|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
<template>
|
|
|
<view style="width: 100%;height: 100%;">
|
|
<view style="width: 100%;height: 100%;">
|
|
|
<!--医院列表 -->
|
|
<!--医院列表 -->
|
|
|
- <u-select v-model="hospitalListShow" :list="hospitalList" @confirm="setSelectHospital" ></u-select>
|
|
|
|
|
|
|
+ <u-select v-model="hospitalListShow" :list="hospitalList" @confirm="setSelectHospital"></u-select>
|
|
|
<u-select v-model="timeShow" mode="mutil-column-auto" :list="timeList" @confirm="yearConfirm" :default-value="defaultIndex"></u-select>
|
|
<u-select v-model="timeShow" mode="mutil-column-auto" :list="timeList" @confirm="yearConfirm" :default-value="defaultIndex"></u-select>
|
|
|
<!--日视图弹出层-->
|
|
<!--日视图弹出层-->
|
|
|
<u-popup v-model="popupShow" mode="bottom" border-radius="50">
|
|
<u-popup v-model="popupShow" mode="bottom" border-radius="50">
|
|
@@ -104,28 +104,29 @@
|
|
|
this.getMonthList();
|
|
this.getMonthList();
|
|
|
// this.getMonthList();
|
|
// this.getMonthList();
|
|
|
// this.getNowmonth()
|
|
// this.getNowmonth()
|
|
|
- console.log("s", this.schedulingList)
|
|
|
|
|
|
|
+ console.log("排班数据", this.schedulingList)
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
onShow() {
|
|
onShow() {
|
|
|
|
|
+ this.defaultIndex= [0,0]
|
|
|
|
|
+ this.getNowTime()
|
|
|
if (this.refresh) {
|
|
if (this.refresh) {
|
|
|
this.monthList.splice(0, this.monthList.length);
|
|
this.monthList.splice(0, this.monthList.length);
|
|
|
this.schedulingList.splice(0, this.schedulingList.length);
|
|
this.schedulingList.splice(0, this.schedulingList.length);
|
|
|
this.$nextTick(function() {
|
|
this.$nextTick(function() {
|
|
|
this.getHostail()
|
|
this.getHostail()
|
|
|
- this.getNowTime()
|
|
|
|
|
this.getMonthList();
|
|
this.getMonthList();
|
|
|
})
|
|
})
|
|
|
- this.refresh=false
|
|
|
|
|
|
|
+ this.refresh = false
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
},
|
|
},
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
//保存医院下标
|
|
//保存医院下标
|
|
|
- defaultIndex:[0,0],
|
|
|
|
|
-
|
|
|
|
|
- refresh:false,
|
|
|
|
|
|
|
+ defaultIndex: [0, 0],
|
|
|
|
|
+
|
|
|
|
|
+ refresh: false,
|
|
|
timeShow: false,
|
|
timeShow: false,
|
|
|
timeList: [],
|
|
timeList: [],
|
|
|
year: 0, //年
|
|
year: 0, //年
|
|
@@ -191,22 +192,19 @@
|
|
|
if (this.hospitalID != 0) {
|
|
if (this.hospitalID != 0) {
|
|
|
if (this.saveDayType.mon == this.hospitalID) {
|
|
if (this.saveDayType.mon == this.hospitalID) {
|
|
|
SaveLists.push(1)
|
|
SaveLists.push(1)
|
|
|
|
|
+ } else if (this.saveDayType.mon == 0) {
|
|
|
|
|
+ SaveLists.push(0)
|
|
|
}
|
|
}
|
|
|
- //else if(this.saveDayType.mon == 0){
|
|
|
|
|
- // SaveLists.push(0)
|
|
|
|
|
- // }
|
|
|
|
|
if (this.saveDayType.aft == this.hospitalID) {
|
|
if (this.saveDayType.aft == this.hospitalID) {
|
|
|
SaveLists.push(2)
|
|
SaveLists.push(2)
|
|
|
|
|
+ } else if (this.saveDayType.aft == 0) {
|
|
|
|
|
+ SaveLists.push(0)
|
|
|
}
|
|
}
|
|
|
- //else if(this.saveDayType.aft == 0){
|
|
|
|
|
- // SaveLists.push(0)
|
|
|
|
|
- // }
|
|
|
|
|
if (this.saveDayType.nig == this.hospitalID) {
|
|
if (this.saveDayType.nig == this.hospitalID) {
|
|
|
SaveLists.push(3)
|
|
SaveLists.push(3)
|
|
|
|
|
+ } else if (this.saveDayType.nig == 0) {
|
|
|
|
|
+ SaveLists.push(0)
|
|
|
}
|
|
}
|
|
|
- //else if(this.saveDayType.nig == 0){
|
|
|
|
|
- // SaveLists.push(0)
|
|
|
|
|
- // }
|
|
|
|
|
if (SaveLists.length != 0) {
|
|
if (SaveLists.length != 0) {
|
|
|
let s = SaveLists.join(",");
|
|
let s = SaveLists.join(",");
|
|
|
let tj = {
|
|
let tj = {
|
|
@@ -215,7 +213,7 @@
|
|
|
'type': s,
|
|
'type': s,
|
|
|
'organization_id': this.hospitalID,
|
|
'organization_id': this.hospitalID,
|
|
|
}
|
|
}
|
|
|
- console.log(tj);
|
|
|
|
|
|
|
+ console.log("提交时间的数组",tj);
|
|
|
// if(typeof tj=='object'){
|
|
// if(typeof tj=='object'){
|
|
|
// tj = JSON.stringify(tj);
|
|
// tj = JSON.stringify(tj);
|
|
|
// }
|
|
// }
|
|
@@ -276,14 +274,17 @@
|
|
|
let day = new Date();
|
|
let day = new Date();
|
|
|
let a = day.getDate()
|
|
let a = day.getDate()
|
|
|
for (let x = 0; x < this.monthList.length - this.empty; x++) {
|
|
for (let x = 0; x < this.monthList.length - this.empty; x++) {
|
|
|
- this.monthList[x + this.empty].mon = this.schedulingList[x].mon == "0" ? 0 : this.schedulingList[x].mon == this.hospitalID&&this.overdue(x) ?
|
|
|
|
|
|
|
+ this.monthList[x + this.empty].mon = this.schedulingList[x].mon == "0" ? 0 : this.schedulingList[x].mon == this.hospitalID &&
|
|
|
|
|
+ this.overdue(x) ?
|
|
|
1 : 2
|
|
1 : 2
|
|
|
- this.monthList[x + this.empty].aft = this.schedulingList[x].aft == "0" ? 0 : this.schedulingList[x].aft == this.hospitalID&&this.overdue(x) ?
|
|
|
|
|
|
|
+ this.monthList[x + this.empty].aft = this.schedulingList[x].aft == "0" ? 0 : this.schedulingList[x].aft == this.hospitalID &&
|
|
|
|
|
+ this.overdue(x) ?
|
|
|
1 : 2
|
|
1 : 2
|
|
|
- this.monthList[x + this.empty].nig = this.schedulingList[x].nig == "0" ? 0 : this.schedulingList[x].nig == this.hospitalID&&this.overdue(x) ?
|
|
|
|
|
|
|
+ this.monthList[x + this.empty].nig = this.schedulingList[x].nig == "0" ? 0 : this.schedulingList[x].nig == this.hospitalID &&
|
|
|
|
|
+ this.overdue(x) ?
|
|
|
1 : 2
|
|
1 : 2
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// for (let x = 0; x < this.monthList.length - this.empty - a; x++) {
|
|
// for (let x = 0; x < this.monthList.length - this.empty - a; x++) {
|
|
|
// this.monthList[x + this.empty - a].mon = this.schedulingList[x - a].mon == "0" ? 0 : 2
|
|
// this.monthList[x + this.empty - a].mon = this.schedulingList[x - a].mon == "0" ? 0 : 2
|
|
|
// this.monthList[x + this.empty - a].aft = this.schedulingList[x - a].aft == "0" ? 0 : 2
|
|
// this.monthList[x + this.empty - a].aft = this.schedulingList[x - a].aft == "0" ? 0 : 2
|
|
@@ -291,15 +292,15 @@
|
|
|
// }
|
|
// }
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- overdue(day){
|
|
|
|
|
|
|
+ overdue(day) {
|
|
|
let date = new Date();
|
|
let date = new Date();
|
|
|
- if(this.year==date.getFullYear()&&this.month==date.getMonth()&&day+1<date.getDate()){
|
|
|
|
|
- console.log("123123",day+1,date.getDate(),this.year,date.getFullYear(),this.month,date.getMonth())
|
|
|
|
|
|
|
+ if (this.year == date.getFullYear() && this.month == date.getMonth() && day + 1 < date.getDate()) {
|
|
|
return false
|
|
return false
|
|
|
- }else{return true}
|
|
|
|
|
-
|
|
|
|
|
- }
|
|
|
|
|
- ,
|
|
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return true
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ },
|
|
|
getMonthList: async function() {
|
|
getMonthList: async function() {
|
|
|
console.log("请求数据", this.mothonStart, this.mothonEnd)
|
|
console.log("请求数据", this.mothonStart, this.mothonEnd)
|
|
|
let res = await this.$request.post("doctor/monthDetail", {
|
|
let res = await this.$request.post("doctor/monthDetail", {
|
|
@@ -344,9 +345,10 @@
|
|
|
yearList.push({
|
|
yearList.push({
|
|
|
label: x + "月",
|
|
label: x + "月",
|
|
|
value: x,
|
|
value: x,
|
|
|
- extra:x-1
|
|
|
|
|
|
|
+ extra: x - 1
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
|
|
+ this.timeList.splice(0, this.timeList.length)
|
|
|
for (let x = 0; x < 3; x++) {
|
|
for (let x = 0; x < 3; x++) {
|
|
|
this.timeList.push({
|
|
this.timeList.push({
|
|
|
label: (this.year + x) + "年",
|
|
label: (this.year + x) + "年",
|
|
@@ -374,9 +376,6 @@
|
|
|
this.empty = date.getDay()
|
|
this.empty = date.getDay()
|
|
|
|
|
|
|
|
date.setFullYear(this.year, this.month + 1, 0); //查看这个月有几天
|
|
date.setFullYear(this.year, this.month + 1, 0); //查看这个月有几天
|
|
|
- console.log('查看这个月有几天:', date.setFullYear(this.year, this.month + 1, 0));
|
|
|
|
|
- console.log(this.year, this.month)
|
|
|
|
|
- console.log("本月最后一号", date.getDate());
|
|
|
|
|
|
|
|
|
|
this.mothonStart = this.year + '-' + (this.month + 1) + '-' + '01'
|
|
this.mothonStart = this.year + '-' + (this.month + 1) + '-' + '01'
|
|
|
|
|
|
|
@@ -397,9 +396,12 @@
|
|
|
select: false,
|
|
select: false,
|
|
|
//判断方法,通过判断是不是选中的医院ID
|
|
//判断方法,通过判断是不是选中的医院ID
|
|
|
//0没有排班,1有排班,2有排班,但不是这个医院
|
|
//0没有排班,1有排班,2有排班,但不是这个医院
|
|
|
- mon: this.schedulingList[c].mon == "0" ? 0 : this.schedulingList[c].mon == this.hospitalID&&this.overdue(c) ? 1 : 2,
|
|
|
|
|
- aft: this.schedulingList[c].aft == "0" ? 0 : this.schedulingList[c].aft == this.hospitalID&&this.overdue(c) ? 1 : 2,
|
|
|
|
|
- nig: this.schedulingList[c].nig == "0" ? 0 : this.schedulingList[c].nig == this.hospitalID&&this.overdue(c) ? 1 : 2
|
|
|
|
|
|
|
+ mon: this.schedulingList[c].mon == "0" ? 0 : this.schedulingList[c].mon == this.hospitalID && this.overdue(c) ?
|
|
|
|
|
+ 1 : 2,
|
|
|
|
|
+ aft: this.schedulingList[c].aft == "0" ? 0 : this.schedulingList[c].aft == this.hospitalID && this.overdue(c) ?
|
|
|
|
|
+ 1 : 2,
|
|
|
|
|
+ nig: this.schedulingList[c].nig == "0" ? 0 : this.schedulingList[c].nig == this.hospitalID && this.overdue(c) ?
|
|
|
|
|
+ 1 : 2
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
}
|
|
}
|
|
@@ -415,9 +417,7 @@
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
getimePate(str) {
|
|
getimePate(str) {
|
|
|
- console.log(str);
|
|
|
|
|
var date = new Date(str.replace(/-/g, '/'));
|
|
var date = new Date(str.replace(/-/g, '/'));
|
|
|
- console.log(date)
|
|
|
|
|
return Date.parse(date);
|
|
return Date.parse(date);
|
|
|
|
|
|
|
|
},
|
|
},
|
|
@@ -462,13 +462,13 @@
|
|
|
console.log('月份:', this.monthList);
|
|
console.log('月份:', this.monthList);
|
|
|
for (let x = 0; x < this.monthList.length - this.empty; x++) {
|
|
for (let x = 0; x < this.monthList.length - this.empty; x++) {
|
|
|
this.monthList[x + this.empty].mon = this.schedulingList[x].mon == "0" ? 0 : this.schedulingList[x].mon == this
|
|
this.monthList[x + this.empty].mon = this.schedulingList[x].mon == "0" ? 0 : this.schedulingList[x].mon == this
|
|
|
- .hospitalID ?
|
|
|
|
|
|
|
+ .hospitalID && this.overdue(x) ?
|
|
|
1 : 2
|
|
1 : 2
|
|
|
this.monthList[x + this.empty].aft = this.schedulingList[x].aft == "0" ? 0 : this.schedulingList[x].aft == this
|
|
this.monthList[x + this.empty].aft = this.schedulingList[x].aft == "0" ? 0 : this.schedulingList[x].aft == this
|
|
|
- .hospitalID ?
|
|
|
|
|
|
|
+ .hospitalID && this.overdue(x) ?
|
|
|
1 : 2
|
|
1 : 2
|
|
|
this.monthList[x + this.empty].nig = this.schedulingList[x].nig == "0" ? 0 : this.schedulingList[x].nig == this
|
|
this.monthList[x + this.empty].nig = this.schedulingList[x].nig == "0" ? 0 : this.schedulingList[x].nig == this
|
|
|
- .hospitalID ?
|
|
|
|
|
|
|
+ .hospitalID && this.overdue(x) ?
|
|
|
1 : 2
|
|
1 : 2
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
@@ -496,9 +496,9 @@
|
|
|
this.monthList.map(val => {
|
|
this.monthList.map(val => {
|
|
|
val.select = false
|
|
val.select = false
|
|
|
})
|
|
})
|
|
|
- this.saveDayType.mon = this.schedulingList[index - 2].mon;
|
|
|
|
|
- this.saveDayType.aft = this.schedulingList[index - 2].aft;
|
|
|
|
|
- this.saveDayType.nig = this.schedulingList[index - 2].nig;
|
|
|
|
|
|
|
+ this.saveDayType.mon = this.schedulingList[index - this.empty].mon;
|
|
|
|
|
+ this.saveDayType.aft = this.schedulingList[index - this.empty].aft;
|
|
|
|
|
+ this.saveDayType.nig = this.schedulingList[index - this.empty].nig;
|
|
|
this.monthList[index].select = true
|
|
this.monthList[index].select = true
|
|
|
this.day = text
|
|
this.day = text
|
|
|
this.popupShow = true
|
|
this.popupShow = true
|
|
@@ -520,10 +520,10 @@
|
|
|
* 确认选择年月
|
|
* 确认选择年月
|
|
|
* */
|
|
* */
|
|
|
yearConfirm(e) {
|
|
yearConfirm(e) {
|
|
|
- console.log("选择了年月",e)
|
|
|
|
|
|
|
+ console.log("选择了年月", e)
|
|
|
this.defaultIndex[0] = e[0].extra
|
|
this.defaultIndex[0] = e[0].extra
|
|
|
this.defaultIndex[1] = e[1].extra
|
|
this.defaultIndex[1] = e[1].extra
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
this.year = e[0].value
|
|
this.year = e[0].value
|
|
|
this.month = e[1].value - 1
|
|
this.month = e[1].value - 1
|
|
|
let d = new Date();
|
|
let d = new Date();
|
|
@@ -536,7 +536,6 @@
|
|
|
this.getHostail()
|
|
this.getHostail()
|
|
|
this.getMonthList();
|
|
this.getMonthList();
|
|
|
this.day = 0
|
|
this.day = 0
|
|
|
- console.log("s", this.schedulingList)
|
|
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
},
|
|
},
|