gaoluyang
2024-07-18 9c1906a8056c0c88fdd116b60fbd17aa8a0cbb5c
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>
@@ -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">
@@ -170,6 +169,9 @@
                </el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="复核说明:">
              <el-input v-model="formData0.reviewerRemark" type="textarea" :rows="3" size="small" :disabled="title=='批准'"></el-input>
            </el-form-item>
          </el-form>
            </el-col>
        <el-col :span="12">
@@ -178,6 +180,9 @@
              <el-input v-model="formData0.number" size="small" :disabled="title=='批准'"></el-input>
            </el-form-item>
            <el-form-item label="数量:" required>
              <el-input v-model="formData0.amount" size="small" :disabled="title=='批准'"></el-input>
            </el-form-item>
            <el-form-item label="复核数量:" required>
              <el-input v-model="formData0.reviewerNumber" size="small" :disabled="title=='批准'"></el-input>
            </el-form-item>
            <el-form-item label="核准工时:">
@@ -192,12 +197,6 @@
          </el-form>
            </el-col>
         </el-row>
      <el-form :model="formData0" label-width="90px">
        <el-form-item label="复核说明:">
          <el-input v-model="formData0.reviewerRemark" type="textarea"
  :rows="3" size="small" :disabled="title=='批准'"></el-input>
        </el-form-item>
      </el-form>
         <span slot="footer" class="dialog-footer">
            <el-row>
               <el-button @click="submitCheck(0)" :loading="checkLoadN">{{title=='审核'?'不通过':'不批准'}}</el-button>
@@ -210,10 +209,10 @@
      :visible.sync="batchCheckDialog"
      width="30%"
      :before-close="closeBatchCheckDialog">
      <span>这是一段信息</span>
      <span>{{batchCheckDialogMessage}}</span>
      <span slot="footer" class="dialog-footer">
    <el-button @click="batchCheckDialog = false">取 消</el-button>
    <el-button type="primary" @click="batchCheck">确 定</el-button>
    <el-button @click="batchCheckDialog = false">{{batchCheckTitle=='批量审核'?'不通过':'不批准'}}</el-button>
    <el-button type="primary" @click="batchCheck">{{batchCheckTitle=='批量审核'?'通 过':'批 准'}}</el-button>
  </span>
    </el-dialog>
  </div>
@@ -341,7 +340,7 @@
               entity: {
                  week: null,
                  weekDay: null,
                  dateTime: null,
                  dateTime: [],
            name:null,
                  orderBy: {
                     field: 'id',
@@ -400,6 +399,7 @@
        reviewerNonproductiveTime:'',
        auxiliaryProject:'',
        reviewerRemark:'',
        nameUser: ''
      },
      checkVisible:false,
      checkLoadN:false,
@@ -425,7 +425,8 @@
      outLoading:false,
      batchCheckTitle: '批量审核',
      batchCheckDialog: false,
      ValueTable0Selected: []
      ValueTable0Selected: [],
      batchCheckDialogMessage: ''
    }
  },
  watch:{
@@ -500,10 +501,12 @@
      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.refreshTable()
    },
    getPower(){
@@ -575,6 +578,7 @@
        this.componentData1.entity = {...this.componentData1.entity,...entity}
        this.$refs['ValueTable1'].selectList()
      }
      this.collectWorkingHours()
    },
    refresh(){
      this.entity = {}
@@ -686,6 +690,7 @@
        const isApprove = this.ValueTable0Selected.every(item => item.state !== '已批准')
        console.log('this.isApprove---', isApprove)
        this.batchCheckTitle = e === 0 ? '批量审核' : '批量批准'
        this.batchCheckDialogMessage = e === 0 ? '是否全部通过审核?' : '是否全部通过批准?'
        if (this.batchCheckTitle === '批量审核') {
          if (isChecked) {
            this.batchCheckDialog = true
@@ -817,9 +822,28 @@
      return String(d)
    },
    collectWorkingHours(){
      this.$axios.post(this.$api.auxiliaryOutputWorkingHours.collectWorkingHours).then(res => {
        this.totalInfo = res.data
      })
      let entity = {}
      if(this.entity.week1&&this.entity.week2){
        entity.week = JSON.stringify([this.entity.week1,this.entity.week2])
      }else{
        entity.week = ''
      }
      if(this.entity.dateTime){
        entity.dateTime = JSON.stringify(this.entity.dateTime)
      }else{
        entity.dateTime = ''
      }
      entity.weekDay = this.entity.weekDay
      entity.name = this.entity.name
      this.$axios.post(this.$api.auxiliaryOutputWorkingHours.collectWorkingHours,{
    entity:entity
   }, {
  headers: {
 'Content-Type': 'application/json'
 }
 }).then(res => {
 this.totalInfo = res.data
 })
    },
    selectshiftByUser(){
      this.$axios.post(this.$api.auxiliaryWorkingHoursDay.selectshiftByUser).then(res => {