Browse Source

Merge branch 'missingDetectionStatistics' into dev

huoyi 3 weeks ago
parent
commit
9989036db9

+ 62 - 0
src/api/missedInspection/missedInspection.js

@@ -0,0 +1,62 @@
1
+import request from '@/utils/request'
2
+
3
+// 查询漏检列表
4
+export function listMissedInspection(query) {
5
+  return request({
6
+    url: '/blocked/missReview/list',
7
+    method: 'get',
8
+    params: query
9
+  })
10
+}
11
+
12
+// 查询漏检详细
13
+export function getMissedInspection(id) {
14
+  return request({
15
+    url: `/blocked/missReview/${id}`,
16
+    method: 'get'
17
+  })
18
+}
19
+
20
+// 新增漏检
21
+export function addMissedInspection(data) {
22
+  return request({
23
+    url: '/blocked/missReview',
24
+    method: 'post',
25
+    data: data
26
+  })
27
+}
28
+
29
+// 修改漏检
30
+export function updateMissedInspection(data) {
31
+  return request({
32
+    url: '/blocked/missReview',
33
+    method: 'post',
34
+    data: data
35
+  })
36
+}
37
+
38
+// 删除漏检
39
+export function delMissedInspection(ids) {
40
+  return request({
41
+    url: `/blocked/missReview/${ids}`,
42
+    method: 'delete'
43
+  })
44
+}
45
+
46
+// 导出漏检
47
+export function exportMissedInspection(data) {
48
+  return request({
49
+    url: '/blocked/missReview/export',
50
+    method: 'post',
51
+    data: data
52
+  })
53
+}
54
+
55
+// 下载导入模板
56
+export function downloadTemplate() {
57
+  return request({
58
+    url: '/blocked/missReview/importTemplate',
59
+    method: 'get',
60
+    responseType: 'blob'
61
+  })
62
+}

+ 10 - 0
src/api/system/category.js

@@ -0,0 +1,10 @@
1
+import request from '@/utils/request'
2
+
3
+// 查询漏检物品分类列表
4
+export function listCategory(query) {
5
+  return request({
6
+    url: '/system/category/list',
7
+    method: 'get',
8
+    params: query
9
+  })
10
+}

+ 8 - 0
src/api/system/dept/dept.js

@@ -29,3 +29,11 @@ export function getDeptDetail(deptId) {
29 29
     method: 'get',
30 30
   })
31 31
 }
32
+// 查询部门列表
33
+export function listDept(query) {
34
+  return request({
35
+    url: '/system/dept/list',
36
+    method: 'get',
37
+    params: query
38
+  })
39
+}

+ 51 - 0
src/api/system/position.js

@@ -0,0 +1,51 @@
1
+import request from '@/utils/request'
2
+
3
+// 查询位置列表
4
+export function listPosition(query) {
5
+  return request({
6
+    url: '/system/position/list',
7
+    method: 'get',
8
+    params: query
9
+  })
10
+}
11
+
12
+// 查询位置详细
13
+export function getPosition(id) {
14
+  return request({
15
+    url: '/system/position/' + id,
16
+    method: 'get'
17
+  })
18
+}
19
+
20
+// 新增位置
21
+export function addPosition(data) {
22
+  return request({
23
+    url: '/system/position',
24
+    method: 'post',
25
+    data: data
26
+  })
27
+}
28
+
29
+// 修改位置
30
+export function updatePosition(data) {
31
+  return request({
32
+    url: '/system/position',
33
+    method: 'put',
34
+    data: data
35
+  })
36
+}
37
+
38
+// 删除位置
39
+export function delPosition(id) {
40
+  return request({
41
+    url: '/system/position/' + id,
42
+    method: 'delete'
43
+  })
44
+}
45
+//查询位置列表树形结构
46
+export function treePosition() {
47
+  return request({
48
+    url: '/system/position/listTree',
49
+    method: 'get'
50
+  })
51
+}

+ 8 - 0
src/api/system/user.js

@@ -125,4 +125,12 @@ export function getPostAllList() {
125 125
     url: '/system/post/listAllTree',
126 126
     method: 'get',
127 127
   })
128
+}
129
+//根据用户ID和角色编码列表查询各级直属领导列表
130
+export function selectUserLeaderListByCondition(data) {
131
+  return request({
132
+    url: '/system/user/selectUserLeaderListByCondition',
133
+    method: 'post',
134
+    data: data
135
+  })
128 136
 }

+ 3 - 2
src/config.js

@@ -4,8 +4,9 @@ module.exports = {
4 4
  // baseUrl: process.env.NODE_ENV === 'development' ? 'http://192.168.3.221:82/prod-api' : '/prod-api', //生产
5 5
   //  baseUrl: process.env.NODE_ENV === 'development' ? 'http://192.168.3.221:8080' : '/prod-api',
6 6
 // baseUrl: process.env.NODE_ENV === 'development' ? 'http://guangxi.qinghe.sundot.cn:8088' : 'http://guangxi.qinghe.sundot.cn:8088/prod-api',
7
-    baseUrl: 'http://airport.samsundot.com:9024/prod-api',//测试
8
-// baseUrl:'http://airport.samsundot.com:9021/prod-api',//生产
7
+
8
+    baseUrl: 'http://airport-test.samsundot.com:9025/prod-api',//测试
9
+ //baseUrl:'http://airport.samsundot.com:9021/prod-api',//生产
9 10
   // 应用信息
10 11
   appInfo: {
11 12
     // 应用名称

+ 6 - 0
src/pages.json

@@ -315,6 +315,12 @@
315 315
       }
316 316
     },
317 317
     {
318
+      "path": "pages/missedInspectionList/index",
319
+      "style": {
320
+        "navigationBarTitleText": "漏检统计"
321
+      }
322
+    },
323
+    {
318 324
       "path": "pages/seizureRecord/index",
319 325
       "style": {
320 326
         "navigationBarTitleText": "查获记录"

+ 524 - 0
src/pages/missedInspectionList/index.vue

@@ -0,0 +1,524 @@
1
+<template>
2
+    <home-container :customStyle="{ background: 'none' }" :customHomeStyle="{ overflow: 'hidden' }">
3
+        <scroll-view scroll-y class="form-scroll">
4
+            <view class="form-container">
5
+                <uni-forms ref="formRef" :rules="rules" :modelValue="formData" label-position="left" err-show-type="modal"
6
+                    :label-width="150">
7
+                    <view class="form-row">
8
+                        <uni-forms-item label="大队" name="brigadeId" required>
9
+                            <uni-data-picker :localdata="brigadeOptions" popup-title="请选择大队" v-model="formData.brigadeId"
10
+                                @change="handleFormBrigadeChange" />
11
+                        </uni-forms-item>
12
+                    </view>
13
+                    <view class="form-row">
14
+                        <uni-forms-item label="被回查人" name="reviewedUserId" required>
15
+                            <uni-data-picker :localdata="personOptions" popup-title="请选择被回查人" v-model="formData.reviewedUserId"
16
+                                @change="handleReviewedUserChange" />
17
+                        </uni-forms-item>
18
+                    </view>
19
+                    <view class="form-row">
20
+                        <uni-forms-item label="回查日期" name="reviewDate" required>
21
+                            <uni-datetime-picker type="date" v-model="formData.reviewDate" />
22
+                        </uni-forms-item>
23
+                    </view>
24
+                    <view class="form-row">
25
+                        <uni-forms-item label="漏检时间" name="missCheckTime" required>
26
+                            <uni-datetime-picker type="datetime" v-model="formData.missCheckTime" />
27
+                        </uni-forms-item>
28
+                    </view>
29
+                    <view class="form-row">
30
+                        <uni-forms-item label="漏检时间段" name="missCheckTimePeriod" required>
31
+                            <uni-data-picker :localdata="blockedTimePeriodOptions" popup-title="请选择漏检时间段"
32
+                                v-model="formData.missCheckTimePeriod" />
33
+                        </uni-forms-item>
34
+                    </view>
35
+                    <view class="form-row">
36
+                        <uni-forms-item label="上岗位置" name="channelId" required>
37
+                            <uni-data-picker :localdata="areaOptions" popup-title="请选择上岗位置" v-model="formData.channelId" />
38
+                        </uni-forms-item>
39
+                    </view>
40
+                    <view class="form-row">
41
+                        <uni-forms-item label="漏检物品" name="missCheckItem" required>
42
+                            <uni-data-picker :localdata="missCheckItemOptions" popup-title="请选择漏检物品"
43
+                                v-model="formData.missCheckItem" />
44
+                        </uni-forms-item>
45
+                    </view>
46
+                    <view class="form-row">
47
+                        <uni-forms-item label="分管主管" name="supervisorId" required>
48
+                            <uni-data-picker :localdata="supervisorOptions" popup-title="请选择分管主管"
49
+                                v-model="formData.supervisorId" />
50
+                        </uni-forms-item>
51
+                    </view>
52
+                    <view class="form-row">
53
+                        <uni-forms-item label="代管主管" name="actingSupervisorId">
54
+                            <uni-data-picker :localdata="supervisorOptions" popup-title="请选择代管主管"
55
+                                v-model="formData.actingSupervisorId" />
56
+                        </uni-forms-item>
57
+                    </view>
58
+                    <view class="form-row">
59
+                        <uni-forms-item label="分管班组长" name="teamLeaderId" required>
60
+                            <uni-data-picker :localdata="teamLeaderOptions" popup-title="请选择分管班组长"
61
+                                v-model="formData.teamLeaderId" />
62
+                        </uni-forms-item>
63
+                    </view>
64
+                    <view class="form-row">
65
+                        <uni-forms-item label="物品位置" name="itemLocation" required>
66
+                            <uni-data-picker :localdata="blockedItemPositionOptions" popup-title="请选择物品位置"
67
+                                v-model="formData.itemLocation" />
68
+                        </uni-forms-item>
69
+                    </view>
70
+                    <view class="form-row">
71
+                        <uni-forms-item label="简单/难" name="difficultyLevel" required>
72
+                            <uni-data-picker :localdata="difficultyLevelOptions" popup-title="请选择难度"
73
+                                v-model="formData.difficultyLevel" />
74
+                        </uni-forms-item>
75
+                    </view>
76
+                    <view class="form-row">
77
+                        <uni-forms-item label="回查人" name="reviewUserId" required>
78
+                            <uni-data-picker :localdata="personOptions" popup-title="请选择回查人" v-model="formData.reviewUserId" />
79
+                        </uni-forms-item>
80
+                    </view>
81
+                    <view class="form-row">
82
+                        <uni-forms-item label="判别类型" name="discriminationType" required>
83
+                            <uni-data-picker :localdata="discriminationTypeOptions" popup-title="请选择判别类型"
84
+                                v-model="formData.discriminationType" />
85
+                        </uni-forms-item>
86
+                    </view>
87
+                    <view class="form-row">
88
+                        <uni-forms-item label="是否追回" name="isRecovered" required>
89
+                            <uni-data-picker :localdata="isRecoveredOptions" popup-title="请选择是否追回"
90
+                                v-model="formData.isRecovered" />
91
+                        </uni-forms-item>
92
+                    </view>
93
+                    <view class="form-row">
94
+                        <uni-forms-item label="开机年限" name="machineOperatingYears" required>
95
+                            <uni-data-picker :localdata="blockedOperatingYearsOptions" popup-title="请选择开机年限"
96
+                                v-model="formData.machineOperatingYears" />
97
+                        </uni-forms-item>
98
+                    </view>
99
+                    <view class="form-row">
100
+                        <uni-forms-item label="证书级别" name="certificateLevel" required>
101
+                            <uni-data-picker :localdata="certificateLevelOptions" popup-title="请选择证书级别"
102
+                                v-model="formData.certificateLevel" />
103
+                        </uni-forms-item>
104
+                    </view>
105
+                    <view class="form-row">
106
+                        <uni-forms-item label="人员性别" name="gender" required>
107
+                            <uni-data-picker :localdata="genderOptions" popup-title="请选择人员性别" v-model="formData.gender" />
108
+                        </uni-forms-item>
109
+                    </view>
110
+                    <view class="form-row">
111
+                        <uni-forms-item label="漏检原因分类" name="missCheckReasonCategory" required>
112
+                            <uni-data-picker :localdata="blockedMissCheckReasonOptions" popup-title="请选择漏检原因分类"
113
+                                v-model="formData.missCheckReasonCategory" />
114
+                        </uni-forms-item>
115
+                    </view>
116
+                    <view class="form-row">
117
+                        <uni-forms-item label="月考成绩" name="monthlyAssessment" required>
118
+                            <uni-data-picker :localdata="blockedMonthlyExamResultOptions" popup-title="请选择月考成绩"
119
+                                v-model="formData.monthlyAssessment" />
120
+                        </uni-forms-item>
121
+                    </view>
122
+                    <view class="form-row">
123
+                        <uni-forms-item label="本月自测有无漏检(请输入0-2的整数)" name="selfTestHasMissCheck" required>
124
+                            <uni-number-box :min="0" :max="2" v-model="formData.selfTestHasMissCheck"  ></uni-number-box>
125
+                        </uni-forms-item>
126
+                    </view>
127
+                </uni-forms>
128
+            </view>
129
+        </scroll-view>
130
+
131
+        <view class="submit-bar">
132
+            <view class="submit-btn" @click="submitForm">提交</view>
133
+        </view>
134
+    </home-container>
135
+</template>
136
+
137
+<script>
138
+import HomeContainer from "@/components/HomeContainer.vue";
139
+import { listPosition } from '@/api/system/position';
140
+import { addMissedInspection } from '@/api/missedInspection/missedInspection';
141
+import { listDept } from '@/api/system/dept/dept';
142
+import { getUserList, selectUserLeaderListByCondition, getUserInfoById } from '@/api/system/user';
143
+import { listCategory } from '@/api/system/category';
144
+import { formatTime } from '@/utils/formatUtils';
145
+import useDictMixin from '@/utils/dict';
146
+
147
+export default {
148
+    name: 'MissedInspectionAdd',
149
+    components: {
150
+        HomeContainer
151
+    },
152
+    mixins: [useDictMixin],
153
+    data() {
154
+        return {
155
+            formData: {
156
+                id: null,
157
+                brigadeId: null,
158
+                brigadeName: null,
159
+                reviewedUserId: null,
160
+                reviewedUserName: null,
161
+                reviewDate: '',
162
+                missCheckTime: '',
163
+                missCheckTimePeriod: null,
164
+                channelId: null,
165
+                channelName: null,
166
+                missCheckItem: null,
167
+                supervisorId: null,
168
+                supervisorName: null,
169
+                actingSupervisorId: null,
170
+                actingSupervisorName: null,
171
+                teamLeaderId: null,
172
+                teamLeaderName: null,
173
+                itemLocation: null,
174
+                difficultyLevel: null,
175
+                reviewUserId: null,
176
+                reviewUserName: null,
177
+                discriminationType: null,
178
+                isRecovered: null,
179
+                machineOperatingYears: null,
180
+                certificateLevel: null,
181
+                gender: null,
182
+                missCheckReasonCategory: null,
183
+                monthlyAssessment: null,
184
+                selfTestHasMissCheck: 0
185
+            },
186
+
187
+            rules: {
188
+                brigadeId: [{ required: true, errorMessage: '大队不能为空' }],
189
+                reviewedUserId: [{ required: true, errorMessage: '被回查人不能为空' }],
190
+                reviewDate: [{ required: true, errorMessage: '回查日期不能为空' }],
191
+                missCheckTime: [{ required: true, errorMessage: '漏检时间不能为空' }],
192
+                missCheckTimePeriod: [{ required: true, errorMessage: '漏检时间段不能为空' }],
193
+                channelId: [{ required: true, errorMessage: '上岗位置不能为空' }],
194
+                missCheckItem: [{ required: true, errorMessage: '漏检物品不能为空' }],
195
+                supervisorId: [{ required: true, errorMessage: '分管主管不能为空' }],
196
+                teamLeaderId: [{ required: true, errorMessage: '分管班组长不能为空' }],
197
+                itemLocation: [{ required: true, errorMessage: '物品位置不能为空' }],
198
+                difficultyLevel: [{ required: true, errorMessage: '简单/难不能为空' }],
199
+                reviewUserId: [{ required: true, errorMessage: '回查人不能为空' }],
200
+                discriminationType: [{ required: true, errorMessage: '判别类型不能为空' }],
201
+                isRecovered: [{ 
202
+                    validateFunction: function(rule, value, data, callback) {
203
+                        if (value === null || value === undefined || value === '') {
204
+                            callback('是否追回不能为空');
205
+                        }
206
+                        callback();
207
+                    }
208
+                }],
209
+                machineOperatingYears: [{ required: true, errorMessage: '开机年限不能为空' }],
210
+                certificateLevel: [{ required: true, errorMessage: '证书级别不能为空' }],
211
+                gender: [{ required: true, errorMessage: '人员性别不能为空' }],
212
+                missCheckReasonCategory: [{ required: true, errorMessage: '漏检原因分类不能为空' }],
213
+                monthlyAssessment: [{ required: true, errorMessage: '月考成绩不能为空' }],
214
+                selfTestHasMissCheck: [{ required: true, errorMessage: '本月自测有无漏检不能为空' }]
215
+            },
216
+
217
+            brigadeOptions: [],
218
+            personOptions: [],
219
+            teamLeaderOptions: [],
220
+            supervisorOptions: [],
221
+            areaOptions: [],
222
+            missCheckItemOptions: [],
223
+
224
+            discriminationTypeOptions: [],
225
+            blockedTimePeriodOptions: [],
226
+            blockedItemPositionOptions: [],
227
+            blockedMonthlyExamResultOptions: [],
228
+            blockedOperatingYearsOptions: [],
229
+            blockedMissCheckReasonOptions: [],
230
+            difficultyLevelOptions: [
231
+                { text: '简单', value: '简单' },
232
+                { text: '难', value: '难' }
233
+            ],
234
+            isRecoveredOptions: [
235
+                { text: '是', value: 1 },
236
+                { text: '否', value: 0 }
237
+            ],
238
+            certificateLevelOptions: [
239
+                { text: '高级', value: '高级' },
240
+                { text: '中级', value: '中级' },
241
+                { text: '初级', value: '初级' }
242
+            ],
243
+            genderOptions: [
244
+                { text: '男', value: '男' },
245
+                { text: '女', value: '女' }
246
+            ]
247
+        }
248
+    },
249
+    onLoad() {
250
+        this.initData();
251
+    },
252
+    methods: {
253
+        initData() {
254
+            this.getUserAll();
255
+            this.getDeptList();
256
+            this.getPositionList();
257
+            this.getTeamLeaderOptions();
258
+            this.getSupervisorOptions();
259
+            this.getMissCheckItemOptions();
260
+            this.getDictData();
261
+            this.formData.missCheckTime = formatTime(new Date(), 'YYYY-MM-DD hh:mm');
262
+            this.formData.reviewDate = formatTime(new Date(), 'YYYY-MM-DD');
263
+        },
264
+
265
+        async getDictData() {
266
+            const dict = await this.useDict(
267
+                'discrimination_type',
268
+                'blocked_time_period',
269
+                'blocked_item_position',
270
+                'blocked_monthly_exam_result',
271
+                'blocked_operating_years',
272
+                'blocked_miss_check_reason'
273
+            );
274
+
275
+            const formatDict = (options) => {
276
+                return (options || []).map(item => ({
277
+                    value: item.value,
278
+                    text: item.label || item.text
279
+                }));
280
+            };
281
+
282
+            this.discriminationTypeOptions = formatDict(dict.discrimination_type);
283
+            this.blockedTimePeriodOptions = formatDict(dict.blocked_time_period);
284
+            this.blockedItemPositionOptions = formatDict(dict.blocked_item_position);
285
+            this.blockedMonthlyExamResultOptions = formatDict(dict.blocked_monthly_exam_result);
286
+            this.blockedOperatingYearsOptions = formatDict(dict.blocked_operating_years);
287
+            this.blockedMissCheckReasonOptions = formatDict(dict.blocked_miss_check_reason);
288
+        },
289
+
290
+        getDeptList() {
291
+            listDept({}).then(res => {
292
+                const deptList = res.data || [];
293
+                this.brigadeOptions = deptList.filter(item => item.deptType === 'BRIGADE' && [311, 314, 315].includes(item.deptId)).map(item => ({
294
+                    value: item.deptId,
295
+                    text: item.deptName
296
+                }));
297
+            });
298
+        },
299
+
300
+        getUserAll() {
301
+            getUserList({ pageNum: 1, pageSize: 1000 }).then(res => {
302
+                this.personOptions = (res.rows || []).map(item => ({
303
+                    value: item.userId,
304
+                    text: item.nickName
305
+                }));
306
+            });
307
+        },
308
+
309
+        getPositionList() {
310
+            listPosition({ positionType: 'CHANNEL' }).then(res => {
311
+                this.areaOptions = (res.data || []).map(item => ({
312
+                    value: item.id,
313
+                    text: item.name
314
+                }));
315
+            });
316
+        },
317
+
318
+        getTeamLeaderOptions() {
319
+            selectUserLeaderListByCondition({ roleKeyList: ['banzuzhang'] }).then(res => {
320
+                this.teamLeaderOptions = (res.data || []).map(item => ({
321
+                    value: item.userId,
322
+                    text: item.nickName
323
+                }));
324
+            });
325
+        },
326
+
327
+        getSupervisorOptions() {
328
+            selectUserLeaderListByCondition({ roleKeyList: ['kezhang'] }).then(res => {
329
+                this.supervisorOptions = (res.data || []).map(item => ({
330
+                    value: item.userId,
331
+                    text: item.nickName
332
+                }));
333
+            });
334
+        },
335
+
336
+        getMissCheckItemOptions() {
337
+            listCategory().then(res => {
338
+                const data = res.data || [];
339
+                this.missCheckItemOptions = this.flattenTree(data);
340
+            });
341
+        },
342
+
343
+        flattenTree(data, parentLabel = '') {
344
+            const result = [];
345
+            data.forEach(item => {
346
+                const label = parentLabel ? `${parentLabel} / ${item.name}` : item.name;
347
+                if (item.children && item.children.length > 0) {
348
+                    result.push(...this.flattenTree(item.children, label));
349
+                } else {
350
+                    result.push({
351
+                        value: item.name,
352
+                        text: label
353
+                    });
354
+                }
355
+            });
356
+            return result;
357
+        },
358
+
359
+        handleReviewedUserChange(e) {
360
+            let userId = e.detail.value;
361
+            if (Array.isArray(userId)) {
362
+                userId = userId[0]?.value;
363
+            } else if (userId && typeof userId === 'object') {
364
+                userId = userId.value;
365
+            }
366
+            if (userId) {
367
+                selectUserLeaderListByCondition({ userId: userId, roleKeyList: ['banzuzhang'] }).then(res => {
368
+                    if (res.data && res.data.length > 0) {
369
+                        this.formData.teamLeaderId = res.data[0].userId;
370
+                    }
371
+                });
372
+                selectUserLeaderListByCondition({ userId: userId, roleKeyList: ['kezhang'] }).then(res => {
373
+                    if (res.data && res.data.length > 0) {
374
+                        this.formData.supervisorId = res.data[0].userId;
375
+                    }
376
+                });
377
+                getUserInfoById(userId).then(res => {
378
+                    const data = res?.data;
379
+                    if (data) {
380
+                        this.formData.gender = data.sex === '0' ? '男' : '女';
381
+                    }
382
+                });
383
+            } else {
384
+                this.formData.supervisorId = null;
385
+                this.formData.teamLeaderId = null;
386
+                this.formData.gender = null;
387
+            }
388
+        },
389
+
390
+        handleFormBrigadeChange(e) {
391
+            const brigadeId = e.detail.value;
392
+            const brigade = this.brigadeOptions.find(item => item.value === brigadeId);
393
+            this.formData.brigadeName = brigade ? brigade.label : null;
394
+        },
395
+
396
+        submitForm() {
397
+       
398
+
399
+            const requiredFields = [
400
+                { key: 'brigadeId', label: '大队' },
401
+                { key: 'reviewedUserId', label: '被回查人' },
402
+                { key: 'reviewDate', label: '回查日期' },
403
+                { key: 'missCheckTime', label: '漏检时间' },
404
+                { key: 'missCheckTimePeriod', label: '漏检时间段' },
405
+                { key: 'channelId', label: '上岗位置' },
406
+                { key: 'missCheckItem', label: '漏检物品' },
407
+                { key: 'supervisorId', label: '分管主管' },
408
+                { key: 'teamLeaderId', label: '分管班组长' },
409
+                { key: 'itemLocation', label: '物品位置' },
410
+                { key: 'difficultyLevel', label: '简单/难' },
411
+                { key: 'reviewUserId', label: '回查人' },
412
+                { key: 'discriminationType', label: '判别类型' },
413
+                { key: 'isRecovered', label: '是否追回' },
414
+                { key: 'machineOperatingYears', label: '开机年限' },
415
+                { key: 'certificateLevel', label: '证书级别' },
416
+                { key: 'gender', label: '人员性别' },
417
+                { key: 'missCheckReasonCategory', label: '漏检原因分类' },
418
+                { key: 'monthlyAssessment', label: '月考成绩' },
419
+                { key: 'selfTestHasMissCheck', label: '本月自测有无漏检' }
420
+            ];
421
+
422
+            for (const field of requiredFields) {
423
+                const value = this.formData[field.key];
424
+                if (value === null || value === undefined || value === '') {
425
+                    uni.showToast({ title: `${field.label}不能为空`, icon: 'none' });
426
+                    return;
427
+                }
428
+            }
429
+
430
+            this.mapNames();
431
+            console.log(this.formData);
432
+            addMissedInspection(this.formData).then(() => {
433
+                uni.showToast({ title: '新增成功', icon: 'success' });
434
+                
435
+                setTimeout(() => {
436
+                    uni.navigateBack();
437
+                }, 1500);
438
+            }).catch(() => {
439
+                uni.showToast({ title: '新增失败', icon: 'none' });
440
+            });
441
+        },
442
+        
443
+    
444
+
445
+        mapNames() {
446
+            if (this.formData.brigadeId) {
447
+                console.log(this.formData.brigadeId,this.brigadeOptions,11);
448
+                const brigade = this.brigadeOptions.find(item => item.value === this.formData.brigadeId);
449
+                this.formData.brigadeName = brigade ? brigade.text : null;
450
+            }
451
+
452
+            if (this.formData.reviewedUserId) {
453
+                const reviewedUser = this.personOptions.find(item => item.value === this.formData.reviewedUserId);
454
+                this.formData.reviewedUserName = reviewedUser ? reviewedUser.text : null;
455
+            }
456
+
457
+            if (this.formData.channelId) {
458
+                const channel = this.areaOptions.find(item => item.value === this.formData.channelId);
459
+                this.formData.channelName = channel ? channel.text : null;
460
+            }
461
+
462
+            if (this.formData.supervisorId) {
463
+                const supervisor = this.supervisorOptions.find(item => item.value === this.formData.supervisorId);
464
+                this.formData.supervisorName = supervisor ? supervisor.text : null;
465
+            }
466
+
467
+            if (this.formData.actingSupervisorId) {
468
+                const actingSupervisor = this.supervisorOptions.find(item => item.value === this.formData.actingSupervisorId);
469
+                this.formData.actingSupervisorName = actingSupervisor ? actingSupervisor.text : null;
470
+            }
471
+
472
+            if (this.formData.teamLeaderId) {
473
+                const teamLeader = this.teamLeaderOptions.find(item => item.value === this.formData.teamLeaderId);
474
+                this.formData.teamLeaderName = teamLeader ? teamLeader.text : null;
475
+            }
476
+
477
+            if (this.formData.reviewUserId) {
478
+                const reviewUser = this.personOptions.find(item => item.value === this.formData.reviewUserId);
479
+                this.formData.reviewUserName = reviewUser ? reviewUser.text : null;
480
+            }
481
+        }
482
+    }
483
+}
484
+</script>
485
+
486
+<style scoped>
487
+.form-scroll {
488
+    height: calc(100vh - 160rpx);
489
+    width: 100%;
490
+    box-sizing: border-box;
491
+}
492
+
493
+.form-container {
494
+    padding: 20rpx;
495
+    background-color: #fff;
496
+}
497
+
498
+.form-row {
499
+    margin-bottom: 20rpx;
500
+}
501
+
502
+.submit-bar {
503
+    position: fixed;
504
+    bottom: 0;
505
+    left: 0;
506
+    right: 0;
507
+    background-color: #fff;
508
+    padding: 15rpx 20rpx;
509
+    border-top: 1px solid #f0f0f0;
510
+    padding-bottom: calc(15rpx + env(safe-area-inset-bottom));
511
+    box-sizing: border-box;
512
+}
513
+
514
+.submit-btn {
515
+    height: 88rpx;
516
+    display: flex;
517
+    align-items: center;
518
+    justify-content: center;
519
+    border-radius: 8rpx;
520
+    font-size: 32rpx;
521
+    color: #fff;
522
+    background-color: #409EFF;
523
+}
524
+</style>