From feb53a39cb88c7f807c287b18d8008bb149b5200 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期五, 13 六月 2025 17:40:08 +0800
Subject: [PATCH] 小数点

---
 src/views/salesManagement/invoiceRegistration/index.vue |   34 ++++++++++++++++++++--------------
 1 files changed, 20 insertions(+), 14 deletions(-)

diff --git a/src/views/salesManagement/invoiceRegistration/index.vue b/src/views/salesManagement/invoiceRegistration/index.vue
index b97e26e..77596d7 100644
--- a/src/views/salesManagement/invoiceRegistration/index.vue
+++ b/src/views/salesManagement/invoiceRegistration/index.vue
@@ -41,9 +41,9 @@
               <el-table-column label="鍚◣鍗曚环(鍏�)" prop="taxInclusiveUnitPrice" :formatter="formattedNumber" />
               <el-table-column label="鍚◣鎬讳环(鍏�)" prop="taxInclusiveTotalPrice" :formatter="formattedNumber" />
               <el-table-column label="涓嶅惈绋庢�讳环(鍏�)" prop="taxExclusiveTotalPrice" :formatter="formattedNumber" />
-              <el-table-column label="寮�绁ㄦ暟" prop="invoiceNum" />
+              <el-table-column label="寮�绁ㄦ暟" prop="invoiceNum" :formatter="formattedNumber" />
               <el-table-column label="寮�绁ㄩ噾棰�(鍏�)" prop="invoiceAmount" :formatter="formattedNumber" />
-              <el-table-column label="鏈紑绁ㄦ暟" prop="noInvoiceNum" />
+              <el-table-column label="鏈紑绁ㄦ暟" prop="noInvoiceNum" :formatter="formattedNumber" />
               <el-table-column label="鏈紑绁ㄩ噾棰�(鍏�)" prop="noInvoiceAmount" :formatter="formattedNumber"/>
             </el-table>
           </template>
@@ -55,6 +55,7 @@
         <el-table-column label="涓氬姟鍛�" prop="salesman" show-overflow-tooltip/>
         <el-table-column label="椤圭洰鍚嶇О" prop="projectName" show-overflow-tooltip/>
         <el-table-column label="鍚堝悓閲戦(鍏�)" prop="contractAmount" show-overflow-tooltip :formatter="formattedNumber"/>
+        <el-table-column label="宸插紑绁ㄩ噾棰�(鍏�)" prop="invoiceTotal" show-overflow-tooltip :formatter="formattedNumber"/>
         <el-table-column label="鏈紑绁ㄩ噾棰�(鍏�)" prop="noInvoiceAmountTotal" show-overflow-tooltip :formatter="formattedNumber"/>
       </el-table>
       <pagination v-show="total > 0" :total="total" layout="total, sizes, prev, pager, next, jumper" :page="page.current"
@@ -140,7 +141,7 @@
 // import {userListNoPage} from "@/api/system/user.js";
 import {
   getSalesLedgerWithProducts,
-  ledgerList,
+  ledgerListPage,
   productList,
 } from "@/api/salesManagement/salesLedger.js";
 import {
@@ -153,7 +154,7 @@
 const tableLoading = ref(false)
 const page = reactive({
   current: 1,
-  size: 10,
+  size: 100,
 })
 const total = ref(0)
 // 鐢ㄦ埛淇℃伅琛ㄥ崟寮规鏁版嵁
@@ -177,6 +178,9 @@
 const { searchForm, form, rules } = toRefs(data)
 
 const formattedNumber = (row, column, cellValue) => {
+  if (cellValue == 0) {
+    return parseFloat(cellValue).toFixed(2);
+  }
   if (cellValue) {
     return parseFloat(cellValue).toFixed(2);
   } else {
@@ -189,16 +193,16 @@
   page.current = 1
   getList()
 }
-const paginationChange = ({ current, limit }) => {
-  page.current = current;
-  page.size = limit;
+const paginationChange = (obj) => {
+  page.current = obj.page;
+  page.size = obj.limit;
   getList()
 }
 const getList = () => {
   tableLoading.value = true
-  ledgerList({...searchForm.value, ...page}).then(res => {
+  ledgerListPage({...searchForm.value, ...page}).then(res => {
     tableLoading.value = false
-    tableData.value = res.rows;
+    tableData.value = res.records;
     total.value = res.total
     expandedRowKeys.value = []
   })
@@ -231,7 +235,7 @@
 }
 // 涓昏〃鍚堣鏂规硶
 const summarizeMainTable = (param) => {
-  return proxy.summarizeTable(param, ['contractAmount','noInvoiceAmountTotal']);
+  return proxy.summarizeTable(param, ['contractAmount','noInvoiceAmountTotal','invoiceTotal']);
 };
 // 瀛愯〃鍚堣鏂规硶
 const summarizeChildrenTable = (param) => {
@@ -302,9 +306,9 @@
   // 璁$畻鏈寮�绁ㄩ噾棰�
   row.currentInvoiceAmount = (row.currentInvoiceNum * row.taxInclusiveUnitPrice).toFixed(2)
   // 璁$畻鏈紑绁ㄦ暟
-  row.noInvoiceNum = row.originalNoInvoiceNum - row.currentInvoiceNum
+  row.noInvoiceNum = (row.originalNoInvoiceNum - row.currentInvoiceNum).toFixed(2)
   // 璁$畻鏈紑绁ㄩ噾棰�
-  row.noInvoiceAmount = row.tempnoInvoiceAmount -  row.currentInvoiceAmount
+  row.noInvoiceAmount = (row.tempnoInvoiceAmount -  row.currentInvoiceAmount).toFixed(2)
 }
 // 鏈寮�绁ㄩ噾棰濆け鐒︽搷浣�
 const invoiceAmountBlur = (row) => {
@@ -318,10 +322,12 @@
   }
   // 璁$畻鏈寮�绁ㄦ暟
   row.currentInvoiceNum = (row.currentInvoiceAmount / row.taxInclusiveUnitPrice).toFixed(2)
+  console.log('row.currentInvoiceNum ',row.currentInvoiceNum )
+  console.log(' row.originalNoInvoiceNum  ', row.originalNoInvoiceNum  )
   // 璁$畻鏈紑绁ㄦ暟
-  row.noInvoiceNum = row.originalNoInvoiceNum - row.currentInvoiceNum
+  row.noInvoiceNum = (row.originalNoInvoiceNum - row.currentInvoiceNum).toFixed(2)
   // 璁$畻鏈紑绁ㄩ噾棰�
-  row.noInvoiceAmount = row.tempnoInvoiceAmount -  row.currentInvoiceAmount
+  row.noInvoiceAmount = (row.tempnoInvoiceAmount -  row.currentInvoiceAmount).toFixed(2)
 }
 
 getList()

--
Gitblit v1.9.3