Browse Source

直接投入联调

ljb 10 months ago
parent
commit
3e30844789

+ 3 - 9
src/option/projectManage/zztlCost.js

@@ -22,7 +22,6 @@ export default {
       type: 'input',
       width: 100,
       span: 24,
-      span: 24,
       showOverflowTooltip: true,
       rules: [{
         required: true,
@@ -32,7 +31,7 @@ export default {
     },
     {
       label: '用量',
-      prop: 'yl',
+      prop: 'yongLiang',
       type: 'number',
       min: 0,
       precision: 2,
@@ -43,7 +42,7 @@ export default {
     },
     {
       label: '单价',
-      prop: 'dj',
+      prop: 'danJia',
       type: 'number',
       min: 0,
       precision: 2,
@@ -54,11 +53,10 @@ export default {
     },
     {
       label: '预算金额',
-      prop: 'zzsc',
+      prop: 'ysje',
       type: 'number',
       min: 0,
       precision: 2,
-      span: 12,
       width: 90,
       span: 24,
       align: 'center',
@@ -69,7 +67,6 @@ export default {
       label: '2-仪器设备名称',
       prop: 'yqsbmc',
       type: 'input',
-      span: 12,
       minWidth: 120,
       span: 24,
       showOverflowTooltip: true,
@@ -80,7 +77,6 @@ export default {
       type: 'number',
       min: 0,
       precision: 2,
-      span: 12,
       minWidth: 140,
       span: 24,
       align: 'center',
@@ -90,7 +86,6 @@ export default {
       label: '3-固定资产名称(租赁)',
       prop: 'gdzcmc',
       type: 'input',
-      span: 12,
       minWidth: 110,
       span: 24,
       showOverflowTooltip: true,
@@ -100,7 +95,6 @@ export default {
       prop: 'zlfyys',
       type: 'number',
       min: 0,
-      span: 12,
       minWidth: 100,
       span: 24,
       precision: 2,

+ 40 - 6
src/views/project-manage/components/all-budget-table.vue

@@ -1,8 +1,8 @@
 <template>
-  <div>
+  <div v-loading="loading">
     <div class="container">
       <div class="operate-btn" style="text-align: right; margin: 10px 16px;">
-        <el-button>刷新</el-button>
+        <el-button @click="handleRefresh">刷新</el-button>
         <el-button type="primary">下载</el-button>
         <el-button type="primary">打印</el-button>
       </div>
@@ -34,6 +34,7 @@
                 style="width: 100%"
                 show-summary
                 class="budget-table"
+                :summary-method="getSummaries"
               >
                 <el-table-column
                   prop="kmmc"
@@ -98,6 +99,8 @@ export default {
       }],
 
       selProject: {},
+
+      loading: false,
     };
   },
   computed: {
@@ -121,11 +124,16 @@ export default {
     this.currProjectId = this.projectId || '';
   },
   methods: {
+    handleRefresh() {
+      this.getAllBudgetData(this.selProject.id);
+    },
     handleProjectChange(data) {
       this.selProject = data;
     },
     getAllBudgetData(id) {
+      this.loading = true;
       getAllBudget({ xmId: id }).then(({ data }) => {
+        this.loading = false;
         if (data.success) {
           const { xmysze } = data.data;
           let ysze = xmysze === -1 ? 1 : xmysze;
@@ -149,19 +157,45 @@ export default {
               readKey = 'qtfy';
             }
 
-            item.sales = data.data[readKey] === -1 ? 0 : data.data[readKey];
+            item.sales = (data.data[readKey] === -1 ? 0 : data.data[readKey]).toFixed(2);
             let ratio = 0;
             if (item.sales) {
-              ratio = new Decimal(item.sales).div(new Decimal(ysze)).toNumber();
+              ratio = (new Decimal(item.sales).div(new Decimal(ysze))*100).toFixed(2);
             }
             item.ratio = ratio;
 
             return item;
           });
-
-          console.log(this.tableData)
+        }
+      }).catch(err => {
+        this.loading = false;
+      });
+    },
+    getSummaries(param) {
+      const { columns, data } = param;
+      const sums = [];
+      columns.forEach((column, index) => {
+        if (index === 0) {
+          sums[index] = '合计';
+          return;
+        }
+        const values = data.map(item => Number(item[column.property]));
+        if (!values.every(value => isNaN(value))) {
+          sums[index] = values.reduce((prev, curr) => {
+            const value = Number(curr);
+            if (!isNaN(value)) {
+              return prev + curr;
+            } else {
+              return prev;
+            }
+          }, 0);
+          // 保留两位小数
+          sums[index] = sums[index].toFixed(2);
+        } else {
+          sums[index] = 'N/A';
         }
       });
+      return sums;
     }
   }
 };

+ 4 - 0
src/views/project-manage/components/design-cost.vue

@@ -147,6 +147,10 @@ export default window.$crudCommon({
   // 模块路径
   name: 'projectManage/designCost',
   res: ({ data }) => {
+    data.records = data.records.map(item => {
+      item.ysje = (item.ysje || 0).toFixed(2);
+      return item;
+    });
     return data;
   },
 });

+ 4 - 0
src/views/project-manage/components/other-cost.vue

@@ -147,6 +147,10 @@ export default window.$crudCommon({
   // 模块路径
   name: 'projectManage/otherCost',
   res: ({ data }) => {
+    data.records = data.records.map(item => {
+      item.ysje = (item.ysje || 0).toFixed(2);
+      return item;
+    })
     return data;
   },
 });

+ 5 - 0
src/views/project-manage/components/outsourcing-cost.vue

@@ -149,6 +149,11 @@ export default window.$crudCommon({
   // 模块路径
   name: 'projectManage/outsourcingCost',
   res: ({ data }) => {
+    data.records = data.records.map(item => {
+      item.wwfy = (item.wwfy || 0).toFixed(2);
+
+      return item;
+    })
     return data;
   },
 });

+ 2 - 1
src/views/project-manage/components/person-cost.vue

@@ -171,7 +171,8 @@ export default window.$crudCommon({
       item.name = item.technician.name;
       item.number = item.technician.number;
       item.identityCard = item.technician.identityCard;
-      item.total = zzsc.mul(pjrgfy);
+      item.pjrgfy = (item.pjrgfy || 0).toFixed(2);
+      item.total = zzsc.mul(pjrgfy).toFixed(2);
       item.isWp = item.nature === '在职' ? '是' : '否';
       return item;
     });

+ 1 - 1
src/views/project-manage/components/wxzctx-cost.vue

@@ -211,7 +211,7 @@ export default window.$crudCommon({
     data.records = data.records.map(item => {
       item.zcmc = item.zcEntity ? item.zcEntity.zcmc : '';
       item.zcbm = item.zcEntity ? item.zcEntity.zcbm : '';
-      item.ytxe = (item.zcEntity ? item.zcEntity.ytxe : 0).toFixed(2);
+      item.ytxe = (item.zcEntity ? item.zcEntity.yzje : 0).toFixed(2);
 
       let zzscD = new Decimal(item.zzsc || 0); // 工作时长
       let yzjeD = new Decimal(item.ytxe || 0); // 摊销额

+ 4 - 0
src/views/project-manage/components/zb-cost.vue

@@ -149,6 +149,10 @@ export default window.$crudCommon({
   // 模块路径
   name: 'projectManage/zbCost',
   res: ({ data }) => {
+    data.records = data.records.map(item => {
+      item.ysje = (item.ysje || 0).toFixed(2);
+      return item;
+    });
     return data;
   },
 });

+ 15 - 0
src/views/project-manage/components/zztl-cost.vue

@@ -71,6 +71,7 @@ import UploadExcelDialog from "@/components/upload-excel-dialog";
 import projectSelect from "@/components/project-select";
 import {getToken} from "@/util/auth";
 import {downloadXls} from "@/util/util";
+import Decimal from "decimal.js";
 
 
 export default window.$crudCommon({
@@ -148,6 +149,20 @@ export default window.$crudCommon({
   // 模块路径
   name: 'projectManage/zztlCost',
   res: ({ data }) => {
+
+    data.records = data.records.map(item => {
+      item.yongLiang = item.yongLiang === -1 ? '' : (item.yongLiang).toFixed(2);
+      item.danJia = item.danJia === -1 ? '' : (item.danJia).toFixed(2);
+      item.ysje = item.ysje === -1 ? '' : (item.ysje).toFixed(2);
+      item.zlfyys = item.zlfyys === -1 ? '' : (item.zlfyys).toFixed(2);
+
+      if (item.yongLiang && item.danJia) {
+        item.wzysje = new Decimal(item.yongLiang).mul(item.danJia);
+      }
+
+      return item;
+    });
+
     return data;
   },
 });