|
@@ -972,6 +972,15 @@
|
972
|
972
|
@did_selected="will_add_schedule_action_three"
|
973
|
973
|
@did_cancel="cancel_schedule_action"
|
974
|
974
|
></schedule-selector-dialog>
|
|
975
|
+
|
|
976
|
+ <template-schedule-dialog
|
|
977
|
+ ref="selector_dialog_two"
|
|
978
|
+ :patients="patients"
|
|
979
|
+ @did_selected="will_add_schedule_action_four"
|
|
980
|
+ @did_cancel="cancel_schedule_action"
|
|
981
|
+ >
|
|
982
|
+ </template-schedule-dialog>
|
|
983
|
+
|
975
|
984
|
<!-- 智能排班 -->
|
976
|
985
|
<div class="dialog-wrapper">
|
977
|
986
|
<el-dialog
|
|
@@ -1210,6 +1219,7 @@ import {
|
1210
|
1219
|
import TemplateTableItem from "./template_table_item";
|
1211
|
1220
|
import ScheduleSelectorDialog from "./template_schedule_selector_dialog";
|
1212
|
1221
|
import { PostSearchSmartSchTemplatePatient } from "../../../api/schedule_template/sch_template";
|
|
1222
|
+import TemplateScheduleDialog from './template_schedule_dialog'
|
1213
|
1223
|
|
1214
|
1224
|
const weekOptions = [
|
1215
|
1225
|
{
|
|
@@ -1253,6 +1263,7 @@ var rowspanNoControl = -1;
|
1253
|
1263
|
export default {
|
1254
|
1264
|
name: "TemplateTable",
|
1255
|
1265
|
components: {
|
|
1266
|
+ TemplateScheduleDialog,
|
1256
|
1267
|
TemplateTableItem,
|
1257
|
1268
|
ScheduleSelectorDialog,
|
1258
|
1269
|
},
|
|
@@ -1795,7 +1806,7 @@ export default {
|
1795
|
1806
|
|
1796
|
1807
|
if (info.pid > 0 || info.treat_mode_id > 0 ) {
|
1797
|
1808
|
if (this.cur_drag_obj == 2){
|
1798
|
|
-
|
|
1809
|
+
|
1799
|
1810
|
if(info.pid != this.cur_drag_info.patient_id){
|
1800
|
1811
|
console.log('1234132412',info.pid,this.cur_drag_info.patient_id);
|
1801
|
1812
|
this.tipDialogVisible = true
|
|
@@ -2639,7 +2650,7 @@ export default {
|
2639
|
2650
|
this.cur_drag_info.id = 0;
|
2640
|
2651
|
|
2641
|
2652
|
}
|
2642
|
|
-
|
|
2653
|
+
|
2643
|
2654
|
console.log('this.cur_drag_info的数据',this.cur_drag_info);
|
2644
|
2655
|
},
|
2645
|
2656
|
allowDrop(e) {
|
|
@@ -2760,7 +2771,7 @@ export default {
|
2760
|
2771
|
}
|
2761
|
2772
|
return "";
|
2762
|
2773
|
},
|
2763
|
|
-
|
|
2774
|
+
|
2764
|
2775
|
makeDeviceNumbers: function (device_numbers) {
|
2765
|
2776
|
this.all_zones = [];
|
2766
|
2777
|
this.devices = [];
|
|
@@ -2998,26 +3009,19 @@ export default {
|
2998
|
3009
|
this.cur_info.patient_name = row[column.property].name
|
2999
|
3010
|
this.cur_info.mode_name = row[column.property].treat_mode
|
3000
|
3011
|
console.log('this.patient_id_hover的数据',this.patient_id_hover);
|
3001
|
|
- }
|
3002
|
|
-
|
3003
|
|
- // else {
|
3004
|
|
- // this.$refs.selector_dialog.showWith(item.pid, item.treat_mode_id, weekday, time_type, device_number_id)
|
3005
|
|
- // }
|
3006
|
|
- // console.log('row[column.property]',row[column.property]);
|
3007
|
|
- // if (row[column.property].schedule_id > 0) {
|
3008
|
|
- // let patient_id = row[column.property].patient_id
|
3009
|
|
- // this.patient_id_hover = patient_id;
|
3010
|
|
- // } else {
|
3011
|
|
- // this.patient_id_hover = -1;
|
3012
|
|
- // this.currentData.mode_id = 1;
|
3013
|
|
- // this.currentData.id = 0;
|
3014
|
|
- // this.currentData.patient_id = 0;
|
3015
|
|
- // this.currentData.patient = "";
|
3016
|
|
- // this.currentData.contagions = [];
|
3017
|
|
- // this.getSchedulePatients();
|
3018
|
|
- // this.dialogTableVisible = true;
|
|
3012
|
+ }else{
|
|
3013
|
+ var item = row[column.property]
|
|
3014
|
+ var weekday_timetype = column.property.split('_')
|
|
3015
|
+ var weekday = weekday_timetype[0]
|
|
3016
|
+ var time_type = weekday_timetype[1]
|
|
3017
|
+ var device_number_id = row.id
|
|
3018
|
+ if (item.pid == 0) {
|
|
3019
|
+ this.$refs.selector_dialog_two.show(weekday, time_type, device_number_id,this.patients)
|
|
3020
|
+ } else {
|
|
3021
|
+ this.$refs.selector_dialog_two.showWith(item.pid, item.treat_mode_id, weekday, time_type, device_number_id,this.patients)
|
|
3022
|
+ }
|
3019
|
3023
|
|
3020
|
|
- // }
|
|
3024
|
+ }
|
3021
|
3025
|
},
|
3022
|
3026
|
// 双击
|
3023
|
3027
|
itemdblclick (row, column, cell, event){
|
|
@@ -3127,6 +3131,88 @@ export default {
|
3127
|
3131
|
}
|
3128
|
3132
|
|
3129
|
3133
|
this.$message.error("设备不存在");
|
|
3134
|
+ }, will_add_schedule_action_four: function(patient_id, treat_mode, weekday, time_type, device_number_id) {
|
|
3135
|
+ var patient = null
|
|
3136
|
+ for (let index = 0; index < this.patients.length; index++) {
|
|
3137
|
+ const p = this.patients[index]
|
|
3138
|
+ if (p.id == patient_id) {
|
|
3139
|
+ patient = p
|
|
3140
|
+ break
|
|
3141
|
+ }
|
|
3142
|
+ }
|
|
3143
|
+ if (patient == null) {
|
|
3144
|
+ this.$message.error('患者不存在')
|
|
3145
|
+ return
|
|
3146
|
+ }
|
|
3147
|
+
|
|
3148
|
+ for (let index = 0; index < this.opera_device_numbers.length; index++) {
|
|
3149
|
+ const device_number = this.opera_device_numbers[index]
|
|
3150
|
+ console.log(device_number)
|
|
3151
|
+ for (let t_y = 1; t_y <= 3; t_y++) {
|
|
3152
|
+ if (t_y == time_type && device_number_id == device_number.id) {
|
|
3153
|
+ continue
|
|
3154
|
+ }
|
|
3155
|
+ if (device_number[weekday + '_' + t_y].pid == patient_id) {
|
|
3156
|
+ this.$message.error('同位患者一天内不可有两次排班')
|
|
3157
|
+ return
|
|
3158
|
+ }
|
|
3159
|
+ }
|
|
3160
|
+ }
|
|
3161
|
+
|
|
3162
|
+ for (let index = 0; index < this.opera_device_numbers.length; index++) {
|
|
3163
|
+ const device_number = this.opera_device_numbers[index]
|
|
3164
|
+ if (device_number.id == device_number_id) {
|
|
3165
|
+ var isDiseaseSame = false
|
|
3166
|
+ var havePatientDisease = patient.contagions.length > 0
|
|
3167
|
+ if (patient.contagions.length > 0 || device_number.zone.type != 1) {
|
|
3168
|
+ if (device_number.zone.type != 1) {
|
|
3169
|
+ for (let c_i = 0; c_i < patient.contagions.length; c_i++) {
|
|
3170
|
+ const contagion = patient.contagions[c_i]
|
|
3171
|
+ if (contagion.disease_id == device_number.zone.type) {
|
|
3172
|
+ isDiseaseSame = true
|
|
3173
|
+ }
|
|
3174
|
+ }
|
|
3175
|
+ }
|
|
3176
|
+ } else {
|
|
3177
|
+ isDiseaseSame = true
|
|
3178
|
+ }
|
|
3179
|
+ if (isDiseaseSame == false) {
|
|
3180
|
+ // 此患者没有传染病,与此透析机不匹配,确定在此排班吗?
|
|
3181
|
+ // 此患者有传染病,与此透析机不匹配,确定在此排班吗?
|
|
3182
|
+ var msg = havePatientDisease ? '此患者有传染病,与此透析机不匹配,确定在此排班吗?' : '此患者没有传染病,与此透析机不匹配,确定在此排班吗?'
|
|
3183
|
+ this.$confirm(msg, '提示', { confirmButtonText: '确 定', cancelButtonText: '取 消', type: 'warning' })
|
|
3184
|
+ .then(() => {
|
|
3185
|
+ // this.add_scheduleTwo(patient, device_number, treat_mode, weekday, time_type)
|
|
3186
|
+
|
|
3187
|
+ this.will_add_schedule_action(
|
|
3188
|
+ patient.id,
|
|
3189
|
+ treat_mode,
|
|
3190
|
+ weekday,
|
|
3191
|
+ time_type,
|
|
3192
|
+ device_number.id,
|
|
3193
|
+ 0
|
|
3194
|
+ );
|
|
3195
|
+ this.saveActionTwo();
|
|
3196
|
+ })
|
|
3197
|
+ } else {
|
|
3198
|
+ // this.add_scheduleTwo(patient, device_number, treat_mode, weekday, time_type)
|
|
3199
|
+ this.will_add_schedule_action(
|
|
3200
|
+ patient.id,
|
|
3201
|
+ treat_mode,
|
|
3202
|
+ weekday,
|
|
3203
|
+ time_type,
|
|
3204
|
+ device_number.id,
|
|
3205
|
+ 0
|
|
3206
|
+ );
|
|
3207
|
+ this.saveActionTwo();
|
|
3208
|
+ }
|
|
3209
|
+ // this.saveActionTwo()
|
|
3210
|
+ this.$refs.selector_dialog_two.hide()
|
|
3211
|
+ return
|
|
3212
|
+ }
|
|
3213
|
+ }
|
|
3214
|
+
|
|
3215
|
+ this.$message.error('设备不存在')
|
3130
|
3216
|
},
|
3131
|
3217
|
will_add_schedule_action_three: function (
|
3132
|
3218
|
patient_id,
|