|
|
|
|
@ -139,33 +139,39 @@ export default { |
|
|
|
|
* 发起流程 |
|
|
|
|
* @param form {"processId": "流程定义id", ...表单自定义字段变量} |
|
|
|
|
*/ |
|
|
|
|
handleStartProcess() { |
|
|
|
|
this.loading = true |
|
|
|
|
this.$refs.form.validate((valid, done, msg) => { |
|
|
|
|
let form = this.deepClone(this.form) |
|
|
|
|
if (this.$refs.examineForm && this.$refs.examineForm.examineForm) { |
|
|
|
|
const { copyUser, assignee } = this.$refs.examineForm.examineForm |
|
|
|
|
form = { ...form, copyUser, assignee } |
|
|
|
|
} |
|
|
|
|
if (valid) { |
|
|
|
|
startProcess(form).then(() => { |
|
|
|
|
this.$message.success("发起成功") |
|
|
|
|
this.handleCloseTag('/plugin/workflow/process/send') |
|
|
|
|
done() |
|
|
|
|
this.loading = false |
|
|
|
|
}).catch(() => { |
|
|
|
|
handleStartProcess(isExForm = false) { |
|
|
|
|
return new Promise((resolve) => { |
|
|
|
|
this.loading = true |
|
|
|
|
this.$refs.form.validate((valid, done, msg) => { |
|
|
|
|
let form = this.deepClone(this.form) |
|
|
|
|
if (this.$refs.examineForm && this.$refs.examineForm.examineForm) { |
|
|
|
|
const { copyUser, assignee } = this.$refs.examineForm.examineForm |
|
|
|
|
form = { ...form, copyUser, assignee } |
|
|
|
|
} |
|
|
|
|
if (valid) { |
|
|
|
|
startProcess(form).then(() => { |
|
|
|
|
if (isExForm === true) { |
|
|
|
|
resolve(done) |
|
|
|
|
} else { |
|
|
|
|
this.$message.success("发起成功") |
|
|
|
|
this.handleCloseTag('/plugin/workflow/process/send') |
|
|
|
|
done() |
|
|
|
|
this.loading = false |
|
|
|
|
} |
|
|
|
|
}).catch(() => { |
|
|
|
|
done() |
|
|
|
|
this.loading = false |
|
|
|
|
}) |
|
|
|
|
} else { |
|
|
|
|
done() |
|
|
|
|
this.loading = false |
|
|
|
|
}) |
|
|
|
|
} else { |
|
|
|
|
done() |
|
|
|
|
this.loading = false |
|
|
|
|
if (msg) { |
|
|
|
|
const key = Object.keys(msg)[0] |
|
|
|
|
const rules = msg[key] |
|
|
|
|
this.$message.error(rules.map(r => r.message).join(' | ')) |
|
|
|
|
if (msg) { |
|
|
|
|
const key = Object.keys(msg)[0] |
|
|
|
|
const rules = msg[key] |
|
|
|
|
this.$message.error(rules.map(r => r.message).join(' | ')) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
/** |
|
|
|
|
|