|
|
@@ -18,16 +18,25 @@
|
|
|
@row-dblclick="handleRowDblclick"
|
|
|
>
|
|
|
</ibps-crud>
|
|
|
+ <makeUpEdit
|
|
|
+ v-if="showMakeUpEdit"
|
|
|
+ :visible.sync="showMakeUpEdit"
|
|
|
+ :params="bukaInfo"
|
|
|
+ :readonly="readonly"
|
|
|
+ @close="() => {closeBuKaDialog()}"
|
|
|
+ />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import { saveAttendanceReissue, saveAttendanceDetail, getAttendanceDetail } from '@/api/business/attendance'
|
|
|
import ActionUtils from '@/utils/action'
|
|
|
import FixHeight from '@/mixins/height'
|
|
|
-import IbpsExport from '@/plugins/export'
|
|
|
-import color from '@/store/modules/ibps/modules/color'
|
|
|
|
|
|
export default {
|
|
|
+ components: {
|
|
|
+ makeUpEdit: () => import('./makeUpEdit')
|
|
|
+ },
|
|
|
mixins: [FixHeight],
|
|
|
data () {
|
|
|
const { userList = [], deptList = [] } = this.$store.getters || {}
|
|
|
@@ -45,6 +54,8 @@ export default {
|
|
|
currentPage: 1,
|
|
|
limit: 20
|
|
|
},
|
|
|
+ showMakeUpEdit: false,
|
|
|
+ bukaInfo: {},
|
|
|
sorts: {},
|
|
|
listConfig: {
|
|
|
toolbars: [
|
|
|
@@ -62,21 +73,23 @@ export default {
|
|
|
]
|
|
|
},
|
|
|
columns: [
|
|
|
- { prop: 'bianZhiRen', label: '申请人', tags: userOption, width: 80 },
|
|
|
- { prop: 'bianZhiShiJian', label: '申请时间', dateFormat: 'yyyy-MM-dd HH:mm', sortable: 'custom', width: 140 },
|
|
|
+ { prop: 'bian_zhi_ren_', label: '申请人', tags: userOption, width: 80 },
|
|
|
+ { prop: 'bian_zhi_shi_jian', label: '申请时间', dateFormat: 'yyyy-MM-dd HH:mm', sortable: 'custom', width: 140 },
|
|
|
// { prop: 'shenHeRen', label: '审核人', tags: userOption, dataType: 'stringArray', separator: ',', minWidth: 100 },
|
|
|
// { prop: 'shenHeShiJian', label: '审核时间', dateFormat: 'yyyy-MM-dd HH:mm', sortable: 'custom', width: 140 },
|
|
|
- { prop: 'zhuangTai', label: '状态', width: 90 },
|
|
|
- { prop: 'buKaRiQi', label: '补卡日期', dateFormat: 'yyyy-MM-dd', sortable: 'custom', width: 80 },
|
|
|
- { prop: 'buKaShiJian', label: '补卡时间', dateFormat: 'HH:mm', sortable: 'custom', width: 80 },
|
|
|
- { prop: 'buKaBanCi', label: '补卡班次', width: 80 },
|
|
|
- { prop: 'buKaShiYou', label: '补卡事由', width: 300 },
|
|
|
- { prop: 'fuJian', label: '说明附件', width: 150 }
|
|
|
+ { prop: 'zhuang_tai_', label: '状态', width: 90 },
|
|
|
+ { prop: 'bu_ka_ri_qi_', label: '补卡日期', dateFormat: 'yyyy-MM-dd', sortable: 'custom', width: 80 },
|
|
|
+ { prop: 'bu_ka_shi_jian_', label: '补卡时间', dateFormat: 'HH:mm', sortable: 'custom', width: 80 },
|
|
|
+ { prop: 'bu_ka_ban_ci_', label: '补卡班次', width: 80 },
|
|
|
+ { prop: 'bu_ka_shi_you_', label: '补卡事由', width: 300 },
|
|
|
+ { prop: 'fu_jian_', label: '说明附件', width: 150 }
|
|
|
],
|
|
|
rowHandle: {
|
|
|
effect: 'default',
|
|
|
// effect: 'display',
|
|
|
actions: [
|
|
|
+ { key: 'agree', label: '同意', type: 'success', icon: 'ibps-icon-check' },
|
|
|
+ { key: 'disagree', label: '不同意', type: 'danger', icon: 'ibps-icon-close' },
|
|
|
{ key: 'detail', label: '详情', type: 'primary', icon: 'ibps-icon-list-alt' }
|
|
|
]
|
|
|
}
|
|
|
@@ -120,6 +133,7 @@ export default {
|
|
|
const { first, second } = this.$store.getters.level || {}
|
|
|
const searchParam = this.$refs['crud'] ? this.$refs['crud'].getSearcFormData() : {}
|
|
|
searchParam['Q^di_dian_^S'] = second || first
|
|
|
+ searchParam['Q^shen_he_ren_^S'] = this.$store.getters.userId
|
|
|
return ActionUtils.formatParams(searchParam, this.pagination, this.sorts)
|
|
|
},
|
|
|
getSearchSql () {
|
|
|
@@ -173,17 +187,98 @@ export default {
|
|
|
},
|
|
|
|
|
|
// 操作处理
|
|
|
- handleAction (command, _, selection) {
|
|
|
+ handleAction (command, position, selection, data) {
|
|
|
switch (command) {
|
|
|
case 'search':
|
|
|
ActionUtils.setFirstPagination(this.pagination)
|
|
|
this.loadData()
|
|
|
break
|
|
|
+ case 'agree':
|
|
|
+ this.handleAgree(command, data)
|
|
|
+ break
|
|
|
+ case 'disagree':
|
|
|
+ this.handleAgree(command, data)
|
|
|
+ break
|
|
|
+ case 'detail':
|
|
|
+ this.handleEdit(command, data)
|
|
|
+ break
|
|
|
}
|
|
|
},
|
|
|
- addData () {
|
|
|
-
|
|
|
+ /* 点击单条同意/不同意
|
|
|
+ */
|
|
|
+ async handleAgree (key, data) {
|
|
|
+ const self = this
|
|
|
+ let status = '未通过'
|
|
|
+ if (key === 'agree') {
|
|
|
+ status = '已通过'
|
|
|
+ }
|
|
|
+ const submitData = {
|
|
|
+ banCiZhuangTai: data.ban_ci_zhuang_tai || '',
|
|
|
+ bianZhiRen: data.bian_zhi_ren_ || '',
|
|
|
+ bianZhiShiJian: data.bian_zhi_shi_jian || '',
|
|
|
+ buKaBanCi: data.bu_ka_ban_ci_ || '',
|
|
|
+ buKaRiQi: data.bu_ka_ri_qi_ || '',
|
|
|
+ buKaShiJian: data.bu_ka_shi_jian_ || '',
|
|
|
+ buKaShiYou: data.bu_ka_shi_you_ || '',
|
|
|
+ createBy: data.create_by_ || '',
|
|
|
+ createTime: data.create_time_ || '',
|
|
|
+ diDian: data.di_dian_ || '',
|
|
|
+ fuJian: data.fu_jian_ || '',
|
|
|
+ id: data.id_ || '',
|
|
|
+ ip: data.ip_ || '',
|
|
|
+ kaoQinId: data.kao_qin_id_ || '',
|
|
|
+ paiBanId: data.pai_ban_id_ || '',
|
|
|
+ paiBanJiLuId: data.pai_ban_ji_lu_id_ || '',
|
|
|
+ shenHeRen: data.shen_he_ren_ || '',
|
|
|
+ shenHeShiJian: data.shen_he_shi_jian_ || '',
|
|
|
+ shenHeYiJian: data.shen_he_yi_jian_ || '',
|
|
|
+ tenantId: data.tenant_id_ || '',
|
|
|
+ updateBy: data.update_by_ || '',
|
|
|
+ updateTime: data.update_time_ || '',
|
|
|
+ zhuangTai: status
|
|
|
+ }
|
|
|
+ // 更新补卡数据
|
|
|
+ saveAttendanceReissue(submitData).then((res) => {
|
|
|
+ self.$message.success(`操作成功`)
|
|
|
+ self.loadData() // 刷新列表
|
|
|
+ if (key === 'agree') {
|
|
|
+ // 更新考勤表
|
|
|
+ self.updateAttendanceDetail(submitData)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 更新考勤
|
|
|
+ updateAttendanceDetail (submitData) {
|
|
|
+ const self = this
|
|
|
+ getAttendanceDetail({ id: submitData.kaoQinId }).then((res) => { // 获取考勤明细
|
|
|
+ const updateData = res.data
|
|
|
+ if (submitData.buKaBanCi.includes('上班')) { // 更新上班数据
|
|
|
+ updateData.zhuangTai1 = '正常'
|
|
|
+ updateData.daKaShiJian1 = submitData.buKaShiJian
|
|
|
+ } else { // 更新下班数据
|
|
|
+ updateData.zhuangTai2 = '正常'
|
|
|
+ updateData.daKaShiJian2 = submitData.buKaShiJian
|
|
|
+ }
|
|
|
+ saveAttendanceDetail(updateData)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 处理编辑
|
|
|
+ */
|
|
|
+ async handleEdit (key, data) {
|
|
|
+ this.params = {
|
|
|
+ data,
|
|
|
+ action: key === 'detail' ? 'view' : 'edit'
|
|
|
+ }
|
|
|
+ this.bukaInfo = data
|
|
|
+ this.readonly = key === 'detail'
|
|
|
+ this.showMakeUpEdit = true
|
|
|
+ },
|
|
|
+ closeBuKaDialog () {
|
|
|
+ this.showMakeUpEdit = false
|
|
|
+ this.loadData()
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
</script>
|