licp
2024-05-31 51bfe4a889a45a1733cc6542f3bc624ad1675f33
完善工时管理
已修改5个文件
143 ■■■■ 文件已修改
src/assets/api/controller.js 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/do/b1-ins-order/add.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/do/b1-ins-order/fiberoptic-config.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/do/b3-work-time-management/work-time-management.vue 131 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/do/b3-work-time-management/work-time-statistics.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/api/controller.js
@@ -28,6 +28,7 @@
    companies,
    auxiliaryOutputWorkingHours,
    auxiliaryWorkingHoursDay,
    auxiliaryCorrectionHours,
  }
}
@@ -319,3 +320,7 @@
  check: "/auxiliaryWorkingHoursDay/check", //审核
  approve: "/auxiliaryWorkingHoursDay/approve", //批准
}
const auxiliaryCorrectionHours = {
  selectAuxiliaryCorrectionHours: "/auxiliaryCorrectionHours/selectAuxiliaryCorrectionHours", //查询修正工时
}
src/components/do/b1-ins-order/add.vue
@@ -373,7 +373,7 @@
        <el-table-column prop="section" label="区间" width="120" show-overflow-tooltip></el-table-column>
        <el-table-column prop="ask" label="要求值" min-width="220px">
          <template slot-scope="scope">
            <el-input size="small" placeholder="要求值" v-model="scope.row.ask" clearable type="textarea" readonly
            <el-input size="small" placeholder="要求值" v-model="scope.row.ask" clearable type="textarea"
              :autosize="{ minRows: 1, maxRows: 3}" @change="e=>requestChange(e,scope.row)" :readonly="active>1"></el-input>
          </template>
        </el-table-column>
src/components/do/b1-ins-order/fiberoptic-config.vue
@@ -355,7 +355,6 @@
        } else {
          this.bushing = []
        }
        console.log(1111111,this.bushing)
      },
      getStandTreeBySampleType() {
        this.$axios.post(this.$api.standardTree.getStandTreeBySampleType, {
src/components/do/b3-work-time-management/work-time-management.vue
@@ -174,13 +174,13 @@
              <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-input v-model="formData0.reviewerNumber" size="small" :disabled="title=='批准'"></el-input>
            </el-form-item>
            <el-form-item label="核准工时:">
              <el-input v-model="formData0.approvedWorkingHour" size="small" disabled></el-input>
            </el-form-item>
            <el-form-item label="辅助工时:">
              <el-input v-model="formData0.nonproductiveTime" size="small" disabled></el-input>
            <el-form-item label="复核工时:">
              <el-input v-model="formData0.reviewerNonproductiveTime" size="small" disabled></el-input>
            </el-form-item>
            <el-form-item label="辅助项目:">
              <el-input v-model="formData0.auxiliaryProject" size="small" disabled></el-input>
@@ -254,11 +254,55 @@
                    tagField: {
            shift:{
              select:[]
            },
            state:{
              select:[
                {
                  label:'已提交',
                  value:'已提交',
                  type:'primary'
                },
                {
                  label:'已审核',
                  value:'已审核',
                  type:'warning'
                },
                {
                  label:'已批准',
                  value:'已批准',
                  type:'success'
                },
              ]
            },
            weekDay:{
              select:[]
            }
          },
                    linkEvent: {},
                    selectField: {
            shift:{
              select:[]
            },
            state:{
              select:[
                {
                  label:'已提交',
                  value:'已提交',
                  type:'primary'
                },
                {
                  label:'已审核',
                  value:'已审核',
                  type:'warning'
                },
                {
                  label:'已批准',
                  value:'已批准',
                  type:'success'
                },
              ]
            },
            weekDay:{
              select:[]
            }
          },
@@ -292,13 +336,13 @@
      entityCopy1: {},
      upIndex1:100,
      weekList:[
        {label: '星期一', value: '1'},
        {label: '星期二', value: '2'},
        {label: '星期三', value: '3'},
        {label: '星期四', value: '4'},
        {label: '星期五', value: '5'},
        {label: '星期六', value: '6'},
        {label: '星期日', value: '7'}
        {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'}
      ],
      currentTable:'ValueTable0',
      addVisible:false,
@@ -324,9 +368,9 @@
        createUser:'',
        shift:'',
        number:'',
        amount:'',
        reviewerNumber:'',
        approvedWorkingHour:'',
        nonproductiveTime:'',
        reviewerNonproductiveTime:'',
        auxiliaryProject:'',
        reviewerRemark:'',
      },
@@ -387,21 +431,21 @@
        this.formData.nonproductiveTime = this.formData.amount*val
      }
    },
    'formData0.amount'(val){
    'formData0.reviewerNumber'(val){
      if(val){
        if(!isNaN(val)){
          if(this.formData0.approvedWorkingHour){
            this.formData0.nonproductiveTime = this.formData0.approvedWorkingHour*val
            this.formData0.reviewerNonproductiveTime = this.formData0.approvedWorkingHour*val
          }
        }else{
          this.$message.error('请输入数字')
          this.formData0.amount = ''
          this.formData0.reviewerNumber = ''
        }
      }
    },
    'formData0.approvedWorkingHour'(val){
      if(val&&this.formData0.amount){
        this.formData0.nonproductiveTime = this.formData0.amount*val
      if(val&&this.formData0.reviewerNumber){
        this.formData0.reviewerNonproductiveTime = this.formData0.reviewerNumber*val
      }
    }
  },
@@ -412,6 +456,8 @@
    this.selectshiftByUser()
    this.entityCopy = this.HaveJson(this.componentData.entity);
    this.entityCopy1 = this.HaveJson(this.componentData1.entity);
    this.componentData.tagField.weekDay.select = this.weekList
    this.componentData.selectField.weekDay.select = this.weekList
  },
  methods:{
    getYearAndMonthAndDays(date){
@@ -534,14 +580,16 @@
        this.$message.error('请输入数量')
        return
      }
      this.checkLoadY = true
      if(this.title == '审核'){
        // if(e==0){
        //   // 审核不通过
        // }else{
        //   // 审核通过
        // }
        this.formData0.state = e==0?'审核不通过':'审核通过'
        if(e==0){
          // 审核不通过
          this.checkLoadN = true
        }else{
          // 审核通过
          this.checkLoadY = true
        }
        this.formData0.state = e==0?this.formData0.state:'已审核'
        this.$axios.post(this.$api.auxiliaryWorkingHoursDay.check, {
            ...this.formData0
        }, {
@@ -549,7 +597,13 @@
            'Content-Type': 'application/json'
          }
        }).then(res => {
          this.checkLoadY = false
          if(e==0){
            // 审核不通过
            this.checkLoadN = false
          }else{
            // 审核通过
            this.checkLoadY = false
          }
          if (res.code == 201) return
          this.$message.success('操作成功')
          this.checkVisible = false
@@ -557,20 +611,24 @@
          this.collectWorkingHours()
        })
      }else{
        // if(e==0){
        //   // 审核不通过
        // }else{
        //   // 审核通过
        // }
        if(e==0){
          this.checkLoadN = true
        }else{
          this.checkLoadY = true
        }
        this.$axios.post(this.$api.auxiliaryWorkingHoursDay.approve, {
            id:this.formData0.id,
            state:e==0?'批准不通过':'批准通过'
            state:e==0?'已提交':'已批准'
        }, {
          headers: {
            'Content-Type': 'application/json'
          }
        }).then(res => {
          this.checkLoadY = false
          if(e==0){
            this.checkLoadN = false
          }else{
            this.checkLoadY = false
          }
          if (res.code == 201) return
          this.$message.success('操作成功')
          this.checkVisible = false
@@ -628,8 +686,13 @@
      if(this.formData.number){
        this.$axios.post(this.$api.auxiliaryWorkingHoursDay.selectAuxiliaryWorkingHoursByNumber+'?number='+this.formData.number).then(res => {
        this.auxiliaryWorking = res.data
        this.formData.approvedWorkingHour = this.auxiliaryWorking.approvedWorkingHour
        this.formData.auxiliaryProject = this.auxiliaryWorking.auxiliaryProject
        if(this.addVisible){
          this.formData.approvedWorkingHour = this.auxiliaryWorking.approvedWorkingHour
          this.formData.auxiliaryProject = this.auxiliaryWorking.auxiliaryProject
        }else if(this.title=='审核'&&this.checkVisible){
          this.formData0.approvedWorkingHour = this.auxiliaryWorking.approvedWorkingHour
          this.formData0.auxiliaryProject = this.auxiliaryWorking.auxiliaryProject
        }
      })
      }
    },
src/components/do/b3-work-time-management/work-time-statistics.vue
@@ -52,8 +52,8 @@
                :url="$api.auxiliaryWorkingHours.selectAuxiliaryWorkingHours"
                :componentData="componentData" :inputUrl="$api.auxiliaryWorkingHours.selectAuxiliaryWorkingHours" :downUrl="$api.auxiliaryWorkingHours.selectAuxiliaryWorkingHours" :key="upIndex" />
      <ValueTable ref="ValueTable1"
        v-show="currentTable == 'value1'"
                :url="$api.auxiliaryWorkingHours.selectAuxiliaryWorkingHours"
        v-if="currentTable == 'value1'"
                :url="$api.auxiliaryCorrectionHours.selectAuxiliaryCorrectionHours"
                :componentData="componentData0" :key="upIndex" />
    </div>
  </div>