|
@@ -5,19 +5,40 @@
|
|
<a-input v-decorator="['name', {rules: [{required: true, message: '节点名称不能为空'}]}]" />
|
|
<a-input v-decorator="['name', {rules: [{required: true, message: '节点名称不能为空'}]}]" />
|
|
</a-form-item>
|
|
</a-form-item>
|
|
<template v-if="record.type===3">
|
|
<template v-if="record.type===3">
|
|
|
|
+ <a-form-item label="人员类型">
|
|
|
|
+ <a-select v-decorator="['verifyType', {rules: [{required: true, message: '人员类型不能为空'}]}]" placeholder="请选择" @change="handleVerifyType">
|
|
|
|
+ <a-select-option :value="0">审批人
|
|
|
|
+ </a-select-option>
|
|
|
|
+ <a-select-option :value="1">审批角色
|
|
|
|
+ </a-select-option>
|
|
|
|
+ </a-select>
|
|
|
|
+ </a-form-item>
|
|
<a-form-item label="所属部门">
|
|
<a-form-item label="所属部门">
|
|
<a-tree-select v-decorator="['deptId', {rules: [{required: true, message: '审核人不能为空'}]}]" style="width: 100%" :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }" :replaceFields="replaceFields" :tree-data="treeData" placeholder="请选择" tree-default-expand-all @change="handleDept">
|
|
<a-tree-select v-decorator="['deptId', {rules: [{required: true, message: '审核人不能为空'}]}]" style="width: 100%" :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }" :replaceFields="replaceFields" :tree-data="treeData" placeholder="请选择" tree-default-expand-all @change="handleDept">
|
|
</a-tree-select>
|
|
</a-tree-select>
|
|
</a-form-item>
|
|
</a-form-item>
|
|
- <a-form-item label="审核人">
|
|
|
|
|
|
+ <a-form-item v-if="verifyType" label="审批角色">
|
|
|
|
+ <a-select v-decorator="['roleId', {rules: [{required: true, message: '审批角色不能为空'}]}]" placeholder="请选择" @change="handleRole">
|
|
|
|
+ <a-select-option v-for="{roleName, roleId} in verifierRoleList" :key="roleId" :label="roleName" :value="roleId">{{ roleName }}
|
|
|
|
+ </a-select-option>
|
|
|
|
+ </a-select>
|
|
|
|
+ </a-form-item>
|
|
|
|
+ <a-form-item v-else label="审核人">
|
|
<a-select v-decorator="['verifier', {rules: [{required: true, message: '审核人不能为空'}]}]" placeholder="请选择" @change="handleVerifier">
|
|
<a-select v-decorator="['verifier', {rules: [{required: true, message: '审核人不能为空'}]}]" placeholder="请选择" @change="handleVerifier">
|
|
<a-select-option v-for="{realName, userId} in verifierList" :key="userId" :label="realName" :value="userId">{{ realName }}
|
|
<a-select-option v-for="{realName, userId} in verifierList" :key="userId" :label="realName" :value="userId">{{ realName }}
|
|
</a-select-option>
|
|
</a-select-option>
|
|
</a-select>
|
|
</a-select>
|
|
</a-form-item>
|
|
</a-form-item>
|
|
- <a-form-item label="审核人姓名 " v-show="false">
|
|
|
|
|
|
+ <a-form-item label="审批模式">
|
|
|
|
+ <a-select v-decorator="['nodeFilterModel', {rules: [{required: verifyType, message: '审批角色不能为空'}]}]" placeholder="请选择">
|
|
|
|
+ <a-select-option v-for="(label,value) in nodeFilterModelMap" :key="value" :value="parseInt(value)">{{label}}</a-select-option>
|
|
|
|
+ </a-select>
|
|
|
|
+ </a-form-item>
|
|
|
|
+ <a-form-item v-show="false">
|
|
<a-input type="hidden" v-decorator="['userName']">
|
|
<a-input type="hidden" v-decorator="['userName']">
|
|
</a-input>
|
|
</a-input>
|
|
|
|
+ <a-input type="hidden" v-decorator="['roleName']">
|
|
|
|
+ </a-input>
|
|
</a-form-item>
|
|
</a-form-item>
|
|
</template>
|
|
</template>
|
|
<template v-if="record.type===2">
|
|
<template v-if="record.type===2">
|
|
@@ -83,12 +104,13 @@
|
|
<script>
|
|
<script>
|
|
import pick from 'lodash.pick'
|
|
import pick from 'lodash.pick'
|
|
import { getDeptTree } from '@/api/upms/dept'
|
|
import { getDeptTree } from '@/api/upms/dept'
|
|
-import { queryUserByDept } from '@/api/upms/user'
|
|
|
|
|
|
+import { queryUserByDept, queryUserRoleByDept } from '@/api/upms/user'
|
|
import { getCustomClassNameList, getCustomCodeList } from '@/api/custom/className'
|
|
import { getCustomClassNameList, getCustomCodeList } from '@/api/custom/className'
|
|
export default {
|
|
export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
visible: false,
|
|
visible: false,
|
|
|
|
+ verifyType: null,
|
|
confirmLoading: false,
|
|
confirmLoading: false,
|
|
form: this.$form.createForm(this),
|
|
form: this.$form.createForm(this),
|
|
record: {},
|
|
record: {},
|
|
@@ -96,16 +118,19 @@ export default {
|
|
key: 'id',
|
|
key: 'id',
|
|
},
|
|
},
|
|
verifierList: [],
|
|
verifierList: [],
|
|
|
|
+ verifierRoleList: [],
|
|
treeData: [],
|
|
treeData: [],
|
|
classNameCodeMap: {},
|
|
classNameCodeMap: {},
|
|
customCodeList: [],
|
|
customCodeList: [],
|
|
customClassNameList: [],
|
|
customClassNameList: [],
|
|
handleNameList: [],
|
|
handleNameList: [],
|
|
handleConditionMap: {},
|
|
handleConditionMap: {},
|
|
|
|
+ nodeFilterModelMap: {},
|
|
}
|
|
}
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
this.handleConditionMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.TREATMENT_CONDITION)
|
|
this.handleConditionMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.TREATMENT_CONDITION)
|
|
|
|
+ this.nodeFilterModelMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.NODE_FILTER_MODEL)
|
|
getDeptTree().then((res) => {
|
|
getDeptTree().then((res) => {
|
|
this.treeData = this.setTree(res.data)
|
|
this.treeData = this.setTree(res.data)
|
|
})
|
|
})
|
|
@@ -117,6 +142,7 @@ export default {
|
|
base(record) {
|
|
base(record) {
|
|
this.visible = true
|
|
this.visible = true
|
|
this.record = record
|
|
this.record = record
|
|
|
|
+ this.verifyType = record.verifyType
|
|
record.deptId && this.handleDept(record.deptId)
|
|
record.deptId && this.handleDept(record.deptId)
|
|
record.titleCode && this.handleTitleCode(record.titleCode)
|
|
record.titleCode && this.handleTitleCode(record.titleCode)
|
|
record.titleColumnCode && this.handleTitleColumnCode(record.titleColumnCode)
|
|
record.titleColumnCode && this.handleTitleColumnCode(record.titleColumnCode)
|
|
@@ -130,11 +156,15 @@ export default {
|
|
pick(record, [
|
|
pick(record, [
|
|
'name',
|
|
'name',
|
|
'verifier',
|
|
'verifier',
|
|
|
|
+ 'nodeFilterModel',
|
|
'deptId',
|
|
'deptId',
|
|
|
|
+ 'roleId',
|
|
'reflect',
|
|
'reflect',
|
|
'titleCode',
|
|
'titleCode',
|
|
'titleColumnCode',
|
|
'titleColumnCode',
|
|
'handleNameId',
|
|
'handleNameId',
|
|
|
|
+ 'verifyType',
|
|
|
|
+ 'userName',
|
|
'id',
|
|
'id',
|
|
'handleCondition',
|
|
'handleCondition',
|
|
'handleConditionValue',
|
|
'handleConditionValue',
|
|
@@ -153,10 +183,24 @@ export default {
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ handleVerifyType(val) {
|
|
|
|
+ this.verifyType = val
|
|
|
|
+ if (this.form.getFieldValue('deptId')) {
|
|
|
|
+ console.log(this.form.getFieldValue('deptId'))
|
|
|
|
+
|
|
|
|
+ this.handleDept(this.form.getFieldValue('deptId'))
|
|
|
|
+ }
|
|
|
|
+ },
|
|
handleDept(deptId) {
|
|
handleDept(deptId) {
|
|
- queryUserByDept({ deptId }).then((res) => {
|
|
|
|
- this.verifierList = res.data
|
|
|
|
- })
|
|
|
|
|
|
+ if (this.verifyType) {
|
|
|
|
+ queryUserRoleByDept({ deptId }).then((res) => {
|
|
|
|
+ this.verifierRoleList = res.data
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ queryUserByDept({ deptId }).then((res) => {
|
|
|
|
+ this.verifierList = res.data
|
|
|
|
+ })
|
|
|
|
+ }
|
|
},
|
|
},
|
|
handleTitleCode(val) {
|
|
handleTitleCode(val) {
|
|
this._titleCode = val
|
|
this._titleCode = val
|
|
@@ -191,6 +235,17 @@ export default {
|
|
})
|
|
})
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ handleRole(_, val) {
|
|
|
|
+ const {
|
|
|
|
+ form: { setFieldsValue },
|
|
|
|
+ } = this
|
|
|
|
+
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
+ setFieldsValue({
|
|
|
|
+ roleName: val.componentOptions.propsData.label,
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ },
|
|
handleVerifier(_, val) {
|
|
handleVerifier(_, val) {
|
|
console.log(val)
|
|
console.log(val)
|
|
const {
|
|
const {
|
|
@@ -223,6 +278,9 @@ export default {
|
|
this.record.userName = values.userName
|
|
this.record.userName = values.userName
|
|
this.record.handleConditionValue = values.handleConditionValue
|
|
this.record.handleConditionValue = values.handleConditionValue
|
|
this.record.handleCondition = values.handleCondition
|
|
this.record.handleCondition = values.handleCondition
|
|
|
|
+ this.record.verifyType = values.verifyType
|
|
|
|
+ this.record.roleId = values.roleId
|
|
|
|
+ this.record.nodeFilterModel = values.nodeFilterModel
|
|
this.confirmLoading = false
|
|
this.confirmLoading = false
|
|
this.onClose()
|
|
this.onClose()
|
|
})
|
|
})
|