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
               case "wxIncidentWithCmdb": //是否绑定资产
165
               case "wxIncidentWithCmdb": //是否绑定资产
166
                 localStorage.setItem("wxIncidentWithCmdb", v.valueconfig);
166
                 localStorage.setItem("wxIncidentWithCmdb", v.valueconfig);
167
                 break;
167
                 break;
168
+              case "ifWorking": //是否开通上下班
169
+                localStorage.setItem("ifWorking", v.valueconfig);
170
+                break;
168
               // case "wxBxQuestions": //微信报修常见问题链接
171
               // case "wxBxQuestions": //微信报修常见问题链接
169
               //   localStorage.setItem("wxBxQuestions", v.valueconfig);
172
               //   localStorage.setItem("wxBxQuestions", v.valueconfig);
170
               //   break;
173
               //   break;

+ 45 - 21
src/views/indes.vue

@@ -39,7 +39,7 @@
39
       <!-- 统计信息 -->
39
       <!-- 统计信息 -->
40
       <div
40
       <div
41
         class="newStatistics"
41
         class="newStatistics"
42
-        v-if="!newStatisticsLoading && isShowNewStatistics"
42
+        v-if="ifWorking == 1 && !newStatisticsLoading && isShowNewStatistics"
43
       >
43
       >
44
         <div class="buildOrder">
44
         <div class="buildOrder">
45
           <router-link
45
           <router-link
@@ -60,20 +60,36 @@
60
           </router-link>
60
           </router-link>
61
         </div>
61
         </div>
62
         <div class="attendance">
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
             <div class="s_num">{{ newStatistics.usersCount }}</div>
68
             <div class="s_num">{{ newStatistics.usersCount }}</div>
65
             <div>应到</div>
69
             <div>应到</div>
66
           </router-link>
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
             <div class="s_num">{{ newStatistics.onlineCount }}</div>
76
             <div class="s_num">{{ newStatistics.onlineCount }}</div>
69
             <div>实到</div>
77
             <div>实到</div>
70
           </router-link>
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
             <div class="s_num">{{ newStatistics.unOnlineCount }}</div>
84
             <div class="s_num">{{ newStatistics.unOnlineCount }}</div>
73
             <div>未打卡</div>
85
             <div>未打卡</div>
74
           </router-link>
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
             <div>昨日早退</div>
93
             <div>昨日早退</div>
78
           </router-link>
94
           </router-link>
79
         </div>
95
         </div>
@@ -199,7 +215,12 @@
199
           </span>
215
           </span>
200
         </div>
216
         </div>
201
         <div class="conentBox" v-if="!newNoticeNoData && !newNoticeLoading">
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
             <div class="head overflowEllipsis2">{{ v.title }}</div>
224
             <div class="head overflowEllipsis2">{{ v.title }}</div>
204
             <div class="cot">
225
             <div class="cot">
205
               {{ v.createTime | timeFormat("yyyy-MM-dd HH:mm") }}
226
               {{ v.createTime | timeFormat("yyyy-MM-dd HH:mm") }}
@@ -225,10 +246,11 @@ import { SM } from "./../http/http";
225
 export default {
246
 export default {
226
   data() {
247
   data() {
227
     return {
248
     return {
228
-      wxClQuestions:localStorage.getItem("wxClQuestions"),
249
+      wxClQuestions: localStorage.getItem("wxClQuestions"),
229
       loginUser: JSON.parse(localStorage.getItem("loginUser")),
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
       noticeData: "", //公告列表
254
       noticeData: "", //公告列表
233
       dataList: "", //最新报修
255
       dataList: "", //最新报修
234
       state: "", //流程状态
256
       state: "", //流程状态
@@ -250,11 +272,11 @@ export default {
250
     };
272
     };
251
   },
273
   },
252
   methods: {
274
   methods: {
253
-    scan(){
275
+    scan() {
254
       // this.$router.push({name:'ScanResult',params:{data:'[{"name":"资产名称","value":"哈哈哈"},{"name":"数量","value":"12"}]'}});
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
     getNoticData() {
282
     getNoticData() {
@@ -281,12 +303,14 @@ export default {
281
     // 获取统计信息
303
     // 获取统计信息
282
     getManagerIndexInfo() {
304
     getManagerIndexInfo() {
283
       this.newStatisticsLoading = true;
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
     getNewRapir() {
316
     getNewRapir() {
@@ -393,7 +417,7 @@ export default {
393
     localStorage.removeItem("order");
417
     localStorage.removeItem("order");
394
     this.getNoticData();
418
     this.getNoticData();
395
     this.getNewRapir();
419
     this.getNewRapir();
396
-    if (this.isShowNewStatistics) {
420
+    if (this.isShowNewStatistics && this.ifWorking == 1) {
397
       this.getManagerIndexInfo();
421
       this.getManagerIndexInfo();
398
     }
422
     }
399
   },
423
   },

+ 5 - 2
src/views/my.vue

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