From 70d6b00181e291c342df11c9e3d95451768f455d Mon Sep 17 00:00:00 2001
From: 祖安之光 <11848914+light-of-zuan@user.noreply.gitee.com>
Date: Fri, 10 Apr 2026 16:17:27 +0800
Subject: [PATCH] 修改暂存
---
src/views/saftyCheckMng/dailyCheck/index.vue | 61 +++++++++++-------------------
1 files changed, 23 insertions(+), 38 deletions(-)
diff --git a/src/views/saftyCheckMng/dailyCheck/index.vue b/src/views/saftyCheckMng/dailyCheck/index.vue
index f7f0955..ae8afcc 100644
--- a/src/views/saftyCheckMng/dailyCheck/index.vue
+++ b/src/views/saftyCheckMng/dailyCheck/index.vue
@@ -182,7 +182,6 @@
haveMainHazard: null,
checkBeginDate: "",
checkEndDate: "",
- scratchpad: 2
},
originDeptList: [],
dataList: [],
@@ -312,14 +311,14 @@
rules: [{ required: true, message: "请选择复查时间", trigger: "blur" }],
},
{
- label: '检查图片',
- prop: 'checkPics',
- type: 'upload',
- uploadType: 'img',
+ label: "检查图片",
+ prop: "checkPics",
+ type: "upload",
+ uploadType: "img",
limit: 3,
maxSize: 5,
- accept: 'image/*',
- tip: '支持上传图片格式,尺寸小于5M,最多可上传3份'
+ accept: "image/*",
+ tip: "支持上传图片格式,尺寸小于5M,最多可上传3份",
},
{
label: "备注",
@@ -409,28 +408,8 @@
}
};
-const openDialog = async(type, value) => {
- let initalData = {}
- if(type == 'add'){
- const res = await getDailySafetyInspectList({
- pageNum: 1,
- pageSize: 10,
- researchGroup: null,
- checkUser: "",
- checkType: null,
- haveMainHazard: null,
- checkBeginDate: "",
- checkEndDate: "",
- scratchpad: 1
- })
- if (res.code == 200) {
- initalData = JSON.parse(JSON.stringify(res.rows[0])) || {}
- } else {
- ElMessage.warning(res.msg);
- }
- }else{
- initalData = JSON.parse(JSON.stringify(value));
- }
+const openDialog = async (type, value) => {
+ const initalData = JSON.parse(JSON.stringify(value));
if (
initalData.dailySafetyInspectionDepts &&
Array.isArray(initalData.dailySafetyInspectionDepts)
@@ -509,15 +488,21 @@
const handleSave = async (data) => {
const params = JSON.parse(JSON.stringify(data));
- params.dailySafetyInspectionDepts = params.dailySafetyInspectionDepts.map(
- (i) => {
- return {
- deptId: i,
- deptName: state.originDeptList.find((item) => item.deptId == i)
- ?.deptName,
- };
- },
- );
+ if (
+ params.dailySafetyInspectionDepts &&
+ Array.isArray(params.dailySafetyInspectionDepts)
+ ) {
+ params.dailySafetyInspectionDepts = params.dailySafetyInspectionDepts.map(
+ (i) => {
+ return {
+ deptId: i,
+ deptName: state.originDeptList.find((item) => item.deptId == i)
+ ?.deptName,
+ };
+ },
+ );
+ }
+
const res = await saveTemDailySafetyInspect(params);
if (res.code == 200) {
ElMessage.success(res.msg);
--
Gitblit v1.9.2