Browse Source

1.新增每月实际参研人员页面;2、项目参研人员汇总表接口联调

ljb 10 months ago
parent
commit
e4586b9a55

+ 14 - 0
src/api/basicResource/technicianRoster.js

@@ -47,3 +47,17 @@ export const getLastMonthData = params => {
     }
   })
 }
+
+// 通过项目周期获取可以人员列表
+export const getListByProDate = (startDate, endDate) => {
+  return request({
+    url: '/api/kd-scientific/technician/page/date-interval',
+    method: 'get',
+    params: {
+      startDate,
+      endDate,
+      current: 1,
+      size: 99999,
+    }
+  })
+}

+ 40 - 0
src/api/techPerson/monthSjcyry.js

@@ -0,0 +1,40 @@
+import request from '@/router/axios';
+
+export const getList = (current, size, params) => {
+  return request({
+    url: '/api/kd-scientific/technician/xm/monthly/page',
+    method: 'get',
+    params: {
+      ...params,
+      current,
+      size,
+    }
+  })
+}
+
+export const add = (row) => {
+  return request({
+    url: '/api/kd-scientific/technician/xm/monthly/submit',
+    method: 'post',
+    data: row
+  })
+}
+
+export const remove = (ids) => {
+  return request({
+    url: '/apikd-scientific/technician/xm/monthly/remove',
+    method: 'delete',
+    params: {
+      ids,
+    }
+  })
+}
+
+// 直接引用预算表名单
+export const yyysbmd = (params) => {
+  return request({
+    url: '/apikd-scientific/technician/xm/monthly/yyysbmd',
+    method: 'get',
+    params
+  })
+}

+ 1 - 1
src/components/project-select/index.vue

@@ -2,7 +2,7 @@
   <el-select
     v-model="xmId"
     filterable
-    placeholder="请选择"
+    placeholder="请选择 项目名称"
     :loading="loading"
     :disabled="disabled"
     style="width: 100%;"

+ 121 - 0
src/option/techPerson/monthSjcyry.js

@@ -0,0 +1,121 @@
+export default {
+  height: 'auto',
+  calcHeight: 30,
+  tip: false,
+  searchShow: true,
+  searchMenuSpan: 6,
+  border: true,
+  index: true,
+  selection: true,
+  addBtn: true,
+  editBtn: false,
+  searchLabelWidth: 140,
+  labelWidth: 100,
+  menu: true,
+  dialogClickModal: false,
+  dialogWidth: 500,
+  dialogType: "drawer",
+  column: [
+    {
+      label: '研发项目编号',
+      prop: 'xmbh',
+      span: 24,
+      align: 'center',
+      width: 120,
+      showOverflowTooltip: true,
+      display: false,
+    },
+    {
+      label: '研发项目名称',
+      prop: 'xmmc',
+      span: 24,
+      search: true,
+      minWidth: 140,
+      align: 'center',
+      showOverflowTooltip: true,
+    },
+    {
+      label: '姓名',
+      prop: 'name',
+      span: 24,
+      width: 110,
+      align: 'center',
+      search: true,
+      showOverflowTooltip: true,
+    },
+    {
+      label: '工号',
+      prop: 'number',
+      span: 24,
+      width: 110,
+      align: 'center',
+      search: true,
+      showOverflowTooltip: true,
+      display: false
+    },
+    {
+      label: '身份证号',
+      prop: 'identityCard',
+      span: 24,
+      search: true,
+      width: 155,
+      align: 'center',
+      showOverflowTooltip: true,
+      display: false
+    },
+    {
+      label: '所属二级单位',
+      prop: 'secondaryUnit',
+      type: 'input',
+      span: 24,
+      width: 140,
+      search: true,
+      align: 'center',
+      showOverflowTooltip: true,
+      display: false
+    },
+    {
+      label: '部门/科室/项目部',
+      prop: 'department',
+      type: 'input',
+      span: 24,
+      width: 140,
+      search: true,
+      align: 'center',
+      showOverflowTooltip: true,
+      display: false
+    },
+    {
+      label: '用工性质',
+      prop: 'nature',
+      type: 'select',
+      span: 24,
+      width: 80,
+      align: 'center',
+      search: true,
+      dicUrl: '/api/kd-system/dict-biz/dictionary?code=yonggongxingzhi',
+      props: {
+        label: 'dictValue',
+        value: 'dictKey',
+      },
+      showOverflowTooltip: true,
+      display: false
+    },
+    {
+      label: '参研情况',
+      prop: 'situation',
+      type: 'select',
+      span: 24,
+      width: 70,
+      align: 'center',
+      search: true,
+      dicUrl: '/api/kd-system/dict-biz/dictionary?code=canyanqingkuang',
+      props: {
+        label: 'dictValue',
+        value: 'dictKey',
+      },
+      showOverflowTooltip: true,
+      display: false
+    }
+  ],
+};

+ 162 - 0
src/views/tech-person/month-cjcyry.vue

@@ -0,0 +1,162 @@
+<template>
+  <basic-container>
+    <avue-crud
+      ref="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="warning"
+          size="small"
+          plain
+          icon="el-icon-download"
+          @click="handleExport"
+        >
+          导出
+        </el-button>
+        <el-button
+          size="small"
+          type="primary"
+          @click="handleZjyyClick"
+        >
+          直接引用预算表名单
+        </el-button>
+        <print-table-btn @click="printTable" />
+        <div>
+          <year-month-select v-model="params.yearAndMonth" :showAllYear="false"></year-month-select>
+        </div>
+      </template>
+
+      <template slot="xmmcSearch">
+        <project-select placeholder="请选择项目名称" v-model="params.xmId"></project-select>
+      </template>
+
+      <template slot="xmmcForm">
+        <project-select placeholder="请选择项目名称" v-model="form.xmId" @change="handleProjectChange"></project-select>
+      </template>
+
+      <template slot="nameForm">
+        <el-select placeholder="请选择 参研人员姓名" v-model="form.tenantId" :disabled="!form.xmId">
+          <el-option v-for="item of technicianList" :key="item.id" :value="item.id" :label="item.name"></el-option>
+        </el-select>
+      </template>
+      
+    </avue-crud>
+
+    <WideTablePrinter
+      ref="printWideTable"
+      :columns="wideTableColumns"
+      :data="data"
+      :print-title="printTitle"
+      :rows-per-page="30"
+      :default-landscape="true"
+    />
+  </basic-container>
+</template>
+
+<script>
+import {exportBloByPost} from "@/api/common";
+import YearMonthSelect from "@/components/year-month-select";
+import moment from "moment";
+import NProgress from 'nprogress';
+import 'nprogress/nprogress.css';
+import {getToken} from "@/util/auth";
+import {downloadXls} from "@/util/util";
+import projectSelect from "@/components/project-select";
+import {getListByProDate} from "@/api/basicResource/technicianRoster";
+import {yyysbmd} from "@/api/techPerson/monthSjcyry"
+
+
+export default window.$crudCommon({
+  components: {
+    YearMonthSelect,
+    projectSelect
+  },
+  data() {
+    return {
+      params: {
+        yearAndMonth: moment(new Date()).format('YYYYMM'),
+      },
+
+      technicianList: [],
+
+      wideTableColumns: [],
+      printTitle: "",
+    };
+  },
+  watch: {
+    'params.yearAndMonth'(newVal) {
+      this.page.currentPage = 1;
+      this.getList(this.page);
+    },
+  },
+  methods: {
+    getFormData() {
+      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 }) => {
+        if (data.code == 200) {
+          this.$message.success("引用预算表成功");
+          this.page.currentPage = 1;
+          this.getList(this.page);
+        }
+      });
+    },
+    handleProjectChange(data) {
+      this.technicianList = [];
+      let startDate = moment(data.xmkssj).format('yyyyMM');
+      let endDate = moment(data.xmjssj).format('yyyyMM');
+
+      getListByProDate(startDate, endDate).then(({ data }) => {
+        if (data.code == 200) {
+          this.technicianList = data.data.records;
+        }
+      });
+    },
+    handleExport() {
+      this.$confirm("是否导出吗?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        NProgress.start();
+        exportBloByPost(`/api/kd-scientific/technician/xm/monthly/export?${this.website.tokenHeader}=${getToken()}`, this.params).then(res => {
+          downloadXls(res.data, `${this.params.yearAndMonth}实际参研人员.xlsx`);
+          NProgress.done();
+        })
+      });
+    },
+
+    printTable(isLandscape) {
+      this.wideTableColumns = this.$refs.crud.columnOption;
+      this.printTitle = `${this.params.yearAndMonth}实际参研人员`;
+      this.$nextTick(() => {
+        this.$refs.printWideTable.printTable(isLandscape);
+      })
+    }
+  },
+}, {
+  // 模块路径
+  name: 'techPerson/monthSjcyry',
+  res: ({ data }) => {
+    return data;
+  }
+});
+</script>