| | |
| | | </el-button> |
| | | <el-button type="primary" :disabled="this.transferTaskSelection.length==0" v-if="permission.manual_dispatch" plain @click="reassign(1)">手动派工 |
| | | </el-button> |
| | | <el-button type="primary" :disabled="this.transferTaskSelection.length==0" plain @click="reassign(0)">重新指派</el-button> |
| | | <el-button type="primary" :disabled="this.transferTaskSelection.length==0" plain @click="reassign(0)">转派</el-button> |
| | | <el-button type="primary" :disabled="this.transferTaskSelection.length==0" v-if="permission.batch_approve" plain @click="reassign(3)">批量审批 |
| | | </el-button> |
| | | </template> |
| | | <template #menu="scope"> |
| | | <el-button type="primary" text size="default" @click.stop="handleAction(scope.row, scope.index)"> |
| | | {{scope.row.taskDefinitionKey === 'teamLeaderTask' ? '派工' : '审批'}} |
| | | {{approveButtonText(scope.row.taskDefinitionKey)}} |
| | | </el-button> |
| | | </template> |
| | | </avue-crud> |
| | |
| | | <el-drawer title="审批" append-to-body v-model="approveBox" size="100%" v-if="approveBox"> |
| | | <div class="approve-box"> |
| | | <div class="left"> |
| | | <TodolistLeft :row="row" @selection-change="selectionChange" /> |
| | | <TodolistLeft ref="todolistLeft" :row="row" @selection-change="selectionChange" /> |
| | | </div> |
| | | <div class="right"> |
| | | <TodolistRightTop :row="row" /> |
| | |
| | | { label: '驳回', value: 'N' }, |
| | | ], |
| | | rules: [{ required: true, message: '请选择审批结果', trigger: 'blur' }], |
| | | },/* |
| | | { |
| | | label: '发送给', |
| | | prop: 'assignee', |
| | | type: 'select', |
| | | props: { |
| | | label: 'name', |
| | | value: 'id', |
| | | }, |
| | | display: true, |
| | | filterable: true, |
| | | span: 24, |
| | | disabled: false, |
| | | dicData: [ |
| | | |
| | | ], |
| | | |
| | | },*/ |
| | | }, |
| | | { |
| | | label: '发送给', |
| | | prop: 'assignee', |
| | |
| | | span: 24, |
| | | prop: 'comment', |
| | | type: 'textarea', |
| | | // rules: [{ required: true, message: '请输入审批意见', trigger: 'blur' }], |
| | | rules: [ |
| | | { |
| | | validator: (rule, value, callback) => { |
| | |
| | | }); |
| | | }, |
| | | methods: { |
| | | |
| | | approveButtonText(taskDefinitionKey){ |
| | | let lower = taskDefinitionKey.toLowerCase(); |
| | | if(taskDefinitionKey === 'teamLeaderTask') { |
| | | return '派工' |
| | | }else if(taskDefinitionKey == 'unlockProgramConfirm') { |
| | | //解锁,编制复核 |
| | | return '复核' |
| | | }else if(taskDefinitionKey == 'programMgrConfirm') { |
| | | //固化,程序管理员确认 |
| | | return '确认' |
| | | }else if(lower.indexOf('program')>-1) { |
| | | return '编制' |
| | | }else if(lower.indexOf('check')>-1) { |
| | | return '校对' |
| | | }else if(lower.indexOf('useable')>-1) { |
| | | return '检查' |
| | | }else{ |
| | | return '审批' |
| | | } |
| | | }, |
| | | setApproveBtn (row) { // 设置审批结果的状态 |
| | | // 1.审批界面radio文本修改,普通节点的2个radio文本 通过(approve=Y),不通过(现在的驳回)(approve=N) |
| | | |
| | |
| | | this.optionApprove.column[1].disabled = false; |
| | | if (["check", 'cureCheckTask','repalceCheckTask','appendCheckTask'].includes(row.taskDefinitionKey)) {// 校对节点 |
| | | this.formApprove.assignee = row.variables.senior; |
| | | } else if (["programmingTask",'cureProgramTask','repalceProgrammingTask','appendProgrammingTask'].includes(row.taskDefinitionKey)) {// 编制节点 |
| | | } else if (["programmingTask",'cureProgramTask','replaceProgrammingTask','appendProgrammingTask'].includes(row.taskDefinitionKey)) {// 编制节点 |
| | | this.formApprove.assignee = row.variables.checker; |
| | | } else if (row.taskDefinitionKey == "teamLeaderTask") {// 任务派工(组长) |
| | | this.optionApprove.column[1].disabled = false; |
| | |
| | | //根据在线文档34行,'发送给'是禁用,但有默认选项 |
| | | this.optionApprove.column[1].disabled = true; |
| | | |
| | | if (["approveTask", 'seniorApproveTask','replaceApprove','unlockApproveTask','appendApproveTask'].includes(row.taskDefinitionKey)) { |
| | | if (["approveTask", 'seniorApproveTask','replaceApprove','appendApproveTask'].includes(row.taskDefinitionKey)) { |
| | | //审批节点,不通过给编制:编制是责任人,给实际编程员 |
| | | //this.formApprove.assignee = row.variables.programmer; |
| | | this.formApprove.assignee = row.variables.actProgrammer;//给实际编程员 |
| | | }else if(['unlockApproveTask'].includes(row.taskDefinitionKey)){ |
| | | //解锁高师审批节点,上一步是编程 |
| | | this.formApprove.assignee = row.variables.programmer;//给主管工艺 |
| | | } else if(["check", 'cureCheckTask','repalceCheckTask','appendCheckTask'].includes(row.taskDefinitionKey)){ |
| | | //校对节点,上一步是编程 |
| | | //this.formApprove.assignee = row.variables.programmer; |
| | |
| | | }else if(["confirmIsUseableTask"].includes(row.taskDefinitionKey)) { |
| | | //判断是否可用节点,不可用,给编制 |
| | | this.formApprove.assignee = row.variables.programmer; |
| | | }if(['teamLeaderTask','repalceProgrammingTask','unlockProgramConfirm'].includes(row.taskDefinitionKey)){ |
| | | }if(['teamLeaderTask','replaceProgrammingTask','unlockProgramConfirm'].includes(row.taskDefinitionKey)){ |
| | | //初始节点不通过就是结束流程,处理人为空 |
| | | this.formApprove.assignee = ''; |
| | | } |
| | |
| | | //console.log('handleAction', row, index); |
| | | }, |
| | | handleSubmit(form, done) { |
| | | if(this.row.taskDefinitionKey === 'programmingTask') { |
| | | // if(this.applist.length !== 1) { |
| | | // done(); |
| | | // return this.$message.success('请选择1个程序'); |
| | | // } |
| | | |
| | | |
| | | //this.$alert(this.$refs.todolistLeft.programOnMachine) |
| | | //done(); |
| | | //return; |
| | | let programOnMachine = 'N' |
| | | if(this.row.taskDefinitionKey==='programmingTask'){ |
| | | programOnMachine = this.$refs.todolistLeft.programOnMachine?'Y':'N'; |
| | | } |
| | | approve({ |
| | | ...this.formApprove, |
| | | taskId: this.row.taskId, |
| | | processInstanceId: this.row.processInstanceId, |
| | | // programIds: this.row.taskDefinitionKey === 'programmingTask' ? this.applist.map(v => v.id).join(',') : '', |
| | | programOnMachine: programOnMachine |
| | | }).then(res => { |
| | | if(res.data.code !== 200) { |
| | | this.$message.error(res.data.msg); |