Procházet zdrojové kódy

上传文件至 'src/xt_pages/workforce/components'

yangq před 2 roky
rodič
revize
092895fc2e

+ 61 - 61
src/xt_pages/workforce/components/ScheduleItem.vue Zobrazit soubor

@@ -1,61 +1,61 @@
1
-<template>
2
-  <!-- 排班表填充内容 -->
3
-    <div >
4
-
5
-            <div>
6
-                <span :class='modeColor(scheduleDetail.mode_name)'>{{scheduleDetail.patient}}</span><br/>
7
-                <span v-if="scheduleDetail.mode_name.length>0" :class='modeColor(scheduleDetail.mode_name)'>({{scheduleDetail.mode_name}})</span>
8
-              <span v-if="schedulFlag">{{scheduleDetail.dialysis_machine_name}}</span>
9
-            </div>
10
-    </div>
11
-</template>
12
-
13
-<script>
14
-export default {
15
-  name: "scheduleItem",
16
-  props:{
17
-      scheduleDetail:{
18
-          type:Object,
19
-          default: function (){
20
-              return {
21
-                mode_id:0,
22
-                mode_name:'',
23
-                patient_id:0,
24
-                patient:"",
25
-                dialysis_machine_name:"",
26
-              }
27
-          },
28
-      },
29
-      schedulFlag:{
30
-        type:Boolean,
31
-        default:false
32
-      }
33
-  },
34
-  data() {
35
-    return {
36
-      schedul:false
37
-    }
38
-  },
39
-
40
-  methods:{
41
-        modeColor(name){
42
-            if(name == 'HD'){
43
-
44
-            }else if(name == 'HDF'){
45
-                return 'modeRed'
46
-            }else if(name == 'HD+HP'){
47
-                return 'modePurple'
48
-            }
49
-        }
50
-  }
51
-};
52
-</script>
53
-
54
-<style lang="scss" scoped>
55
-.modeRed{
56
-  color:#ee780a;
57
-}
58
-.modePurple{
59
-  color: #53b86e;
60
-}
61
-</style>
1
+<template>
2
+  <!-- 排班表填充内容 -->
3
+    <div >
4
+
5
+            <div>
6
+                <span :class='modeColor(scheduleDetail.mode_name)'>{{scheduleDetail.patient}}</span><br/>
7
+                <span v-if="scheduleDetail.mode_name.length>0" :class='modeColor(scheduleDetail.mode_name)'>({{scheduleDetail.mode_name}})</span>
8
+                <br/><span v-if="schedulFlag">{{scheduleDetail.dialysis_machine_name}}</span>
9
+            </div>
10
+    </div>
11
+</template>
12
+
13
+<script>
14
+export default {
15
+  name: "scheduleItem",
16
+  props:{
17
+      scheduleDetail:{
18
+          type:Object,
19
+          default: function (){
20
+              return {
21
+                mode_id:0,
22
+                mode_name:'',
23
+                patient_id:0,
24
+                patient:"",
25
+                dialysis_machine_name:"",
26
+              }
27
+          },
28
+      },
29
+      schedulFlag:{
30
+        type:Boolean,
31
+        default:false
32
+      }
33
+  },
34
+  data() {
35
+    return {
36
+      schedul:false
37
+    }
38
+  },
39
+
40
+  methods:{
41
+        modeColor(name){
42
+            if(name == 'HD'){
43
+
44
+            }else if(name == 'HDF'){
45
+                return 'modeRed'
46
+            }else if(name == 'HD+HP'){
47
+                return 'modePurple'
48
+            }
49
+        }
50
+  }
51
+};
52
+</script>
53
+
54
+<style lang="scss" scoped>
55
+.modeRed{
56
+  color:#ee0ad0;
57
+}
58
+.modePurple{
59
+  color: #53b86e;
60
+}
61
+</style>

+ 44 - 5
src/xt_pages/workforce/components/editTableData.vue Zobrazit soubor

@@ -181,6 +181,7 @@
181 181
                       icon="el-icon-close"
182 182
                       circle
183 183
                       @click.stop="deletePatientMode(scope.row.Mon_M)"
184
+                      v-show="cur_drag_info.patient_id== 0 ? false : true"
184 185
                   ></el-button>
185 186
                 </div>
186 187
                 <!--  -->
@@ -227,6 +228,7 @@
227 228
                       icon="el-icon-close"
228 229
                       circle
229 230
                       @click.stop="deletePatientMode(scope.row.Mon_A)"
231
+                      v-show="cur_drag_info.patient_id== 0 ? false : true"
230 232
                   ></el-button>
231 233
                 </div>
232 234
                 <div
@@ -271,6 +273,7 @@
271 273
                       icon="el-icon-close"
272 274
                       circle
273 275
                       @click.stop="deletePatientMode(scope.row.Mon_N)"
276
+                      v-show="cur_drag_info.patient_id== 0 ? false : true"
274 277
                   ></el-button>
275 278
                 </div>
276 279
                 <div
@@ -322,6 +325,7 @@
322 325
                       icon="el-icon-close"
323 326
                       circle
324 327
                       @click.stop="deletePatientMode(scope.row.Tue_M)"
328
+                      v-show="cur_drag_info.patient_id== 0 ? false : true"
325 329
                   ></el-button>
326 330
                 </div>
327 331
                 <div
@@ -366,6 +370,7 @@
366 370
                       icon="el-icon-close"
367 371
                       circle
368 372
                       @click.stop="deletePatientMode(scope.row.Tue_A)"
373
+                      v-show="cur_drag_info.patient_id== 0 ? false : true"
369 374
                   ></el-button>
370 375
                 </div>
371 376
                 <div
@@ -409,6 +414,7 @@
409 414
                       icon="el-icon-close"
410 415
                       circle
411 416
                       @click.stop="deletePatientMode(scope.row.Tue_N)"
417
+                      v-show="cur_drag_info.patient_id== 0 ? false : true"
412 418
                   ></el-button>
413 419
                 </div>
414 420
                 <div
@@ -459,6 +465,7 @@
459 465
                       icon="el-icon-close"
460 466
                       circle
461 467
                       @click.stop="deletePatientMode(scope.row.Wed_M)"
468
+                      v-show="cur_drag_info.patient_id== 0 ? false : true"
462 469
                   ></el-button>
463 470
                 </div>
464 471
                 <div
@@ -502,6 +509,7 @@
502 509
                       icon="el-icon-close"
503 510
                       circle
504 511
                       @click.stop="deletePatientMode(scope.row.Wed_A)"
512
+                      v-show="cur_drag_info.patient_id== 0 ? false : true"
505 513
                   ></el-button>
506 514
                 </div>
507 515
                 <div
@@ -545,6 +553,7 @@
545 553
                       icon="el-icon-close"
546 554
                       circle
547 555
                       @click.stop="deletePatientMode(scope.row.Wed_N)"
556
+                      v-show="cur_drag_info.patient_id== 0 ? false : true"
548 557
                   ></el-button>
549 558
                 </div>
550 559
                 <div
@@ -595,6 +604,7 @@
595 604
                       icon="el-icon-close"
596 605
                       circle
597 606
                       @click.stop="deletePatientMode(scope.row.Thurs_M)"
607
+                      v-show="cur_drag_info.patient_id== 0 ? false : true"
598 608
                   ></el-button>
599 609
                 </div>
600 610
                 <div
@@ -643,6 +653,7 @@
643 653
                       icon="el-icon-close"
644 654
                       circle
645 655
                       @click.stop="deletePatientMode(scope.row.Thurs_A)"
656
+                      v-show="cur_drag_info.patient_id== 0 ? false : true"
646 657
                   ></el-button>
647 658
                 </div>
648 659
                 <div
@@ -692,6 +703,7 @@
692 703
                       icon="el-icon-close"
693 704
                       circle
694 705
                       @click.stop="deletePatientMode(scope.row.Thurs_N)"
706
+                      v-show="cur_drag_info.patient_id== 0 ? false : true"
695 707
                   ></el-button>
696 708
                 </div>
697 709
                 <div
@@ -743,6 +755,7 @@
743 755
                       icon="el-icon-close"
744 756
                       circle
745 757
                       @click.stop="deletePatientMode(scope.row.Fri_M)"
758
+                      v-show="cur_drag_info.patient_id== 0 ? false : true"
746 759
                   ></el-button>
747 760
                 </div>
748 761
                 <div
@@ -784,6 +797,7 @@
784 797
                       icon="el-icon-close"
785 798
                       circle
786 799
                       @click.stop="deletePatientMode(scope.row.Fri_A)"
800
+                      v-show="cur_drag_info.patient_id== 0 ? false : true"
787 801
                   ></el-button>
788 802
                 </div>
789 803
         
@@ -823,6 +837,7 @@
823 837
                       icon="el-icon-close"
824 838
                       circle
825 839
                       @click.stop="deletePatientMode(scope.row.Fri_N)"
840
+                      v-show="cur_drag_info.patient_id== 0 ? false : true"
826 841
                   ></el-button>
827 842
                 </div>
828 843
                 <!--  -->
@@ -875,6 +890,7 @@
875 890
                       icon="el-icon-close"
876 891
                       circle
877 892
                       @click.stop="deletePatientMode(scope.row.Sat_M)"
893
+                      v-show="cur_drag_info.patient_id== 0 ? false : true"
878 894
                   ></el-button>
879 895
                 </div>
880 896
                 <!--  -->
@@ -920,6 +936,7 @@
920 936
                       icon="el-icon-close"
921 937
                       circle
922 938
                       @click.stop="deletePatientMode(scope.row.Sat_A)"
939
+                      v-show="cur_drag_info.patient_id== 0 ? false : true"
923 940
                   ></el-button>
924 941
                 </div>
925 942
                 <!--  -->
@@ -965,6 +982,7 @@
965 982
                       icon="el-icon-close"
966 983
                       circle
967 984
                       @click.stop="deletePatientMode(scope.row.Sat_N)"
985
+                      v-show="cur_drag_info.patient_id== 0 ? false : true"
968 986
                   ></el-button>
969 987
                 </div>
970 988
                 <!--  -->
@@ -1021,6 +1039,7 @@
1021 1039
                       icon="el-icon-close"
1022 1040
                       circle
1023 1041
                       @click.stop="deletePatientMode(scope.row.Sun_M)"
1042
+                      v-show="cur_drag_info.patient_id== 0 ? false : true"
1024 1043
                   ></el-button>
1025 1044
                 </div>
1026 1045
                 <div
@@ -1069,6 +1088,7 @@
1069 1088
                       icon="el-icon-close"
1070 1089
                       circle
1071 1090
                       @click.stop="deletePatientMode(scope.row.Sun_A)"
1091
+                      v-show="cur_drag_info.patient_id== 0 ? false : true"
1072 1092
                   ></el-button>
1073 1093
                 </div>
1074 1094
                 <div
@@ -1116,6 +1136,7 @@
1116 1136
                       icon="el-icon-close"
1117 1137
                       circle
1118 1138
                       @click.stop="deletePatientMode(scope.row.Sun_N)"
1139
+                      v-show="cur_drag_info.patient_id== 0 ? false : true"
1119 1140
                   ></el-button>
1120 1141
                 </div>
1121 1142
                 <div
@@ -1436,7 +1457,7 @@
1436 1457
               </el-option>
1437 1458
             </el-select>
1438 1459
           </el-form-item>
1439
-          <el-form-item label="病房: " prop="partition_id">
1460
+          <el-form-item label="分区: " prop="partition_id">
1440 1461
             <el-select
1441 1462
                 v-model="zone_name"
1442 1463
                 placeholder="请选择"
@@ -3136,8 +3157,8 @@ export default {
3136 3157
     drag(e, day, index, name, row) {
3137 3158
       e.preventDefault();
3138 3159
       for (var key in row) {
3139
-        if (key == day && row[key].patient_id > 0) {
3140
-          // console.log(row[key].patient_id)
3160
+        if (key == day) {
3161
+          if(row[key].patient_id > 0){
3141 3162
             this.cur_drag_obj = 2
3142 3163
             var week = this.weekDay(day);
3143 3164
             this.cur_drag_info={
@@ -3154,6 +3175,24 @@ export default {
3154 3175
               patient_name : row[key].patient,
3155 3176
               patient_id : row[key].patient_id,
3156 3177
               id : row[key].schedule_id
3178
+            }
3179
+          }else{
3180
+            this.cur_drag_obj = 2
3181
+            this.cur_drag_info={
3182
+              schedule_date : '',
3183
+              schedule_type : '',
3184
+              bed_id : '',
3185
+              partition_id : '',
3186
+              schedule_week : '',
3187
+              type_name : '',
3188
+              zone_name : '',
3189
+              bed_name : '',
3190
+              mode_id : '',
3191
+              mode_name : '',
3192
+              patient_name : '',
3193
+              patient_id : '',
3194
+              id : '',
3195
+            }
3157 3196
           }
3158 3197
         }
3159 3198
       }
@@ -3215,6 +3254,7 @@ export default {
3215 3254
       if (row.schedule_id > 0) {
3216 3255
         this.CancelSchedule(row.schedule_id);
3217 3256
       }
3257
+      console.log('deletePatientMode',row);
3218 3258
     },
3219 3259
     // 替换
3220 3260
     coverSch(){
@@ -4785,7 +4825,7 @@ export default {
4785 4825
             }
4786 4826
           }
4787 4827
         });
4788
-        this.closePatientPanel();
4828
+        // this.closePatientPanel();
4789 4829
       }
4790 4830
       this.creating_schedule = false;
4791 4831
     },
@@ -5568,7 +5608,6 @@ export default {
5568 5608
     };
5569 5609
   },
5570 5610
   created() {
5571
-   
5572 5611
     var date = new Date();
5573 5612
     this.time = date;
5574 5613
     var year = date.getFullYear();

+ 23 - 10
src/xt_pages/workforce/components/tableData.vue Zobrazit soubor

@@ -494,7 +494,7 @@
494 494
               </el-option>
495 495
             </el-select>
496 496
           </el-form-item>
497
-          <el-form-item label="病房: " prop="partition_id">
497
+          <el-form-item label="分区: " prop="partition_id">
498 498
             <el-select
499 499
                 v-model="zone_name"
500 500
                 placeholder="请选择"
@@ -502,10 +502,10 @@
502 502
                 @change="changePartition"
503 503
             >
504 504
               <el-option
505
-                  v-for="(item, index) in zone_names"
506
-                  :key="index"
507
-                  :label="item"
508
-                  :value="item"
505
+                  v-for="item in zone_names"
506
+                  :key="item.id"
507
+                  :label="item.zone_name"
508
+                  :value="item.zone_id"
509 509
               >
510 510
               </el-option>
511 511
             </el-select>
@@ -662,7 +662,7 @@ export default {
662 662
   data() {
663 663
     return {
664 664
       tableContainHeight:null,
665
-      value1:true,
665
+      value1:false,
666 666
       // tableHeight:'window.innerHeight - 0',
667 667
       // rowClass: "table-row-new-class schedule-table-row",
668 668
       weeks:weekOptions,
@@ -762,6 +762,7 @@ export default {
762 762
       zone_name: "",
763 763
       current_devices: [],
764 764
       zone_names: [],
765
+      zone_namess:[],
765 766
       zone_device_options: [],
766 767
       options:[
767 768
         {id:1,name:"上午"},
@@ -2676,6 +2677,8 @@ export default {
2676 2677
     },
2677 2678
 
2678 2679
     changePartition(value) {
2680
+      // this.current_devices = this.zone_device_map[value];
2681
+      // this.device_id = this.current_devices[0].id;
2679 2682
       let params = {
2680 2683
         zone_id:  value,
2681 2684
         sch_type: this.currentData.schedule_type,
@@ -2687,6 +2690,7 @@ export default {
2687 2690
         if (response.data.state == 0) {
2688 2691
           return false;
2689 2692
         } else {
2693
+          console.log('devices的数据',devices);
2690 2694
           var devices = response.data.data.devices;
2691 2695
           this.current_devices = [];
2692 2696
           this.current_devices = devices;
@@ -2861,14 +2865,14 @@ export default {
2861 2865
                   //   zone_device_map[device_number.zone.name].push(device_number)
2862 2866
                   // }
2863 2867
                   // this.zone_device_map = zone_device_map
2864
-                  //
2868
+                  
2865 2869
                   // this.zone_names = Object.keys(this.zone_device_map)
2866 2870
                   // if (this.zone_names.length > 0) {
2867 2871
                   //   this.zone_name = this.zone_names[0]
2868 2872
                   //   this.current_devices = this.zone_device_map[this.zone_name]
2869 2873
                   //   this.device_id = this.current_devices[0].id
2870 2874
                   // }
2871
-                  //
2875
+                  
2872 2876
                   // this.zone_device_options = [
2873 2877
                   //   { values: this.zone_names },
2874 2878
                   //   // { values: this.getDeviceNumberNames(this.current_devices) },
@@ -3146,7 +3150,6 @@ export default {
3146 3150
         "{y}-{m}-{d}"
3147 3151
       );
3148 3152
 
3149
-
3150 3153
       this.zone_name = row.partition_id;
3151 3154
       this.device_id = row.bed_id;
3152 3155
       // this.current_devices = this.partitions[row.partition_id].jihaos
@@ -3163,9 +3166,19 @@ export default {
3163 3166
           return false;
3164 3167
         } else {
3165 3168
           var devices = response.data.data.devices;
3169
+          console.log('getSmartDevices的数据',devices);
3166 3170
           this.current_devices = [];
3167 3171
           this.current_devices = devices;
3172
+          // this.zone_names= [];
3173
+          // if(devices!=null){
3174
+          //   for(let i=0;i<devices.length;i++){
3175
+          //     this.zone_names.push(devices[0])
3176
+          //   }
3177
+            
3178
+          // }
3179
+         this.zone_names=devices[0];
3168 3180
           this.device_id = devices[0].id
3181
+          console.log('zone_namess的数据',this.zone_names);
3169 3182
         }
3170 3183
       });
3171 3184
 
@@ -3312,7 +3325,7 @@ export default {
3312 3325
   //    this.tableContainHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 160
3313 3326
   // },
3314 3327
   created() {
3315
-    // console.log('this.$refs.schedul.scheduleDetail的数据',this.$refs.schedul);
3328
+    console.log('this.zone_names的数据',this.zone_names);
3316 3329
     var date = new Date()
3317 3330
     this.time = date
3318 3331
     var year = date.getFullYear()