Przeglądaj źródła

非科室绑定人员不能使用上班历史记录

seimin 3 lat temu
rodzic
commit
b1976f3086
1 zmienionych plików z 77 dodań i 53 usunięć
  1. 77 53
      pages/homePage/homePage.vue

+ 77 - 53
pages/homePage/homePage.vue

@@ -20,7 +20,8 @@
20
           <radio-group @change="radioChange1">
20
           <radio-group @change="radioChange1">
21
             <label class="goWorkSelect-item relative" v-for="item in zxzData" :key="item.str">
21
             <label class="goWorkSelect-item relative" v-for="item in zxzData" :key="item.str">
22
               <radio :value="item.str" :checked="item.checked" />
22
               <radio :value="item.str" :checked="item.checked" />
23
-              <picker class="picker" v-if="item.ruleType == 4" @change="bindPickerChange" :value="index" :range="groups" range-key="groupName">
23
+              <picker class="picker" v-if="item.ruleType == 4" @change="bindPickerChange" :value="index" :range="groups"
24
+                range-key="groupName">
24
                 <view>{{ item.configName }}</view>
25
                 <view>{{ item.configName }}</view>
25
               </picker>
26
               </picker>
26
               <view v-else>{{ item.configName }}</view>
27
               <view v-else>{{ item.configName }}</view>
@@ -74,8 +75,8 @@
74
       :content="modelsLock.content" @ok="okLock" @cancel="cancelLock" :operate="modelsLock.operate" @know="knowLock">
75
       :content="modelsLock.content" @ok="okLock" @cancel="cancelLock" :operate="modelsLock.operate" @know="knowLock">
75
     </showModel>
76
     </showModel>
76
     <!-- 自选排班-科室绑定分组-弹窗 -->
77
     <!-- 自选排班-科室绑定分组-弹窗 -->
77
-    <showModel :title="models2.title" :icon="models2.icon" :disjunctor="models2.disjunctor"
78
-      :content="models2.content" @ok="ok2" @cancel="cancel2" :operate="models2.operate">
78
+    <showModel :title="models2.title" :icon="models2.icon" :disjunctor="models2.disjunctor" :content="models2.content"
79
+      @ok="ok2" @cancel="cancel2" :operate="models2.operate">
79
     </showModel>
80
     </showModel>
80
   </view>
81
   </view>
81
 </template>
82
 </template>
@@ -145,12 +146,12 @@
145
         },
146
         },
146
         groups: [],
147
         groups: [],
147
         index: 0,
148
         index: 0,
148
-        quickObj:{},//选择的上班快捷组合
149
+        quickObj: {}, //选择的上班快捷组合
149
         // 自选排班-科室绑定分组-弹窗model
150
         // 自选排班-科室绑定分组-弹窗model
150
         models2: {
151
         models2: {
151
           disjunctor: false,
152
           disjunctor: false,
152
         },
153
         },
153
-        objHistory:{}
154
+        objHistory: {}
154
       };
155
       };
155
     },
156
     },
156
     methods: {
157
     methods: {
@@ -190,6 +191,16 @@
190
       // 锁定
191
       // 锁定
191
       lock(data) {
192
       lock(data) {
192
         console.log(data);
193
         console.log(data);
194
+        // 如果不是科室绑定人员,则提示
195
+        if (data.workAllocationQuick.ruleType != 3) {
196
+          this.modelsLock = {
197
+            disjunctor: true,
198
+            title: "提示",
199
+            content: `需科室绑定人员模式下才可快捷上班!`,
200
+            icon: "warn",
201
+          };
202
+          return;
203
+        }
193
         this.itemLock = data;
204
         this.itemLock = data;
194
         this.modelsLock = {
205
         this.modelsLock = {
195
           disjunctor: true,
206
           disjunctor: true,
@@ -252,7 +263,18 @@
252
       // 选择历史上班记录
263
       // 选择历史上班记录
253
       radioChange2(value) {
264
       radioChange2(value) {
254
         this.objHistory = JSON.parse(value.target.value);
265
         this.objHistory = JSON.parse(value.target.value);
255
-        if(!this.objHistory.deptList){
266
+        console.log(this.objHistory);
267
+        // 如果不是科室绑定人员,则提示
268
+        if (this.objHistory.workAllocationQuick.ruleType != 3) {
269
+          this.models = {
270
+            disjunctor: true,
271
+            title: "提示",
272
+            content: `需科室绑定人员模式下才可快捷上班!`,
273
+            icon: "warn",
274
+          };
275
+          return;
276
+        }
277
+        if (!this.objHistory.deptList) {
256
           this.objHistory.deptList = [];
278
           this.objHistory.deptList = [];
257
         }
279
         }
258
         let depts = this.objHistory.deptList.map((item) => item.dept).join();
280
         let depts = this.objHistory.deptList.map((item) => item.dept).join();
@@ -329,7 +351,7 @@
329
       },
351
       },
330
       //确定
352
       //确定
331
       ok2() {
353
       ok2() {
332
-        uni.setStorageSync("manager", this.groups[this.index].manager);//储存分组组长
354
+        uni.setStorageSync("manager", this.groups[this.index].manager); //储存分组组长
333
         this.models2.disjunctor = false;
355
         this.models2.disjunctor = false;
334
         //进入设置科室界面
356
         //进入设置科室界面
335
         uni.setStorageSync("setDeptConfg", {
357
         uni.setStorageSync("setDeptConfg", {
@@ -339,7 +361,7 @@
339
           ruleType: this.quickObj.ruleType,
361
           ruleType: this.quickObj.ruleType,
340
           id: this.quickObj.id,
362
           id: this.quickObj.id,
341
           classesId: this.quickObj.classes.id,
363
           classesId: this.quickObj.classes.id,
342
-          selectGroupId:this.groups[this.index].id,
364
+          selectGroupId: this.groups[this.index].id,
343
         });
365
         });
344
         uni.navigateTo({
366
         uni.navigateTo({
345
           url: `../setDept/setDept?configName=${this.quickObj.configName}&id=${this.quickObj.id}`,
367
           url: `../setDept/setDept?configName=${this.quickObj.configName}&id=${this.quickObj.id}`,
@@ -351,34 +373,34 @@
351
       },
373
       },
352
       //工作组合的工作模式是2(科室绑定分组)或4(绑定分组)
374
       //工作组合的工作模式是2(科室绑定分组)或4(绑定分组)
353
       bindPickerChange: function(e) {
375
       bindPickerChange: function(e) {
354
-          console.log('picker发送选择改变,携带值为', e.detail.value)
355
-          this.index = e.target.value;
356
-          let userId = uni.getStorageSync("userData").user.id;
357
-          let groupObj = this.groups[this.index];
358
-          if(groupObj.manager == userId){
359
-            //当前登陆人是该分组组长-弹窗确定
360
-            this.models2 = {
361
-              disjunctor: true,
362
-              title: "提示",
363
-              content: `请确认您选择了‘${this.quickObj.classes.name}’班次,并选择了‘${groupObj.groupName}’分组!`,
364
-              icon: "warn",
365
-              operate: {
366
-                ok: "确定",
367
-                cancel: "取消",
368
-              },
369
-            };
370
-          }else{
371
-            //当前登陆人不是该分组组长
372
-            uni.setStorageSync("setDeptConfg", {
373
-              //存设置科室的配置信息
374
-              configName: this.quickObj.configName,
375
-              workSchemeType: this.workSchemeType,
376
-              ruleType: this.quickObj.ruleType,
377
-              id: this.quickObj.id,
378
-              classesId: this.quickObj.classes.id,
379
-            });
380
-            this.GoWork([groupObj]);
381
-          }
376
+        console.log('picker发送选择改变,携带值为', e.detail.value)
377
+        this.index = e.target.value;
378
+        let userId = uni.getStorageSync("userData").user.id;
379
+        let groupObj = this.groups[this.index];
380
+        if (groupObj.manager == userId) {
381
+          //当前登陆人是该分组组长-弹窗确定
382
+          this.models2 = {
383
+            disjunctor: true,
384
+            title: "提示",
385
+            content: `请确认您选择了‘${this.quickObj.classes.name}’班次,并选择了‘${groupObj.groupName}’分组!`,
386
+            icon: "warn",
387
+            operate: {
388
+              ok: "确定",
389
+              cancel: "取消",
390
+            },
391
+          };
392
+        } else {
393
+          //当前登陆人不是该分组组长
394
+          uni.setStorageSync("setDeptConfg", {
395
+            //存设置科室的配置信息
396
+            configName: this.quickObj.configName,
397
+            workSchemeType: this.workSchemeType,
398
+            ruleType: this.quickObj.ruleType,
399
+            id: this.quickObj.id,
400
+            classesId: this.quickObj.classes.id,
401
+          });
402
+          this.GoWork([groupObj]);
403
+        }
382
       },
404
       },
383
       // 选择上班快捷组合
405
       // 选择上班快捷组合
384
       radioChange1(value) {
406
       radioChange1(value) {
@@ -412,7 +434,7 @@
412
           uni.navigateTo({
434
           uni.navigateTo({
413
             url: `../setDept/setDept?configName=${this.quickObj.configName}&id=${this.quickObj.id}`,
435
             url: `../setDept/setDept?configName=${this.quickObj.configName}&id=${this.quickObj.id}`,
414
           });
436
           });
415
-        }else if(obj.ruleType == 2){
437
+        } else if (obj.ruleType == 2) {
416
           //绑定分组,直接上班
438
           //绑定分组,直接上班
417
           uni.setStorageSync("setDeptConfg", {
439
           uni.setStorageSync("setDeptConfg", {
418
             //存设置科室的配置信息
440
             //存设置科室的配置信息
@@ -423,7 +445,7 @@
423
             classesId: this.quickObj.classes.id,
445
             classesId: this.quickObj.classes.id,
424
           });
446
           });
425
           this.GoWork(obj.groups);
447
           this.GoWork(obj.groups);
426
-        }else if(obj.ruleType == 4){
448
+        } else if (obj.ruleType == 4) {
427
           //科室绑定分组,弹出分组选择
449
           //科室绑定分组,弹出分组选择
428
           this.groups = obj.groups;
450
           this.groups = obj.groups;
429
         }
451
         }
@@ -536,7 +558,8 @@
536
           mask: true,
558
           mask: true,
537
         });
559
         });
538
         //自选排班,科室绑定人员,科室绑定分组,绑定分组
560
         //自选排班,科室绑定人员,科室绑定分组,绑定分组
539
-        if (this.workSchemeType == 2 && (this.ruleType == 1 || this.ruleType == 2||this.ruleType == 3||this.ruleType == 4)) {
561
+        if (this.workSchemeType == 2 && (this.ruleType == 1 || this.ruleType == 2 || this.ruleType == 3 || this
562
+            .ruleType == 4)) {
540
           let userId = uni.getStorageSync("userData").user.id;
563
           let userId = uni.getStorageSync("userData").user.id;
541
           let setDeptConfg = uni.getStorageSync("setDeptConfg");
564
           let setDeptConfg = uni.getStorageSync("setDeptConfg");
542
           let postData = {
565
           let postData = {
@@ -544,23 +567,23 @@
544
             customWorking: "on",
567
             customWorking: "on",
545
             userId: userId,
568
             userId: userId,
546
           };
569
           };
547
-          console.log(postData,this.objHistory)
548
-          if(this.ruleType == 3||this.ruleType == 4){
549
-            if(!this.objHistory.deptList){
570
+          console.log(postData, this.objHistory)
571
+          if (this.ruleType == 3 || this.ruleType == 4) {
572
+            if (!this.objHistory.deptList) {
550
               this.objHistory.deptList = [];
573
               this.objHistory.deptList = [];
551
             }
574
             }
552
             let depts = this.objHistory.deptList.map((item) => item.id).join();
575
             let depts = this.objHistory.deptList.map((item) => item.id).join();
553
             postData.deptIds = depts;
576
             postData.deptIds = depts;
554
             postData.quickId = setDeptConfg.id;
577
             postData.quickId = setDeptConfg.id;
555
             postData.classId = setDeptConfg.classesId;
578
             postData.classId = setDeptConfg.classesId;
556
-          }else if(this.ruleType == 2 || this.ruleType == 1){
579
+          } else if (this.ruleType == 2 || this.ruleType == 1) {
557
             postData.quickId = setDeptConfg.id;
580
             postData.quickId = setDeptConfg.id;
558
             postData.classId = setDeptConfg.classesId;
581
             postData.classId = setDeptConfg.classesId;
559
           }
582
           }
560
-          console.log(postData,this.ruleType,setDeptConfg)
561
-          if(groups){
562
-            postData.groupIds = groups.map(v=>v.id).toString();
563
-            if(this.ruleType == 4){
583
+          console.log(postData, this.ruleType, setDeptConfg)
584
+          if (groups) {
585
+            postData.groupIds = groups.map(v => v.id).toString();
586
+            if (this.ruleType == 4) {
564
               //科室绑定分组,并且当前登陆人不是组长
587
               //科室绑定分组,并且当前登陆人不是组长
565
               delete postData.deptIds;
588
               delete postData.deptIds;
566
             }
589
             }
@@ -600,8 +623,8 @@
600
             type: "on",
623
             type: "on",
601
             classId: uni.getStorageSync("setDeptConfg").classesId
624
             classId: uni.getStorageSync("setDeptConfg").classesId
602
           };
625
           };
603
-          if(groups){//caocao
604
-            postData.groupIds = groups.map(v=>v.id).toString();
626
+          if (groups) { //caocao
627
+            postData.groupIds = groups.map(v => v.id).toString();
605
           }
628
           }
606
           post("/auth/onOrOffLine", postData).then((res) => {
629
           post("/auth/onOrOffLine", postData).then((res) => {
607
             uni.hideLoading();
630
             uni.hideLoading();
@@ -1224,12 +1247,13 @@
1224
             border-bottom: 2rpx solid #e5e9ed;
1247
             border-bottom: 2rpx solid #e5e9ed;
1225
             padding: 16rpx;
1248
             padding: 16rpx;
1226
 
1249
 
1227
-            &.relative{
1228
-              position:relative;
1229
-              .picker{
1250
+            &.relative {
1251
+              position: relative;
1252
+
1253
+              .picker {
1230
                 position: absolute;
1254
                 position: absolute;
1231
                 width: 100%;
1255
                 width: 100%;
1232
-                padding-left:64rpx;
1256
+                padding-left: 64rpx;
1233
               }
1257
               }
1234
             }
1258
             }
1235
 
1259