|
|
@@ -82,8 +82,17 @@
|
|
|
</row-item>-->
|
|
|
<row-item>
|
|
|
<a-form-item label="报修人" :labelCol="BaseTool.Constant.labelCol" :wrapperCol="BaseTool.Constant.wrapperCol">
|
|
|
- <a-input
|
|
|
- v-decorator="['actualUser', { initialValue: userInfo.realName, rules: [{ required: true, message: '报修人不能为空' }] }]" />
|
|
|
+ <!-- 报修人账号下拉带搜索,提交 userId,避免手输同名歧义 -->
|
|
|
+ <a-select
|
|
|
+ showSearch
|
|
|
+ :filterOption="(input, option) => option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0"
|
|
|
+ v-decorator="['userId', { initialValue: userInfo.userId, rules: [{ required: true, message: '报修人不能为空' }] }]"
|
|
|
+ placeholder="请选择报修人"
|
|
|
+ >
|
|
|
+ <a-select-option v-for="user in userList" :key="user.userId" :value="user.userId" :label="user.realName">
|
|
|
+ {{ user.realName }}<template v-if="user.username">({{ user.username }})</template>
|
|
|
+ </a-select-option>
|
|
|
+ </a-select>
|
|
|
</a-form-item>
|
|
|
</row-item>
|
|
|
<row-item>
|
|
|
@@ -317,6 +326,8 @@ export default {
|
|
|
'remark',
|
|
|
'repairErrorTypeId',
|
|
|
'notifyTeamLeaders',
|
|
|
+ 'userId',
|
|
|
+ 'actualUser',
|
|
|
'deptId'
|
|
|
])
|
|
|
)
|
|
|
@@ -363,6 +374,9 @@ export default {
|
|
|
values.checkFileList = this.checkFileList
|
|
|
// 通知班长:多选数组转逗号分隔字符串
|
|
|
values.notifyTeamLeaders = (values.notifyTeamLeaders || []).join(',')
|
|
|
+ // 报修人:根据下拉选中的 userId 同步姓名,后端以 userId 为准
|
|
|
+ const chosenUser = this.userList.find((user) => user.userId === values.userId)
|
|
|
+ values.actualUser = chosenUser ? chosenUser.realName : this.userInfo.realName
|
|
|
if (this.BaseTool.String.isBlank(values.id)) {
|
|
|
// 重复报修检查:该设备存在未完结报修单时需先确认再提交(允许一台设备多个报修单)
|
|
|
this.confirmDuplicateAdd(values)
|
|
|
@@ -421,19 +435,8 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
changePlanFlag(value) {
|
|
|
+ // 选择工单类别不再自动联动“是否停机”:停机与否必须由报修人在“是否停机”处显式选择
|
|
|
this.category = value
|
|
|
- const {
|
|
|
- form: { setFieldsValue },
|
|
|
- } = this
|
|
|
- if (this.category === 1) {
|
|
|
- this.$nextTick(() => {
|
|
|
- setFieldsValue({ needStop: 1 })
|
|
|
- })
|
|
|
- } else {
|
|
|
- this.$nextTick(() => {
|
|
|
- setFieldsValue({ needStop: 0 })
|
|
|
- })
|
|
|
- }
|
|
|
},
|
|
|
handleCancel(values) {
|
|
|
this.visible = false
|