Browse Source

直接投入费用分配表接口联调

ljb 9 months ago
parent
commit
af74b2e903

+ 3 - 35
src/api/yfCostManage/yfCostStatistics/zjtlCostSummaryList.js

@@ -1,41 +1,9 @@
 import request from '@/router/axios';
 
-export const getList = (current, size, params) => {
+export const getList = (params) => {
   return request({
-    url: '/api/kd-scientific/lease/page',
+    url: '/api/kd-scientific/direct-cost/summary',
     method: 'get',
-    params: {
-      ...params,
-      current,
-      size,
-    }
-  })
-}
-
-export const add = (row) => {
-  return request({
-    url: '/api/kd-scientific/lease/submit',
-    method: 'post',
-    data: row
-  })
-}
-
-
-export const update = (row) => {
-  return request({
-    url: '/api/kd-scientific/lease/submit',
-    method: 'post',
-    data: row
-  })
-}
-
-
-export const remove = (ids) => {
-  return request({
-    url: '/api/kd-scientific/lease/remove',
-    method: 'post',
-    params: {
-      ids
-    }
+    params
   })
 }

+ 44 - 13
src/option/yfCostManage/yfCostStatistics/zjtlCostSummaryList.js

@@ -1,12 +1,10 @@
 export default {
-  height: 'auto',
   calcHeight: 30,
   tip: false,
   searchShow: true,
   searchMenuSpan: 6,
   border: true,
   index: true,
-  selection: true,
   addBtn: false,
   menu: false,
   searchLabelWidth: 140,
@@ -18,21 +16,53 @@ export default {
   showSummary: true,
   sumColumnList: [
     {
-      name: 'price',
+      name: 'cailiaofy',
+      type: 'sum',
+    },
+    {
+      name: 'ranliaofy',
+      type: 'sum',
+    },
+    {
+      name: 'donglify',
+      type: 'sum',
+    },
+    {
+      name: 'yiqishebeify',
+      type: 'sum',
+    },
+    {
+      name: 'fawuzulinfy',
+      type: 'sum',
+    },
+    {
+      name: 'fy6',
+      type: 'sum',
+    },
+    {
+      name: 'fy7',
+      type: 'sum',
+    },
+    {
+      name: 'fy8',
+      type: 'sum',
+    },
+    {
+      name: 'amount',
       type: 'sum',
     },
   ],
   column: [
     {
       label: '研发项目编号',
-      prop: 'xmbh',
+      prop: 'XMBH',
       width: 100,
       align: 'center',
       showOverflowTooltip: true,
     },
     {
       label: '研发项目名称',
-      prop: 'xmmc',
+      prop: 'XMMC',
       minWidth: 120,
       align: 'center',
       search: true,
@@ -40,7 +70,7 @@ export default {
     },
     {
       label: '材料费用',
-      prop: 'clfy',
+      prop: 'cailiaofy',
       type: 'number',
       span: 24,
       minWidth: 60,
@@ -51,7 +81,7 @@ export default {
     },
     {
       label: '燃料费用',
-      prop: 'rlfy',
+      prop: 'ranliaofy',
       type: 'number',
       span: 24,
       minWidth: 60,
@@ -62,7 +92,7 @@ export default {
     },
     {
       label: '动力费用',
-      prop: 'dlfy',
+      prop: 'donglify',
       type: 'number',
       span: 24,
       minWidth: 60,
@@ -73,7 +103,7 @@ export default {
     },
     {
       label: '研发仪器设备租赁费',
-      prop: 'sbfy',
+      prop: 'yiqishebeify',
       type: 'number',
       span: 24,
       minWidth: 70,
@@ -84,7 +114,7 @@ export default {
     },
     {
       label: '房屋租赁费',
-      prop: 'fwzlf',
+      prop: 'fawuzulinfy',
       type: 'number',
       span: 24,
       minWidth: 70,
@@ -95,7 +125,7 @@ export default {
     },
     {
       label: '用于中间试验和产品试制的模具、工艺装备开发及制造费',
-      prop: 'tsfy',
+      prop: 'fy6',
       type: 'number',
       span: 24,
       minWidth: 140,
@@ -106,7 +136,7 @@ export default {
     },
     {
       label: '不构成固定资产的样品、样机及一般测试手段购置费',
-      prop: 'ypgzf',
+      prop: 'fy7',
       type: 'number',
       span: 24,
       minWidth: 140,
@@ -117,7 +147,7 @@ export default {
     },
     {
       label: '试制产品的检验费',
-      prop: 'jyf',
+      prop: 'fy8',
       type: 'number',
       span: 24,
       minWidth: 70,
@@ -148,6 +178,7 @@ export default {
       precision: 2,
       search: true,
       showOverflowTooltip: true,
+      hide: true
     },
   ],
 };

+ 14 - 9
src/views/yf-cost-manage/yf-cost-statistics/zjtl-cost-statistics/zjtl-cost-summary-list.vue.vue

@@ -4,7 +4,6 @@
       v-bind="bindVal"
       v-on="onEvent"
       v-model="form"
-      :page.sync="page"
     >
       <template slot="menuLeft">
         <el-button
@@ -19,7 +18,7 @@
         <print-table-btn @click="printTable" />
         
         <div style="display: flex; align-items: center;">
-          <year-month-select v-model="params.yearAndMonth" :showAllYear="false"></year-month-select>
+          <year-month-select v-model="params.yearAndMonth"></year-month-select>
         </div>
       </template>
 
@@ -73,14 +72,23 @@ export default window.$crudCommon({
   },
   watch: {
     'params.yearAndMonth'(newVal) {
-      this.page.currentPage = 1;
-      this.getList(this.page);
+      this.getList();
     }
   },
   methods: {
-    loadData() {},
+    loadData() {
+        this.loading = true;
+        this.api[this.option.list || 'getList'](this.getSearchParams()).then(res => {
+          this.data = res.data.data.map(item => {
+            let amount = new Decimal(item.cailiaofy).add(new Decimal(item.ranliaofy)).add(new Decimal(item.donglify)).add(new Decimal(item.yiqishebeify)).add(new Decimal(item.fawuzulinfy)).add(new Decimal(item.fy6)).add(new Decimal(item.fy7)).add(new Decimal(item.fy8));
+            item.amount = amount;
+            return item;
+          });
+          this.loading = false;
+        });
+      },
     handleExport() {
-      exportBlob(`/api/kd-scientific/lease/export?${this.website.tokenHeader}=${getToken()}`, this.params).then(res => {
+      exportBlob(`/api/kd-scientific/direct-cost/summary/export?${this.website.tokenHeader}=${getToken()}`, this.params).then(res => {
         downloadXls(res.data, `${this.params.yearAndMonth}直接投入费用汇总表.xlsx`);
       });
     },
@@ -99,8 +107,5 @@ export default window.$crudCommon({
 }, {
   // 模块路径
   name: 'yfCostManage/yfCostStatistics/zjtlCostSummaryList',
-  res: ({ data }) => {
-    return data;
-  },
 });
 </script>