Browse Source

高新口径研发费用报表接口联调

ljb 9 months ago
parent
commit
2bcd571c98

+ 2 - 4
src/api/externalReports/gxAuxiliaryDetails.js

@@ -1,13 +1,11 @@
 import request from '@/router/axios';
 
-export const getList = (current, size, params) => {
+export const getList = (params) => {
   return request({
-    url: '/api/kd-scientific/page',
+    url: '/api/kd-scientific/xm/cost/details/high-tech-list',
     method: 'get',
     params: {
       ...params,
-      current,
-      size,
     }
   })
 }

+ 1 - 1
src/api/externalReports/gxAuxiliarySumList.js

@@ -2,7 +2,7 @@ import request from '@/router/axios';
 
 export const getList = (current, size, params) => {
   return request({
-    url: '/api/kd-scientific/page',
+    url: '/api/kd-scientific/xm/cost/details/high-tech-summary',
     method: 'get',
     params: {
       ...params,

+ 70 - 14
src/option/externalReports/gxAuxiliarySumList.js

@@ -15,6 +15,54 @@ export default {
   dialogClickModal: false,
   dialogWidth: 500,
   dialogType: "drawer",
+  showSummary: true,
+  sumColumnList: [
+    {
+      label:'合计',
+      name: 'ryrgTotal',
+      type: 'sum',
+    },
+    {
+      name: 'zjtrTotal',
+      type: 'sum',
+    },
+    {
+      name: 'zjfyycqdtfyTotal',
+      type: 'sum'
+    },
+    {
+      name: 'sjfTotal',
+      type: 'sum'
+    },
+    {
+      name: 'wxzctxTotal',
+      type: 'sum'
+    },
+    {
+      name: 'zbtsfyysyfyTotal',
+      type: 'sum'
+    },
+    {
+      name: 'qtfyTotal',
+      type: 'sum'
+    },
+    {
+      name: 'qtfyLimit',
+      type: 'sum'
+    },
+    {
+      name: 'qtfyAdjust',
+      type: 'sum'
+    },
+    {
+      name: 'wwyfTotal',
+      type: 'sum'
+    },
+    {
+      name: 'amount',
+      type: 'sum'
+    }
+  ],
   column: [
     {
       label: '研发项目编号',
@@ -35,7 +83,7 @@ export default {
     },
     {
       label: '1、人员人工',
-      prop: 'ryrg',
+      prop: 'ryrgTotal',
       span: 24,
       minWidth: 90,
       align: 'center',
@@ -43,7 +91,7 @@ export default {
     },
     {
       label: '2、直接投入',
-      prop: 'zjtl',
+      prop: 'zjtrTotal',
       span: 24,
       minWidth: 90,
       align: 'center',
@@ -51,7 +99,7 @@ export default {
     },
     {
       label: '3、折旧费用与长期摊销费用',
-      prop: 'cqdt',
+      prop: 'zjfyycqdtfyTotal',
       span: 24,
       minWidth: 110,
       align: 'center',
@@ -59,7 +107,7 @@ export default {
     },
     {
       label: '4、设计费',
-      prop: 'cqdt',
+      prop: 'sjfTotal',
       span: 24,
       minWidth: 90,
       align: 'center',
@@ -67,7 +115,7 @@ export default {
     },
     {
       label: '5、无形资产摊销',
-      prop: 'cqdt',
+      prop: 'wxzctxTotal',
       span: 24,
       minWidth: 90,
       align: 'center',
@@ -75,39 +123,47 @@ export default {
     },
     {
       label: '6、装备调试费用与试验费用',
-      prop: 'cqdt',
+      prop: 'zbtsfyysyfyTotal',
       span: 24,
       minWidth: 110,
       align: 'center',
       showOverflowTooltip: true,
     },
     {
-      label: '7、其他费用',
-      prop: 'cqdt',
+      label: '7-1、其他费用',
+      prop: 'qtfyTotal',
       span: 24,
       minWidth: 90,
       align: 'center',
       showOverflowTooltip: true,
     },
     {
-      label: '8、委外研发',
-      prop: 'cqdt',
+      label: '7-2、其他费用限额',
+      prop: 'qtfyLimit',
       span: 24,
       minWidth: 90,
       align: 'center',
       showOverflowTooltip: true,
     },
     {
-      label: '合计',
-      prop: 'cqdt',
+      label: '7-3、调整后其他费用',
+      prop: 'qtfyAdjust',
       span: 24,
       minWidth: 90,
       align: 'center',
       showOverflowTooltip: true,
     },
     {
-      label: '账簿名称',
-      prop: 'cqdt',
+      label: '8、委外研发',
+      prop: 'wwyfTotal',
+      span: 24,
+      minWidth: 90,
+      align: 'center',
+      showOverflowTooltip: true,
+    },
+    {
+      label: '合计',
+      prop: 'amount',
       span: 24,
       minWidth: 90,
       align: 'center',

+ 8 - 8
src/option/externalReports/kjAuxiliarySumList.js

@@ -145,13 +145,13 @@ export default {
       align: 'center',
       showOverflowTooltip: true,
     },
-    {
-      label: '账簿名称',
-      prop: 'cashbook',
-      span: 24,
-      minWidth: 90,
-      align: 'center',
-      showOverflowTooltip: true,
-    },
+    // {
+    //   label: '账簿名称',
+    //   prop: 'cashbook',
+    //   span: 24,
+    //   minWidth: 90,
+    //   align: 'center',
+    //   showOverflowTooltip: true,
+    // },
   ],
 };

+ 225 - 0
src/views/external-reports/high-tech/components/common-list.vue

@@ -0,0 +1,225 @@
+<template>
+  <div>
+    <div style="width: 100%; display: flex; align-items: center; justify-content: space-between;">
+      <div class="left" style="display: flex;">
+        <div style="margin-right: 50px;">研发项目编号:{{ data[0].xmbh }}</div>
+        <div>项目项目名称:{{ data[0].xmmc }}</div>
+      </div>
+      <div class="right">
+        <el-button
+          type="warning"
+          size="small"
+          plain
+          icon="el-icon-download"
+          @click="handleExport"
+          style="margin-right: 10px;"
+        >
+          导出
+        </el-button>
+      </div>
+    </div>
+    <avue-crud class="common-crud" :option="options" :data="data">
+    </avue-crud>
+  </div>
+</template>
+
+<script>
+import {exportBlob} from "@/api/common";
+import {getToken} from "@/util/auth";
+import {downloadXls} from "@/util/util";
+
+export default {
+  props: {
+    data: {
+      type: Array,
+      default: () => []
+    }
+  },
+  data() {
+    return {
+      options: {
+        calcHeight: 30,
+        tip: false,
+        searchShow: true,
+        searchMenuSpan: 6,
+        border: true,
+        index: true,
+        addBtn: false,
+        selection: true,
+        searchLabelWidth: 140,
+        labelWidth: 100,
+        menuWidth: 180,
+        menu: false,
+        dialogClickModal: false,
+        refreshBtn: false,
+        columnBtn: false,
+        gridBtn: false,
+        dialogWidth: 500,
+        dialogType: "drawer",
+        showSummary: true,
+        sumColumnList: [
+          {
+            label:'合计',
+            name: 'ryrg',
+            type: 'sum',
+          },
+          {
+            name: 'zjtr',
+            type: 'sum',
+          },
+          {
+            name: 'zjfyycqdtfy',
+            type: 'sum'
+          },
+          {
+            name: 'sjf',
+            type: 'sum'
+          },
+          {
+            name: 'wxzctx',
+            type: 'sum'
+          },
+          {
+            name: 'zbtsfyysyfy',
+            type: 'sum'
+          },
+          {
+            name: 'qtfy',
+            type: 'sum'
+          },
+          {
+            name: 'wwyf',
+            type: 'sum'
+          },
+          {
+            name: 'amount',
+            type: 'sum'
+          }
+        ],
+        column: [
+          {
+            label: '凭证日期',
+            prop: 'recordDate',
+            span: 24,
+            width: 90,
+            align: 'center',
+            showOverflowTooltip: true,
+          },
+          {
+            label: '凭证字号',
+            prop: 'voucherNumber',
+            span: 24,
+            width: 120,
+            align: 'center',
+            showOverflowTooltip: true,
+          },
+          {
+            label: '摘要',
+            prop: 'digest',
+            span: 24,
+            width: 160,
+            align: 'center',
+            showOverflowTooltip: true,
+          },
+          {
+            label: '1、人员人工',
+            prop: 'ryrg',
+            span: 24,
+            minWidth: 90,
+            align: 'center',
+            showOverflowTooltip: true,
+          },
+          {
+            label: '2、直接投入',
+            prop: 'zjtr',
+            span: 24,
+            minWidth: 90,
+            align: 'center',
+            showOverflowTooltip: true,
+          },
+          {
+            label: '3、折旧费用与长期摊销费用',
+            prop: 'zjfyycqdtfy',
+            span: 24,
+            minWidth: 90,
+            align: 'center',
+            showOverflowTooltip: true,
+          },
+          {
+            label: '4、设计费',
+            prop: 'sjf',
+            span: 24,
+            minWidth: 90,
+            align: 'center',
+            showOverflowTooltip: true,
+          },
+          {
+            label: '5、无形资产摊销',
+            prop: 'wxzctx',
+            span: 24,
+            minWidth: 90,
+            align: 'center',
+            showOverflowTooltip: true,
+          },
+          {
+            label: '6、装备调试费用与试验费用',
+            prop: 'zbtsfyysyfy',
+            span: 24,
+            minWidth: 90,
+            align: 'center',
+            showOverflowTooltip: true,
+          },
+          {
+            label: '7、其他费用',
+            prop: 'qtfy',
+            span: 24,
+            minWidth: 90,
+            align: 'center',
+            showOverflowTooltip: true,
+          },
+          {
+            label: '8、委外研发',
+            prop: 'wwyf',
+            span: 24,
+            minWidth: 90,
+            align: 'center',
+            showOverflowTooltip: true,
+          },
+          {
+            label: '合计',
+            prop: 'amount',
+            span: 24,
+            minWidth: 90,
+            align: 'center',
+            showOverflowTooltip: true,
+          },
+          {
+            label: '账簿名称',
+            prop: 'cashbook',
+            span: 24,
+            minWidth: 90,
+            align: 'center',
+            showOverflowTooltip: true,
+          },
+        ],
+      },
+    };
+  },
+  methods: {
+    handleExport() {
+      this.$message.error("暂未开发");
+      // exportBlob(`/api/kd-scientific/goods/yanfalingliaodan/export?${this.website.tokenHeader}=${getToken()}`, this.params).then(res => {
+      //   downloadXls(res.data, `${this.params.yearAndMonth}${title}.xlsx`);
+      // });
+    },
+  }
+};
+</script>
+
+<style lang="scss">
+.common-crud {
+  .avue-crud__header {
+    min-height: 0;
+  }
+}
+</style>

+ 89 - 83
src/views/external-reports/high-tech/gx-auxiliary-details.vue

@@ -1,109 +1,115 @@
 <template>
-  <basic-container>
-    <avue-crud
-      v-bind="bindVal"
-      v-on="onEvent"
-      v-model="form"
-      :page.sync="page"
-    >
-      <template slot="menuLeft">
-        <el-button
-          type="warning"
-          size="small"
-          plain
-          icon="el-icon-download"
-          @click="handleExport"
-        >
-          导出
-        </el-button>
-        <print-table-btn @click="printTable" />
-        
-        <div style="display: flex; align-items: center;">
-          <year-month-select v-model="params.yearAndMonth"></year-month-select>
-        </div>
+  <basic-container v-loading="loading">
+    <avue-form ref="searchForm" v-model="params" :option="searchOption" class="cl-search-form">
+      <template slot-scope="{size}" slot="menuForm">
+        <el-button type="primary" :size="size" icon="el-icon-search" @click="handleSearchBtn">查询</el-button>
+        <el-button :size="size" icon="el-icon-delete" @click="handleResetBtn">清空</el-button>
       </template>
-
-       <!-- 开始时间 -->
-      <template slot="pzrqSearch">
-        <span>凭证日期:</span>
-        <el-date-picker
-          v-model="params.pzrqRange"
-          type="daterange"
-          range-separator="至"
-          start-placeholder="开始日期"
-          end-placeholder="结束日期"
-          value-format="yyyy-MM-dd"
-          style="width: 240px !important;"
-        >
-        </el-date-picker>
-      </template>
-    </avue-crud>
-
-   
-
-    <WideTablePrinter
-      ref="printWideTable"
-      :columns="wideTableColumns"
-      :data="data"
-      :print-title="printTitle"
-      :rows-per-page="30"
-      :default-landscape="true"
-    />
+    </avue-form>
+    <div>
+    </div>
+    <div style="display: flex; align-items: center;">
+      <year-month-select v-model="yearAndMonth" :showAllYear="false" style="margin: 6px 0 20px;"></year-month-select>
+    </div>
+    <template v-if="listData.length">
+      <common-list v-for="(item, index) of listData" :data="item" :key="index" style="margin-bottom: 25px;"></common-list>
+    </template>
+    <el-empty v-else description="暂无数据"></el-empty>
   </basic-container>
 </template>
 
 <script>
 import YearMonthSelect from "@/components/year-month-select";
-import {exportBlob} from "@/api/common";
-import {getToken} from "@/util/auth";
-import {downloadXls} from "@/util/util";
+import commonList from "./components/common-list.vue";
+import { getList } from "@/api/externalReports/gxAuxiliaryDetails";
 import moment from "moment";
 
-
-export default window.$crudCommon({
+export default {
   components: {
     YearMonthSelect,
+    commonList
   },
   data() {
     return {
-      params: {
-        yearAndMonth: moment(new Date()).format('YYYYMM'),
+      loading: false,
+      searchOption: {
+        submitBtn:false,
+        emptyBtn:false,
+        column: [{
+          label: '项目名称',
+          prop: 'xmmc',
+          type: 'input',
+        }]
       },
+      listData: [],
 
-      wideTableColumns: [],
-      printTitle: "",
-    };
+      yearAndMonth: moment(new Date()).format('YYYYMM'),
+      params: {},
+    }
   },
   watch: {
-    'params.yearAndMonth'(newVal) {
-      this.page.currentPage = 1;
-      this.getList(this.page);
+    yearAndMonth() {
+      this.loadData();
     }
   },
+  mounted() {
+    this.loadData();
+  },
   methods: {
-    loadData() {},
-    handleExport() {
-      exportBlob(`/api/kd-scientific/export?${this.website.tokenHeader}=${getToken()}`, this.params).then(res => {
-        downloadXls(res.data, `${this.params.yearAndMonth}高新研发费用明细表.xlsx`);
+    loadData() {
+      let params = { ...this.params };
+      if (params.useDateRange && params.useDateRange.length) {
+        params.dateMin = params.useDateRange[0];
+        params.dateMax = params.useDateRange[1];
+      }
+      delete params.useDateRange;
+      this.loading = true;
+      getList({
+        ...params,
+        yearAndMonth: this.yearAndMonth,
+      }).then(({ data }) => {
+        this.loading = false;
+        if (data.code == 200) {
+          let allList = data.data.map(item => {
+            let childArr = item.costList.map(costItem => {
+              return { xmmc: item.xmmc, xmbh: item.xmbh, ...costItem };
+            });
+            return childArr;
+          });
+
+
+          this.listData = allList;
+        }
+      }).catch(() => {
+        this.loading = false;
       });
     },
-    /**
-     * 打印表格
-     * @param isLandscape 是否横向打印
-     */
-    printTable(isLandscape) {
-      this.wideTableColumns = this.$refs.crud.columnOption;
-      this.printTitle = `${this.params.yearAndMonth}高新研发费用明细表.xlsx`;
-      this.$nextTick(() => {
-        this.$refs.printWideTable.printTable(isLandscape);
-      })
+    handleSearchBtn() {
+      this.loadData();
+    },
+    handleResetBtn() {
+      this.params = {};
+      this.$refs.searchForm.resetForm();
+      this.loadData();
     },
   },
-}, {
-  // 模块路径
-  name: 'externalReports/gxAuxiliaryDetails',
-  res: ({ data }) => {
-    return data;
-  },
-});
+}
 </script>
+
+<style lang="scss">
+.cl-search-form {
+  .el-form-item--small .el-form-item__label {
+    display: none;
+  }
+  .el-form-item--small .el-form-item__content {
+    margin-left: 8px !important;
+  }
+  .el-form-item--mini.el-form-item, .el-form-item--small.el-form-item  {
+    margin-bottom: 6px;
+  }
+  .avue-form__group .el-col {
+    width: auto !important;
+    padding-top: 0 !important;
+  }
+}
+</style>

+ 30 - 3
src/views/external-reports/high-tech/gx-auxiliary-sum-list.vue

@@ -41,6 +41,7 @@ import {exportBlob} from "@/api/common";
 import {getToken} from "@/util/auth";
 import {downloadXls} from "@/util/util";
 import moment from "moment";
+import Decimal from "decimal.js";
 
 
 export default window.$crudCommon({
@@ -64,10 +65,9 @@ export default window.$crudCommon({
     }
   },
   methods: {
-    loadData() {},
     handleExport() {
       exportBlob(`/api/kd-scientific/export?${this.website.tokenHeader}=${getToken()}`, this.params).then(res => {
-        downloadXls(res.data, `${this.params.yearAndMonth}高新研发费用汇总表.xlsx`);
+        downloadXls(res.data, `${this.params.yearAndMonth}高新研发费用辅助账汇总表.xlsx`);
       });
     },
     /**
@@ -76,7 +76,7 @@ export default window.$crudCommon({
      */
     printTable(isLandscape) {
       this.wideTableColumns = this.$refs.crud.columnOption;
-      this.printTitle = `${this.params.yearAndMonth}高新研发费用汇总表.xlsx`;
+      this.printTitle = `${this.params.yearAndMonth}高新研发费用辅助账汇总表.xlsx`;
       this.$nextTick(() => {
         this.$refs.printWideTable.printTable(isLandscape);
       })
@@ -86,6 +86,33 @@ export default window.$crudCommon({
   // 模块路径
   name: 'externalReports/gxAuxiliarySumList',
   res: ({ data }) => {
+    data.records = data.records.map(item => {
+      item.ryrgTotal = item.ryrgTotal.toFixed(2);
+      item.zjtrTotal = item.zjtrTotal.toFixed(2);
+      item.zjfyycqdtfyTotal = item.zjfyycqdtfyTotal.toFixed(2);
+      item.sjfTotal = item.sjfTotal.toFixed(2);
+      item.wxzctxTotal = item.wxzctxTotal.toFixed(2);
+      item.zbtsfyysyfyTotal = item.zbtsfyysyfyTotal.toFixed(2);
+      item.qtfyTotal = item.qtfyTotal.toFixed(2);
+      item.qtfyLimit = item.qtfyLimit.toFixed(2);
+      item.qtfyAdjust = item.qtfyAdjust.toFixed(2);
+      item.wwyfTotal = item.wwyfTotal.toFixed(2);
+
+      // 合计
+      let amount = 0;
+      amount = new Decimal(item.ryrgTotal)
+        .add(new Decimal(item.zjtrTotal))
+        .add(new Decimal(item.zjfyycqdtfyTotal))
+        .add(new Decimal(item.sjfTotal))
+        .add(new Decimal(item.wxzctxTotal))
+        .add(new Decimal(item.zbtsfyysyfyTotal))
+        .add(new Decimal(item.qtfyAdjust))
+        .add(new Decimal(item.wwyfTotal));
+      item.amount = amount;
+
+
+      return item;
+    });
     return data;
   },
 });

+ 0 - 115
src/views/external-reports/kj-standards/kj-auxiliary-details-old.vue

@@ -1,115 +0,0 @@
-<template>
-  <basic-container>
-    <avue-crud
-      v-bind="bindVal"
-      v-on="onEvent"
-      v-model="form"
-    >
-      <template slot="menuLeft">
-        <el-button
-          type="warning"
-          size="small"
-          plain
-          icon="el-icon-download"
-          @click="handleExport"
-        >
-          导出
-        </el-button>
-        <print-table-btn @click="printTable" />
-        
-        <div style="display: flex; align-items: center;">
-          <year-month-select v-model="params.yearAndMonth" :showAllYear="false"></year-month-select>
-        </div>
-      </template>
-
-      <!-- 开始时间 -->
-      <template slot="kssjSearch">
-        <el-date-picker
-          v-model="params.kssjRange"
-          type="daterange"
-          range-separator="至"
-          start-placeholder="开始日期"
-          end-placeholder="结束日期"
-          value-format="yyyy-MM-dd"
-          style="width: 240px !important;"
-        >
-        </el-date-picker>
-      </template>
-      
-    </avue-crud>
-
-    <WideTablePrinter
-      ref="printWideTable"
-      :columns="wideTableColumns"
-      :data="data"
-      :print-title="printTitle"
-      :rows-per-page="30"
-      :default-landscape="true"
-    />
-  </basic-container>
-</template>
-
-<script>
-import YearMonthSelect from "@/components/year-month-select";
-import {exportBlob} from "@/api/common";
-import {getToken} from "@/util/auth";
-import {downloadXls} from "@/util/util";
-import moment from "moment";
-
-
-export default window.$crudCommon({
-  components: {
-    YearMonthSelect,
-  },
-  data() {
-    return {
-      params: {
-        yearAndMonth: moment(new Date()).format('YYYYMM'),
-      },
-
-      wideTableColumns: [],
-      printTitle: "",
-    };
-  },
-  watch: {
-    'params.yearAndMonth'(newVal) {
-      this.page.currentPage = 1;
-      this.getList(this.page);
-    }
-  },
-  methods: {
-    loadData() {
-      this.loading = true;
-      this.api['getList'](this.getSearchParams()).then(({ data }) => {
-        if (data.success) {
-          this.data = data.data;
-        }
-        this.loading = false;
-      })
-      
-    },
-    handleExport() {
-      exportBlob(`/api/kd-scientific/attendance/export?${this.website.tokenHeader}=${getToken()}`, this.params).then(res => {
-        downloadXls(res.data, `${this.params.yearAndMonth}研发费用明细表.xlsx`);
-      });
-    },
-    /**
-     * 打印表格
-     * @param isLandscape 是否横向打印
-     */
-    printTable(isLandscape) {
-      this.wideTableColumns = this.$refs.crud.columnOption;
-      this.printTitle = `${this.params.yearAndMonth}研发费用明细表.xlsx`;
-      this.$nextTick(() => {
-        this.$refs.printWideTable.printTable(isLandscape);
-      })
-    },
-  },
-}, {
-  // 模块路径
-  name: 'externalReports/kjAuxiliaryDetails',
-  res: ({ data }) => {
-    return data;
-  },
-});
-</script>