From add06adc5d974ac685cb637c48f2455034c8a52f Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期五, 06 二月 2026 13:34:19 +0800
Subject: [PATCH] Merge branch 'dev_new' of http://114.132.189.42:9002/r/product-inventory-APP-before into dev_new
---
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