licp
2024-05-31 4bad62e4fd67ba8759f79263e4b08bf9ab6d64d0
src/components/do/b3-work-time-management/work-time-statistics.vue
@@ -5,17 +5,17 @@
            <div class="search_label">日期:</div>
            <div class="search_input" style="display: flex;align-items: center;">
          <el-date-picker
            v-model="componentData.entity.month"
            v-model="entity.month"
            type="month"
            format="yyyy-MM"
            value-format="yyyy"
            value-format="yyyy-MM"
            placeholder="选择月" size="small" style="width: 100%;">
          </el-date-picker>
        </div>
         </div>
         <div class="search_thing">
            <div class="search_label">员工:</div>
            <el-select v-model="componentData.entity.name" placeholder="全部" size="small" @change="refreshTable()">
            <el-select v-model="entity.name" placeholder="全部" size="small" @change="refreshTable()">
               <el-option v-for="item in personList" :key="item.id" :label="item.name" :value="item.id">
               </el-option>
            </el-select>
@@ -28,15 +28,17 @@
            </el-option>
          </el-select> -->
          <el-input size="small" placeholder="请输入" clearable
                  v-model="componentData.entity.departLims" @keyup.enter.native="refreshTable()"></el-input>
                  v-model="entity.departLims" @keyup.enter.native="refreshTable()"></el-input>
        </div>
         </div>
         <div class="search_thing" style="padding-left: 30px;width: 100px;">
         <div class="search_thing" style="padding-left: 30px;">
            <el-button size="small" @click="refresh()">重 置</el-button>
            <el-button size="small" type="primary" @click="refreshTable()">查 询</el-button>
         </div>
      <el-button size="small" type="primary" style="position: absolute;right: 50px;" @click="handleDown">导 出</el-button>
      <el-button size="small" type="primary" style="position: absolute;right: 120px;" @click="handleUp" v-show="currentTable == 'value0'">导 入</el-button>
      <div class="search_thing">
        <el-button size="small" type="primary"  @click="handleDown" v-show="currentTable == 'value0'">导 出</el-button>
        <el-button size="small" type="primary" @click="handleUp" v-show="currentTable == 'value1'">导 入</el-button>
      </div>
      </div>
    <el-radio-group v-model="currentTable" size="small" :key="'111'" style="margin-top: 10px;">
      <el-radio-button label="value0">
@@ -48,13 +50,15 @@
    </el-radio-group>
    <div class="table">
      <ValueTable ref="ValueTable0"
        v-show="currentTable == 'value0'"
        v-if="currentTable == 'value0'"
            :url="$api.auxiliaryWorkingHours.selectAuxiliaryWorkingHours"
            :componentData="componentData" :inputUrl="$api.auxiliaryWorkingHours.selectAuxiliaryWorkingHours" :downUrl="$api.auxiliaryWorkingHours.selectAuxiliaryWorkingHours" :key="upIndex" />
      <ValueTable ref="ValueTable1"
        v-if="currentTable == 'value1'"
            :url="$api.auxiliaryCorrectionHours.selectAuxiliaryCorrectionHours"
            :componentData="componentData0" :key="upIndex" />
        :inputUrl="$api.auxiliaryCorrectionHours.upload"
            :componentData="componentData0"
        :key="upIndex1" />
    </div>
  </div>
</template>
@@ -72,7 +76,7 @@
    return{
      componentData: {
               entity: {
                  month: null,
                  month: getYearAndMonthAndDays().split('-')[0]+'-'+getYearAndMonthAndDays().split('-')[1],
                  name: null,
                  departLims: null,
                  orderBy: {
@@ -84,40 +88,13 @@
               showSelect: false,
               select: false,
               do: [],
               tagField: {
                  deviceStatus: {
                     select: []
                  },
                  equipmentManager: {
                     select: []
                  },
                  authorizedPerson: {
                     select: []
                  },
            insProductIds:{
              select:[]
            }
               },
               linkEvent: {
                  deviceName: {
                     method: 'selectAllByOne'
                  }
               },
               selectField: {
                  authorizedPerson: {
                     select: [],
                     choose: true
                  },
                  equipmentManager: {
                     select: []
                  },
            insProductIds:{
              select:[],
              choose: true
            }
               },
               tagField: {},
               linkEvent: {},
               selectField: {},
               requiredAdd: [],
               requiredUp: []
               requiredUp: [],
          accept: '.xlsx',
          inputType: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
         },
      componentData0: {
               entity: {
@@ -133,43 +110,22 @@
               showSelect: false,
               select: false,
               do: [],
               tagField: {
                  deviceStatus: {
                     select: []
                  },
                  equipmentManager: {
                     select: []
                  },
                  authorizedPerson: {
                     select: []
                  },
            insProductIds:{
              select:[]
            }
               },
               tagField: {},
               linkEvent: {
                  deviceName: {
                     method: 'selectAllByOne'
                  }
               },
               selectField: {
                  authorizedPerson: {
                     select: [],
                     choose: true
                  },
                  equipmentManager: {
                     select: []
                  },
            insProductIds:{
              select:[],
              choose: true
            }
               },
               selectField: {},
               requiredAdd: [],
               requiredUp: []
               requiredUp: [],
          accept: '.xlsx',
          inputType: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
         },
      entity:{},
      entity:{
        month:getYearAndMonthAndDays()
      },
      entityCopy:{},
      entityCopy0:{},
      upIndex:0,
      upIndex1:100,
      weekList:[],
      personList:[],
      currentTable:'value0'
@@ -177,13 +133,33 @@
  },
  mounted(){
    this.getUsers()
    this.entityCopy = this.HaveJson(this.componentData.entity);
    this.entityCopy0 = this.HaveJson(this.componentData0.entity);
  },
  methods: {
    getYearAndMonthAndDays(date){
      return getYearAndMonthAndDays(date)
    refresh(){
      this.entity = {
        month:getYearAndMonthAndDays()
      }
      if(this.currentTable=='value0'){
        this.componentData.entity = this.HaveJson(this.entityCopy)
        this.upIndex++
      }else{
        this.componentData0.entity = this.HaveJson(this.entityCopy0)
        this.upIndex1++
      }
      this.refreshTable()
    },
    refresh(){},
    refreshTable(){},
    refreshTable(){
      let entity = {...this.entity}
      if(this.currentTable=='value0'){
        this.componentData.entity = {...this.componentData.entity,...entity}
        this.$refs['ValueTable0'].selectList()
      }else{
        this.componentData0.entity = {...this.componentData0.entity,...entity}
        this.$refs['ValueTable1'].selectList()
      }
    },
    getUsers(){
      this.$axios.post(this.$api.user.selectUserList, {
               page: {
@@ -206,14 +182,10 @@
        })
    },
    handleDown(){
      if(this.currentTable == 'value0'){
        this.$refs.ValueTable0.downFile(false)
      }else{
        this.$refs.ValueTable1.downFile(false)
      }
    },
    handleUp(){
      this.$refs.ValueTable0.openUpload()
      this.$refs.ValueTable1.openUpload()
    }
  }
}