Browse Source

提交研发资产费用分摊表

ljb 11 months ago
parent
commit
c69bcc980d

+ 30 - 329
src/option/deviceManage/yfCostShareList.js

@@ -6,8 +6,9 @@ export default {
   searchMenuSpan: 6,
   border: true,
   index: true,
-  viewBtn: true,
-  selection: true,
+  addBtn: false,
+  menu: false,
+  selection: false,
   searchLabelWidth: 140,
   labelWidth: 140,
   menuWidth: 220,
@@ -16,383 +17,83 @@ export default {
   dialogType: "drawer",
   column: [
     {
-      label: '姓名',
-      prop: 'name',
+      label: '月份',
+      prop: 'month',
       type: 'input',
-      span: 12,
-      search: true,
       width: 100,
       align: 'center',
       showOverflowTooltip: true,
-      rules: [
-        {
-          required: true,
-          message: '请输入姓名',
-          trigger: 'blur',
-        },
-      ],
-    },
-    {
-      label: '工号',
-      prop: 'number',
-      type: 'input',
-      span: 12,
-      width: 160,
-      align: 'center',
-      search: true,
-      showOverflowTooltip: true,
-      // rules: [
-      //   {
-      //     required: true,
-      //     message: '请输入工号',
-      //     trigger: 'blur',
-      //   },
-      // ],
-    },
-    {
-      label: '身份证号',
-      prop: 'identityCard',
-      type: 'input',
-      span: 12,
-      search: true,
-      width: 160,
-      align: 'center',
-      showOverflowTooltip: true,
-      // rules: [
-      //   {
-      //     required: true,
-      //     message: '请输入身份证号',
-      //     trigger: 'blur',
-      //   },
-      // ],
     },
     {
-      label: '性别',
-      prop: 'gender',
+      label: '资产编码',
+      prop: 'zcbm',
       type: 'select',
-      dicUrl: '/api/kd-system/dict/dictionary?code=sex',
-      props: {
-        label: 'dictValue',
-        value: 'dictKey',
-      },
-      span: 12,
-      width: 50,
-      align: 'center',
-      showOverflowTooltip: true,
-      rules: [
-        {
-          required: true,
-          message: '请选择性别',
-          trigger: 'change',
-        },
-      ],
-    },
-    {
-      label: '出生日期',
-      prop: 'birthday',
-      type: 'date',
-      valueFormat: 'yyyy-MM-DD',
-      span: 12,
-      width: 90,
-      align: 'center',
-      showOverflowTooltip: true,
-      rules: [
-        {
-          required: true,
-          message: '请选择出生日期',
-          trigger: 'blur',
-        },
-      ],
-    },
-    {
-      label: '民族',
-      prop: 'ethnic',
-      type: 'input',
-      span: 12,
       width: 120,
       align: 'center',
       showOverflowTooltip: true,
-      rules: [
-        {
-          required: true,
-          message: '请输入民族',
-          trigger: 'blur',
-        },
-      ],
-    },
-    {
-      label: '所属二级单位',
-      prop: 'secondaryUnit',
-      type: 'input',
-      span: 12,
-      width: 140,
-      search: true,
-      align: 'center',
-      showOverflowTooltip: true,
-      rules: [
-        {
-          required: true,
-          message: '请输入所属二级单位',
-          trigger: 'blur',
-        },
-      ],
-    },
-    {
-      label: '部门/科室/项目部',
-      prop: 'department',
-      type: 'input',
-      span: 12,
-      width: 140,
-      search: true,
-      align: 'center',
-      showOverflowTooltip: true,
-      rules: [
-        {
-          required: true,
-          message: '请输入部门/科室/项目部',
-          trigger: 'blur',
-        },
-      ],
-    },
-    {
-      label: '岗位职务',
-      prop: 'post',
-      type: 'input',
-      span: 12,
-      width: 100,
-      align: 'center',
-      search: true,
-      showOverflowTooltip: true,
-      rules: [
-        {
-          required: true,
-          message: '请输入岗位职务',
-          trigger: 'blur',
-        },
-      ],
-    },
-    {
-      label: '岗位所在地',
-      prop: 'postLocation',
-      type: 'input',
-      span: 12,
-      width: 100,
-      search: true,
-      align: 'center',
-      showOverflowTooltip: true,
-      rules: [
-        {
-          required: true,
-          message: '请输入岗位所在地',
-          trigger: 'blur',
-        },
-      ],
-    },
-    {
-      label: '用工性质',
-      prop: 'nature',
-      type: 'select',
-      span: 12,
-      width: 80,
-      align: 'center',
-      search: true,
-      dicUrl: '/api/kd-system/dict-biz/dictionary?code=yonggongxingzhi',
-      props: {
-        label: 'dictValue',
-        value: 'dictKey',
-      },
-      showOverflowTooltip: true,
-      rules: [
-        {
-          required: true,
-          message: '请选择用工性质',
-          trigger: 'change',
-        },
-      ],
     },
     {
-      label: '入职时间',
-      prop: 'hireDate',
-      type: 'datetime',
-      valueFormat: 'yyyy-MM-dd HH:mm:ss',
-      span: 12,
+      label: '资产名称',
+      prop: 'zcmc',
+      type: 'date',
       width: 140,
       align: 'center',
-      search: true,
       showOverflowTooltip: true,
-      rules: [
-        {
-          required: true,
-          message: '请选择入职时间',
-          trigger: 'blur',
-        },
-      ],
     },
     {
-      label: '最高学历',
-      prop: 'education',
+      label: '资产类别',
+      prop: 'zclb',
       type: 'select',
-      span: 12,
-      width: 100,
+      width: 120,
       align: 'center',
+      dicUrl: '/api/kd-system/dict-biz/dictionary?code=asset_category',
       search: true,
-      dicUrl: '/api/kd-system/dict-biz/dictionary?code=xueli',
       props: {
         label: 'dictValue',
         value: 'dictKey',
       },
       showOverflowTooltip: true,
-      rules: [
-        {
-          required: true,
-          message: '请选择最高学历',
-          trigger: 'change',
-        },
-      ],
     },
     {
-      label: '最高学位',
-      prop: 'degree',
+      label: '用途',
+      prop: 'yt',
       type: 'select',
-      span: 12,
       width: 90,
-      align: 'center',
+      dicUrl: '/api/kd-system/dict-biz/dictionary?code=asset_category',
       search: true,
-      dicUrl: '/api/kd-system/dict-biz/dictionary?code=xuewei',
       props: {
         label: 'dictValue',
         value: 'dictKey',
       },
-      showOverflowTooltip: true,
-      rules: [
-        {
-          required: true,
-          message: '请选择最高学位',
-          trigger: 'change',
-        },
-      ],
-    },
-    {
-      label: '最高学历学校',
-      prop: 'schoolName',
-      type: 'input',
-      span: 12,
-      width: 160,
       align: 'center',
       showOverflowTooltip: true,
-      rules: [
-        {
-          required: true,
-          message: '请输入最高学历学校',
-          trigger: 'blur',
-        },
-      ],
     },
     {
-      label: '最高学历专业名称',
-      prop: 'major',
-      type: 'input',
-      span: 12,
-      width: 140,
+      label: '资产原值(元)',
+      prop: 'zcyz',
+      type: 'number',
+      width: 110,
+      search: true,
       align: 'center',
       showOverflowTooltip: true,
-      rules: [
-        {
-          required: true,
-          message: '请输入最高学历专业名称',
-          trigger: 'blur',
-        },
-      ],
     },
     {
-      label: '职称',
-      prop: 'rank',
-      type: 'select',
-      span: 12,
-      width: 120,
-      align: 'center',
+      label: '净残值(%)',
+      prop: 'jcz',
+      type: 'number',
+      width: 110,
       search: true,
-      dicUrl: '/api/kd-system/dict-biz/dictionary?code=zhicheng',
-      props: {
-        label: 'dictValue',
-        value: 'dictKey',
-      },
-      showOverflowTooltip: true,
-      rules: [
-        {
-          required: true,
-          message: '请选择职称',
-          trigger: 'change',
-        },
-      ],
-    },
-    {
-      label: '职业资格',
-      prop: 'practicingRequirement',
-      type: 'input',
-      span: 12,
-      width: 100,
       align: 'center',
       showOverflowTooltip: true,
-      rules: [
-        {
-          required: true,
-          message: '请输入职业资格',
-          trigger: 'blur',
-        },
-      ],
     },
     {
-      label: '其他说明',
-      prop: 'remark',
-      type: 'textarea',
-      span: 24,
-      minWidth: 160,
-      showOverflowTooltip: true,
-    },
-    {
-      label: '参研情况',
-      prop: 'situation',
-      type: 'select',
-      span: 12,
-      width: 100,
-      align: 'center',
+      label: '月折旧额/月摊销额(元)',
+      prop: 'zje',
+      type: 'number',
+      width: 150,
       search: true,
-      dicUrl: '/api/kd-system/dict-biz/dictionary?code=canyanqingkuang',
-      props: {
-        label: 'dictValue',
-        value: 'dictKey',
-      },
-      showOverflowTooltip: true,
-      rules: [
-        {
-          required: true,
-          message: '请选择参研情况',
-          trigger: 'change',
-        },
-      ],
-    },
-    {
-      label: '人员类型',
-      prop: 'personnelType',
-      type: 'select',
-      span: 12,
-      width: 100,
       align: 'center',
-      search: true,
-      dicUrl: '/api/kd-system/dict-biz/dictionary?code=renyuanleixing',
-      props: {
-        label: 'dictValue',
-        value: 'dictKey',
-      },
       showOverflowTooltip: true,
-      rules: [
-        {
-          required: true,
-          message: '请选择人员类型',
-          trigger: 'change',
-        },
-      ],
     },
   ],
 };

+ 3 - 85
src/views/device-manage/asset-legder.vue

@@ -21,7 +21,7 @@
         <print-table-btn @click="printTable" />
         
         <div style="display: flex; align-items: center;">
-          <year-month-select v-model="params.yearAndMonth"></year-month-select>
+          <year-month-select v-model="params.yearAndMonth" :showAllYear="false"></year-month-select>
         </div>
       </template>
 
@@ -96,7 +96,6 @@
 </template>
 
 <script>
-import { getLastMonthData } from "@/api/basicResource/technicianRoster";
 import {exportBloByPost} from "@/api/common";
 import YearMonthSelect from "@/components/year-month-select";
 import moment from "moment";
@@ -113,7 +112,6 @@ export default window.$crudCommon({
       params: {
         yearAndMonth: moment(new Date()).format('YYYYMM'),
       },
-      isSelAnnual: false, // 是否选择全年
 
       wideTableColumns: [],
       printTitle: "",
@@ -121,90 +119,14 @@ export default window.$crudCommon({
   },
   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: {
-    validCustom() {
-      if (!this.form.number && !this.form.identityCard) {
-        this.$message.warning("工号和身份证号必须填写一项!");
-        return false;
-      }
-      return true;
-    },
-    addBefore(loading, callback) {
-      if (!this.validCustom()) {
-        loading();
-        return;
-      }
-      callback && callback();
-    },
-    updateBefore(loading, callback) {
-      if (!this.validCustom()) {
-        loading();
-        return false;
-      }
-      callback && callback();
-    },
-    getDelParams(row) {
-      return [{ id: row.id, yearAndMonth: this.params.yearAndMonth }];
-    },
-    getBatchDelParams() {
-      let delArr = [];
-      this.data.forEach(item => {
-        if (this.ids.indexOf(item.id) > -1) {
-          delArr.push({ yearAndMonth: this.params.yearAndMonth, id: item.id });
-        }
-      });
-      return delArr;
-    },
-    handleImport() {
-      let excelParams = { yearAndMonth: this.params.yearAndMonth };
-      this.$refs.uploadExcelDialog.open('/api/kd-scientific/technician/import', excelParams);
-    },
-    uploadAfter() {
-      this.page.currentPage = 1;
-      this.getList(this.page);
-    },
     handleExport() {
       exportBloByPost(`/api/kd-scientific/technician/export?${this.website.tokenHeader}=${getToken()}`, this.params).then(res => {
-        downloadXls(res.data, `技术人员花名册${this.params.yearAndMonth}.xlsx`);
-      });
-    },
-    handleTemplate() {
-      this.$message.warning("暂未配置模板");
-    },
-    handleReadyLastMonData() {
-      this.$confirm("确认要读取上个月的数据吗?", "提示", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning"
-      }).then(() => {
-        getLastMonthData({ yearAndMonth: this.params.yearAndMonth}).then(res => {
-          let data = res.data;
-          if (data.success) {
-
-            this.$message.success('读取成功!');
-            this.page.currentPage = 1;
-            this.getList(this.page);
-          }
-        });
+        downloadXls(res.data, `科研资产台账RD匹配表${this.params.yearAndMonth}.xlsx`);
       });
     },
     /**
@@ -213,7 +135,7 @@ export default window.$crudCommon({
      */
     printTable(isLandscape) {
       this.wideTableColumns = this.$refs.crud.columnOption;
-      this.printTitle = `技术人员花名册${this.params.yearAndMonth}`;
+      this.printTitle = `科研资产台账RD匹配表${this.params.yearAndMonth}`;
       this.$nextTick(() => {
         this.$refs.printWideTable.printTable(isLandscape);
       })
@@ -223,10 +145,6 @@ export default window.$crudCommon({
   // 模块路径
   name: 'deviceManage/assetLegder',
   res: ({ data }) => {
-    data.records = data.records.map(item => {
-      item.gender = item.gender ? String(item.gender) : '';
-      return item;
-    });
     return data;
   },
 });

+ 106 - 162
src/views/device-manage/yf-cost-share-list.vue

@@ -10,26 +10,6 @@
     >
       <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
@@ -38,25 +18,61 @@
         >
           导出
         </el-button>
-        <el-button
-          v-if="!isSelAnnual"
-          type="primary"
-          size="small"
-          plain
-          @click="handleReadyLastMonData"
-        >
-          读取上个月人员名单
-        </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 style="display: flex; align-items: center">
+          <year-month-select
+            v-model="params.yearAndMonth"
+            :showAllYear="false"
+          ></year-month-select>
+        </div>
+      </template>
+
+      <!-- 资产原值 -->
+      <template slot="zcyzSearch">
+        <div style="display: flex; align-items: center">
+          <avue-input-number
+            v-model="params.zcyzStart"
+            :min="0"
+          ></avue-input-number>
+          <span style="width: 70px; text-align: center">至</span>
+          <avue-input-number
+            v-model="params.zcycEnd"
+            :min="0"
+          ></avue-input-number>
+        </div>
+      </template>
+
+      <!-- 净残值 -->
+      <template slot="jczSearch">
+        <div style="display: flex; align-items: center">
+          <avue-input-number
+            v-model="params.jczStart"
+            :min="0"
+          ></avue-input-number>
+          <span style="width: 70px; text-align: center">至</span>
+          <avue-input-number
+            v-model="params.jczEnd"
+            :min="0"
+          ></avue-input-number>
         </div>
       </template>
-      
-    </avue-crud>
 
-    <upload-excel-dialog ref="uploadExcelDialog" :uploadAfter="uploadAfter"/>
+      <!-- 折旧额 -->
+      <template slot="zjeSearch">
+        <div style="display: flex; align-items: center">
+          <avue-input-number
+            v-model="params.zjeStart"
+            :min="0"
+          ></avue-input-number>
+          <span style="width: 70px; text-align: center">至</span>
+          <avue-input-number
+            v-model="params.zjeEnd"
+            :min="0"
+          ></avue-input-number>
+        </div>
+      </template>
+    </avue-crud>
 
     <WideTablePrinter
       ref="printWideTable"
@@ -70,140 +86,68 @@
 </template>
 
 <script>
-import { getLastMonthData } from "@/api/basicResource/technicianRoster";
-import {exportBloByPost} from "@/api/common";
+import { exportBloByPost } from "@/api/common";
 import YearMonthSelect from "@/components/year-month-select";
-import UploadExcelDialog from "@/components/upload-excel-dialog";
 import moment from "moment";
-import {getToken} from "@/util/auth";
-import {downloadXls} from "@/util/util";
-
+import { getToken } from "@/util/auth";
+import { downloadXls } from "@/util/util";
 
-export default window.$crudCommon({
-  components: {
-    YearMonthSelect,
-    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() {
+export default window.$crudCommon(
+  {
+    components: {
+      YearMonthSelect,
+    },
+    data() {
       return {
-        addBtn: !this.isSelAnnual,
-        editBtn: !this.isSelAnnual,
-        delBtn: !this.isSelAnnual,
+        params: {
+          yearAndMonth: moment(new Date()).format("YYYYMM"),
+        },
+
+        wideTableColumns: [],
+        printTitle: "",
       };
     },
-  },
-  methods: {
-    validCustom() {
-      if (!this.form.number && !this.form.identityCard) {
-        this.$message.warning("工号和身份证号必须填写一项!");
-        return false;
-      }
-      return true;
-    },
-    addBefore(loading, callback) {
-      if (!this.validCustom()) {
-        loading();
-        return;
-      }
-      callback && callback();
-    },
-    updateBefore(loading, callback) {
-      if (!this.validCustom()) {
-        loading();
-        return false;
-      }
-      callback && callback();
-    },
-    getDelParams(row) {
-      return [{ id: row.id, yearAndMonth: this.params.yearAndMonth }];
-    },
-    getBatchDelParams() {
-      let delArr = [];
-      this.data.forEach(item => {
-        if (this.ids.indexOf(item.id) > -1) {
-          delArr.push({ yearAndMonth: this.params.yearAndMonth, id: item.id });
+    watch: {
+      "params.yearAndMonth"(newVal) {
+        if (newVal.length > 4) {
+          this.page.currentPage = 1;
+          this.getList(this.page);
         }
-      });
-      return delArr;
-    },
-    handleImport() {
-      let excelParams = { yearAndMonth: this.params.yearAndMonth };
-      this.$refs.uploadExcelDialog.open('/api/kd-scientific/technician/import', excelParams);
-    },
-    uploadAfter() {
-      this.page.currentPage = 1;
-      this.getList(this.page);
-    },
-    handleExport() {
-      exportBloByPost(`/api/kd-scientific/technician/export?${this.website.tokenHeader}=${getToken()}`, this.params).then(res => {
-        downloadXls(res.data, `技术人员花名册${this.params.yearAndMonth}.xlsx`);
-      });
-    },
-    handleTemplate() {
-      this.$message.warning("暂未配置模板");
-    },
-    handleReadyLastMonData() {
-      this.$confirm("确认要读取上个月的数据吗?", "提示", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning"
-      }).then(() => {
-        getLastMonthData({ yearAndMonth: this.params.yearAndMonth}).then(res => {
-          let data = res.data;
-          if (data.success) {
-
-            this.$message.success('读取成功!');
-            this.page.currentPage = 1;
-            this.getList(this.page);
-          }
-        });
-      });
-    },
-    /**
-     * 打印表格
-     * @param isLandscape 是否横向打印
-     */
-    printTable(isLandscape) {
-      this.wideTableColumns = this.$refs.crud.columnOption;
-      this.printTitle = `技术人员花名册${this.params.yearAndMonth}`;
-      this.$nextTick(() => {
-        this.$refs.printWideTable.printTable(isLandscape);
-      })
+      },
+      methods: {
+        handleExport() {
+          exportBloByPost(
+            `/api/kd-scientific/technician/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);
+          });
+        },
+      },
     },
   },
-}, {
-  // 模块路径
-  name: 'basicResource/technicianRoster',
-  res: ({ data }) => {
-    data.records = data.records.map(item => {
-      item.gender = item.gender ? String(item.gender) : '';
-      return item;
-    });
-    return data;
-  },
-});
+  {
+    // 模块路径
+    name: "deviceManage/yfCostShareList",
+    res: ({ data }) => {
+      return data;
+    },
+  }
+);
 </script>