From 8d541eed8bb02d5a9b32b706cde9665df9a83aec Mon Sep 17 00:00:00 2001
From: xiaoyi <908147524@qq.com>
Date: 星期四, 29 十月 2026 11:47:49 +0800
Subject: [PATCH] refactor(safety): 人员与车间字段改用员工选择器与车间下拉
---
src/views/safety/inspection/record/index.vue | 14 +++++++++-----
1 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/src/views/safety/inspection/record/index.vue b/src/views/safety/inspection/record/index.vue
index b45cd6c..04cdaee 100644
--- a/src/views/safety/inspection/record/index.vue
+++ b/src/views/safety/inspection/record/index.vue
@@ -34,6 +34,7 @@
updateInspection,
uploadSafetyFiles,
} from '#/api/safety';
+import HrmEmployeeSelect from '#/views/hrm/employee/components/select.vue';
import { INSPECTION_RESULT_OPTIONS, splitUrls } from '../../shared';
@@ -55,7 +56,9 @@
const initial = (): SafetyApi.Inspection => ({
pointId: 0,
inspectTime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
- inspector: '',
+ inspectorId: undefined,
+ // 宸℃浜哄鍚嶄负鍚庣鍥炲~鐨勫揩鐓у瓧娈碉紝浠呯敤浜庡睍绀�
+ inspector: undefined,
result: 'NORMAL',
content: '',
photoUrls: '',
@@ -68,7 +71,7 @@
const rules = {
pointId: [{ required: true, message: '璇烽�夋嫨宸℃鐐逛綅' }],
inspectTime: [{ required: true, message: '璇烽�夋嫨宸℃鏃堕棿' }],
- inspector: [{ required: true, whitespace: true, message: '璇疯緭鍏ュ贰妫�浜�' }],
+ inspectorId: [{ required: true, message: '璇烽�夋嫨宸℃浜�' }],
};
const pointOptions = computed(() =>
@@ -168,9 +171,10 @@
try {
const data = {
...model,
- inspector: model.inspector.trim(),
photoUrls: photoList.value.join(','),
};
+ // 宸℃浜哄鍚嶄负鍙蹇収锛屼笉鍐嶆彁浜�
+ delete data.inspector;
await (data.id ? updateInspection(data) : createInspection(data));
message.success('宸℃璁板綍宸蹭繚瀛�');
open.value = false;
@@ -363,8 +367,8 @@
class="w-full"
/>
</FormItem>
- <FormItem label="宸℃浜�" name="inspector">
- <Input v-model:value="model.inspector" :maxlength="50" placeholder="璇疯緭鍏ュ贰妫�浜哄鍚�" />
+ <FormItem label="宸℃浜�" name="inspectorId">
+ <HrmEmployeeSelect v-model="model.inspectorId" placeholder="浠庡憳宸ユ。妗堜腑閫夋嫨宸℃浜�" />
</FormItem>
<FormItem label="宸℃缁撴灉" name="result">
<Select v-model:value="model.result" :options="INSPECTION_RESULT_OPTIONS" />
--
Gitblit v1.9.3