Browse Source

Merge branch 'lmm' into develop

seimin 3 years ago
parent
commit
3c9c0cafb7
3 changed files with 81 additions and 63 deletions
  1. 2 0
      http/http.js
  2. 2 2
      main.js
  3. 77 61
      pages/mypage/mypage.vue

+ 2 - 0
http/http.js

@@ -88,6 +88,7 @@ export function SM() {
88 88
       success: function(res) {
89 89
         let str = res.result.replace(/[\s\/]/g, '') || 'none';
90 90
         str = str.replace(/CODABAR,/i, '');
91
+        str = str.replace(/CODE_128,/i, '');
91 92
         resolve(str);
92 93
       },
93 94
       fail(err) {
@@ -120,6 +121,7 @@ export function SM() {
120 121
               // 当needResult 为 1 时,扫码返回的结果
121 122
               let str = res.resultStr.replace(/[\s\/]/g, '') || 'none';
122 123
               str = str.replace(/CODABAR,/i, '');
124
+              str = str.replace(/CODE_128,/i, '');
123 125
               resolve(str);
124 126
             },
125 127
             cancel(err){

+ 2 - 2
main.js

@@ -2,8 +2,8 @@ import Vue from 'vue'
2 2
 import App from './App'
3 3
 // #ifdef H5
4 4
 import wx from 'weixin-jsapi'
5
-import VConsole from 'vconsole';
6
-new VConsole();
5
+// import VConsole from 'vconsole';
6
+// new VConsole();
7 7
 Vue.prototype.wx = wx //声明扫码
8 8
 Vue.prototype.audios = [] //待播放的语音集合
9 9
 // #endif

+ 77 - 61
pages/mypage/mypage.vue

@@ -10,8 +10,9 @@
10 10
       <view class="topText">
11 11
         <view class="topTextHeader">
12 12
           <text>您好,{{ userData.name }}</text>
13
-          <button v-show="!userData.online" class="changeHospital" size="mini" type="default"
14
-            @click="changeHospital">切换院区</button>
13
+          <button v-show="!userData.online" class="changeHospital" size="mini" type="default" @click="changeHospital">
14
+            切换院区
15
+          </button>
15 16
         </view>
16 17
         <view>当前积分 : {{ tabNum.score }}</view>
17 18
       </view>
@@ -37,7 +38,11 @@
37 38
               align-items: center;
38 39
               justify-content: space-between;
39 40
             ">
40
-            <view class="tbTitle"> {{ types }}已完成工单{{ tabNums }}单,未评价工单{{tabEvaluate}}单,共计得分{{tabScores}}分 </view>
41
+            <view class="tbTitle">
42
+              {{ types }}已完成工单{{ tabNums }}单,未评价工单{{
43
+                tabEvaluate
44
+              }}单,共计得分{{ tabScores }}分
45
+            </view>
41 46
             <view class="tbText" @click="my_list(tabType)"> 查看明细>> </view>
42 47
           </view>
43 48
           <view class="canvasRing_wrap">
@@ -46,7 +51,11 @@
46 51
           </view>
47 52
         </view>
48 53
         <view class="TB1" v-show="tabNums == 0 && !TBLoading">
49
-          <view class="title"> {{ types }}已完成工单{{ tabComplete }}单,未评价工单{{tabEvaluate}}单,共计得分{{tabScores}}分 </view>
54
+          <view class="title">
55
+            {{ types }}已完成工单{{ tabComplete }}单,未评价工单{{
56
+              tabEvaluate
57
+            }}单,共计得分{{ tabScores }}分
58
+          </view>
50 59
           <view class="cont"> 暂无数据 </view>
51 60
         </view>
52 61
         <view class="TB_list" v-show="!TBLoading">
@@ -94,7 +103,7 @@
94 103
         hosModels: {
95 104
           disjunctor: false,
96 105
         },
97
-        type: '',
106
+        type: "",
98 107
         tabType: "day",
99 108
         tabNum: {},
100 109
         BtData: [],
@@ -123,38 +132,38 @@
123 132
       hosOk(hosId) {
124 133
         this.hosModels.disjunctor = false;
125 134
         uni.showLoading({
126
-          title: '正在加载中',
127
-          mask: true
135
+          title: "正在加载中",
136
+          mask: true,
128 137
         });
129
-        let type = '';
138
+        let type = "";
130 139
         // #ifdef APP-PLUS
131
-        type = 'APP';
140
+        type = "APP";
132 141
         // #endif
133 142
         // #ifdef H5
134
-        type = 'Wechat';
143
+        type = "Wechat";
135 144
         // #endif
136 145
         post("/auth/changeHospital", {
137
-          "currentHosId": hosId,
138
-          loginType: type
139
-        }).then(result => {
140
-          uni.hideLoading()
146
+          currentHosId: hosId,
147
+          loginType: type,
148
+        }).then((result) => {
149
+          uni.hideLoading();
141 150
           if (result.status == 200) {
142 151
             uni.showToast({
143
-              icon: 'success',
144
-              title: '切换院区成功'
152
+              icon: "success",
153
+              title: "切换院区成功",
145 154
             });
146
-            let userData = uni.getStorageSync('userData');
147
-            console.log(userData)
155
+            let userData = uni.getStorageSync("userData");
156
+            console.log(userData);
148 157
             userData.user.currentHospital = result.user.user.currentHospital;
149
-            uni.setStorageSync('userData', userData);
158
+            uni.setStorageSync("userData", userData);
150 159
             this.tab("day", "今日");
151 160
           } else {
152 161
             uni.showToast({
153
-              icon: 'none',
154
-              title: '切换院区失败'
162
+              icon: "none",
163
+              title: "切换院区失败",
155 164
             });
156 165
           }
157
-        })
166
+        });
158 167
       },
159 168
       // 切换院区-取消
160 169
       hosCancel() {
@@ -163,9 +172,9 @@
163 172
       // 切换院区
164 173
       changeHospital() {
165 174
         this.hosModels = {
166
-          title: '切换院区',
175
+          title: "切换院区",
167 176
           disjunctor: true,
168
-        }
177
+        };
169 178
       },
170 179
       // 绘图
171 180
       showRing(canvasId, chartData) {
@@ -237,8 +246,39 @@
237 246
       // 获取执行中列表
238 247
       getWorkingNum() {
239 248
         return post("/workerOrder/executingOrders", {
240
-          "idx": 0,
241
-          "sum": 1
249
+          idx: 0,
250
+          sum: 1,
251
+        });
252
+      },
253
+      // 自选排班下班
254
+      customOff() {
255
+        post("/auth/onOrOffLine", {
256
+          type: "off",
257
+          customWorking: "off",
258
+          classId: uni.getStorageSync("setDeptConfg").classesId,
259
+        }).then((res) => {
260
+          uni.hideLoading();
261
+          if (res.status == 200) {
262
+            let obj = uni.getStorageSync("userData");
263
+            obj.user.online = false;
264
+            if (uni.getStorageSync("setDeptConfg")) {
265
+              uni.removeStorageSync("setDeptConfg"); //清空选择的科室配置,初始化
266
+            }
267
+            if (uni.getStorageSync("setDepts")) {
268
+              uni.removeStorageSync("setDepts"); //清空选择的科室,初始化
269
+            }
270
+            if (uni.getStorageSync("manager")) {
271
+              uni.removeStorageSync("manager"); //清空选择的分组组长,初始化
272
+            }
273
+            uni.setStorageSync("userData", obj);
274
+            this.getCurrentUser();
275
+            this.getTabData();
276
+          } else {
277
+            uni.showToast({
278
+              icon: "none",
279
+              title: "请求失败!",
280
+            });
281
+          }
242 282
         });
243 283
       },
244 284
       //上下班弹窗确定
@@ -258,41 +298,13 @@
258 298
           this.getWorkSchemeAndRule().then((ress) => {
259 299
             if (ress.status == 200) {
260 300
               let workType = ress.settings ? ress.settings.workType : -1; //1是综合,2是自主
261
-              let ruleType = ress.settings ? ress.settings.ruleType : -1; //3是科室绑定人员,4是科室绑定分组,2是绑定分组
262 301
               // 自主下班,并且是科室绑定人员,科室绑定分组,绑定分组
263
-              if (workType == 2 && (ruleType == 1||ruleType == 2||ruleType == 3||ruleType == 4)) {
264
-                post("/auth/onOrOffLine", {
265
-                  type: "off",
266
-                  customWorking: "off",
267
-                  classId:uni.getStorageSync("setDeptConfg").classesId
268
-                }).then((res) => {
269
-                  uni.hideLoading();
270
-                  if (res.status == 200) {
271
-                    let obj = uni.getStorageSync("userData");
272
-                    obj.user.online = false;
273
-                    if (uni.getStorageSync("setDeptConfg")) {
274
-                      uni.removeStorageSync("setDeptConfg"); //清空选择的科室配置,初始化
275
-                    }
276
-                    if (uni.getStorageSync("setDepts")) {
277
-                      uni.removeStorageSync("setDepts"); //清空选择的科室,初始化
278
-                    }
279
-                    if (uni.getStorageSync("manager")) {
280
-                      uni.removeStorageSync("manager"); //清空选择的分组组长,初始化
281
-                    }
282
-                    uni.setStorageSync("userData", obj);
283
-                    this.getCurrentUser();
284
-                    this.getTabData();
285
-                  } else {
286
-                    uni.showToast({
287
-                      icon: "none",
288
-                      title: "请求失败!",
289
-                    });
290
-                  }
291
-                });
302
+              if (workType == 2) {
303
+                this.customOff();
292 304
               } else {
293 305
                 post("/auth/onOrOffLine", {
294 306
                   type: "off",
295
-                  classId:uni.getStorageSync("setDeptConfg").classesId
307
+                  classId: uni.getStorageSync("setDeptConfg").classesId,
296 308
                 }).then((res) => {
297 309
                   uni.hideLoading();
298 310
                   if (res.status == 200) {
@@ -318,6 +330,9 @@
318 330
                   }
319 331
                 });
320 332
               }
333
+            } else if (ress.status == 500) {
334
+              //500的时候自选下班
335
+              this.customOff();
321 336
             } else {
322 337
               uni.hideLoading();
323 338
               uni.showToast({
@@ -340,8 +355,8 @@
340 355
           //有online为上班 传off
341 356
           this.type = "off";
342 357
           uni.showLoading({
343
-            title: '加载中',
344
-            mask: true
358
+            title: "加载中",
359
+            mask: true,
345 360
           });
346 361
           let workingNumResult = await this.getWorkingNum();
347 362
           uni.hideLoading();
@@ -349,7 +364,8 @@
349 364
             workingNum = workingNumResult.data.data.length;
350 365
           }
351 366
           if (workingNum) {
352
-            types = "您还<b style='color:red'>有未完成的工单</b>,确定下班后,<b style='color:red'>未完成工单将不计算积分。</b>";
367
+            types =
368
+              "您还<b style='color:red'>有未完成的工单</b>,确定下班后,<b style='color:red'>未完成工单将不计算积分。</b>";
353 369
           } else {
354 370
             types = "确定是否下班 ?";
355 371
           }
@@ -359,7 +375,7 @@
359 375
         }
360 376
         this.models = {
361 377
           disjunctor: true,
362
-          title: this.type == 'off' ? '下班提醒' : "上班提醒",
378
+          title: this.type == "off" ? "下班提醒" : "上班提醒",
363 379
           content: types,
364 380
           icon: "warn",
365 381
           operate: {