seimin 3 gadi atpakaļ
vecāks
revīzija
926e106fb2
3 mainītis faili ar 48 papildinājumiem un 38 dzēšanām
  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 211
           text: "处理过",
212 212
           value: "done"
213 213
         },
214
-        {
215
-          text: "我创建",
216
-          value: "create"
217
-        }
214
+        // {
215
+        //   text: "我创建",
216
+        //   value: "create"
217
+        // }
218 218
       ],
219 219
       searchType: "userAll",
220 220
       type: "all",
@@ -401,7 +401,9 @@ export default {
401 401
         this.type = this.$route.params.type;
402 402
         if (this.type === "todo") {
403 403
           this.searchType = "todo";
404
-        } else {
404
+        }else if(this.type === "done"){
405
+          this.searchType = "done";
406
+        }else {
405 407
           this.searchType = "userAll";
406 408
         }
407 409
       }

+ 38 - 32
src/views/my.vue

@@ -66,7 +66,7 @@
66 66
             <span>{{ incidentCount.incidentDone || 0 }}</span>
67 67
           </div>
68 68
         </div>
69
-        <div class="status" @click="toIncidentList('create')">
69
+        <!-- <div class="status" @click="toIncidentList('create')">
70 70
           <div>
71 71
             <svg class="icon" aria-hidden="true">
72 72
               <use xlink:href="#icon-daipingjia"></use>
@@ -76,7 +76,7 @@
76 76
             <span>我创建</span>
77 77
             <span>{{ incidentCount.incidentCreate || 0 }}</span>
78 78
           </div>
79
-        </div>
79
+        </div> -->
80 80
       </div>
81 81
     </div>
82 82
     <div class="myRapir">
@@ -149,9 +149,6 @@ export default {
149 149
         }).show()
150 150
         return;
151 151
       }
152
-      // 本地测试
153
-      // this.goToWork(online, '123');
154
-      // return;
155 152
       let _this = this;
156 153
       this.toast = this.$createToast({
157 154
         time: 0,
@@ -159,6 +156,9 @@ export default {
159 156
         txt: "正在加载中"
160 157
       });
161 158
       this.toast.show();
159
+      // 本地测试
160
+      // this.goToWork(online, '123');
161
+      // return;
162 162
       //第二个参数 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02'
163 163
       sdk.getLocation(res => {
164 164
         // alert(JSON.stringify(res));
@@ -186,18 +186,18 @@ export default {
186 186
       this.$http
187 187
         .post("service/auth/online", { online, address })
188 188
         .then(res => {
189
-          this.toast.hide();//本地测试
190 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 199
           } else {
200
+            this.toast.hide();
201 201
              this.$createDialog({
202 202
               type: 'confirm',
203 203
               icon: 'cubeic-alert',
@@ -225,26 +225,19 @@ export default {
225 225
                 this.$http
226 226
                 .post("service/auth/online", { online, address, confirm:'ok' })
227 227
                 .then(res => {
228
-                  this.toast.hide();
229 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 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 260
     getGroups() {
257 261
       var that = this;
@@ -309,6 +313,8 @@ export default {
309 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 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 176
       } else if (this.searchType2 === "2") {
175 177
         //迟到
176 178
         this.items = arr.filter(v => v.extra2 == "迟到");