Browse Source

调班bug修复

zhonghuizhen 1 year ago
parent
commit
d01de658eb

+ 5 - 4
src/views/business/​scheduleManage/adjust.vue

@@ -33,11 +33,10 @@
 </template>
 
 <script>
-import { queryAdjustment, removeAdjustment, saveAdjustment } from '@/api/business/schedule'
+import { queryAdjustment, removeAdjustment, sendMessage, saveAdjustment } from '@/api/business/schedule'
 import { stateType } from '@/views/constants/schedule'
 import ActionUtils from '@/utils/action'
 import FixHeight from '@/mixins/height'
-import action from '@/business/platform/bpmn/form/action';
 
 export default {
     components: {
@@ -79,7 +78,7 @@ export default {
                 columns: [
                     { prop: 'createBy', label: '申请人', tags: userOption, width: 100 },
                     { prop: 'createTime', label: '申请时间', dateFormat: 'yyyy-MM-dd HH:mm', sortable: 'custom', width: 140 },
-                    { prop: 'executor', label: '审批人', tags: userOption, width: 100 },
+                    { prop: 'executor', label: '审批人', tags: userOption, dataType: 'stringArray', separator: ',', minWidth: 100 },
                     { prop: 'executeDate', label: '审批时间', dateFormat: 'yyyy-MM-dd HH:mm', sortable: 'custom', width: 140 },
                     { prop: 'reason', label: '调班原因', width: 150 },
                     { prop: 'status', label: '状态', tags: stateType, width: 100 },
@@ -243,6 +242,8 @@ export default {
                 await this.$common.request('update', sonUpdateParams) // 更新子表
                 ActionUtils.successMessage()
                 this.search()
+                // 告知审核人该单已取消
+                // sendMessage(data, data.createBy)
             }).catch((e) => { console.error(e) })
             /*
             saveAdjustment(data).then(() => {
@@ -262,7 +263,7 @@ export default {
             }).catch(() => {})
         },
         handleRowDblclick (row) {
-            this.handleEdit(row, 'detail')
+            // this.handleEdit(row, 'detail')
         }
     }
 }

+ 16 - 7
src/views/business/​scheduleManage/adjustVerify.vue

@@ -83,7 +83,7 @@ export default {
                 columns: [
                     { prop: 'createBy', label: '申请人', tags: userOption, width: 100 },
                     { prop: 'createTime', label: '申请时间', dateFormat: 'yyyy-MM-dd HH:mm', sortable: 'custom', width: 140 },
-                    { prop: 'executor', label: '审批人', tags: userOption, width: 100 },
+                    { prop: 'executor', label: '审批人', tags: userOption, dataType: 'stringArray', separator: ',', minWidth: 100 },
                     { prop: 'executeDate', label: '审批时间', dateFormat: 'yyyy-MM-dd HH:mm', sortable: 'custom', width: 140 },
                     { prop: 'reason', label: '调班原因', width: 150 },
                     { prop: 'status', label: '状态', tags: stateType, width: 100 },
@@ -177,12 +177,14 @@ export default {
 
             if (this.isRoleFilter()) { // 超级管理员和高权限角色不做审批人过滤
             } else {
-                /* 审批人过滤
+                // 审批人过滤
                 const { userId } = this.$store.getters || ''
                 if (userId) {
-                    paramjson['Q^executor_^S'] = userId
+                    parameters[0].parameters.push({
+                        'key': 'Q^executor_^SL',
+                        'value': userId
+                    })
                 }
-                */
             }
             const param = {
                 parameters: parameters,
@@ -269,8 +271,11 @@ export default {
         sendMsg (data) {
             switch (data.status) {
                 case '待审批':
-                    sendMessage(data, data.executor || '')
-                    break
+                { const executorList = data.executor.split(',')
+                    executorList.forEach(el => {
+                        sendMessage(data, el)
+                    })
+                    break }
                 case '已拒绝':
                 { // 已拒绝时视情况发送给审核人申请人(审核时拒绝消息对象需排除自己)
                     const parties = data.adjustmentDetailPoList.map(obj => obj.party)
@@ -387,6 +392,10 @@ export default {
             let uparr = []
             let sonuparr = []
             data.forEach((el) => {
+                if (el.status === '已通过' || el.status === '已拒绝') {
+                    // this.$message.warning('所选数据中有已通过/已拒绝的申请单,请取消选择!')
+                    return
+                }
                 el.status = key === 'massAgree' ? this.isNextStep(el) : '已拒绝'
                 uparr.push({
                     where: {
@@ -479,7 +488,7 @@ export default {
          *
          */
         handleRowDblclick (row) {
-            this.handleEdit(row, 'detail')
+            // this.handleEdit(row, 'detail')
         }
     }
 }

+ 12 - 7
src/views/business/​scheduleManage/components/adjust-edit.vue

@@ -413,7 +413,8 @@ export default {
                     startDate: data.startDate,
                     scheduleShift: config.scheduleShift,
                     scheduleStaff: self.userList.filter(u => config.scheduleStaff.includes(u.userId) && u.userId !== this.userId),
-                    shiftList: data.staffScheduleDetailPoList
+                    shiftList: data.staffScheduleDetailPoList,
+                    executor: JSON.stringify(config.approver) || ''
                 }
                 self.scheduleOptions = self.scheduleList.map(s => ({
                     label: s.title,
@@ -442,7 +443,8 @@ export default {
                     endDate: schedule.endDate,
                     scheduleShift: config.scheduleShift,
                     scheduleStaff: self.userList.filter(u => config.scheduleStaff.includes(u.userId) && u.userId !== self.userId),
-                    shiftList: schedule.staffScheduleDetailPoList
+                    shiftList: schedule.staffScheduleDetailPoList,
+                    executor: JSON.stringify(config.approver) || ''
                 }
                 self.currentShift = self.scheduleInfo.shiftList.find(s => s.userId === self.userId) // 当前排班中我的排版表
                 if (!self.currentShift) {
@@ -750,10 +752,10 @@ export default {
                     const beforeAdjust = i.beforeAdjust.map(item => `【${item}】`).join('')
                     const afterAdjust = i.afterAdjust.map(item => `【${item}】`).join('')
                     let desc = ''
-                    if (i.party) {
+                    if (i.party && i.party !== this.$store.getters.userId) {
                         desc = `${i.beforeDate}班次${beforeAdjust}与${partyName}${i.afterDate}班次${afterAdjust}调换`
                     } else {
-                        desc = `${i.beforeDate}班次${beforeAdjust}调换到${i.afterDate}`
+                        desc = `${i.beforeDate}班次${beforeAdjust}调换到${i.afterAdjust}`
                     }
                     result.push(desc)
                 })
@@ -776,8 +778,7 @@ export default {
                     if (this.rowValidate(this.formData.adjustList[this.formData.adjustList.length - 1], this.formData.adjustList.length)) {
                         return
                     }
-
-                    statusVal = adjustList.some(i => this.$utils.isNotEmpty(i.party)) ? '待审核' : '待审批'
+                    statusVal = adjustList.some((i) => { return this.$utils.isNotEmpty(i.party) && this.reScheduleValue !== 'paiban' }) ? '待审核' : '待审批'
                 }
                 // return
                 const submitData = {
@@ -788,6 +789,7 @@ export default {
                     diDian: second || first,
                     overview: getOverview(adjustList),
                     status: statusVal,
+                    executor: this.scheduleInfo.executor.replace(/\[|\]|\"/g, '').replace(/,/g, ',') || '',
                     adjustmentDetailPoList: adjustList.map(i => ({
                         recordId: i.recordId,
                         beforeDate: i.beforeDate,
@@ -807,7 +809,10 @@ export default {
                         sendMessage(submitData, el)
                     })
                 } else if (statusVal === '待审批') {
-                    sendMessage(submitData, submitData.executor || '')
+                    const executorList = submitData.executor.split(',')
+                    executorList.forEach(el => {
+                        sendMessage(submitData, el)
+                    })
                 }
             })
         },