From a0faa6ff04f38f53728b97c21c82fd9798488e45 Mon Sep 17 00:00:00 2001
From: gaoluyang <gaoluyang@rengu.cc>
Date: 星期三, 17 七月 2024 15:49:25 +0800
Subject: [PATCH] 日工时管理的辅助工时增加可以批量审核和批准的功能

---
 src/components/tool/value-table.vue |   44 ++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 44 insertions(+), 0 deletions(-)

diff --git a/src/components/tool/value-table.vue b/src/components/tool/value-table.vue
index 0f74844..6416a82 100644
--- a/src/components/tool/value-table.vue
+++ b/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

--
Gitblit v1.9.3