From 2dc24084675a49f6c55da5ee0069b2de0503c449 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期四, 05 二月 2026 16:33:35 +0800
Subject: [PATCH] 进销存升级app: 1.开票登记、开票台账、回款流水还有客户合同号字段(需要去掉) 2.采购台账、销售台账页面都需要加上删除按钮

---
 src/pages/procurementManagement/procurementInvoiceLedger/detail.vue |   76 ++++++++++++++++++++-----------------
 1 files changed, 41 insertions(+), 35 deletions(-)

diff --git a/src/pages/procurementManagement/procurementInvoiceLedger/detail.vue b/src/pages/procurementManagement/procurementInvoiceLedger/detail.vue
index 179e7e1..3b0bea3 100644
--- a/src/pages/procurementManagement/procurementInvoiceLedger/detail.vue
+++ b/src/pages/procurementManagement/procurementInvoiceLedger/detail.vue
@@ -102,7 +102,7 @@
   const temFutureTickets = ref(0);
   const originalTicketsNum = ref(0); // 淇濆瓨鍘熷鏉ョエ鏁�
 
-  // 琛ㄥ崟鏍¢獙瑙勫垯
+  // 琛ㄥ崟鏍¢獙瑙勫垯 - 浣跨敤绠�鍗曠殑 required 瑙勫垯
   const rules = {
     ticketsNum: [{ required: true, message: "璇疯緭鍏ユ潵绁ㄦ暟", trigger: "blur" }],
     ticketsAmount: [
@@ -265,44 +265,50 @@
 
   // 琛ㄥ崟鎻愪氦
   const onSubmit = async () => {
-    if (!formRef.value) {
-      console.log("琛ㄥ崟寮曠敤涓嶅瓨鍦�");
+    // 鍦ㄩ獙璇佸墠锛岀‘淇濆繀濉瓧娈垫湁鍊�
+    if (!form.value.ticketsNum || form.value.ticketsNum === "" || form.value.ticketsNum === null || form.value.ticketsNum === undefined) {
+      uni.showToast({
+        title: "璇疯緭鍏ユ潵绁ㄦ暟",
+        icon: "none",
+      });
       return;
     }
     
-    try {
-      // 鍏堣皟鐢� validate 鏂规硶
-      const validateResult = formRef.value.validate();
-      
-      // 濡傛灉 validate 杩斿洖 undefined 鎴� null锛岀洿鎺ユ彁浜�
-      if (validateResult === undefined || validateResult === null) {
-        submitForm();
-        return;
-      }
-      
-      // 濡傛灉杩斿洖 Promise锛屼娇鐢� await 鍜� catch
-      if (validateResult && typeof validateResult.then === 'function') {
-        const valid = await validateResult.catch(() => false);
-        if (valid) {
-          // 琛ㄥ崟楠岃瘉閫氳繃锛屾彁浜よ〃鍗�
-          submitForm();
-        } else {
-          // 琛ㄥ崟楠岃瘉澶辫触
-          console.log("琛ㄥ崟楠岃瘉澶辫触");
-        }
-      } else {
-        // 濡傛灉杩斿洖甯冨皵鍊硷紝鐩存帴鍒ゆ柇
-        if (validateResult) {
-          submitForm();
-        } else {
-          console.log("琛ㄥ崟楠岃瘉澶辫触");
-        }
-      }
-    } catch (error) {
-      // 濡傛灉 validate 鏂规硶涓嶅瓨鍦ㄦ垨鎶涘嚭閿欒锛岀洿鎺ユ彁浜�
-      console.log("琛ㄥ崟楠岃瘉澶辫触", error);
-      submitForm();
+    if (!form.value.ticketsAmount || form.value.ticketsAmount === "" || form.value.ticketsAmount === null || form.value.ticketsAmount === undefined) {
+      uni.showToast({
+        title: "璇疯緭鍏ユ湰娆℃潵绁ㄩ噾棰�",
+        icon: "none",
+      });
+      return;
     }
+    
+    // 纭繚瀛楁鏄暟瀛楃被鍨嬶紝骞惰浆鎹负瀛楃涓诧紙鍥犱负琛ㄥ崟鍙兘闇�瑕佸瓧绗︿覆绫诲瀷锛�
+    const ticketsNum = Number(form.value.ticketsNum);
+    const ticketsAmount = Number(form.value.ticketsAmount);
+    
+    // 濡傛灉鏉ョエ鏁颁负0鎴栨潵绁ㄩ噾棰濅负0锛屾彁绀虹敤鎴�
+    if (isNaN(ticketsNum) || ticketsNum <= 0) {
+      uni.showToast({
+        title: "鏉ョエ鏁板繀椤诲ぇ浜�0",
+        icon: "none",
+      });
+      return;
+    }
+    
+    if (isNaN(ticketsAmount) || ticketsAmount <= 0) {
+      uni.showToast({
+        title: "鏈鏉ョエ閲戦蹇呴』澶т簬0",
+        icon: "none",
+      });
+      return;
+    }
+    
+    // 鏇存柊琛ㄥ崟鍊硷紝纭繚鏄湁鏁堢殑鏁板瓧瀛楃涓�
+    form.value.ticketsNum = ticketsNum.toString();
+    form.value.ticketsAmount = ticketsAmount.toString();
+    
+    // 鎵嬪姩楠岃瘉閫氳繃鍚庯紝鐩存帴鎻愪氦锛岃烦杩囪〃鍗曢獙璇侊紙閬垮厤鐪熸満涓婄殑楠岃瘉闂锛�
+    submitForm();
   };
   const purchaseLedgerId = ref("");
   const productModelId = ref({});

--
Gitblit v1.9.3