From a2c33664f683aee11fdc62391c8d1e21cc74f5b2 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期四, 21 五月 2026 17:24:49 +0800
Subject: [PATCH] 天津宝东 1.修改展示字段
---
src/views/salesManagement/salesLedger/index.vue | 42 +++++++++++++++++++++++++++++++++++++++---
1 files changed, 39 insertions(+), 3 deletions(-)
diff --git a/src/views/salesManagement/salesLedger/index.vue b/src/views/salesManagement/salesLedger/index.vue
index fc2851f..3d88828 100644
--- a/src/views/salesManagement/salesLedger/index.vue
+++ b/src/views/salesManagement/salesLedger/index.vue
@@ -48,6 +48,9 @@
@click="openForm('add')">
鏂板鍙拌处
</el-button>
+ <el-button type="primary" plain :disabled="selectedRows.length === 0" @click="handleBatchExportContract">
+ 瀵煎嚭鍚堝悓
+ </el-button>
<el-button type="primary"
plain
@click="handleImport">瀵煎叆
@@ -1578,7 +1581,7 @@
selectedQuotation.value = null;
let userLists = await userListNoPage();
userList.value = userLists.data;
- listCustomer({ current: -1, size: -1 }).then(res => {
+ listCustomer({ current: -1, size: -1, type: 0 }).then(res => {
customerOption.value = res.data.records;
});
form.value.entryPerson = userStore.id;
@@ -2652,7 +2655,7 @@
// 鍙戣揣鐘舵�佸繀椤绘槸"寰呭彂璐�"鎴�"瀹℃牳鎷掔粷"
const statusStr = shippingStatus ? String(shippingStatus).trim() : "";
- return statusStr === "寰呭彂璐�" || statusStr === "瀹℃牳鎷掔粷";
+ return statusStr === "寰呭彂璐�" || statusStr === "瀹℃牳鎷掔粷" || statusStr === "閮ㄥ垎鍙戣揣";
};
// 鎵撳紑闄勪欢寮圭獥
@@ -2664,7 +2667,40 @@
recordId.value = row.id;
fileDialogVisible.value = true;
};
-
+ const handleBatchExportContract = () => {
+ if (selectedRows.value.length === 0) {
+ proxy.$modal.msgWarning("璇烽�夋嫨瑕佸鍑虹殑鍙拌处");
+ return;
+ }
+ const firstCustomerKey =
+ selectedRows.value[0].customerId ?? selectedRows.value[0].customerName ?? "";
+ const hasDifferentCustomer = selectedRows.value.some((row) => {
+ const customerKey = row.customerId ?? row.customerName ?? "";
+ return String(customerKey) !== String(firstCustomerKey);
+ });
+ if (hasDifferentCustomer) {
+ proxy.$modal.msgWarning("浠呮敮鎸佸悓涓�瀹㈡埛鍚屾椂瀵煎嚭鍚堝悓");
+ return;
+ }
+ const ids = selectedRows.value
+ .map((row) => row.id)
+ .filter((id) => id !== null && id !== undefined);
+ if (ids.length === 0) {
+ proxy.$modal.msgWarning("鏈幏鍙栧埌鍚堝悓ID");
+ return;
+ }
+ proxy.download(
+ "/sales/ledger/exportContract",
+ ids,
+ `閿�鍞悎鍚宊鎵归噺_${dayjs().format("YYYYMMDDHHmmss")}.docx`,
+ {
+ method: "post",
+ filename: `閿�鍞悎鍚宊鎵归噺_${dayjs().format("YYYYMMDDHHmmss")}.docx`,
+ headers: { "Content-Type": "application/json;charset=utf-8" },
+ transformRequest: [(data) => JSON.stringify(data)],
+ }
+ );
+ }
// 鎵撳紑鍙戣揣寮规
const openDeliveryForm = async row => {
// 妫�鏌ユ槸鍚﹀彲浠ュ彂璐�
--
Gitblit v1.9.3