Browse Source

Merge branch 'kd-dev' of https://gitee.com/zhoulisky/kd-web into kd-dev

zhouli 10 months ago
parent
commit
6e1cef15c1

+ 1 - 29
src/api/techPerson/highTechPersonSumList.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/ndgkjryhzb',
     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,
-    }
-  })
-}

+ 1 - 1
src/api/yfCostManage/yfCostStatistics/yfWorkHoursAllocationList.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/page',
+    url: '/api/kd-scientific/xm/technician/hours/myyfgsfpb',
     method: 'get',
     method: 'get',
     params: {
     params: {
       ...params,
       ...params,

+ 1 - 0
src/option/techPerson/cyPersonRoster.js

@@ -10,6 +10,7 @@ export default {
   selection: true,
   selection: true,
   addBtn: false,
   addBtn: false,
   delBtn: false,
   delBtn: false,
+  menu: false,
   searchLabelWidth: 140,
   searchLabelWidth: 140,
   labelWidth: 140,
   labelWidth: 140,
   menuWidth: 160,
   menuWidth: 160,

+ 17 - 24
src/option/techPerson/highTechPersonSumList.js

@@ -8,8 +8,8 @@ export default {
   index: true,
   index: true,
   addBtn: false,
   addBtn: false,
   viewBtn: true,
   viewBtn: true,
-  printBtn: true,
   selection: true,
   selection: true,
+  menu: false,
   searchLabelWidth: 140,
   searchLabelWidth: 140,
   labelWidth: 140,
   labelWidth: 140,
   menuWidth: 220,
   menuWidth: 220,
@@ -23,7 +23,7 @@ export default {
       type: 'input',
       type: 'input',
       span: 12,
       span: 12,
       search: true,
       search: true,
-      width: 100,
+      width: 80,
       align: 'center',
       align: 'center',
       showOverflowTooltip: true,
       showOverflowTooltip: true,
       rules: [
       rules: [
@@ -39,7 +39,7 @@ export default {
       prop: 'number',
       prop: 'number',
       type: 'input',
       type: 'input',
       span: 12,
       span: 12,
-      width: 160,
+      width: 90,
       align: 'center',
       align: 'center',
       search: true,
       search: true,
       showOverflowTooltip: true,
       showOverflowTooltip: true,
@@ -57,7 +57,7 @@ export default {
       type: 'input',
       type: 'input',
       span: 12,
       span: 12,
       search: true,
       search: true,
-      width: 160,
+      width: 150,
       align: 'center',
       align: 'center',
       showOverflowTooltip: true,
       showOverflowTooltip: true,
       // rules: [
       // rules: [
@@ -111,7 +111,7 @@ export default {
       prop: 'ethnic',
       prop: 'ethnic',
       type: 'input',
       type: 'input',
       span: 12,
       span: 12,
-      width: 120,
+      width: 80,
       align: 'center',
       align: 'center',
       showOverflowTooltip: true,
       showOverflowTooltip: true,
       rules: [
       rules: [
@@ -127,7 +127,7 @@ export default {
       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,
@@ -144,7 +144,7 @@ export default {
       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,
@@ -217,7 +217,7 @@ export default {
       type: 'datetime',
       type: 'datetime',
       valueFormat: 'yyyy-MM-dd HH:mm:ss',
       valueFormat: 'yyyy-MM-dd HH:mm:ss',
       span: 12,
       span: 12,
-      width: 140,
+      width: 90,
       align: 'center',
       align: 'center',
       search: true,
       search: true,
       showOverflowTooltip: true,
       showOverflowTooltip: true,
@@ -256,7 +256,7 @@ export default {
       prop: 'degree',
       prop: 'degree',
       type: 'select',
       type: 'select',
       span: 12,
       span: 12,
-      width: 90,
+      width: 70,
       align: 'center',
       align: 'center',
       search: true,
       search: true,
       dicUrl: '/api/kd-system/dict-biz/dictionary?code=xuewei',
       dicUrl: '/api/kd-system/dict-biz/dictionary?code=xuewei',
@@ -278,7 +278,7 @@ export default {
       prop: 'schoolName',
       prop: 'schoolName',
       type: 'input',
       type: 'input',
       span: 12,
       span: 12,
-      width: 160,
+      width: 130,
       align: 'center',
       align: 'center',
       showOverflowTooltip: true,
       showOverflowTooltip: true,
       rules: [
       rules: [
@@ -294,7 +294,7 @@ export default {
       prop: 'major',
       prop: 'major',
       type: 'input',
       type: 'input',
       span: 12,
       span: 12,
-      width: 140,
+      width: 120,
       align: 'center',
       align: 'center',
       showOverflowTooltip: true,
       showOverflowTooltip: true,
       rules: [
       rules: [
@@ -310,7 +310,7 @@ export default {
       prop: 'rank',
       prop: 'rank',
       type: 'select',
       type: 'select',
       span: 12,
       span: 12,
-      width: 120,
+      width: 100,
       align: 'center',
       align: 'center',
       search: true,
       search: true,
       dicUrl: '/api/kd-system/dict-biz/dictionary?code=zhicheng',
       dicUrl: '/api/kd-system/dict-biz/dictionary?code=zhicheng',
@@ -332,7 +332,7 @@ export default {
       prop: 'practicingRequirement',
       prop: 'practicingRequirement',
       type: 'input',
       type: 'input',
       span: 12,
       span: 12,
-      width: 100,
+      width: 80,
       align: 'center',
       align: 'center',
       search: true,
       search: true,
       showOverflowTooltip: true,
       showOverflowTooltip: true,
@@ -349,7 +349,7 @@ export default {
       prop: 'situation',
       prop: 'situation',
       type: 'select',
       type: 'select',
       span: 12,
       span: 12,
-      width: 100,
+      width: 80,
       align: 'center',
       align: 'center',
       search: true,
       search: true,
       dicUrl: '/api/kd-system/dict-biz/dictionary?code=canyanqingkuang',
       dicUrl: '/api/kd-system/dict-biz/dictionary?code=canyanqingkuang',
@@ -371,7 +371,7 @@ export default {
       prop: 'personnelType',
       prop: 'personnelType',
       type: 'select',
       type: 'select',
       span: 12,
       span: 12,
-      width: 100,
+      width: 80,
       align: 'center',
       align: 'center',
       dicUrl: '/api/kd-system/dict-biz/dictionary?code=renyuanleixing',
       dicUrl: '/api/kd-system/dict-biz/dictionary?code=renyuanleixing',
       props: {
       props: {
@@ -397,21 +397,14 @@ export default {
     },
     },
     {
     {
       label: '本年度从事研发工作天数',
       label: '本年度从事研发工作天数',
-      prop: 'yfts',
+      prop: 'workDaysByYear',
       type: 'number',
       type: 'number',
       span: 12,
       span: 12,
-      width: 170,
+      width: 160,
       align: 'center',
       align: 'center',
       fixed: 'right',
       fixed: 'right',
       showOverflowTooltip: true,
       showOverflowTooltip: true,
       editDisplay: false,
       editDisplay: false,
-      rules: [
-        {
-          required: true,
-          message: '请输入本年度从事研发工作天数',
-          trigger: 'change',
-        },
-      ],
     },
     },
   ],
   ],
 };
 };

+ 1 - 1
src/option/yfCostManage/yfCostStatistics/yfWorkHoursAllocationList.js

@@ -7,7 +7,7 @@ export default {
   border: true,
   border: true,
   index: true,
   index: true,
   addBtn: false,
   addBtn: false,
-  selection: true,
+  selection: false,
   searchLabelWidth: 140,
   searchLabelWidth: 140,
   labelWidth: 100,
   labelWidth: 100,
   menuWidth: 180,
   menuWidth: 180,

+ 0 - 1
src/views/tech-person/cy-person-sum-list.vue

@@ -124,7 +124,6 @@ export default window.$crudCommon({
         });
         });
       });
       });
     });
     });
-    console.log(newList)
     data.records = newList;
     data.records = newList;
     return data;
     return data;
   }
   }

+ 2 - 33
src/views/tech-person/high-tech-person-sum-list.vue

@@ -11,24 +11,6 @@
     >
     >
       <template slot="menuLeft">
       <template slot="menuLeft">
         <el-button
         <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"
           type="warning"
           size="small"
           size="small"
           plain
           plain
@@ -46,8 +28,6 @@
       
       
     </avue-crud>
     </avue-crud>
 
 
-    <upload-excel-dialog ref="uploadExcelDialog" :uploadAfter="uploadAfter"/>
-
     <WideTablePrinter
     <WideTablePrinter
       ref="printWideTable"
       ref="printWideTable"
       :columns="wideTableColumns"
       :columns="wideTableColumns"
@@ -60,9 +40,8 @@
 </template>
 </template>
 
 
 <script>
 <script>
-import {exportBloByPost} from "@/api/common";
+import {exportBlob} from "@/api/common";
 import YearMonthSelect from "@/components/year-month-select";
 import YearMonthSelect from "@/components/year-month-select";
-import UploadExcelDialog from "@/components/upload-excel-dialog";
 import moment from "moment";
 import moment from "moment";
 import {getToken} from "@/util/auth";
 import {getToken} from "@/util/auth";
 import {downloadXls} from "@/util/util";
 import {downloadXls} from "@/util/util";
@@ -71,7 +50,6 @@ import {downloadXls} from "@/util/util";
 export default window.$crudCommon({
 export default window.$crudCommon({
   components: {
   components: {
     YearMonthSelect,
     YearMonthSelect,
-    UploadExcelDialog
   },
   },
   data() {
   data() {
     return {
     return {
@@ -90,17 +68,8 @@ export default window.$crudCommon({
     }
     }
   },
   },
   methods: {
   methods: {
-    loadData() {},
-    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() {
     handleExport() {
-      exportBloByPost(`/api/kd-scientific/technician/export?${this.website.tokenHeader}=${getToken()}`, this.params).then(res => {
+      exportBlob(`/api/kd-scientific/technician/ndgkjryhzb/export?${this.website.tokenHeader}=${getToken()}`, this.params).then(res => {
         downloadXls(res.data, `${this.params.yearAndMonth}年度高新科技人员汇总表.xlsx`);
         downloadXls(res.data, `${this.params.yearAndMonth}年度高新科技人员汇总表.xlsx`);
       });
       });
     },
     },

+ 0 - 2
src/views/yf-cost-manage/basic-data-setting/working-hours-records.vue

@@ -196,8 +196,6 @@ export default window.$crudCommon({
         }
         }
       });
       });
 
 
-      console.log(dailyAttendances)
-
       // 获取最新修改过的数据
       // 获取最新修改过的数据
       let updatedMonthData = [];
       let updatedMonthData = [];
       dailyAttendances.forEach(item => {
       dailyAttendances.forEach(item => {

+ 67 - 43
src/views/yf-cost-manage/yf-cost-statistics/person-cost-statistics/yf-work-hours-allocation-list.vue

@@ -5,9 +5,7 @@
       v-on="onEvent"
       v-on="onEvent"
       v-model="form"
       v-model="form"
       :page.sync="page"
       :page.sync="page"
-      :before-open="handleBeforeOpen"
       :header-cell-style="headerCellStyle" 
       :header-cell-style="headerCellStyle" 
-      :span-method="spanMethod"
     >
     >
       <template slot="menuLeft">
       <template slot="menuLeft">
         <el-button
         <el-button
@@ -25,7 +23,35 @@
           <year-month-select v-model="params.yearAndMonth" :showAllYear="false"></year-month-select>
           <year-month-select v-model="params.yearAndMonth" :showAllYear="false"></year-month-select>
         </div>
         </div>
       </template>
       </template>
-      
+
+      <template slot="gslb" slot-scope="{ row }">
+        <div v-if="row.dailyHoursList.length" class="custom-cell">
+          <div class="custom-cell-line">研发工时</div>
+          <div class="custom-cell-line">非研发工时</div>
+        </div>
+      </template>
+
+      <template v-for="col of allMonthCols" :slot="col" slot-scope="{ row }">
+        <div v-if="row.dailyHoursList.length" class="custom-cell" :key="col">
+          <div class="custom-cell-line">{{ row.dailyHoursList[0] ? row.dailyHoursList[0][col] : '' }}</div>
+          <div class="custom-cell-line">{{ row.dailyHoursList[1] ? row.dailyHoursList[1][col] : '' }}</div>
+        </div>
+      </template>
+
+      <template slot="hoursTotal" slot-scope="{ row }">
+        <div v-if="row.dailyHoursList.length" class="custom-cell">
+          <div class="custom-cell-line">{{ row.workHoursTotal }}</div>
+          <div class="custom-cell-line">{{ row.unworkHoursTotal }}</div>
+        </div>
+      </template>
+
+      <template slot="hoursRate" slot-scope="{ row }">
+        <div v-if="row.dailyHoursList.length" class="custom-cell">
+          <div class="custom-cell-line">{{ row.workHoursRate }}</div>
+          <div class="custom-cell-line">{{ row.unworkHoursRate }}</div>
+        </div>
+      </template>
+
     </avue-crud>
     </avue-crud>
 
 
     <WideTablePrinter
     <WideTablePrinter
@@ -62,6 +88,8 @@ export default window.$crudCommon({
 
 
       wideTableColumns: [],
       wideTableColumns: [],
       printTitle: "",
       printTitle: "",
+
+      allMonthCols: [],
     };
     };
   },
   },
   watch: {
   watch: {
@@ -79,33 +107,12 @@ export default window.$crudCommon({
     this.option.column = deepClone(this.defaultColumns);
     this.option.column = deepClone(this.defaultColumns);
   },
   },
   methods: {
   methods: {
-    loadData() {},
-    spanMethod({ row, column, rowIndex, columnIndex }) {
-      let fields = ["xm", "number", "idCard", "personnelType"];
-      let cellValue = row[column.property];
-      if (cellValue && fields.includes(column.property)) {
-        let prevRow = this.data[rowIndex - 1];
-        let nextRow = this.data[rowIndex + 1];
-        if (prevRow && prevRow[column.property] === cellValue) {
-          return { rowspan: 0, colspan: 0 };
-        } else {
-          let countRowspan = 1;
-          while (nextRow && nextRow[column.property] === cellValue) {
-            nextRow = this.data[++countRowspan + rowIndex];
-          }
-          if (countRowspan > 1) {
-            row.hbFlag = true;
-            return { rowspan: countRowspan, colspan: 1 };
-          }
-        }
-      }
-    },
     refreshTableCol(yearAndMonth) {
     refreshTableCol(yearAndMonth) {
       let yearMonth = moment(yearAndMonth).format("YYYY-MM").split("-");
       let yearMonth = moment(yearAndMonth).format("YYYY-MM").split("-");
       const monthDays = getMonthDatesWithMarkers(Number(yearMonth[0]), Number(yearMonth[1]));
       const monthDays = getMonthDatesWithMarkers(Number(yearMonth[0]), Number(yearMonth[1]));
 
 
       let newColumns = deepClone(this.defaultColumns);
       let newColumns = deepClone(this.defaultColumns);
-
+      this.allMonthCols = [];
       monthDays.forEach((item) => {
       monthDays.forEach((item) => {
         let col = {
         let col = {
           prop: moment(item.dateString).format('yyyyMMDD'),
           prop: moment(item.dateString).format('yyyyMMDD'),
@@ -124,16 +131,17 @@ export default window.$crudCommon({
           col.labelClassName = 'red';
           col.labelClassName = 'red';
         }
         }
         newColumns.push(col);
         newColumns.push(col);
+        this.allMonthCols.push(moment(item.dateString).format('yyyyMMDD'));
       });
       });
       newColumns.push({
       newColumns.push({
-        prop: "hj",
+        prop: "hoursTotal",
         label: "合计",
         label: "合计",
-        width: 60,
+        width: 50,
         align: 'center',
         align: 'center',
         showOverflowTooltip: true,
         showOverflowTooltip: true,
         display: false,
         display: false,
       }, {
       }, {
-        prop: "gsfpl",
+        prop: "hoursRate",
         label: "工时分配率",
         label: "工时分配率",
         width: 60,
         width: 60,
         align: 'center',
         align: 'center',
@@ -141,10 +149,10 @@ export default window.$crudCommon({
         display: false,
         display: false,
       });
       });
 
 
-      this.option.column = newColumns;
+      this.option.column = [...newColumns];
     },
     },
     handleExport() {
     handleExport() {
-      exportBlob(`/api/kd-scientific/attendance/export?${this.website.tokenHeader}=${getToken()}`, this.params).then(res => {
+      exportBlob(`/api/kd-scientific/xm/technician/hours/myyfgsfpb/export?${this.website.tokenHeader}=${getToken()}`, this.params).then(res => {
         downloadXls(res.data, `${this.params.yearAndMonth}研发工时分配表.xlsx`);
         downloadXls(res.data, `${this.params.yearAndMonth}研发工时分配表.xlsx`);
       });
       });
     },
     },
@@ -170,21 +178,37 @@ export default window.$crudCommon({
   // 模块路径
   // 模块路径
   name: 'yfCostManage/yfCostStatistics/yfWorkHoursAllocationList',
   name: 'yfCostManage/yfCostStatistics/yfWorkHoursAllocationList',
   res: ({ data }) => {
   res: ({ data }) => {
-    let newList = [];
-    data.records.forEach((item) => {
-      let objData = {
-        ...item,
-        id: item.unicode,
-        monthlyHours: (item.monthlyHours || 0).toFixed(1),
-        monthlyDays: (item.monthlyDays || 0).toFixed(1)
-      };
-      item.dailyAttendances.forEach(hourItem => {
-        objData[hourItem.workDate] = (hourItem.workHours || 0).toFixed(1);
-      });
-      newList.push(objData);
+    data.records = data.records.map(item => {
+      if (item.dailyHoursList && item.dailyHoursList.length) {
+        let newDailyHoursList = [
+          {gslb: '研发工时', hoursTotal: item.workHoursTotal, hoursRate: (item.workHoursRate * 100).toFixed(2)},
+          {gslb: '非研发工时', hourTotal: item.unworkHoursTotal, hoursRate: (item.unworkHoursRate * 100).toFixed(2)}
+        ];
+        item.dailyHoursList.forEach(hourItem => {
+          newDailyHoursList[0][hourItem.workDate] = hourItem.workHours;
+          newDailyHoursList[1][hourItem.workDate] = hourItem.unworkHours;
+        });
+
+        item.dailyHoursList = newDailyHoursList;
+        item.workHoursRate = (item.workHoursRate * 100).toFixed(2);
+        item.unworkHoursRate = (item.unworkHoursRate * 100).toFixed(2);
+      }
+      return item;
     });
     });
-    data.records = newList;
     return data;
     return data;
   },
   },
 });
 });
 </script>
 </script>
+
+<style lang="scss" scoped>
+.custom-cell {
+  margin: 0 -10px;
+  &-line {
+    border-bottom: 1px solid #EBEEF5;
+    line-height: 24px;
+    &:last-child {
+      border-bottom: 0;
+    }
+  }
+}
+</style>