Parcourir la source

1.优化请求拦截器多次触发重新登录弹出框的问题
2.机器设备作价采用物价指数调整法时计算的价格含税

GouGengquan il y a 6 mois
Parent
commit
ca7e59b9e1
2 fichiers modifiés avec 20 ajouts et 17 suppressions
  1. 8 1
      src/utils/request.js
  2. 12 16
      src/views/assets/workbench/calculate/importInfo.vue

+ 8 - 1
src/utils/request.js

@@ -32,6 +32,9 @@ service.interceptors.request.use(
   }
 )
 
+// 重新登录弹出框触发条件(避免重复弹出)
+let messageBoxFlag = true;
+
 // 返回拦截器
 service.interceptors.response.use(
 
@@ -47,7 +50,9 @@ service.interceptors.response.use(
       })
 
       // code 701 未登录处理
-      if (res.code === 701) {
+      if (res.code === 701 && messageBoxFlag) {
+        // 未登录后将flag置为false
+        messageBoxFlag = false;
         ElMessageBox.confirm('您已退出登录, 您可以点击取消留在当前页面, 或重新登录', '确认重新登录', {
           confirmButtonText: '重新登录',
           cancelButtonText: '取消',
@@ -57,6 +62,8 @@ service.interceptors.response.use(
           cancelButtonClass: 'elMessageBoxCancelButton'
         }
         ).then(() => { // 确认重新登录
+          // 确认重新登陆后将flag置为true
+          messageBoxFlag = true;
           removeToken();
           window.location.href = import.meta.env.VITE_OA_URL;
         })

+ 12 - 16
src/views/assets/workbench/calculate/importInfo.vue

@@ -867,12 +867,13 @@
         <vxe-column field="material2Price" title="主材2单价(元/(吨/方))" width="160" :edit-render="{ name: 'VxeNumberInput' }"></vxe-column>
         <vxe-column field="mainMaterialCost" title="主材费/设备报价(含税不含运费不含安装调试费)" width="160">
           <template #default="{ row }">
-            <span>{{ row.mainMaterialCost = isNaN(((row.material2 && row.material2 !== '无') 
-              ? ((row.material1Quantity / (row.material1UseRatio / 100) * row.material1Price) + (row.material2Quantity / (row.material2UseRatio / 100) * row.material2Price)).toFixed(0) 
-              : (row.material1Quantity / (row.material1UseRatio / 100) * row.material1Price).toFixed(0))) 
-              ? 0 
-              : ((row.material2 && row.material2 !== '无') 
-              ? ((row.material1Quantity / (row.material1UseRatio / 100) * row.material1Price) + (row.material2Quantity / (row.material2UseRatio / 100) * row.material2Price)).toFixed(0) 
+            <span>
+              {{ row.mainMaterialCost = isNaN(((row.material2 && row.material2 !== '无')
+              ? ((row.material1Quantity / (row.material1UseRatio / 100) * row.material1Price) + (row.material2Quantity / (row.material2UseRatio / 100) * row.material2Price)).toFixed(0)
+              : (row.material1Quantity / (row.material1UseRatio / 100) * row.material1Price).toFixed(0)))
+              ? 0
+              : ((row.material2 && row.material2 !== '无')
+              ? ((row.material1Quantity / (row.material1UseRatio / 100) * row.material1Price) + (row.material2Quantity / (row.material2UseRatio / 100) * row.material2Price)).toFixed(0)
               : (row.material1Quantity / (row.material1UseRatio / 100) * row.material1Price).toFixed(0)) }}
             </span>
           </template>
@@ -1041,7 +1042,7 @@ import {
   getNonSDataPage,
   updateNonSData,
   updateBatchNonSData,
-  deleteEqptDataById
+  deleteEqptDataById,
 } from '@/api/assetsCalculateEqptData'
 import { getDaysBetween } from '@/utils/date'
 import { eqptLifeIfrRefsList } from '@/api/eqptLifeIfrRefs'
@@ -1427,7 +1428,6 @@ export default {
           })
         }
         this.getEqptLifeIfrRefs()
-        // this.getEqptTableFilter(this.eqptPageData)
       })
     },
     // 分页查询进口设备信息
@@ -1451,7 +1451,6 @@ export default {
             })
           })
         }
-        // this.getEqptTableFilter(this.eqptImpPageData)
       })
     },
     // 分页查询非标设备信息
@@ -1476,7 +1475,6 @@ export default {
           })
         }
         this.getEqptGnEvpList()
-        // this.getEqptTableFilter(this.eqptNonSPageData)
       })
     },
     // 获取测算表基础信息
@@ -1609,16 +1607,15 @@ export default {
     },
     // 计算单价
     countPrice(row) {
-      console.log('in')
       if (row.valuationMethod === '物价指数调整法' && row.inquiryBasis) {
         if (row.inquiryBasis.includes(':')) {
           const parts = row.inquiryBasis.split(':')
           if (parts.length > 1) {
             let ppi = parts[1].trim()
-            row.price = (row.unTaxedUnitPrice * ppi).toFixed(2)
+            row.price = (row.unTaxedUnitPrice * ppi * 1.13).toFixed(2)
           }
         } else {
-          row.price = (row.unTaxedUnitPrice * row.inquiryBasis).toFixed(2)
+          row.price = (row.unTaxedUnitPrice * row.inquiryBasis * 1.13).toFixed(2)
         }
       }
     },
@@ -1658,7 +1655,6 @@ export default {
               message: res.message,
               type: 'success',
             })
-            this.getEqptDataPage()
           }
         })
       } else {
@@ -1985,7 +1981,7 @@ export default {
       fileUtil.download('/file/download/assets/declarationForm?tmplCode=DECLARATION_FORM')
     },
     deleteEqptDataById(eqptId) {
-      deleteEqptDataById(eqptId).then(res => {
+      deleteEqptDataById(eqptId).then((res) => {
         if (res.code == 200) {
           ElMessage({
             showClose: true,
@@ -1995,7 +1991,7 @@ export default {
           this.getEqptDataPage()
         }
       })
-    }
+    },
   },
 }
 </script>