Browse Source

撤回日报加确认,增加考勤时长显示

QuYueTing 6 months ago
parent
commit
1fe6c00f16

+ 28 - 23
fhKeeper/formulahousekeeper/timesheet_h5/src/views/edit/index.vue

@@ -1239,30 +1239,35 @@ export default {
             });
         },
         cancel() {
-            const toast = this.$toast.loading({
-                forbidClick: true,
-                duration: 0
-            });
-            var ids = '';
-            var data = this.form.domains;
-            data.forEach(element => {
-                if (element.id != null && element.id != '') {
-                    if (element.id) {
-                        ids += (element.id + ',');
-                    }
-                }
-            });
-            this.$axios.post("/report/cancel", { userId: this.user.id, reportIds: ids })
-                .then(res => {
-                    if (res.code == "ok") {
-                        this.$toast.clear();
-                        this.$toast.success('撤销成功');
-                        this.getReport();
-                    } else {
-                        this.$toast.clear();
-                        this.$toast.fail('获取失败');
+            this.$dialog.confirm({
+                title: '撤回日报',
+                message: '确定要撤回当天日报吗?'
+            }).then(() => {
+                const toast = this.$toast.loading({
+                    forbidClick: true,
+                    duration: 0
+                });
+                var ids = '';
+                var data = this.form.domains;
+                data.forEach(element => {
+                    if (element.id != null && element.id != '') {
+                        if (element.id) {
+                            ids += (element.id + ',');
+                        }
                     }
-                }).catch(err => { this.$toast.clear(); });
+                });
+                this.$axios.post("/report/cancel", { userId: this.user.id, reportIds: ids })
+                    .then(res => {
+                        if (res.code == "ok") {
+                            this.$toast.clear();
+                            this.$toast.success('撤销成功');
+                            this.getReport();
+                        } else {
+                            this.$toast.clear();
+                            this.$toast.fail('获取失败');
+                        }
+                    }).catch(err => { this.$toast.clear(); });
+            }).catch(() => { });
         },
 
         confirmWorkTime(field) {

+ 13 - 1
fhKeeper/formulahousekeeper/timesheet_h5/src/views/view/index.vue

@@ -67,7 +67,8 @@
                             </template>
                             <div class="form_text" v-if="user.timeType.onlyShowPercent == 0">
                                 <span style="margin-right:20px;margin-left:5px;font-size:14px;">
-                                    总填报:
+                                    <span v-if="user.timeType.showCorpwxCardtime" :style="item.cardTime !=item.reportTime?'color:#ff0000;':''">考勤时长:{{item.cardTime | amounts}}h</span>
+                                    总填报时长:
                                     <span>{{ parseFloat(item.reportTime).toFixed(1) }}h</span>
                                 </span>
                             </div>
@@ -326,7 +327,18 @@ export default {
     },
     created() {
     },
+    filters:{
+        // 过滤
+        amounts(value) {
+            if(value == NaN || value == undefined || value == 'undefined' || value == null || value == 'null') {
+                return 0
+            }
+            var zhi = +value + 0
+            return zhi.toFixed(1)
+        },
+    },
     methods: {
+        
         onDownRefresh() {
             this.pageIndex = 1
             this.upFinished = false // 不写这句会导致你上拉到底过后在下拉刷新将不能触发下拉加载事件