From b95f47dc46951561f36980ca4bae17a752eab8c4 Mon Sep 17 00:00:00 2001 From: gaoluyang <2820782392@qq.com> Date: 星期六, 12 七月 2025 13:38:44 +0800 Subject: [PATCH] 1.采购管理-优化:不是本条数据录入人不可修改数据。表格展示优化、来票操作后,不能再次编辑。未进行开票、来票操作的台账可以进行编辑 --- src/views/procurementManagement/invoiceEntry/components/Modal.vue | 52 ++++++++++++++++++++++++++++++++++++++-------------- 1 files changed, 38 insertions(+), 14 deletions(-) diff --git a/src/views/procurementManagement/invoiceEntry/components/Modal.vue b/src/views/procurementManagement/invoiceEntry/components/Modal.vue index 4c19cfd..f4f3045 100644 --- a/src/views/procurementManagement/invoiceEntry/components/Modal.vue +++ b/src/views/procurementManagement/invoiceEntry/components/Modal.vue @@ -54,10 +54,7 @@ </el-col> <el-col :span="12"> <el-form-item label="鍙戠エ閲戦(鍏�)锛�" prop="invoiceAmount"> - <el-input - type="number" - :step="0.01" - :min="0" + <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="form.invoiceAmount" placeholder="鑷姩濉厖" clearable @@ -116,12 +113,14 @@ rowKey="id" :column="columns" :tableData="form.productData" + :summaryMethod="summarizeChildrenTable" + :isShowSummary="true" height="auto" > <template #ticketsNumRef="{ row }"> <el-input-number v-model="row.ticketsNum" - placeholder="璇烽�夋嫨" + placeholder="璇疯緭鍏�" :min="0" :step="0.1" clearable @@ -132,7 +131,7 @@ <template #ticketsAmountRef="{ row }"> <el-input-number v-model="row.ticketsAmount" - placeholder="璇烽�夋嫨" + placeholder="璇疯緭鍏�" :min="0" :step="0.1" clearable @@ -153,6 +152,7 @@ <script setup> import { ref, getCurrentInstance } from "vue"; +import { defineEmits } from 'vue'; import { useModal } from "@/hooks/useModal"; import useFormData from "@/hooks/useFormData"; import FileUpload from "@/components/Upload/FileUpload.vue"; @@ -214,14 +214,18 @@ title: "鏉ョエ鐧昏", }); +const emit = defineEmits(['refreshList']); + const columns = [ { label: "浜у搧澶х被", prop: "productCategory", + width: 120, }, { label: "瑙勬牸鍨嬪彿", prop: "specificationModel", + width: 120, }, { label: "鍗曚綅", @@ -286,10 +290,12 @@ { label: "鏈潵绁ㄦ暟", prop: "futureTickets", + width: 100, }, { label: "鏈潵绁ㄩ噾棰�(鍏�)", prop: "futureTicketsAmount", + width: 200, }, ]; @@ -319,7 +325,19 @@ form.productData = data.productData; } }; - +// 瀛愯〃鍚堣鏂规硶 +const summarizeChildrenTable = (param) => { + return proxy.summarizeTable(param, [ + "taxInclusiveUnitPrice", + "taxInclusiveTotalPrice", + "taxExclusiveTotalPrice", + "ticketsNum", + "ticketsAmount", + "ticketsAmountRef", + "futureTickets", + "futureTicketsAmount", + ]); +}; //鏈鏉ョエ鏁板け鐒︽搷浣� const invoiceNumBlur = (row) => { if (!row.ticketsNum || row.ticketsNum === "") { @@ -331,11 +349,11 @@ return; } // 璁$畻鏈鏉ョエ閲戦 - row.ticketsAmount = row.ticketsNum * row.taxInclusiveUnitPrice; + row.ticketsAmount = (row.ticketsNum * row.taxInclusiveUnitPrice).toFixed(2) // 璁$畻鏈潵绁ㄦ暟 - row.futureTickets = row.tempFutureTickets - row.ticketsNum; + row.futureTickets = (row.tempFutureTickets - row.ticketsNum).toFixed(2) // 璁$畻鏈潵绁ㄩ噾棰� - row.futureTicketsAmount = row.tempFutureTicketsAmount - row.ticketsAmount; + row.futureTicketsAmount = (row.tempFutureTicketsAmount - row.ticketsAmount).toFixed(2) calculateinvoiceAmount(); }; @@ -354,9 +372,9 @@ (row.ticketsAmount / row.taxInclusiveUnitPrice).toFixed(2) ); // 璁$畻鏈潵绁ㄦ暟 - row.futureTickets = row.tempFutureTickets - row.ticketsNum; + row.futureTickets = (row.tempFutureTickets - row.ticketsNum).toFixed(2) // 璁$畻鏈潵绁ㄩ噾棰� - row.futureTicketsAmount = row.tempFutureTicketsAmount - row.ticketsAmount; + row.futureTicketsAmount = (row.tempFutureTicketsAmount - row.ticketsAmount).toFixed(2) calculateinvoiceAmount(); }; @@ -364,7 +382,7 @@ let invoiceAmountTotal = 0; form.productData.forEach((item) => { if (item.ticketsAmount) { - invoiceAmountTotal += item.ticketsAmount; + invoiceAmountTotal += Number(item.ticketsAmount); } }); form.invoiceAmount = invoiceAmountTotal.toFixed(2); @@ -384,6 +402,11 @@ const removeFile = (file) => { const { tempId } = file.response.data; form.tempFileIds = form.tempFileIds.filter((item) => item !== tempId); +}; + +const closeAndRefresh = () => { + closeModal(); + emit('refreshList'); }; const submitForm = () => { @@ -409,7 +432,7 @@ }); modalLoading.value = false; if (code == 200) { - closeModal(); + closeAndRefresh(); } } else { modalLoading.value = false; @@ -419,6 +442,7 @@ defineExpose({ open, + closeAndRefresh, }); </script> -- Gitblit v1.9.3