From 1116b9a9a5eb9a838723e5b5c04482a143c9ff4a Mon Sep 17 00:00:00 2001
From: syruan <15555146157@163.com>
Date: Sat, 30 Aug 2025 22:17:52 +0800
Subject: [PATCH] =?UTF-8?q?=E8=B4=B9=E7=94=A8=E6=8E=A8=E9=80=81=E5=AE=A1?=
 =?UTF-8?q?=E6=A0=B8=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
 src/api/costPush/costPush.js                  |  2 +-
 .../material/costPush/pushReview/index.vue    | 80 ++++++++++++++-----
 2 files changed, 62 insertions(+), 20 deletions(-)
diff --git a/src/api/costPush/costPush.js b/src/api/costPush/costPush.js
index c4c711fc..9b139b3d 100644
--- a/src/api/costPush/costPush.js
+++ b/src/api/costPush/costPush.js
@@ -30,7 +30,7 @@ export function submitFee(params){
 // 查询费用推送审核租赁列表
 export function getLeaseList(query) {
   return request({
-    url: '/material/iws_cost_push/getLeaseCostsByAgreementIdAndMonth',
+    url: '/material/slt_agreement_info/leasePeriodCostDetails',
     method: 'get',
     params: query
   })
diff --git a/src/views/material/costPush/pushReview/index.vue b/src/views/material/costPush/pushReview/index.vue
index 02339a5b..069f0259 100644
--- a/src/views/material/costPush/pushReview/index.vue
+++ b/src/views/material/costPush/pushReview/index.vue
@@ -111,13 +111,19 @@
           
         
       
+      
+        
+          工器具
+          安全用品
+        
+      
       
         
           
             {{scope.row.leaseMoney}}
           
           
-            {{scope.row.leaseMoney}}
+            {{Number(scope.row.leaseMoney).toFixed(3)}}
           
         
       
@@ -127,7 +133,7 @@
             {{scope.row.repairMoney}}
           
           
-            {{scope.row.repairMoney}}
+            {{Number(scope.row.repairMoney).toFixed(3)}}
           
         
       
@@ -137,7 +143,7 @@
             {{scope.row.scrapMoney}}
           
           
-            {{scope.row.scrapMoney}}
+            {{Number(scope.row.scrapMoney).toFixed(3)}}
           
         
       
@@ -147,13 +153,16 @@
             {{scope.row.lostMoney}}
           
           
-            {{scope.row.lostMoney}}
+            {{Number(scope.row.lostMoney).toFixed(3)}}
           
         
       
       
         
-          
+          
+            {{Number(scope.row.money).toFixed(3)}}
+          
+          
             {{scope.row.money}}
           
         
@@ -184,7 +193,7 @@
      -->
 
       
-      
+      
         
           
           
           
           
-          
+          
           
-          
-          
-          
-          
-          
+          
+          
+          
+          
+          
             
-                {{ scope.row.leaseMoney.toFixed(2) }}
+              {{ scope.row.endTime }}
+              未归还
+            
+          
+          
+          
+            
+                {{ scope.row.leaseCost.toFixed(2) }}
             
                       
         
@@ -492,6 +508,7 @@ export default {
       },
       dialogLeaseTotal: 0,
       leaseAllMoney: 0,
+      currentLeaseRow: null, // 当前租赁费用行数据
 
       //维修费用弹窗
       showRepair: false,
@@ -630,6 +647,13 @@ export default {
       /** 查询列表 */
       getList() {
         this.loading = true;
+        // 重置合计变量,避免重复累加
+        this.leaseAll = 0;
+        this.repairAll = 0;
+        this.scrapAll = 0;
+        this.loseAll = 0;
+        this.moneyAll = 0;
+        
         console.log(this.queryParams.month)
         getPushReviewList(this.queryParams).then((response) => {
           this.pushReviewList = response.rows;
@@ -653,12 +677,17 @@ export default {
           this.pushReviewList.push(obj)
           this.loading = false;
         });
-
-        this.loading = false;
       },
 
       /** 重置按钮操作 */
       resetQuery() {
+        // 重置合计变量
+        this.leaseAll = 0;
+        this.repairAll = 0;
+        this.scrapAll = 0;
+        this.loseAll = 0;
+        this.moneyAll = 0;
+        
         this.queryParams = {
           pageNum: 1,
           pageSize: 10,
@@ -702,13 +731,26 @@ export default {
         this.dialogLease.typeName = ""
         this.dialogLease.modelName = ""
         this.dialogLease.id = row.id;
+        this.currentLeaseRow = row; // 保存当前行数据
         this.getLeaseList(row)
       },
       //查询租赁费用
       getLeaseList(row) {
         this.loading = true;
+        
+        // 根据选择的月份计算开始日期和结束日期
+        const selectedMonth = this.queryParams.month; // 格式: "2024-08"
+        const startDate = selectedMonth + '-01'; // 月份第一天
+        
+        // 计算月份最后一天
+        const year = parseInt(selectedMonth.split('-')[0]);
+        const month = parseInt(selectedMonth.split('-')[1]);
+        const endDate = new Date(year, month, 0).toISOString().split('T')[0]; // 当月最后一天
+        
         let params = {
           month: this.queryParams.month,
+          startDate: startDate,
+          endDate: endDate,
           agreementId: row.agreementId,
           typeName: this.dialogLease.typeName,
           modelName: this.dialogLease.modelName,
@@ -717,14 +759,14 @@ export default {
           this.dialogLeaseList = response.rows;
           this.leaseAllMoney = 0;
           this.dialogLeaseList.forEach(item => {
-            this.leaseAllMoney += Number(item.leaseMoney);
+            this.leaseAllMoney += Number(item.leaseCost);
           })
           this.dialogLeaseTotal = response.total;
           this.loading = false;
         });
       },
       handleQueryLease() {
-        this.getLeaseList()
+        this.getLeaseList(this.currentLeaseRow)
       },
       //导出租赁费用
       handleExportLease() {
@@ -875,13 +917,13 @@ export default {
       objectSpanMethod ({ row, column, rowIndex, columnIndex }) {
         if (rowIndex === this.pushReviewList.length-1 && columnIndex == 1) {
           let rowspan = 2
-          let colspan = 6
+          let colspan = 7  // 增加了结算类型列,所以从6改为7
           return { rowspan, colspan }
         }
         // 解决偏移的重要代码
         // 重点在 else if 判断必须加因为合并单元格数据会出现偏移、
         // 否则如果是 第二行 的 第二列 那么隐藏原有第二行 的 第二列的数据使他隐藏
-        else if (rowIndex === this.pushReviewList.length-1 && columnIndex < 6) {
+        else if (rowIndex === this.pushReviewList.length-1 && columnIndex < 7) {  // 从6改为7
           return {
             rowspan: 0,
             colspan: 0