seimin 3 years ago
parent
commit
926e106fb2
3 changed files with 48 additions and 38 deletions
  1. 7 5
      src/views/incidentList.vue
  2. 38 32
      src/views/my.vue
  3. 3 1
      src/views/workList.vue

+ 7 - 5
src/views/incidentList.vue

@@ -211,10 +211,10 @@ export default {
211
           text: "处理过",
211
           text: "处理过",
212
           value: "done"
212
           value: "done"
213
         },
213
         },
214
-        {
215
-          text: "我创建",
216
-          value: "create"
217
-        }
214
+        // {
215
+        //   text: "我创建",
216
+        //   value: "create"
217
+        // }
218
       ],
218
       ],
219
       searchType: "userAll",
219
       searchType: "userAll",
220
       type: "all",
220
       type: "all",
@@ -401,7 +401,9 @@ export default {
401
         this.type = this.$route.params.type;
401
         this.type = this.$route.params.type;
402
         if (this.type === "todo") {
402
         if (this.type === "todo") {
403
           this.searchType = "todo";
403
           this.searchType = "todo";
404
-        } else {
404
+        }else if(this.type === "done"){
405
+          this.searchType = "done";
406
+        }else {
405
           this.searchType = "userAll";
407
           this.searchType = "userAll";
406
         }
408
         }
407
       }
409
       }

+ 38 - 32
src/views/my.vue

@@ -66,7 +66,7 @@
66
             <span>{{ incidentCount.incidentDone || 0 }}</span>
66
             <span>{{ incidentCount.incidentDone || 0 }}</span>
67
           </div>
67
           </div>
68
         </div>
68
         </div>
69
-        <div class="status" @click="toIncidentList('create')">
69
+        <!-- <div class="status" @click="toIncidentList('create')">
70
           <div>
70
           <div>
71
             <svg class="icon" aria-hidden="true">
71
             <svg class="icon" aria-hidden="true">
72
               <use xlink:href="#icon-daipingjia"></use>
72
               <use xlink:href="#icon-daipingjia"></use>
@@ -76,7 +76,7 @@
76
             <span>我创建</span>
76
             <span>我创建</span>
77
             <span>{{ incidentCount.incidentCreate || 0 }}</span>
77
             <span>{{ incidentCount.incidentCreate || 0 }}</span>
78
           </div>
78
           </div>
79
-        </div>
79
+        </div> -->
80
       </div>
80
       </div>
81
     </div>
81
     </div>
82
     <div class="myRapir">
82
     <div class="myRapir">
@@ -149,9 +149,6 @@ export default {
149
         }).show()
149
         }).show()
150
         return;
150
         return;
151
       }
151
       }
152
-      // 本地测试
153
-      // this.goToWork(online, '123');
154
-      // return;
155
       let _this = this;
152
       let _this = this;
156
       this.toast = this.$createToast({
153
       this.toast = this.$createToast({
157
         time: 0,
154
         time: 0,
@@ -159,6 +156,9 @@ export default {
159
         txt: "正在加载中"
156
         txt: "正在加载中"
160
       });
157
       });
161
       this.toast.show();
158
       this.toast.show();
159
+      // 本地测试
160
+      // this.goToWork(online, '123');
161
+      // return;
162
       //第二个参数 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02'
162
       //第二个参数 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02'
163
       sdk.getLocation(res => {
163
       sdk.getLocation(res => {
164
         // alert(JSON.stringify(res));
164
         // alert(JSON.stringify(res));
@@ -186,18 +186,18 @@ export default {
186
       this.$http
186
       this.$http
187
         .post("service/auth/online", { online, address })
187
         .post("service/auth/online", { online, address })
188
         .then(res => {
188
         .then(res => {
189
-          this.toast.hide();//本地测试
190
           if (res.data.status == 200) {
189
           if (res.data.status == 200) {
191
-            this.online = online;
192
-            const t = this.$createToast({
193
-              type: "txt",
194
-              txt: online == 1 ? "上班成功" : "下班成功"
195
-            });
196
-            t.show();
197
-            setTimeout(() => {
198
-              t.hide();
199
-            }, 1000);
190
+            this.$http
191
+              .post("service/auth/showOnlineBtn", {})
192
+              .then((res) => {
193
+                this.toast.hide();
194
+                if(res.data.status == 200){
195
+                  this.online = res.data.online;
196
+                  this.showToast(online, '成功');
197
+                }
198
+              });
200
           } else {
199
           } else {
200
+            this.toast.hide();
201
              this.$createDialog({
201
              this.$createDialog({
202
               type: 'confirm',
202
               type: 'confirm',
203
               icon: 'cubeic-alert',
203
               icon: 'cubeic-alert',
@@ -225,26 +225,19 @@ export default {
225
                 this.$http
225
                 this.$http
226
                 .post("service/auth/online", { online, address, confirm:'ok' })
226
                 .post("service/auth/online", { online, address, confirm:'ok' })
227
                 .then(res => {
227
                 .then(res => {
228
-                  this.toast.hide();
229
                   if (res.data.status == 200) {
228
                   if (res.data.status == 200) {
230
-                    this.online = online;
231
-                    const t = this.$createToast({
232
-                      type: "txt",
233
-                      txt: online == 1 ? "上班成功" : "下班成功"
229
+                    this.$http
230
+                    .post("service/auth/showOnlineBtn", {})
231
+                    .then((res) => {
232
+                      this.toast.hide();
233
+                      if(res.data.status == 200){
234
+                        this.online = res.data.online;
235
+                        this.showToast(online, '成功')
236
+                      }
234
                     });
237
                     });
235
-                    t.show();
236
-                    setTimeout(() => {
237
-                      t.hide();
238
-                    }, 1000);
239
                   }else{
238
                   }else{
240
-                    const t = this.$createToast({
241
-                      type: "txt",
242
-                      txt: online == 1 ? "上班失败" : "下班失败"
243
-                    });
244
-                    t.show();
245
-                    setTimeout(() => {
246
-                      t.hide();
247
-                    }, 1000);
239
+                    this.toast.hide();
240
+                    this.showToast(online, '失败')
248
                   }
241
                   }
249
                 })
242
                 })
250
               },
243
               },
@@ -252,6 +245,17 @@ export default {
252
           }
245
           }
253
         });
246
         });
254
     },
247
     },
248
+    // 展示信息
249
+    showToast(online, msg){
250
+      const t = this.$createToast({
251
+        type: "txt",
252
+        txt: online == 1 ? "上班"+msg : "下班"+msg
253
+      });
254
+      t.show();
255
+      setTimeout(() => {
256
+        t.hide();
257
+      }, 1000);
258
+    },
255
     // 工作组
259
     // 工作组
256
     getGroups() {
260
     getGroups() {
257
       var that = this;
261
       var that = this;
@@ -309,6 +313,8 @@ export default {
309
                     this.online = res.data.online;
313
                     this.online = res.data.online;
310
                   }
314
                   }
311
                 });
315
                 });
316
+            }else{
317
+              this.isWorkLoading = false;
312
             }
318
             }
313
           }
319
           }
314
         });
320
         });

+ 3 - 1
src/views/workList.vue

@@ -170,7 +170,9 @@ export default {
170
       }
170
       }
171
       if (this.searchType2 === "1") {
171
       if (this.searchType2 === "1") {
172
         //实到
172
         //实到
173
-        this.items = arr.filter(v => v.extra2 == "正常");
173
+        let arr1 = arr.filter(v => v.extra2 == "迟到");
174
+        let arr2 = arr.filter(v => v.extra2 == "正常");
175
+        this.items = [...arr1,...arr2];
174
       } else if (this.searchType2 === "2") {
176
       } else if (this.searchType2 === "2") {
175
         //迟到
177
         //迟到
176
         this.items = arr.filter(v => v.extra2 == "迟到");
178
         this.items = arr.filter(v => v.extra2 == "迟到");