|
@@ -1827,17 +1827,53 @@
|
1827
|
1827
|
</div>
|
1828
|
1828
|
<span slot="footer" class="dialog-footer">
|
1829
|
1829
|
<el-button
|
1830
|
|
- type="primary"
|
1831
|
|
- @click="coverSch()"
|
|
1830
|
+ type="danger"
|
|
1831
|
+ @click="tipDialogVisibleTwo = true"
|
1832
|
1832
|
>替换</el-button>
|
1833
|
1833
|
<el-button
|
1834
|
1834
|
type="primary"
|
1835
|
|
- @click="changeSchTwo()"
|
|
1835
|
+ @click="tipDialogVisibleThree = true"
|
1836
|
1836
|
>交换</el-button>
|
1837
|
1837
|
<el-button @click="tipDialogVisible = false">取 消</el-button>
|
1838
|
1838
|
</span>
|
1839
|
1839
|
</el-dialog>
|
1840
|
1840
|
|
|
1841
|
+ <el-dialog
|
|
1842
|
+ title="提示"
|
|
1843
|
+ :visible.sync="tipDialogVisibleTwo"
|
|
1844
|
+ width="300px"
|
|
1845
|
+ >
|
|
1846
|
+ <div>
|
|
1847
|
+ 是否将此位置排班替换
|
|
1848
|
+ </div>
|
|
1849
|
+ <span slot="footer" class="dialog-footer">
|
|
1850
|
+ <el-button
|
|
1851
|
+ type="primary"
|
|
1852
|
+ @click="coverSch()"
|
|
1853
|
+ >确定</el-button>
|
|
1854
|
+
|
|
1855
|
+ <el-button @click="tipDialogVisibleTwo = false">取 消</el-button>
|
|
1856
|
+ </span>
|
|
1857
|
+ </el-dialog>
|
|
1858
|
+
|
|
1859
|
+
|
|
1860
|
+ <el-dialog
|
|
1861
|
+ title="提示"
|
|
1862
|
+ :visible.sync="tipDialogVisibleThree"
|
|
1863
|
+ width="300px"
|
|
1864
|
+ >
|
|
1865
|
+ <div>
|
|
1866
|
+ 是否将此位置排班互换
|
|
1867
|
+ </div>
|
|
1868
|
+ <span slot="footer" class="dialog-footer">
|
|
1869
|
+ <el-button
|
|
1870
|
+ type="primary"
|
|
1871
|
+ @click="changeSchTwo()"
|
|
1872
|
+ >确定</el-button>
|
|
1873
|
+ <el-button @click="tipDialogVisibleThree = false">取 消</el-button>
|
|
1874
|
+ </span>
|
|
1875
|
+ </el-dialog>
|
|
1876
|
+
|
1841
|
1877
|
|
1842
|
1878
|
</div>
|
1843
|
1879
|
</template>
|
|
@@ -1857,6 +1893,7 @@ import {
|
1857
|
1893
|
BatchSmartSch,
|
1858
|
1894
|
} from "@/api/schedule_template/sch_template";
|
1859
|
1895
|
import {
|
|
1896
|
+ CancelScheduleTwo,
|
1860
|
1897
|
CancelSchedule,
|
1861
|
1898
|
ChangeSchedule,
|
1862
|
1899
|
CreateSchedule,
|
|
@@ -1930,6 +1967,8 @@ export default {
|
1930
|
1967
|
|
1931
|
1968
|
data() {
|
1932
|
1969
|
return {
|
|
1970
|
+ tipDialogVisibleTwo:false,
|
|
1971
|
+ tipDialogVisibleThree:false,
|
1933
|
1972
|
cur_date:"",
|
1934
|
1973
|
dataloading:false,
|
1935
|
1974
|
current_patient_data:[],
|
|
@@ -1938,6 +1977,7 @@ export default {
|
1938
|
1977
|
saveloading: false,
|
1939
|
1978
|
zones: [],
|
1940
|
1979
|
weeks: weekOptions,
|
|
1980
|
+ first_weeks:[],
|
1941
|
1981
|
smart_keyword: "",
|
1942
|
1982
|
cur_smart_patient_id: 0,
|
1943
|
1983
|
cur_smart_patient_name: "",
|
|
@@ -2352,6 +2392,11 @@ export default {
|
2352
|
2392
|
},
|
2353
|
2393
|
handleClick() {
|
2354
|
2394
|
if (this.editableTabsValue == "1") {
|
|
2395
|
+
|
|
2396
|
+ console.log(this.first_weeks)
|
|
2397
|
+ console.log(this.weeks)
|
|
2398
|
+
|
|
2399
|
+
|
2355
|
2400
|
for (let i = 0; i < this.weeks.length; i++) {
|
2356
|
2401
|
var tempDate = new Date();
|
2357
|
2402
|
var day = tempDate.getDay();
|
|
@@ -2364,6 +2409,22 @@ export default {
|
2364
|
2409
|
this.weeks[i].is_edit = false;
|
2365
|
2410
|
}
|
2366
|
2411
|
}
|
|
2412
|
+
|
|
2413
|
+ for(let i = 0; i < this.weeks.length; i++){
|
|
2414
|
+ for(let b = 0; b < this.first_weeks.length; b++){
|
|
2415
|
+ if(this.weeks[i].week_type == this.first_weeks[b].week_type && this.first_weeks[b].order_id > 0){
|
|
2416
|
+ console.log(this.weeks[i].week_type)
|
|
2417
|
+ console.log(this.first_weeks[b].week_type)
|
|
2418
|
+ console.log(this.first_weeks[b].order_id)
|
|
2419
|
+
|
|
2420
|
+ this.weeks[i].is_edit = false
|
|
2421
|
+ }
|
|
2422
|
+
|
|
2423
|
+ }
|
|
2424
|
+ }
|
|
2425
|
+
|
|
2426
|
+
|
|
2427
|
+
|
2367
|
2428
|
} else {
|
2368
|
2429
|
for (let i = 0; i < this.weeks.length; i++) {
|
2369
|
2430
|
this.weeks[i].is_edit = true;
|
|
@@ -2531,16 +2592,16 @@ export default {
|
2531
|
2592
|
console.log(delTempData)
|
2532
|
2593
|
|
2533
|
2594
|
|
2534
|
|
-
|
2535
|
|
- for (let i = 0; i < delTempData.length; i++) {
|
2536
|
|
- for (let b = 0; b < saveOrEditTempData.length; b++) {
|
2537
|
|
- if(delTempData[i].sch_id == saveOrEditTempData[b].sch_id){
|
2538
|
|
- delTempData.splice(i,1)
|
|
2595
|
+ if(saveOrEditTempData.length > 0 ){
|
|
2596
|
+ for (let i = 0; i < delTempData.length; i++) {
|
|
2597
|
+ for (let b = 0; b < saveOrEditTempData.length; b++) {
|
|
2598
|
+ if(saveOrEditTempData[b].sch_id&&delTempData[i].sch_id&&delTempData[i].sch_id == saveOrEditTempData[b].sch_id){
|
|
2599
|
+ delTempData.splice(i,1)
|
|
2600
|
+ }
|
2539
|
2601
|
}
|
2540
|
2602
|
}
|
2541
|
|
- }
|
2542
|
|
- console.log(delTempData)
|
2543
|
2603
|
|
|
2604
|
+ }
|
2544
|
2605
|
for (let i = 0; i < saveOrEditTempData.length; i++) {
|
2545
|
2606
|
if (saveOrEditTempData[i].bed_id == "" || saveOrEditTempData[i].zone_id == "") {
|
2546
|
2607
|
this.$message.error("分区或者床位不能空");
|
|
@@ -2549,8 +2610,7 @@ export default {
|
2549
|
2610
|
}
|
2550
|
2611
|
|
2551
|
2612
|
|
2552
|
|
- if (saveOrEditTempData.length > 0 ) {
|
2553
|
|
-
|
|
2613
|
+ if (saveOrEditTempData.length > 0 || delTempData.length > 0) {
|
2554
|
2614
|
|
2555
|
2615
|
let obj = {
|
2556
|
2616
|
smart_schs: saveOrEditTempData,
|
|
@@ -2624,7 +2684,8 @@ export default {
|
2624
|
2684
|
return "";
|
2625
|
2685
|
},
|
2626
|
2686
|
handleSelect(val) {
|
2627
|
|
- this.dataloading = true
|
|
2687
|
+ this.first_weeks = []
|
|
2688
|
+ this.dataloading = true
|
2628
|
2689
|
getSmartSchByPatient(val.id).then((response) => {
|
2629
|
2690
|
this.dataloading = false
|
2630
|
2691
|
var sch = response.data.data.sch
|
|
@@ -2685,6 +2746,11 @@ export default {
|
2685
|
2746
|
) {
|
2686
|
2747
|
this.weeks[b].is_edit = true;
|
2687
|
2748
|
} else {
|
|
2749
|
+ let obj = {
|
|
2750
|
+ week_type:this.weeks[b].week_type,
|
|
2751
|
+ order_id:schedules[i].order.id,
|
|
2752
|
+ }
|
|
2753
|
+ this.first_weeks.push(obj)
|
2688
|
2754
|
this.weeks[b].is_edit = false;
|
2689
|
2755
|
}
|
2690
|
2756
|
this.editableTabs[0].checkedWeek.push(this.weeks[b]);
|
|
@@ -2946,7 +3012,7 @@ export default {
|
2946
|
3012
|
tableWeekArrage: [],
|
2947
|
3013
|
},
|
2948
|
3014
|
];
|
2949
|
|
-
|
|
3015
|
+ this.first_weeks = []
|
2950
|
3016
|
getPatientSmartSch(params).then((response) => {
|
2951
|
3017
|
if (response.data.state == 0) {
|
2952
|
3018
|
return false;
|
|
@@ -2998,7 +3064,9 @@ export default {
|
2998
|
3064
|
is_edit = true;
|
2999
|
3065
|
}
|
3000
|
3066
|
obj.is_edit = is_edit;
|
|
3067
|
+ console.log("schedules[i].order.id")
|
3001
|
3068
|
|
|
3069
|
+ console.log(schedules[i].order.id)
|
3002
|
3070
|
|
3003
|
3071
|
for (let b = 0; b < this.weeks.length; b++) {
|
3004
|
3072
|
if (schedules[i].schedule_week == this.weeks[b].week_type) {
|
|
@@ -3006,9 +3074,13 @@ export default {
|
3006
|
3074
|
this.weeks[b].week_type >= day &&
|
3007
|
3075
|
schedules[i].order.id == 0
|
3008
|
3076
|
) {
|
3009
|
|
-
|
3010
|
3077
|
this.weeks[b].is_edit = true;
|
3011
|
3078
|
} else {
|
|
3079
|
+ let obj = {
|
|
3080
|
+ week_type:this.weeks[b].week_type,
|
|
3081
|
+ order_id:schedules[i].order.id,
|
|
3082
|
+ }
|
|
3083
|
+ this.first_weeks.push(obj)
|
3012
|
3084
|
this.weeks[b].is_edit = false;
|
3013
|
3085
|
}
|
3014
|
3086
|
|
|
@@ -3273,9 +3345,6 @@ export default {
|
3273
|
3345
|
dragendTwo(event) {},
|
3274
|
3346
|
isEditForDate(day){
|
3275
|
3347
|
var week = this.weekDay(day);
|
3276
|
|
- console.log(this.weekDays[week[0] - 1].valueOf())
|
3277
|
|
- console.log( new Date(this.weekDays[week[0] - 1]).valueOf() /1000 )
|
3278
|
|
- console.log(this.weekDays[week[0] - 1] >= this.cur_date)
|
3279
|
3348
|
if( new Date(this.weekDays[week[0] - 1]).valueOf() /1000 >= this.cur_date){
|
3280
|
3349
|
return true
|
3281
|
3350
|
}else{
|
|
@@ -3285,15 +3354,12 @@ export default {
|
3285
|
3354
|
},
|
3286
|
3355
|
drag(e, day, index, name, row) {
|
3287
|
3356
|
e.preventDefault();
|
3288
|
|
- console.log("拖动前")
|
3289
|
|
- console.log(row)
|
3290
|
3357
|
for (var key in row) {
|
3291
|
3358
|
if (key == day) {
|
3292
|
3359
|
console.log(row[key].patient_id)
|
3293
|
3360
|
|
3294
|
3361
|
if(row[key].patient_id > 0 ) {
|
3295
|
3362
|
this.cur_drag_obj = 2
|
3296
|
|
- console.log(row)
|
3297
|
3363
|
var week = this.weekDay(day);
|
3298
|
3364
|
this.cur_drag_info.schedule_date = this.weekDays[week[0] - 1];
|
3299
|
3365
|
this.cur_drag_info.schedule_type = week[1];
|
|
@@ -3316,37 +3382,24 @@ export default {
|
3316
|
3382
|
allowDrop(e) {
|
3317
|
3383
|
e.preventDefault();
|
3318
|
3384
|
},coverSch(){
|
3319
|
|
- this.$confirm('是否将此位置排班替换?', '替换', {
|
3320
|
|
- confirmButtonText: '确 定',
|
3321
|
|
- cancelButtonText: '取 消',
|
3322
|
|
- type: 'warning'
|
3323
|
|
- }).then(() => {
|
3324
|
|
- let params={
|
3325
|
|
- id_one:this.cur_drag_info.id,
|
3326
|
|
- id_two:this.currentData.id
|
3327
|
|
-
|
3328
|
|
- }
|
3329
|
|
- CoverSch(params).then((response) => {
|
3330
|
|
- if (response.data.state == 0) {
|
3331
|
|
- this.$message.error(response.data.msg);
|
3332
|
|
- } else {
|
3333
|
|
- this.$message.success("替换成功");
|
3334
|
|
- this.tipDialogVisible = false
|
3335
|
|
- this.getSchedules();
|
|
3385
|
+ let params={
|
|
3386
|
+ id_one:this.cur_drag_info.id,
|
|
3387
|
+ id_two:this.currentData.id
|
3336
|
3388
|
|
3337
|
|
- }
|
3338
|
|
- });
|
3339
|
|
-
|
3340
|
|
- })
|
3341
|
|
- .catch(() => {
|
3342
|
|
- })
|
|
3389
|
+ }
|
|
3390
|
+ CoverSch(params).then((response) => {
|
|
3391
|
+ if (response.data.state == 0) {
|
|
3392
|
+ this.$message.error(response.data.msg);
|
|
3393
|
+ this.tipDialogVisibleTwo = false
|
3343
|
3394
|
|
|
3395
|
+ } else {
|
|
3396
|
+ this.$message.success("替换成功");
|
|
3397
|
+ this.tipDialogVisible = false
|
|
3398
|
+ this.tipDialogVisibleTwo = false
|
|
3399
|
+ this.getSchedules();
|
|
3400
|
+ }
|
|
3401
|
+ });
|
3344
|
3402
|
},changeSchTwo(){
|
3345
|
|
- this.$confirm('是否将此位置排班互换?', '交换', {
|
3346
|
|
- confirmButtonText: '确 定',
|
3347
|
|
- cancelButtonText: '取 消',
|
3348
|
|
- type: 'warning'
|
3349
|
|
- }).then(() => {
|
3350
|
3403
|
let params={
|
3351
|
3404
|
id_one:this.cur_drag_info.id,
|
3352
|
3405
|
id_two:this.currentData.id
|
|
@@ -3355,17 +3408,15 @@ export default {
|
3355
|
3408
|
ExchangeSch(params).then((response) => {
|
3356
|
3409
|
if (response.data.state == 0) {
|
3357
|
3410
|
this.$message.error(response.data.msg);
|
|
3411
|
+ this.tipDialogVisibleThree = false
|
3358
|
3412
|
} else {
|
3359
|
3413
|
this.$message.success("交换成功");
|
3360
|
3414
|
this.tipDialogVisible = false
|
|
3415
|
+ this.tipDialogVisibleThree = false
|
3361
|
3416
|
this.getSchedules();
|
3362
|
3417
|
|
3363
|
3418
|
}
|
3364
|
3419
|
});
|
3365
|
|
- })
|
3366
|
|
- .catch(() => {
|
3367
|
|
- })
|
3368
|
|
-
|
3369
|
3420
|
},
|
3370
|
3421
|
// ----------------------------------
|
3371
|
3422
|
// | !在html里面的chedule-item里绑定的|
|
|
@@ -3407,7 +3458,7 @@ export default {
|
3407
|
3458
|
if(this.cur_drag_obj == 2 ){
|
3408
|
3459
|
if(this.cur_drag_info.schedule_date == this.currentData.schedule_date){ //同一天
|
3409
|
3460
|
if(row[key].patient_id == 0) { //空床位
|
3410
|
|
- CancelSchedule(this.cur_drag_info.id).then((response) => {
|
|
3461
|
+ CancelScheduleTwo(this.cur_drag_info.id).then((response) => {
|
3411
|
3462
|
if (response.data.state == 0) {
|
3412
|
3463
|
this.$message.error(response.data.msg);
|
3413
|
3464
|
} else {
|
|
@@ -3437,15 +3488,16 @@ export default {
|
3437
|
3488
|
}
|
3438
|
3489
|
}
|
3439
|
3490
|
});
|
|
3491
|
+ //接口提交排班数据
|
|
3492
|
+ that.currentData.mode_id = that.cur_drag_info.mode_id;
|
|
3493
|
+ that.currentData.id = 0;
|
|
3494
|
+ that.currentData.contagions = [];
|
|
3495
|
+ that.currentData.patient_id = that.cur_drag_info.patient_id;
|
|
3496
|
+ that.currentData.patient = that.cur_drag_info.patient_name;
|
|
3497
|
+ that.setSchedule();
|
3440
|
3498
|
}
|
3441
|
3499
|
});
|
3442
|
|
- //接口提交排班数据
|
3443
|
|
- this.currentData.mode_id = this.cur_drag_info.mode_id;
|
3444
|
|
- this.currentData.id = 0;
|
3445
|
|
- this.currentData.contagions = [];
|
3446
|
|
- this.currentData.patient_id = this.cur_drag_info.patient_id;
|
3447
|
|
- this.currentData.patient = this.cur_drag_info.patient_name;
|
3448
|
|
- this.setSchedule();
|
|
3500
|
+
|
3449
|
3501
|
}else{ //非空,替換或者交換位置
|
3450
|
3502
|
this.tipDialogVisible = true
|
3451
|
3503
|
}
|
|
@@ -4343,7 +4395,7 @@ export default {
|
4343
|
4395
|
|
4344
|
4396
|
// 删除某一单元格内的患者透析排班
|
4345
|
4397
|
deletePatientMode(row) {
|
4346
|
|
-
|
|
4398
|
+ console.log(row)
|
4347
|
4399
|
if (row.schedule_id > 0) {
|
4348
|
4400
|
this.CancelSchedule(row.schedule_id);
|
4349
|
4401
|
}
|