From 63e4b5c676e8d545004d45261ed086e556701189 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期五, 06 二月 2026 14:16:41 +0800
Subject: [PATCH] 进销存升级app: 1.同一销售台账产生多条开票登记记录,编辑单个开票台账可以不超过合同金额,但多个开票台账编辑可以超过合同金额
---
src/pages/sales/invoiceLedger/detail.vue | 21 ++++++++++++++++++++-
1 files changed, 20 insertions(+), 1 deletions(-)
diff --git a/src/pages/sales/invoiceLedger/detail.vue b/src/pages/sales/invoiceLedger/detail.vue
index 93e622a..2abb7d7 100644
--- a/src/pages/sales/invoiceLedger/detail.vue
+++ b/src/pages/sales/invoiceLedger/detail.vue
@@ -18,6 +18,9 @@
<u-form-item label="鍙戠エ閲戦(鍏�)" prop="invoiceTotal" required border-bottom>
<u-input v-model="form.invoiceTotal" type="number" placeholder="璇疯緭鍏�" />
</u-form-item>
+ <view class="tip-text" v-if="Number(maxInvoiceAmount) > 0">
+ 鍙紑绁ㄦ渶澶ч噾棰濓細{{ formatAmount(maxInvoiceAmount) }} 鍏�
+ </view>
<u-form-item label="寮�绁ㄤ汉" border-bottom>
<u-input v-model="form.invoicePerson" readonly />
</u-form-item>
@@ -110,6 +113,7 @@
})
const fileList = ref([])
const currentId = ref('')
+const maxInvoiceAmount = ref(0)
// 鏃ユ湡閫夋嫨
const showInvoiceDatePicker = ref(false)
@@ -245,6 +249,10 @@
const res = await invoiceLedgerProductInfo({ id })
const data = res?.data || res
form.value = { ...data }
+ // 璁$畻鍙戠エ閲戦鏈�澶у�硷細noInvoiceAmount + invoiceAmount
+ const noInvoiceAmount = parseFloat(data?.noInvoiceAmount || 0)
+ const invoiceAmount = parseFloat(data?.invoiceAmount || 0)
+ maxInvoiceAmount.value = (Number.isNaN(noInvoiceAmount) ? 0 : noInvoiceAmount) + (Number.isNaN(invoiceAmount) ? 0 : invoiceAmount)
fileList.value = data?.fileList || []
if (!form.value.invoicePerson) {
form.value.invoicePerson = userStore.nickName
@@ -264,6 +272,17 @@
if (!form.value.invoiceNo) { showToast('璇疯緭鍏ュ彂绁ㄥ彿'); return }
if (!form.value.invoiceTotal) { showToast('璇疯緭鍏ュ彂绁ㄩ噾棰�'); return }
if (!form.value.invoiceDate) { showToast('璇烽�夋嫨寮�绁ㄦ棩鏈�'); return }
+
+ // 鏍¢獙锛氬彂绁ㄩ噾棰濅笉鑳借秴杩囨渶澶у��
+ const invoiceTotal = parseFloat(form.value.invoiceTotal || 0)
+ if (Number.isNaN(invoiceTotal) || invoiceTotal <= 0) {
+ showToast('璇疯緭鍏ユ湁鏁堢殑鍙戠エ閲戦')
+ return
+ }
+ if (maxInvoiceAmount.value > 0 && invoiceTotal - maxInvoiceAmount.value > 1e-6) {
+ showToast(`鍙戠エ閲戦涓嶈兘瓒呰繃鏈�澶у�硷細${formatAmount(maxInvoiceAmount.value)}`)
+ return
+ }
showLoadingToast('鎻愪氦涓�...')
form.value.fileList = fileList.value
await invoiceLedgerSaveOrUpdate(form.value)
@@ -342,7 +361,7 @@
.uploaded-list { padding: 8px 16px 0 16px; }
.uploaded-item { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #f5f5f5; }
.file-name { font-size: 12px; color: #333; margin-right: 8px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
-.tip-text { padding: 4px 16px 0 16px; font-size: 12px; color: #888; }
+.tip-text { padding: 4px 0; font-size: 12px; color: #888; }
.footer-btns {
position: fixed;
left: 0;
--
Gitblit v1.9.3