|
@@ -10,11 +10,53 @@
|
|
|
<row-list :col="1">
|
|
|
<row-item>
|
|
|
<a-form-item
|
|
|
- label="转派对象"
|
|
|
+ label="部门"
|
|
|
:labelCol="BaseTool.Constant.labelCol2"
|
|
|
:wrapperCol="BaseTool.Constant.wrapperCol2"
|
|
|
>
|
|
|
<a-select
|
|
|
+ @change="deptChange"
|
|
|
+ v-decorator="['deptId']"
|
|
|
+ placeholder="请选择">
|
|
|
+ <a-select-option
|
|
|
+ v-for="(label,value) in repairDeptMap"
|
|
|
+ :key="value"
|
|
|
+ :label="label"
|
|
|
+ :value="value">{{ label }}
|
|
|
+ </a-select-option>
|
|
|
+ </a-select>
|
|
|
+ </a-form-item>
|
|
|
+ </row-item>
|
|
|
+ <row-item>
|
|
|
+ <a-form-item
|
|
|
+ label="角色"
|
|
|
+ :labelCol="BaseTool.Constant.labelCol2"
|
|
|
+ :wrapperCol="BaseTool.Constant.wrapperCol2"
|
|
|
+ >
|
|
|
+ <a-select
|
|
|
+ @change="roleCodeChange"
|
|
|
+ v-decorator="['roleCode']"
|
|
|
+ placeholder="请选择">
|
|
|
+ <a-select-option
|
|
|
+ value=" REPAIR_MANAGE">工程师
|
|
|
+ </a-select-option>
|
|
|
+ <a-select-option
|
|
|
+ value="Maintenance_Leader">班组长
|
|
|
+ </a-select-option>
|
|
|
+ <a-select-option
|
|
|
+ value=" Maintenance">维修人
|
|
|
+ </a-select-option>
|
|
|
+ </a-select>
|
|
|
+ </a-form-item>
|
|
|
+ </row-item>
|
|
|
+ <row-item>
|
|
|
+ <a-form-item
|
|
|
+ label="人员"
|
|
|
+ :labelCol="BaseTool.Constant.labelCol2"
|
|
|
+ :wrapperCol="BaseTool.Constant.wrapperCol2"
|
|
|
+ >
|
|
|
+ <a-select
|
|
|
+ :disabled="!(roleCode&&dept)"
|
|
|
v-decorator="['dispatchUserId']"
|
|
|
placeholder="请选择">
|
|
|
<a-select-option
|
|
@@ -47,7 +89,7 @@
|
|
|
|
|
|
<script>
|
|
|
import { transferApplyByDTO } from '@/api/repair/application-form'
|
|
|
-import { queryRepairUser } from '@/api/upms/user-dept'
|
|
|
+import { queryRepairUser2 } from '@/api/upms/user-dept'
|
|
|
|
|
|
export default {
|
|
|
name: 'TransferForm',
|
|
@@ -60,13 +102,17 @@ export default {
|
|
|
roleType: null,
|
|
|
// 下拉框map
|
|
|
record: {},
|
|
|
- roleUserMap: []
|
|
|
+ roleUserMap: [],
|
|
|
+ repairDeptMap: {},
|
|
|
+ dept: null,
|
|
|
+ roleCode: null
|
|
|
}
|
|
|
},
|
|
|
props: {
|
|
|
},
|
|
|
created () {
|
|
|
// 下拉框map
|
|
|
+ this.repairDeptMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_DEPT_CATEGORY)
|
|
|
},
|
|
|
methods: {
|
|
|
base (record, roleType) {
|
|
@@ -76,8 +122,6 @@ export default {
|
|
|
this.record = record
|
|
|
this.roleType = roleType
|
|
|
// 转派工程师集合查询
|
|
|
- const params = { roleType: this.roleType, deptId: record.repairDeptId, queryType: 3 }
|
|
|
- this.getUsers(params)
|
|
|
},
|
|
|
save () {
|
|
|
const { form: { validateFieldsAndScroll } } = this
|
|
@@ -105,8 +149,23 @@ export default {
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
- getUsers (params) {
|
|
|
- queryRepairUser(params).then(res => {
|
|
|
+ deptChange (val) {
|
|
|
+ this.dept = val
|
|
|
+ if (this.roleCode) {
|
|
|
+ this.getUsers()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ roleCodeChange (val) {
|
|
|
+ this.roleCode = val
|
|
|
+ if (this.dept) {
|
|
|
+ this.getUsers()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ getUsers () {
|
|
|
+ queryRepairUser2({
|
|
|
+ deptId: this.dept,
|
|
|
+ roleCode: this.roleCode
|
|
|
+ }).then(res => {
|
|
|
this.roleUserMap = res.data
|
|
|
})
|
|
|
},
|