Explorar o código

refactor(repair): 优化报修申请表单字段和组件

- 将紧急等级字段名称更改为紧急程度
- 将异常类别字段更改为故障类型并使用下拉选择替代树形选择
- 移除错误类型树数据获取相关代码
- 添加故障类型字典映射
- 在字典常量中新增故障类型定义
- 在用户列表中增加部门列显示
dazhaxie hai 2 días
pai
achega
8d508b5a5d

+ 1 - 0
src/utils/dict.js

@@ -129,6 +129,7 @@ DictCache.TYPE = {
   REPAIR_REASON_STATUS: 'REPAIR_REASON_STATUS', // 分析措施状态
   REPAIR_REASON_TYPE: 'REPAIR_REASON_TYPE', // 分析措施类别
   REPAIR_QUESTION: 'REPAIR_QUESTION', // 故障描述
+  REPAIR_ERROR_TYPE: 'REPAIR_ERROR_TYPE', // 故障类型
   YES_NO: 'YES_NO', // 是否
   REPAIR_FORM_STATUS: 'REPAIR_FORM_STATUS', // 维修状态
   REPAIR_CHECK_STATUS: 'REPAIR_CHECK_STATUS', // 验收状态

+ 17 - 16
src/views/repair/application-form/modules/BaseForm.vue

@@ -83,13 +83,13 @@
               v-decorator="['actualUser', { initialValue: userInfo.realName, rules: [{ required: true, message: '报修人不能为空' }] }]" />
           </a-form-item>
         </row-item>
-        <!--        <row-item>
+        <row-item>
           <a-form-item
-            label="紧急等级"
+            label="紧急程度"
             :labelCol="BaseTool.Constant.labelCol"
             :wrapperCol="BaseTool.Constant.wrapperCol"
           >
-            <a-select v-decorator="['level', {initialValue: 1, rules: [{required: true, message: '紧急等级不能为空'}]}]" placeholder="请选择">
+            <a-select v-decorator="['level', {initialValue: 1, rules: [{required: true, message: '紧急程度不能为空'}]}]" placeholder="请选择">
               <a-select-option
                 v-for="(label,value) in levelMap"
                 :key="value"
@@ -101,22 +101,25 @@
         </row-item>
         <row-item>
           <a-form-item
-            label="异常类别"
+            label="故障类型"
             :labelCol="BaseTool.Constant.labelCol"
             :wrapperCol="BaseTool.Constant.wrapperCol"
           >
-            <a-tree-select
+            <a-select
               style="width: 100%"
-              :dropdownStyle="{ maxHeight: '400px', overflow: 'auto' }"
-              :treeData="treeData"
-              :treeNodeFilterProp="'title'"
-              :showSearch="true"
               v-decorator="['repairErrorTypeId']"
               placeholder="请选择"
+              allowClear
             >
-            </a-tree-select>
+              <a-select-option
+                v-for="(label,value) in faultTypeMap"
+                :key="value"
+                :label="label"
+                :value="value">{{ label }}
+              </a-select-option>
+            </a-select>
           </a-form-item>
-        </row-item>-->
+        </row-item>
         <row-item>
           <a-form-item label="报修图片" :labelCol="BaseTool.Constant.labelCol" :wrapperCol="BaseTool.Constant.wrapperCol">
             <a-upload :action="uploadUrl" :multiple="true" list-type="picture"
@@ -182,7 +185,6 @@ import { queryUser } from '@/api/upms/user'
 import { uploadUrl } from '@/api/upms/file'
 import Vue from 'vue'
 import { ACCESS_TOKEN } from '@/store/mutation-types'
-import { fetchErrorTypeTree } from '@/api/repair/errortype'
 import { getSbPositionTree } from '@/api/sb/position'
 
 export default {
@@ -197,10 +199,10 @@ export default {
       sourceMap: {},
       levelMap: {},
       questionMap: {},
-      treeData: [],
       needStop: null,
       sbPositionData: [],
       needStopMap: {},
+      faultTypeMap: {},
       category: 0,
       categoryMap: {},
       statusMap: {},
@@ -229,6 +231,7 @@ export default {
     this.levelMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_APPLICATION_FORM_LEVEL)
     this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_APPLICATION_FORM_STATUS)
     this.questionMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_QUESTION)
+    this.faultTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_ERROR_TYPE)
     this.needStopMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.YES_NO)
     this.categoryMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_APPLICATION_FORM_CATEGORY)
     this.getUsers()
@@ -236,9 +239,6 @@ export default {
   methods: {
     base(record) {
       this.visible = true
-      fetchErrorTypeTree().then((res) => {
-        this.treeData = res.data
-      })
       getSbPositionTree().then(res => {
         this.sbPositionData = res.data
       })
@@ -307,6 +307,7 @@ export default {
               'category',
               'partName',
               'remark',
+              'repairErrorTypeId',
             ])
           )
         )

+ 4 - 0
src/views/upms/user/User.vue

@@ -158,6 +158,10 @@ export default {
           dataIndex: 'realName'
         },
         {
+          title: '部门',
+          dataIndex: 'deptName'
+        },
+        {
           title: '手机号',
           dataIndex: 'phone'
         },