chore: 更新外置表单模版

saber
ssc 4 years ago
parent 4fc9e5b356
commit d6ae3bde34
  1. 8
      src/views/plugin/workflow/mixins/ex-form.js
  2. 12
      src/views/plugin/workflow/process/external/Leave/start.vue
  3. 12
      src/views/plugin/workflow/process/external/template/start.vue

@ -139,7 +139,8 @@ export default {
* 发起流程
* @param form {"processId": "流程定义id", ...表单自定义字段变量}
*/
handleStartProcess() {
handleStartProcess(isExForm = false) {
return new Promise((resolve) => {
this.loading = true
this.$refs.form.validate((valid, done, msg) => {
let form = this.deepClone(this.form)
@ -149,10 +150,14 @@ export default {
}
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
@ -167,6 +172,7 @@ export default {
}
}
})
})
},
/**
* 获取流程任务详情

@ -35,10 +35,7 @@
<el-button type="primary"
size="medium"
v-loading="loading"
@click="() => {
loading = true;
$refs.form.submit()
}">发起</el-button>
@click="handleSubmit">发起</el-button>
<el-button v-if="permission.wf_process_draft"
type="success"
size="medium"
@ -225,14 +222,13 @@ export default {
this.waiting = false
})
},
handleSubmit(form, done) {
this.handleStartProcess(form).then(() => {
handleSubmit() {
this.handleStartProcess(true).then(done => {
this.$message.success("发起成功")
done()
this.handleCloseTag('/plugin/workflow/process/send')
done()
}).catch(() => {
this.loading = false
done()
})
},
}

@ -29,10 +29,7 @@
<el-button type="primary"
size="medium"
v-loading="loading"
@click="() => {
loading = true;
$refs.form.submit()
}">发起</el-button>
@click="handleSubmit">发起</el-button>
<el-button v-if="permission.wf_process_draft"
type="success"
size="medium"
@ -101,14 +98,13 @@ export default {
this.waiting = false
})
},
handleSubmit(form, done) {
this.handleStartProcess(form).then(() => {
handleSubmit() {
this.handleStartProcess(true).then(done => {
this.$message.success("发起成功")
done()
this.handleCloseTag('/plugin/workflow/process/send')
done()
}).catch(() => {
this.loading = false
done()
})
},
}

Loading…
Cancel
Save