소스 검색

提交研发燃料和研发租赁页面

ljb 10 달 전
부모
커밋
968cbe54a0

+ 3 - 3
src/api/techPerson/monthSjcyry.js

@@ -31,10 +31,10 @@ export const remove = (ids) => {
 }
 
 // 直接引用预算表名单
-export const yyysbmd = (params) => {
+export const yyysbmd = (data) => {
   return request({
     url: '/apikd-scientific/technician/xm/monthly/yyysbmd',
-    method: 'get',
-    params
+    method: 'post',
+    data
   })
 }

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

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

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

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

+ 17 - 6
src/components/project-select/index.vue

@@ -5,6 +5,7 @@
     placeholder="请选择 项目名称"
     :loading="loading"
     :disabled="disabled"
+    :multiple="multiple"
     style="width: 100%;"
     @change="handleProjectChange"
   >
@@ -24,10 +25,16 @@ export default {
   name: 'ProjectSelect',
   props: {
     value: [String, Number],
+    // 搜索条件
     params: Object,
     disabled: {
       type: Boolean,
       default: false
+    },
+    // 是否多选
+    multiple: {
+      type: Boolean,
+      default: false
     }
   },
   data() {
@@ -62,17 +69,21 @@ export default {
           this.projectList = data.data.records;
           this.xmId = this.value;
 
-          this.findProjectObj(this.value, proData => {
-            this.$emit('change', proData);
-          });
+          if (!this.multiple) {
+            this.findProjectObj(this.value, proData => {
+              this.$emit('change', proData);
+            });
+          }
         }
       })
     },
     handleProjectChange(val) {
       this.$emit('input', val);
-      this.findProjectObj(val, proData => {
-        this.$emit('change', proData);
-      });
+      if (!this.multiple) {
+        this.findProjectObj(val, proData => {
+          this.$emit('change', proData);
+        });
+      }
     },
   }
 }

+ 125 - 0
src/option/yfCostManage/basicDataSetting/leaseRecords.js

@@ -0,0 +1,125 @@
+export default {
+  height: 'auto',
+  calcHeight: 30,
+  tip: false,
+  searchShow: true,
+  searchMenuSpan: 6,
+  border: true,
+  index: true,
+  selection: true,
+  searchLabelWidth: 140,
+  labelWidth: 130,
+  menuWidth: 140,
+  dialogClickModal: false,
+  dialogWidth: 500,
+  dialogType: "drawer",
+  showSummary: true,
+  sumColumnList: [
+    {
+      name: 'lqsl',
+      type: 'sum',
+    },
+    {
+      name: 'je',
+      type: 'sum'
+    }
+  ],
+  column: [
+    {
+      label: '日期',
+      prop: 'rq',
+      type: 'date',
+      span: 24,
+      width: 100,
+      align: 'center',
+      showOverflowTooltip: true,
+    },
+    {
+      label: '研发项目编号',
+      prop: 'xmbh',
+      type: 'input',
+      span: 24,
+      search: true,
+      width: 100,
+      align: 'center',
+      showOverflowTooltip: true,
+      display: false,
+    },
+    {
+      label: '研发项目名称',
+      prop: 'xmmc',
+      type: 'select',
+      span: 24,
+      minWidth: 160,
+      search: true,
+      showOverflowTooltip: true,
+    },
+    {
+      label: '租赁资产类型',
+      prop: 'zlzclx',
+      type: 'select',
+      span: 24,
+      width: 100,
+      align: 'center',
+      search: true,
+      dicUrl: '/api/kd-system/dict-biz/dictionary?code=renyuanleixing',
+      props: {
+        label: 'dictValue',
+        value: 'dictKey',
+      },
+      showOverflowTooltip: true,
+    },
+    {
+      label: '租赁资产名称',
+      prop: 'zlzcmc',
+      type: 'input',
+      span: 24,
+      search: true,
+      width: 160,
+      align: 'center',
+      showOverflowTooltip: true,
+    },
+    {
+      label: '型号规格',
+      prop: 'xhgg',
+      type: 'input',
+      span: 24,
+      search: true,
+      minWidth: 140,
+      showOverflowTooltip: true,
+    },
+    {
+      label: '使用天数或使用量',
+      prop: 'dw',
+      type: 'number',
+      span: 24,
+      width: 140,
+      align: 'center',
+      min: 0,
+      precision: 0,
+      showOverflowTooltip: true,
+    },
+    {
+      label: '单价(元)',
+      prop: 'dj',
+      type: 'number',
+      span: 24,
+      width: 100,
+      align: 'center',
+      min: 0,
+      precision: 2,
+      showOverflowTooltip: true,
+    },
+    {
+      label: '总价(不含税)',
+      prop: 'zj',
+      type: 'number',
+      span: 24,
+      width: 120,
+      align: 'center',
+      min: 0,
+      precision: 2,
+      showOverflowTooltip: true,
+    },
+  ],
+};

+ 143 - 0
src/option/yfCostManage/basicDataSetting/pickingDetail.js

@@ -0,0 +1,143 @@
+export default {
+  height: 'auto',
+  calcHeight: 30,
+  tip: false,
+  searchShow: true,
+  searchMenuSpan: 6,
+  border: true,
+  index: true,
+  selection: true,
+  searchLabelWidth: 140,
+  labelWidth: 100,
+  menuWidth: 140,
+  dialogClickModal: false,
+  dialogWidth: 500,
+  dialogType: "drawer",
+  showSummary: true,
+  sumColumnList: [
+    {
+      name: 'lqsl',
+      type: 'sum',
+    },
+    {
+      name: 'je',
+      type: 'sum'
+    }
+  ],
+  column: [
+    {
+      label: '日期',
+      prop: 'rq',
+      type: 'date',
+      span: 24,
+      width: 100,
+      align: 'center',
+      showOverflowTooltip: true,
+    },
+    {
+      label: '研发项目编号',
+      prop: 'xmbh',
+      type: 'input',
+      span: 24,
+      search: true,
+      width: 100,
+      align: 'center',
+      showOverflowTooltip: true,
+      display: false,
+    },
+    {
+      label: '研发项目名称',
+      prop: 'xmmc',
+      type: 'select',
+      span: 24,
+      minWidth: 160,
+      search: true,
+      showOverflowTooltip: true,
+    },
+    {
+      label: '类型',
+      prop: 'type',
+      type: 'select',
+      span: 24,
+      width: 100,
+      align: 'center',
+      search: true,
+      dicUrl: '/api/kd-system/dict-biz/dictionary?code=renyuanleixing',
+      props: {
+        label: 'dictValue',
+        value: 'dictKey',
+      },
+      showOverflowTooltip: true,
+    },
+    {
+      label: '物资编号',
+      prop: 'wzbh',
+      type: 'input',
+      span: 24,
+      search: true,
+      width: 100,
+      align: 'center',
+      showOverflowTooltip: true,
+    },
+    {
+      label: '物资名称',
+      prop: 'wzmc',
+      type: 'input',
+      span: 24,
+      search: true,
+      minWidth: 160,
+      showOverflowTooltip: true,
+    },
+    {
+      label: '型号规格',
+      prop: 'xhgg',
+      type: 'input',
+      span: 24,
+      search: true,
+      minWidth: 140,
+      showOverflowTooltip: true,
+    },
+    {
+      label: '单位',
+      prop: 'dw',
+      type: 'input',
+      span: 24,
+      width: 100,
+      align: 'center',
+      showOverflowTooltip: true,
+    },
+    {
+      label: '单价(元)',
+      prop: 'dj',
+      type: 'number',
+      span: 24,
+      width: 100,
+      align: 'center',
+      min: 0,
+      precision: 2,
+      showOverflowTooltip: true,
+    },
+    {
+      label: '领取数量',
+      prop: 'lqsl',
+      type: 'number',
+      span: 24,
+      width: 100,
+      align: 'center',
+      min: 0,
+      precision: 0,
+      showOverflowTooltip: true,
+    },
+    {
+      label: '金额(元)',
+      prop: 'je',
+      type: 'number',
+      span: 24,
+      width: 100,
+      align: 'center',
+      min: 0,
+      precision: 2,
+      showOverflowTooltip: true,
+    },
+  ],
+};

+ 3 - 0
src/views/project-manage/components/outsourcing-doc.vue

@@ -305,6 +305,9 @@ export default {
       this.selProject = data;
     },
     getListData() {
+      if (!this.params.xmId) {
+        return;
+      }
       this.loading = true;
       getList(1, 99999, this.params).then(({ data }) => {
         this.loading = false;

+ 21 - 3
src/views/tech-person/month-cjcyry.vue

@@ -40,7 +40,7 @@
       </template>
 
       <template slot="xmmcSearch">
-        <project-select placeholder="请选择项目名称" v-model="params.xmId"></project-select>
+        <project-select ref="projectSelectRef" placeholder="请选择项目名称" multiple v-model="params.xmId"></project-select>
       </template>
 
       <template slot="xmmcForm">
@@ -103,15 +103,33 @@ export default window.$crudCommon({
     },
   },
   methods: {
+    getSearchParams() {
+      console.log(this)
+      return {
+        ...this.params,
+        xmId: this.params.xmId ? this.params.xmId.join(',') : undefined
+      };
+    },
     getFormData() {
-      return { ...this.form, yearAndMonth: this.params.yearAndMonth };
+      return {
+        ...this.form,
+        yearAndMonth: this.params.yearAndMonth,
+      };
     },
     handleZjyyClick() {
       if (!this.params.xmId) {
         this.$message.error("请设置“研发项目”后,再操作!");
         return;
       }
-      yyysbmd({ xmId: this.params.xmId, yearAndMonth: this.params.yearAndMonth }).then(({ data }) => {
+      let xmList = [];
+      let proList = this.$refs.projectSelectRef.projectList;
+      proList.forEach(item => {
+        if (this.params.xmId.indexOf(item.id) > -1) {
+          xmList.push(item);
+        }
+      });
+
+      yyysbmd({ xmList, yearAndMonth: this.params.yearAndMonth }).then(({ data }) => {
         if (data.code == 200) {
           this.$message.success("引用预算表成功");
           this.page.currentPage = 1;

+ 126 - 0
src/views/yf-cost-manage/basic-data-setting/lease-records.vue

@@ -0,0 +1,126 @@
+<template>
+  <basic-container>
+    <avue-crud
+      v-bind="bindVal"
+      v-on="onEvent"
+      v-model="form"
+      :page.sync="page"
+    >
+      <template slot="menuLeft">
+         <el-button
+          type="danger"
+          size="small"
+          icon="el-icon-delete"
+          plain
+          @click="handleDelete"
+        >
+          删 除
+        </el-button>
+        <el-button
+          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>
+        <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="xmmcForm">
+        <project-select placeholder="请选择项目名称" v-model="form.xmId" @change="handleProjectChange"></project-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 YearMonthSelect from "@/components/year-month-select";
+import UploadExcelDialog from "@/components/upload-excel-dialog";
+import projectSelect from "@/components/project-select";
+import moment from "moment";
+
+
+export default window.$crudCommon({
+  components: {
+    YearMonthSelect,
+    projectSelect,
+    UploadExcelDialog,
+  },
+  data() {
+    return {
+      params: {
+        yearAndMonth: moment(new Date()).format('YYYYMM'),
+      },
+      defaultColumns: [],
+
+      wideTableColumns: [],
+      printTitle: "",
+    };
+  },
+  watch: {
+    'params.yearAndMonth'(newVal) {
+      this.page.currentPage = 1;
+      this.getList(this.page);
+    }
+  },
+  methods: {
+    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`);
+      });
+    },
+    /**
+     * 打印表格
+     * @param isLandscape 是否横向打印
+     */
+    printTable(isLandscape) {
+      this.wideTableColumns = this.$refs.crud.columnOption;
+      this.printTitle = `研发租赁资产使用记录和费用表${this.params.yearAndMonth}`;
+      this.$nextTick(() => {
+        this.$refs.printWideTable.printTable(isLandscape);
+      })
+    },
+  },
+}, {
+  // 模块路径
+  name: 'yfCostManage/basicDataSetting/leaseRecords',
+  res: ({ data }) => {
+    return data;
+  },
+});
+</script>

+ 126 - 0
src/views/yf-cost-manage/basic-data-setting/picking-detail.vue

@@ -0,0 +1,126 @@
+<template>
+  <basic-container>
+    <avue-crud
+      v-bind="bindVal"
+      v-on="onEvent"
+      v-model="form"
+      :page.sync="page"
+    >
+      <template slot="menuLeft">
+         <el-button
+          type="danger"
+          size="small"
+          icon="el-icon-delete"
+          plain
+          @click="handleDelete"
+        >
+          删 除
+        </el-button>
+        <el-button
+          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>
+        <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="xmmcForm">
+        <project-select placeholder="请选择项目名称" v-model="form.xmId" @change="handleProjectChange"></project-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 YearMonthSelect from "@/components/year-month-select";
+import UploadExcelDialog from "@/components/upload-excel-dialog";
+import projectSelect from "@/components/project-select";
+import moment from "moment";
+
+
+export default window.$crudCommon({
+  components: {
+    YearMonthSelect,
+    projectSelect,
+    UploadExcelDialog,
+  },
+  data() {
+    return {
+      params: {
+        yearAndMonth: moment(new Date()).format('YYYYMM'),
+      },
+      defaultColumns: [],
+
+      wideTableColumns: [],
+      printTitle: "",
+    };
+  },
+  watch: {
+    'params.yearAndMonth'(newVal) {
+      this.page.currentPage = 1;
+      this.getList(this.page);
+    }
+  },
+  methods: {
+    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`);
+      });
+    },
+    /**
+     * 打印表格
+     * @param isLandscape 是否横向打印
+     */
+    printTable(isLandscape) {
+      this.wideTableColumns = this.$refs.crud.columnOption;
+      this.printTitle = `研发领料燃料动力明细清单${this.params.yearAndMonth}`;
+      this.$nextTick(() => {
+        this.$refs.printWideTable.printTable(isLandscape);
+      })
+    },
+  },
+}, {
+  // 模块路径
+  name: 'yfCostManage/basicDataSetting/pickingDetail',
+  res: ({ data }) => {
+    return data;
+  },
+});
+</script>