Browse Source

上下班修改

seimin 3 years ago
parent
commit
b38696fd39
3 changed files with 125 additions and 59 deletions
  1. 2 2
      main.js
  2. 95 50
      pages/receiptpage/receiptpage.vue
  3. 28 7
      pages/setDept/setDept.vue

+ 2 - 2
main.js

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

+ 95 - 50
pages/receiptpage/receiptpage.vue

@@ -5,10 +5,10 @@
5
         :key="item.value" @click="clickHandler(item.label)">
5
         :key="item.value" @click="clickHandler(item.label)">
6
         {{ item.label }}
6
         {{ item.label }}
7
         <text class="tab_num">( {{ item.num }} )</text>
7
         <text class="tab_num">( {{ item.num }} )</text>
8
-        <view class="more" v-if="item.label==='执行中'"></view>
9
-        <picker class="more_picker" v-if="item.label==='执行中'" @click.stop @change="execFilter($event)" :value="index"
8
+        <view class="more" v-if="item.label === '执行中'"></view>
9
+        <picker class="more_picker" v-if="item.label === '执行中'" @click.stop @change="execFilter($event)" :value="index"
10
           :range="array" range-key="name">
10
           :range="array" range-key="name">
11
-          <view class="uni-input">{{array[index].name}}</view>
11
+          <view class="uni-input">{{ array[index].name }}</view>
12
         </picker>
12
         </picker>
13
       </view>
13
       </view>
14
     </view>
14
     </view>
@@ -54,7 +54,9 @@
54
                 <!-- 待取货 -->
54
                 <!-- 待取货 -->
55
               </view>
55
               </view>
56
               <view class="page_item_top_R type">
56
               <view class="page_item_top_R type">
57
-                {{item.isHalfInspect===1?'半程陪检':item.taskType.taskName}}
57
+                {{
58
+                  item.isHalfInspect === 1 ? "半程陪检" : item.taskType.taskName
59
+                }}
58
               </view>
60
               </view>
59
             </view>
61
             </view>
60
             <view class="page_item_cont" @click="itemInfo(item.id)">
62
             <view class="page_item_cont" @click="itemInfo(item.id)">
@@ -95,17 +97,26 @@
95
                 </view>
97
                 </view>
96
                 <view v-if="item.patient.careLevel">
98
                 <view v-if="item.patient.careLevel">
97
                   护理等级 :
99
                   护理等级 :
98
-                  <text
99
-                    :class="[(item.patient.careLevel.value==0||item.patient.careLevel.value==1)?'red':'green']">{{ item.patient.careLevel.name}}</text>
100
+                  <text :class="[
101
+                      item.patient.careLevel.value == 0 ||
102
+                      item.patient.careLevel.value == 1
103
+                        ? 'red'
104
+                        : 'green',
105
+                    ]">{{ item.patient.careLevel.name }}</text>
100
                 </view>
106
                 </view>
101
                 <view v-if="item.patient.illnessState">
107
                 <view v-if="item.patient.illnessState">
102
                   病情级别 :
108
                   病情级别 :
103
-                  <text
104
-                    :class="{red:item.patient.illnessState.value==2||item.patient.illnessState.value==3}">{{ item.patient.illnessState.name}}</text>
109
+                  <text :class="{
110
+                      red:
111
+                        item.patient.illnessState.value == 2 ||
112
+                        item.patient.illnessState.value == 3,
113
+                    }">{{ item.patient.illnessState.name }}</text>
105
                 </view>
114
                 </view>
106
-                <view v-if="item.isAccompany===1||item.isAccompany===0">
115
+                <view v-if="item.isAccompany === 1 || item.isAccompany === 0">
107
                   陪同情况 :
116
                   陪同情况 :
108
-                  <text :class="{red:item.isAccompany===1}">{{ item.isAccompany===1?'需要医护陪同':'无需医护陪同'}}</text>
117
+                  <text :class="{ red: item.isAccompany === 1 }">{{
118
+                    item.isAccompany === 1 ? "需要医护陪同" : "无需医护陪同"
119
+                  }}</text>
109
                 </view>
120
                 </view>
110
               </view>
121
               </view>
111
               <view class="page_item_conts" v-if="item.taskType.associationType.value == 'patientTransport'">
122
               <view class="page_item_conts" v-if="item.taskType.associationType.value == 'patientTransport'">
@@ -120,27 +131,37 @@
120
                 </view>
131
                 </view>
121
                 <view v-if="item.patient.careLevel">
132
                 <view v-if="item.patient.careLevel">
122
                   护理等级 :
133
                   护理等级 :
123
-                  <text
124
-                    :class="[(item.patient.careLevel.value==0||item.patient.careLevel.value==1)?'red':'green']">{{ item.patient.careLevel.name}}</text>
134
+                  <text :class="[
135
+                      item.patient.careLevel.value == 0 ||
136
+                      item.patient.careLevel.value == 1
137
+                        ? 'red'
138
+                        : 'green',
139
+                    ]">{{ item.patient.careLevel.name }}</text>
125
                 </view>
140
                 </view>
126
                 <view v-if="item.patient.illnessState">
141
                 <view v-if="item.patient.illnessState">
127
                   病情级别 :
142
                   病情级别 :
128
-                  <text
129
-                    :class="{red:item.patient.illnessState.value==2||item.patient.illnessState.value==3}">{{ item.patient.illnessState.name}}</text>
143
+                  <text :class="{
144
+                      red:
145
+                        item.patient.illnessState.value == 2 ||
146
+                        item.patient.illnessState.value == 3,
147
+                    }">{{ item.patient.illnessState.name }}</text>
130
                 </view>
148
                 </view>
131
-                <view v-if="item.isAccompany===1||item.isAccompany===0">
149
+                <view v-if="item.isAccompany === 1 || item.isAccompany === 0">
132
                   陪同情况 :
150
                   陪同情况 :
133
-                  <text :class="{red:item.isAccompany===1}">{{ item.isAccompany===1?'需要医护陪同':'无需医护陪同'}}</text>
151
+                  <text :class="{ red: item.isAccompany === 1 }">{{
152
+                    item.isAccompany === 1 ? "需要医护陪同" : "无需医护陪同"
153
+                  }}</text>
134
                 </view>
154
                 </view>
135
               </view>
155
               </view>
136
               <view class="page_item_conts" v-if="item.taskType.associationType.value == 'drugsBag'">
156
               <view class="page_item_conts" v-if="item.taskType.associationType.value == 'drugsBag'">
137
                 <view>
157
                 <view>
138
-                  药包编码 : {{ item.drugs?item.drugs.packid:'无'}}
158
+                  药包编码 : {{ item.drugs ? item.drugs.packid : "无" }}
139
                 </view>
159
                 </view>
140
               </view>
160
               </view>
141
               <view class="page_item_conts" v-if="item.taskType.associationType.value == 'jPBag'">
161
               <view class="page_item_conts" v-if="item.taskType.associationType.value == 'jPBag'">
142
                 <view>
162
                 <view>
143
-                  药包编码 : {{ item.staticDistri?item.staticDistri.packid:'无'}}
163
+                  药包编码 :
164
+                  {{ item.staticDistri ? item.staticDistri.packid : "无" }}
144
                 </view>
165
                 </view>
145
               </view>
166
               </view>
146
               <view class="line"></view>
167
               <view class="line"></view>
@@ -238,18 +259,22 @@
238
       return {
259
       return {
239
         // 筛选条件
260
         // 筛选条件
240
         array: [{
261
         array: [{
241
-          id: 0,
242
-          name: '全部'
243
-        }, {
244
-          id: 71,
245
-          name: '待到达'
246
-        }, {
247
-          id: 72,
248
-          name: '待送达'
249
-        }, {
250
-          id: 75,
251
-          name: '执行中'
252
-        }, ],
262
+            id: 0,
263
+            name: "全部",
264
+          },
265
+          {
266
+            id: 71,
267
+            name: "待到达",
268
+          },
269
+          {
270
+            id: 72,
271
+            name: "待送达",
272
+          },
273
+          {
274
+            id: 75,
275
+            name: "执行中",
276
+          },
277
+        ],
253
         index: 0,
278
         index: 0,
254
         arrayKey: 0,
279
         arrayKey: 0,
255
         // 当前登录人是否是药房角色
280
         // 当前登录人是否是药房角色
@@ -336,39 +361,41 @@
336
         this.zxzData = [];
361
         this.zxzData = [];
337
         this.totalNum = -1;
362
         this.totalNum = -1;
338
         this.idx = 0;
363
         this.idx = 0;
339
-        this.selectedLabelSlots = '执行中';
364
+        this.selectedLabelSlots = "执行中";
340
         this.executingOrders(0);
365
         this.executingOrders(0);
341
       },
366
       },
342
       // 获取科室二维码设置开关
367
       // 获取科室二维码设置开关
343
       getMenu() {
368
       getMenu() {
344
-        let menu = uni.getStorageSync('userData').menu;
369
+        let menu = uni.getStorageSync("userData").menu;
345
         //判断当前登陆人具体角色 start
370
         //判断当前登陆人具体角色 start
346
         let roles = uni.getStorageSync("userData").user.role;
371
         let roles = uni.getStorageSync("userData").user.role;
347
-        this.pharmacistFlag = roles.some(item => item.rolecode === "pharmacist");
372
+        this.pharmacistFlag = roles.some(
373
+          (item) => item.rolecode === "pharmacist"
374
+        );
348
         //判断当前登陆人具体角色 end
375
         //判断当前登陆人具体角色 end
349
         console.log(menu);
376
         console.log(menu);
350
-        menu.forEach(item => {
351
-          if (item.link === 'wxInspect') {
377
+        menu.forEach((item) => {
378
+          if (item.link === "wxInspect") {
352
             this.content.push({
379
             this.content.push({
353
               text: "检查信息",
380
               text: "检查信息",
354
             });
381
             });
355
-          } else if (item.link === 'wxPatient') {
382
+          } else if (item.link === "wxPatient") {
356
             this.content.push({
383
             this.content.push({
357
               text: "患者信息",
384
               text: "患者信息",
358
             });
385
             });
359
-          } else if (item.link === 'wxPharmacy') {
386
+          } else if (item.link === "wxPharmacy") {
360
             // 如果是配药师人员,则增加药房
387
             // 如果是配药师人员,则增加药房
361
             if (this.pharmacistFlag) {
388
             if (this.pharmacistFlag) {
362
               this.content.push({
389
               this.content.push({
363
                 text: "药房",
390
                 text: "药房",
364
               });
391
               });
365
             }
392
             }
366
-          } else if (item.link === 'wxCode') {
393
+          } else if (item.link === "wxCode") {
367
             this.content.push({
394
             this.content.push({
368
               text: "二维码设置",
395
               text: "二维码设置",
369
             });
396
             });
370
           }
397
           }
371
-        })
398
+        });
372
       },
399
       },
373
       // 拍照
400
       // 拍照
374
       photograph(data) {
401
       photograph(data) {
@@ -521,7 +548,7 @@
521
       },
548
       },
522
       //执行中列表数据获取
549
       //执行中列表数据获取
523
       executingOrders(idx) {
550
       executingOrders(idx) {
524
-        console.log(this.zxzData.length, this.totalNum)
551
+        console.log(this.zxzData.length, this.totalNum);
525
         if (this.zxzData.length == this.totalNum) {
552
         if (this.zxzData.length == this.totalNum) {
526
           uni.showToast({
553
           uni.showToast({
527
             icon: "none",
554
             icon: "none",
@@ -692,16 +719,34 @@
692
     onLoad() {
719
     onLoad() {
693
       // 获取菜单权限
720
       // 获取菜单权限
694
       this.getMenu();
721
       this.getMenu();
695
-      let setDeptConfg = uni.getStorageSync("setDeptConfg");
696
-      let manager = uni.getStorageSync("manager");
697
-      let userId = uni.getStorageSync("userData").user.id;
698
-      console.log(setDeptConfg,manager,userId)
699
-      if (setDeptConfg.workSchemeType == 2 && (setDeptConfg.ruleType == 3 || (setDeptConfg.ruleType == 4 && userId == manager) )) {
700
-        //自选排班,科室绑定人员 || 科室绑定分组 && 组长是当前登陆人
701
-        this.content.unshift({
702
-          text: "负责科室",
703
-        });
704
-      }
722
+      post("/auth/getUserWorkDept", {}).then((ress) => {
723
+        if (ress.status == 200) {
724
+          // let userId = uni.getStorageSync("userData").user.id;
725
+          let groupManager = ress.settings && ress.settings.groupManager; //当前工作组合选择的组
726
+          let workType = ress.settings ? ress.settings.workType : -1; //1是综合,2是自主
727
+          let ruleType = ress.settings ? ress.settings.ruleType : -1; //3是科室绑定人员,4是科室绑定分组,2是绑定分组
728
+          if (workType == 2 && (ruleType == 3 || (ruleType == 4 && groupManager))) {
729
+            //自选排班,科室绑定分组,当前登陆人是组长
730
+            this.content.unshift({
731
+              text: "负责科室",
732
+            });
733
+          }
734
+        }
735
+      });
736
+      // let setDeptConfg = uni.getStorageSync("setDeptConfg");
737
+      // let manager = uni.getStorageSync("manager");
738
+      // let userId = uni.getStorageSync("userData").user.id;
739
+      // console.log(setDeptConfg, manager, userId);
740
+      // if (
741
+      //   setDeptConfg.workSchemeType == 2 &&
742
+      //   (setDeptConfg.ruleType == 3 ||
743
+      //     (setDeptConfg.ruleType == 4 && userId == manager))
744
+      // ) {
745
+      //   //自选排班,科室绑定人员 || 科室绑定分组 && 组长是当前登陆人
746
+      //   this.content.unshift({
747
+      //     text: "负责科室",
748
+      //   });
749
+      // }
705
       // #ifdef APP-PLUS
750
       // #ifdef APP-PLUS
706
       // this.content.push({
751
       // this.content.push({
707
       //   text: "退出登录",
752
       //   text: "退出登录",

+ 28 - 7
pages/setDept/setDept.vue

@@ -130,10 +130,11 @@
130
             deptIds: ids1.join(),
130
             deptIds: ids1.join(),
131
             userId: this.userId,
131
             userId: this.userId,
132
             changeDept: 1,
132
             changeDept: 1,
133
-            classId: setDeptConfg.classesId
133
+            classId: setDeptConfg.classesId,
134
           };
134
           };
135
-          if(setDeptConfg.workSchemeType == 2 && setDeptConfg.ruleType == 4){
135
+          if (setDeptConfg.workSchemeType == 2 && setDeptConfg.ruleType == 4 && this.changedept == 1) {
136
             //自选排班,科室绑定分组
136
             //自选排班,科室绑定分组
137
+            console.log(setDeptConfg)
137
             postData1.groupIds = setDeptConfg.selectGroupId.toString();
138
             postData1.groupIds = setDeptConfg.selectGroupId.toString();
138
             postData1.isManager = true;
139
             postData1.isManager = true;
139
           }
140
           }
@@ -147,14 +148,15 @@
147
               },
148
               },
148
               deptList: ids2,
149
               deptList: ids2,
149
               hosId: uni.getStorageSync("userData").user.currentHospital.id,
150
               hosId: uni.getStorageSync("userData").user.currentHospital.id,
150
-              classId: setDeptConfg.classesId
151
+              classId: setDeptConfg.classesId,
151
             },
152
             },
152
           };
153
           };
153
           uni.showLoading({
154
           uni.showLoading({
154
             title: "加载中",
155
             title: "加载中",
155
             mask: true,
156
             mask: true,
156
           });
157
           });
157
-          if (this.changedept == 1) { //单纯切换科室!!!!
158
+          if (this.changedept == 1) {
159
+            //单纯切换科室!!!!
158
             //切换负责科室,不重新上班
160
             //切换负责科室,不重新上班
159
             post("/auth/customOnline", postData1).then((res) => {
161
             post("/auth/customOnline", postData1).then((res) => {
160
               if (res.status == 200) {
162
               if (res.status == 200) {
@@ -208,10 +210,11 @@
208
               quickId: this.id,
210
               quickId: this.id,
209
               deptIds: ids1.join(),
211
               deptIds: ids1.join(),
210
               userId: this.userId,
212
               userId: this.userId,
211
-              classId: setDeptConfg.classesId
213
+              classId: setDeptConfg.classesId,
212
             };
214
             };
213
-            if(setDeptConfg.workSchemeType == 2 && setDeptConfg.ruleType == 4){
215
+            if (setDeptConfg.workSchemeType == 2 && setDeptConfg.ruleType == 4) {
214
               //自选排班,科室绑定分组
216
               //自选排班,科室绑定分组
217
+              console.log(setDeptConfg)
215
               postData.groupIds = setDeptConfg.selectGroupId.toString();
218
               postData.groupIds = setDeptConfg.selectGroupId.toString();
216
               postData.isManager = true;
219
               postData.isManager = true;
217
             }
220
             }
@@ -261,10 +264,28 @@
261
           title: "加载中",
264
           title: "加载中",
262
           mask: true,
265
           mask: true,
263
         });
266
         });
264
-        post("/auth/getUserWorkDept", {}).then((res) => {
267
+        let setDeptConfg = uni.getStorageSync("setDeptConfg");
268
+        let postData = {};
269
+        if (setDeptConfg.workSchemeType == 2 && setDeptConfg.ruleType == 4 && this.changedept != 1) {
270
+          //自选排班,科室绑定分组,切换科室的时候
271
+          console.log(setDeptConfg)
272
+          postData.quickId = this.id;
273
+          postData.groupId = setDeptConfg.selectGroupId.toString();
274
+        }
275
+        if (setDeptConfg.workSchemeType == 2 && setDeptConfg.ruleType == 3 && this.changedept != 1) {
276
+          //自选排班,科室绑定人员,切换科室的时候
277
+          postData.quickId = this.id;
278
+        }
279
+        post("/auth/getUserWorkDept", postData).then((res) => {
265
           uni.hideLoading();
280
           uni.hideLoading();
266
           if (res.status == 200) {
281
           if (res.status == 200) {
267
             this.zxzData = res.data;
282
             this.zxzData = res.data;
283
+            if (res.settings) {
284
+              if (res.settings.groupManager) {
285
+                setDeptConfg.selectGroupId = res.settings.groupManager.groupIds;
286
+                uni.setStorageSync('setDeptConfg', setDeptConfg);
287
+              }
288
+            }
268
             uni.setStorageSync("setDepts", this.zxzData); //存科室列表
289
             uni.setStorageSync("setDepts", this.zxzData); //存科室列表
269
           }
290
           }
270
         });
291
         });