From d876aa06f04d7b93f849e944cca5df64b6a28ee2 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期二, 09 十二月 2025 10:19:29 +0800
Subject: [PATCH] 1.南洋电缆小数点修改
---
src/views/procurementManagement/invoiceEntry/components/Modal.vue | 75 +++++++++++++++++++++++++++----------
1 files changed, 54 insertions(+), 21 deletions(-)
diff --git a/src/views/procurementManagement/invoiceEntry/components/Modal.vue b/src/views/procurementManagement/invoiceEntry/components/Modal.vue
index e3d96af..2f54261 100644
--- a/src/views/procurementManagement/invoiceEntry/components/Modal.vue
+++ b/src/views/procurementManagement/invoiceEntry/components/Modal.vue
@@ -58,6 +58,7 @@
v-model="form.invoiceAmount"
placeholder="鑷姩濉厖"
clearable
+ :disabled="true"
/>
</el-form-item>
</el-col>
@@ -77,6 +78,8 @@
style="width: 100%"
v-model="form.entryDate"
type="date"
+ value-format="YYYY-MM-DD"
+ format="YYYY-MM-DD"
clearable
/>
</el-form-item>
@@ -103,6 +106,8 @@
style="width: 100%"
v-model="form.enterDate"
type="date"
+ value-format="YYYY-MM-DD"
+ format="YYYY-MM-DD"
clearable
/>
</el-form-item>
@@ -113,14 +118,17 @@
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"
+ :precision="2"
clearable
style="width: 100%"
@change="invoiceNumBlur(row)"
@@ -129,8 +137,9 @@
<template #ticketsAmountRef="{ row }">
<el-input-number
v-model="row.ticketsAmount"
- placeholder="璇烽�夋嫨"
+ placeholder="璇疯緭鍏�"
:min="0"
+ :precision="2"
:step="0.1"
clearable
style="width: 100%"
@@ -140,16 +149,17 @@
</PIMTable>
</el-form>
<template #footer>
+ <el-button type="primary" :loading="modalLoading" @click="submitForm">
+ {{ modalOptions.confirmText }}
+ </el-button>
<el-button @click="closeModal">{{ modalOptions.cancelText }}</el-button>
- <el-button type="primary" :loading="modalLoading" @click="submitForm">
- {{ modalOptions.confirmText }}
- </el-button>
</template>
</el-dialog>
</template>
<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";
@@ -189,8 +199,7 @@
const rules = ref({
invoiceNumber: [
- { required: true, message: "璇疯緭鍏ュ彂绁ㄥ彿", trigger: "blur" },
- { type: "string" },
+ { required: false, message: "璇疯緭鍏ュ彂绁ㄥ彿", trigger: "blur" },
],
invoiceAmount: [
{ required: true, message: "璇疯緭鍏ュ彂绁ㄩ噾棰�", trigger: "blur" },
@@ -211,14 +220,18 @@
title: "鏉ョエ鐧昏",
});
+const emit = defineEmits(['refreshList']);
+
const columns = [
{
label: "浜у搧澶х被",
prop: "productCategory",
+ width: 120,
},
{
label: "瑙勬牸鍨嬪彿",
prop: "specificationModel",
+ width: 120,
},
{
label: "鍗曚綅",
@@ -245,7 +258,7 @@
prop: "taxInclusiveUnitPrice",
width: 150,
formatData: (val) => {
- return val ? parseFloat(val).toFixed(2) : 0;
+ return val ? parseFloat(val).toFixed(5) : 0;
},
},
{
@@ -253,7 +266,7 @@
prop: "taxInclusiveTotalPrice",
width: 150,
formatData: (val) => {
- return parseFloat(val).toFixed(2) ?? 0;
+ return parseFloat(val).toFixed(5) ?? 0;
},
},
{
@@ -261,7 +274,7 @@
prop: "taxExclusiveTotalPrice",
width: 150,
formatData: (val) => {
- return parseFloat(val).toFixed(2) ?? 0;
+ return parseFloat(val).toFixed(5) ?? 0;
},
},
{
@@ -283,10 +296,12 @@
{
label: "鏈潵绁ㄦ暟",
prop: "futureTickets",
+ width: 100,
},
{
label: "鏈潵绁ㄩ噾棰�(鍏�)",
prop: "futureTicketsAmount",
+ width: 200,
},
];
@@ -316,7 +331,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 === "") {
@@ -328,11 +355,11 @@
return;
}
// 璁$畻鏈鏉ョエ閲戦
- row.ticketsAmount = row.ticketsNum * row.taxInclusiveUnitPrice;
+ row.ticketsAmount = (row.ticketsNum * row.taxInclusiveUnitPrice).toFixed(5)
// 璁$畻鏈潵绁ㄦ暟
- row.futureTickets = row.tempFutureTickets - row.ticketsNum;
+ row.futureTickets = (row.tempFutureTickets - row.ticketsNum).toFixed(5)
// 璁$畻鏈潵绁ㄩ噾棰�
- row.futureTicketsAmount = row.tempFutureTicketsAmount - row.ticketsAmount;
+ row.futureTicketsAmount = (row.tempFutureTicketsAmount - row.ticketsAmount).toFixed(5)
calculateinvoiceAmount();
};
@@ -348,12 +375,12 @@
}
// 璁$畻鏈鏉ョエ鏁�
row.ticketsNum = Number(
- (row.ticketsAmount / row.taxInclusiveUnitPrice).toFixed(2)
+ (row.ticketsAmount / row.taxInclusiveUnitPrice).toFixed(5)
);
// 璁$畻鏈潵绁ㄦ暟
- row.futureTickets = row.tempFutureTickets - row.ticketsNum;
+ row.futureTickets = (row.tempFutureTickets - row.ticketsNum).toFixed(5)
// 璁$畻鏈潵绁ㄩ噾棰�
- row.futureTicketsAmount = row.tempFutureTicketsAmount - row.ticketsAmount;
+ row.futureTicketsAmount = (row.tempFutureTicketsAmount - row.ticketsAmount).toFixed(5)
calculateinvoiceAmount();
};
@@ -361,10 +388,10 @@
let invoiceAmountTotal = 0;
form.productData.forEach((item) => {
if (item.ticketsAmount) {
- invoiceAmountTotal += item.ticketsAmount;
+ invoiceAmountTotal += Number(item.ticketsAmount);
}
});
- form.invoiceAmount = invoiceAmountTotal.toFixed(2);
+ form.invoiceAmount = invoiceAmountTotal.toFixed(5);
};
const open = (type, eid) => {
@@ -383,10 +410,15 @@
form.tempFileIds = form.tempFileIds.filter((item) => item !== tempId);
};
+const closeAndRefresh = () => {
+ closeModal();
+ emit('refreshList');
+};
+
const submitForm = () => {
formRef.value.validate(async (valid, fields) => {
if (valid) {
- modalLoading.value = true;
+ // modalLoading.value = true;
const { code } = await addOrUpdateRegistration({
purchaseLedgerId: id.value,
purchaseContractNumber: form.purchaseLedgerNo,
@@ -406,7 +438,7 @@
});
modalLoading.value = false;
if (code == 200) {
- closeModal();
+ closeAndRefresh();
}
} else {
modalLoading.value = false;
@@ -416,6 +448,7 @@
defineExpose({
open,
+ closeAndRefresh,
});
</script>
--
Gitblit v1.9.3