| | |
| | | @selection-change="selectionTransferTask"> |
| | | <template #menu-left> |
| | | |
| | | <el-button type="primary" v-if="permission.auto_dispatch" plain @click="reassign(2)">自动派工 |
| | | <el-button type="primary" :disabled="this.transferTaskSelection.length==0" v-if="permission.auto_dispatch" plain @click="reassign(2)">自动派工 |
| | | </el-button> |
| | | <el-button type="primary" v-if="permission.manual_dispatch" plain @click="reassign(1)">手动派工 |
| | | <el-button type="primary" :disabled="this.transferTaskSelection.length==0" v-if="permission.manual_dispatch" plain @click="reassign(1)">手动派工 |
| | | </el-button> |
| | | <el-button type="primary" plain @click="reassign(0)">重新指派</el-button> |
| | | <el-button type="primary" v-if="permission.batch_approve" plain @click="reassign(3)">批量审批 |
| | | <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"> |
| | |
| | | </div> |
| | | </el-drawer> |
| | | </basic-container> |
| | | <div> |
| | | <!--<top-todo ref="topTodoComponent" />--> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { getList, approve, getAssignee,reassgin,manualDispatch,autoDispatch,getPrevius,batchApprove } from '@/api/flow/todolist'; |
| | | import { mapGetters } from 'vuex'; |
| | |
| | | import TodolistLeft from './components/TodolistLeft.vue'; |
| | | import TodolistRightTop from './components/TodolistRightTop.vue'; |
| | | import processTrace from './components/process-trace.vue'; |
| | | |
| | | //import top-todo from '../../page/index/LoadGood.vue'; |
| | | export default { |
| | | components: { |
| | | TodolistLeft, |
| | |
| | | activeName: 'approve', |
| | | applist: [], |
| | | assigneeData: [], |
| | | allAssigneeData: [], |
| | | managerAssigneeData: [],//数控管理员角色的审批用户 |
| | | row: {}, |
| | | approveBox: false, |
| | | formApprove: { |
| | |
| | | }; |
| | | }, |
| | | watch: { |
| | | // 'form.category'() { |
| | | // const category = func.toInt(this.form.category); |
| | | // this.$refs.crud.option.column.filter(item => { |
| | | // if (item.prop === 'path') { |
| | | // item.rules[0].required = category === 1; |
| | | // } |
| | | // if (item.prop === 'isOpen') { |
| | | // item.disabled = category === 2; |
| | | // } |
| | | // }); |
| | | // }, |
| | | |
| | | 'formApprove.approve'(val) { |
| | | this.setAssignee(this.row, val); |
| | | // if(val === 'Y' && ['confirmIsUseableTask'].includes(this.row.taskDefinitionKey) && this.row.variables.isProcessEditionSame=='N') { |
| | | // // this.optionApprove.column[2].display = true; // 显示工序版次 |
| | | // } else { |
| | | // this.optionApprove.column[2].display = false; // 隐藏工序版次 |
| | | // } |
| | | |
| | | }, |
| | | 'reassignForm.approve'(val) { |
| | |
| | | }, |
| | | }, |
| | | mounted() { |
| | | getAssignee(this.row).then(res => { |
| | | this.assigneeData = res.data.data; |
| | | this.optionApprove.column[1].dicData = this.assigneeData; |
| | | this.reassignOption.column[1].dicData = this.assigneeData; |
| | | }) |
| | | //this.setApproveBtn(row) |
| | | getAssignee({ |
| | | taskId: 0, |
| | | }).then(res => { |
| | | //if(row.taskDefinitionKey === '') |
| | | this.assigneeData = res.data.data; |
| | | this.reassignOption.column[1].dicData = this.assigneeData; |
| | | }); |
| | | }, |
| | | methods: { |
| | | // 设置审批结果的状态 |
| | |
| | | this.optionApprove.column[0].dicData = [ |
| | | { label: '通过', value: 'Y' }, |
| | | { label: '结束', value: 'N' }, |
| | | ]; |
| | | break; |
| | | case 'appendProgrammingTask': // 补充流程的 编程节点 |
| | | this.optionApprove.column[0].dicData = [ |
| | | { label: '通过', value: 'Y' }, |
| | | { label: '结束', value: 'E' }, |
| | | ]; |
| | | break; |
| | | case 'cureProgramTask': // 固化编制,可以通过(给校对);不通过N(给程序管理员) |
| | |
| | | } |
| | | }, |
| | | setAssignee (row, approve) { |
| | | |
| | | if (["cureProgramTask"].includes(row.taskDefinitionKey)) { |
| | | if(approve === 'N'){ |
| | | this.optionApprove.column[1].dicData = this.managerAssigneeData; |
| | | }else{ |
| | | //this.assigneeData = this.allAssigneeData; |
| | | this.optionApprove.column[1].dicData = this.allAssigneeData; |
| | | } |
| | | } |
| | | if (approve === 'Y') {//审批通过的情况 |
| | | |
| | | this.optionApprove.column[1].disabled = false; |
| | | if (["check", 'cureCheckTask','repalceCheckTask'].includes(row.taskDefinitionKey)) {// 校对节点 |
| | | if (["check", 'cureCheckTask','repalceCheckTask','appendCheckTask'].includes(row.taskDefinitionKey)) {// 校对节点 |
| | | this.formApprove.assignee = row.variables.senior; |
| | | } else if (["programmingTask",'cureProgramTask','repalceProgrammingTask'].includes(row.taskDefinitionKey)) {// 编制节点 |
| | | } else if (["programmingTask",'cureProgramTask','repalceProgrammingTask','appendProgrammingTask'].includes(row.taskDefinitionKey)) {// 编制节点 |
| | | this.formApprove.assignee = row.variables.checker; |
| | | } else if (row.taskDefinitionKey == "teamLeaderTask") {// 任务派工(组长) |
| | | this.optionApprove.column[1].disabled = false; |
| | | this.formApprove.assignee = row.variables.programmer |
| | | } else if (row.taskDefinitionKey == "confirmIsUseableTask") {//判断程序是否可用节点,都是发送给校对 |
| | | this.formApprove.assignee = row.variables.checker |
| | | } else if (["approveTask", 'seniorApproveTask','replaceApprove','unlockApproveTask'].includes(row.taskDefinitionKey)) {// 高师审核 |
| | | } else if (["approveTask", 'seniorApproveTask','replaceApprove','unlockApproveTask','appendApproveTask'].includes(row.taskDefinitionKey)) {// 高师审核 |
| | | this.optionApprove.column[1].disabled = true;//最后一个节点"发送给" 禁用 |
| | | this.formApprove.assignee = ''; // 如果是通过流程直接结束 |
| | | }else if('unlockProgramConfirm'==row.taskDefinitionKey){ |
| | |
| | | //根据在线文档34行,'发送给'是禁用,但有默认选项 |
| | | this.optionApprove.column[1].disabled = true; |
| | | |
| | | if (["approveTask", 'seniorApproveTask','replaceApprove','unlockApproveTask'].includes(row.taskDefinitionKey)) { |
| | | if (["approveTask", 'seniorApproveTask','replaceApprove','unlockApproveTask','appendApproveTask'].includes(row.taskDefinitionKey)) { |
| | | //审批节点,不通过给编制:编制是责任人,不给校对了 |
| | | this.formApprove.assignee = row.variables.programmer; |
| | | } else if(["check", 'cureCheckTask','repalceCheckTask'].includes(row.taskDefinitionKey)){ |
| | | } else if(["check", 'cureCheckTask','repalceCheckTask','appendCheckTask'].includes(row.taskDefinitionKey)){ |
| | | //校对节点,上一步是编程 |
| | | this.formApprove.assignee = row.variables.programmer; |
| | | }else if (["programmingTask"].includes(row.taskDefinitionKey)) { |
| | |
| | | //固化编制节点,不通过给数控管理员 |
| | | //TODO 按找角色定位给其中一个数控管理员 |
| | | this.optionApprove.column[1].disabled = false; |
| | | for(var i=0;i<this.assigneeData.length;i++){ |
| | | if(this.assigneeData[i].manager == true){ |
| | | this.formApprove.assignee = this.assigneeData[i].id; |
| | | break; |
| | | } |
| | | } |
| | | //this.formApprove.assignee = ''; |
| | | }else if(["confirmIsUseableTask"].includes(row.taskDefinitionKey)) { |
| | | //判断是否可用节点,不可用,给编制 |
| | |
| | | this.transferTaskSelection = list; |
| | | }, |
| | | reassign(val) {// 重新指派 |
| | | |
| | | this.reassignType = val; |
| | | if (this.transferTaskSelection.length === 0) { |
| | | this.$message.warning('请选择需要操作的任务'); |
| | |
| | | } |
| | | }, |
| | | handleAction(row, index) { |
| | | getAssignee({ |
| | | taskId: row.taskId, |
| | | }).then(res => { |
| | | //if(row.taskDefinitionKey === '') |
| | | this.assigneeData = res.data.data; |
| | | this.allAssigneeData = res.data.data; |
| | | //初始化数控管理员的数组 |
| | | for(var i=0;i<this.allAssigneeData.length;i++){ |
| | | if(this.allAssigneeData[i].manager == true){ |
| | | this.managerAssigneeData[this.managerAssigneeData.length] = this.allAssigneeData[i]; |
| | | } |
| | | } |
| | | this.optionApprove.column[1].dicData = this.assigneeData; |
| | | this.reassignOption.column[1].dicData = this.assigneeData; |
| | | }) |
| | | this.formApprove = { |
| | | comment: '', |
| | | approve: 'Y', // 默认同 |
| | | } |
| | | this.approveBox = true; |
| | | this.row = row |
| | | |
| | | this.setAssignee(row, this.formApprove.approve); |
| | | this.setApproveBtn(row); |
| | | console.log('handleAction', row, index); |
| | |
| | | } |
| | | |
| | | .left { |
| | | width: 400px; |
| | | width: 40%; |
| | | } |
| | | |
| | | .right { |