From 17bdc12280602e882f42445d10d68e9e2575773f Mon Sep 17 00:00:00 2001
From: gongchunyi <deslre0381@gmail.com>
Date: 星期二, 03 三月 2026 09:15:20 +0800
Subject: [PATCH] feat: 售后附件与临期售后信息接口对接

---
 src/views/customerService/expiryAfterSales/components/formDia.vue |   42 ++++++++++++++++++++++++++++--------------
 1 files changed, 28 insertions(+), 14 deletions(-)

diff --git a/src/views/customerService/expiryAfterSales/components/formDia.vue b/src/views/customerService/expiryAfterSales/components/formDia.vue
index e8293d6..2fe603b 100644
--- a/src/views/customerService/expiryAfterSales/components/formDia.vue
+++ b/src/views/customerService/expiryAfterSales/components/formDia.vue
@@ -161,8 +161,8 @@
 import {ref, computed} from "vue";
 import useUserStore from "@/store/modules/user.js";
 import { getCurrentDate } from "@/utils/index.js";
-// import {userListNoPageByTenantId} from "@/api/system/user.js"; // 鏆傛椂娉ㄩ噴鎺夛紝浣跨敤鍋囨暟鎹�
-// import {expiryAfterSalesAdd, expiryAfterSalesUpdate} from "@/api/customerService/index.js"; // 鏆傛椂娉ㄩ噴鎺夛紝浣跨敤鍋囨暟鎹�
+import {userListNoPageByTenantId} from "@/api/system/user.js";
+import {expiryAfterSalesAdd, expiryAfterSalesUpdate} from "@/api/customerService/index.js";
 const { proxy } = getCurrentInstance()
 const emit = defineEmits(['close'])
 const dialogFormVisible = ref(false);
@@ -218,14 +218,10 @@
   operationType.value = type;
   dialogFormVisible.value = true;
 	
-	// 妯℃嫙鑾峰彇鐢ㄦ埛鍒楄〃
-	userList.value = [
-		{ userId: 1, nickName: "寮犱笁" },
-		{ userId: 2, nickName: "鏉庡洓" },
-		{ userId: 3, nickName: "鐜嬩簲" },
-		{ userId: 4, nickName: "璧靛叚" },
-		{ userId: 5, nickName: "瀛欏叓" }
-	];
+	// 鑾峰彇鐢ㄦ埛鍒楄〃
+	userListNoPageByTenantId().then(res => {
+		userList.value = res.data;
+	});
 
 	if (type === 'add') {
 		// 鏂板鏃堕噸缃〃鍗�
@@ -256,12 +252,30 @@
 const submitForm = () => {
 	proxy.$refs["formRef"].validate(valid => {
 		if (valid) {
-			// 妯℃嫙鎻愪氦鎿嶄綔
-			setTimeout(() => {
-				console.log("妯℃嫙鎻愪氦鐨勬暟鎹�:", form.value);
+			const submitData = {
+				id: form.value.id,
+				productName: form.value.productName,
+				batchNumber: form.value.batchNumber,
+				expireDate: form.value.expiryDate,
+				stockQuantity: form.value.stockQuantity,
+				customerName: form.value.customerName,
+				contactPhone: form.value.contactPhone,
+				disRes: form.value.problemDesc,
+				status: form.value.status,
+				disposeUserId: form.value.handlerId,
+				disposeNickName: userList.value.find(item => item.userId === form.value.handlerId)?.nickName,
+				disposeResult: form.value.handleResult,
+				disDate: form.value.handleDate
+			};
+			
+			const apiCall = operationType.value === 'add' ? expiryAfterSalesAdd : expiryAfterSalesUpdate;
+			apiCall(submitData).then(() => {
 				proxy.$modal.msgSuccess(operationType.value === 'add' ? "鏂板鎴愬姛" : "鏇存柊鎴愬姛");
 				closeDia();
-			}, 300);
+			}).catch(error => {
+				console.error('鎻愪氦鏁版嵁澶辫触:', error);
+				proxy.$modal.msgError('鎻愪氦鏁版嵁澶辫触锛岃绋嶅悗閲嶈瘯');
+			});
 		}
 	});
 }

--
Gitblit v1.9.3