feat(hrm): 统一审批状态显示并添加外出条打印功能
- 在请假、外出申请页面统一审批状态显示为标签样式 - 将审批状态字段从approveStatus改为approvalStatus - 添加外出条打印组件,支持PDF格式打印 - 优化审批状态标签颜色和文本显示 - 修复已撤销状态显示错误问题
This commit is contained in:
@@ -56,7 +56,8 @@
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div style="text-align: center;">
|
||||
<el-button type="primary" @click="handleSubmit" v-loading="loading">{{ form.applyId ? '更新申请' : '提交申请' }}</el-button>
|
||||
<el-button type="primary" @click="handleSubmit" v-loading="loading">{{ form.leaveId ? '更新申请' : '提交申请'
|
||||
}}</el-button>
|
||||
<el-button @click="handleReset">重置表单</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
@@ -68,7 +69,13 @@
|
||||
<el-button style="float: right;" icon="el-icon-refresh" @click="getList">刷新</el-button>
|
||||
</template>
|
||||
<el-table v-loading="loading" :data="leaveRequestList">
|
||||
<el-table-column label="申请状态" align="center" prop="approvalStatus"></el-table-column>
|
||||
<el-table-column prop="approvalStatus" label="审批状态" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="getStatusTagType(scope.row.approvalStatus)">
|
||||
{{ getStatusText(scope.row.approvalStatus) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="请假类型" align="center" prop="leaveType">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.hrm_leave_type" :value="scope.row.leaveType" />
|
||||
@@ -299,6 +306,27 @@ export default {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 获取审批状态对应的标签类型
|
||||
getStatusTagType(status) {
|
||||
const typeMap = {
|
||||
'待审批': 'warning',
|
||||
'已同意': 'success',
|
||||
'已驳回': 'danger',
|
||||
'已撤销': 'info',
|
||||
}
|
||||
return typeMap[status] || 'default'
|
||||
},
|
||||
|
||||
// 获取审批状态的中文文本
|
||||
getStatusText(status) {
|
||||
const textMap = {
|
||||
'待审批': '待审批',
|
||||
'已同意': '已同意',
|
||||
'已驳回': '已驳回',
|
||||
'已撤销': '已撤销',
|
||||
}
|
||||
return textMap[status] || '未知状态'
|
||||
},
|
||||
// 核心新增:自动计算请假天数的方法
|
||||
calculateLeaveDays() {
|
||||
const { startTime, endTime } = this.form;
|
||||
|
||||
Reference in New Issue
Block a user