|
@@ -2910,203 +2910,203 @@ export default {
|
2910
|
2910
|
}
|
2911
|
2911
|
},
|
2912
|
2912
|
showSmartDialog() {
|
2913
|
|
- this.dataloading = true
|
|
2913
|
+ // this.dataloading = true
|
2914
|
2914
|
this.editableTabsValue = "1";
|
2915
|
|
- for (let i = 0; i < this.patientList.length; i++) {
|
2916
|
|
- if (this.patientList[i].id == this.cur_info.patient_id) {
|
2917
|
|
- this.cur_smart_patient_name = this.patientList[i].name;
|
2918
|
|
- this.cur_smart_patient_no = this.patientList[i].dialysis_no;
|
2919
|
|
- this.cur_smart_patient_id = this.patientList[i].id;
|
2920
|
|
- }
|
2921
|
|
- }
|
2922
|
|
-
|
2923
|
|
- let params = {
|
2924
|
|
- patient_id: this.cur_info.patient_id,
|
2925
|
|
- };
|
2926
|
|
- let data = [
|
2927
|
|
- {
|
2928
|
|
- checkedWeek: [],
|
2929
|
|
- title: "本周",
|
2930
|
|
- name: "1",
|
2931
|
|
- tableWeekArrage: [],
|
2932
|
|
- },
|
2933
|
|
- {
|
2934
|
|
- checkedWeek: [],
|
2935
|
|
- title: "下周",
|
2936
|
|
- name: "2",
|
2937
|
|
- tableWeekArrage: [],
|
2938
|
|
- },
|
2939
|
|
- {
|
2940
|
|
- checkedWeek: [],
|
2941
|
|
- title: "下下周",
|
2942
|
|
- name: "3",
|
2943
|
|
- tableWeekArrage: [],
|
2944
|
|
- },
|
2945
|
|
- ];
|
2946
|
|
- this.first_weeks = []
|
2947
|
|
- getPatientSmartSch(params).then((response) => {
|
2948
|
|
- if (response.data.state == 0) {
|
2949
|
|
- return false;
|
2950
|
|
- }
|
2951
|
|
- var schedules = response.data.data.schedules;
|
2952
|
|
- this.dataloading = false
|
2953
|
|
- this.current_all_sch[0].tableWeekArrage = [];
|
2954
|
|
- this.current_all_sch[1].tableWeekArrage = [];
|
2955
|
|
- this.current_all_sch[2].tableWeekArrage = [];
|
2956
|
|
- this.editableTabs[0].tableWeekArrage = [];
|
2957
|
|
- this.editableTabs[0].checkedWeek = [];
|
2958
|
|
- this.editableTabs[1].tableWeekArrage = [];
|
2959
|
|
- this.editableTabs[1].checkedWeek = [];
|
2960
|
|
- this.editableTabs[2].tableWeekArrage = [];
|
2961
|
|
- this.editableTabs[2].checkedWeek = [];
|
2962
|
|
- var tempDate = new Date();
|
2963
|
|
- var day = tempDate.getDay();
|
2964
|
|
- if (day == 0) {
|
2965
|
|
- day = 7;
|
2966
|
|
- }
|
2967
|
|
-
|
2968
|
|
- for (let i = 0; i < schedules.length; i++) {
|
2969
|
|
-
|
2970
|
|
-
|
2971
|
|
- var week_type = this.getWeekType(
|
2972
|
|
- this.getTime(schedules[i].schedule_date, "{y}-{m}-{d}")
|
2973
|
|
- ).toString();
|
2974
|
|
-
|
2975
|
|
- switch (week_type) {
|
2976
|
|
- case "1":
|
2977
|
|
- var obj = {
|
2978
|
|
- mode_id: schedules[i].mode_id,
|
2979
|
|
- sch_type: schedules[i].schedule_type,
|
2980
|
|
- zone_id: schedules[i].partition_id,
|
2981
|
|
- jihao_id: schedules[i].bed_id,
|
2982
|
|
- is_edit: false,
|
2983
|
|
- week: this.getWeek(schedules[i].schedule_week),
|
2984
|
|
- schedule_date: this.getDate(schedules[i].schedule_week),
|
2985
|
|
- jihaos: this.partitionsProp[schedules[i].partition_id].jihaos,
|
2986
|
|
- sch_id: schedules[i].id,
|
2987
|
|
- };
|
2988
|
|
- let is_edit = true;
|
2989
|
|
- if (
|
2990
|
|
- schedules[i].schedule_week < day ||
|
2991
|
|
- schedules[i].order.id > 0
|
2992
|
|
- ) {
|
2993
|
|
- is_edit = false;
|
2994
|
|
- } else {
|
2995
|
|
- is_edit = true;
|
2996
|
|
- }
|
2997
|
|
- obj.is_edit = is_edit;
|
2998
|
|
- console.log("schedules[i].order.id")
|
2999
|
|
-
|
3000
|
|
- console.log(schedules[i].order.id)
|
3001
|
|
-
|
3002
|
|
- for (let b = 0; b < this.weeks.length; b++) {
|
3003
|
|
- if (schedules[i].schedule_week == this.weeks[b].week_type) {
|
3004
|
|
- if (
|
3005
|
|
- this.weeks[b].week_type >= day &&
|
3006
|
|
- schedules[i].order.id == 0
|
3007
|
|
- ) {
|
3008
|
|
- this.weeks[b].is_edit = true;
|
3009
|
|
- } else {
|
3010
|
|
- let obj = {
|
3011
|
|
- week_type:this.weeks[b].week_type,
|
3012
|
|
- order_id:schedules[i].order.id,
|
3013
|
|
- }
|
3014
|
|
- this.first_weeks.push(obj)
|
3015
|
|
- this.weeks[b].is_edit = false;
|
3016
|
|
- }
|
3017
|
|
-
|
3018
|
|
- this.editableTabs[0].checkedWeek.push(this.weeks[b]);
|
3019
|
|
- }
|
3020
|
|
- }
|
3021
|
|
- data[0].tableWeekArrage.push(obj);
|
3022
|
|
-
|
3023
|
|
- this.editableTabs[0].tableWeekArrage.push(obj);
|
3024
|
|
- break;
|
3025
|
|
- case "2":
|
3026
|
|
- var obj2 = {
|
3027
|
|
- mode_id: schedules[i].mode_id,
|
3028
|
|
- sch_type: schedules[i].schedule_type,
|
3029
|
|
- zone_id: schedules[i].partition_id,
|
3030
|
|
- jihao_id: schedules[i].bed_id,
|
3031
|
|
- is_edit: true,
|
3032
|
|
- week: this.getWeek(schedules[i].schedule_week),
|
3033
|
|
- schedule_date: this.getDate(schedules[i].schedule_week + 7),
|
3034
|
|
- jihaos: this.partitionsProp[schedules[i].partition_id].jihaos,
|
3035
|
|
- sch_id: schedules[i].id,
|
3036
|
|
- };
|
3037
|
|
-
|
3038
|
|
- for (let b = 0; b < this.weeks.length; b++) {
|
3039
|
|
- if (schedules[i].schedule_week == this.weeks[b].week_type) {
|
3040
|
|
- // this.weeks[b].is_edit = true;
|
3041
|
|
- this.editableTabs[1].checkedWeek.push(this.weeks[b]);
|
3042
|
|
- }
|
3043
|
|
- }
|
3044
|
|
- data[1].tableWeekArrage.push(obj2);
|
3045
|
|
- this.editableTabs[1].tableWeekArrage.push(obj2);
|
3046
|
|
- break;
|
3047
|
|
-
|
3048
|
|
- case "3":
|
3049
|
|
- let obj3 = {
|
3050
|
|
- mode_id: schedules[i].mode_id,
|
3051
|
|
- sch_type: schedules[i].schedule_type,
|
3052
|
|
- zone_id: schedules[i].partition_id,
|
3053
|
|
- jihao_id: schedules[i].bed_id,
|
3054
|
|
- is_edit: true,
|
3055
|
|
- week: this.getWeek(schedules[i].schedule_week),
|
3056
|
|
- schedule_date: this.getDate(schedules[i].schedule_week + 14),
|
3057
|
|
- jihaos: this.partitionsProp[schedules[i].partition_id].jihaos,
|
3058
|
|
- sch_id: schedules[i].id,
|
3059
|
|
- };
|
3060
|
|
- for (let b = 0; b < this.weeks.length; b++) {
|
3061
|
|
- if (schedules[i].schedule_week == this.weeks[b].week_type) {
|
3062
|
|
- // this.weeks[b].is_edit = true;
|
3063
|
|
- this.editableTabs[2].checkedWeek.push(this.weeks[b]);
|
3064
|
|
- }
|
3065
|
|
- }
|
3066
|
|
- data[2].tableWeekArrage.push(obj3);
|
3067
|
|
-
|
3068
|
|
- this.editableTabs[2].tableWeekArrage.push(obj3);
|
3069
|
|
- break;
|
3070
|
|
- }
|
3071
|
|
- }
|
3072
|
|
- });
|
3073
|
|
-
|
3074
|
|
- if(this.editableTabsValue == "1") {
|
3075
|
|
- var tempDate = new Date();
|
3076
|
|
- var day = tempDate.getDay();
|
3077
|
|
- if (day == 0) {
|
3078
|
|
- day = 7;
|
3079
|
|
- }
|
3080
|
|
- for (let i = 0; i < this.weeks.length; i++) {
|
3081
|
|
- if (this.weeks[i].week_type < day) {
|
3082
|
|
- this.weeks[i].is_edit = false;
|
3083
|
|
- }
|
3084
|
|
- }
|
3085
|
|
- }
|
3086
|
|
-
|
3087
|
|
-
|
3088
|
|
- for (let i = 0; i < this.editableTabs.length; i++) {
|
3089
|
|
- for(let b = 0; b < this.editableTabs[i].tableWeekArrage.length;b++){
|
3090
|
|
- data[i]["week_type"] = this.getWeekByzhongwen(data[i].week);
|
3091
|
|
-
|
3092
|
|
-
|
3093
|
|
-
|
3094
|
|
- }
|
3095
|
|
- }
|
3096
|
|
-
|
3097
|
|
- data.sort(function (a, b) {
|
3098
|
|
- return a.week_type - b.week_type;
|
3099
|
|
- });
|
3100
|
|
-
|
3101
|
|
-
|
3102
|
|
-
|
3103
|
|
- this.current_patient_data = data
|
3104
|
|
- console.log("current_patient_data")
|
3105
|
|
- console.log(this.current_patient_data)
|
|
2915
|
+ // for (let i = 0; i < this.patientList.length; i++) {
|
|
2916
|
+ // if (this.patientList[i].id == this.cur_info.patient_id) {
|
|
2917
|
+ // this.cur_smart_patient_name = this.patientList[i].name;
|
|
2918
|
+ // this.cur_smart_patient_no = this.patientList[i].dialysis_no;
|
|
2919
|
+ // this.cur_smart_patient_id = this.patientList[i].id;
|
|
2920
|
+ // }
|
|
2921
|
+ // }
|
|
2922
|
+ //
|
|
2923
|
+ // let params = {
|
|
2924
|
+ // patient_id: this.cur_info.patient_id,
|
|
2925
|
+ // };
|
|
2926
|
+ // let data = [
|
|
2927
|
+ // {
|
|
2928
|
+ // checkedWeek: [],
|
|
2929
|
+ // title: "本周",
|
|
2930
|
+ // name: "1",
|
|
2931
|
+ // tableWeekArrage: [],
|
|
2932
|
+ // },
|
|
2933
|
+ // {
|
|
2934
|
+ // checkedWeek: [],
|
|
2935
|
+ // title: "下周",
|
|
2936
|
+ // name: "2",
|
|
2937
|
+ // tableWeekArrage: [],
|
|
2938
|
+ // },
|
|
2939
|
+ // {
|
|
2940
|
+ // checkedWeek: [],
|
|
2941
|
+ // title: "下下周",
|
|
2942
|
+ // name: "3",
|
|
2943
|
+ // tableWeekArrage: [],
|
|
2944
|
+ // },
|
|
2945
|
+ // ];
|
|
2946
|
+ // this.first_weeks = []
|
|
2947
|
+ // getPatientSmartSch(params).then((response) => {
|
|
2948
|
+ // if (response.data.state == 0) {
|
|
2949
|
+ // return false;
|
|
2950
|
+ // }
|
|
2951
|
+ // var schedules = response.data.data.schedules;
|
|
2952
|
+ // this.dataloading = false
|
|
2953
|
+ // this.current_all_sch[0].tableWeekArrage = [];
|
|
2954
|
+ // this.current_all_sch[1].tableWeekArrage = [];
|
|
2955
|
+ // this.current_all_sch[2].tableWeekArrage = [];
|
|
2956
|
+ // this.editableTabs[0].tableWeekArrage = [];
|
|
2957
|
+ // this.editableTabs[0].checkedWeek = [];
|
|
2958
|
+ // this.editableTabs[1].tableWeekArrage = [];
|
|
2959
|
+ // this.editableTabs[1].checkedWeek = [];
|
|
2960
|
+ // this.editableTabs[2].tableWeekArrage = [];
|
|
2961
|
+ // this.editableTabs[2].checkedWeek = [];
|
|
2962
|
+ // var tempDate = new Date();
|
|
2963
|
+ // var day = tempDate.getDay();
|
|
2964
|
+ // if (day == 0) {
|
|
2965
|
+ // day = 7;
|
|
2966
|
+ // }
|
|
2967
|
+ //
|
|
2968
|
+ // for (let i = 0; i < schedules.length; i++) {
|
|
2969
|
+ //
|
|
2970
|
+ //
|
|
2971
|
+ // var week_type = this.getWeekType(
|
|
2972
|
+ // this.getTime(schedules[i].schedule_date, "{y}-{m}-{d}")
|
|
2973
|
+ // ).toString();
|
|
2974
|
+ //
|
|
2975
|
+ // switch (week_type) {
|
|
2976
|
+ // case "1":
|
|
2977
|
+ // var obj = {
|
|
2978
|
+ // mode_id: schedules[i].mode_id,
|
|
2979
|
+ // sch_type: schedules[i].schedule_type,
|
|
2980
|
+ // zone_id: schedules[i].partition_id,
|
|
2981
|
+ // jihao_id: schedules[i].bed_id,
|
|
2982
|
+ // is_edit: false,
|
|
2983
|
+ // week: this.getWeek(schedules[i].schedule_week),
|
|
2984
|
+ // schedule_date: this.getDate(schedules[i].schedule_week),
|
|
2985
|
+ // jihaos: this.partitionsProp[schedules[i].partition_id].jihaos,
|
|
2986
|
+ // sch_id: schedules[i].id,
|
|
2987
|
+ // };
|
|
2988
|
+ // let is_edit = true;
|
|
2989
|
+ // if (
|
|
2990
|
+ // schedules[i].schedule_week < day ||
|
|
2991
|
+ // schedules[i].order.id > 0
|
|
2992
|
+ // ) {
|
|
2993
|
+ // is_edit = false;
|
|
2994
|
+ // } else {
|
|
2995
|
+ // is_edit = true;
|
|
2996
|
+ // }
|
|
2997
|
+ // obj.is_edit = is_edit;
|
|
2998
|
+ // console.log("schedules[i].order.id")
|
|
2999
|
+ //
|
|
3000
|
+ // console.log(schedules[i].order.id)
|
|
3001
|
+ //
|
|
3002
|
+ // for (let b = 0; b < this.weeks.length; b++) {
|
|
3003
|
+ // if (schedules[i].schedule_week == this.weeks[b].week_type) {
|
|
3004
|
+ // if (
|
|
3005
|
+ // this.weeks[b].week_type >= day &&
|
|
3006
|
+ // schedules[i].order.id == 0
|
|
3007
|
+ // ) {
|
|
3008
|
+ // this.weeks[b].is_edit = true;
|
|
3009
|
+ // } else {
|
|
3010
|
+ // let obj = {
|
|
3011
|
+ // week_type:this.weeks[b].week_type,
|
|
3012
|
+ // order_id:schedules[i].order.id,
|
|
3013
|
+ // }
|
|
3014
|
+ // this.first_weeks.push(obj)
|
|
3015
|
+ // this.weeks[b].is_edit = false;
|
|
3016
|
+ // }
|
|
3017
|
+ //
|
|
3018
|
+ // this.editableTabs[0].checkedWeek.push(this.weeks[b]);
|
|
3019
|
+ // }
|
|
3020
|
+ // }
|
|
3021
|
+ // data[0].tableWeekArrage.push(obj);
|
|
3022
|
+ //
|
|
3023
|
+ // this.editableTabs[0].tableWeekArrage.push(obj);
|
|
3024
|
+ // break;
|
|
3025
|
+ // case "2":
|
|
3026
|
+ // var obj2 = {
|
|
3027
|
+ // mode_id: schedules[i].mode_id,
|
|
3028
|
+ // sch_type: schedules[i].schedule_type,
|
|
3029
|
+ // zone_id: schedules[i].partition_id,
|
|
3030
|
+ // jihao_id: schedules[i].bed_id,
|
|
3031
|
+ // is_edit: true,
|
|
3032
|
+ // week: this.getWeek(schedules[i].schedule_week),
|
|
3033
|
+ // schedule_date: this.getDate(schedules[i].schedule_week + 7),
|
|
3034
|
+ // jihaos: this.partitionsProp[schedules[i].partition_id].jihaos,
|
|
3035
|
+ // sch_id: schedules[i].id,
|
|
3036
|
+ // };
|
|
3037
|
+ //
|
|
3038
|
+ // for (let b = 0; b < this.weeks.length; b++) {
|
|
3039
|
+ // if (schedules[i].schedule_week == this.weeks[b].week_type) {
|
|
3040
|
+ // // this.weeks[b].is_edit = true;
|
|
3041
|
+ // this.editableTabs[1].checkedWeek.push(this.weeks[b]);
|
|
3042
|
+ // }
|
|
3043
|
+ // }
|
|
3044
|
+ // data[1].tableWeekArrage.push(obj2);
|
|
3045
|
+ // this.editableTabs[1].tableWeekArrage.push(obj2);
|
|
3046
|
+ // break;
|
|
3047
|
+ //
|
|
3048
|
+ // case "3":
|
|
3049
|
+ // let obj3 = {
|
|
3050
|
+ // mode_id: schedules[i].mode_id,
|
|
3051
|
+ // sch_type: schedules[i].schedule_type,
|
|
3052
|
+ // zone_id: schedules[i].partition_id,
|
|
3053
|
+ // jihao_id: schedules[i].bed_id,
|
|
3054
|
+ // is_edit: true,
|
|
3055
|
+ // week: this.getWeek(schedules[i].schedule_week),
|
|
3056
|
+ // schedule_date: this.getDate(schedules[i].schedule_week + 14),
|
|
3057
|
+ // jihaos: this.partitionsProp[schedules[i].partition_id].jihaos,
|
|
3058
|
+ // sch_id: schedules[i].id,
|
|
3059
|
+ // };
|
|
3060
|
+ // for (let b = 0; b < this.weeks.length; b++) {
|
|
3061
|
+ // if (schedules[i].schedule_week == this.weeks[b].week_type) {
|
|
3062
|
+ // // this.weeks[b].is_edit = true;
|
|
3063
|
+ // this.editableTabs[2].checkedWeek.push(this.weeks[b]);
|
|
3064
|
+ // }
|
|
3065
|
+ // }
|
|
3066
|
+ // data[2].tableWeekArrage.push(obj3);
|
|
3067
|
+ //
|
|
3068
|
+ // this.editableTabs[2].tableWeekArrage.push(obj3);
|
|
3069
|
+ // break;
|
|
3070
|
+ // }
|
|
3071
|
+ // }
|
|
3072
|
+ // });
|
|
3073
|
+
|
|
3074
|
+ // if(this.editableTabsValue == "1") {
|
|
3075
|
+ // var tempDate = new Date();
|
|
3076
|
+ // var day = tempDate.getDay();
|
|
3077
|
+ // if (day == 0) {
|
|
3078
|
+ // day = 7;
|
|
3079
|
+ // }
|
|
3080
|
+ // for (let i = 0; i < this.weeks.length; i++) {
|
|
3081
|
+ // if (this.weeks[i].week_type < day) {
|
|
3082
|
+ // this.weeks[i].is_edit = false;
|
|
3083
|
+ // }
|
|
3084
|
+ // }
|
|
3085
|
+ // }
|
|
3086
|
+ //
|
|
3087
|
+ //
|
|
3088
|
+ // for (let i = 0; i < this.editableTabs.length; i++) {
|
|
3089
|
+ // for(let b = 0; b < this.editableTabs[i].tableWeekArrage.length;b++){
|
|
3090
|
+ // data[i]["week_type"] = this.getWeekByzhongwen(data[i].week);
|
|
3091
|
+ //
|
|
3092
|
+ //
|
|
3093
|
+ //
|
|
3094
|
+ // }
|
|
3095
|
+ // }
|
|
3096
|
+ //
|
|
3097
|
+ // data.sort(function (a, b) {
|
|
3098
|
+ // return a.week_type - b.week_type;
|
|
3099
|
+ // });
|
|
3100
|
+ //
|
|
3101
|
+ //
|
|
3102
|
+ //
|
|
3103
|
+ // this.current_patient_data = data
|
|
3104
|
+ // console.log("current_patient_data")
|
|
3105
|
+ // console.log(this.current_patient_data)
|
3106
|
3106
|
|
3107
|
3107
|
this.smartVisible = true;
|
3108
|
|
- this.current_all_sch = data;
|
3109
|
|
- this.src_all_sch = data;
|
|
3108
|
+ // this.current_all_sch = data;
|
|
3109
|
+ // this.src_all_sch = data;
|
3110
|
3110
|
|
3111
|
3111
|
},
|
3112
|
3112
|
|