gaoluyang
2024-07-17 c105b70fcf9819b5f597c254b395932f215ab98f
批注工时批量审核批准修改
已修改1个文件
47 ■■■■ 文件已修改
src/components/tool/value-table.vue 47 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/tool/value-table.vue
@@ -1110,41 +1110,22 @@
      batchCheck(e) {
        if (this.multipleSelection && this.multipleSelection.length > 0) {
          const list = JSON.parse(JSON.stringify(this.multipleSelection))
          const url = e === 0 ? this.$api.auxiliaryWorkingHoursDay.check : this.$api.auxiliaryWorkingHoursDay.approve
          const state = e === 0 ? '已审核' : '已批准'
          list.forEach(item => {
            if (e == 0) {
              item.state = '已审核'
              this.$axios.post(this.$api.auxiliaryWorkingHoursDay.check, {
                  ...item
                },{
                  headers: {
                    'Content-Type': 'application/json'
                  }
            this.$axios.post(url, {id: item.id, state: state
              },{
                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('操作成功')
              })
            }
              }
            ).then(res => {
              if (res.code === 201) {
                return
              }
              this.$parent.submitBatchCheckDialog()
              this.$message.success('操作成功')
            })
          })
        } else {
          this.$message.error('请选择至少一条数据')