From df2328ea56438bf534ad2df79d7f761606cd9cce Mon Sep 17 00:00:00 2001
From: zhangwencui <1064582902@qq.com>
Date: 星期五, 26 六月 2026 17:34:40 +0800
Subject: [PATCH] 已完成状态的生产订单,工艺路线不能修改,新增编辑按钮都不要展示

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

diff --git a/src/views/financialManagement/receivable/invoiceApply.vue b/src/views/financialManagement/receivable/invoiceApply.vue
index 14fdd67..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,
@@ -98,7 +100,7 @@
         <el-row :gutter="20">
           <el-col :span="24">
             <el-form-item label="鐢宠鍗曞彿" prop="applyCode">
-              <el-input v-model="form.applyCode" placeholder="绯荤粺鑷姩鐢熸垚" disabled />
+              <el-input v-model="form.applyCode" placeholder="淇濆瓨鍚庤嚜鍔ㄧ敓鎴�" disabled />
             </el-form-item>
           </el-col>
         </el-row>
@@ -189,6 +191,20 @@
             </el-form-item>
           </el-col>
         </el-row>
+        <el-row :gutter="20">
+          <el-col :span="12">
+            <el-form-item label="鍒涘缓鏃堕棿" prop="createTime">
+              <el-date-picker
+                v-model="formCreateTimeDate"
+                type="date"
+                placeholder="閫夋嫨鏃ユ湡"
+                value-format="YYYY-MM-DD"
+                style="width: 100%;"
+                :disabled="isView"
+              />
+            </el-form-item>
+          </el-col>
+        </el-row>
         <el-form-item label="鍙戠エ鍐呭" prop="content">
           <el-input v-model="form.content" type="textarea" :rows="3" placeholder="璇疯緭鍏ュ彂绁ㄥ唴瀹�" :disabled="isView" />
         </el-form-item>
@@ -253,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";
@@ -524,6 +541,13 @@
   applyDate: "",
   content: "",
   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 = {
@@ -626,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, ",");
@@ -706,6 +751,7 @@
     status: normalizeStatus(row.status ?? row.auditStatus),
     outboundBatchNos,
     outboundBatches: formatOutboundBatches(row.outboundBatches),
+    createTime: row.createTime ?? "",
   });
 };
 
@@ -714,7 +760,7 @@
   isView.value = false;
   dialogTitle.value = "鏂板寮�绁ㄧ敵璇�";
   Object.assign(form, {
-    applyCode: "KP" + Date.now().toString().slice(-8),
+    applyCode: "",
     customerId: "",
     outboundBatchNos: [],
     outboundBatches: "",
@@ -724,6 +770,7 @@
     applyDate: new Date().toISOString().split("T")[0],
     content: "",
     remark: "",
+    createTime: dayjs().format("YYYY-MM-DD HH:mm:ss"),
   });
   outboundBatchList.value = [];
   outboundBatchOptions.value = [];
@@ -752,6 +799,7 @@
     invoiceAmount: form.amount,
     taxRate: form.taxRate,
     status: 0,
+    createTime: form.createTime,
   };
   if (forUpdate) {
     payload.id = currentId.value;
@@ -766,6 +814,7 @@
   dialogTitle.value = "缂栬緫寮�绁ㄧ敵璇�";
   fillFormFromRow(row);
   dialogVisible.value = true;
+  loadOutboundBatches(form.customerId, true);
 };
 
 const view = (row) => {

--
Gitblit v1.9.3