From 8efcd56a5a576e6012ef99bfb4d1f0c41359db56 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期五, 05 十二月 2025 16:19:55 +0800
Subject: [PATCH] 1.海川开心-检定校准记录添加删除功能

---
 src/views/equipmentManagement/calibration/index.vue |   35 +++++++++++++++++++++++++++++++++--
 1 files changed, 33 insertions(+), 2 deletions(-)

diff --git a/src/views/equipmentManagement/calibration/index.vue b/src/views/equipmentManagement/calibration/index.vue
index 1eee34a..89d71b6 100644
--- a/src/views/equipmentManagement/calibration/index.vue
+++ b/src/views/equipmentManagement/calibration/index.vue
@@ -57,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()
 
@@ -134,6 +134,7 @@
 	{
 		dataType: "action",
 		label: "鎿嶄綔",
+		width: 100,
 		align: "center",
 		fixed: 'right',
 		operation: [
@@ -142,6 +143,16 @@
 				type: "text",
 				clickFun: (row) => {
 					openCalibrationDia("edit", row);
+				},
+			},
+			{
+				name: "鍒犻櫎",
+				type: "text",
+				style: {
+					color: "#F56C6C"
+				},
+				clickFun: (row) => {
+					handleDelete(row);
 				},
 			},
 		],
@@ -191,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