From 60830aade68c18e6f71d698fad4f7b4b189c8adb Mon Sep 17 00:00:00 2001
From: yaowanxin <3588231647@qq.com>
Date: 星期一, 26 一月 2026 14:39:10 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev_New' into dev_New

---
 src/views/procurementManagement/procurementInvoiceLedger/Form/EditForm.vue   |  172 +++++++++++++++++++---------------
 src/api/procurementManagement/procurementInvoiceLedger.js                    |   13 ++
 src/views/procurementManagement/procurementInvoiceLedger/Modal/EditModal.vue |   96 ++++++++++---------
 3 files changed, 156 insertions(+), 125 deletions(-)

diff --git a/src/api/procurementManagement/procurementInvoiceLedger.js b/src/api/procurementManagement/procurementInvoiceLedger.js
index 2408bbd..038e94f 100644
--- a/src/api/procurementManagement/procurementInvoiceLedger.js
+++ b/src/api/procurementManagement/procurementInvoiceLedger.js
@@ -83,11 +83,18 @@
   });
 }
 
-export function getProductRecordById(params) {
+// export function getProductRecordById(params) {
+//   return request({
+//     url: "/purchase/registration/getProductRecordById",
+//     method: "get",
+//     params: 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/procurementInvoiceLedger/Form/EditForm.vue b/src/views/procurementManagement/procurementInvoiceLedger/Form/EditForm.vue
index f939be4..7f8b852 100644
--- a/src/views/procurementManagement/procurementInvoiceLedger/Form/EditForm.vue
+++ b/src/views/procurementManagement/procurementInvoiceLedger/Form/EditForm.vue
@@ -23,17 +23,28 @@
       </el-col>
       <el-col :span="12">
         <el-form-item label="鍙戠エ鍙凤細">
-          <el-input disabled v-model="form.invoiceNumber" />
+          <el-input disabled
+                    v-model="form.invoiceNumber" />
         </el-form-item>
       </el-col>
       <el-col :span="12">
         <el-form-item label="鏉ョエ鏁帮細">
-          <el-input-number :step="0.1" :min="0" style="width: 100%" v-model="form.ticketsNum" @change="inputTicketsNum" :precision="2"/>
+          <el-input-number :step="0.1"
+                           :min="0"
+                           style="width: 100%"
+                           v-model="form.ticketsNum"
+                           @change="inputTicketsNum"
+                           :precision="2" />
         </el-form-item>
       </el-col>
       <el-col :span="12">
         <el-form-item label="鏈鏉ョエ閲戦(鍏�)锛�">
-					<el-input-number :step="0.1" :min="0" style="width: 100%" v-model="form.ticketsAmount" @change="inputTicketsAmount" :precision="2"/>
+          <el-input-number :step="0.1"
+                           :min="0"
+                           style="width: 100%"
+                           v-model="form.ticketsAmount"
+                           @change="inputTicketsAmount"
+                           :precision="2" />
         </el-form-item>
       </el-col>
       <el-col :span="12">
@@ -46,83 +57,92 @@
 </template>
 
 <script setup>
-import useFormData from "@/hooks/useFormData";
-import { getProductRecordById } from "@/api/procurementManagement/procurementInvoiceLedger";
-const { proxy } = getCurrentInstance()
+  import useFormData from "@/hooks/useFormData";
+  import { getProductRecordById } from "@/api/procurementManagement/procurementInvoiceLedger";
+  const { proxy } = getCurrentInstance();
 
-defineOptions({
-  name: "鏉ョエ鍙拌处琛ㄥ崟",
-});
-const temFutureTickets = ref(0)
-const { form, resetForm } = useFormData({
-  id: undefined,
-  purchaseContractNumber: undefined, // 閲囪喘鍚堝悓鍙�
-  salesContractNo: undefined, // 閿�鍞悎鍚屽彿
-  createdAt: undefined, // 鍒涘缓鏃堕棿
-  invoiceNumber: undefined, // 鍙戠エ鍙�
-  ticketsNum: undefined, // 鏉ョエ鏁�
-  ticketsAmount: undefined, // 鏉ョエ閲戦
-	taxInclusiveUnitPrice: undefined, // 鍚◣鍗曚环
-});
+  defineOptions({
+    name: "鏉ョエ鍙拌处琛ㄥ崟",
+  });
+  const temFutureTickets = ref(0);
+  const { form, resetForm } = useFormData({
+    id: undefined,
+    purchaseContractNumber: undefined, // 閲囪喘鍚堝悓鍙�
+    salesContractNo: undefined, // 閿�鍞悎鍚屽彿
+    createdAt: undefined, // 鍒涘缓鏃堕棿
+    invoiceNumber: undefined, // 鍙戠エ鍙�
+    ticketsNum: undefined, // 鏉ョエ鏁�
+    ticketsAmount: undefined, // 鏉ョエ閲戦
+    taxInclusiveUnitPrice: undefined, // 鍚◣鍗曚环
+  });
 
-const load = async (id) => {
-  const { code, data } = await getProductRecordById({ id });
-  if (code === 200) {
-    form.id = data.id;
-    form.purchaseContractNumber = data.purchaseContractNumber;
-    form.salesContractNo = data.salesContractNo;
-    form.createdAt = data.createdAt;
-    form.invoiceNumber = data.invoiceNumber;
-    form.ticketsNum = data.ticketsNum;
-    form.ticketsAmount = data.ticketsAmount.toFixed(2);
-    form.taxInclusiveUnitPrice = data.taxInclusiveUnitPrice;
-    form.futureTickets = data.futureTickets;
-    temFutureTickets.value = data.futureTickets;
-  }
-};
+  const load = async (id, purchaseLedgerId, productModelId) => {
+    const { code, data } = await getProductRecordById({
+      id: id,
+      purchaseLedgerId: purchaseLedgerId,
+      productModelId: productModelId,
+    });
+    if (code === 200) {
+      form.id = data.id;
+      form.purchaseContractNumber = data.purchaseContractNumber;
+      form.salesContractNo = data.salesContractNo;
+      form.createdAt = data.createdAt;
+      form.invoiceNumber = data.invoiceNumber;
+      form.ticketsNum = data.ticketsNum;
+      form.ticketsAmount = data.ticketsAmount.toFixed(2);
+      form.taxInclusiveUnitPrice = data.taxInclusiveUnitPrice;
+      form.futureTickets = data.futureTickets;
+      temFutureTickets.value = data.futureTickets;
+    }
+  };
 
-const inputTicketsNum = (val) => {
-	// 纭繚鍚◣鍗曚环瀛樺湪涓斾笉涓洪浂
-	if (!form.taxInclusiveUnitPrice || Number(form.taxInclusiveUnitPrice) === 0) {
-		proxy.$modal.msgWarning("鍚◣鍗曚环涓嶈兘涓洪浂鎴栨湭瀹氫箟");
-		return;
-	}
-	if (Number(form.ticketsNum) > Number(temFutureTickets.value)) {
-		proxy.$modal.msgWarning("寮�绁ㄦ暟涓嶅緱澶т簬鏈紑绁ㄦ暟");
-		form.ticketsNum = temFutureTickets.value
-	}
-	
-	// 纭繚鎵�鏈夋暟鍊奸兘杞崲涓烘暟瀛楃被鍨嬭繘琛岃绠�
-	const ticketsAmount = Number(form.ticketsNum) * Number(form.taxInclusiveUnitPrice);
-	const futureTickets = Number(temFutureTickets.value) - Number(form.ticketsNum);
-	form.futureTickets = Number(futureTickets.toFixed(2));
-	form.ticketsAmount = Number(ticketsAmount.toFixed(2));
-};
-const inputTicketsAmount = (val) => {
-	// 纭繚鍚◣鍗曚环瀛樺湪涓斾笉涓洪浂
-	if (!form.taxInclusiveUnitPrice || Number(form.taxInclusiveUnitPrice) === 0) {
-		proxy.$modal.msgWarning("鍚◣鍗曚环涓嶈兘涓洪浂鎴栨湭瀹氫箟");
-		return;
-	}
-	
-	if (Number(val) > Number(form.futureTickets*form.taxInclusiveUnitPrice)) {
-		proxy.$modal.msgWarning("鏈鏉ョエ閲戦涓嶅緱澶т簬鎬婚噾棰�");
-		form.ticketsAmount = (form.futureTickets*form.taxInclusiveUnitPrice).toFixed(2)
-		const ticketsNum = Number(form.ticketsAmount) / Number(form.taxInclusiveUnitPrice);
-		form.ticketsNum = Number(ticketsNum.toFixed(2))
-		return;
-	}
-	
-	// 纭繚鎵�鏈夋暟鍊奸兘杞崲涓烘暟瀛楃被鍨嬭繘琛岃绠�
-	const ticketsNum = Number(val) / Number(form.taxInclusiveUnitPrice);
-	form.ticketsNum = Number(ticketsNum.toFixed(2));
-};
+  const inputTicketsNum = val => {
+    // 纭繚鍚◣鍗曚环瀛樺湪涓斾笉涓洪浂
+    if (!form.taxInclusiveUnitPrice || Number(form.taxInclusiveUnitPrice) === 0) {
+      proxy.$modal.msgWarning("鍚◣鍗曚环涓嶈兘涓洪浂鎴栨湭瀹氫箟");
+      return;
+    }
+    if (Number(form.ticketsNum) > Number(temFutureTickets.value)) {
+      proxy.$modal.msgWarning("寮�绁ㄦ暟涓嶅緱澶т簬鏈紑绁ㄦ暟");
+      form.ticketsNum = temFutureTickets.value;
+    }
 
-defineExpose({
-  load,
-  form,
-  resetForm,
-});
+    // 纭繚鎵�鏈夋暟鍊奸兘杞崲涓烘暟瀛楃被鍨嬭繘琛岃绠�
+    const ticketsAmount =
+      Number(form.ticketsNum) * Number(form.taxInclusiveUnitPrice);
+    const futureTickets =
+      Number(temFutureTickets.value) - Number(form.ticketsNum);
+    form.futureTickets = Number(futureTickets.toFixed(2));
+    form.ticketsAmount = Number(ticketsAmount.toFixed(2));
+  };
+  const inputTicketsAmount = val => {
+    // 纭繚鍚◣鍗曚环瀛樺湪涓斾笉涓洪浂
+    if (!form.taxInclusiveUnitPrice || Number(form.taxInclusiveUnitPrice) === 0) {
+      proxy.$modal.msgWarning("鍚◣鍗曚环涓嶈兘涓洪浂鎴栨湭瀹氫箟");
+      return;
+    }
+
+    if (Number(val) > Number(form.futureTickets * form.taxInclusiveUnitPrice)) {
+      proxy.$modal.msgWarning("鏈鏉ョエ閲戦涓嶅緱澶т簬鎬婚噾棰�");
+      form.ticketsAmount = (
+        form.futureTickets * form.taxInclusiveUnitPrice
+      ).toFixed(2);
+      const ticketsNum =
+        Number(form.ticketsAmount) / Number(form.taxInclusiveUnitPrice);
+      form.ticketsNum = Number(ticketsNum.toFixed(2));
+      return;
+    }
+
+    // 纭繚鎵�鏈夋暟鍊奸兘杞崲涓烘暟瀛楃被鍨嬭繘琛岃绠�
+    const ticketsNum = Number(val) / Number(form.taxInclusiveUnitPrice);
+    form.ticketsNum = Number(ticketsNum.toFixed(2));
+  };
+
+  defineExpose({
+    load,
+    form,
+    resetForm,
+  });
 </script>
 
 <style lang="scss" scoped></style>
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>

--
Gitblit v1.9.3