|
@@ -1,19 +1,22 @@
|
|
|
<template>
|
|
|
- <m-dialog :title="`${item.workFlowTmplate?.name} 审批配置`" ref="dialog" @sure="onSure">
|
|
|
- <el-form ref="form" inline :model="formValues" label-width="80px" >
|
|
|
+ <m-dialog title="审批配置" ref="dialog" @sure="onSure">
|
|
|
+ <el-form ref="form" inline :model="formValues" label-width="100px" >
|
|
|
+ <el-form-item label="工作流">
|
|
|
+ <el-tag>{{ item.workFlowTmplate?.name }}</el-tag>
|
|
|
+ </el-form-item>
|
|
|
<m-card
|
|
|
v-for="(item, index) in formValues.items"
|
|
|
:key="item.key"
|
|
|
shadow="never"
|
|
|
class="mb-3 cardBox"
|
|
|
>
|
|
|
- <el-form-item label="处理对象">
|
|
|
+ <el-form-item label="处理对象" required :prop="`items.${index}.handleType`">
|
|
|
<el-select v-model="item.handleType" placeholder="请选择处理对象" @change="onChange(item)">
|
|
|
<el-option label="指定人" :value="0"></el-option>
|
|
|
<el-option label="指定部室岗位" :value="1"></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="处理方">
|
|
|
+ <el-form-item label="处理方" required :prop="`items.${index}.handleValue`">
|
|
|
<el-cascader
|
|
|
v-model="item.handleValue"
|
|
|
:ref="`cascader_${index}`"
|
|
@@ -176,24 +179,27 @@ export default {
|
|
|
postName: node.value
|
|
|
}
|
|
|
},
|
|
|
- async onSure () {
|
|
|
- try {
|
|
|
- await saveWorkflow({
|
|
|
- workFlowTmplateItems: this.formValues.items.map((e, index) => {
|
|
|
- return {
|
|
|
- handleType: e.handleType,
|
|
|
- handleValue: e.handleValueData,
|
|
|
- sort: index
|
|
|
+ onSure () {
|
|
|
+ this.$refs.form.validate(async valid => {
|
|
|
+ if (!valid) return
|
|
|
+ try {
|
|
|
+ await saveWorkflow({
|
|
|
+ workFlowTmplateItems: this.formValues.items.map((e, index) => {
|
|
|
+ return {
|
|
|
+ handleType: e.handleType,
|
|
|
+ handleValue: e.handleValueData,
|
|
|
+ sort: index
|
|
|
+ }
|
|
|
+ }),
|
|
|
+ workFlowTmplate: {
|
|
|
+ workFlowTmplateId: this.item.workFlowTmplate.workFlowTmplateId
|
|
|
}
|
|
|
- }),
|
|
|
- workFlowTmplate: {
|
|
|
- workFlowTmplateId: this.item.workFlowTmplate.workFlowTmplateId
|
|
|
- }
|
|
|
- })
|
|
|
- this.$message.success('保存成功')
|
|
|
- } catch (error) {
|
|
|
- this.$message.error(error)
|
|
|
- }
|
|
|
+ })
|
|
|
+ this.$message.success('保存成功')
|
|
|
+ } catch (error) {
|
|
|
+ this.$message.error(error)
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
}
|