From b77cb967a3ae670fead19a461daa127a8a4647b2 Mon Sep 17 00:00:00 2001
From: chenrui <1187576398@qq.com>
Date: 星期一, 09 六月 2025 16:05:15 +0800
Subject: [PATCH] 回款登记记录修改

---
 src/views/salesManagement/invoiceLedger/index.vue |   57 +++++++++++++++++++++++++++++++--------------------------
 1 files changed, 31 insertions(+), 26 deletions(-)

diff --git a/src/views/salesManagement/invoiceLedger/index.vue b/src/views/salesManagement/invoiceLedger/index.vue
index 85f0473..b298ef4 100644
--- a/src/views/salesManagement/invoiceLedger/index.vue
+++ b/src/views/salesManagement/invoiceLedger/index.vue
@@ -90,7 +90,7 @@
         <el-row :gutter="30">
           <el-col :span="12">
             <el-form-item label="寮�绁ㄤ汉锛�" prop="invoicePerson">
-              <el-input v-model="form.invoicePerson" placeholder="璇疯緭鍏�" clearable/>
+              <el-input v-model="form.invoicePerson" placeholder="璇疯緭鍏�" clearable disabled/>
             </el-form-item>
           </el-col>
           <el-col :span="12">
@@ -103,6 +103,7 @@
                   type="date"
                   placeholder="璇烽�夋嫨"
                   clearable
+                  disabled
               />
             </el-form-item>
           </el-col>
@@ -143,7 +144,7 @@
         </div>
       </template>
     </el-dialog>
-    <el-dialog title="涓婁紶寮圭獥" width="20%" v-model="uploadModal">
+    <el-dialog title="涓婁紶寮圭獥" width="50%" v-model="uploadModal">
       <el-row :gutter="30">
         <el-col :span="24">
           <el-form-item label="闄勪欢鏉愭枡锛�" prop="remark">
@@ -156,6 +157,7 @@
                 :headers="upload.headers"
                 accept=".pdf"
                 :limit="1"
+                style="width: 100%"
                 :on-exceed="handleExceed"
                 :before-upload="handleBeforeUpload"
                 :on-error="handleUploadError"
@@ -194,6 +196,7 @@
   commitFile,
   registrationProductPage
 } from "../../../api/salesManagement/invoiceLedger.js";
+import useUserStore from "@/store/modules/user.js";
 const { proxy } = getCurrentInstance()
 const tableData = ref([])
 const productData = ref([])
@@ -201,7 +204,7 @@
 const tableLoading = ref(false)
 const page = reactive({
   current: 1,
-  size: 10,
+  size: 100,
 })
 const total = ref(0)
 const fileList = ref([])
@@ -235,6 +238,7 @@
 })
 const { searchForm, form, rules } = toRefs(data)
 const currentId = ref('')
+const userStore = useUserStore()
 const upload = reactive({
   // 涓婁紶鐨勫湴鍧�
   url: import.meta.env.VITE_APP_BASE_API + "/invoiceLedger/uploadFile",
@@ -252,9 +256,9 @@
   page.current = 1
   getList()
 }
-const paginationChange = ({ current, limit }) => {
-  page.current = current;
-  page.size = limit;
+const paginationChange = (obj) => {
+  page.current = obj.page;
+  page.size = obj.limit;
   getList()
 }
 const getList = () => {
@@ -271,26 +275,10 @@
 }
 // 涓昏〃鍚堣鏂规硶
 const summarizeMainTable = (param) => {
-  const { columns, data } = param;
-  const sums = [];
-  columns.forEach((column, index) => {
-    if (index === 0) {
-      sums[index] = '鍚堣';
-      return;
-    }
-    const prop = column.property;
-    if (['invoiceAmount'].includes(prop)) {
-      const values = data.map(item => Number(item[prop]));
-      if (!values.every(value => isNaN(value))) {
-        sums[index] = values.reduce((acc, val) => (!isNaN(val) ? acc + val : acc), 0);
-      } else {
-        sums[index] = '';
-      }
-    } else {
-      sums[index] = '';
-    }
-  })
-  return sums;
+  return proxy.summarizeTable(param, ['invoiceTotal'], {
+    ticketsNum: { noDecimal: true }, // 涓嶄繚鐣欏皬鏁�
+    futureTickets: { noDecimal: true }, // 涓嶄繚鐣欏皬鏁�
+  });
 };
 // 鎵撳紑寮规
 const openForm = (row) => {
@@ -298,9 +286,17 @@
   productData.value = []
   fileList.value = []
   currentId.value = row.id;
+
   invoiceLedgerProductInfo({id: row.id}).then(res => {
     form.value = {...res.data}
     fileList.value = res.data.fileList;
+    if(!form.value.invoicePerson){
+      form.value.invoicePerson = userStore.nickName
+      form.value.entryDate = getCurrentDate();
+    }
+    if(!form.value.invoiceDate){
+      form.value.invoiceDate = getCurrentDate();
+    }
   })
   dialogFormVisible.value = true
 }
@@ -411,6 +407,15 @@
 
 }
 
+// 鑾峰彇褰撳墠鏃ユ湡骞舵牸寮忓寲涓� YYYY-MM-DD
+function getCurrentDate() {
+  const today = new Date();
+  const year = today.getFullYear();
+  const month = String(today.getMonth() + 1).padStart(2, '0'); // 鏈堜唤浠�0寮�濮�
+  const day = String(today.getDate()).padStart(2, '0');
+  return `${year}-${month}-${day}`;
+}
+
 getList()
 </script>
 

--
Gitblit v1.9.3