Browse Source

参研人员花名册接口联调

ljb 10 months ago
parent
commit
c2006fe5e3

+ 1 - 29
src/api/techPerson/cyPersonRoster.js

@@ -2,7 +2,7 @@ import request from '@/router/axios';
 
 
 export const getList = (current, size, params) => {
 export const getList = (current, size, params) => {
   return request({
   return request({
-    url: '/api/kd-scientific/technician/page',
+    url: '/api/kd-scientific/technician/cyryhmc',
     method: 'get',
     method: 'get',
     params: {
     params: {
       ...params,
       ...params,
@@ -11,31 +11,3 @@ export const getList = (current, size, params) => {
     }
     }
   })
   })
 }
 }
-
-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 = (ids) => {
-  return request({
-    url: '/api/kd-scientific/technician/remove',
-    method: 'post',
-    params: {
-      ids,
-    }
-  })
-}

+ 30 - 91
src/option/techPerson/cyPersonRoster.js

@@ -24,125 +24,78 @@ export default {
       children: [{
       children: [{
         label: '姓名',
         label: '姓名',
         prop: 'name',
         prop: 'name',
+        type: 'input',
         span: 12,
         span: 12,
         search: true,
         search: true,
-        width: 100,
+        width: 80,
         align: 'center',
         align: 'center',
         showOverflowTooltip: true,
         showOverflowTooltip: true,
-        rules: [
-          {
-            required: true,
-            message: '请输入姓名',
-            trigger: 'blur',
-          },
-        ],
       },
       },
       {
       {
         label: '工号',
         label: '工号',
         prop: 'number',
         prop: 'number',
+        type: 'input',
         span: 12,
         span: 12,
-        width: 130,
+        width: 90,
         align: 'center',
         align: 'center',
         search: true,
         search: true,
         showOverflowTooltip: true,
         showOverflowTooltip: true,
-        rules: [
-          {
-            required: true,
-            message: '请输入工号',
-            trigger: 'blur',
-          },
-        ],
       },
       },
       {
       {
         label: '身份证号',
         label: '身份证号',
         prop: 'idCard',
         prop: 'idCard',
+        type: 'input',
         span: 12,
         span: 12,
         search: true,
         search: true,
-        width: 155,
+        width: 150,
         align: 'center',
         align: 'center',
         showOverflowTooltip: true,
         showOverflowTooltip: true,
-        rules: [
-          {
-            required: true,
-            message: '请输入身份证号',
-            trigger: 'blur',
-          },
-        ],
       },
       },
       {
       {
         label: '所属二级单位',
         label: '所属二级单位',
         prop: 'secondaryUnit',
         prop: 'secondaryUnit',
         type: 'input',
         type: 'input',
         span: 12,
         span: 12,
-        width: 140,
+        width: 100,
         search: true,
         search: true,
         align: 'center',
         align: 'center',
         showOverflowTooltip: true,
         showOverflowTooltip: true,
-        rules: [
-          {
-            required: true,
-            message: '请输入所属二级单位',
-            trigger: 'blur',
-          },
-        ],
       },
       },
       {
       {
         label: '部门/科室/项目部',
         label: '部门/科室/项目部',
         prop: 'department',
         prop: 'department',
         type: 'input',
         type: 'input',
         span: 12,
         span: 12,
-        width: 140,
+        width: 120,
         search: true,
         search: true,
         align: 'center',
         align: 'center',
         showOverflowTooltip: true,
         showOverflowTooltip: true,
-        rules: [
-          {
-            required: true,
-            message: '请输入部门/科室/项目部',
-            trigger: 'blur',
-          },
-        ],
       },
       },
       {
       {
         label: '岗位职务',
         label: '岗位职务',
         prop: 'post',
         prop: 'post',
         type: 'input',
         type: 'input',
         span: 12,
         span: 12,
-        width: 100,
+        width: 80,
         align: 'center',
         align: 'center',
         search: true,
         search: true,
         showOverflowTooltip: true,
         showOverflowTooltip: true,
-        rules: [
-          {
-            required: true,
-            message: '请输入岗位职务',
-            trigger: 'blur',
-          },
-        ],
       },
       },
       {
       {
         label: '岗位所在地',
         label: '岗位所在地',
         prop: 'postLocation',
         prop: 'postLocation',
         type: 'input',
         type: 'input',
         span: 12,
         span: 12,
-        width: 100,
-        search: true,
-        showOverflowTooltip: true,
+        width: 90,
         align: 'center',
         align: 'center',
-        rules: [
-          {
-            required: true,
-            message: '请输入岗位所在地',
-            trigger: 'blur',
-          },
-        ],
+        showOverflowTooltip: true,
       },
       },
       {
       {
         label: '用工性质',
         label: '用工性质',
         prop: 'nature',
         prop: 'nature',
         type: 'select',
         type: 'select',
         span: 12,
         span: 12,
-        width: 80,
+        width: 70,
         align: 'center',
         align: 'center',
         search: true,
         search: true,
         dicUrl: '/api/kd-system/dict-biz/dictionary?code=yonggongxingzhi',
         dicUrl: '/api/kd-system/dict-biz/dictionary?code=yonggongxingzhi',
@@ -151,13 +104,6 @@ export default {
           value: 'dictKey',
           value: 'dictKey',
         },
         },
         showOverflowTooltip: true,
         showOverflowTooltip: true,
-        rules: [
-          {
-            required: true,
-            message: '请选择用工性质',
-            trigger: 'change',
-          },
-        ],
       },
       },
       {
       {
         label: '参研情况',
         label: '参研情况',
@@ -173,20 +119,13 @@ export default {
           value: 'dictKey',
           value: 'dictKey',
         },
         },
         showOverflowTooltip: true,
         showOverflowTooltip: true,
-        rules: [
-          {
-            required: true,
-            message: '请选择参研情况',
-            trigger: 'change',
-          },
-        ],
       },
       },
       {
       {
         label: '人员类型',
         label: '人员类型',
         prop: 'personnelType',
         prop: 'personnelType',
         type: 'select',
         type: 'select',
         span: 12,
         span: 12,
-        width: 80,
+        width: 70,
         align: 'center',
         align: 'center',
         search: true,
         search: true,
         dicUrl: '/api/kd-system/dict-biz/dictionary?code=renyuanleixing',
         dicUrl: '/api/kd-system/dict-biz/dictionary?code=renyuanleixing',
@@ -206,15 +145,15 @@ export default {
         prop: 'cyxm',
         prop: 'cyxm',
         span: 12,
         span: 12,
         width: 300,
         width: 300,
-        align: 'center',
+        showOverflowTooltip: true,
       }, {
       }, {
         label: '参研个数',
         label: '参研个数',
-        prop: 'cygs',
+        prop: 'situationCount',
         type: 'number',
         type: 'number',
         span: 12,
         span: 12,
-        width: 80,
+        width: 70,
         align: 'center',
         align: 'center',
-        search: true
+        search: true,
       }]
       }]
     },
     },
     {
     {
@@ -223,63 +162,63 @@ export default {
       align: 'center',
       align: 'center',
       children: [{
       children: [{
         label: '1月',
         label: '1月',
-        prop: 'one',
+        prop: '1',
         type: 'number',
         type: 'number',
         span: 12,
         span: 12,
         width: 50,
         width: 50,
         align: 'center',
         align: 'center',
       }, {
       }, {
         label: '2月',
         label: '2月',
-        prop: 'two',
+        prop: '2',
         type: 'number',
         type: 'number',
         span: 12,
         span: 12,
         width: 50,
         width: 50,
         align: 'center',
         align: 'center',
       }, {
       }, {
         label: '3月',
         label: '3月',
-        prop: 'two',
+        prop: '3',
         type: 'number',
         type: 'number',
         span: 12,
         span: 12,
         width: 50,
         width: 50,
         align: 'center',
         align: 'center',
       }, {
       }, {
         label: '4月',
         label: '4月',
-        prop: 'two',
+        prop: '4',
         type: 'number',
         type: 'number',
         span: 12,
         span: 12,
         width: 50,
         width: 50,
         align: 'center',
         align: 'center',
       }, {
       }, {
         label: '5月',
         label: '5月',
-        prop: 'two',
+        prop: '5',
         type: 'number',
         type: 'number',
         span: 12,
         span: 12,
         width: 50,
         width: 50,
         align: 'center',
         align: 'center',
       }, {
       }, {
         label: '6月',
         label: '6月',
-        prop: 'two',
+        prop: '6',
         type: 'number',
         type: 'number',
         span: 12,
         span: 12,
         width: 50,
         width: 50,
         align: 'center',
         align: 'center',
       }, {
       }, {
         label: '7月',
         label: '7月',
-        prop: 'two',
+        prop: '7',
         type: 'number',
         type: 'number',
         span: 12,
         span: 12,
         width: 50,
         width: 50,
         align: 'center',
         align: 'center',
       }, {
       }, {
         label: '8月',
         label: '8月',
-        prop: 'two',
-       type: 'number',
+        prop: '8',
+        type: 'number',
         span: 12,
         span: 12,
         width: 50,
         width: 50,
         align: 'center',
         align: 'center',
       }, {
       }, {
         label: '9月',
         label: '9月',
-        prop: 'two',
+        prop: '9',
         type: 'number',
         type: 'number',
         span: 12,
         span: 12,
         width: 50,
         width: 50,
@@ -289,21 +228,21 @@ export default {
         // }
         // }
       }, {
       }, {
         label: '10月',
         label: '10月',
-        prop: 'two',
+        prop: '10',
         type: 'number',
         type: 'number',
         span: 12,
         span: 12,
         width: 50,
         width: 50,
         align: 'center',
         align: 'center',
       }, {
       }, {
         label: '11月',
         label: '11月',
-        prop: 'two',
+        prop: '11',
         type: 'number',
         type: 'number',
         span: 12,
         span: 12,
         width: 50,
         width: 50,
         align: 'center',
         align: 'center',
       }, {
       }, {
         label: '12月',
         label: '12月',
-        prop: 'two',
+        prop: '12',
         type: 'number',
         type: 'number',
         span: 12,
         span: 12,
         width: 50,
         width: 50,

+ 25 - 5
src/views/tech-person/cy-person-roster.vue

@@ -26,8 +26,13 @@
         <el-input v-model="params.cygs" />
         <el-input v-model="params.cygs" />
       </template>
       </template>
 
 
-      <template #name="scope">
-        <span style="color: blue;">{{scope.row.name}}</span>
+      <template slot="situationCountSearch">
+        <div style="display: flex; align-items: center;">
+          <span>参研个数:</span>
+          <avue-input-number v-model="params.situationCountMin" :min="0" style="width: 100px !important;"></avue-input-number>
+          <span style="width: 20px; text-align: center;">至</span>
+          <avue-input-number v-model="params.situationCountMax" :min="0" style="width: 100px !important;"></avue-input-number>
+        </div>
       </template>
       </template>
       
       
     </avue-crud>
     </avue-crud>
@@ -74,7 +79,6 @@ export default window.$crudCommon({
     }
     }
   },
   },
   methods: {
   methods: {
-    loadData() {},
     handleExport() {
     handleExport() {
       this.$confirm("是否导出吗?", "提示", {
       this.$confirm("是否导出吗?", "提示", {
         confirmButtonText: "确定",
         confirmButtonText: "确定",
@@ -82,7 +86,7 @@ export default window.$crudCommon({
         type: "warning"
         type: "warning"
       }).then(() => {
       }).then(() => {
         NProgress.start();
         NProgress.start();
-        exportBloByPost(`/api/kd-scientific/technician/export?${this.website.tokenHeader}=${getToken()}`, this.params).then(res => {
+        exportBloByPost(`/api/kd-scientific/technician/cyryhmc/export?${this.website.tokenHeader}=${getToken()}`, this.params).then(res => {
           downloadXls(res.data, `${this.params.yearAndMonth}参研人员花名册.xlsx`);
           downloadXls(res.data, `${this.params.yearAndMonth}参研人员花名册.xlsx`);
           NProgress.done();
           NProgress.done();
         })
         })
@@ -102,6 +106,22 @@ export default window.$crudCommon({
   },
   },
 }, {
 }, {
   // 模块路径
   // 模块路径
-  name: 'techPerson/cyPersonRoster'
+  name: 'techPerson/cyPersonRoster',
+  res: ({ data }) => {
+    data.records = data.records.map(item => {
+      let cyxmList = item.xmList.map(item => item.xmmc);
+      item.cyxm = cyxmList.join(';');
+      item.situationCount = item.xmList.length;
+
+      item.hoursList = item.hoursList.forEach(hourItem => {
+        item[Number(hourItem.workDate.substring(hourItem.workDate.length - 2))] = hourItem.workHours;
+      });
+
+
+      return item;
+    });
+
+    return data;
+  }
 });
 });
 </script>
 </script>