Explorar o código

feat(检查模块): 添加BRIGADE_LEVEL级别支持并优化不合格人员显示

- 在检查记录、整改记录和任务页面中添加BRIGADE_LEVEL级别的支持
- 优化getUserName方法,当用户选项为空时显示原始用户名
- 移除checkTask页面中科内自查的单选框
- 统一格式化代码,删除多余空格和换行
huoyi hai 4 meses
pai
achega
0c0122e35c

+ 53 - 54
src/views/check/checkCorrection/components/Deatils.vue

@@ -1,12 +1,14 @@
1 1
 <template>
2 2
   <el-dialog :title="title" v-model="open" width="1100px" append-to-body>
3 3
     <div class="contentWrap" v-loading="loading">
4
-      <el-form ref="checkFormRef" :model="form" :rules="rules" scroll-to-error :scroll-into-view-options="{block: 'center'}" label-width="9em">
5
-        <el-card header="基本信息" style="margin-bottom: 10px;"  v-card-expand="{ isExpanded: true }">
4
+      <el-form ref="checkFormRef" :model="form" :rules="rules" scroll-to-error
5
+        :scroll-into-view-options="{ block: 'center' }" label-width="9em">
6
+        <el-card header="基本信息" style="margin-bottom: 10px;" v-card-expand="{ isExpanded: true }">
6 7
           <el-row :gutter="16">
7 8
             <el-col :span="12">
8 9
               <el-form-item label="任务编号" prop="taskCode">
9
-                <el-input :disabled="disabled" v-model="form.taskCode" :placeholder="disabled ? '-' : '请输入任务编号'" maxlength="30" />
10
+                <el-input :disabled="disabled" v-model="form.taskCode" :placeholder="disabled ? '-' : '请输入任务编号'"
11
+                  maxlength="30" />
10 12
               </el-form-item>
11 13
             </el-col>
12 14
             <el-col :span="12">
@@ -16,29 +18,20 @@
16 18
             </el-col>
17 19
             <el-col :span="12">
18 20
               <el-form-item label="被检查人/科/班组" prop="checkedDepartmentName">
19
-                <el-input
20
-                  v-if=" form.checkedLevel === 'DEPARTMENT_LEVEL' "
21
-                  :disabled="disabled"
22
-                  :value="form.checkedDepartmentName"
23
-                  :placeholder="disabled ? '-' : '请输入被检查人/科/班组'" />
24
-                <el-input
25
-                  v-else-if=" form.checkedLevel === 'TEAM_LEVEL' "
26
-                  :disabled="disabled"
27
-                  :value="form.checkedTeamName"
28
-                  :placeholder="disabled ? '-' : '请输入被检查人/科/班组'" />
29
-                <el-input
30
-                  v-else-if=" form.checkedLevel === 'PERSONNEL_LEVEL' "
31
-                  :disabled="disabled"
32
-                  :value="form.checkedPersonnelName"
33
-                  :placeholder="disabled ? '-' : '请输入被检查人/科/班组'" />
21
+                <el-input v-if="form.checkedLevel === 'DEPARTMENT_LEVEL'" :disabled="disabled"
22
+                  :value="form.checkedDepartmentName" :placeholder="disabled ? '-' : '请输入被检查人/科/班组'" />
23
+                <el-input v-else-if="form.checkedLevel === 'TEAM_LEVEL'" :disabled="disabled"
24
+                  :value="form.checkedTeamName" :placeholder="disabled ? '-' : '请输入被检查人/科/班组'" />
25
+                <el-input v-else-if="form.checkedLevel === 'PERSONNEL_LEVEL'" :disabled="disabled"
26
+                  :value="form.checkedPersonnelName" :placeholder="disabled ? '-' : '请输入被检查人/科/班组'" />
27
+                <el-input v-else-if="form.checkedLevel === 'BRIGADE_LEVEL'" :disabled="disabled"
28
+                  :value="form.checkedBrigadeName" :placeholder="disabled ? '-' : '请输入被检查人/科/班组'" />
34 29
                 <el-input :disabled="disabled" v-else />
35 30
               </el-form-item>
36 31
             </el-col>
37 32
             <el-col :span="12">
38 33
               <el-form-item label="检查地点" prop="nickName">
39
-                <el-input
40
-                  :disabled="disabled"
41
-                  :value="viewText( form.terminlName, form.regionalName, form.channelName )"
34
+                <el-input :disabled="disabled" :value="viewText(form.terminlName, form.regionalName, form.channelName)"
42 35
                   :placeholder="disabled ? '-' : '请输入检查地点'" />
43 36
               </el-form-item>
44 37
             </el-col>
@@ -53,27 +46,20 @@
53 46
         <el-card header="待整改任务" style="margin-bottom: 10px;" v-card-expand="{ isExpanded: true }">
54 47
           <div>
55 48
             <el-row :gutter="16">
56
-              <el-col :span="24" v-for=" item of groupHandler( form.checkProjectItemList ) " :key="item.id"
49
+              <el-col :span="24" v-for="item of groupHandler(form.checkProjectItemList)" :key="item.id"
57 50
                 style="margin-bottom: 15px;">
58 51
                 <div class="title">{{ item.title }}</div>
59
-                <div v-for=" attr in item.list " :key="attr.index" style="padding: 0 30px; box-sizing: border-box;">
52
+                <div v-for="attr in item.list" :key="attr.index" style="padding: 0 30px; box-sizing: border-box;">
60 53
                   <el-form-item :label="attr.projectName" label-width="auto"
61 54
                     :prop="`checkProjectItemList.${attr.index}.scoreLevel`">
62
-                    <el-switch
63
-                      :disabled="disabled"
64
-                      v-model="attr.scoreLevel"
65
-                      active-value="QUALIFIED"
66
-                      inactive-value="UNQUALIFIED"
67
-                      inline-prompt
68
-                      active-text="符合"
69
-                      inactive-text="不符合"
55
+                    <el-switch :disabled="disabled" v-model="attr.scoreLevel" active-value="QUALIFIED"
56
+                      inactive-value="UNQUALIFIED" inline-prompt active-text="符合" inactive-text="不符合"
70 57
                       style="--el-switch-on-color: rgb(98, 111, 240); --el-switch-off-color: #ff4949" />
71 58
                   </el-form-item>
72
-                  <div v-if=" attr.scoreLevel === 'UNQUALIFIED' " style="padding: 0 30px; box-sizing: border-box;">
73
-                    <el-form-item v-if="attr.checkUserList && attr.checkUserList.length" label="不合格人员" label-width="6em" prop="checkedPersonnelName">
74
-                      <el-input
75
-                        :disabled="disabled"
76
-                        :value="getUserName( attr.checkUserList )" />
59
+                  <div v-if="attr.scoreLevel === 'UNQUALIFIED'" style="padding: 0 30px; box-sizing: border-box;">
60
+                    <el-form-item v-if="attr.checkUserList && attr.checkUserList.length" label="不合格人员" label-width="6em"
61
+                      prop="checkedPersonnelName">
62
+                      <el-input :disabled="disabled" :value="getUserName(attr.checkUserList)" />
77 63
                     </el-form-item>
78 64
                     <el-form-item v-if="attr.problemDescription" label="问题描述" label-width="6em"
79 65
                       :prop="`checkProjectItemList.${attr.index}.problemDescription`">
@@ -82,52 +68,57 @@
82 68
                   </div>
83 69
                 </div>
84 70
               </el-col>
85
-              <el-col :span="24" v-if=" form.checkRecordBaseAttachmentList && form.checkRecordBaseAttachmentList.length ">
71
+              <el-col :span="24" v-if="form.checkRecordBaseAttachmentList && form.checkRecordBaseAttachmentList.length">
86 72
                 <div class="title">不合格照片</div>
87 73
                 <div class="imgList">
88
-                  <ImageUpload :modelValue="transformImglistData(form.checkRecordBaseAttachmentList)" :disabled="disabled"  />
74
+                  <ImageUpload :modelValue="transformImglistData(form.checkRecordBaseAttachmentList)"
75
+                    :disabled="disabled" />
89 76
                 </div>
90 77
               </el-col>
91 78
             </el-row>
92 79
           </div>
93 80
         </el-card>
94 81
 
95
-        <el-card header="整改要求" style="margin-bottom: 10px;"  v-card-expand="{ isExpanded: true }">
82
+        <el-card header="整改要求" style="margin-bottom: 10px;" v-card-expand="{ isExpanded: true }">
96 83
           <el-row :gutter="16">
97 84
             <el-col :span="12">
98 85
               <el-form-item label="负责人" prop="responsibleUserName">
99
-                <el-input v-model="form.responsibleUserName" :disabled="disabled" :placeholder="disabled ? '-' : '请输入负责人'" />
86
+                <el-input v-model="form.responsibleUserName" :disabled="disabled"
87
+                  :placeholder="disabled ? '-' : '请输入负责人'" />
100 88
               </el-form-item>
101 89
             </el-col>
102 90
 
103 91
             <el-col :span="12">
104 92
               <el-form-item label="整改期限" prop="rectificationDeadline">
105
-                <el-input v-model="form.rectificationDeadline" :disabled="disabled" :placeholder="disabled ? '-' : '请输入整改期限'" />
93
+                <el-input v-model="form.rectificationDeadline" :disabled="disabled"
94
+                  :placeholder="disabled ? '-' : '请输入整改期限'" />
106 95
               </el-form-item>
107 96
             </el-col>
108 97
             <el-col :span="24">
109 98
               <el-form-item label="整改要求" prop="rectificationSuggestions">
110
-                <el-input type="textarea" v-model="form.rectificationSuggestions" :disabled="disabled" :placeholder="disabled ? '-' : '请输入整改要求'" />
99
+                <el-input type="textarea" v-model="form.rectificationSuggestions" :disabled="disabled"
100
+                  :placeholder="disabled ? '-' : '请输入整改要求'" />
111 101
               </el-form-item>
112 102
             </el-col>
113 103
           </el-row>
114 104
         </el-card>
115
-        <el-card header="整改详情" style="margin-bottom: 10px;"  v-card-expand="{ isExpanded: true }">
105
+        <el-card header="整改详情" style="margin-bottom: 10px;" v-card-expand="{ isExpanded: true }">
116 106
           <el-row :gutter="16">
117 107
             <el-col :span="24">
118 108
               <el-form-item label="整改详情" label-width="6em" prop="rectificationDetails">
119
-                <el-input type="textarea" v-model="form.rectificationDetails" :disabled="disabled" :placeholder="'请输入整改要求'" />
109
+                <el-input type="textarea" v-model="form.rectificationDetails" :disabled="disabled"
110
+                  :placeholder="'请输入整改要求'" />
120 111
               </el-form-item>
121 112
             </el-col>
122 113
             <el-col :span="24" v-if="baseAttachmentList.length">
123 114
               <div class="title">整改图片</div>
124 115
               <div class="imgList">
125
-                <ImageUpload v-model="baseAttachmentList" :disabled="disabled"  />
116
+                <ImageUpload v-model="baseAttachmentList" :disabled="disabled" />
126 117
               </div>
127 118
             </el-col>
128 119
           </el-row>
129 120
         </el-card>
130
-        <el-card header="审批历史" style="margin-bottom: 10px;"  v-card-expand="{ isExpanded: true }">
121
+        <el-card header="审批历史" style="margin-bottom: 10px;" v-card-expand="{ isExpanded: true }">
131 122
           <el-table :data="historyInstanceList">
132 123
             <el-table-column label="审批人" align="center" prop="operatorName" width="180" />
133 124
             <el-table-column label="审批时间" align="center" prop="operationTime" />
@@ -146,7 +137,7 @@
146 137
 
147 138
 <script setup>
148 139
 import { watch, ref, onMounted, reactive, onUnmounted, computed } from 'vue'
149
-import { getCheckCorrection, historyInstance} from "@/api/check/checkCorrection"
140
+import { getCheckCorrection, historyInstance } from "@/api/check/checkCorrection"
150 141
 import { listUser } from "@/api/system/user"
151 142
 const props = defineProps({
152 143
   id: {
@@ -178,7 +169,7 @@ const getDetailInfo = () => {
178 169
     } else {
179 170
       return historyInstanceList.value = []
180 171
     }
181
-    
172
+
182 173
   }).finally(() => {
183 174
     loading.value = false
184 175
   })
@@ -210,10 +201,10 @@ const transformImglistData = (imgList) => {
210 201
 }
211 202
 
212 203
 const baseAttachmentList = computed({
213
-  get () {
204
+  get() {
214 205
     return transformImglistData(form.value.baseAttachmentList)
215 206
   },
216
-  set (newValue) {
207
+  set(newValue) {
217 208
     form.value.baseAttachmentList = newValue.map(item => {
218 209
       return {
219 210
         attachmentName: item.name,
@@ -228,13 +219,13 @@ const groupHandler = (list) => {
228 219
     return list.reduce((cur, acc, index) => {
229 220
       const findIndex = cur.findIndex(item => item.categoryCodeOne === acc.categoryCodeOne && item.categoryCodeTwo === acc.categoryCodeTwo)
230 221
       if (findIndex >= 0) {
231
-        cur[ findIndex ].list.push({ index, ...acc })
222
+        cur[findIndex].list.push({ index, ...acc })
232 223
       } else {
233 224
         cur.push({
234 225
           title: `${acc.categoryNameOne}/${acc.categoryNameTwo}`,
235 226
           categoryCodeOne: acc.categoryCodeOne,
236 227
           categoryCodeTwo: acc.categoryCodeTwo,
237
-          list: [ { index, ...acc } ]
228
+          list: [{ index, ...acc }]
238 229
         })
239 230
       }
240 231
       return cur
@@ -252,12 +243,20 @@ const getUserInfo = () => {
252 243
 }
253 244
 
254 245
 const getUserName = (list) => {
246
+  let res = ''
255 247
   if (Array.isArray(list) && list.length) {
256
-    return list.map(attr => {
248
+    res = list.map(attr => {
257 249
       return (listUserOption.value.find(item => item.value === attr.userId) || {}).label
258 250
     }).filter(Boolean).join('、')
259 251
   }
260
-  return '-'
252
+  
253
+  if (res) {
254
+    return res
255
+  } else {
256
+    res = list.map((item) => item.userName).join('、')
257
+    return res || '-'
258
+  }
259
+
261 260
 }
262 261
 
263 262
 const cancel = () => {

+ 1 - 0
src/views/check/checkCorrection/index.vue

@@ -47,6 +47,7 @@
47 47
           <div v-if="scope.row.checkedLevel === 'DEPARTMENT_LEVEL'">{{ scope.row.checkedDepartmentName }}</div>
48 48
           <div v-if="scope.row.checkedLevel === 'TEAM_LEVEL'">{{ scope.row.checkedTeamName }}</div>
49 49
           <div v-if="scope.row.checkedLevel === 'PERSONNEL_LEVEL'">{{ scope.row.checkedPersonnelName }}</div>
50
+          <div v-if="scope.row.checkedLevel === 'BRIGADE_LEVEL'">{{ scope.row.checkedBrigadeName }}</div>
50 51
         </template>
51 52
       </el-table-column>
52 53
       <el-table-column label="整改状态" align="center" prop="statusDesc" width="100" />

+ 28 - 31
src/views/check/checkRecord/components/Details.vue

@@ -15,25 +15,20 @@
15 15
           </el-col>
16 16
           <el-col :span="12">
17 17
             <el-form-item label="被检查人/科/班组" prop="checkedDepartmentName">
18
-              <el-input
19
-                v-if=" form.checkedLevel === 'DEPARTMENT_LEVEL' "
20
-                :value="form.checkedDepartmentName"
18
+              <el-input v-if="form.checkedLevel === 'DEPARTMENT_LEVEL'" :value="form.checkedDepartmentName"
21 19
                 :placeholder="disabled ? '-' : '请输入被检查人/科/班组'" />
22
-              <el-input
23
-                v-else-if=" form.checkedLevel === 'TEAM_LEVEL' "
24
-                :value="form.checkedTeamName"
20
+              <el-input v-else-if="form.checkedLevel === 'TEAM_LEVEL'" :value="form.checkedTeamName"
25 21
                 :placeholder="disabled ? '-' : '请输入被检查人/科/班组'" />
26
-              <el-input
27
-                v-else-if=" form.checkedLevel === 'PERSONNEL_LEVEL' "
28
-                :value="form.checkedPersonnelName"
22
+              <el-input v-else-if="form.checkedLevel === 'PERSONNEL_LEVEL'" :value="form.checkedPersonnelName"
23
+                :placeholder="disabled ? '-' : '请输入被检查人/科/班组'" />
24
+              <el-input v-else-if="form.checkedLevel === 'BRIGADE_LEVEL'" :value="form.checkedBrigadeName"
29 25
                 :placeholder="disabled ? '-' : '请输入被检查人/科/班组'" />
30 26
               <el-input v-else />
31 27
             </el-form-item>
32 28
           </el-col>
33 29
           <el-col :span="12">
34 30
             <el-form-item label="检查地点" prop="nickName">
35
-              <el-input
36
-                :value="viewText( form.terminlName, form.regionalName, form.channelName )"
31
+              <el-input :value="viewText(form.terminlName, form.regionalName, form.channelName)"
37 32
                 :placeholder="disabled ? '-' : '请输入检查地点'" />
38 33
             </el-form-item>
39 34
           </el-col>
@@ -48,26 +43,20 @@
48 43
       <el-card header="巡检项目" style="margin-bottom: 10px;">
49 44
         <div>
50 45
           <el-row :gutter="16">
51
-            <el-col :span="24" v-for=" item of groupHandler( form.checkProjectItemList ) " :key="item.id"
46
+            <el-col :span="24" v-for="item of groupHandler(form.checkProjectItemList)" :key="item.id"
52 47
               style="margin-bottom: 15px;">
53 48
               <div class="title">{{ item.title }}</div>
54
-              <div v-for=" attr in item.list " :key="attr.index" style="padding: 0 30px; box-sizing: border-box;">
49
+              <div v-for="attr in item.list" :key="attr.index" style="padding: 0 30px; box-sizing: border-box;">
55 50
                 <el-form-item :label="attr.projectName" label-width="auto"
56 51
                   :prop="`checkProjectItemList.${attr.index}.scoreLevel`">
57
-                  <el-switch
58
-                    v-model="attr.scoreLevel"
59
-                    active-value="QUALIFIED"
60
-                    inactive-value="UNQUALIFIED"
61
-                    inline-prompt
62
-                    active-text="符合"
63
-                    inactive-text="不符合"
52
+                  <el-switch v-model="attr.scoreLevel" active-value="QUALIFIED" inactive-value="UNQUALIFIED"
53
+                    inline-prompt active-text="符合" inactive-text="不符合"
64 54
                     style="--el-switch-on-color: rgb(98, 111, 240); --el-switch-off-color: #ff4949" />
65 55
                 </el-form-item>
66
-                <div v-if=" attr.scoreLevel === 'UNQUALIFIED' " style="padding: 0 30px; box-sizing: border-box;">
67
-                  <el-form-item v-if=" attr.checkUserList && attr.checkUserList.length " label="不合格人员" label-width="6em" prop="checkedPersonnelName">
68
-                    <el-input
69
-                      :value="getUserName( attr.checkUserList )" 
70
-                    />
56
+                <div v-if="attr.scoreLevel === 'UNQUALIFIED'" style="padding: 0 30px; box-sizing: border-box;">
57
+                  <el-form-item v-if="attr.checkUserList && attr.checkUserList.length" label="不合格人员" label-width="6em"
58
+                    prop="checkedPersonnelName">
59
+                    <el-input :value="getUserName(attr.checkUserList)" />
71 60
                   </el-form-item>
72 61
                   <el-form-item v-if="attr.problemDescription" label="问题描述" label-width="6em"
73 62
                     :prop="`checkProjectItemList.${attr.index}.problemDescription`">
@@ -76,10 +65,10 @@
76 65
                 </div>
77 66
               </div>
78 67
             </el-col>
79
-            <el-col :span="24" v-if=" form.baseAttachmentList && form.baseAttachmentList.length ">
68
+            <el-col :span="24" v-if="form.baseAttachmentList && form.baseAttachmentList.length">
80 69
               <div class="title">不合格照片</div>
81 70
               <div class="imgList">
82
-                <ImageUpload :modelValue="transformImglistData( form.baseAttachmentList )" disabled />
71
+                <ImageUpload :modelValue="transformImglistData(form.baseAttachmentList)" disabled />
83 72
               </div>
84 73
             </el-col>
85 74
           </el-row>
@@ -138,12 +127,20 @@ const getUserInfo = () => {
138 127
 }
139 128
 
140 129
 const getUserName = (list) => {
130
+  let res = ''
141 131
   if (Array.isArray(list) && list.length) {
142
-    return list.map(attr => {
132
+    res = list.map(attr => {
143 133
       return (listUserOption.value.find(item => item.value === attr.userId) || {}).label
144 134
     }).filter(Boolean).join('、')
145 135
   }
146
-  return '-'
136
+
137
+  if (res) {
138
+    return res
139
+  } else {
140
+    res = list.map((item) => item.userName).join('、')
141
+    return res || '-'
142
+  }
143
+
147 144
 }
148 145
 
149 146
 const transformImglistData = (imgList) => {
@@ -168,13 +165,13 @@ const groupHandler = (list) => {
168 165
     return list.reduce((cur, acc, index) => {
169 166
       const findIndex = cur.findIndex(item => item.categoryCodeOne === acc.categoryCodeOne && item.categoryCodeTwo === acc.categoryCodeTwo)
170 167
       if (findIndex >= 0) {
171
-        cur[ findIndex ].list.push({ index, ...acc })
168
+        cur[findIndex].list.push({ index, ...acc })
172 169
       } else {
173 170
         cur.push({
174 171
           title: `${acc.categoryNameOne}/${acc.categoryNameTwo}`,
175 172
           categoryCodeOne: acc.categoryCodeOne,
176 173
           categoryCodeTwo: acc.categoryCodeTwo,
177
-          list: [ { index, ...acc } ]
174
+          list: [{ index, ...acc }]
178 175
         })
179 176
       }
180 177
       return cur

+ 1 - 0
src/views/check/checkRecord/index.vue

@@ -117,6 +117,7 @@
117 117
           <div v-if="scope.row.checkedLevel === 'DEPARTMENT_LEVEL'">{{ scope.row.checkedDepartmentName }}</div>
118 118
           <div v-if="scope.row.checkedLevel === 'TEAM_LEVEL'">{{ scope.row.checkedTeamName }}</div>
119 119
           <div v-if="scope.row.checkedLevel === 'PERSONNEL_LEVEL'">{{ scope.row.checkedPersonnelName }}</div>
120
+          <div v-if="scope.row.checkedLevel === 'BRIGADE_LEVEL'">{{ scope.row.checkedBrigadeName }}</div>
120 121
         </template>
121 122
       </el-table-column>
122 123
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="100">

+ 2 - 2
src/views/check/checkTask/index.vue

@@ -141,14 +141,14 @@
141 141
               </div>
142 142
             </el-form-item>
143 143
           </el-col>
144
-          <el-col :span="12">
144
+          <!-- <el-col :span="12">
145 145
             <el-form-item label="是否科内自查" prop="isSelfCheck">
146 146
               <el-radio-group v-model="form.isSelfCheck" :disabled="formDisabled">
147 147
                 <el-radio :value="1">是</el-radio>
148 148
                 <el-radio :value="0">否</el-radio>
149 149
               </el-radio-group>
150 150
             </el-form-item>
151
-          </el-col>
151
+          </el-col> -->
152 152
           <el-col :span="12" v-if="form.isSelfCheck === 1">
153 153
             <el-form-item label="自查科室" prop="selfCheckDeptId" :required="true">
154 154
               <el-select v-model="form.selfCheckDeptId" placeholder="请选择自查科室" style="width: 100%"