licp
2024-12-20 d975fc4756806f5b51f006c19c33571b9b8c0b3b
src/components/do/b3-work-time-management/work-time-management.vue
@@ -27,8 +27,8 @@
            size="small"
            type="daterange"
            range-separator="至"
            format="yyyy-MM-dd HH:mm:ss"
            value-format="yyyy-MM-dd HH:mm:ss"
            format="yyyy-MM-dd"
            value-format="yyyy-MM-dd"
            start-placeholder="开始日期"
            end-placeholder="结束日期" @change="refreshTable()" clearable>
          </el-date-picker>
@@ -63,7 +63,7 @@
      </el-radio-group>
      <div style="display: flex;align-items: center;">
        <p style="font-size: 14px;margin-right: 30px;">
          总工时汇总:<span style="font-size: 16px;color: #3A7BFA;" v-if="totalInfo">{{ (totalInfo['产量工时汇总']+totalInfo['辅助工时汇总'])? (totalInfo['产量工时汇总']+totalInfo['辅助工时汇总']):0 }}</span>&nbsp;&nbsp;&nbsp;&nbsp;产量工时汇总:<span style="font-size: 16px;color: #3A7BFA;" v-if="totalInfo">{{totalInfo['产量工时汇总']?totalInfo['产量工时汇总']:0}}</span>&nbsp;&nbsp;&nbsp;&nbsp;辅助工时汇总:<span style="font-size: 16px;color: #3A7BFA;" v-if="totalInfo">{{totalInfo['辅助工时汇总']?totalInfo['辅助工时汇总']:0}}</span>
          总工时汇总:<span style="font-size: 16px;color: #3A7BFA;" v-if="totalInfo">{{ (totalInfo['产量工时汇总']+totalInfo['辅助工时汇总'])? Number((totalInfo['产量工时汇总']+totalInfo['辅助工时汇总'])).tofixed(4):0 }}</span>&nbsp;&nbsp;&nbsp;&nbsp;产量工时汇总:<span style="font-size: 16px;color: #3A7BFA;" v-if="totalInfo">{{totalInfo['产量工时汇总']?Number(totalInfo['产量工时汇总']).tofixed(4):0}}</span>&nbsp;&nbsp;&nbsp;&nbsp;辅助工时汇总:<span style="font-size: 16px;color: #3A7BFA;" v-if="totalInfo">{{totalInfo['辅助工时汇总']?Number(totalInfo['辅助工时汇总']).tofixed(4):0}}</span>
        </p>
        <el-button size="small" type="primary" @click="openAdd" v-show="currentTable == 'ValueTable0'&&add">录入数据</el-button>
        <el-button size="small" type="primary"
@@ -75,12 +75,11 @@
    </div>
    <div class="table">
      <ValueTable ref="ValueTable0"
        v-if="currentTable == 'ValueTable0'"
        v-if="currentTable == 'ValueTable0'" :isColumnWidth="true"
            :url="$api.auxiliaryWorkingHoursDay.selectAuxiliaryWorkingHoursDay"
            :delUrl="$api.auxiliaryWorkingHoursDay.deleteAuxiliaryWorkingHoursDay" :componentData="componentData" :key="upIndex"
        @delete="handleDelete" />
      <ValueTable ref="ValueTable1"
      v-if="currentTable == 'ValueTable1'"
      <ValueTable ref="ValueTable1" v-if="currentTable == 'ValueTable1'" :isColumnWidth="true"
            :url="$api.auxiliaryOutputWorkingHours.selectAuxiliaryOutputWorkingHours" :componentData="componentData1" :key="upIndex1" />
    </div>
    <el-dialog :title="formData.id?'编辑':'录入数据'" :visible.sync="addVisible" width="600px" :before-close="handleClose">
@@ -162,7 +161,7 @@
              </el-select>
            </el-form-item>
            <el-form-item label="姓名:">
              <el-input v-model="formData0.nameUser" size="small" disabled></el-input>
              <el-input v-model="formData0.name" size="small" disabled></el-input>
            </el-form-item>
            <el-form-item label="班次:">
              <el-select v-model="formData0.shift" placeholder="请选择" size="small" :disabled="title=='批准'">
@@ -333,7 +332,8 @@
          }
        },
        requiredAdd: [],
        requiredUp: []
        requiredUp: [],
        needSort: ['createTime', 'name']
         },
      entityCopy: {},
         upIndex: 0,
@@ -363,13 +363,13 @@
      entityCopy1: {},
      upIndex1:100,
      weekList:[
        {label: '周一', value: '1',type:'primary'},
        {label: '周二', value: '2',type:'primary'},
        {label: '周三', value: '3',type:'primary'},
        {label: '周四', value: '4',type:'primary'},
        {label: '周五', value: '5',type:'primary'},
        {label: '周六', value: '6',type:'primary'},
        {label: '周日', value: '7',type:'primary'}
        {label: '周一', value: '周一',type:'primary'},
        {label: '周二', value: '周二',type:'primary'},
        {label: '周三', value: '周三',type:'primary'},
        {label: '周四', value: '周四',type:'primary'},
        {label: '周五', value: '周五',type:'primary'},
        {label: '周六', value: '周六',type:'primary'},
        {label: '周日', value: '周日',type:'primary'}
      ],
      currentTable:'ValueTable0',
      addVisible:false,
@@ -400,7 +400,8 @@
        reviewerNonproductiveTime:'',
        auxiliaryProject:'',
        reviewerRemark:'',
        nameUser: ''
        nameUser: '',
        name: ''
      },
      checkVisible:false,
      checkLoadN:false,
@@ -502,12 +503,13 @@
      let year = currentDate.getFullYear();
      let month = String(currentDate.getMonth() + 1).padStart(2, '0');
      let day = String(currentDate.getDate()).padStart(2, '0');
      let formattedDate1 = `${year}-${month}-${day} 00:00:00`;
      let formattedDate2 = `${year}-${month}-${day} 23:59:59`;
      let formattedDate1 = `${year}-${month}-${day}`;
      let formattedDate2 = `${year}-${month}-${day}`;
      this.entity.dateTime.push(formattedDate1);
      this.entity.dateTime.push(formattedDate2);
      this.componentData1.entity.dateTime.push(formattedDate1);
      this.componentData1.entity.dateTime.push(formattedDate2);
      this.componentData1.entity.dateTime = JSON.stringify(this.componentData1.entity.dateTime)
      this.refreshTable()
    },
    getPower(){
@@ -528,7 +530,6 @@
          if (power[i].menuMethod == 'insertAuxiliaryWorkingHoursDay') {
                  add = true
               }
          console.log(add)
          if (power[i].menuMethod == 'updateAuxiliaryWorkingHoursDay') {
                  up = true
               }
@@ -557,7 +558,7 @@
    getYearAndMonthAndDays(date){
      return getYearAndMonthAndDays(date)
    },
    refreshTable(){
    refreshTable(e){
      let entity = {}
      if(this.entity.week1&&this.entity.week2){
        entity.week = JSON.stringify([this.entity.week1,this.entity.week2])
@@ -574,10 +575,12 @@
      if(this.currentTable=='ValueTable0'){
        entity.state = this.entity.state
        this.componentData.entity = {...this.componentData.entity,...entity}
        this.$refs['ValueTable0'].selectList()
        this.$nextTick(() => {
          this.$refs['ValueTable0'].selectList(e)
        })
      }else{
        this.componentData1.entity = {...this.componentData1.entity,...entity}
        this.$refs['ValueTable1'].selectList()
        this.$refs['ValueTable1'].selectList(e)
      }
      this.collectWorkingHours()
    },
@@ -646,7 +649,7 @@
            this.formData.nonproductiveTime = ''
            this.formData.auxiliaryProject = ''
            // this.addVisible = false
            this.refreshTable()
            this.refreshTable('page')
            this.collectWorkingHours()
          })
      }else{
@@ -667,7 +670,7 @@
            this.formData.nonproductiveTime = ''
            this.formData.auxiliaryProject = ''
            // this.addVisible = false
            this.refreshTable()
            this.refreshTable('page')
            this.collectWorkingHours()
          })
      }
@@ -676,11 +679,13 @@
      this.title = '审核'
      this.formData0 = row;
      this.checkVisible = true
      this.formData0.reviewerNumber = this.formData0.amount
    },
    handleRatify(row){
      this.title = '批准'
      this.formData0 = row;
      this.checkVisible = true
      this.formData0.reviewerNumber = this.formData0.amount
    },
    handleChangeTask (row) {
      this.ValueTable0Selected = JSON.parse(JSON.stringify(row))
@@ -718,7 +723,7 @@
    },
    submitBatchCheckDialog () {
      this.batchCheckDialog = false
      this.refreshTable()
      this.refreshTable('page')
      this.collectWorkingHours()
    },
    submitCheck(e){
@@ -741,7 +746,7 @@
        }
        this.formData0.state = e==0?this.formData0.state:'已审核'
        this.$axios.post(this.$api.auxiliaryWorkingHoursDay.check, {
            ...this.formData0
          auxiliaryWorkingHoursDays:[this.formData0]
        }, {
          headers: {
            'Content-Type': 'application/json'
@@ -757,7 +762,7 @@
          if (res.code == 201) return
          this.$message.success('操作成功')
          this.checkVisible = false
          this.refreshTable()
          this.refreshTable('page')
          this.collectWorkingHours()
        })
      }else{
@@ -767,8 +772,10 @@
          this.checkLoadY = true
        }
        this.$axios.post(this.$api.auxiliaryWorkingHoursDay.approve, {
            id:this.formData0.id,
            state:e==0?'已提交':'已批准'
            auxiliaryWorkingHoursDays:[{
              id:this.formData0.id,
              state:e==0?'已提交':'已批准'
            }]
        }, {
          headers: {
            'Content-Type': 'application/json'
@@ -782,7 +789,7 @@
          if (res.code == 201) return
          this.$message.success('操作成功')
          this.checkVisible = false
          this.refreshTable()
          this.refreshTable('page')
          this.collectWorkingHours()
        })
      }
@@ -921,7 +928,4 @@
      height: calc(100% - 60px - 80px - 10px - 40px - 25px);
      padding: 20px;
   }
>>>.el-dialog__wrapper {
  z-index: 9999 !important; /* 根据需要调整层级 */
}
</style>