| | |
| | | </el-button> |
| | | <el-button type="primary" v-if="permission.auto_dispatch" plain @click="reassign(2)">自动派工 |
| | | </el-button> |
| | | <el-button type="primary" 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)">审批 |
| | | <el-button type="primary" text size="default" @click.stop="handleAction(scope.row, scope.index)"> |
| | | {{scope.row.taskDefinitionKey === 'teamLeaderTask' ? '派工' : '审批'}} |
| | | </el-button> |
| | | </template> |
| | | </avue-crud> |
| | |
| | | </div> |
| | | <div class="right"> |
| | | <TodolistRightTop :row="row" /> |
| | | <avue-form ref="form" :option="optionApprove" v-model="formApprove" @submit="handleSubmit" /> |
| | | <el-tabs |
| | | type="card" |
| | | class="demo-tabs" |
| | | v-model="activeName" |
| | | > |
| | | <el-tab-pane label="审批" name="approve"> |
| | | <avue-form ref="form" :option="optionApprove" v-model="formApprove" @submit="handleSubmit" /> |
| | | </el-tab-pane> |
| | | <el-tab-pane label="流程轨迹" name="log"> |
| | | <processTrace :item="row" v-if="activeName==='log'"></processTrace> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | |
| | | </div> |
| | | </div> |
| | | </el-drawer> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { getList, approve, getAssignee,reassgin,manualDispatch,autoDispatch } from '@/api/flow/todolist'; |
| | | import { getList, approve, getAssignee,reassgin,manualDispatch,autoDispatch,getPrevius,batchApprove } from '@/api/flow/todolist'; |
| | | import { mapGetters } from 'vuex'; |
| | | import dayjs from 'dayjs'; |
| | | import TodolistLeft from './components/TodolistLeft.vue'; |
| | | import TodolistRightTop from './components/TodolistRightTop.vue'; |
| | | import processTrace from './components/process-trace.vue'; |
| | | export default { |
| | | components: { |
| | | TodolistLeft, |
| | | TodolistRightTop |
| | | TodolistRightTop, |
| | | processTrace |
| | | }, |
| | | data() { |
| | | return { |
| | | |
| | | activeName: 'approve', |
| | | applist: [], |
| | | assigneeData: [], |
| | | row: {}, |
| | |
| | | emptyBtn: false, |
| | | column: [ |
| | | { |
| | | label: '审批结果', |
| | | prop: 'approve', |
| | | type: 'radio', |
| | | span: 24, |
| | | display: false, |
| | | dicData: [ |
| | | { label: '通过', value: 'Y' }, |
| | | { label: '驳回', value: 'N' }, |
| | | ], |
| | | rules: [{ required: true, message: '请选择审批结果', trigger: 'blur' }], |
| | | }, |
| | | { |
| | | label: '发送给', |
| | | prop: 'newAssigneeId', |
| | | type: 'select', |
| | |
| | | }, |
| | | span: 24, |
| | | disabled: false, |
| | | display: true, |
| | | dicData: [ |
| | | |
| | | ], |
| | |
| | | span: 24, |
| | | prop: 'comment', |
| | | type: 'textarea', |
| | | rules: [{ required: true, message: '请输入审批意见', trigger: 'blur' }], |
| | | // rules: [{ required: true, message: '请输入审批意见', trigger: 'blur' }], |
| | | }, |
| | | ], |
| | | }, |
| | |
| | | // } |
| | | |
| | | }, |
| | | 'reassignForm.approve'(val) { |
| | | if(this.reassignType ===3) { |
| | | if(val === 'Y') { |
| | | this.reassignOption.column[1].disabled = true; |
| | | this.reassignOption.column[1].display = false; |
| | | this.reassignForm.newAssigneeId = ''; |
| | | } else { |
| | | this.reassignOption.column[1].display = false; |
| | | this.reassignOption.column[1].disabled = false; |
| | | this.reassignForm.newAssigneeId = ''; |
| | | } |
| | | } |
| | | |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapGetters(['userInfo', 'permission']), |
| | |
| | | return { |
| | | manual_dispatch: this.validData(this.permission.manual_dispatch, false), |
| | | auto_dispatch: this.validData(this.permission.auto_dispatch, false), |
| | | batch_approve: this.validData(this.permission.batch_approve, true), |
| | | }; |
| | | }, |
| | | }, |
| | |
| | | getAssignee().then(res => { |
| | | this.assigneeData = res.data.data; |
| | | this.optionApprove.column[1].dicData = this.assigneeData; |
| | | this.reassignOption.column[0].dicData = this.assigneeData; |
| | | this.reassignOption.column[1].dicData = this.assigneeData; |
| | | }) |
| | | this.setApproveBtn() |
| | | }, |
| | |
| | | this.formApprove.assignee = '' |
| | | if (["approveTask", 'seniorApproveTask','replaceApprove'].includes(row.taskDefinitionKey)) {// 高师审核 |
| | | this.optionApprove.column[1].disabled = true; |
| | | this.formApprove.assignee = row.varables.assignee; // 如果是通过,则默认指派给自己 |
| | | getPrevius({processInstanceId: row.processInstanceId}).then(res => { |
| | | console.log(res) |
| | | if(res.data.code === 200) { |
| | | |
| | | this.formApprove.assignee = res.data.data // 如果是通过,则默认指派给自己 |
| | | } |
| | | }) |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | }).catch(err => { |
| | | this.$message.success('操作失败'); |
| | | }) |
| | | }).catch(() => { |
| | | // this.$message.info('已取消操作'); |
| | | }); |
| | | } else { |
| | | this.reassignBox = true; |
| | | |
| | | if(val === 3) {//批量审批时 显示通过驳回 |
| | | this.reassignOption.column[0].display = true; |
| | | this.reassignOption.column[0].dicData[1].label = '不通过'; |
| | | this.reassignForm.approve = 'Y'; |
| | | this.reassignForm.newAssigneeId = ''; |
| | | this.reassignOption.column[1].disabled = true; |
| | | this.reassignOption.column[1].display = true; |
| | | } else { |
| | | this.reassignOption.column[0].display = false; |
| | | this.reassignForm.approve = ''; |
| | | |
| | | } |
| | | if(val ===1) { |
| | | this.reassignForm.newAssigneeId = this.transferTaskSelection[0].variables.programmer; |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | confirmButtonText: this.$t('submitText'), |
| | | cancelButtonText: this.$t('cancelText'), |
| | | type: 'warning', |
| | | }).then(() => { |
| | | }).then((res) => { |
| | | console.log(res,'>>>>>>') |
| | | reassgin({ |
| | | ...form, |
| | | taskId: this.transferTaskSelection[0].taskId, |
| | |
| | | this.$message.error('操作失败'); |
| | | done() |
| | | }) |
| | | }).catch(() => { |
| | | console.log('>>>>>>') |
| | | // this.$message.info('已取消操作'); |
| | | done(); |
| | | }); |
| | | |
| | | } else if (this.reassignType === 1) { |
| | |
| | | console.error(err); |
| | | done() |
| | | }) |
| | | }).catch(() => { |
| | | console.log('>>>>>>') |
| | | // this.$message.info('已取消操作'); |
| | | done(); |
| | | }); |
| | | } else if (this.reassignType === 3) { |
| | | this.$confirm('确认要进行批量审批吗?', '', { |
| | | confirmButtonText: this.$t('submitText'), |
| | | cancelButtonText: this.$t('cancelText'), |
| | | type: 'warning', |
| | | }).then(() => { |
| | | batchApprove({ |
| | | assignee: form.newAssigneeId, |
| | | comment: form.comment, |
| | | approve: form.approve, |
| | | taskIds: this.transferTaskSelection.map(v => v.taskId), |
| | | processInstanceIds: this.transferTaskSelection.map(v => v.processInstanceId), |
| | | }).then(res => { |
| | | if(res.data.code !== 200) { |
| | | this.$message.error(res.data.msg); |
| | | return; |
| | | } |
| | | this.$message.success('操作成功'); |
| | | this.reassignBox = false; |
| | | this.$refs?.reassginform?.resetForm(); |
| | | this.onLoad(this.page, this.query); |
| | | done() |
| | | |
| | | }).catch(err => { |
| | | console.error(err); |
| | | done() |
| | | }) |
| | | }).catch(() => { |
| | | console.log('>>>>>>') |
| | | // this.$message.info('已取消操作'); |
| | | done(); |
| | | }); |
| | | } |
| | | |
| | | done(); |
| | | }, |
| | | handleAction(row, index) { |
| | | this.formApprove = { |
| | |
| | | |
| | | .right { |
| | | flex: 1; |
| | | padding: 0 10px; |
| | | } |
| | | } |
| | | </style> |