yq1 1 年間 前
コミット
4556ca78c7
共有1 個のファイルを変更した207 個の追加168 個の削除を含む
  1. 207 168
      src/xt_pages/workforce/components/editTableData.vue

+ 207 - 168
src/xt_pages/workforce/components/editTableData.vue ファイルの表示

@@ -148,6 +148,10 @@
148 148
             color: '#606266',
149 149
             // border: '1px solid aqua',
150 150
           }"
151
+            v-loading="loading"
152
+            element-loading-text="拼命加载中"
153
+            element-loading-spinner="el-icon-loading"
154
+            element-loading-background="rgba(0, 0, 0, 0.8)"
151 155
             :fit="true"
152 156
             :data="scheduleZone"
153 157
             @cell-click="clickThis"
@@ -1916,6 +1920,7 @@ export default {
1916 1920
       modename_value:true,//关闭透析模式开关
1917 1921
       Dialysis_patient:'',
1918 1922
       cur_date:"",
1923
+      loading:false,//加载
1919 1924
       dataloading:false,
1920 1925
       current_patient_data:[],
1921 1926
       week_zhongwens: ["周一", "周二", "周三", "周四", "周五", "周六", "周日"],
@@ -2904,19 +2909,19 @@ export default {
2904 2909
       }
2905 2910
     },
2906 2911
     showSmartDialog() {
2907
-      // this.dataloading = true
2912
+      this.dataloading = true
2908 2913
       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
-      // }
2914
+      for (let i = 0; i < this.patientList.length; i++) {
2915
+        if (this.patientList[i].id == this.cur_info.patient_id) {
2916
+          this.cur_smart_patient_name = this.patientList[i].name;
2917
+          this.cur_smart_patient_no = this.patientList[i].dialysis_no;
2918
+          this.cur_smart_patient_id = this.patientList[i].id;
2919
+        }
2920
+      }
2916 2921
 
2917
-      // let params = {
2918
-      //   patient_id: this.cur_info.patient_id,
2919
-      // };
2922
+      let params = {
2923
+        patient_id: this.cur_info.patient_id,
2924
+      };
2920 2925
       let data = [
2921 2926
         {
2922 2927
           checkedWeek: [],
@@ -2938,132 +2943,132 @@ export default {
2938 2943
         },
2939 2944
       ];
2940 2945
       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
-      // });
2946
+      getPatientSmartSch(params).then((response) => {
2947
+        if (response.data.state == 0) {
2948
+          return false;
2949
+        }
2950
+        var schedules = response.data.data.schedules;
2951
+        this.dataloading = false
2952
+        this.current_all_sch[0].tableWeekArrage = [];
2953
+        this.current_all_sch[1].tableWeekArrage = [];
2954
+        this.current_all_sch[2].tableWeekArrage = [];
2955
+        this.editableTabs[0].tableWeekArrage = [];
2956
+        this.editableTabs[0].checkedWeek = [];
2957
+        this.editableTabs[1].tableWeekArrage = [];
2958
+        this.editableTabs[1].checkedWeek = [];
2959
+        this.editableTabs[2].tableWeekArrage = [];
2960
+        this.editableTabs[2].checkedWeek = [];
2961
+        var tempDate = new Date();
2962
+        var day = tempDate.getDay();
2963
+        if (day == 0) {
2964
+          day = 7;
2965
+        }
2966
+
2967
+        for (let i = 0; i < schedules.length; i++) {
2968
+
2969
+
2970
+          var week_type = this.getWeekType(
2971
+              this.getTime(schedules[i].schedule_date, "{y}-{m}-{d}")
2972
+          ).toString();
2973
+
2974
+          switch (week_type) {
2975
+            case "1":
2976
+              var obj = {
2977
+                mode_id: schedules[i].mode_id,
2978
+                sch_type: schedules[i].schedule_type,
2979
+                zone_id: schedules[i].partition_id,
2980
+                jihao_id: schedules[i].bed_id,
2981
+                is_edit: false,
2982
+                week: this.getWeek(schedules[i].schedule_week),
2983
+                schedule_date: this.getDate(schedules[i].schedule_week),
2984
+                jihaos: this.partitionsProp[schedules[i].partition_id].jihaos,
2985
+                sch_id: schedules[i].id,
2986
+              };
2987
+              let is_edit = true;
2988
+              if (
2989
+                  schedules[i].schedule_week < day ||
2990
+                  schedules[i].order.id > 0
2991
+              ) {
2992
+                is_edit = false;
2993
+              } else {
2994
+                is_edit = true;
2995
+              }
2996
+              obj.is_edit = is_edit;
2997
+              console.log("schedules[i].order.id")
2998
+
2999
+              console.log(schedules[i].order.id)
3000
+
3001
+              for (let b = 0; b < this.weeks.length; b++) {
3002
+                if (schedules[i].schedule_week == this.weeks[b].week_type) {
3003
+                  if (
3004
+                      this.weeks[b].week_type >= day &&
3005
+                      schedules[i].order.id == 0
3006
+                  ) {
3007
+                    this.weeks[b].is_edit = true;
3008
+                  } else {
3009
+                    let obj = {
3010
+                      week_type:this.weeks[b].week_type,
3011
+                      order_id:schedules[i].order.id,
3012
+                    }
3013
+                    this.first_weeks.push(obj)
3014
+                    this.weeks[b].is_edit = false;
3015
+                  }
3016
+
3017
+                  this.editableTabs[0].checkedWeek.push(this.weeks[b]);
3018
+                }
3019
+              }
3020
+              data[0].tableWeekArrage.push(obj);
3021
+
3022
+              this.editableTabs[0].tableWeekArrage.push(obj);
3023
+              break;
3024
+            case "2":
3025
+              var obj2 = {
3026
+                mode_id: schedules[i].mode_id,
3027
+                sch_type: schedules[i].schedule_type,
3028
+                zone_id: schedules[i].partition_id,
3029
+                jihao_id: schedules[i].bed_id,
3030
+                is_edit: true,
3031
+                week: this.getWeek(schedules[i].schedule_week),
3032
+                schedule_date: this.getDate(schedules[i].schedule_week + 7),
3033
+                jihaos: this.partitionsProp[schedules[i].partition_id].jihaos,
3034
+                sch_id: schedules[i].id,
3035
+              };
3036
+
3037
+              for (let b = 0; b < this.weeks.length; b++) {
3038
+                if (schedules[i].schedule_week == this.weeks[b].week_type) {
3039
+                  // this.weeks[b].is_edit = true;
3040
+                  this.editableTabs[1].checkedWeek.push(this.weeks[b]);
3041
+                }
3042
+              }
3043
+              data[1].tableWeekArrage.push(obj2);
3044
+              this.editableTabs[1].tableWeekArrage.push(obj2);
3045
+              break;
3046
+
3047
+            case "3":
3048
+              let obj3 = {
3049
+                mode_id: schedules[i].mode_id,
3050
+                sch_type: schedules[i].schedule_type,
3051
+                zone_id: schedules[i].partition_id,
3052
+                jihao_id: schedules[i].bed_id,
3053
+                is_edit: true,
3054
+                week: this.getWeek(schedules[i].schedule_week),
3055
+                schedule_date: this.getDate(schedules[i].schedule_week + 14),
3056
+                jihaos: this.partitionsProp[schedules[i].partition_id].jihaos,
3057
+                sch_id: schedules[i].id,
3058
+              };
3059
+              for (let b = 0; b < this.weeks.length; b++) {
3060
+                if (schedules[i].schedule_week == this.weeks[b].week_type) {
3061
+                  // this.weeks[b].is_edit = true;
3062
+                  this.editableTabs[2].checkedWeek.push(this.weeks[b]);
3063
+                }
3064
+              }
3065
+              data[2].tableWeekArrage.push(obj3);
3066
+
3067
+              this.editableTabs[2].tableWeekArrage.push(obj3);
3068
+              break;
3069
+          }
3070
+        }
3071
+      });
3067 3072
 
3068 3073
       if(this.editableTabsValue == "1") {
3069 3074
         var tempDate = new Date();
@@ -4793,7 +4798,6 @@ export default {
4793 4798
               mode_name: "",
4794 4799
               patient_id: 0,
4795 4800
               dialysis_machine_name: "",
4796
-
4797 4801
               patient: "",
4798 4802
             };
4799 4803
             that.scheduleZone[index].Sat_N = {
@@ -4912,11 +4916,11 @@ export default {
4912 4916
             }
4913 4917
           }
4914 4918
         });
4915
-        // this.closePatientPanel();
4916 4919
       }
4917 4920
       this.creating_schedule = false;
4918 4921
     },
4919 4922
     async CreateScheduleTwo(id, data,id_two) {
4923
+      this.loading =true
4920 4924
       this.creating_schedule = true;
4921 4925
       let response =await CreateScheduleTwo(id, data,id_two)
4922 4926
 
@@ -4927,38 +4931,73 @@ export default {
4927 4931
         var schedule = response.data.data.schedule;
4928 4932
         this.creating_schedule=false;
4929 4933
         this.dialogTableVisible=false
4930
-        this.getSchedules()
4931
-        // this.scheduleZone.forEach(function (zone, index) {
4932
-        //   if (
4933
-        //     zone.zone_id == schedule.partition_id &&
4934
-        //     zone.jihao_id == schedule.bed_id
4935
-        //   ) {
4936
-        //     var weekPath = that.weekPath(
4937
-        //       schedule.schedule_week,
4938
-        //       schedule.schedule_type
4939
-        //     );
4940
-        //     if (weekPath.length == 2) {
4941
-        //       var weekPathKey = weekPath[0] + "_" + weekPath[1];
4942
-        //       that.scheduleZone[index][weekPathKey] = {
4943
-        //         schedule_id: schedule.id,
4944
-        //         mode_id: schedule.mode_id,
4945
-        //         patient_id: schedule.patient_id,
4946
-        //         patient: schedule.patient,
4947
-        //         dialysis_machine_name: schedule.dialysis_machine_name,
4948
-        //
4949
-        //         patient_contagions: that.currentData.contagions,
4950
-        //         mode_name:
4951
-        //           typeof that.modeOptions[schedule.mode_id] === "undefined"
4952
-        //             ? ""
4953
-        //             : that.modeOptions[schedule.mode_id].name,
4954
-        //       };
4955
-        //       that.scheduleZone[index].total += 1;
4956
-        //     }
4957
-        //   }
4958
-        // });
4934
+        // this.getSchedules()
4935
+        console.log('cccccc',this.cur_drag_info);
4936
+         const curdrag = this.cur_drag_info
4937
+        if(curdrag.bed_id!=''){
4938
+
4939
+          this.scheduleZone.forEach(function (zone, index) {
4940
+            if (
4941
+              zone.zone_id == schedule.partition_id &&
4942
+              zone.jihao_id == schedule.bed_id
4943
+            ) {
4944
+              // console.log('111111',zone.zone_id,zone.jihao_id);
4945
+              var weekPath = that.weekPath(
4946
+                schedule.schedule_week,
4947
+                schedule.schedule_type
4948
+              );
4949
+              console.log('22222',weekPath);
4950
+              if (weekPath.length == 2) {
4951
+                var weekPathKey = weekPath[0] + "_" + weekPath[1];
4952
+                that.scheduleZone[index][weekPathKey] = {
4953
+                  schedule_id: schedule.id,
4954
+                  mode_id: schedule.mode_id,
4955
+                  patient_id: schedule.patient_id,
4956
+                  patient: schedule.patient,
4957
+                  dialysis_machine_name: schedule.dialysis_machine_name,
4958
+                  patient_contagions: that.currentData.contagions,
4959
+                  mode_name:
4960
+                    typeof that.modeOptions[schedule.mode_id] === "undefined"
4961
+                      ? ""
4962
+                      : that.modeOptions[schedule.mode_id].name,
4963
+                };
4964
+                // console.log('3333',that.scheduleZone[index][weekPathKey]);
4965
+                that.scheduleZone[index].total += 1;
4966
+              }
4967
+            }
4968
+
4969
+            if(zone.zone_id == curdrag.partition_id &&
4970
+                zone.jihao_id == curdrag.bed_id
4971
+              ){
4972
+                // console.log('aaaaaa',curdrag);
4973
+                var weekPath = that.weekPath(
4974
+                  curdrag.schedule_week,
4975
+                  curdrag.schedule_type
4976
+                );
4977
+                console.log('aaaaaa',weekPath);
4978
+                if(weekPath.length == 2){
4979
+                  var weekPathKey = weekPath[0] + "_" + weekPath[1];
4980
+                  that.scheduleZone[index][weekPathKey] ={
4981
+                    schedule_id: '',
4982
+                    mode_id: '',
4983
+                    patient_id: '',
4984
+                    patient: '',
4985
+                    dialysis_machine_name: '',
4986
+                    patient_contagions: '',
4987
+                    mode_name:''
4988
+                  };
4989
+                  that.scheduleZone[index].total += 1;
4990
+                  }
4991
+              }
4992
+          });
4993
+        }else{
4994
+          this.getSchedules()
4995
+        }
4996
+        // return that.scheduleZone()
4959 4997
         // this.closePatientPanel();
4960 4998
       }
4961 4999
       this.creating_schedule = false;
5000
+      this.loading=false
4962 5001
     },
4963 5002
     // 单击选中患者
4964 5003
     clickThis(row, column, cell, event) {