From 47bae1f938f915206e3934ea960aff975e5738c9 Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期五, 12 六月 2026 16:09:49 +0800
Subject: [PATCH] feat(teachingDemo): 新增工艺路线与BOM教学演示模块

---
 src/views/financialManagement/receivable/invoiceApply.vue |   35 +++++++++++++++++++++++++++++++++--
 1 files changed, 33 insertions(+), 2 deletions(-)

diff --git a/src/views/financialManagement/receivable/invoiceApply.vue b/src/views/financialManagement/receivable/invoiceApply.vue
index d5ab6dc..21b5f0e 100644
--- a/src/views/financialManagement/receivable/invoiceApply.vue
+++ b/src/views/financialManagement/receivable/invoiceApply.vue
@@ -48,6 +48,8 @@
         v-loading="tableLoading"
         :column="columns"
         :tableData="dataList"
+        isShowSummary
+        :summaryMethod="getSummaries"
         :page="{
           current: pagination.currentPage,
           size: pagination.pageSize,
@@ -193,7 +195,7 @@
           <el-col :span="12">
             <el-form-item label="鍒涘缓鏃堕棿" prop="createTime">
               <el-date-picker
-                v-model="form.createTime"
+                v-model="formCreateTimeDate"
                 type="date"
                 placeholder="閫夋嫨鏃ユ湡"
                 value-format="YYYY-MM-DD"
@@ -267,6 +269,7 @@
 
 <script setup>
 import { ref, reactive, computed, onMounted, nextTick, getCurrentInstance, defineAsyncComponent } from "vue";
+import dayjs from "dayjs";
 import { ElMessage, ElMessageBox } from "element-plus";
 import FormDialog from "@/components/Dialog/FormDialog.vue";
 import { listCustomer } from "@/api/basicData/customer.js";
@@ -540,6 +543,12 @@
   remark: "",
   createTime: "",
 });
+const formCreateTimeDate = computed({
+  get: () => (form.createTime ? String(form.createTime).split(" ")[0] : ""),
+  set: (value) => {
+    form.createTime = value ? `${value} ${dayjs().format("HH:mm:ss")}` : "";
+  },
+});
 
 const rules = {
   customerId: [{ required: true, message: "璇烽�夋嫨瀹㈡埛", trigger: "change" }],
@@ -641,6 +650,27 @@
   proxy.download("/accountInvoiceApplication/exportAccountInvoiceApplication", params, filename);
 };
 
+const getSummaries = ({ columns, data }) => {
+  const sums = [];
+  columns.forEach((col, index) => {
+    if (index === 0) {
+      sums[index] = "鍚堣";
+    } else if (col.property === "amount") {
+      const total = data.reduce((prev, cur) => {
+        const v = Number(cur.amount);
+        return prev + (isNaN(v) ? 0 : v);
+      }, 0);
+      sums[index] = total.toLocaleString("zh-CN", {
+        minimumFractionDigits: 2,
+        maximumFractionDigits: 2,
+      });
+    } else {
+      sums[index] = "";
+    }
+  });
+  return sums;
+};
+
 const formatMoney = (value) => {
   if (value === undefined || value === null) return "0.00";
   return Number(value).toFixed(2).replace(/\B(?=(\d{3})+(?!\d))/g, ",");
@@ -721,6 +751,7 @@
     status: normalizeStatus(row.status ?? row.auditStatus),
     outboundBatchNos,
     outboundBatches: formatOutboundBatches(row.outboundBatches),
+    createTime: row.createTime ?? "",
   });
 };
 
@@ -739,7 +770,7 @@
     applyDate: new Date().toISOString().split("T")[0],
     content: "",
     remark: "",
-    createTime: new Date().toISOString().split("T")[0],
+    createTime: dayjs().format("YYYY-MM-DD HH:mm:ss"),
   });
   outboundBatchList.value = [];
   outboundBatchOptions.value = [];

--
Gitblit v1.9.3