| | |
| | | </el-button> |
| | | </template> |
| | | <template #menu="scope"> |
| | | <el-button type="primary" text size="default" v-if="permission.flow_model_update" |
| | | @click.stop="handleAction(scope.row, scope.index)">审批 |
| | | <el-button type="primary" text size="default" @click.stop="handleAction(scope.row, scope.index)">审批 |
| | | </el-button> |
| | | </template> |
| | | </avue-crud> |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | |
| | | applist: [], |
| | | assigneeData: [], |
| | | row: {}, |
| | |
| | | span: 24, |
| | | prop: 'comment', |
| | | type: 'textarea', |
| | | rules: [{ required: true, message: '请输入审批意见', trigger: 'blur' }], |
| | | // rules: [{ required: true, message: '请输入审批意见', trigger: 'blur' }], |
| | | rules: [ |
| | | { |
| | | validator: (rule, value, callback) => { |
| | | console.log('-------',this.formApprove) |
| | | if (value === '' && this.formApprove.approve !== 'Y') { |
| | | callback(new Error('请输入备注')); |
| | | } else { |
| | | callback(); |
| | | } |
| | | }, |
| | | trigger: 'blur' |
| | | } |
| | | ] |
| | | }, |
| | | ], |
| | | }, |
| | |
| | | query: {}, |
| | | loading: true, |
| | | option: { |
| | | rowKey: "taskId", |
| | | addBtn: false, |
| | | editBtn: false, |
| | | delBtn: false, |
| | |
| | | ], |
| | | }, |
| | | { |
| | | label: '任务名称', |
| | | label: '流程名称', |
| | | prop: 'processDefinitionName', |
| | | width: 100, |
| | | }, |
| | | },/* |
| | | { |
| | | label: '流程类型', |
| | | width: 100, |
| | | prop: 'categoryName', |
| | | }, |
| | | },*/ |
| | | |
| | | { |
| | | label: '机床', |
| | |
| | | { |
| | | label: '文件', |
| | | width: 200, |
| | | prop: '', |
| | | prop: 'file', |
| | | }, |
| | | { |
| | | label: '到达时间', |
| | |
| | | this.reassignBox = false; |
| | | this.$refs?.reassginform?.resetForm(); |
| | | this.onLoad(this.page, this.query); |
| | | done() |
| | | |
| | | }).catch(err => { |
| | | console.error(err); |
| | | done() |
| | | }) |
| | | }); |
| | | done(); |
| | |
| | | }, |
| | | handleSubmit(form, done) { |
| | | if(this.row.taskDefinitionKey === 'programmingTask') { |
| | | if(this.applist.length !== 1) { |
| | | done(); |
| | | return this.$message.success('请选择1个程序'); |
| | | } |
| | | // if(this.applist.length !== 1) { |
| | | // done(); |
| | | // return this.$message.success('请选择1个程序'); |
| | | // } |
| | | } |
| | | approve({ |
| | | ...this.formApprove, |
| | | taskId: this.row.taskId, |
| | | processInstanceId: this.row.processInstanceId, |
| | | programIds: this.row.taskDefinitionKey === 'programmingTask' ? this.applist.map(v => v.id).join(',') : '', |
| | | // programIds: this.row.taskDefinitionKey === 'programmingTask' ? this.applist.map(v => v.id).join(',') : '', |
| | | }).then(res => { |
| | | if(res.data.code !== 200) { |
| | | this.$message.error(res.data.msg); |
| | | done(); |
| | | return; |
| | | } |
| | | this.$message.success('审批成功'); |
| | | this.approveBox = false; |
| | | this.onLoad(this.page, this.query); |
| | | done(); |
| | | }).catch(err => { |
| | | done(); |
| | | console.error(err); |
| | | }); |
| | | }, |