From c1a35f017eba33c14536784325f3fd16a60a603d Mon Sep 17 00:00:00 2001
From: zss <zss@example.com>
Date: 星期三, 17 七月 2024 16:20:56 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 src/components/do/b3-work-time-management/work-time-management.vue |  246 +++++++++++++++++++++++++++++++------------------
 1 files changed, 155 insertions(+), 91 deletions(-)

diff --git a/src/components/do/b3-work-time-management/work-time-management.vue b/src/components/do/b3-work-time-management/work-time-management.vue
index 1a2efab..bea077b 100644
--- a/src/components/do/b3-work-time-management/work-time-management.vue
+++ b/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('璇疯緭鍏ョ紪鍙�')

--
Gitblit v1.9.3