From da80b0aeb7c014ee1a854ce2ca7cd6f9c2d0787c Mon Sep 17 00:00:00 2001
From: huminmin <mac@MacBook-Pro.local>
Date: 星期四, 23 四月 2026 10:42:48 +0800
Subject: [PATCH] 导出销售台账送货单
---
src/views/salesManagement/salesLedger/index.vue | 106 +++++++++++++++++++++++++++++++---------------------
1 files changed, 63 insertions(+), 43 deletions(-)
diff --git a/src/views/salesManagement/salesLedger/index.vue b/src/views/salesManagement/salesLedger/index.vue
index 740371d..fbbcb85 100644
--- a/src/views/salesManagement/salesLedger/index.vue
+++ b/src/views/salesManagement/salesLedger/index.vue
@@ -34,6 +34,7 @@
<el-button @click="handleOut">瀵煎嚭</el-button>
<el-button type="danger" plain @click="handleDelete">鍒犻櫎</el-button>
<el-button type="primary" plain @click="handlePrint">鎵撳嵃</el-button>
+ <el-button type="primary" plain @click="handleExport">瀵煎嚭閫佽揣鍗�</el-button>
</div>
</div>
<el-table :data="tableData" border v-loading="tableLoading" @selection-change="handleSelectionChange"
@@ -446,7 +447,7 @@
鏆傛棤鎵撳嵃鏁版嵁
</div>
<div v-else
- style="text-align: center; padding: 10px; color: #666; font-size: 16px; background: #e8f4fd; margin-bottom: 10px;">
+ style="text-align: center; padding: 10px; color: #666; font-size: 18px; background: #e8f4fd; margin-bottom: 10px;">
鍏� {{ printData.length }} 鏉℃暟鎹緟鎵撳嵃
</div>
<div v-for="(item, index) in printData" :key="index" class="print-page">
@@ -503,7 +504,7 @@
</div>
</div>
- <span style="font-size: 20px; margin-top: 5px;">璐х墿璇︾粏淇℃伅锛�</span>
+ <span style="font-size: 18px; margin-top: 5px;">璐х墿璇︾粏淇℃伅锛�</span>
<div class="table-section">
<table class="product-table">
<thead>
@@ -528,14 +529,14 @@
<td>{{ item.salesContractNo || '' }}</td>
</tr>
<!-- 娣诲姞绌虹櫧琛屼互纭繚鑷冲皯5琛� -->
- <tr v-for="n in Math.max(0, 5 - (item.products ? item.products.length : 0))" :key="'empty-' + n" style="height: 25px;">
- <td style="height: 35px;"></td>
- <td style="height: 35px;"></td>
- <td style="height: 35px;"></td>
- <td style="height: 35px;"></td>
- <td style="height: 35px;"></td>
- <td style="height: 35px;"></td>
- <td style="height: 35px;"></td>
+ <tr v-for="n in Math.max(0, 5 - (item.products ? item.products.length : 0))" :key="'empty-' + n">
+ <td> </td>
+ <td> </td>
+ <td> </td>
+ <td> </td>
+ <td> </td>
+ <td> </td>
+ <td> </td>
</tr>
</tbody>
<tfoot>
@@ -548,14 +549,14 @@
</table>
<div style="width: 80px; display: flex; flex-direction: column;">
- <div style="height: 35px; border-bottom: 1px dashed #000; text-align: center; display: flex; align-items: center; justify-content: center;">鍏卞洓鑱�</div>
- <div style="height: 35px; border-bottom: 1px dashed #000; text-align: center; display: flex; align-items: center; justify-content: center;">瀛樻牴</div>
- <div style="height: 35px; border-bottom: 1px dashed #000; text-align: center; display: flex; align-items: center; justify-content: center;">瀹㈡埛</div>
- <div style="height: 35px; border-bottom: 1px dashed #000; text-align: center; display: flex; align-items: center; justify-content: center;">璁拌处</div>
- <div style="height: 35px; text-align: center; display: flex; align-items: center; justify-content: center;">浠撳簱</div>
+ <div style="height: 33px; border-bottom: 1px dashed #000; text-align: center; display: flex; align-items: center; justify-content: center;">鍏卞洓鑱�</div>
+ <div style="height: 28px; border-bottom: 1px dashed #000; text-align: center; display: flex; align-items: center; justify-content: center;">瀛樻牴</div>
+ <div style="height: 29px; border-bottom: 1px dashed #000; text-align: center; display: flex; align-items: center; justify-content: center;">瀹㈡埛</div>
+ <div style="height: 29px; border-bottom: 1px dashed #000; text-align: center; display: flex; align-items: center; justify-content: center;">璁拌处</div>
+ <div style="height: 28px; text-align: center; display: flex; align-items: center; justify-content: center;">浠撳簱</div>
</div>
</div>
- <div style="margin: 10px 0; font-size: 20px;">
+ <div style="margin: 10px 0; font-size: 16px;">
<span>澶囨敞锛� 璐靛叕鍙稿湪鏀惰揣鍚庤鍗冲埢鏍稿疄鏁伴噺鍙婂搧璐紝鑻ユ湁寮傝锛岃鍦�3鏃ュ唴鎻愬嚭锛屽惁鍒欒涓烘敹濡ャ��</span>
</div>
<div class="footer">
@@ -658,15 +659,15 @@
import FormDialog from '@/components/Dialog/FormDialog.vue';
import { getQuotationList } from "@/api/salesManagement/salesQuotation.js";
import {
- ledgerListPage,
- productList,
- customerList,
- addOrUpdateSalesLedger,
- getSalesLedgerWithProducts,
- delLedger,
- addOrUpdateSalesLedgerProduct,
- delProduct,
- delLedgerFile, getProductInventory,
+ ledgerListPage,
+ productList,
+ customerList,
+ addOrUpdateSalesLedger,
+ getSalesLedgerWithProducts,
+ delLedger,
+ addOrUpdateSalesLedgerProduct,
+ delProduct,
+ delLedgerFile, getProductInventory,
} from "@/api/salesManagement/salesLedger.js";
import { modelList, productTreeList } from "@/api/basicData/product.js";
import useFormData from "@/hooks/useFormData.js";
@@ -1471,6 +1472,27 @@
});
};
+const handleExport = () => {
+ if (selectedRows.value.length === 0) {
+ proxy.$modal.msgWarning("璇烽�夋嫨瑕佸鍑洪�佽揣鍗曠殑鏁版嵁");
+ return;
+ }
+
+ ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚鍑猴紝鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
+ confirmButtonText: "纭",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
+ })
+ .then(() => {
+ console.log(selectedRows.value.map((item) => item.id))
+ proxy.download("/sales/ledger/exportShippingNote", {ids: selectedRows.value.map((item) => item.id).join(",")}, "閫佽揣鍗�.zip");
+ selectedRows.value = [];
+ })
+ .catch(() => {
+ proxy.$modal.msg("宸插彇娑�");
+ });
+}
+
// 鎵撳嵃鍔熻兘
const handlePrint = async () => {
if (selectedRows.value.length === 0) {
@@ -1562,22 +1584,20 @@
width: 100%;
height: 100%;
font-size: 18px;
- line-height: 1.5;
+ line-height: 1;
display: flex;
flex-direction: column;
color: #000;
}
.header {
text-align: center;
- margin-bottom: 8px;
}
.company-name {
- font-size: 32px;
+ font-size: 30px;
font-weight: bold;
- margin-bottom: 4px;
}
.document-title {
- font-size: 28px;
+ font-size: 25px;
font-weight: bold;
letter-spacing: 10px;
}
@@ -1587,17 +1607,17 @@
align-items: center;
}
.info-row {
- line-height: 26px;
+ line-height: 20px;
}
.label {
font-weight: bold;
min-width: 60px;
- font-size: 20px;
+ font-size: 18px;
}
.value {
margin-right: 20px;
min-width: 80px;
- font-size: 20px;
+ font-size: 18px;
}
.table-section {
margin-bottom: 4px;
@@ -1611,13 +1631,13 @@
}
.product-table th, .product-table td {
border: 1px solid #000;
- padding: 6px;
+ padding: 3px;
text-align: center;
- font-size: 20px;
- line-height: 1.4;
+ font-size: 18px;
+ line-height: 1.2;
}
.product-table th {
- font-size: 20px;
+ font-size: 19px;
font-weight: bold;
}
.total-value {
@@ -1627,7 +1647,7 @@
margin: 10px 0;
}
.sign-section {
- margin-top: 15px;
+ margin-top: 10px;
}
.footer {
display: flex;
@@ -1638,17 +1658,17 @@
width: 50%;
}
.info-row {
- line-height: 26px;
+ line-height: 20px;
}
.label {
font-weight: bold;
min-width: 60px;
- font-size: 20px;
+ font-size: 18px;
}
.value {
margin-right: 20px;
min-width: 80px;
- font-size: 20px;
+ font-size: 18px;
}
}
@media print {
@@ -1662,7 +1682,7 @@
padding-right: 10mm;
page-break-inside: avoid;
page-break-after: always;
- font-size: 20px;
+ font-size: 18px;
}
.print-page:last-child {
page-break-after: avoid;
@@ -2231,7 +2251,7 @@
th,
td {
border: 1px solid #000;
- padding: 6px;
+ padding: 3px;
text-align: center;
font-size: 16px;
line-height: 1.4;
--
Gitblit v1.9.3