From 212c5847ee2e657de6e7c4d98cbcd0727c8cdb11 Mon Sep 17 00:00:00 2001
From: liyong <18434998025@163.com>
Date: 星期四, 05 三月 2026 11:45:18 +0800
Subject: [PATCH] feat(inventory): 发货台账添加产品名称和规格型号

---
 src/views/customerService/expiryAfterSales/index.vue |  140 +++++++++++++---------------------------------
 1 files changed, 41 insertions(+), 99 deletions(-)

diff --git a/src/views/customerService/expiryAfterSales/index.vue b/src/views/customerService/expiryAfterSales/index.vue
index b958acb..ee5395d 100644
--- a/src/views/customerService/expiryAfterSales/index.vue
+++ b/src/views/customerService/expiryAfterSales/index.vue
@@ -72,7 +72,7 @@
 import {onMounted, ref} from "vue";
 import FormDia from "@/views/customerService/expiryAfterSales/components/formDia.vue";
 import {ElMessageBox} from "element-plus";
-// import {expiryAfterSalesDelete, expiryAfterSalesListPage} from "@/api/customerService/index.js"; // 鏆傛椂娉ㄩ噴鎺夛紝浣跨敤鍋囨暟鎹�
+import {expiryAfterSalesDelete, expiryAfterSalesListPage} from "@/api/customerService/index.js";
 import useUserStore from "@/store/modules/user.js";
 const { proxy } = getCurrentInstance();
 const userStore = useUserStore()
@@ -127,7 +127,8 @@
 			label: "澶勭悊鐘舵��",
 			prop: "status",
 			width: "",
-			slot: true,
+			dataType: "slot",
+			slot: "status",
 		},
 		{
 			label: "澶勭悊浜�",
@@ -142,7 +143,8 @@
 		{
 			label: "鎿嶄綔",
 			prop: "operation",
-			slot: true,
+			dataType: "slot",
+			slot: "operation",
 			width: "200",
 		},
 	],
@@ -190,97 +192,39 @@
 // 鑾峰彇鍒楄〃鏁版嵁
 const getList = () => {
 	tableLoading.value = true;
+	// 鏋勯�犳煡璇㈠弬鏁帮紝鏄犲皠鍓嶇瀛楁鍒板悗绔瓧娈�
+	const queryParams = {
+		expireDate: searchForm.value.expiryDate,
+		disDate: searchForm.value.handleDate,
+		status: searchForm.value.status,
+		current: page.value.current,
+		size: page.value.size
+	};
 	
-	// 妯℃嫙寮傛璇锋眰
-	setTimeout(() => {
-		// 鍋囨暟鎹�
-		const mockData = [
-			{
-				id: 1,
-				productName: "缁寸敓绱燙鐗�",
-				batchNumber: "VC20240801",
-				expiryDate: "2024-12-15",
-				stockQuantity: 150,
-				customerName: "寮犱笁鑽簵",
-				problemDesc: "涓磋繎淇濊川鏈熼渶瑕佸鐞�",
-				status: 1,
-				handlerName: "",
-				handleDate: "",
-			},
-			{
-				id: 2,
-				productName: "闃胯帿瑗挎灄鑳跺泭",
-				batchNumber: "AM20240715",
-				expiryDate: "2024-11-20",
-				stockQuantity: 80,
-				customerName: "鏉庡洓鍖婚櫌",
-				problemDesc: "搴撳瓨绉帇锛屼复鏈熷鐞�",
-				status: 2,
-				handlerName: "鐜嬩簲",
-				handleDate: "2024-09-25",
-			},
-			{
-				id: 3,
-				productName: "鎰熷啋鐏甸绮�",
-				batchNumber: "GM20240620",
-				expiryDate: "2024-10-30",
-				stockQuantity: 200,
-				customerName: "璧靛叚璇婃墍",
-				problemDesc: "瀛h妭鎬ц嵂鍝侊紝闇�瑕佹竻鐞嗗簱瀛�",
-				status: 1,
-				handlerName: "",
-				handleDate: "",
-			},
-			{
-				id: 4,
-				productName: "澶嶅悎缁寸敓绱犵墖",
-				batchNumber: "FH20240510",
-				expiryDate: "2024-12-01",
-				stockQuantity: 300,
-				customerName: "閽变竷杩為攣",
-				problemDesc: "涓存湡浜у搧閫�鎹㈢敵璇�",
-				status: 2,
-				handlerName: "瀛欏叓",
-				handleDate: "2024-09-20",
-			},
-			{
-				id: 5,
-				productName: "鏉胯摑鏍归绮�",
-				batchNumber: "BL20240430",
-				expiryDate: "2024-11-10",
-				stockQuantity: 120,
-				customerName: "鍛ㄤ節鑽埧",
-				problemDesc: "鎵规闂锛岄渶瑕佸彫鍥�",
-				status: 1,
-				handlerName: "",
-				handleDate: "",
-			}
-		];
-
-		// 绠�鍗曠殑鎼滅储杩囨护
-		let filteredData = mockData;
-		
-		if (searchForm.value.status !== "" && searchForm.value.status !== null) {
-			filteredData = filteredData.filter(item => item.status === searchForm.value.status);
-		}
-		
-		if (searchForm.value.expiryDate) {
-			filteredData = filteredData.filter(item => item.expiryDate === searchForm.value.expiryDate);
-		}
-		
-		if (searchForm.value.handleDate) {
-			filteredData = filteredData.filter(item => item.handleDate === searchForm.value.handleDate);
-		}
-
-		// 鍒嗛〉澶勭悊
-		const start = (page.value.current - 1) * page.value.size;
-		const end = start + page.value.size;
-		const paginatedData = filteredData.slice(start, end);
-
+	expiryAfterSalesListPage(queryParams).then(res => {
+		// 鏄犲皠鍚庣杩斿洖鏁版嵁鍒板墠绔〃鏍�
+		tableData.value = res.data.records.map(item => ({
+			id: item.id,
+			productName: item.productName,
+			batchNumber: item.batchNumber,
+			expiryDate: item.expireDate,
+			stockQuantity: item.stockQuantity,
+			customerName: item.customerName,
+			contactPhone: item.contactPhone,
+			problemDesc: item.disRes,
+			status: item.status,
+			handlerId: item.disposeUserId,
+			handlerName: item.disposeNickName,
+			handleResult: item.disposeResult,
+			handleDate: item.disDate
+		}));
+		page.value.total = res.data.total;
 		tableLoading.value = false;
-		tableData.value = paginatedData;
-		page.value.total = filteredData.length;
-	}, 500); // 妯℃嫙缃戠粶寤惰繜
+	}).catch(error => {
+		console.error('鑾峰彇鍒楄〃鏁版嵁澶辫触:', error);
+		tableLoading.value = false;
+		proxy.$modal.msgError('鑾峰彇鏁版嵁澶辫触锛岃绋嶅悗閲嶈瘯');
+	});
 };
 
 // 鎵撳紑寮规
@@ -306,14 +250,12 @@
 	})
 		.then(() => {
 			tableLoading.value = true;
-			
-			// 妯℃嫙鍒犻櫎鎿嶄綔
-			setTimeout(() => {
-				tableLoading.value = false;
+			expiryAfterSalesDelete(ids).then(() => {
 				proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
-				console.log("妯℃嫙鍒犻櫎鐨勬暟鎹甀D:", ids);
-				getList(); // 閲嶆柊鑾峰彇鏁版嵁
-			}, 300);
+				getList();
+			}).finally(() => {
+				tableLoading.value = false;
+			});
 		})
 		.catch(() => {
 			proxy.$modal.msg("宸插彇娑�");

--
Gitblit v1.9.3