Browse Source

提交科研项目清单

ljb 9 months ago
parent
commit
6edfbda385

+ 31 - 0
src/api/externalReports/kyProjectList.js

@@ -0,0 +1,31 @@
+import request from '@/router/axios';
+
+export const getList = (current, size, params) => {
+  return request({
+    url: '/api/kd-scientific/xm/finance/page',
+    method: 'get',
+    params: {
+      ...params,
+      current,
+      size,
+    }
+  })
+}
+
+export const remove = (ids) => {
+  return request({
+    url: '/api/kd-scientific/xm/finance/remove',
+    method: 'post',
+    params: {
+      ids
+    }
+  })
+}
+
+export const readMonthProject = (params) => {
+  return request({
+    url: '/api/kd-scientific/xm/finance/fetch',
+    method: 'post',
+    params
+  })
+}

+ 37 - 0
src/option/externalReports/kyProjectList.js

@@ -0,0 +1,37 @@
+export default {
+  height: 'auto',
+  calcHeight: 30,
+  tip: false,
+  searchShow: true,
+  searchMenuSpan: 6,
+  border: true,
+  index: true,
+  selection: true,
+  editBtn: false,
+  searchLabelWidth: 140,
+  labelWidth: 100,
+  menuWidth: 140,
+  menu: true,
+  dialogClickModal: false,
+  dialogWidth: 500,
+  dialogType: "drawer",
+  column: [
+    {
+      label: '研发项目编号',
+      prop: 'xmbh',
+      span: 24,
+      minWidth: 160,
+      align: 'center',
+      showOverflowTooltip: true,
+    },
+    {
+      label: '研发项目名称',
+      prop: 'xmmc',
+      span: 24,
+      minWidth: 160,
+      align: 'center',
+      search: true,
+      showOverflowTooltip: true,
+    },
+  ],
+};

+ 2 - 2
src/views/basic-resource/basic-database/subject-setting.vue

@@ -42,7 +42,7 @@ export default {
         index: true,
         index: true,
         border: true,
         border: true,
         searchLabelWidth: 140,
         searchLabelWidth: 140,
-        labelWidth: 140,
+        labelWidth: 160,
         menuWidth: 220,
         menuWidth: 220,
         dialogClickModal: false,
         dialogClickModal: false,
         dialogWidth: 500,
         dialogWidth: 500,
@@ -139,7 +139,7 @@ export default {
             showOverflowTooltip: true,
             showOverflowTooltip: true,
           },
           },
           {
           {
-            label: "高新研发费用科目",
+            label: "加计扣除研发费用科目",
             prop: "adSubjectEnable",
             prop: "adSubjectEnable",
             type: "radio",
             type: "radio",
             dicData:[{
             dicData:[{

+ 114 - 0
src/views/external-reports/components/ky-project-list.vue

@@ -0,0 +1,114 @@
+<template>
+  <avue-crud
+    v-bind="bindVal"
+    v-on="onEvent"
+    v-model="form"
+    :page.sync="page"
+  >
+    <template slot="menuLeft">
+      <el-button type="primary" size="small" @click="handleReadMonthProject">引入当月项目</el-button>
+      <el-button
+        type="danger"
+        size="small"
+        icon="el-icon-delete"
+        plain
+        @click="handleDelete"
+      >
+        删 除
+      </el-button>
+      <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" :showMonth="false"></year-month-select>
+      </div>
+    </template>
+    
+  </avue-crud>
+</template>
+
+<script>
+import YearMonthSelect from "@/components/year-month-select";
+import { readMonthProject } from "@/api/externalReports/kyProjectList";
+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({
+  props: {
+    type: [String, Number]
+  },
+  components: {
+    YearMonthSelect,
+  },
+  data() {
+    return {
+      params: {
+        yearAndMonth: moment(new Date()).format('YYYY'),
+      },
+      defaultColumns: [],
+
+      wideTableColumns: [],
+      printTitle: "",
+    };
+  },
+  watch: {
+    'params.yearAndMonth'(newVal) {
+      this.page.currentPage = 1;
+      this.getList(this.page);
+    }
+  },
+  methods: {
+    getSearchParams() {
+      return { ...this.params, type: this.type };
+    },
+    handleExport() {
+      exportBlob(`/api/kd-scientific/asset/kyyqsbzjfyfpb?${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}科研仪器设备折旧费用分配表`;
+      this.$nextTick(() => {
+        this.$refs.printWideTable.printTable(isLandscape);
+      })
+    },
+    handleReadMonthProject() {
+      readMonthProject({ yearAndMonth: this.params.yearAndMonth, type: this.type })
+    },
+  },
+}, {
+  // 模块路径
+  name: 'externalReports/kyProjectList',
+  res: ({ data }) => {
+    data.records = data.records.map(item => {
+      item.zcbm = item.asset ? item.asset.zcbm : '';
+      item.zcmc = item.asset ? item.asset.zcmc : '';
+      item.zclb = item.asset ? item.asset.zclb : '';
+      item.yt = item.asset ? item.asset.yt : '';
+      item.zcyz = item.asset ? item.asset.zcyz : '';
+      item.jcz = item.asset ? item.asset.jcz : '';
+      item.yzje = item.asset ? item.asset.yzje : '';
+      item.yanfaTanXiao = Number(new Decimal(item.yzje || 0).mul(item.yanfaFenTanLv || 0)).toFixed(2);
+      return item;
+    });
+    return data;
+  },
+});
+</script>

+ 23 - 0
src/views/external-reports/high-tech/gx-project-list.vue

@@ -0,0 +1,23 @@
+<template>
+  <basic-container>
+    <ky-project-list :type="3"></ky-project-list>
+  </basic-container>
+</template>
+
+<script>
+import kyProjectList from '../components/ky-project-list.vue';
+
+export default {
+  components: {
+    kyProjectList
+  },
+  data() {
+    return {
+     
+    };
+  },
+  methods: {
+    
+  },
+};
+</script>

+ 23 - 0
src/views/external-reports/jjkc-standards/jjkc-project-list.vue

@@ -0,0 +1,23 @@
+<template>
+  <basic-container>
+    <ky-project-list :type="2"></ky-project-list>
+  </basic-container>
+</template>
+
+<script>
+import kyProjectList from '../components/ky-project-list.vue';
+
+export default {
+  components: {
+    kyProjectList
+  },
+  data() {
+    return {
+     
+    };
+  },
+  methods: {
+    
+  },
+};
+</script>

+ 23 - 0
src/views/external-reports/kj-standards/kj-project-list.vue

@@ -0,0 +1,23 @@
+<template>
+  <basic-container>
+    <ky-project-list :type="1"></ky-project-list>
+  </basic-container>
+</template>
+
+<script>
+import kyProjectList from '../components/ky-project-list.vue';
+
+export default {
+  components: {
+    kyProjectList
+  },
+  data() {
+    return {
+     
+    };
+  },
+  methods: {
+    
+  },
+};
+</script>