Browse Source

研发租赁费用分配表

ljb 9 months ago
parent
commit
26671435b1

+ 9 - 0
src/api/yfCostManage/yfCostStatistics/yfLeaseAllocationList.js

@@ -0,0 +1,9 @@
+import request from '@/router/axios';
+
+export const getList = (params) => {
+  return request({
+    url: '/api/kd-scientific/lease/yfzlzcfyfpb',
+    method: 'get',
+    params: params
+  })
+}

+ 28 - 1
src/views/yf-cost-manage/yf-cost-statistics/zjtl-cost-statistics/cl-cost/components/common-page.vue

@@ -19,6 +19,19 @@
         <el-button :size="size" icon="el-icon-delete" @click="handleResetBtn">清空</el-button>
       </template>
     </avue-form>
+    <div>
+      <el-button
+        type="warning"
+        size="small"
+        plain
+        icon="el-icon-download"
+        @click="handleExport"
+        style="margin-right: 10px;"
+      >
+        导出
+      </el-button>
+      <print-table-btn />
+    </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>
@@ -32,7 +45,10 @@
 <script>
 import YearMonthSelect from "@/components/year-month-select";
 import commonList from "./common-list.vue";
-import { getList } from "@/api/yfCostManage/yfCostStatistics/clCost"
+import { getList } from "@/api/yfCostManage/yfCostStatistics/clCost";
+import {exportBlob} from "@/api/common";
+import {getToken} from "@/util/auth";
+import {downloadXls} from "@/util/util";
 import moment from "moment";
 
 export default {
@@ -113,6 +129,17 @@ export default {
         this.loading = false;
       });
     },
+    handleExport() {
+      let title = '研发项目领料单';
+      if (this.type == '动力') {
+        title = '研发动力消耗单';
+      } else if (this.type == '燃料') {
+        title = '研发燃料消耗单';
+      }
+      exportBlob(`/api/kd-scientific/goods/yanfalingliaodan/export?${this.website.tokenHeader}=${getToken()}`, this.params).then(res => {
+        downloadXls(res.data, `${this.params.yearAndMonth}${title}.xlsx`);
+      });
+    },
     handleSearchBtn() {
       this.loadData();
     },

+ 106 - 0
src/views/yf-cost-manage/yf-cost-statistics/zjtl-cost-statistics/dev-cost/components/common-list.vue

@@ -0,0 +1,106 @@
+<template>
+  <avue-crud class="cl-crud" :option="options" :data="data">
+    <template slot="menuLeft">
+      <div style="display: flex; align-items: center;">
+        <div style="margin-right: 50px;">研发项目编号:{{ data[0].xmbh }}</div>
+        <div>项目项目名称:{{ data[0].xmmc }}</div>
+      </div>
+    </template>
+  </avue-crud>
+</template>
+
+<script>
+export default {
+  props: {
+    data: {
+      type: Array,
+      default: () => []
+    }
+  },
+  data() {
+    return {
+      options: {
+        tip: false,
+        searchShow: false,
+        border: true,
+        index: true,
+        showSummary: true,
+        menu: false,
+        addBtn: false,
+        refreshBtn: false,
+        columnBtn: false,
+        gridBtn: false,
+        sumColumnList: [
+          {
+            name: "quantity",
+            type: "sum",
+          },
+          {
+            name: "amount",
+            type: "sum",
+          },
+        ],
+        column: [
+          {
+            label: "日期",
+            prop: "leaseDate",
+            width: 100,
+            align: "center",
+            showOverflowTooltip: true,
+          },
+          {
+            label: "租赁资产类型",
+            prop: "type",
+            width: 120,
+            align: "center",
+            showOverflowTooltip: true,
+          },
+          {
+            label: "租赁资产名称",
+            prop: "name",
+            minWidth: 140,
+            showOverflowTooltip: true,
+          },
+          {
+            label: "型号规格",
+            prop: "model",
+            width: 120,
+            align: "center",
+            showOverflowTooltip: true,
+          },
+          {
+            label: "使用天数或使用量",
+            prop: "quantity",
+            width: 120,
+            align: "center",
+            showOverflowTooltip: true,
+          },
+          {
+            label: "单价",
+            prop: "unitPrice",
+            width: 120,
+            align: "center",
+            showOverflowTooltip: true,
+          },
+          {
+            label: "总价(不含税)",
+            prop: "amount",
+            width: 120,
+            align: "center",
+            showOverflowTooltip: true,
+          },
+        ],
+      },
+    };
+  },
+  methods: {},
+};
+</script>
+
+<style lang="scss">
+.cl-crud {
+  .avue-crud__header {
+    min-height: 26px;
+  }
+}
+</style>

+ 163 - 0
src/views/yf-cost-manage/yf-cost-statistics/zjtl-cost-statistics/dev-cost/yf-lease-allocation-list.vue

@@ -0,0 +1,163 @@
+<template>
+  <basic-container v-loading="loading">
+    <avue-form ref="searchForm" v-model="params" :option="searchOption" class="cl-search-form">
+      <template slot="useDate">
+        <span>日期:</span>
+        <el-date-picker
+          v-model="params.leaseDate"
+          type="daterange"
+          range-separator="至"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期"
+          value-format="yyyy-MM-dd"
+          style="width: 220px !important;"
+        >
+        </el-date-picker>
+      </template>
+      <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>
+    </avue-form>
+    <div>
+      <el-button
+        type="warning"
+        size="small"
+        plain
+        icon="el-icon-download"
+        @click="handleExport"
+        style="margin-right: 10px;"
+      >
+        导出
+      </el-button>
+      <print-table-btn />
+    </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" :type="type" :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 commonList from "./components/common-list.vue";
+import { getList } from "@/api/yfCostManage/yfCostStatistics/yfLeaseAllocationList";
+import {exportBlob} from "@/api/common";
+import {getToken} from "@/util/auth";
+import {downloadXls} from "@/util/util";
+import moment from "moment";
+
+export default {
+  components: {
+    YearMonthSelect,
+    commonList
+  },
+  data() {
+    return {
+      loading: false,
+      searchOption: {
+        submitBtn:false,
+        emptyBtn:false,
+        column: [{
+          label: '项目名称',
+          prop: 'xmmc',
+        }, {
+          label: '资产名称',
+          prop: 'name',
+        }, {
+          label: '资产类型',
+          prop: 'type',
+          type: 'select',
+          dicData: [{
+            label: '仪器设备',
+            value: '仪器设备'
+          }, {
+            label: '房屋建筑物',
+            value: '房屋建筑物'
+          }]
+        }, {
+          label: '日期',
+          prop: 'useDate',
+          type: 'date',
+        }]
+      },
+      listData: [],
+
+      yearAndMonth: moment(new Date()).format('YYYYMM'),
+      params: {},
+    }
+  },
+  watch: {
+    yearAndMonth() {
+      this.loadData();
+    }
+  },
+  mounted() {
+    this.loadData();
+  },
+  methods: {
+    loadData() {
+      let params = { ...this.params };
+      if (params.leaseDate && params.leaseDate.length) {
+        params.leaseDateMin = params.leaseDate[0];
+        params.leaseDateMax = params.leaseDate[1];
+      }
+      delete params.leaseDate;
+      this.loading = true;
+      getList({
+        ...params,
+        yearAndMonth: this.yearAndMonth,
+      }).then(({ data }) => {
+        this.loading = false;
+        if (data.code == 200) {
+          let allList = [];
+          data.data.map(item => {
+            Object.keys(item).map(key => {
+              allList.push(item[key]);
+            });
+          });
+
+          this.listData = allList;
+        }
+      }).catch(() => {
+        this.loading = false;
+      });
+    },
+    handleExport() {
+      exportBlob(`/api/kd-scientific/lease/yfzlzcfyfpb/export?${this.website.tokenHeader}=${getToken()}`, this.params).then(res => {
+        downloadXls(res.data, `${this.params.yearAndMonth}研发租赁资产费用分配表.xlsx`);
+      });
+    },
+    handleSearchBtn() {
+      this.loadData();
+    },
+    handleResetBtn() {
+      this.params = {};
+      this.$refs.searchForm.resetForm();
+      this.loadData();
+    },
+  },
+}
+</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>