| xqd
@@ -39,7 +39,7 @@
|
|
|
</u-popup>
|
|
|
<!-- 顶部标题和按钮 -->
|
|
|
<view class="flex justify-between align-center" style="margin: 40rpx 28rpx;">
|
|
|
- <view style="flex-grow: 2;" class="drop-down" @click="timeShow=true ">
|
|
|
+ <view style="flex-grow: 2;" class="drop-down" @click="timeShow=true ">
|
|
|
<text>{{year}}年{{month+1}}月</text>
|
|
|
<u-icon name="arrow-down-fill" size="32" color="#848484" v-show="!timeShow"></u-icon>
|
|
|
<u-icon name="arrow-up-fill" size="32" color="#848484" v-show="timeShow"></u-icon>
|
| xqd
@@ -68,23 +68,21 @@
|
|
|
:'height: 100rpx;width: 100rpx;border-radius:50%;background:#00aaff;color:#fff;font-weight: bold;'">{{item.text}}</view>
|
|
|
<!-- 排班情况 -->
|
|
|
<view style="color: #FFF;text-align: center;font-size: 28rpx;">
|
|
|
- <view :style="item.mon==1?
|
|
|
+ <view :style="item.mon > 0?'opacity:1.0':'opacity:0.0'">
|
|
|
+ <view :style="item.mon==1?
|
|
|
'margin: 5rpx 10rpx;background:#00aaff;border-radius: 50rpx;font-size: 20rpx;padding:6rpx 0;'
|
|
|
- :'margin: 5rpx 10rpx;background:#cccccc;border-radius: 50rpx;font-size: 20rpx;padding:6rpx 0'
|
|
|
- "
|
|
|
- v-if="item.mon > 0">上午</view>
|
|
|
-
|
|
|
- <view :style="item.aft==1?
|
|
|
+ :'margin: 5rpx 10rpx;background:#cccccc;border-radius: 50rpx;font-size: 20rpx;padding:6rpx 0'">上午</view>
|
|
|
+ </view>
|
|
|
+ <view :style="item.aft > 0?'opacity:1.0':'opacity:0.0'">
|
|
|
+ <view :style="item.aft==1?
|
|
|
'margin: 5rpx 10rpx;background:#ffaa00;border-radius: 50rpx;font-size: 20rpx;padding:6rpx 0;'
|
|
|
- :'margin: 5rpx 10rpx;background:#cccccc;border-radius: 50rpx;font-size: 20rpx;padding:6rpx 0'
|
|
|
- "
|
|
|
- v-if="item.aft > 0">下午</view>
|
|
|
-
|
|
|
- <view :style="item.nig==1?
|
|
|
+ :'margin: 5rpx 10rpx;background:#cccccc;border-radius: 50rpx;font-size: 20rpx;padding:6rpx 0'">下午</view>
|
|
|
+ </view>
|
|
|
+ <view :style="item.nig > 0?'opacity:1.0':'opacity:0.0'">
|
|
|
+ <view :style="item.nig==1?
|
|
|
'margin: 5rpx 10rpx;background:#55aa00;border-radius: 50rpx;font-size: 20rpx;padding:6rpx 0;'
|
|
|
- :'margin: 5rpx 10rpx;background:#cccccc;border-radius: 50rpx;font-size: 20rpx;padding:6rpx 0'
|
|
|
- "
|
|
|
- v-if="item.nig > 0">晚上</view>
|
|
|
+ :'margin: 5rpx 10rpx;background:#cccccc;border-radius: 50rpx;font-size: 20rpx;padding:6rpx 0'">晚上</view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
| xqd
@@ -108,13 +106,23 @@
|
|
|
// this.getNowmonth()
|
|
|
console.log("s", this.schedulingList)
|
|
|
})
|
|
|
-
|
|
|
},
|
|
|
onShow() {
|
|
|
+ if (this.refresh) {
|
|
|
+ this.monthList.splice(0, this.monthList.length);
|
|
|
+ this.schedulingList.splice(0, this.schedulingList.length);
|
|
|
+ this.$nextTick(function() {
|
|
|
+ this.getHostail()
|
|
|
+ this.getNowTime()
|
|
|
+ this.getMonthList();
|
|
|
+ })
|
|
|
+ this.refresh=false
|
|
|
+ }
|
|
|
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ refresh:false,
|
|
|
timeShow: false,
|
|
|
timeList: [],
|
|
|
year: 0, //年
|
| xqd
@@ -167,34 +175,6 @@
|
|
|
margin: '20rpx 0 10rpx 0'
|
|
|
},
|
|
|
saveDay: 0,
|
|
|
- //上午按钮样式
|
|
|
- monStyle: {
|
|
|
- backgroundColor: '#5667c8',
|
|
|
- color: '#fff',
|
|
|
- fontWeight: "bold",
|
|
|
- margin: '20rpx 0 10rpx 0'
|
|
|
- },
|
|
|
- //下午按钮样式
|
|
|
- aftStyle: {
|
|
|
- backgroundColor: '#ec9d75',
|
|
|
- color: '#fff',
|
|
|
- fontWeight: "bold",
|
|
|
- margin: '20rpx 0 10rpx 0'
|
|
|
- },
|
|
|
- //晚上按钮样式
|
|
|
- nigStyle: {
|
|
|
- backgroundColor: '#55aa7f',
|
|
|
- color: '#fff',
|
|
|
- fontWeight: "bold",
|
|
|
- margin: '20rpx 0 10rpx 0'
|
|
|
- },
|
|
|
- //其他医院按钮样式
|
|
|
- otherStyle: {
|
|
|
- backgroundColor: '#989898',
|
|
|
- color: '#fff',
|
|
|
- fontWeight: "bold",
|
|
|
- margin: '20rpx 0 10rpx 0'
|
|
|
- }
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
| xqd
@@ -290,26 +270,46 @@
|
|
|
this.getListTime(this.hospitalList[0].value)
|
|
|
this.hospital = this.hospitalList[0].label
|
|
|
this.hospitalID = this.hospitalList[0].value + ""
|
|
|
+ let day = new Date();
|
|
|
+ let a = day.getDate()
|
|
|
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.monthList[x + this.empty].mon = this.schedulingList[x].mon == "0" ? 0 : this.schedulingList[x].mon == this.hospitalID&&this.overdue(x) ?
|
|
|
1 : 2
|
|
|
this.monthList[x + this.empty].aft = this.schedulingList[x].aft == "0" ? 0 : this.schedulingList[x].aft == this.hospitalID ?
|
|
|
1 : 2
|
|
|
this.monthList[x + this.empty].nig = this.schedulingList[x].nig == "0" ? 0 : this.schedulingList[x].nig == this.hospitalID ?
|
|
|
1 : 2
|
|
|
}
|
|
|
+
|
|
|
+ // 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].aft = this.schedulingList[x - a].aft == "0" ? 0 : 2
|
|
|
+ // this.monthList[x + this.empty - a].nig = this.schedulingList[x - a].nig == "0" ? 0 : 2
|
|
|
+ // }
|
|
|
}
|
|
|
},
|
|
|
+ overdue(day){
|
|
|
+ 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())
|
|
|
+ return false
|
|
|
+ }else{return true}
|
|
|
+
|
|
|
+ }
|
|
|
+ ,
|
|
|
getMonthList: async function() {
|
|
|
console.log("请求数据", this.mothonStart, this.mothonEnd)
|
|
|
let res = await this.$request.post("doctor/monthDetail", {
|
|
|
'start_day': this.mothonStart,
|
|
|
'end_day': this.mothonEnd
|
|
|
});
|
|
|
+ console.log("收到数据", res)
|
|
|
if (res.status == 0) {
|
|
|
let data = res.data;
|
|
|
let newList = [];
|
|
|
for (let i = 0; i < data.length; i++) {
|
|
|
+ +
|
|
|
+ // console.log(i)
|
|
|
this.schedulingList.push({
|
|
|
mon: data[i].ident.zao,
|
|
|
aft: data[i].ident.xia,
|
| xqd
@@ -376,7 +376,6 @@
|
|
|
this.mothonStart = this.year + '-' + (this.month + 1) + '-' + '01'
|
|
|
|
|
|
this.mothonEnd = this.year + '-' + (this.month + 1) + '-' + date.getDate()
|
|
|
-
|
|
|
for (let c = 0; c < date.getDate(); c++) {
|
|
|
let months = (this.month + 1);
|
|
|
if (months < 10) {
|
| xqd
@@ -393,10 +392,11 @@
|
|
|
select: false,
|
|
|
//判断方法,通过判断是不是选中的医院ID
|
|
|
//0没有排班,1有排班,2有排班,但不是这个医院
|
|
|
- mon: this.schedulingList[c].mon == "0" ? 0 : this.schedulingList[c].mon == this.hospitalID ? 1 : 2,
|
|
|
- aft: this.schedulingList[c].aft == "0" ? 0 : this.schedulingList[c].aft == this.hospitalID ? 1 : 2,
|
|
|
- nig: this.schedulingList[c].nig == "0" ? 0 : this.schedulingList[c].nig == this.hospitalID ? 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
|
|
|
})
|
|
|
+
|
|
|
}
|
|
|
console.log(this.monthList)
|
|
|
|
| xqd
@@ -518,11 +518,19 @@
|
|
|
yearConfirm(e) {
|
|
|
this.year = e[0].value
|
|
|
this.month = e[1].value - 1
|
|
|
- this.monthList = []
|
|
|
- this.schedulingList = []
|
|
|
- this.getMonthList();
|
|
|
- this.day = 0
|
|
|
- console.log(e)
|
|
|
+ let d = new Date();
|
|
|
+ this.mothonStart = this.year + '-' + (this.month + 1) + '-' + '01'
|
|
|
+ d.setFullYear(this.year, this.month + 1, 0);
|
|
|
+ this.mothonEnd = this.year + '-' + (this.month + 1) + '-' + d.getDate()
|
|
|
+ this.monthList.splice(0, this.monthList.length);
|
|
|
+ this.schedulingList.splice(0, this.schedulingList.length);
|
|
|
+ this.$nextTick(function() {
|
|
|
+ this.getHostail()
|
|
|
+ this.getMonthList();
|
|
|
+ this.day = 0
|
|
|
+ console.log("s", this.schedulingList)
|
|
|
+ })
|
|
|
+
|
|
|
},
|
|
|
/**
|
|
|
* 日视图按钮点击
|
| xqd
@@ -622,7 +630,7 @@
|
|
|
font-weight: bold;
|
|
|
margin: 20rpx 0 10rpx 0;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
,
|
|
|
/* //上午按钮样式 */
|
|
|
.monStyle {
|
| xqd
@@ -635,7 +643,7 @@
|
|
|
fontWeight: bold;
|
|
|
margin: 20rpx 0 10rpx 0;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
,
|
|
|
/* //下午按钮样式 */
|
|
|
.aftStyle {
|
| xqd
@@ -649,7 +657,7 @@
|
|
|
font-weight: bold;
|
|
|
margin: 20rpx 0 10rpx 0;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
,
|
|
|
/* //晚上按钮样式 */
|
|
|
.nigStyle {
|
| xqd
@@ -662,7 +670,7 @@
|
|
|
font-weight: bold;
|
|
|
margin: 20rpx 0 10rpx 0;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
,
|
|
|
/* //其他医院按钮样式 */
|
|
|
.otherStyle {
|