From 731d07b73a4d311b62d72fe1b8b9d0c4acc2b25c Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期五, 05 十二月 2025 16:42:11 +0800
Subject: [PATCH] 1.海川开心-附件模块无法删除,增加删除选项,附件存在突然多出文件的bug

---
 src/views/equipmentManagement/calibration/index.vue |   51 +++++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 45 insertions(+), 6 deletions(-)

diff --git a/src/views/equipmentManagement/calibration/index.vue b/src/views/equipmentManagement/calibration/index.vue
index 2e23184..89d71b6 100644
--- a/src/views/equipmentManagement/calibration/index.vue
+++ b/src/views/equipmentManagement/calibration/index.vue
@@ -13,6 +13,17 @@
 					style="width: 160px"
 					@change="handleQuery"
 				/>
+				<span class="search_title ml10">褰曞叆鏃ユ湡锛�</span>
+				<el-date-picker
+					v-model="searchForm.entryDate"
+					value-format="YYYY-MM-DD"
+					format="YYYY-MM-DD"
+					type="date"
+					placeholder="璇烽�夋嫨"
+					clearable
+					style="width: 160px"
+					@change="handleQuery"
+				/>
 				<span class="search_title ml10">璁¢噺鍣ㄥ叿缂栧彿锛�</span>
 				<el-input v-model="searchForm.code" placeholder="璇疯緭鍏ョ紪鍙�" clearable style="width: 240px" @change="handleQuery"/>
 <!--				<span class="search_title ml10">鐘舵�侊細</span>-->
@@ -46,10 +57,10 @@
 
 <script setup>
 import {onMounted, ref} from "vue";
-import {ElMessageBox} from "element-plus";
+import {ElMessageBox, ElMessage} from "element-plus";
 import useUserStore from "@/store/modules/user.js";
 import CalibrationDia from "@/views/equipmentManagement/measurementEquipment/components/calibrationDia.vue";
-import {ledgerRecordListPage} from "@/api/equipmentManagement/calibration.js";
+import {ledgerRecordListPage, ledgerRecordDelete} from "@/api/equipmentManagement/calibration.js";
 const { proxy } = getCurrentInstance();
 const userStore = useUserStore()
 
@@ -57,7 +68,7 @@
 	searchForm: {
 		recordDate: "",
 		code: "",
-		status: "",
+		entryDate: "",
 	},
 });
 const { searchForm } = toRefs(data);
@@ -123,6 +134,7 @@
 	{
 		dataType: "action",
 		label: "鎿嶄綔",
+		width: 100,
 		align: "center",
 		fixed: 'right',
 		operation: [
@@ -132,9 +144,16 @@
 				clickFun: (row) => {
 					openCalibrationDia("edit", row);
 				},
-				disabled: (row) => {
-					return row.userId !== userStore.id
-				}
+			},
+			{
+				name: "鍒犻櫎",
+				type: "text",
+				style: {
+					color: "#F56C6C"
+				},
+				clickFun: (row) => {
+					handleDelete(row);
+				},
 			},
 		],
 	},
@@ -183,6 +202,26 @@
 	})
 }
 
+// 鍒犻櫎璁板綍
+const handleDelete = (row) => {
+	ElMessageBox.confirm(`纭鍒犻櫎璁¢噺鍣ㄥ叿缂栧彿涓�"${row.code}"鐨勬瀹氳褰曞悧锛焋, "鍒犻櫎纭", {
+		confirmButtonText: "纭",
+		cancelButtonText: "鍙栨秷",
+		type: "warning",
+	})
+		.then(() => {
+			ledgerRecordDelete([row.id]).then(() => {
+				ElMessage.success("鍒犻櫎鎴愬姛");
+				getList();
+			}).catch(() => {
+				ElMessage.error("鍒犻櫎澶辫触");
+			});
+		})
+		.catch(() => {
+			proxy.$modal.msg("宸插彇娑堝垹闄�");
+		});
+};
+
 // 瀵煎嚭
 const handleOut = () => {
 	ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚鍑猴紝鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {

--
Gitblit v1.9.3