zss
2024-07-17 c1a35f017eba33c14536784325f3fd16a60a603d
Merge remote-tracking branch 'origin/master'
已修改3个文件
304 ■■■■■ 文件已修改
src/components/do/b3-work-time-management/work-time-management.vue 246 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/do/b6-device-management/b6-data-acquisition-config.vue 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/tool/value-table.vue 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/do/b3-work-time-management/work-time-management.vue
@@ -65,10 +65,12 @@
        <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>
        </p>
        <el-button size="small" type="primary" style="margin-right: 16px;" @click="openAdd" v-show="currentTable == 'ValueTable0'&&add">录入数据</el-button>
        <el-button size="small" type="primary" @click="openAdd" v-show="currentTable == 'ValueTable0'&&add">录入数据</el-button>
        <el-button size="small" type="primary"
        v-if="down"
        @click="handleOut" :loading="outLoading">导 出</el-button>
        <el-button size="small" type="primary" v-show="currentTable == 'ValueTable0'&&add" @click="openBatchCheck(0)">批量审核</el-button>
        <el-button size="small" type="primary" v-show="currentTable == 'ValueTable0'&&add" @click="openBatchCheck(1)">批量批准</el-button>
      </div>
    </div>
    <div class="table">
@@ -203,6 +205,17 @@
                </el-row>
            </span>
        </el-dialog>
    <el-dialog
      :title="batchCheckTitle"
      :visible.sync="batchCheckDialog"
      width="30%"
      :before-close="closeBatchCheckDialog">
      <span>{{batchCheckDialogMessage}}</span>
      <span slot="footer" class="dialog-footer">
    <el-button @click="batchCheckDialog = false">{{batchCheckTitle=='批量审核'?'不通过':'不批准'}}</el-button>
    <el-button type="primary" @click="batchCheck">{{batchCheckTitle=='批量审核'?'通 过':'批 准'}}</el-button>
  </span>
    </el-dialog>
  </div>
</template>
@@ -223,97 +236,104 @@
      down:false,
      add:false,
      componentData: {
                    entity: {
                        week: null,
                        weekDay: null,
                        dateTime: null,
            name:null,
                        orderBy: {
                            field: 'id',
                            order: 'desc'
                        }
                    },
                    isIndex: true,
                    showSelect: false,
                    select: false,
                    do: [{
                        id: 'delete',
                        font: '删除',
                        type: 'text',
                        method: 'doDiy'
                    }, {
                        id: 'handleEdit',
                        font: '编辑',
                        type: 'text',
                        method: 'handleEdit'
                    },{
                        id: 'handleCheck',
                        font: '审核',
                        type: 'text',
                        method: 'handleCheck'
                    }, {
                        id: 'handleRatify',
                        font: '批准',
                        type: 'text',
                        method: 'handleRatify'
                    }],
                    tagField: {
            shift:{
              select:[]
            },
            state:{
              select:[
                {
                  label:'已提交',
                  value:'已提交',
                  type:'primary'
                },
                {
                  label:'已审核',
                  value:'已审核',
                  type:'warning'
                },
                {
                  label:'已批准',
                  value:'已批准',
                  type:'success'
                },
              ]
            },
            weekDay:{
              select:[]
            }
        entity: {
          week: null,
          weekDay: null,
          dateTime: null,
          name:null,
          orderBy: {
            field: 'id',
            order: 'desc'
          }
        },
        isIndex: true,
        showSelect: true,
        select: true,
        selectMethod: 'handleChangeTask',
        do: [{
          id: 'delete',
          font: '删除',
          type: 'text',
          method: 'doDiy'
        }, {
          id: 'handleEdit',
          font: '编辑',
          type: 'text',
          method: 'handleEdit'
        },{
          id: 'handleCheck',
          font: '审核',
          type: 'text',
          method: 'handleCheck',
          disabFun: (row, index) => {
            return row.state === '已审核' || row.state === '已批准'
          }
        }, {
          id: 'handleRatify',
          font: '批准',
          type: 'text',
          method: 'handleRatify',
          disabFun: (row, index) => {
            return row.state === '已批准'
          }
        }],
        tagField: {
          shift:{
            select:[]
          },
                    linkEvent: {},
                    selectField: {
            shift:{
              select:[]
            },
            state:{
              select:[
                {
                  label:'已提交',
                  value:'已提交',
                  type:'primary'
                },
                {
                  label:'已审核',
                  value:'已审核',
                  type:'warning'
                },
                {
                  label:'已批准',
                  value:'已批准',
                  type:'success'
                },
              ]
            },
            weekDay:{
              select:[]
            }
          state:{
            select:[
              {
                label:'已提交',
                value:'已提交',
                type:'primary'
              },
              {
                label:'已审核',
                value:'已审核',
                type:'warning'
              },
              {
                label:'已批准',
                value:'已批准',
                type:'success'
              },
            ]
          },
                    requiredAdd: [],
                    requiredUp: []
          weekDay:{
            select:[]
          }
        },
        linkEvent: {},
        selectField: {
          shift:{
            select:[]
          },
          state:{
            select:[
              {
                label:'已提交',
                value:'已提交',
                type:'primary'
              },
              {
                label:'已审核',
                value:'已审核',
                type:'warning'
              },
              {
                label:'已批准',
                value:'已批准',
                type:'success'
              },
            ]
          },
          weekDay:{
            select:[]
          }
        },
        requiredAdd: [],
        requiredUp: []
            },
      entityCopy: {},
            upIndex: 0,
@@ -402,7 +422,11 @@
      ],
      totalInfo:null,
      auxiliaryWorking:null,
      outLoading:false
      outLoading:false,
      batchCheckTitle: '批量审核',
      batchCheckDialog: false,
      ValueTable0Selected: [],
      batchCheckDialogMessage: ''
    }
  },
  watch:{
@@ -481,6 +505,7 @@
      let formattedDate2 = `${year}-${month}-${day} 23:59:59`;
      this.entity.dateTime.push(formattedDate1);
      this.entity.dateTime.push(formattedDate2);
      this.refreshTable()
    },
    getPower(){
      let power = JSON.parse(sessionStorage.getItem('power'))
@@ -654,6 +679,45 @@
      this.formData0 = row;
      this.checkVisible = true
    },
    handleChangeTask (row) {
      this.ValueTable0Selected = JSON.parse(JSON.stringify(row))
    },
    openBatchCheck (e) {
      if (this.ValueTable0Selected.length > 0) {
        const isChecked = this.ValueTable0Selected.every(item => item.state === '已提交')
        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
          } else {
            this.$message.error('请选择未审核或未批准的数据')
          }
        } else {
          if (isApprove) {
            this.batchCheckDialog = true
          } else {
            this.$message.error('请选择未批准的数据')
          }
        }
      } else {
        this.$message.error('请选择至少一条数据')
      }
    },
    batchCheck () {
      const e = this.batchCheckTitle === '批量审核' ? 0 : 1
      this.$refs.ValueTable0.batchCheck(e)
    },
    closeBatchCheckDialog () {
      this.batchCheckDialog = false
    },
    submitBatchCheckDialog () {
      this.batchCheckDialog = false
      this.refreshTable()
      this.collectWorkingHours()
    },
    submitCheck(e){
      if(!this.formData0.number){
        this.$message.error('请输入编号')
src/components/do/b6-device-management/b6-data-acquisition-config.vue
@@ -203,11 +203,15 @@
      // 删除公式formItem
      const index = this.domains.indexOf(item)
      if (index !== -1 && this.domains.length > 1) {
        this.$axios.get(this.$api.deviceScope.deleteDataAcquisitionConfiguration + "?id=" + item.id).then(res => {
          if(res.code == 200) {
            this.domains.splice(index, 1)
          }
        })
        if(item.id){
            this.$axios.get(this.$api.deviceScope.deleteDataAcquisitionConfiguration + "?id=" + item.id).then(res => {
            if(res.code == 200) {
              this.domains.splice(index, 1)
            }
          })
        } else {
          this.domains.splice(index, 1)
        }
      } else {
        this.$message.error('不允许删除最后一条数据!');
      }
src/components/tool/value-table.vue
@@ -1106,6 +1106,50 @@
          this.$message.error('请选择要删除的数据')
        }
      },
      // 日工时管理辅助工时--批量审核和批准
      batchCheck(e) {
        if (this.multipleSelection && this.multipleSelection.length > 0) {
          const list = JSON.parse(JSON.stringify(this.multipleSelection))
          list.forEach(item => {
            if (e == 0) {
              item.state = '已审核'
              this.$axios.post(this.$api.auxiliaryWorkingHoursDay.check, {
                  ...item
                },{
                  headers: {
                    'Content-Type': 'application/json'
                  }
                }
              ).then(res => {
                if (res.code === 201) {
                  return
                }
                this.$parent.submitBatchCheckDialog()
                this.$message.success('操作成功')
              })
            } else {
              item.state = '已批准'
              this.$axios.post(this.$api.auxiliaryWorkingHoursDay.approve, {
                id: item.id,
                state: item.state
                },{
                  headers: {
                    'Content-Type': 'application/json'
                  }
                }
              ).then(res => {
                if (res.code === 201) {
                  return
                }
                this.$parent.submitBatchCheckDialog()
                this.$message.success('操作成功')
              })
            }
          })
        } else {
          this.$message.error('请选择至少一条数据')
        }
      },
      getRedColor(label,row){
        if(this.data.cellSpecialStyle&&this.data.cellSpecialStyle.redColorByKey&&label.includes(this.data.cellSpecialStyle.redColorByKey)&&row[(label.replace(this.data.cellSpecialStyle.redColorByKey, ""))]){
          return true