From efe125921e37d031d6ff31018c1d4e4e133c60d5 Mon Sep 17 00:00:00 2001
From: yyb <995253665@qq.com>
Date: 星期二, 21 四月 2026 13:25:35 +0800
Subject: [PATCH] 添加产品宽高搜索功能,优化销售台账数据处理逻辑,新增面积和数量列
---
src/views/salesManagement/salesLedger/index.vue | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 57 insertions(+), 1 deletions(-)
diff --git a/src/views/salesManagement/salesLedger/index.vue b/src/views/salesManagement/salesLedger/index.vue
index 7ba3cf0..5f36cee 100644
--- a/src/views/salesManagement/salesLedger/index.vue
+++ b/src/views/salesManagement/salesLedger/index.vue
@@ -32,6 +32,20 @@
prefix-icon="Search"
@change="handleQuery" />
</el-form-item>
+ <el-form-item label="浜у搧瀹�(mm)锛�">
+ <el-input v-model="searchForm.width"
+ placeholder="璇疯緭鍏�"
+ clearable
+ prefix-icon="Search"
+ @change="handleQuery" />
+ </el-form-item>
+ <el-form-item label="浜у搧楂�(mm)锛�">
+ <el-input v-model="searchForm.height"
+ placeholder="璇疯緭鍏�"
+ clearable
+ prefix-icon="Search"
+ @change="handleQuery" />
+ </el-form-item>
<el-form-item label="褰曞叆鏃ユ湡锛�">
<el-date-picker v-model="searchForm.entryDate"
value-format="YYYY-MM-DD"
@@ -319,6 +333,14 @@
width="220"
show-overflow-tooltip
:formatter="formattedNumber" />
+ <el-table-column label="闈㈢Н"
+ prop="productTotalArea"
+ width="120"
+ show-overflow-tooltip />
+ <el-table-column label="鏁伴噺"
+ prop="productTotalQuantity"
+ width="120"
+ show-overflow-tooltip />
<el-table-column label="鍙戣揣鐘舵��"
width="140"
align="center">
@@ -1909,6 +1931,8 @@
customerName: "", // 瀹㈡埛鍚嶇О
customerId: "", // 瀹㈡埛ID锛堟煡璇笅鎷夛級
salesContractNo: "", // 閿�鍞悎鍚岀紪鍙�
+ width: undefined, // 浜у搧瀹�(mm)
+ height: undefined, // 浜у搧楂�(mm)
entryDate: null, // 褰曞叆鏃ユ湡
entryDateStart: undefined,
entryDateEnd: undefined,
@@ -2867,14 +2891,44 @@
delete params.customerName;
}
}
+ const widthValue =
+ params.width != null ? String(params.width).trim() : "";
+ if (widthValue) {
+ params.width = widthValue;
+ } else {
+ delete params.width;
+ }
+ const heightValue =
+ params.height != null ? String(params.height).trim() : "";
+ if (heightValue) {
+ params.height = heightValue;
+ } else {
+ delete params.height;
+ }
+ const shouldAutoExpandBySize = Boolean(params.width || params.height);
delete params.customerId;
return ledgerListPage(params)
- .then(res => {
+ .then(async res => {
tableLoading.value = false;
tableData.value = res.records;
tableData.value.map(item => {
item.children = [];
});
+ if (shouldAutoExpandBySize && tableData.value.length > 0) {
+ const loadChildrenTasks = tableData.value.map(item =>
+ productList({ salesLedgerId: item.id, type: 1 })
+ .then(productRes => {
+ item.children = Array.isArray(productRes?.data)
+ ? productRes.data
+ : [];
+ })
+ .catch(() => {
+ item.children = [];
+ })
+ );
+ await Promise.all(loadChildrenTasks);
+ expandedRowKeys.value = tableData.value.map(item => item.id);
+ }
total.value = res.total;
return res;
})
@@ -3233,6 +3287,8 @@
const summarizeMainTable = param => {
return proxy.summarizeTable(param, [
"contractAmount",
+ "productTotalQuantity",
+ "productTotalArea",
"taxInclusiveTotalPrice",
"taxExclusiveTotalPrice",
]);
--
Gitblit v1.9.3