Browse Source

处理动态月份表格bug

ljb 8 months ago
parent
commit
9d5f64153c

+ 1 - 49
src/option/yfCostManage/basicDataSetting/attenInfo.js

@@ -16,54 +16,6 @@ export default {
   dialogWidth: 500,
   dialogWidth: 500,
   dialogType: "drawer",
   dialogType: "drawer",
   column: [
   column: [
-    {
-      label: '姓名',
-      prop: 'name',
-      span: 24,
-      search: true,
-      width: 90,
-      align: 'center',
-      type: 'input',
-      showOverflowTooltip: true,
-      disabled: true,
-    },
-    {
-      label: '工号',
-      prop: 'number',
-      type: 'input',
-      span: 24,
-      width: 90,
-      align: 'center',
-      search: true,
-      showOverflowTooltip: true,
-      disabled: true,
-    },
-    {
-      label: '身份证号',
-      prop: 'idCard',
-      type: 'input',
-      span: 24,
-      search: true,
-      width: 150,
-      align: 'center',
-      showOverflowTooltip: true,
-      disabled: true,
-    },
-    {
-      label: '科研人员类别',
-      prop: 'personnelType',
-      type: 'select',
-      span: 24,
-      width: 100,
-      align: 'center',
-      search: true,
-      dicUrl: '/api/kd-system/dict/dictionary?code=renyuanleixing',
-      props: {
-        label: 'dictValue',
-        value: 'dictKey',
-      },
-      showOverflowTooltip: true,
-      disabled: true,
-    },
+    
   ],
   ],
 };
 };

+ 1 - 93
src/option/yfCostManage/basicDataSetting/devWorkHoursRegister.js

@@ -16,98 +16,6 @@ export default {
   dialogWidth: 500,
   dialogWidth: 500,
   dialogType: "drawer",
   dialogType: "drawer",
   column: [
   column: [
-    {
-      label: '研发项目编号',
-      prop: 'xmbh',
-      span: 24,
-      width: 100,
-      align: 'center',
-      type: 'input',
-      showOverflowTooltip: true,
-      disabled: true,
-    },
-    {
-      label: '研发项目名称',
-      prop: 'xmmc',
-      type: 'input',
-      span: 24,
-      width: 110,
-      align: 'center',
-      search: true,
-      showOverflowTooltip: true,
-      disabled: true,
-    },
-    {
-      label: '资产编码',
-      prop: 'zcbm',
-      type: 'input',
-      span: 24,
-      width: 90,
-      align: 'center',
-      showOverflowTooltip: true,
-      disabled: true,
-    },
-    {
-      label: '资产名称',
-      prop: 'zcmc',
-      span: 24,
-      width: 110,
-      align: 'center',
-      search: true,
-      showOverflowTooltip: true,
-      disabled: true,
-    },
-    {
-      label: '资产类别',
-      prop: 'zclb',
-      type: 'select',
-      span: 24,
-      width: 70,
-      align: 'center',
-      dicUrl: '/api/kd-system/dict/dictionary?code=zclb',
-      props: {
-        label: 'dictValue',
-        value: 'dictKey',
-      },
-      showOverflowTooltip: true,
-      disabled: true,
-    },
-    {
-      label: '用途',
-      prop: 'yt',
-      type: 'select',
-      span: 24,
-      width: 60,
-      align: 'center',
-      search: true,
-      dicUrl: '/api/kd-system/dict/dictionary?code=zcyt',
-      props: {
-        label: 'dictValue',
-        value: 'dictKey',
-      },
-      showOverflowTooltip: true,
-      disabled: true,
-    },
-    {
-      label: '总工时',
-      prop: 'zgs',
-      type: 'number',
-      precision: 1,
-      min: 0,
-      width: 50,
-      align: 'center',
-      showOverflowTooltip: true,
-    },
-    {
-      label: '使用工时',
-      prop: 'monthlyHours',
-      type: 'number',
-      span: 24,
-      width: 50,
-      align: 'center',
-      showOverflowTooltip: true,
-      display: false,
-      search: true,
-    },
+    
   ],
   ],
 };
 };

+ 92 - 92
src/option/yfCostManage/basicDataSetting/workHoursRecords.js

@@ -16,97 +16,97 @@ export default {
   dialogWidth: 500,
   dialogWidth: 500,
   dialogType: "drawer",
   dialogType: "drawer",
   column: [
   column: [
-    {
-      label: '研发项目编号',
-      prop: 'xmbh',
-      span: 24,
-      width: 100,
-      align: 'center',
-      type: 'input',
-      showOverflowTooltip: true,
-      disabled: true,
-    },
-    {
-      label: '研发项目名称',
-      prop: 'xmmc',
-      type: 'input',
-      span: 24,
-      width: 110,
-      align: 'center',
-      search: true,
-      showOverflowTooltip: true,
-      disabled: true,
-    },
-    {
-      label: '姓名',
-      prop: 'name',
-      span: 24,
-      search: true,
-      width: 90,
-      cell: true,
-      align: 'center',
-      // type: 'select',
-      showOverflowTooltip: true,
-      // dicUrl: '',
-      // dicFlag: true,
-      // dicFormatter:(res)=>{     
-      //   return res.data.records
-      // },
-      // dicQuery: {
-      //   current: 1,
-      //   size: 99999,
-      //   yearAndMonth: ''
-      // },
-      // props: {
-      //   label: 'name',
-      //   value: 'id',
-      // },
-      disabled: true,
-      rules: [
-        {
-          required: true,
-          message: '请选择技术人员',
-          trigger: 'blur',
-        },
-      ],
-    },
-    {
-      label: '工号',
-      prop: 'number',
-      type: 'input',
-      span: 24,
-      width: 90,
-      align: 'center',
-      search: true,
-      disabled: true,
-      showOverflowTooltip: true,
-    },
-    {
-      label: '身份证号',
-      prop: 'idCard',
-      type: 'input',
-      span: 24,
-      search: true,
-      disabled: true,
-      width: 150,
-      align: 'center',
-      showOverflowTooltip: true,
-    },
-    {
-      label: '科研人员类别',
-      prop: 'personnelType',
-      type: 'select',
-      span: 24,
-      width: 100,
-      align: 'center',
-      search: true,
-      disabled: true,
-      dicUrl: '/api/kd-system/dict/dictionary?code=renyuanleixing',
-      props: {
-        label: 'dictValue',
-        value: 'dictKey',
-      },
-      showOverflowTooltip: true,
-    },
+    // {
+    //   label: '研发项目编号',
+    //   prop: 'xmbh',
+    //   span: 24,
+    //   width: 100,
+    //   align: 'center',
+    //   type: 'input',
+    //   showOverflowTooltip: true,
+    //   disabled: true,
+    // },
+    // {
+    //   label: '研发项目名称',
+    //   prop: 'xmmc',
+    //   type: 'input',
+    //   span: 24,
+    //   width: 110,
+    //   align: 'center',
+    //   search: true,
+    //   showOverflowTooltip: true,
+    //   disabled: true,
+    // },
+    // {
+    //   label: '姓名',
+    //   prop: 'name',
+    //   span: 24,
+    //   search: true,
+    //   width: 90,
+    //   cell: true,
+    //   align: 'center',
+    //   // type: 'select',
+    //   showOverflowTooltip: true,
+    //   // dicUrl: '',
+    //   // dicFlag: true,
+    //   // dicFormatter:(res)=>{     
+    //   //   return res.data.records
+    //   // },
+    //   // dicQuery: {
+    //   //   current: 1,
+    //   //   size: 99999,
+    //   //   yearAndMonth: ''
+    //   // },
+    //   // props: {
+    //   //   label: 'name',
+    //   //   value: 'id',
+    //   // },
+    //   disabled: true,
+    //   rules: [
+    //     {
+    //       required: true,
+    //       message: '请选择技术人员',
+    //       trigger: 'blur',
+    //     },
+    //   ],
+    // },
+    // {
+    //   label: '工号',
+    //   prop: 'number',
+    //   type: 'input',
+    //   span: 24,
+    //   width: 90,
+    //   align: 'center',
+    //   search: true,
+    //   disabled: true,
+    //   showOverflowTooltip: true,
+    // },
+    // {
+    //   label: '身份证号',
+    //   prop: 'idCard',
+    //   type: 'input',
+    //   span: 24,
+    //   search: true,
+    //   disabled: true,
+    //   width: 150,
+    //   align: 'center',
+    //   showOverflowTooltip: true,
+    // },
+    // {
+    //   label: '科研人员类别',
+    //   prop: 'personnelType',
+    //   type: 'select',
+    //   span: 24,
+    //   width: 100,
+    //   align: 'center',
+    //   search: true,
+    //   disabled: true,
+    //   dicUrl: '/api/kd-system/dict/dictionary?code=renyuanleixing',
+    //   props: {
+    //     label: 'dictValue',
+    //     value: 'dictKey',
+    //   },
+    //   showOverflowTooltip: true,
+    // },
   ],
   ],
 };
 };

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

@@ -16,62 +16,6 @@ export default {
   dialogWidth: 500,
   dialogWidth: 500,
   dialogType: "drawer",
   dialogType: "drawer",
   column: [
   column: [
-    {
-      label: '姓名',
-      prop: 'name',
-      span: 24,
-      search: true,
-      width: 90,
-      align: 'center',
-      type: 'input',
-      showOverflowTooltip: true,
-      disabled: true,
-    },
-    {
-      label: '工号',
-      prop: 'number',
-      type: 'input',
-      span: 24,
-      width: 90,
-      align: 'center',
-      search: true,
-      showOverflowTooltip: true,
-      disabled: true,
-    },
-    {
-      label: '身份证号',
-      prop: 'idCard',
-      type: 'input',
-      span: 24,
-      search: true,
-      width: 150,
-      align: 'center',
-      showOverflowTooltip: true,
-      disabled: true,
-    },
-    {
-      label: '科研人员类别',
-      prop: 'personnelType',
-      type: 'select',
-      span: 24,
-      width: 100,
-      align: 'center',
-      search: true,
-      dicUrl: '/api/kd-system/dict/dictionary?code=renyuanleixing',
-      props: {
-        label: 'dictValue',
-        value: 'dictKey',
-      },
-      showOverflowTooltip: true,
-      disabled: true,
-    },
-    {
-      label: '类别',
-      prop: 'gslb',
-      span: 24,
-      width: 90,
-      align: 'center',
-      showOverflowTooltip: true,
-    },
+    
   ],
   ],
 };
 };

+ 6 - 80
src/printOption/RDSystemManage/list.js

@@ -9,101 +9,27 @@ const dict = [{
 }];
 }];
 
 
 export default {
 export default {
-  height: 'auto',
-  calcHeight: 30,
-  tip: false,
-  searchShow: true,
-  searchMenuSpan: 6,
-  border: true,
-  index: true,
-  delBtn: false,
-  searchLabelWidth: 160,
-  labelWidth: 145,
-  menuWidth: 160,
-  dialogClickModal: false,
-  dialogType: "drawer",
-  dialogWidth: 520,
-  addBtnText: "上传制度",
   column: [
   column: [
     {
     {
       label: '文件类型',
       label: '文件类型',
       prop: 'wjlx',
       prop: 'wjlx',
-      type: 'select',
-      span: 24,
-      search: true,
-      dicUrl: '/api/kd-system/dict/dictionary?code=system_doc_type',
-      editDisabled: true,
-      props: {
-        label: 'dictValue',
-        value: 'dictKey',
-      },
-      rules: [
-        {
-          required: true,
-          message: '请选择文件类型',
-          trigger: 'blur',
-        },
-      ],
+      width: 300,
     },
     },
     {
     {
       label: '企业制度的文件名称',
       label: '企业制度的文件名称',
       prop: 'zdwjdz',
       prop: 'zdwjdz',
-      type: "upload",
-      search: false,
-      multiple: true,
-      span: 24,
-      action: '/api/kd-resource/oss/endpoint/put-file',
-      dataType: "object",
-      propsHttp: {
-        url: "link",
-        name: "originalName",
-        res: "data",
-      },
-      uploadPreview: (file, column, done) => {
-        downloadFileByUrl(file.url, file.name);
-        return;
-      },
-      tip: '注:可一次上传多个相关文件(文档、表格、图片等)。支持格式:DOC, PDF, Excel, PNG, JPG, PPT 等。请确保文件内容清晰有效。'
+      width: 300
     },
     },
     {
     {
       label: '企业制度实施证明',
       label: '企业制度实施证明',
       prop: 'zdsszm',
       prop: 'zdsszm',
-      type: "upload",
-      multiple: true,
-      span: 24,
-      action: '/api/kd-resource/oss/endpoint/put-file',
-      dataType: "object",
-      propsHttp: {
-        url: "link",
-        name: "originalName",
-        res: "data",
-      },
-      uploadPreview: (file, column, done) => {
-        downloadFileByUrl(file.url, file.name);
-        return;
-      },
-      tip: '注:可一次上传多个相关文件(文档、表格、图片等)。支持格式:DOC, PDF, Excel, PNG, JPG, PPT 等。请确保文件内容清晰有效。'
+      width: 300
     },
     },
     {
     {
       label: '制度有效性',
       label: '制度有效性',
-      prop: 'zdyxx',
-      type: 'select',
-      span: 24,
-      props:{
-        label:'name',
-        value:'code'
-      },
-      dicData: dict,
-      align: 'center',
-      search: true,
-      width: 90,
-      rules: [
-        {
-          required: true,
-          message: '请选择制度有效性',
-          trigger: 'blur',
-        },
-      ],
+      prop: '$zdyxx',
+      width: 100,
+      align: 'center'
     },
     },
     // {
     // {
     //   label: '制度上传时间',
     //   label: '制度上传时间',

+ 16 - 3
src/views/RD-system-manage/list.vue

@@ -85,10 +85,11 @@
     <WideTablePrinter
     <WideTablePrinter
       ref="printWideTable"
       ref="printWideTable"
       :columns="wideTableColumns"
       :columns="wideTableColumns"
-      :data="data"
+      :data="wideTableData"
       :print-title="pageTitle"
       :print-title="pageTitle"
       :rows-per-page="30"
       :rows-per-page="30"
       :default-landscape="true"
       :default-landscape="true"
+      :zoom="95"
     />
     />
   </basic-container>
   </basic-container>
 </template>
 </template>
@@ -114,7 +115,7 @@ export default window.$crudCommon({
       },
       },
 
 
       wideTableColumns: [],
       wideTableColumns: [],
-      printTitle: "",
+      wideTableData: [],
     };
     };
   },
   },
   watch: {
   watch: {
@@ -182,7 +183,19 @@ export default window.$crudCommon({
      * @param isLandscape 是否横向打印
      * @param isLandscape 是否横向打印
      */
      */
     printTable(isLandscape) {
     printTable(isLandscape) {
-      this.wideTableColumns = this.$refs.crud.columnOption;
+      this.wideTableColumns = this.printOption.column;
+      console.log(this.$refs.crud.list)
+      this.wideTableData = JSON.parse(JSON.stringify(this.$refs.crud.list)).map(item => {
+        if (item.zdwjdz && item.zdwjdz instanceof Array) {
+          item.zdwjdz = item.zdwjdz.map(item => item.label).join('、')
+        }
+        if (item.zdsszm && item.zdsszm instanceof Array) {
+          item.zdsszm = item.zdsszm.map(item => item.label).join('、')
+        }
+
+        return item;
+      });
+
       this.$nextTick(() => {
       this.$nextTick(() => {
         this.$refs.printWideTable.printTable(isLandscape);
         this.$refs.printWideTable.printTable(isLandscape);
       })
       })

+ 106 - 43
src/views/yf-cost-manage/basic-data-setting/atten-info.vue

@@ -57,6 +57,7 @@
       :print-title="pageTitle"
       :print-title="pageTitle"
       :rows-per-page="30"
       :rows-per-page="30"
       :default-landscape="true"
       :default-landscape="true"
+      :zoom="70"
     />
     />
   </basic-container>
   </basic-container>
 </template>
 </template>
@@ -83,7 +84,78 @@ export default window.$crudCommon({
       params: {
       params: {
         yearAndMonth: "",
         yearAndMonth: "",
       },
       },
-      defaultColumns: [],
+      defaultColumns: [
+        {
+          label: '姓名',
+          prop: 'name',
+          span: 24,
+          search: true,
+          width: 90,
+          align: 'center',
+          type: 'input',
+          showOverflowTooltip: true,
+          disabled: true,
+        },
+        {
+          label: '工号',
+          prop: 'number',
+          type: 'input',
+          span: 24,
+          width: 90,
+          align: 'center',
+          search: true,
+          showOverflowTooltip: true,
+          disabled: true,
+        },
+        {
+          label: '身份证号',
+          prop: 'idCard',
+          type: 'input',
+          span: 24,
+          search: true,
+          width: 150,
+          align: 'center',
+          showOverflowTooltip: true,
+          disabled: true,
+        },
+        {
+          label: '科研人员类别',
+          prop: 'personnelType',
+          type: 'select',
+          span: 24,
+          width: 100,
+          align: 'center',
+          search: true,
+          dicUrl: '/api/kd-system/dict/dictionary?code=renyuanleixing',
+          props: {
+            label: 'dictValue',
+            value: 'dictKey',
+          },
+          showOverflowTooltip: true,
+          disabled: true,
+        },
+        {
+          prop: "monthlyHours",
+          label: "本月出勤/小时",
+          type: 'number',
+          precision: 1,
+          min: 0,
+          width: 70,
+          align: 'center',
+          showOverflowTooltip: true,
+          display: false,
+        }, {
+          prop: "monthlyDays",
+          label: "本月出勤/天",
+          type: 'number',
+          precision: 1,
+          min: 0,
+          width: 70,
+          align: 'center',
+          showOverflowTooltip: true,
+          display: false,
+        }
+      ],
 
 
       wideTableColumns: [],
       wideTableColumns: [],
     };
     };
@@ -102,60 +174,51 @@ export default window.$crudCommon({
       return `${yearAndMonthCN}${this.tag.label}`.replace(/每月/g, '');
       return `${yearAndMonthCN}${this.tag.label}`.replace(/每月/g, '');
     }
     }
   },
   },
-  async created() {
-    this.defaultColumns = deepClone(this.option.column);
-    this.refreshTableCol(this.params.yearAndMonth);
-  },
-  beforeDestroy() {
-    this.option.column = deepClone(this.defaultColumns);
-  },
+  // async created() {
+  //   this.defaultColumns = deepClone(this.option.column);
+  //   this.refreshTableCol(this.params.yearAndMonth);
+  // },
+  // beforeDestroy() {
+  //   this.option.column = deepClone(this.defaultColumns);
+  // },
   methods: {
   methods: {
     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]));
-
+      for (let i=monthDays.length; i<31; i++) {
+        let _day = i+1
+        monthDays.push({
+          day: _day,
+          hide: true
+        });
+      }
       let newColumns = deepClone(this.defaultColumns);
       let newColumns = deepClone(this.defaultColumns);
-
-      monthDays.forEach((item) => {
-        let col = {
-          prop: moment(item.dateString).format('yyyyMMDD'),
-          label: item.dayName + "" + item.day.toString(),
-          type: 'number',
-          precision: 1,
-          min: 0,
-          width: 50,
-          align: 'center',
-          isWorkDay: ChineseHoliday.isWorkday(item.dateString),
-          showOverflowTooltip: true,
+       monthDays.forEach((item, index) => {
+        let col = {};
+        if (item.hide) {
+          col = {
+            hide: true,
+          };
+        } else {
+          col = {
+            prop: moment(item.dateString).format('yyyyMMDD'),
+            label:  item.dayName + "" + item.day.toString(),
+            type: 'number',
+            precision: 1,
+            min: 0,
+            width: 50,
+            align: 'center',
+            isWorkDay: ChineseHoliday.isWorkday(item.dateString),
+            showOverflowTooltip: true,
+            hide: item.hide
+          };
         }
         }
-
         if (!ChineseHoliday.isWorkday(item.dateString)) {
         if (!ChineseHoliday.isWorkday(item.dateString)) {
           col.labelClassName = 'red';
           col.labelClassName = 'red';
           col.labelClassName = 'red';
           col.labelClassName = 'red';
         }
         }
         newColumns.push(col);
         newColumns.push(col);
       });
       });
-      newColumns.push({
-        prop: "monthlyHours",
-        label: "本月出勤/小时",
-        type: 'number',
-        precision: 1,
-        min: 0,
-        width: 70,
-        align: 'center',
-        showOverflowTooltip: true,
-        display: false,
-      }, {
-        prop: "monthlyDays",
-        label: "本月出勤/天",
-        type: 'number',
-        precision: 1,
-        min: 0,
-        width: 70,
-        align: 'center',
-        showOverflowTooltip: true,
-        display: false,
-      });
 
 
       this.option.column = newColumns;
       this.option.column = newColumns;
     },
     },

+ 122 - 22
src/views/yf-cost-manage/basic-data-setting/dev-work-hours-register.vue

@@ -91,7 +91,101 @@ export default window.$crudCommon({
       params: {
       params: {
         yearAndMonth: "",
         yearAndMonth: "",
       },
       },
-      defaultColumns: [],
+      defaultColumns: [
+        {
+          label: '研发项目编号',
+          prop: 'xmbh',
+          span: 24,
+          width: 100,
+          align: 'center',
+          type: 'input',
+          showOverflowTooltip: true,
+          disabled: true,
+        },
+        {
+          label: '研发项目名称',
+          prop: 'xmmc',
+          type: 'input',
+          span: 24,
+          width: 110,
+          align: 'center',
+          search: true,
+          showOverflowTooltip: true,
+          disabled: true,
+        },
+        {
+          label: '资产编码',
+          prop: 'zcbm',
+          type: 'input',
+          span: 24,
+          width: 90,
+          align: 'center',
+          showOverflowTooltip: true,
+          disabled: true,
+        },
+        {
+          label: '资产名称',
+          prop: 'zcmc',
+          span: 24,
+          width: 110,
+          align: 'center',
+          search: true,
+          showOverflowTooltip: true,
+          disabled: true,
+        },
+        {
+          label: '资产类别',
+          prop: 'zclb',
+          type: 'select',
+          span: 24,
+          width: 70,
+          align: 'center',
+          dicUrl: '/api/kd-system/dict/dictionary?code=zclb',
+          props: {
+            label: 'dictValue',
+            value: 'dictKey',
+          },
+          showOverflowTooltip: true,
+          disabled: true,
+        },
+        {
+          label: '用途',
+          prop: 'yt',
+          type: 'select',
+          span: 24,
+          width: 60,
+          align: 'center',
+          search: true,
+          dicUrl: '/api/kd-system/dict/dictionary?code=zcyt',
+          props: {
+            label: 'dictValue',
+            value: 'dictKey',
+          },
+          showOverflowTooltip: true,
+          disabled: true,
+        },
+        {
+          label: '总工时',
+          prop: 'zgs',
+          type: 'number',
+          precision: 1,
+          min: 0,
+          width: 50,
+          align: 'center',
+          showOverflowTooltip: true,
+        },
+        {
+          label: '使用工时',
+          prop: 'monthlyHours',
+          type: 'number',
+          span: 24,
+          width: 50,
+          align: 'center',
+          showOverflowTooltip: true,
+          display: false,
+          search: true,
+        },
+      ],
 
 
       wideTableColumns: [],
       wideTableColumns: [],
       printTitle: "",
       printTitle: "",
@@ -111,35 +205,41 @@ export default window.$crudCommon({
       return `${yearAndMonthCN}${this.tag.label}`.replace(/每月/g, '');
       return `${yearAndMonthCN}${this.tag.label}`.replace(/每月/g, '');
     }
     }
   },
   },
-  async created() {
-    this.defaultColumns = deepClone(this.option.column);
-    this.refreshTableCol(this.params.yearAndMonth);
-  },
-  beforeDestroy() {
-    this.option.column = deepClone(this.defaultColumns);
-  },
   methods: {
   methods: {
     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]));
-
+      for (let i=monthDays.length; i<31; i++) {
+        let _day = i+1
+        monthDays.push({
+          day: _day,
+          hide: true
+        });
+      }
       let newColumns = deepClone(this.defaultColumns);
       let newColumns = deepClone(this.defaultColumns);
-
-      monthDays.forEach((item) => {
-        let col = {
-          prop: moment(item.dateString).format('yyyyMMDD'),
-          label: item.dayName + "" + item.day.toString(),
-          type: 'number',
-          precision: 1,
-          min: 0,
-          width: 50,
-          align: 'center',
-          isWorkDay: ChineseHoliday.isWorkday(item.dateString),
-          showOverflowTooltip: true,
+       monthDays.forEach((item, index) => {
+        let col = {};
+        if (item.hide) {
+          col = {
+            hide: true,
+          };
+        } else {
+          col = {
+            prop: moment(item.dateString).format('yyyyMMDD'),
+            label:  item.dayName + "" + item.day.toString(),
+            type: 'number',
+            precision: 1,
+            min: 0,
+            width: 50,
+            align: 'center',
+            isWorkDay: ChineseHoliday.isWorkday(item.dateString),
+            showOverflowTooltip: true,
+            hide: item.hide
+          };
         }
         }
-
         if (!ChineseHoliday.isWorkday(item.dateString)) {
         if (!ChineseHoliday.isWorkday(item.dateString)) {
           col.labelClassName = 'red';
           col.labelClassName = 'red';
+          col.labelClassName = 'red';
         }
         }
         newColumns.push(col);
         newColumns.push(col);
       });
       });

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

@@ -1,6 +1,7 @@
 <template>
 <template>
   <basic-container>
   <basic-container>
     <avue-crud
     <avue-crud
+      v-if="!headerLoading"
       v-bind="bindVal"
       v-bind="bindVal"
       v-on="onEvent"
       v-on="onEvent"
       v-model="form"
       v-model="form"
@@ -93,12 +94,106 @@ export default window.$crudCommon({
       params: {
       params: {
         yearAndMonth: "",
         yearAndMonth: "",
       },
       },
-      defaultColumns: [],
+      defaultColumns: [
+        {
+          label: '研发项目编号',
+          prop: 'xmbh',
+          span: 24,
+          width: 100,
+          align: 'center',
+          type: 'input',
+          showOverflowTooltip: true,
+          disabled: true,
+        },
+        {
+          label: '研发项目名称',
+          prop: 'xmmc',
+          type: 'input',
+          span: 24,
+          width: 110,
+          align: 'center',
+          search: true,
+          showOverflowTooltip: true,
+          disabled: true,
+        },
+        {
+          label: '姓名',
+          prop: 'name',
+          span: 24,
+          search: true,
+          width: 90,
+          cell: true,
+          align: 'center',
+          // type: 'select',
+          showOverflowTooltip: true,
+          // dicUrl: '',
+          // dicFlag: true,
+          // dicFormatter:(res)=>{     
+          //   return res.data.records
+          // },
+          // dicQuery: {
+          //   current: 1,
+          //   size: 99999,
+          //   yearAndMonth: ''
+          // },
+          // props: {
+          //   label: 'name',
+          //   value: 'id',
+          // },
+          disabled: true,
+          rules: [
+            {
+              required: true,
+              message: '请选择技术人员',
+              trigger: 'blur',
+            },
+          ],
+        },
+        {
+          label: '工号',
+          prop: 'number',
+          type: 'input',
+          span: 24,
+          width: 90,
+          align: 'center',
+          search: true,
+          disabled: true,
+          showOverflowTooltip: true,
+        },
+        {
+          label: '身份证号',
+          prop: 'idCard',
+          type: 'input',
+          span: 24,
+          search: true,
+          disabled: true,
+          width: 150,
+          align: 'center',
+          showOverflowTooltip: true,
+        },
+        {
+          label: '科研人员类别',
+          prop: 'personnelType',
+          type: 'select',
+          span: 24,
+          width: 100,
+          align: 'center',
+          search: true,
+          disabled: true,
+          dicUrl: '/api/kd-system/dict/dictionary?code=renyuanleixing',
+          props: {
+            label: 'dictValue',
+            value: 'dictKey',
+          },
+          showOverflowTooltip: true,
+        },
+      ],
 
 
       oldMonthData: [],
       oldMonthData: [],
 
 
       wideTableColumns: [],
       wideTableColumns: [],
       printTitle: "",
       printTitle: "",
+
     };
     };
   },
   },
   watch: {
   watch: {
@@ -115,13 +210,6 @@ export default window.$crudCommon({
       return `${yearAndMonthCN}${this.tag.label}`.replace(/每月/g, '');
       return `${yearAndMonthCN}${this.tag.label}`.replace(/每月/g, '');
     }
     }
   },
   },
-  async created() {
-    this.defaultColumns = deepClone(this.option.column);
-    this.refreshTableCol(this.params.yearAndMonth);
-  },
-  beforeDestroy() {
-    this.option.column = deepClone(this.defaultColumns);
-  },
   methods: {
   methods: {
     handleBeforeOpen(done, type) {
     handleBeforeOpen(done, type) {
       this.oldMonthData = this.form.dailyAttendances || [];
       this.oldMonthData = this.form.dailyAttendances || [];
@@ -130,21 +218,34 @@ export default window.$crudCommon({
     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]));
-
+      for (let i=monthDays.length; i<31; i++) {
+        let _day = i+1
+        monthDays.push({
+          day: _day,
+          hide: true
+        });
+      }
       let newColumns = deepClone(this.defaultColumns);
       let newColumns = deepClone(this.defaultColumns);
-
-       monthDays.forEach(item => {
-        let col = {
-          prop: moment(item.dateString).format('yyyyMMDD'),
-          label:  item.dayName + "" + item.day.toString(),
-          type: 'number',
-          precision: 1,
-          min: 0,
-          width: 50,
-          align: 'center',
-          isWorkDay: ChineseHoliday.isWorkday(item.dateString),
-          showOverflowTooltip: true,
-        };
+       monthDays.forEach((item, index) => {
+        let col = {};
+        if (item.hide) {
+          col = {
+            hide: true,
+          };
+        } else {
+          col = {
+            prop: moment(item.dateString).format('yyyyMMDD'),
+            label:  item.dayName + "" + item.day.toString(),
+            type: 'number',
+            precision: 1,
+            min: 0,
+            width: 50,
+            align: 'center',
+            isWorkDay: ChineseHoliday.isWorkday(item.dateString),
+            showOverflowTooltip: true,
+            hide: item.hide
+          };
+        }
         if (!ChineseHoliday.isWorkday(item.dateString)) {
         if (!ChineseHoliday.isWorkday(item.dateString)) {
           col.labelClassName = 'red';
           col.labelClassName = 'red';
           col.labelClassName = 'red';
           col.labelClassName = 'red';

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

@@ -86,7 +86,80 @@ export default window.$crudCommon({
       params: {
       params: {
         yearAndMonth: "",
         yearAndMonth: "",
       },
       },
-      defaultColumns: [],
+      defaultColumns: [
+        {
+          label: '姓名',
+          prop: 'name',
+          span: 24,
+          search: true,
+          width: 90,
+          align: 'center',
+          type: 'input',
+          showOverflowTooltip: true,
+          disabled: true,
+        },
+        {
+          label: '工号',
+          prop: 'number',
+          type: 'input',
+          span: 24,
+          width: 90,
+          align: 'center',
+          search: true,
+          showOverflowTooltip: true,
+          disabled: true,
+        },
+        {
+          label: '身份证号',
+          prop: 'idCard',
+          type: 'input',
+          span: 24,
+          search: true,
+          width: 150,
+          align: 'center',
+          showOverflowTooltip: true,
+          disabled: true,
+        },
+        {
+          label: '科研人员类别',
+          prop: 'personnelType',
+          type: 'select',
+          span: 24,
+          width: 100,
+          align: 'center',
+          search: true,
+          dicUrl: '/api/kd-system/dict/dictionary?code=renyuanleixing',
+          props: {
+            label: 'dictValue',
+            value: 'dictKey',
+          },
+          showOverflowTooltip: true,
+          disabled: true,
+        },
+        {
+          label: '类别',
+          prop: 'gslb',
+          span: 24,
+          width: 90,
+          align: 'center',
+          showOverflowTooltip: true,
+        },
+        {
+          prop: "hoursTotal",
+          label: "合计",
+          width: 50,
+          align: 'center',
+          showOverflowTooltip: true,
+          display: false,
+        }, {
+          prop: "hoursRate",
+          label: "工时分配率",
+          width: 60,
+          align: 'center',
+          showOverflowTooltip: true,
+          display: false,
+        }
+      ],
 
 
       wideTableColumns: [],
       wideTableColumns: [],
       printTitle: "",
       printTitle: "",
@@ -108,57 +181,46 @@ export default window.$crudCommon({
       return `${yearAndMonthCN}${this.tag.label}`.replace(/每月/g, '')
       return `${yearAndMonthCN}${this.tag.label}`.replace(/每月/g, '')
     }
     }
   },
   },
-  async created() {
-    this.defaultColumns = deepClone(this.option.column);
-    this.refreshTableCol(this.params.yearAndMonth);
-  },
-  beforeDestroy() {
-    this.option.column = deepClone(this.defaultColumns);
-  },
   methods: {
   methods: {
     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]));
-
+      for (let i=monthDays.length; i<31; i++) {
+        let _day = i+1
+        monthDays.push({
+          day: _day,
+          hide: true
+        });
+      }
       let newColumns = deepClone(this.defaultColumns);
       let newColumns = deepClone(this.defaultColumns);
-      this.allMonthCols = [];
-      monthDays.forEach((item) => {
-        let col = {
-          prop: moment(item.dateString).format('yyyyMMDD'),
-          label: item.dayName + "" + item.day.toString(),
-          type: 'number',
-          precision: 1,
-          min: 0,
-          width: 50,
-          align: 'center',
-          isWorkDay: ChineseHoliday.isWorkday(item.dateString),
-          showOverflowTooltip: true,
+       monthDays.forEach((item, index) => {
+        let col = {};
+        if (item.hide) {
+          col = {
+            hide: true,
+          };
+        } else {
+          col = {
+            prop: moment(item.dateString).format('yyyyMMDD'),
+            label:  item.dayName + "" + item.day.toString(),
+            type: 'number',
+            precision: 1,
+            min: 0,
+            width: 50,
+            align: 'center',
+            isWorkDay: ChineseHoliday.isWorkday(item.dateString),
+            showOverflowTooltip: true,
+            hide: item.hide
+          };
         }
         }
-
         if (!ChineseHoliday.isWorkday(item.dateString)) {
         if (!ChineseHoliday.isWorkday(item.dateString)) {
           col.labelClassName = 'red';
           col.labelClassName = 'red';
           col.labelClassName = 'red';
           col.labelClassName = 'red';
         }
         }
         newColumns.push(col);
         newColumns.push(col);
-        this.allMonthCols.push(moment(item.dateString).format('yyyyMMDD'));
-      });
-      newColumns.push({
-        prop: "hoursTotal",
-        label: "合计",
-        width: 50,
-        align: 'center',
-        showOverflowTooltip: true,
-        display: false,
-      }, {
-        prop: "hoursRate",
-        label: "工时分配率",
-        width: 60,
-        align: 'center',
-        showOverflowTooltip: true,
-        display: false,
       });
       });
 
 
-      this.option.column = [...newColumns];
+      this.option.column = newColumns;
     },
     },
     handleExport() {
     handleExport() {
       exportBloByPost(`/api/kd-scientific/xm/technician/hours/myyfgsfpb/export?${this.website.tokenHeader}=${getToken()}`, this.params).then(res => {
       exportBloByPost(`/api/kd-scientific/xm/technician/hours/myyfgsfpb/export?${this.website.tokenHeader}=${getToken()}`, this.params).then(res => {