licp
2024-12-24 e4bb381c896015c4b87faa002ba6875c06a2fd16
src/components/do/b3-work-time-management/work-time-statistics.vue
@@ -57,9 +57,10 @@
    <div class="table">
      <ValueTable ref="ValueTable0"
        v-if="currentTable == 'value0'" :isColumnWidth="true"
                  :isShowZero="true"
            :url="$api.auxiliaryOriginalHours.selectAuxiliaryOriginalHours"
            :componentData="componentData" :key="upIndex" />
      <ValueTable ref="ValueTable1"
      <ValueTable ref="ValueTable1" :isShowZero="true"
        v-if="currentTable == 'value1'" :isColumnWidth="true"
            :url="$api.auxiliaryCorrectionHours.selectAuxiliaryCorrectionHours"
        :inputUrl="$api.auxiliaryCorrectionHours.upload"
@@ -83,48 +84,48 @@
      down:false,
      up:false,
      componentData: {
               entity: {
                  month: getYearAndMonthAndDays().split('-')[0]+'-'+getYearAndMonthAndDays().split('-')[1],
                  name: null,
                  departLims: null,
               },
               isIndex: true,
               showSelect: false,
               select: false,
               do: [],
               tagField: {},
               linkEvent: {},
               selectField: {},
               requiredAdd: [],
               requiredUp: [],
          accept: '.xlsx',
          inputType: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
          cellSpecialStyle:{
            redColorByKey:'Hours'
          }
        entity: {
          month: getYearAndMonthAndDays().split('-')[0]+'-'+getYearAndMonthAndDays().split('-')[1],
          name: null,
          departLims: null,
        },
        isIndex: true,
        showSelect: false,
        select: false,
        do: [],
        tagField: {},
        linkEvent: {},
        selectField: {},
        requiredAdd: [],
        requiredUp: [],
        accept: '.xlsx',
        inputType: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
        cellSpecialStyle:{
          redColorByKey:'Hours'
        },
         },
      componentData0: {
               entity: {
                  month: getYearAndMonthAndDays().split('-')[0]+'-'+getYearAndMonthAndDays().split('-')[1],
                  name: null,
                  departLims: null,
                  orderBy: {
                     field: 'id',
                     order: 'desc'
                  }
               },
               isIndex: true,
               showSelect: false,
               select: false,
               do: [],
               tagField: {},
               linkEvent: {
                  },
               selectField: {},
               requiredAdd: [],
               requiredUp: [],
          accept: '.xlsx',
          inputType: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
        entity: {
          month: getYearAndMonthAndDays().split('-')[0]+'-'+getYearAndMonthAndDays().split('-')[1],
          name: null,
          departLims: null,
          orderBy: {
            field: 'id',
            order: 'desc'
          }
        },
        isIndex: true,
        showSelect: false,
        select: false,
        do: [],
        tagField: {},
        linkEvent: {
        },
        selectField: {},
        requiredAdd: [],
        requiredUp: [],
        accept: '.xlsx',
        inputType: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
         },
      entity:{
        month:getYearAndMonthAndDays(),
@@ -203,13 +204,33 @@
        // params:entity,
      },{responseType: "blob"}).then(res => {
        this.outLoading = false
        this.$message.success('导出成功')
        const blob = new Blob([res],{ type: 'application/octet-stream' });
        const url = URL.createObjectURL(blob);
        const link = document.createElement('a');
        link.href = url;
        link.download = entity.month+'工时统计表.xlsx';
        link.click();
        //将Blob 对象转换成字符串
        let reader = new FileReader();
        reader.readAsText(blob, 'utf-8');
        reader.onload = () => {
          try {
            let result = JSON.parse(reader.result);
            if (result.message) {
              this.$message.error(result.message);
            } else {
              const url = URL.createObjectURL(blob);
              const link = document.createElement('a');
              link.href = url;
              link.download = entity.month+'工时统计表.xlsx';
              link.click();
              this.$message.success('导出成功')
            }
          } catch (err) {
            console.log(err);
            const url = URL.createObjectURL(blob);
            const link = document.createElement('a');
            link.href = url;
            link.download = entity.month+'工时统计表.xlsx';
            link.click();
            this.$message.success('导出成功')
          }
        }
      })
    },
    handleUp(){