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/salesManagement/invoiceRegistration/index.vue | 40 +++++++++++++++++++++++++++++-----------
1 files changed, 29 insertions(+), 11 deletions(-)
diff --git a/src/views/salesManagement/invoiceRegistration/index.vue b/src/views/salesManagement/invoiceRegistration/index.vue
index 9a2add4..2777f6c 100644
--- a/src/views/salesManagement/invoiceRegistration/index.vue
+++ b/src/views/salesManagement/invoiceRegistration/index.vue
@@ -36,15 +36,18 @@
<el-form-item>
<el-button type="primary" @click="handleQuery"> 鎼滅储 </el-button>
<el-button @click="resetForm"> 閲嶇疆 </el-button>
+ <el-button @click="handleExport" style="margin-right: 10px">瀵煎嚭</el-button>
</el-form-item>
</el-form>
</div>
<div class="table_list">
<div class="flex justify-between">
<div></div>
+ <div>
<el-button type="primary" @click="openForm" style="margin-bottom: 8px">
鏂板鐧昏
</el-button>
+ </div>
</div>
<el-table
:data="tableData"
@@ -319,7 +322,6 @@
<el-table-column label="鏈寮�绁ㄦ暟" prop="currentInvoiceNum" width="180">
<template #default="scope">
<el-input-number :step="0.1" :min="0" style="width: 100%"
- :precision="2"
v-model="scope.row.currentInvoiceNum"
@change="invoiceNumBlur(scope.row)"
></el-input-number>
@@ -332,7 +334,6 @@
>
<template #default="scope">
<el-input-number :step="0.01" :min="0" style="width: 100%"
- :precision="2"
v-model="scope.row.currentInvoiceAmount"
@change="invoiceAmountBlur(scope.row)"
></el-input-number>
@@ -463,17 +464,17 @@
const formattedNumber = (row, column, cellValue) => {
if (cellValue == 0) {
- return parseFloat(cellValue).toFixed(2);
+ return parseFloat(cellValue).toFixed(5);
}
if (cellValue) {
- return parseFloat(cellValue).toFixed(2);
+ return parseFloat(cellValue).toFixed(5);
} else {
return cellValue;
}
};
const formattedInputNumber = (value) => {
- return value ? parseFloat(value).toFixed(2) : 0;
+ return value ? parseFloat(value).toFixed(5) : 0;
};
// 鏌ヨ鍒楄〃
@@ -599,11 +600,27 @@
});
};
+// 瀵煎嚭閿�鍞彴璐�
+const handleExport = () => {
+ ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚鍑猴紝鏄惁纭瀵煎嚭锛�", "瀵煎嚭", {
+ confirmButtonText: "纭",
+ cancelButtonText: "鍙栨秷",
+ type: "warning",
+ })
+ .then(() => {
+ proxy.download("/sales/ledger/exportOne", { ...searchForm, ...page }, "寮�绁ㄧ櫥璁�.xlsx");
+ })
+ .catch(() => {
+ proxy.$modal.msg("宸插彇娑�");
+ });
+};
+
//鏈寮�绁ㄥけ鐒︽搷浣�
const invoiceNumBlur = (row) => {
if (!row.currentInvoiceNum) {
row.currentInvoiceNum = 0;
}
+ row.currentInvoiceNum = row.currentInvoiceNum.toFixed(5);
if (row.currentInvoiceNum > row.tempNoInvoiceNum) {
proxy.$modal.msgWarning("鏈寮�绁ㄦ暟涓嶅緱澶т簬鏈紑绁ㄦ暟");
row.currentInvoiceNum = 0;
@@ -611,21 +628,22 @@
// 璁$畻鏈寮�绁ㄩ噾棰�
row.currentInvoiceAmount = (
row.currentInvoiceNum * row.taxInclusiveUnitPrice
- ).toFixed(2);
+ ).toFixed(5);
// 璁$畻鏈紑绁ㄦ暟
row.noInvoiceNum = (row.originalNoInvoiceNum - row.currentInvoiceNum).toFixed(
- 2
+ 5
);
// 璁$畻鏈紑绁ㄩ噾棰�
row.noInvoiceAmount = (
row.tempnoInvoiceAmount - row.currentInvoiceAmount
- ).toFixed(2);
+ ).toFixed(5);
};
// 鏈寮�绁ㄩ噾棰濆け鐒︽搷浣�
const invoiceAmountBlur = (row) => {
if (!row.currentInvoiceAmount) {
row.currentInvoiceAmount = 0;
}
+ row.currentInvoiceAmount = row.currentInvoiceAmount.toFixed(5);
// 璁$畻鏄惁瓒呰繃寮�绁ㄦ�婚噾棰�
if (row.currentInvoiceAmount > row.tempnoInvoiceAmount) {
proxy.$modal.msgWarning("鏈寮�绁ㄩ噾棰濅笉寰楀ぇ浜庢湭寮�绁ㄩ噾棰�");
@@ -634,17 +652,17 @@
// 璁$畻鏈寮�绁ㄦ暟
row.currentInvoiceNum = (
row.currentInvoiceAmount / row.taxInclusiveUnitPrice
- ).toFixed(2);
+ ).toFixed(5);
console.log("row.currentInvoiceNum ", row.currentInvoiceNum);
console.log(" row.originalNoInvoiceNum ", row.originalNoInvoiceNum);
// 璁$畻鏈紑绁ㄦ暟
row.noInvoiceNum = (row.originalNoInvoiceNum - row.currentInvoiceNum).toFixed(
- 2
+ 5
);
// 璁$畻鏈紑绁ㄩ噾棰�
row.noInvoiceAmount = (
row.tempnoInvoiceAmount - row.currentInvoiceAmount
- ).toFixed(2);
+ ).toFixed(5);
};
onMounted(() => {
--
Gitblit v1.9.3