From 378c343c859f135b18d39f994c247598bc9a2b9a Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期四, 15 一月 2026 17:55:24 +0800
Subject: [PATCH] Merge branch 'dev_天津军泰伟业' of http://114.132.189.42:9002/r/product-inventory-management into dev_天津军泰伟业

---
 src/views/procurementManagement/procurementInvoiceLedger/index.vue           |    2 
 src/views/salesManagement/invoiceLedger/index.vue                            |    2 
 src/views/procurementManagement/procurementInvoiceLedger/Form/EditForm.vue   |   34 ++-
 src/api/procurementManagement/procurementInvoiceLedger.js                    |    6 
 src/views/procurementManagement/invoiceEntry/index.vue                       |  488 ++++++++++++++++++++++----------------------
 src/views/procurementManagement/procurementInvoiceLedger/Modal/EditModal.vue |   96 ++++----
 src/views/procurementManagement/paymentEntry/index.vue                       |    8 
 7 files changed, 330 insertions(+), 306 deletions(-)

diff --git a/src/api/procurementManagement/procurementInvoiceLedger.js b/src/api/procurementManagement/procurementInvoiceLedger.js
index 76f8410..3ca8dd5 100644
--- a/src/api/procurementManagement/procurementInvoiceLedger.js
+++ b/src/api/procurementManagement/procurementInvoiceLedger.js
@@ -83,11 +83,11 @@
   });
 }
 
-export function getProductRecordById(params) {
+export function getProductRecordById(data) {
   return request({
     url: "/purchase/registration/getProductRecordById",
-    method: "get",
-    params: params,
+     method: "post",
+    data: data,
   });
 }
 
diff --git a/src/views/procurementManagement/invoiceEntry/index.vue b/src/views/procurementManagement/invoiceEntry/index.vue
index 2a04cab..d177c97 100644
--- a/src/views/procurementManagement/invoiceEntry/index.vue
+++ b/src/views/procurementManagement/invoiceEntry/index.vue
@@ -1,35 +1,30 @@
 <template>
   <div class="app-container">
     <div class="search_form">
-      <el-form :model="filters" :inline="true">
+      <el-form :model="filters"
+               :inline="true">
         <el-form-item label="渚涘簲鍟嗗悕绉�">
-          <el-input
-              v-model="filters.supplierName"
-              placeholder="璇疯緭鍏ュ悕绉版悳绱�"
-              clearable
-              prefix-icon="Search"
-              @change="getTableData"
-          />
+          <el-input v-model="filters.supplierName"
+                    placeholder="璇疯緭鍏ュ悕绉版悳绱�"
+                    clearable
+                    prefix-icon="Search"
+                    @change="getTableData" />
         </el-form-item>
         <el-form-item label="閲囪喘璁㈠崟鍙凤細">
-          <el-input
-            v-model="filters.purchaseContractNumber"
-            placeholder="璇疯緭鍏�"
-            clearable
-            prefix-icon="Search"
-            @change="getTableData"
-          />
+          <el-input v-model="filters.purchaseContractNumber"
+                    placeholder="璇疯緭鍏�"
+                    clearable
+                    prefix-icon="Search"
+                    @change="getTableData" />
         </el-form-item>
-
         <el-form-item label="閿�鍞悎鍚屽彿">
-          <el-input
-              v-model="filters.salesContractNo"
-              placeholder="璇疯緭鍏ラ攢鍞悎鍚屽彿"
-              clearable
-          />
+          <el-input v-model="filters.salesContractNo"
+                    placeholder="璇疯緭鍏ラ攢鍞悎鍚屽彿"
+                    clearable />
         </el-form-item>
         <el-form-item>
-          <el-button type="primary" @click="getTableData"> 鎼滅储 </el-button>
+          <el-button type="primary"
+                     @click="getTableData"> 鎼滅储 </el-button>
           <el-button @click="resetFilters"> 閲嶇疆 </el-button>
         </el-form-item>
       </el-form>
@@ -38,264 +33,269 @@
       <div class="actions">
         <div></div>
         <div>
-          <el-button @click="handleExport" style="margin-right: 10px">瀵煎嚭</el-button>
-          <el-button type="primary" @click="handleAdd('add')">
+          <el-button @click="handleExport"
+                     style="margin-right: 10px">瀵煎嚭</el-button>
+          <el-button type="primary"
+                     @click="handleAdd('add')">
             鏂板鐧昏
           </el-button>
-<!--          <el-button type="danger" plain @click="handleDelete">鍒犻櫎</el-button>-->
+          <!--          <el-button type="danger" plain @click="handleDelete">鍒犻櫎</el-button>-->
         </div>
       </div>
-      <PIMTable
-        rowKey="id"
-        :column="columns"
-        :tableData="filteredDataList"
-        :tableLoading="loading"
-        :isSelection="true"
-        :page="{
+      <PIMTable rowKey="id"
+                :column="columns"
+                :tableData="dataList"
+                :tableLoading="loading"
+                :isSelection="true"
+                :page="{
           current: pagination.currentPage,
           size: pagination.pageSize,
           total: pagination.total,
         }"
-        :expand-row-keys="expandRowKeys"
-        :summaryMethod="summarizeMainTable"
-        :isShowSummary="true"
-        @expand-change="expandChange"
-        @selection-change="handleSelectionChange"
-        @pagination="changePage"
-      >
+                :expand-row-keys="expandRowKeys"
+                :summaryMethod="summarizeMainTable"
+                :isShowSummary="true"
+                @expand-change="expandChange"
+                @selection-change="handleSelectionChange"
+                @pagination="changePage">
         <template #expand="{ row }">
           <ExpandTable ref="expandTableRef" />
         </template>
         <template #operation="{ row }">
-          <el-button
-            text
-            type="primary"
-            size="small"
-            @click="handleEdit('edit', row.id)"
-          >
+          <el-button text
+                     type="primary"
+                     size="small"
+                     @click="handleEdit('edit', row.id)">
             缂栬緫
           </el-button>
         </template>
       </PIMTable>
     </div>
-    <Modal ref="modalRef" @refreshList="getTableData"></Modal>
+    <Modal ref="modalRef"
+           @refreshList="getTableData"></Modal>
   </div>
 </template>
 
 <script setup>
-import { usePaginationApi } from "@/hooks/usePaginationApi";
-import {delRegistration, gePurchaseListPage} from "@/api/procurementManagement/invoiceEntry.js";
-import { nextTick, onMounted, getCurrentInstance, ref } from "vue";
-import ExpandTable from "./components/ExpandTable.vue";
-import Modal from "./components/Modal.vue";
-import {ElMessageBox} from "element-plus";
+  import { usePaginationApi } from "@/hooks/usePaginationApi";
+  import {
+    delRegistration,
+    gePurchaseListPage,
+  } from "@/api/procurementManagement/invoiceEntry.js";
+  import { nextTick, onMounted, getCurrentInstance, ref } from "vue";
+  import ExpandTable from "./components/ExpandTable.vue";
+  import Modal from "./components/Modal.vue";
+  import { ElMessageBox } from "element-plus";
 
-defineOptions({
-  name: "鏉ョエ鐧昏",
-});
+  defineOptions({
+    name: "鏉ョエ鐧昏",
+  });
 
-const { proxy } = getCurrentInstance();
-const expandRowKeys = ref([]);
-const expandTableRef = ref();
-const modalRef = ref();
-const selectedRows = ref([]);
+  const { proxy } = getCurrentInstance();
+  const expandRowKeys = ref([]);
+  const expandTableRef = ref();
+  const modalRef = ref();
+  const selectedRows = ref([]);
 
-const {
-  loading,
-  filters,
-  columns,
-  dataList,
-  pagination,
-  getTableData,
-  resetFilters,
-  onCurrentChange,
-} = usePaginationApi(
-  gePurchaseListPage,
-  {
-    purchaseContractNumber: undefined,
-  },
-  [
+  const {
+    loading,
+    filters,
+    columns,
+    dataList,
+    pagination,
+    getTableData,
+    resetFilters,
+    onCurrentChange,
+  } = usePaginationApi(
+    gePurchaseListPage,
     {
-      type: "expand",
-      dataType: "slot",
-      slot: "expand",
+      purchaseContractNumber: undefined,
     },
-    {
-      label: "閲囪喘璁㈠崟鍙�",
-      prop: "purchaseContractNumber",
-      width:150
-    },
-    {
-      label: "閿�鍞悎鍚屽彿",
-      prop: "salesContractNo",
-      width:150
-    },
-    {
-      label: "渚涘簲鍟嗗悕绉�",
-      prop: "supplierName",
-      width:300
-    },
-    {
-      label: "褰曞叆浜�",
-      prop: "recorderName",
-    },
-    {
-      label: "褰曞叆鏃ユ湡",
-      prop: "entryDate",
-      width:110
-    },
-    {
-      label: "鍚堝悓閲戦(鍏�)",
-      prop: "contractAmount",
-      width:200,
-      formatData: (val) => {
-        return val ? parseFloat(val).toFixed(2) : 0;
+    [
+      {
+        type: "expand",
+        dataType: "slot",
+        slot: "expand",
       },
-    },
-    {
-      label: "宸叉潵绁ㄩ噾棰�(鍏�)",
-      prop: "receiptPaymentAmount",
-      width:200,
-      formatData: (val) => {
-        return val ? parseFloat(val).toFixed(2) : 0;
+      {
+        label: "閲囪喘璁㈠崟鍙�",
+        prop: "purchaseContractNumber",
+        width: 150,
       },
-    },
-    {
-      label: "寰呮潵绁ㄩ噾棰�(鍏�)",
-      prop: "unReceiptPaymentAmount",
-      width:200,
-      formatData: (val) => {
-        return val ? parseFloat(val).toFixed(2) : 0;
+      {
+        label: "閿�鍞悎鍚屽彿",
+        prop: "salesContractNo",
+        width: 150,
       },
-    },
-    // {
-    //   fixed: "right",
-    //   label: "鎿嶄綔",
-    //   dataType: "slot",
-    //   slot: "operation",
-    //   align: "center",
-    //   width: "200px",
-    // },
-  ]
-);
-// 璁$畻灞炴�ц繃婊� 瀹℃壒閫氳繃approvalStatus=1 鐨勬暟鎹�
-const filteredDataList = computed(() => {
-  return dataList.value.filter(item => item.approvalStatus == 1);
-});
-const handleSelectionChange = (selection) => {
-  selectedRows.value = selection.filter(
-    (item) => item.purchaseContractNumber !== undefined
+      {
+        label: "渚涘簲鍟嗗悕绉�",
+        prop: "supplierName",
+        width: 300,
+      },
+      {
+        label: "褰曞叆浜�",
+        prop: "recorderName",
+      },
+      {
+        label: "褰曞叆鏃ユ湡",
+        prop: "entryDate",
+        width: 110,
+      },
+      {
+        label: "鍚堝悓閲戦(鍏�)",
+        prop: "contractAmount",
+        width: 200,
+        formatData: val => {
+          return val ? parseFloat(val).toFixed(2) : 0;
+        },
+      },
+      {
+        label: "宸叉潵绁ㄩ噾棰�(鍏�)",
+        prop: "receiptPaymentAmount",
+        width: 200,
+        formatData: val => {
+          return val ? parseFloat(val).toFixed(2) : 0;
+        },
+      },
+      {
+        label: "寰呮潵绁ㄩ噾棰�(鍏�)",
+        prop: "unReceiptPaymentAmount",
+        width: 200,
+        formatData: val => {
+          return val ? parseFloat(val).toFixed(2) : 0;
+        },
+      },
+      // {
+      //   fixed: "right",
+      //   label: "鎿嶄綔",
+      //   dataType: "slot",
+      //   slot: "operation",
+      //   align: "center",
+      //   width: "200px",
+      // },
+    ]
   );
-};
+  // 璁$畻灞炴�ц繃婊� 瀹℃壒閫氳繃approvalStatus=1 鐨勬暟鎹�
+  // const filteredDataList = computed(() => {
+  //   // return dataList.value.filter(item => item.approvalStatus == 1);
+  //   return dataList;
+  // });
+  const handleSelectionChange = selection => {
+    selectedRows.value = selection.filter(
+      item => item.purchaseContractNumber !== undefined
+    );
+  };
 
-const handleAdd = (type) => {
-	if (selectedRows.value.length < 1) {
-		proxy.$modal.msgWarning("璇疯嚦灏戦�変腑涓�鏉℃暟鎹�");
-		return;
-	}
-	modalRef.value.open(type, selectedRows.value);
-};
-
-const handleEdit = (type, id) => {
-  modalRef.value.open(type, id);
-};
-
-// 瀵煎嚭
-const handleOut = () => {
-	ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚鍑猴紝鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
-		confirmButtonText: "纭",
-		cancelButtonText: "鍙栨秷",
-		type: "warning",
-	})
-		.then(() => {
-			proxy.download("/purchase/registration/export", {}, "鏉ョエ鐧昏.xlsx");
-		})
-		.catch(() => {
-			proxy.$modal.msg("宸插彇娑�");
-		});
-};
-
-// 瀵煎嚭閲囪喘鍙拌处
-const handleExport = () => {
-	ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚鍑猴紝鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
-		confirmButtonText: "纭",
-		cancelButtonText: "鍙栨秷",
-		type: "warning",
-	})
-		.then(() => {
-			proxy.download("/purchase/ledger/exportOne", {}, "鏉ョエ鐧昏.xlsx");
-		})
-		.catch(() => {
-			proxy.$modal.msg("宸插彇娑�");
-		});
-};
-
-// 鍒犻櫎
-const handleDelete = () => {
-	let ids = [];
-	if (selectedRows.value.length > 0) {
-    // 鏂板鍒ゆ柇锛氬鏋滄湁閫変腑鐨勬暟鎹病鏈塼icketRegistrationId锛屾彁绀哄苟缁堟
-    const noTicket = selectedRows.value.some(item => !item.ticketRegistrationId);
-    if (noTicket) {
-      proxy.$modal.msgWarning("閲囪喘鍙拌处杩樻湭杩涜鏉ョエ鐧昏,鏃犳硶杩涜鍒犻櫎鎿嶄綔");
+  const handleAdd = type => {
+    if (selectedRows.value.length < 1) {
+      proxy.$modal.msgWarning("璇疯嚦灏戦�変腑涓�鏉℃暟鎹�");
       return;
     }
-		ids = selectedRows.value.map((item) => item.ticketRegistrationId);
-	} else {
-		proxy.$modal.msgWarning("璇烽�夋嫨鏁版嵁");
-		return;
-	}
-	ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚垹闄わ紝鏄惁纭鍒犻櫎锛�", "瀵煎嚭", {
-		confirmButtonText: "纭",
-		cancelButtonText: "鍙栨秷",
-		type: "warning",
-	})
-		.then(() => {
-			delRegistration(ids).then((res) => {
-				proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
-				getList();
-			});
-		})
-		.catch(() => {
-			proxy.$modal.msg("宸插彇娑�");
-		});
-};
+    modalRef.value.open(type, selectedRows.value);
+  };
 
-const expandChange = async (row, expandedRows) => {
-  if (expandedRows.length > 0) {
-    await nextTick();
-    expandTableRef.value.getList(row.id);
-  }
-};
+  const handleEdit = (type, id) => {
+    modalRef.value.open(type, id);
+  };
 
-const changePage = ({ page, limit }) => {
-  pagination.currentPage = page;
-  pagination.pageSize = limit;
-  onCurrentChange(page);
-};
-// 涓昏〃鍚堣鏂规硶
-const summarizeMainTable = (param) => {
-	return proxy.summarizeTable(
-		param,
-		["contractAmount", "receiptPaymentAmount", "unReceiptPaymentAmount"],
-		{
-			ticketsNum: { noDecimal: true }, // 涓嶄繚鐣欏皬鏁�
-			futureTickets: { noDecimal: true }, // 涓嶄繚鐣欏皬鏁�
-		}
-	);
-};
-onMounted(() => {
-  getTableData();
-});
+  // 瀵煎嚭
+  const handleOut = () => {
+    ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚鍑猴紝鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
+      confirmButtonText: "纭",
+      cancelButtonText: "鍙栨秷",
+      type: "warning",
+    })
+      .then(() => {
+        proxy.download("/purchase/registration/export", {}, "鏉ョエ鐧昏.xlsx");
+      })
+      .catch(() => {
+        proxy.$modal.msg("宸插彇娑�");
+      });
+  };
+
+  // 瀵煎嚭閲囪喘鍙拌处
+  const handleExport = () => {
+    ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚鍑猴紝鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
+      confirmButtonText: "纭",
+      cancelButtonText: "鍙栨秷",
+      type: "warning",
+    })
+      .then(() => {
+        proxy.download("/purchase/ledger/exportOne", {}, "鏉ョエ鐧昏.xlsx");
+      })
+      .catch(() => {
+        proxy.$modal.msg("宸插彇娑�");
+      });
+  };
+
+  // 鍒犻櫎
+  const handleDelete = () => {
+    let ids = [];
+    if (selectedRows.value.length > 0) {
+      // 鏂板鍒ゆ柇锛氬鏋滄湁閫変腑鐨勬暟鎹病鏈塼icketRegistrationId锛屾彁绀哄苟缁堟
+      const noTicket = selectedRows.value.some(
+        item => !item.ticketRegistrationId
+      );
+      if (noTicket) {
+        proxy.$modal.msgWarning("閲囪喘鍙拌处杩樻湭杩涜鏉ョエ鐧昏,鏃犳硶杩涜鍒犻櫎鎿嶄綔");
+        return;
+      }
+      ids = selectedRows.value.map(item => item.ticketRegistrationId);
+    } else {
+      proxy.$modal.msgWarning("璇烽�夋嫨鏁版嵁");
+      return;
+    }
+    ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚垹闄わ紝鏄惁纭鍒犻櫎锛�", "瀵煎嚭", {
+      confirmButtonText: "纭",
+      cancelButtonText: "鍙栨秷",
+      type: "warning",
+    })
+      .then(() => {
+        delRegistration(ids).then(res => {
+          proxy.$modal.msgSuccess("鍒犻櫎鎴愬姛");
+          getList();
+        });
+      })
+      .catch(() => {
+        proxy.$modal.msg("宸插彇娑�");
+      });
+  };
+
+  const expandChange = async (row, expandedRows) => {
+    if (expandedRows.length > 0) {
+      await nextTick();
+      expandTableRef.value.getList(row.id);
+    }
+  };
+
+  const changePage = ({ page, limit }) => {
+    pagination.currentPage = page;
+    pagination.pageSize = limit;
+    onCurrentChange(page);
+  };
+  // 涓昏〃鍚堣鏂规硶
+  const summarizeMainTable = param => {
+    return proxy.summarizeTable(
+      param,
+      ["contractAmount", "receiptPaymentAmount", "unReceiptPaymentAmount"],
+      {
+        ticketsNum: { noDecimal: true }, // 涓嶄繚鐣欏皬鏁�
+        futureTickets: { noDecimal: true }, // 涓嶄繚鐣欏皬鏁�
+      }
+    );
+  };
+  onMounted(() => {
+    getTableData();
+  });
 </script>
 
 <style lang="scss" scoped>
-.table_list {
-  margin-top: unset;
-}
-.actions {
-  display: flex;
-  justify-content: space-between;
-  margin-bottom: 10px;
-}
+  .table_list {
+    margin-top: unset;
+  }
+  .actions {
+    display: flex;
+    justify-content: space-between;
+    margin-bottom: 10px;
+  }
 </style>
diff --git a/src/views/procurementManagement/paymentEntry/index.vue b/src/views/procurementManagement/paymentEntry/index.vue
index 0cab5c2..dcba772 100644
--- a/src/views/procurementManagement/paymentEntry/index.vue
+++ b/src/views/procurementManagement/paymentEntry/index.vue
@@ -75,6 +75,7 @@
                                  v-model="scope.row.currentPaymentAmount"
                                  :disabled="!scope.row.editType"
                                  :precision="2"
+                                 :max="scope.row.maxAmountTTotal + maxAmount"
                                  placeholder="璇疯緭鍏�"
                                  clearable />
               </template>
@@ -447,6 +448,8 @@
       }
     });
   };
+  const maxAmount = ref(0);
+  const maxAmountTTotal = ref(0);
   // 灞曞紑琛�
   const expandChange = (row, expandedRows) => {
     if (expandedRows.length > 0) {
@@ -454,12 +457,17 @@
         expandedRowKeys.value = [];
         try {
           childrenLoading.value = true;
+          maxAmount.value = row.unPaymentAmountTotal;
           registrationListPageGetById({ id: row.id }).then(res => {
             childrenLoading.value = false;
             const index = tableData.value.findIndex(item => item.id === row.id);
             if (index > -1) {
               expandData.value = res;
             }
+            expandData.value = res.map(item => ({
+              ...item,
+              maxAmountTTotal: item.currentPaymentAmount,
+            }));
             expandedRowKeys.value.push(row.id);
           });
         } catch (error) {
diff --git a/src/views/procurementManagement/procurementInvoiceLedger/Form/EditForm.vue b/src/views/procurementManagement/procurementInvoiceLedger/Form/EditForm.vue
index 85f83ff..b0a2278 100644
--- a/src/views/procurementManagement/procurementInvoiceLedger/Form/EditForm.vue
+++ b/src/views/procurementManagement/procurementInvoiceLedger/Form/EditForm.vue
@@ -75,10 +75,16 @@
     taxInclusiveUnitPrice: undefined, // 鍚◣鍗曚环
     ticketRegistrationId: undefined, // 鍚◣鍗曚环
   });
-
-  const load = async id => {
-    const { code, data } = await getProductRecordById({ id });
+  const cuticketsAmount = ref(0);
+  const cufutureTickets = ref(0);
+  const load = async (id, purchaseLedgerId, productModelId) => {
+    const { code, data } = await getProductRecordById({
+      id: id,
+      purchaseLedgerId: purchaseLedgerId,
+      productModelId: productModelId,
+    });
     if (code === 200) {
+      console.log(data, "鏉ョエ鍙拌处璇︽儏");
       form.id = data.id;
       form.purchaseContractNumber = data.purchaseContractNumber;
       form.salesContractNo = data.salesContractNo;
@@ -88,8 +94,11 @@
       form.ticketsAmount = data.ticketsAmount.toFixed(2);
       form.taxInclusiveUnitPrice = data.taxInclusiveUnitPrice;
       form.futureTickets = data.futureTickets;
+      form.futureTicketsAmount = data.futureTicketsAmount.toFixed(2);
       // temFutureTickets.value = data.futureTickets;
       temFutureTickets.value = data.quantity;
+      cuticketsAmount.value = data.futureTicketsAmount + data.ticketsAmount;
+      cufutureTickets.value = data.futureTickets + data.ticketsNum;
 
       form.ticketRegistrationId = data.ticketRegistrationId;
     }
@@ -101,16 +110,15 @@
       proxy.$modal.msgWarning("鍚◣鍗曚环涓嶈兘涓洪浂鎴栨湭瀹氫箟");
       return;
     }
-    if (Number(form.ticketsNum) > Number(temFutureTickets.value)) {
+    if (Number(form.ticketsNum) > Number(cufutureTickets.value)) {
       proxy.$modal.msgWarning("寮�绁ㄦ暟涓嶅緱澶т簬鏈紑绁ㄦ暟");
-      form.ticketsNum = temFutureTickets.value;
+      form.ticketsNum = cufutureTickets.value;
     }
 
     // 纭繚鎵�鏈夋暟鍊奸兘杞崲涓烘暟瀛楃被鍨嬭繘琛岃绠�
     const ticketsAmount =
       Number(form.ticketsNum) * Number(form.taxInclusiveUnitPrice);
-    const futureTickets =
-      Number(temFutureTickets.value) - Number(form.ticketsNum);
+    const futureTickets = Number(cufutureTickets.value) - Number(form.ticketsNum);
     form.futureTickets = Number(futureTickets.toFixed(2));
     form.ticketsAmount = Number(ticketsAmount.toFixed(2));
   };
@@ -121,14 +129,18 @@
       return;
     }
 
-    if (Number(val) > Number(form.futureTickets * form.taxInclusiveUnitPrice)) {
+    if (
+      Number(val) >
+      Number((form.futureTickets + form.ticketsNum) * form.taxInclusiveUnitPrice)
+    ) {
       proxy.$modal.msgWarning("鏈鏉ョエ閲戦涓嶅緱澶т簬鎬婚噾棰�");
-      form.ticketsAmount = (
-        form.futureTickets * form.taxInclusiveUnitPrice
-      ).toFixed(2);
+      form.ticketsAmount = cuticketsAmount.value.toFixed(2);
       const ticketsNum =
         Number(form.ticketsAmount) / Number(form.taxInclusiveUnitPrice);
       form.ticketsNum = Number(ticketsNum.toFixed(2));
+      form.futureTickets = Number(
+        (cufutureTickets.value - form.ticketsNum).toFixed(2)
+      );
       return;
     }
 
diff --git a/src/views/procurementManagement/procurementInvoiceLedger/Modal/EditModal.vue b/src/views/procurementManagement/procurementInvoiceLedger/Modal/EditModal.vue
index 82b4164..68f3650 100644
--- a/src/views/procurementManagement/procurementInvoiceLedger/Modal/EditModal.vue
+++ b/src/views/procurementManagement/procurementInvoiceLedger/Modal/EditModal.vue
@@ -1,62 +1,66 @@
 <template>
-  <el-dialog :title="modalOptions.title" v-model="visible" @close="close">
+  <el-dialog :title="modalOptions.title"
+             v-model="visible"
+             @close="close">
     <EditForm ref="editFormRef" />
     <template #footer>
-			<el-button type="primary" :loading="loading" @click="sendForm">
-				{{ modalOptions.confirmText }}
-			</el-button>
+      <el-button type="primary"
+                 :loading="loading"
+                 @click="sendForm">
+        {{ modalOptions.confirmText }}
+      </el-button>
       <el-button @click="closeModal">{{ modalOptions.cancelText }}</el-button>
     </template>
   </el-dialog>
 </template>
 
 <script setup>
-import { useModal } from "@/hooks/useModal";
-import EditForm from "../Form/EditForm.vue";
-import { updateRegistration } from "@/api/procurementManagement/procurementInvoiceLedger";
-import { ElMessage } from "element-plus";
+  import { useModal } from "@/hooks/useModal";
+  import EditForm from "../Form/EditForm.vue";
+  import { updateRegistration } from "@/api/procurementManagement/procurementInvoiceLedger";
+  import { ElMessage } from "element-plus";
 
-defineOptions({
-  name: "鏉ョエ鍙拌处缂栬緫",
-});
-const emits = defineEmits(["success"]);
+  defineOptions({
+    name: "鏉ョエ鍙拌处缂栬緫",
+  });
+  const emits = defineEmits(["success"]);
 
-const saleLedgerProjectId = ref('')
-const editFormRef = ref();
-const {
-  id,
-  visible,
-  loading,
-  openModal,
-  modalOptions,
-  handleConfirm,
-  closeModal,
-} = useModal({ title: "鏉ョエ鍙拌处" });
+  const saleLedgerProjectId = ref("");
+  const editFormRef = ref();
+  const {
+    id,
+    visible,
+    loading,
+    openModal,
+    modalOptions,
+    handleConfirm,
+    closeModal,
+  } = useModal({ title: "鏉ョエ鍙拌处" });
 
-const open = async (row) => {
-  openModal(row.id);
-	saleLedgerProjectId.value = row.saleLedgerProjectId;
-  await nextTick();
-  editFormRef.value.load(row.id);
-};
+  const open = async row => {
+    openModal(row.id);
+    saleLedgerProjectId.value = row.saleLedgerProjectId;
+    await nextTick();
+    editFormRef.value.load(row.id, row.purchaseLedgerId, row.productModelId);
+  };
 
-const close = () => {
-  editFormRef.value.resetForm();
-  closeModal();
-};
+  const close = () => {
+    editFormRef.value.resetForm();
+    closeModal();
+  };
 
-const sendForm = async () => {
-  const form = editFormRef.value.form;
-	form.saleLedgerProjectId = saleLedgerProjectId.value;
-  const { code } = await updateRegistration(form);
-  if (code === 200) {
-    emits("success");
-    ElMessage({ message: "鎿嶄綔鎴愬姛", type: "success" });
-    close();
-  }
-};
+  const sendForm = async () => {
+    const form = editFormRef.value.form;
+    form.saleLedgerProjectId = saleLedgerProjectId.value;
+    const { code } = await updateRegistration(form);
+    if (code === 200) {
+      emits("success");
+      ElMessage({ message: "鎿嶄綔鎴愬姛", type: "success" });
+      close();
+    }
+  };
 
-defineExpose({
-  open,
-});
+  defineExpose({
+    open,
+  });
 </script>
diff --git a/src/views/procurementManagement/procurementInvoiceLedger/index.vue b/src/views/procurementManagement/procurementInvoiceLedger/index.vue
index bc05272..9cba844 100644
--- a/src/views/procurementManagement/procurementInvoiceLedger/index.vue
+++ b/src/views/procurementManagement/procurementInvoiceLedger/index.vue
@@ -181,7 +181,7 @@
       },
     },
     {
-      label: "寮�绁ㄦ棩鏈�",
+      label: "鏉ョエ鏃ユ湡",
       prop: "createdAt",
       width: 110,
     },
diff --git a/src/views/salesManagement/invoiceLedger/index.vue b/src/views/salesManagement/invoiceLedger/index.vue
index 364fe9b..df71370 100644
--- a/src/views/salesManagement/invoiceLedger/index.vue
+++ b/src/views/salesManagement/invoiceLedger/index.vue
@@ -181,7 +181,7 @@
                           prop="invoiceTotal">
               <el-input-number :step="0.01"
                                :min="0"
-                               :max="form.noInvoiceAmount"
+                               :max="form.noInvoiceAmount + form.invoiceAmount"
                                style="width: 100%"
                                v-model="form.invoiceTotal"
                                placeholder="璇疯緭鍏�"

--
Gitblit v1.9.3