Browse Source

变更列表完善预算类型变更前后的说明

ljb 9 months ago
parent
commit
be70d1d84a
2 changed files with 39 additions and 6 deletions
  1. 5 5
      src/option/projectManage/change.js
  2. 34 1
      src/views/project-manage/change.vue

+ 5 - 5
src/option/projectManage/change.js

@@ -20,14 +20,14 @@ export default {
       label: '研发项目名称',
       label: '研发项目名称',
       prop: 'xmmc',
       prop: 'xmmc',
       type: 'input',
       type: 'input',
-      minWidth: 240,
+      minWidth: 180,
       showOverflowTooltip: true,
       showOverflowTooltip: true,
     },
     },
     {
     {
       label: '研发项目编号',
       label: '研发项目编号',
       prop: 'xmbh',
       prop: 'xmbh',
       type: 'input',
       type: 'input',
-      minWidth: 160,
+      width: 100,
       align: 'center',
       align: 'center',
       showOverflowTooltip: true,
       showOverflowTooltip: true,
     },
     },
@@ -35,14 +35,14 @@ export default {
       label: '项目申请单位',
       label: '项目申请单位',
       prop: 'xmsqdw',
       prop: 'xmsqdw',
       type: 'select',
       type: 'select',
-      minWidth: 140,
+      width: 140,
       align: 'center',
       align: 'center',
       showOverflowTooltip: true,
       showOverflowTooltip: true,
     },
     },
     {
     {
       label: '变更类型',
       label: '变更类型',
       prop: 'zdmc',
       prop: 'zdmc',
-      width: 140,
+      width: 100,
       align: 'center',
       align: 'center',
       type: 'select',
       type: 'select',
       dicUrl: '/api/kd-system/dict/dictionary?code=xm_biangeng_field',
       dicUrl: '/api/kd-system/dict/dictionary?code=xm_biangeng_field',
@@ -69,7 +69,7 @@ export default {
     {
     {
       label: '变更生效时间',
       label: '变更生效时间',
       prop: 'bgsxsj',
       prop: 'bgsxsj',
-      width: 160,
+      width: 120,
       align: 'center',
       align: 'center',
       showOverflowTooltip: true,
       showOverflowTooltip: true,
     },
     },

+ 34 - 1
src/views/project-manage/change.vue

@@ -74,6 +74,7 @@ import {getToken} from "@/util/auth";
 import projectSelect from "@/components/project-select";
 import projectSelect from "@/components/project-select";
 import {downloadXls} from "@/util/util";
 import {downloadXls} from "@/util/util";
 import changeForm from "./components/change-form.vue";
 import changeForm from "./components/change-form.vue";
+import Decimal from "decimal.js";
 
 
 
 
 export default window.$crudCommon({
 export default window.$crudCommon({
@@ -148,10 +149,42 @@ export default window.$crudCommon({
     handleChangeSucc() {
     handleChangeSucc() {
       this.drawerVisible = false;
       this.drawerVisible = false;
       this.getList();
       this.getList();
-    }
+    },
   },
   },
 }, {
 }, {
   // 模块路径
   // 模块路径
   name: 'projectManage/change',
   name: 'projectManage/change',
+  res: ({data}) => {
+    // 计算预算总额
+    const calcXmAmountTotal = list => {
+      let total = new Decimal(0);
+      list.forEach(item => {
+        total = total.add(new Decimal(item.amount || 0));
+      });
+      return total;
+    };
+    const formatXmysLabel = list => {
+      let yearAmountCN = list.map(item => {
+        return `${item.year}年${item.amount}万元`;
+      }).join('、');
+      let total = calcXmAmountTotal(list);
+      return `总计:${total}万元;其中${yearAmountCN}`
+    }
+    data.records = data.records.map(item => {
+      // 项目预算
+      if (item.zdmc === 'XMYSZEMX') {
+        // 变更前的值
+        let bgqmx = JSON.parse(item.bgqdz);
+        item.bgqdz = formatXmysLabel(bgqmx);
+
+        // 变更后的值
+        let bghmx = JSON.parse(item.bghdz);
+        item.bghdz = formatXmysLabel(bghmx)
+      }
+
+      return item;
+    });
+    return data;
+  }
 });
 });
 </script>
 </script>