Ver Fonte

提交移动端审核二次确认框

Lijy há 8 meses atrás
pai
commit
01545e6ee5

+ 50 - 37
fhKeeper/formulahousekeeper/timesheet_h5/src/views/review/index.vue

@@ -213,6 +213,7 @@
 </template>
 
 <script>
+    import { Dialog } from 'vant';
     export default {
         data() {
             return {
@@ -361,20 +362,26 @@
                     ids = ids.substring(0, ids.length-1);
                 }
                 if(bol){
-                    this.isbatch = true
-                    this.approveinData = {
-                        ids: ids
-                    }
-                    if(this.user.timeType.needEvaluate == 1){
-                        this.$set(this.approveinData,'evaluate','')
-                        this.approveinDialog = true
-                    }else{
-                        const toast = this.$toast.loading({
-                            forbidClick: true,
-                            duration: 0
-                        });
-                        this.batchApproveinfun()
-                    }
+                    Dialog.confirm({
+                        message: `确认批量通过这些的日报吗?`
+                    })
+                    .then(() => {
+                        this.isbatch = true
+                        this.approveinData = {
+                            ids: ids
+                        }
+                        if(this.user.timeType.needEvaluate == 1){
+                            this.$set(this.approveinData,'evaluate','')
+                            this.approveinDialog = true
+                        }else{
+                            const toast = this.$toast.loading({
+                                forbidClick: true,
+                                duration: 0
+                            });
+                            this.batchApproveinfun()
+                        }
+                    })
+                    .catch(() => {});
                 }else{
                     const toast = this.$toast.loading({
                         forbidClick: true,
@@ -491,30 +498,36 @@
             },
 
             approve(id, item) {
-                
-                var ids = '';
-                var data = item.data;
-                data.forEach(element => {
-                    if (element.id != null && element.id != '') {
-                        ids +=(element.id+',');
-                    }
-                });
-                this.isbatch = false
-                this.approveinData = {
-                    id: id,
-                    date: this.nowTime,
-                    reportIds: ids
-                }
-                if(this.user.timeType.needEvaluate == 1){
-                    this.$set(this.approveinData,'evaluate','')
-                    this.approveinDialog = true
-                }else{
-                    const toast = this.$toast.loading({
-                        forbidClick: true,
-                        duration: 0
+                console.log(item, '<==== 点击')
+                Dialog.confirm({
+                    message: `确认通过${item.dateStr}的日报吗?`
+                })
+                .then(() => {
+                    var ids = '';
+                    var data = item.data;
+                    data.forEach(element => {
+                        if (element.id != null && element.id != '') {
+                            ids +=(element.id+',');
+                        }
                     });
-                    this.approveinfun()
-                }
+                    this.isbatch = false
+                    this.approveinData = {
+                        id: id,
+                        date: this.nowTime,
+                        reportIds: ids
+                    }
+                    if(this.user.timeType.needEvaluate == 1){
+                        this.$set(this.approveinData,'evaluate','')
+                        this.approveinDialog = true
+                    }else{
+                        const toast = this.$toast.loading({
+                            forbidClick: true,
+                            duration: 0
+                        });
+                        this.approveinfun()
+                    }
+                })
+                .catch(() => {});
             },
             approveinfun(){
                 let that = this;