From 76bf6e7282105522df085fcaf63732a84fde5274 Mon Sep 17 00:00:00 2001
From: 曹睿 <360930172@qq.com>
Date: 星期四, 19 六月 2025 12:00:38 +0800
Subject: [PATCH] fix: 修复回款流水日期查询

---
 src/views/procurementManagement/procurementInvoiceLedger/index.vue |    4 +-
 src/views/salesManagement/receiptPaymentHistory/index.vue          |   14 +++++--
 src/utils/summarizeTable.js                                        |   75 +++++++++++++++++++++----------------
 3 files changed, 54 insertions(+), 39 deletions(-)

diff --git a/src/utils/summarizeTable.js b/src/utils/summarizeTable.js
index e24d99f..1ad480d 100644
--- a/src/utils/summarizeTable.js
+++ b/src/utils/summarizeTable.js
@@ -6,43 +6,52 @@
  * @returns {Array} 鍚堣琛屾暟鎹�
  */
 const summarizeTable = (param, summaryProps, specialFormat = {}) => {
-    const { columns, data } = param;
-    const sums = [];
-    columns.forEach((column, index) => {
-        if (index === 0) {
-            sums[index] = '鍚堣';
-            return;
-        }
-        const prop = column.property;
-        if (summaryProps.includes(prop)) {
-            const values = data.map(item => Number(item[prop]));
-            // 鍙鏈夋晥鏁板瓧杩涜姹傚拰
-            if (!values.every(isNaN)) {
-                const sum = values.reduce((acc, val) => (!isNaN(val) ? acc + val : acc), 0);
-                if (specialFormat[prop] && specialFormat[prop].noDecimal) {
-                    // 濡傛灉鎸囧畾浜嗕笉闇�瑕佷繚鐣欏皬鏁帮紝鍒欑洿鎺ヨ浆鎹负鏁存暟
-                    sums[index] = Math.round(sum).toString();
-                } else {
-                    // 榛樿淇濈暀涓や綅灏忔暟
-                    sums[index] = parseFloat(sum).toFixed(specialFormat[prop]?.decimalPlaces ?? 2);
-                }
-            } else {
-                sums[index] = '';
-            }
+  const { columns, data } = param;
+  const sums = [];
+  columns.forEach((column, index) => {
+    if (index === 0) {
+      sums[index] = "鍚堣";
+      return;
+    }
+    const prop = column.property;
+    if (summaryProps.includes(prop)) {
+      const values = data.map((item) => Number(item[prop]));
+      // 鍙鏈夋晥鏁板瓧杩涜姹傚拰
+      if (!values.every(isNaN)) {
+        const sum = values.reduce(
+          (acc, val) => (!isNaN(val) ? acc + val : acc),
+          0
+        );
+        if (specialFormat[prop] && specialFormat[prop].noDecimal) {
+          // 濡傛灉鎸囧畾浜嗕笉闇�瑕佷繚鐣欏皬鏁帮紝鍒欑洿鎺ヨ浆鎹负鏁存暟
+          sums[index] = Math.round(sum).toString();
         } else {
-            sums[index] = '';
+          // 榛樿淇濈暀涓や綅灏忔暟
+          sums[index] = parseFloat(sum).toFixed(
+            specialFormat[prop]?.decimalPlaces ?? 2
+          );
         }
-    });
-    return sums;
-}
+      } else {
+        sums[index] = "";
+      }
+    } else {
+      sums[index] = "";
+    }
+  });
+  return sums;
+};
 // 涓嶅惈绋庢�讳环璁$畻
 const calculateTaxExclusiveTotalPrice = (taxInclusiveTotalPrice, taxRate) => {
-    const taxRateDecimal = taxRate / 100;
-    return (taxInclusiveTotalPrice / (1 + taxRateDecimal)).toFixed(2);
-}
+  const taxRateDecimal = taxRate / 100;
+  return (taxInclusiveTotalPrice / (1 + taxRateDecimal)).toFixed(2);
+};
 // 鍚◣鎬讳环璁$畻
 const calculateTaxIncludeTotalPrice = (taxInclusiveUnitPrice, quantity) => {
-    return (taxInclusiveUnitPrice * quantity).toFixed(2);
-}
+  return (taxInclusiveUnitPrice * quantity).toFixed(2);
+};
 // 瀵煎嚭鍑芥暟渚涘叾浠栨枃浠朵娇鐢�
-export { summarizeTable, calculateTaxExclusiveTotalPrice ,calculateTaxIncludeTotalPrice};
+export {
+  summarizeTable,
+  calculateTaxExclusiveTotalPrice,
+  calculateTaxIncludeTotalPrice,
+};
diff --git a/src/views/procurementManagement/procurementInvoiceLedger/index.vue b/src/views/procurementManagement/procurementInvoiceLedger/index.vue
index 4d5e139..c0e11d6 100644
--- a/src/views/procurementManagement/procurementInvoiceLedger/index.vue
+++ b/src/views/procurementManagement/procurementInvoiceLedger/index.vue
@@ -171,8 +171,8 @@
   {},
   {
     createdAt: (aim) => ({
-      createdAtStart: aim[0],
-      createdAtEnd: aim[1],
+      createdAtStart: aim ? aim[0] : undefined,
+      createdAtEnd: aim ? aim[1] : undefined,
     }),
   }
 );
diff --git a/src/views/salesManagement/receiptPaymentHistory/index.vue b/src/views/salesManagement/receiptPaymentHistory/index.vue
index 7f2e139..0462d1a 100644
--- a/src/views/salesManagement/receiptPaymentHistory/index.vue
+++ b/src/views/salesManagement/receiptPaymentHistory/index.vue
@@ -114,8 +114,10 @@
     dayjs().startOf("month").format("YYYY-MM-DD"),
     dayjs().endOf("month").format("YYYY-MM-DD"),
   ],
-  receiptPaymentDateStart: dayjs().startOf("month").format("YYYY-MM-DD"),
-  receiptPaymentDateEnd: dayjs().endOf("month").format("YYYY-MM-DD"),
+  receiptPaymentDateStart: dayjs()
+    .startOf("month")
+    .format("YYYY-MM-DD 00:00:00"),
+  receiptPaymentDateEnd: dayjs().endOf("month").format("YYYY-MM-DD 23:59:59"),
 });
 const { receipt_payment_type } = proxy.useDict("receipt_payment_type");
 const isShowSummarySon = ref(true);
@@ -153,8 +155,12 @@
 
 const changeDateRange = (date) => {
   if (date) {
-    searchForm.receiptPaymentDateStart = date[0];
-    searchForm.receiptPaymentDateEnd = date[1];
+    searchForm.receiptPaymentDateStart = dayjs(date[0]).format(
+      "YYYY-MM-DD 00:00:00"
+    );
+    searchForm.receiptPaymentDateEnd = dayjs(date[1]).format(
+      "YYYY-MM-DD 23:59:59"
+    );
     getList();
   }
 };

--
Gitblit v1.9.3