Browse Source

提交科研无形资产明细表

ljb 10 months ago
parent
commit
469a545be1

+ 39 - 0
src/api/yfCostManage/basicDataSetting/wxzcDetail.js

@@ -0,0 +1,39 @@
+import request from '@/router/axios';
+
+export const getList = (current, size, params) => {
+  return request({
+    url: '/api/kd-scientific/asset/wxzc/page',
+    method: 'get',
+    params: {
+      ...params,
+      current,
+      size,
+    }
+  })
+}
+
+export const add = data => {
+  return request({
+    url: '/kd-scientific/asset/wxzc/save',
+    method: 'post',
+    data
+  })
+}
+
+export const remove = (ids) => {
+  return request({
+    url: '/api/kd-scientific/asset/wxzc/remove',
+    method: 'post',
+    params: {
+      ids
+    }
+  })
+}
+
+export const fetchDeviceData = params => {
+  return request({
+    url: '/api/kd-scientific/asset/wxzc/fetchData',
+    method: 'get',
+    params
+  })
+}

+ 11 - 1
src/option/yfCostManage/basicDataSetting/houseDetailList.js

@@ -57,6 +57,16 @@ export default {
       display: false,
       display: false,
     },
     },
     {
     {
+      label: '资产编码',
+      prop: 'zcbm',
+      type: 'input',
+      span: 24,
+      width: 100,
+      align: 'center',
+      showOverflowTooltip: true,
+      display: false,
+    },
+    {
       label: '资产名称',
       label: '资产名称',
       prop: 'assetId',
       prop: 'assetId',
       span: 24,
       span: 24,
@@ -174,7 +184,7 @@ export default {
       display: false,
       display: false,
     },
     },
     {
     {
-      label: '月折旧额(每台/套)',
+      label: '月折旧额(每台/套)(K)',
       prop: 'yzje',
       prop: 'yzje',
       type: 'number',
       type: 'number',
       span: 24,
       span: 24,

+ 11 - 1
src/option/yfCostManage/basicDataSetting/kyDeviceList.js

@@ -57,6 +57,16 @@ export default {
       display: false,
       display: false,
     },
     },
     {
     {
+      label: '资产编码',
+      prop: 'zcbm',
+      type: 'input',
+      span: 24,
+      width: 100,
+      align: 'center',
+      showOverflowTooltip: true,
+      display: false,
+    },
+    {
       label: '资产名称',
       label: '资产名称',
       prop: 'assetId',
       prop: 'assetId',
       span: 24,
       span: 24,
@@ -174,7 +184,7 @@ export default {
       display: false,
       display: false,
     },
     },
     {
     {
-      label: '月折旧额(每台/套)',
+      label: '月折旧额(每台/套)(K)',
       prop: 'yzje',
       prop: 'yzje',
       type: 'number',
       type: 'number',
       span: 24,
       span: 24,

+ 219 - 0
src/option/yfCostManage/basicDataSetting/wxzcDetail.js

@@ -0,0 +1,219 @@
+import { ZC_STATUS } from "@/config/dict";
+
+export default {
+  height: 'auto',
+  calcHeight: 30,
+  tip: false,
+  searchShow: true,
+  searchMenuSpan: 6,
+  border: true,
+  index: true,
+  delBtn: false,
+  menu: false,
+  selection: true,
+  labelWidth: 120,
+  menuWidth: 220,
+  dialogClickModal: false,
+  dialogWidth: 500,
+  dialogType: "drawer",
+  column: [
+    {
+      label: '月份',
+      prop: 'yearAndMonth',
+      width: 65,
+      align: 'center',
+      showOverflowTooltip: true,
+      display: false
+    },
+    {
+      label: '研发项目编号',
+      prop: 'xmbh',
+      type: 'input',
+      span: 24,
+      width: 100,
+      align: 'center',
+      showOverflowTooltip: true,
+      display: false,
+    },
+    {
+      label: '研发项目名称',
+      prop: 'xmId',
+      span: 24,
+      hide: true,
+      rules: [{
+        required: true,
+        message: '请选择资产名称',
+        trigger: 'blur'
+      }]
+    },
+    {
+      label: '研发项目名称',
+      prop: 'xmmc',
+      type: 'input',
+      span: 24,
+      search: true,
+      width: 120,
+      showOverflowTooltip: true,
+      display: false,
+    },
+    {
+      label: '无形资产编码',
+      prop: 'zcbm',
+      type: 'input',
+      span: 24,
+      width: 100,
+      align: 'center',
+      showOverflowTooltip: true,
+      display: false,
+    },
+    {
+      label: '无形资产名称',
+      prop: 'assetId',
+      span: 24,
+      hide: true,
+      rules: [{
+        required: true,
+        message: '请选择资产名称',
+        trigger: 'blur'
+      }]
+    },
+    {
+      label: '无形资产名称',
+      prop: 'zcmc',
+      type: 'input',
+      span: 24,
+      minWidth: 140,
+      search: true,
+      showOverflowTooltip: true,
+      display: false,
+    },
+    {
+      label: '资产类别',
+      prop: 'zclb',
+      type: 'select',
+      dicUrl: '/api/kd-system/dict-biz/dictionary?code=zclb',
+      props: {
+        label: 'dictValue',
+        value: 'dictKey',
+      },
+      span: 24,
+      width: 85,
+      align: 'center',
+      showOverflowTooltip: true,
+      display: false,
+    },
+    {
+      label: '功率',
+      prop: 'gl',
+      type: 'input',
+      span: 24,
+      width: 70,
+      align: 'center',
+      showOverflowTooltip: true,
+      display: false,
+    },
+    {
+      label: '用途',
+      prop: 'yt',
+      type: 'select',
+      dicUrl: '/api/kd-system/dict-biz/dictionary?code=zcyt',
+      props: {
+        label: 'dictValue',
+        value: 'dictKey',
+      },
+      search: true,
+      span: 24,
+      width: 60,
+      align: 'center',
+      showOverflowTooltip: true,
+      display: false,
+    },
+    {
+      label: '摊销开始时间',
+      prop: 'kssj',
+      type: 'date',
+      valueFormat: 'yyyy-MM-dd',
+      span: 24,
+      width: 95,
+      align: 'center',
+      showOverflowTooltip: true,
+      display: false,
+    },
+    {
+      label: '使用寿命',
+      prop: 'sysm',
+      type: 'number',
+      span: 24,
+      width: 70,
+      search: true,
+      align: 'center',
+      showOverflowTooltip: true,
+      display: false,
+    },
+    {
+      label: '已使用月数',
+      prop: 'ysysm',
+      type: 'number',
+      span: 24,
+      width: 85,
+      align: 'center',
+      display: false,
+      search: true,
+      showOverflowTooltip: true,
+      display: false,
+    },
+    {
+      label: '资产原值(元)',
+      prop: 'zcyz',
+      type: 'number',
+      span: 24,
+      width: 95,
+      align: 'center',
+      search: true,
+      showOverflowTooltip: true,
+      display: false,
+    },
+    {
+      label: '净残值(%)',
+      prop: 'jcz',
+      type: 'number',
+      span: 24,
+      width: 80,
+      align: 'center',
+      showOverflowTooltip: true,
+      display: false,
+    },
+    {
+      label: '月摊销额(每节点/套)(K)',
+      prop: 'yzje',
+      type: 'number',
+      span: 24,
+      width: 120,
+      align: 'center',
+      search: true,
+      showOverflowTooltip: true,
+      display: false,
+    },
+    {
+      label: '使用人',
+      prop: 'syr',
+      type: 'select',
+      span: 24,
+      width: 80,
+      align: 'center',
+      showOverflowTooltip: true,
+    },
+    {
+      label: '状态',
+      prop: 'status',
+      type: 'select',
+      dicData: ZC_STATUS,
+      search: true,
+      span: 24,
+      width: 90,
+      align: 'center',
+      showOverflowTooltip: true,
+      display: false,
+    }
+  ],
+};

+ 232 - 0
src/views/yf-cost-manage/basic-data-setting/wxzc-details.vue

@@ -0,0 +1,232 @@
+<template>
+  <basic-container>
+    <avue-crud
+      v-bind="bindVal"
+      v-on="onEvent"
+      v-model="form"
+      :page.sync="page"
+      :permission="permissionList"
+    >
+      <template slot="menuLeft">
+         <el-button
+          v-if="!isSelAnnual"
+          type="danger"
+          size="small"
+          icon="el-icon-delete"
+          plain
+          @click="handleDelete"
+        >
+          删 除
+        </el-button>
+        <!-- <el-button
+          v-if="!isSelAnnual"
+          type="success"
+          size="small"
+          plain
+          icon="el-icon-upload2"
+          @click="handleImport"
+        >
+          导入
+        </el-button> -->
+        <el-button
+          type="warning"
+          size="small"
+          plain
+          icon="el-icon-download"
+          @click="handleExport"
+        >
+          导出
+        </el-button>
+        <el-button
+          v-if="!isSelAnnual"
+          type="primary"
+          size="small"
+          @click="handleReadyDevData"
+        >
+          直接引用
+        </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>
+      </template>
+
+      <template slot="sysmSearch">
+        <div style="display: flex; align-items: center;">
+          <span>使用寿命:</span>
+          <avue-input-number v-model="params.sysmMin" :min="0" style="width: 90px !important;"></avue-input-number>
+          <span style="width: 20px; text-align: center;">至</span>
+          <avue-input-number v-model="params.sysmMax" :min="0" style="width: 90px !important;"></avue-input-number>
+        </div>
+      </template>
+
+      <template slot="zcyzSearch">
+        <div style="display: flex; align-items: center;">
+          <span>资产原值:</span>
+          <avue-input-number v-model="params.zcyzMin" :min="0" style="width: 90px !important;"></avue-input-number>
+          <span style="width: 20px; text-align: center;">至</span>
+          <avue-input-number v-model="params.zcyzMax" :min="0" style="width: 90px !important;"></avue-input-number>
+        </div>
+      </template>
+
+      <template slot="ysysmSearch">
+        <div style="display: flex; align-items: center;">
+          <span>已使用月数:</span>
+          <avue-input-number v-model="params.ysysmMin" :min="0" style="width: 90px !important;"></avue-input-number>
+          <span style="width: 20px; text-align: center;">至</span>
+          <avue-input-number v-model="params.ysysmMax" :min="0" style="width: 90px !important;"></avue-input-number>
+        </div>
+      </template>
+
+      <template slot="yzjeSearch">
+        <div style="display: flex; align-items: center;">
+          <span>月折旧额(每台/套):</span>
+          <avue-input-number v-model="params.yzjeMin" :min="0" style="width: 90px !important;"></avue-input-number>
+          <span style="width: 20px; text-align: center;">至</span>
+          <avue-input-number v-model="params.yzjeMax" :min="0" style="width: 90px !important;"></avue-input-number>
+        </div>
+      </template>
+
+      <template slot="xmIdForm">
+        <project-select v-model="form.xmId" :params="{ yearAndMonth: params.yearAndMonth }"></project-select>
+      </template>
+
+      <template slot="assetIdForm">
+        <asset-select
+          v-model="form.assetId"
+          :params="{ yearAndMonth: params.yearAndMonth, zclb: '房屋建筑物' }"
+          @change="handleAssetChange"
+        ></asset-select>
+      </template>
+      
+    </avue-crud>
+
+    <upload-excel-dialog ref="uploadExcelDialog" :uploadAfter="uploadAfter"/>
+
+    <WideTablePrinter
+      ref="printWideTable"
+      :columns="wideTableColumns"
+      :data="data"
+      :print-title="printTitle"
+      :rows-per-page="30"
+      :default-landscape="true"
+    />
+  </basic-container>
+</template>
+
+<script>
+import { fetchDeviceData } from "@/api/yfCostManage/basicDataSetting/houseDetailList"
+import YearMonthSelect from "@/components/year-month-select";
+import UploadExcelDialog from "@/components/upload-excel-dialog";
+import projectSelect from "@/components/project-select";
+import assetSelect from "@/components/asset-select";
+import moment from "moment";
+
+
+export default window.$crudCommon({
+  components: {
+    YearMonthSelect,
+    projectSelect,
+    assetSelect,
+    UploadExcelDialog,
+  },
+  data() {
+    return {
+      params: {
+        yearAndMonth: moment(new Date()).format('YYYYMM'),
+      },
+      isSelAnnual: false,
+
+      wideTableColumns: [],
+      printTitle: "",
+    };
+  },
+  watch: {
+    'params.yearAndMonth'(newVal) {
+      if (newVal.length > 4) {
+        // 是否勾选未全年
+        this.isSelAnnual = false;
+      } else {
+        this.isSelAnnual = true;
+      }
+      this.page.currentPage = 1;
+      this.getList(this.page);
+    }
+  },
+  computed: {
+    permissionList() {
+      return {
+        addBtn: !this.isSelAnnual,
+        editBtn: !this.isSelAnnual,
+        delBtn: !this.isSelAnnual,
+      };
+    },
+  },
+  methods: {
+    loadData() {},
+    handleImport() {
+      let excelParams = { yearAndMonth: this.params.yearAndMonth };
+      this.$refs.uploadExcelDialog.open('/api/kd-scientific/asset/wxzc/import', excelParams);
+    },
+    uploadAfter() {
+      this.page.currentPage = 1;
+      this.getList(this.page);
+    },
+    handleExport() {
+      exportBloByPost(`/api/kd-scientific/asset/wxzc/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}`;
+      this.$nextTick(() => {
+        this.$refs.printWideTable.printTable(isLandscape);
+      })
+    },
+    handleReadyDevData() {
+      fetchDeviceData({ yearAndMonth: this.params.yearAndMonth}).then(res => {
+        let data = res.data;
+        if (data.success) {
+
+          this.$message.success('引用成功!');
+          this.page.currentPage = 1;
+          this.getList(this.page);
+        }
+      });
+    },
+    handleAssetChange({ zcbm }) {
+      this.form = { ...this.form, zcbm };
+    },
+    getFormData() {
+      const { xmId, assetId, zcbm } = this.form;
+      return { xmId, assetId, zcbm, yearAndMonth: this.params.yearAndMonth };
+    },
+  },
+}, {
+  // 模块路径
+  name: 'yfCostManage/basicDataSetting/wxzcDetail',
+  res: ({ data }) => {
+    data.records = data.records.map(item => {
+      item.zcmc = item.asset ? item.asset.zcmc : '';
+      item.zclb = item.asset ? item.asset.zclb : '';
+      item.gl = item.asset ? item.asset.gl : '';
+      item.yt = item.asset ? item.asset.yt : '';
+      item.kssj = item.asset ? item.asset.kssj : '';
+      item.sysm = item.asset ? item.asset.sysm : '';
+      item.ysysm = item.asset ? item.asset.ysysm : '';
+      item.zcyz = item.asset ? item.asset.zcyz : '';
+      item.jcz = item.asset ? item.asset.jcz : '';
+      item.yzje = item.asset ? item.asset.yzje : '';
+      item.status = item.status ? item.asset.status : '';
+      return item;
+    });
+    return data;
+  },
+});
+</script>