Browse Source

上下班增加开关

seimin 3 years ago
parent
commit
bca7f7429d
3 changed files with 53 additions and 23 deletions
  1. 3 0
      src/views/Login.vue
  2. 45 21
      src/views/indes.vue
  3. 5 2
      src/views/my.vue

+ 3 - 0
src/views/Login.vue

@@ -165,6 +165,9 @@ export default {
165 165
               case "wxIncidentWithCmdb": //是否绑定资产
166 166
                 localStorage.setItem("wxIncidentWithCmdb", v.valueconfig);
167 167
                 break;
168
+              case "ifWorking": //是否开通上下班
169
+                localStorage.setItem("ifWorking", v.valueconfig);
170
+                break;
168 171
               // case "wxBxQuestions": //微信报修常见问题链接
169 172
               //   localStorage.setItem("wxBxQuestions", v.valueconfig);
170 173
               //   break;

+ 45 - 21
src/views/indes.vue

@@ -39,7 +39,7 @@
39 39
       <!-- 统计信息 -->
40 40
       <div
41 41
         class="newStatistics"
42
-        v-if="!newStatisticsLoading && isShowNewStatistics"
42
+        v-if="ifWorking == 1 && !newStatisticsLoading && isShowNewStatistics"
43 43
       >
44 44
         <div class="buildOrder">
45 45
           <router-link
@@ -60,20 +60,36 @@
60 60
           </router-link>
61 61
         </div>
62 62
         <div class="attendance">
63
-          <router-link class="attendanceItem" :to="{ path: '/main/workList/1/0' }" tag="div">
63
+          <router-link
64
+            class="attendanceItem"
65
+            :to="{ path: '/main/workList/1/0' }"
66
+            tag="div"
67
+          >
64 68
             <div class="s_num">{{ newStatistics.usersCount }}</div>
65 69
             <div>应到</div>
66 70
           </router-link>
67
-          <router-link class="attendanceItem" :to="{ path: '/main/workList/1/1' }" tag="div">
71
+          <router-link
72
+            class="attendanceItem"
73
+            :to="{ path: '/main/workList/1/1' }"
74
+            tag="div"
75
+          >
68 76
             <div class="s_num">{{ newStatistics.onlineCount }}</div>
69 77
             <div>实到</div>
70 78
           </router-link>
71
-          <router-link class="attendanceItem" :to="{ path: '/main/workList/1/4' }" tag="div">
79
+          <router-link
80
+            class="attendanceItem"
81
+            :to="{ path: '/main/workList/1/4' }"
82
+            tag="div"
83
+          >
72 84
             <div class="s_num">{{ newStatistics.unOnlineCount }}</div>
73 85
             <div>未打卡</div>
74 86
           </router-link>
75
-          <router-link class="attendanceItem" :to="{ path: '/main/workList/2/3' }" tag="div">
76
-            <div class="s_num">{{newStatistics.errorOfflineCount}}</div>
87
+          <router-link
88
+            class="attendanceItem"
89
+            :to="{ path: '/main/workList/2/3' }"
90
+            tag="div"
91
+          >
92
+            <div class="s_num">{{ newStatistics.errorOfflineCount }}</div>
77 93
             <div>昨日早退</div>
78 94
           </router-link>
79 95
         </div>
@@ -199,7 +215,12 @@
199 215
           </span>
200 216
         </div>
201 217
         <div class="conentBox" v-if="!newNoticeNoData && !newNoticeLoading">
202
-          <div class="conent" v-for="v in noticeData" :key="v.id" @click="toGuideDetail(v)">
218
+          <div
219
+            class="conent"
220
+            v-for="v in noticeData"
221
+            :key="v.id"
222
+            @click="toGuideDetail(v)"
223
+          >
203 224
             <div class="head overflowEllipsis2">{{ v.title }}</div>
204 225
             <div class="cot">
205 226
               {{ v.createTime | timeFormat("yyyy-MM-dd HH:mm") }}
@@ -225,10 +246,11 @@ import { SM } from "./../http/http";
225 246
 export default {
226 247
   data() {
227 248
     return {
228
-      wxClQuestions:localStorage.getItem("wxClQuestions"),
249
+      wxClQuestions: localStorage.getItem("wxClQuestions"),
229 250
       loginUser: JSON.parse(localStorage.getItem("loginUser")),
230
-      incidentWithConsumable: localStorage.getItem("incidentWithConsumable"),//是否绑定耗材
231
-      wxIncidentWithCmdb: localStorage.getItem("wxIncidentWithCmdb"),//是否绑定资产
251
+      incidentWithConsumable: localStorage.getItem("incidentWithConsumable"), //是否绑定耗材
252
+      wxIncidentWithCmdb: localStorage.getItem("wxIncidentWithCmdb"), //是否绑定资产
253
+      ifWorking: localStorage.getItem("ifWorking"), //是否开通上下班
232 254
       noticeData: "", //公告列表
233 255
       dataList: "", //最新报修
234 256
       state: "", //流程状态
@@ -250,11 +272,11 @@ export default {
250 272
     };
251 273
   },
252 274
   methods: {
253
-    scan(){
275
+    scan() {
254 276
       // this.$router.push({name:'ScanResult',params:{data:'[{"name":"资产名称","value":"哈哈哈"},{"name":"数量","value":"12"}]'}});
255
-      SM(this).then((ress1) => {
256
-        this.$router.push({name:'ScanResult',params:{data:ress1}});
257
-      })
277
+      SM(this).then(ress1 => {
278
+        this.$router.push({ name: "ScanResult", params: { data: ress1 } });
279
+      });
258 280
     },
259 281
     // 获取公告列表数据
260 282
     getNoticData() {
@@ -281,12 +303,14 @@ export default {
281 303
     // 获取统计信息
282 304
     getManagerIndexInfo() {
283 305
       this.newStatisticsLoading = true;
284
-      this.$http.post("service/bpm/data/getManagerIndexInfo", {today:true}).then(res => {
285
-        this.newStatisticsLoading = false;
286
-        if (res.status == 200) {
287
-          this.newStatistics = res.data.data;
288
-        }
289
-      });
306
+      this.$http
307
+        .post("service/bpm/data/getManagerIndexInfo", { today: true })
308
+        .then(res => {
309
+          this.newStatisticsLoading = false;
310
+          if (res.status == 200) {
311
+            this.newStatistics = res.data.data;
312
+          }
313
+        });
290 314
     },
291 315
     // 获取最新报修
292 316
     getNewRapir() {
@@ -393,7 +417,7 @@ export default {
393 417
     localStorage.removeItem("order");
394 418
     this.getNoticData();
395 419
     this.getNewRapir();
396
-    if (this.isShowNewStatistics) {
420
+    if (this.isShowNewStatistics && this.ifWorking == 1) {
397 421
       this.getManagerIndexInfo();
398 422
     }
399 423
   },

+ 5 - 2
src/views/my.vue

@@ -2,7 +2,7 @@
2 2
   <div class="bgColor">
3 3
     <div class="head">
4 4
       <template v-if="!isWorkLoading">
5
-        <div class="img" @click="getLocation(online)" v-show="isWorkOnline">
5
+        <div class="img" @click="getLocation(online)" v-show="ifWorking == 1 && isWorkOnline">
6 6
           {{ online == 1 ? "上班" : "下班" }}
7 7
         </div>
8 8
         <div class="name">{{ loginUser.name }}</div>
@@ -127,6 +127,7 @@ export default {
127 127
     return {
128 128
       loginUser: JSON.parse(localStorage.getItem("loginUser")),
129 129
       valConfig: JSON.parse(localStorage.getItem("valConfig")) - 0, //报修主体
130
+      ifWorking: localStorage.getItem("ifWorking"), //是否开通上下班
130 131
       incidentCount: "",
131 132
       promptingConent: "",
132 133
       promptingStatus: "",
@@ -335,7 +336,9 @@ export default {
335 336
   created() {
336 337
     this.getGroups();
337 338
     this.getIncidentData();
338
-    this.getWorkOnline();
339
+    if(this.ifWorking == 1){
340
+      this.getWorkOnline();
341
+    }
339 342
   },
340 343
 };
341 344
 </script>