陈少旭 1 gadu atpakaļ
vecāks
revīzija
0392bca41b
1 mainītis faili ar 138 papildinājumiem un 138 dzēšanām
  1. 138 138
      src/xt_pages/workforce/components/editTableData.vue

+ 138 - 138
src/xt_pages/workforce/components/editTableData.vue Parādīt failu

@@ -511,7 +511,7 @@
511 511
                         scope.row
512 512
                       )
513 513
                     "
514
-                    
514
+
515 515
                   ></schedule-item>
516 516
                 </div>
517 517
               </template>
@@ -2904,19 +2904,19 @@ export default {
2904 2904
       }
2905 2905
     },
2906 2906
     showSmartDialog() {
2907
-      this.dataloading = true
2907
+      // this.dataloading = true
2908 2908
       this.editableTabsValue = "1";
2909
-      for (let i = 0; i < this.patientList.length; i++) {
2910
-        if (this.patientList[i].id == this.cur_info.patient_id) {
2911
-          this.cur_smart_patient_name = this.patientList[i].name;
2912
-          this.cur_smart_patient_no = this.patientList[i].dialysis_no;
2913
-          this.cur_smart_patient_id = this.patientList[i].id;
2914
-        }
2915
-      }
2909
+      // for (let i = 0; i < this.patientList.length; i++) {
2910
+      //   if (this.patientList[i].id == this.cur_info.patient_id) {
2911
+      //     this.cur_smart_patient_name = this.patientList[i].name;
2912
+      //     this.cur_smart_patient_no = this.patientList[i].dialysis_no;
2913
+      //     this.cur_smart_patient_id = this.patientList[i].id;
2914
+      //   }
2915
+      // }
2916 2916
 
2917
-      let params = {
2918
-        patient_id: this.cur_info.patient_id,
2919
-      };
2917
+      // let params = {
2918
+      //   patient_id: this.cur_info.patient_id,
2919
+      // };
2920 2920
       let data = [
2921 2921
         {
2922 2922
           checkedWeek: [],
@@ -2938,132 +2938,132 @@ export default {
2938 2938
         },
2939 2939
       ];
2940 2940
       this.first_weeks = []
2941
-      getPatientSmartSch(params).then((response) => {
2942
-        if (response.data.state == 0) {
2943
-          return false;
2944
-        }
2945
-        var schedules = response.data.data.schedules;
2946
-        this.dataloading = false
2947
-        this.current_all_sch[0].tableWeekArrage = [];
2948
-        this.current_all_sch[1].tableWeekArrage = [];
2949
-        this.current_all_sch[2].tableWeekArrage = [];
2950
-        this.editableTabs[0].tableWeekArrage = [];
2951
-        this.editableTabs[0].checkedWeek = [];
2952
-        this.editableTabs[1].tableWeekArrage = [];
2953
-        this.editableTabs[1].checkedWeek = [];
2954
-        this.editableTabs[2].tableWeekArrage = [];
2955
-        this.editableTabs[2].checkedWeek = [];
2956
-        var tempDate = new Date();
2957
-        var day = tempDate.getDay();
2958
-        if (day == 0) {
2959
-          day = 7;
2960
-        }
2961
-
2962
-        for (let i = 0; i < schedules.length; i++) {
2963
-
2964
-
2965
-          var week_type = this.getWeekType(
2966
-              this.getTime(schedules[i].schedule_date, "{y}-{m}-{d}")
2967
-          ).toString();
2968
-
2969
-          switch (week_type) {
2970
-            case "1":
2971
-              var obj = {
2972
-                mode_id: schedules[i].mode_id,
2973
-                sch_type: schedules[i].schedule_type,
2974
-                zone_id: schedules[i].partition_id,
2975
-                jihao_id: schedules[i].bed_id,
2976
-                is_edit: false,
2977
-                week: this.getWeek(schedules[i].schedule_week),
2978
-                schedule_date: this.getDate(schedules[i].schedule_week),
2979
-                jihaos: this.partitionsProp[schedules[i].partition_id].jihaos,
2980
-                sch_id: schedules[i].id,
2981
-              };
2982
-              let is_edit = true;
2983
-              if (
2984
-                  schedules[i].schedule_week < day ||
2985
-                  schedules[i].order.id > 0
2986
-              ) {
2987
-                is_edit = false;
2988
-              } else {
2989
-                is_edit = true;
2990
-              }
2991
-              obj.is_edit = is_edit;
2992
-              console.log("schedules[i].order.id")
2993
-
2994
-              console.log(schedules[i].order.id)
2995
-
2996
-              for (let b = 0; b < this.weeks.length; b++) {
2997
-                if (schedules[i].schedule_week == this.weeks[b].week_type) {
2998
-                  if (
2999
-                      this.weeks[b].week_type >= day &&
3000
-                      schedules[i].order.id == 0
3001
-                  ) {
3002
-                    this.weeks[b].is_edit = true;
3003
-                  } else {
3004
-                    let obj = {
3005
-                      week_type:this.weeks[b].week_type,
3006
-                      order_id:schedules[i].order.id,
3007
-                    }
3008
-                    this.first_weeks.push(obj)
3009
-                    this.weeks[b].is_edit = false;
3010
-                  }
3011
-
3012
-                  this.editableTabs[0].checkedWeek.push(this.weeks[b]);
3013
-                }
3014
-              }
3015
-              data[0].tableWeekArrage.push(obj);
3016
-
3017
-              this.editableTabs[0].tableWeekArrage.push(obj);
3018
-              break;
3019
-            case "2":
3020
-              var obj2 = {
3021
-                mode_id: schedules[i].mode_id,
3022
-                sch_type: schedules[i].schedule_type,
3023
-                zone_id: schedules[i].partition_id,
3024
-                jihao_id: schedules[i].bed_id,
3025
-                is_edit: true,
3026
-                week: this.getWeek(schedules[i].schedule_week),
3027
-                schedule_date: this.getDate(schedules[i].schedule_week + 7),
3028
-                jihaos: this.partitionsProp[schedules[i].partition_id].jihaos,
3029
-                sch_id: schedules[i].id,
3030
-              };
3031
-
3032
-              for (let b = 0; b < this.weeks.length; b++) {
3033
-                if (schedules[i].schedule_week == this.weeks[b].week_type) {
3034
-                  // this.weeks[b].is_edit = true;
3035
-                  this.editableTabs[1].checkedWeek.push(this.weeks[b]);
3036
-                }
3037
-              }
3038
-              data[1].tableWeekArrage.push(obj2);
3039
-              this.editableTabs[1].tableWeekArrage.push(obj2);
3040
-              break;
3041
-
3042
-            case "3":
3043
-              let obj3 = {
3044
-                mode_id: schedules[i].mode_id,
3045
-                sch_type: schedules[i].schedule_type,
3046
-                zone_id: schedules[i].partition_id,
3047
-                jihao_id: schedules[i].bed_id,
3048
-                is_edit: true,
3049
-                week: this.getWeek(schedules[i].schedule_week),
3050
-                schedule_date: this.getDate(schedules[i].schedule_week + 14),
3051
-                jihaos: this.partitionsProp[schedules[i].partition_id].jihaos,
3052
-                sch_id: schedules[i].id,
3053
-              };
3054
-              for (let b = 0; b < this.weeks.length; b++) {
3055
-                if (schedules[i].schedule_week == this.weeks[b].week_type) {
3056
-                  // this.weeks[b].is_edit = true;
3057
-                  this.editableTabs[2].checkedWeek.push(this.weeks[b]);
3058
-                }
3059
-              }
3060
-              data[2].tableWeekArrage.push(obj3);
3061
-
3062
-              this.editableTabs[2].tableWeekArrage.push(obj3);
3063
-              break;
3064
-          }
3065
-        }
3066
-      });
2941
+      // getPatientSmartSch(params).then((response) => {
2942
+      //   if (response.data.state == 0) {
2943
+      //     return false;
2944
+      //   }
2945
+      //   var schedules = response.data.data.schedules;
2946
+      //   this.dataloading = false
2947
+      //   this.current_all_sch[0].tableWeekArrage = [];
2948
+      //   this.current_all_sch[1].tableWeekArrage = [];
2949
+      //   this.current_all_sch[2].tableWeekArrage = [];
2950
+      //   this.editableTabs[0].tableWeekArrage = [];
2951
+      //   this.editableTabs[0].checkedWeek = [];
2952
+      //   this.editableTabs[1].tableWeekArrage = [];
2953
+      //   this.editableTabs[1].checkedWeek = [];
2954
+      //   this.editableTabs[2].tableWeekArrage = [];
2955
+      //   this.editableTabs[2].checkedWeek = [];
2956
+      //   var tempDate = new Date();
2957
+      //   var day = tempDate.getDay();
2958
+      //   if (day == 0) {
2959
+      //     day = 7;
2960
+      //   }
2961
+      //
2962
+      //   for (let i = 0; i < schedules.length; i++) {
2963
+      //
2964
+      //
2965
+      //     var week_type = this.getWeekType(
2966
+      //         this.getTime(schedules[i].schedule_date, "{y}-{m}-{d}")
2967
+      //     ).toString();
2968
+      //
2969
+      //     switch (week_type) {
2970
+      //       case "1":
2971
+      //         var obj = {
2972
+      //           mode_id: schedules[i].mode_id,
2973
+      //           sch_type: schedules[i].schedule_type,
2974
+      //           zone_id: schedules[i].partition_id,
2975
+      //           jihao_id: schedules[i].bed_id,
2976
+      //           is_edit: false,
2977
+      //           week: this.getWeek(schedules[i].schedule_week),
2978
+      //           schedule_date: this.getDate(schedules[i].schedule_week),
2979
+      //           jihaos: this.partitionsProp[schedules[i].partition_id].jihaos,
2980
+      //           sch_id: schedules[i].id,
2981
+      //         };
2982
+      //         let is_edit = true;
2983
+      //         if (
2984
+      //             schedules[i].schedule_week < day ||
2985
+      //             schedules[i].order.id > 0
2986
+      //         ) {
2987
+      //           is_edit = false;
2988
+      //         } else {
2989
+      //           is_edit = true;
2990
+      //         }
2991
+      //         obj.is_edit = is_edit;
2992
+      //         console.log("schedules[i].order.id")
2993
+      //
2994
+      //         console.log(schedules[i].order.id)
2995
+      //
2996
+      //         for (let b = 0; b < this.weeks.length; b++) {
2997
+      //           if (schedules[i].schedule_week == this.weeks[b].week_type) {
2998
+      //             if (
2999
+      //                 this.weeks[b].week_type >= day &&
3000
+      //                 schedules[i].order.id == 0
3001
+      //             ) {
3002
+      //               this.weeks[b].is_edit = true;
3003
+      //             } else {
3004
+      //               let obj = {
3005
+      //                 week_type:this.weeks[b].week_type,
3006
+      //                 order_id:schedules[i].order.id,
3007
+      //               }
3008
+      //               this.first_weeks.push(obj)
3009
+      //               this.weeks[b].is_edit = false;
3010
+      //             }
3011
+      //
3012
+      //             this.editableTabs[0].checkedWeek.push(this.weeks[b]);
3013
+      //           }
3014
+      //         }
3015
+      //         data[0].tableWeekArrage.push(obj);
3016
+      //
3017
+      //         this.editableTabs[0].tableWeekArrage.push(obj);
3018
+      //         break;
3019
+      //       case "2":
3020
+      //         var obj2 = {
3021
+      //           mode_id: schedules[i].mode_id,
3022
+      //           sch_type: schedules[i].schedule_type,
3023
+      //           zone_id: schedules[i].partition_id,
3024
+      //           jihao_id: schedules[i].bed_id,
3025
+      //           is_edit: true,
3026
+      //           week: this.getWeek(schedules[i].schedule_week),
3027
+      //           schedule_date: this.getDate(schedules[i].schedule_week + 7),
3028
+      //           jihaos: this.partitionsProp[schedules[i].partition_id].jihaos,
3029
+      //           sch_id: schedules[i].id,
3030
+      //         };
3031
+      //
3032
+      //         for (let b = 0; b < this.weeks.length; b++) {
3033
+      //           if (schedules[i].schedule_week == this.weeks[b].week_type) {
3034
+      //             // this.weeks[b].is_edit = true;
3035
+      //             this.editableTabs[1].checkedWeek.push(this.weeks[b]);
3036
+      //           }
3037
+      //         }
3038
+      //         data[1].tableWeekArrage.push(obj2);
3039
+      //         this.editableTabs[1].tableWeekArrage.push(obj2);
3040
+      //         break;
3041
+      //
3042
+      //       case "3":
3043
+      //         let obj3 = {
3044
+      //           mode_id: schedules[i].mode_id,
3045
+      //           sch_type: schedules[i].schedule_type,
3046
+      //           zone_id: schedules[i].partition_id,
3047
+      //           jihao_id: schedules[i].bed_id,
3048
+      //           is_edit: true,
3049
+      //           week: this.getWeek(schedules[i].schedule_week),
3050
+      //           schedule_date: this.getDate(schedules[i].schedule_week + 14),
3051
+      //           jihaos: this.partitionsProp[schedules[i].partition_id].jihaos,
3052
+      //           sch_id: schedules[i].id,
3053
+      //         };
3054
+      //         for (let b = 0; b < this.weeks.length; b++) {
3055
+      //           if (schedules[i].schedule_week == this.weeks[b].week_type) {
3056
+      //             // this.weeks[b].is_edit = true;
3057
+      //             this.editableTabs[2].checkedWeek.push(this.weeks[b]);
3058
+      //           }
3059
+      //         }
3060
+      //         data[2].tableWeekArrage.push(obj3);
3061
+      //
3062
+      //         this.editableTabs[2].tableWeekArrage.push(obj3);
3063
+      //         break;
3064
+      //     }
3065
+      //   }
3066
+      // });
3067 3067
 
3068 3068
       if(this.editableTabsValue == "1") {
3069 3069
         var tempDate = new Date();