瀏覽代碼

修改月排班页面

渣渣宝 4 年之前
父節點
當前提交
3e9132a130
共有 3 個文件被更改,包括 382 次插入338 次删除
  1. 6 4
      pages/conversation/conversation.vue
  2. 5 0
      pages/login/reg.vue
  3. 371 334
      pages/scheduling/month_Scheduling.vue

+ 6 - 4
pages/conversation/conversation.vue

xqd xqd xqd xqd
@@ -25,7 +25,7 @@
 					<view class="text-grey text-xs">22:20</view>
 				</view>
 			</view>
-			<u-empty text="暂无数据" :show="list.length==0?true:false" mode="order" margin-top="250"></u-empty>
+			<u-empty text="暂无数据" v-if="list.length<=0" mode="order" margin-top="250"></u-empty>
 		</view>
 		<!-- 这是通话记录 当值为false1时显示 -->
 		<view class="cu-list menu-avatar margin-top-xs" v-else @click="call">
@@ -42,7 +42,7 @@
 					</view>
 				</view>
 			</view>
-			<u-empty text="暂无数据" :show="listPhone.length==0?true:false" mode="order" margin-top="250"></u-empty>
+			<u-empty text="暂无数据" v-if="listPhone.length<=0"" mode="order" margin-top="250"></u-empty>
 		</view>
 		
 	</view>
@@ -81,6 +81,8 @@
 				i++;			
 			}
 			this.getcnversationList()
+			console.log(this.list)
+			console.log(this.listPhone)
 		},
 		onLoad() {
 		 this.imService = getApp().globalData.imService;
@@ -98,8 +100,8 @@
 				qiehuan: true,
 				index:0,
 				keyword: "",
-				list:[{},{}],
-				listPhone:[{},{}],
+				list:[],
+				listPhone:[],
 			}
 		},
 		methods: {

+ 5 - 0
pages/login/reg.vue

xqd
@@ -93,6 +93,11 @@
 			_this = this;
 		},
 		methods: {
+			toindex() {
+				uni.switchTab({
+					url: "../index/index"
+				})
+			},
 			//验证码点击事件
 			getVerCode: async function() {
 				//获取验证码

+ 371 - 334
pages/scheduling/month_Scheduling.vue

xqd xqd xqd xqd xqd xqd xqd xqd xqd
@@ -2,40 +2,46 @@
 	<view style="width: 100%;height: 100%;">
 		<!--医院列表 -->
 		<u-select v-model="hospitalListShow" :list="hospitalList" @confirm="setSelectHospital"></u-select>
+		<u-select v-model="timeShow" mode="mutil-column-auto" :list="timeList" @confirm="yearConfirm"></u-select>
 		<!--日视图弹出层-->
-		<u-popup v-model="popupShow" mode="bottom" border-radius="50" @close="allow=false" :mask-close-able="false">
-		  <view style="margin: 20rpx 0;" class="flex justify-center align-center">
-		    <u-icon name="arrow-down"@click="close()"></u-icon>
-		  </view>
-		
-		
+		<u-popup v-model="popupShow" mode="bottom" border-radius="50" :mask-close-able="false">
+			<!-- <view style="margin: 20rpx 0;" class="flex justify-center align-center">
+				<u-icon name="arrow-down" @click="close()"></u-icon>
+			</view> -->
 			<!-- 标题按钮 -->
 			<view class="flex justify-center align-center" style="padding: 30rpx 0;font-size: 38rpx;font-weight: bold;">
-				<text style="flex-grow: 1;text-align: center;padding-left: 90rpx;">{{day}}日排班详情</text>
-				<u-icon v-if="!allow" name="setting-fill" style="margin-right: 50rpx;" @click="allow = true"></u-icon>
-				<u-icon v-else name="close" style="margin-right: 50rpx;" @click="allow = false"></u-icon>
+				<text style="flex-grow: 1;text-align: center;">{{day}}日排班详情</text>
 			</view>
-			<view v-if="monthList[day+empty-1].mon==0&&monthList[day+empty-1].aft==0&&monthList[day+empty-1].nig==0" style="height: 500rpx;" class="flex justify-center align-center">
+			<view v-if="monthList[day+empty-1].mon==0&&monthList[day+empty-1].aft==0&&monthList[day+empty-1].nig==0" style="height: 500rpx;"
+			 class="flex justify-center align-center">
 				<view style="width: 80%;">
-					<u-button shape="circle" :custom-style="otherStyle" @click="modify(0)">暂无排班  点击新增</u-button>
+					<u-button shape="circle" :custom-style="otherStyle" @click="modify(0)">暂无排班 点击新增</u-button>
 				</view>
 			</view>
 			<!-- 上下晚显示 -->
 			<view class="flex justify-center" style="" v-else>
 				<view style="width: 80%;margin: 20rpx 0;text-align: center;font-size: 38rpx;">
-					<u-button shape="circle" :custom-style="monthList[day+empty-1].mon==0 ? nullStyle : monthList[day+empty-1].mon==1 ? monStyle :otherStyle " throttleTime="1000" @click="modify(1)">上午</u-button>
+					<u-button shape="circle" :custom-style="monthList[day+empty-1].mon==0 ? nullStyle : monthList[day+empty-1].mon==1 ? monStyle :otherStyle "
+					 throttleTime="1000" @click="modify(1)">上午</u-button>
 					<text>{{hospitalTimes.zao.amStartTime}} 至 {{hospitalTimes.zao.amEndTime}}</text>
-					<u-button shape="circle" :custom-style="monthList[day+empty-1].aft==0 ? nullStyle : monthList[day+empty-1].aft==1 ? aftStyle :otherStyle " throttleTime="1000" @click="modify(2)">下午</u-button>
+					<u-button shape="circle" :custom-style="monthList[day+empty-1].aft==0 ? nullStyle : monthList[day+empty-1].aft==1 ? aftStyle :otherStyle "
+					 throttleTime="1000" @click="modify(2)">下午</u-button>
 					<text>{{hospitalTimes.zhong.pmStartTime}} 至 {{hospitalTimes.zhong.pmEndTime}}</text>
-					<u-button shape="circle" :custom-style="monthList[day+empty-1].nig==0 ? nullStyle : monthList[day+empty-1].nig==1 ? nigStyle :otherStyle " throttleTime="1000" @click="modify(3)">晚上</u-button>
+					<u-button shape="circle" :custom-style="monthList[day+empty-1].nig==0 ? nullStyle : monthList[day+empty-1].nig==1 ? nigStyle :otherStyle "
+					 throttleTime="1000" @click="modify(3)">晚上</u-button>
 					<text>{{hospitalTimes.wan.nightStartTime}} 至 {{hospitalTimes.wan.nightEndTime}}</text>
 				</view>
-			</view>weis1
+			</view>
+			<view style="height: 100rpx;background-color: #007AFF;color: #FFF;font-size: 36rpx;" class="flex justify-center align-center"
+			 @click="close()">
+				保 存
+			</view>
 		</u-popup>
-		
 		<!-- 顶部标题和按钮 -->
 		<view class="flex justify-between align-center" style="margin: 40rpx 28rpx;">
-			<view style="font-size: 50rpx;flex-grow: 2;" @click="selectYear">{{year}}年{{month+1}}月</view>
+			<view style="font-size: 50rpx;flex-grow: 2;" @click="timeShow=true ">
+				<text style="padding: 15rpx;border: 1rpx solid #b0b0b0;border-radius: 30rpx;">{{year}}年{{month+1}}月</text>
+			</view>
 			<view class="flex justify-around align-center" style="flex-grow: 3;">
 				<view class="drop-down" @click="hospitalListShow=!hospitalListShow">
 					<text>{{hospital}}</text>
@@ -52,35 +58,38 @@
 			<view class="flex justify-around align-center" style="height: 80rpx;background-color: #CCE6FF;">
 				<text v-for="item,index in weekList" :key="index" style="font-size: 28rpx;">{{item.text}}</text>
 			</view>
-			<view class="flex flex-wrap " >
+			<view class="flex flex-wrap ">
 				<view class="" style="width: 14%;padding: 0 0 20rpx 0;font-size: 32rpx;font-weight: 590;height: auto;font-weight: bold;"
 				 v-for="item,index in monthList" :key="index" @click="setDay(index,item.text)">
 					<view class="flex justify-center align-center" :style="!item.select?
 							'height: 100rpx;width: 100rpx;border-radius:50%;font-weight: bold;'
 							:'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="color: #FFF;text-align: center;font-size: 28rpx;">
 						<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?
+						"
+						 v-if="item.mon > 0">上午</view>
+
+						<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?
+						"
+						 v-if="item.aft > 0">下午</view>
+
+						<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>
+						"
+						 v-if="item.nig > 0">晚上</view>
 					</view>
 				</view>
 			</view>
-		</view>
-		
-	<!-- 	  <view class="bottomButton" @click="paiban">
-		   保存
+		</view>
+
+		<!-- 	  <view class="bottomButton" @click="paiban">
+		   保存
 		  </view> -->
 	</view>
 </template>
@@ -88,28 +97,23 @@
 <script>
 	export default {
 		onLoad() {
-			this.$nextTick(function() {
-				// this.getListTime()
+			this.$nextTick(function() {
+				// this.getListTime()
 				this.getHostail()
 				this.getNowTime()
 				this.getMonth();
-				// this.getNowmonth()
-				
-			})
-		
+				// this.getNowmonth()
+
+			})
+
 		},
 		onShow() {
-			if (this.load) {
-				this.monthList = []
-				this.schedulingList = []
-				this.getMonth();
-				// this.getNowmonth()
-				this.day = 0
-				
-			}
+
 		},
 		data() {
 			return {
+				timeShow: false,
+				timeList: [],
 				year: 0, //年
 				month: 0, //月
 				day: 0, //日
@@ -117,190 +121,190 @@
 				load: false, //控制加载,从年视图返回执行onshow
 				popupShow: false, //控制弹窗弹出层
 				weekList: [{
-						text: "日"
-					}, {
-						text: "一"
-					}, {
-						text: "二"
-					}, {
-						text: "三"
-					}, {
-						text: "四"
-					}, {
-						text: "五"
-					}, {
+					text: "日"
+				}, {
+					text: "一"
+				}, {
+					text: "二"
+				}, {
+					text: "三"
+				}, {
+					text: "四"
+				}, {
+					text: "五"
+				}, {
 					text: "六"
-										}],
-				monthList: [],//这个月的数据,不要动
+				}],
+				monthList: [], //这个月的数据,不要动
 
-				hospital: "",//现在选中的医院
-				hospitalID:"1",//选中的医院ID
-				hospitalListShow: false,//控制医院选择器
-				hospitalTimes:0,
+				hospital: "", //现在选中的医院
+				hospitalID: "1", //选中的医院ID
+				hospitalListShow: false, //控制医院选择器
+				hospitalTimes: 0,
 				// 医院列表
-				hospitalList: [
-				],
+				hospitalList: [],
 				// 一个月的排班数据 从一号开始
 				//下标0为一号,值为医院ID
 				// 没有排班记录为0
 				schedulingList: [],
-				
-				mothonStart:'',
-				mothonEnd:'',
+
+				mothonStart: '',
+				mothonEnd: '',
 				// 弹出层数据
-				allow:false ,//允许设置
 				//空按钮样式
-				nullStyle:{
+				nullStyle: {
 					backgroundColor: '#FFF',
-					color:'#000',
+					color: '#000',
 					fontWeight: "bold",
-					margin:'20rpx 0 10rpx 0'
-				},
-				saveDay:0,
+					margin: '20rpx 0 10rpx 0'
+				},
+				saveDay: 0,
 				//上午按钮样式
-				monStyle:{
+				monStyle: {
 					backgroundColor: '#5667c8',
-					color:'#fff',
+					color: '#fff',
 					fontWeight: "bold",
-					margin:'20rpx 0 10rpx 0'
+					margin: '20rpx 0 10rpx 0'
 				},
 				//下午按钮样式
-				aftStyle:{
+				aftStyle: {
 					backgroundColor: '#ec9d75',
-					color:'#fff',
+					color: '#fff',
 					fontWeight: "bold",
-					margin:'20rpx 0 10rpx 0'
+					margin: '20rpx 0 10rpx 0'
 				},
 				//晚上按钮样式
-				nigStyle:{
+				nigStyle: {
 					backgroundColor: '#55aa7f',
-					color:'#fff',
+					color: '#fff',
 					fontWeight: "bold",
-					margin:'20rpx 0 10rpx 0'
+					margin: '20rpx 0 10rpx 0'
 				},
 				//其他医院按钮样式
-				otherStyle:{
+				otherStyle: {
 					backgroundColor: '#989898',
-					color:'#fff',
+					color: '#fff',
 					fontWeight: "bold",
-					margin:'20rpx 0 10rpx 0'
-				} 
+					margin: '20rpx 0 10rpx 0'
+				}
 			}
 		},
-		methods: {
-			close:async function(){
+		methods: {
+			close: async function() {
+				this.popupShow = false;
+				let SaveLists = [];
+				let SaveDate = this.saveDay;
 				console.log(1111)
-				
-				
-			 this.popupShow=false;
-			 let SaveLists=[];
-			 let SaveDate = this.saveDay;
-			 console.log(1111)
-			 if(this.saveDay!=0){
-				 if(this.hospitalID!=0){
-					 if(SaveDate.mon==this.hospitalID){
-						 SaveLists.push(1)
-					 }
-					 if(SaveDate.aft==this.hospitalID){
-						SaveLists.push(2)
-					 }
-					 if(SaveDate.nig==this.hospitalID){
-						SaveLists.push(3)
-					 }
-					 if(SaveLists.length!=0){
-						 let s = SaveLists.join(",");
-						 let tj={
-							 'schedule_date':SaveDate.date,
-							 'week':SaveDate.week,
-							 'type':s,
-							 'organization_id':this.hospitalID,
-						 }
-						 console.log(tj);
-						 console.log(1111)
-						 // if(typeof tj=='object'){
-							//  tj = JSON.stringify(tj);
-						 // }
-						 let res = await this.$request.post("doctor/saveDay",tj);
-						 if(res.status==0){
-							 uni.showToast({
-								title:"修改成功!",
-							 })
-							 SaveLists=[];
-							 this.saveDay = 0;
-							 
-						 }
-						
-					 }
-					 
-				 }else{
-					 uni.showModal({
-						title:'请选择医院'
-					 })
-				 }
-			 }
-		    },
-			getHostail:async function(){
-				let res=await this.$request.post("doctor/organizationList");
-				if(res.status==0){
-					let data=res.data;
-					let newList=[];
-					if(data.length==0){
-						uni.showModal({
-							title:'请先认证医院',
+				if (this.saveDay != 0) {
+					if (this.hospitalID != 0) {
+						if (SaveDate.mon == this.hospitalID) {
+							SaveLists.push(1)
+						}
+						if (SaveDate.aft == this.hospitalID) {
+							SaveLists.push(2)
+						}
+						if (SaveDate.nig == this.hospitalID) {
+							SaveLists.push(3)
+						}
+						if (SaveLists.length != 0) {
+							let s = SaveLists.join(",");
+							let tj = {
+								'schedule_date': SaveDate.date,
+								'week': SaveDate.week,
+								'type': s,
+								'organization_id': this.hospitalID,
+							}
+							console.log(tj);
+							console.log(1111)
+							// if(typeof tj=='object'){
+							//  tj = JSON.stringify(tj);
+							// }
+							let res = await this.$request.post("doctor/saveDay", tj);
+							if (res.status == 0) {
+								uni.showToast({
+									title: "修改成功!",
+								})
+								SaveLists = [];
+								this.saveDay = 0;
+
+							}
+
+						}
+
+					} else {
+						uni.showModal({
+							title: '请选择医院'
+						})
+					}
+				}
+			},
+			getHostail: async function() {
+				let res = await this.$request.post("doctor/organizationList");
+				if (res.status == 0) {
+					let data = res.data;
+					let newList = [];
+					if (data.length == 0) {
+						uni.showModal({
+							title: '请先认证医院',
 							success: function(res) {
 								if (res.confirm) {
 									uni.redirectTo({
-										url:"/pages/login/doctorRenzheng"
+										url: "/pages/login/doctorRenzheng"
 									})
-								}else {
+								} else {
 									uni.navigateBack({
-										delta:1
+										delta: 1
 									})
 								}
-								
-							}
-						})
-					}else{
-						for(let i=0;i<data.length;i++){
-							newList.push({
-								value:data[i].value,
-								label:data[i].label,
-							})
-						}
-					}
-					console.log('机构获取,',res);
-					this.hospitalList = newList;
-					this.getListTime(this.hospitalList[0].value)
-					this.hospital = this.hospitalList[0].label
-					this.hospitalID = this.hospitalList[0].value+""
-					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?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 
-					}
-				}
-			},
-			
-			getMonth:async function(){
-				console.log("请求数据",this.mothonStart,this.mothonEnd)
-				let res = await this.$request.post("doctor/monthDetail",{'start_day':this.mothonStart,'end_day':this.mothonEnd});
-				if(res.status==0){
-					let data = res.data;
-					let newList=[];
-					for(let i=0;i<data.length;i++){
+
+							}
+						})
+					} else {
+						for (let i = 0; i < data.length; i++) {
+							newList.push({
+								value: data[i].value,
+								label: data[i].label,
+							})
+						}
+					}
+					console.log('机构获取,', res);
+					this.hospitalList = newList;
+					this.getListTime(this.hospitalList[0].value)
+					this.hospital = this.hospitalList[0].label
+					this.hospitalID = this.hospitalList[0].value + ""
+					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 ?
+							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
+					}
+				}
+			},
+			getMonth: async function() {
+				console.log("请求数据", this.mothonStart, this.mothonEnd)
+				let res = await this.$request.post("doctor/monthDetail", {
+					'start_day': this.mothonStart,
+					'end_day': this.mothonEnd
+				});
+				if (res.status == 0) {
+					let data = res.data;
+					let newList = [];
+					for (let i = 0; i < data.length; i++) {
 						this.schedulingList.push({
-								mon:data[i].ident.zao,
-								aft:data[i].ident.xia,
-								nig:data[i].ident.wan
-						})
+							mon: data[i].ident.zao,
+							aft: data[i].ident.xia,
+							nig: data[i].ident.wan
+						})
 					}
-					console.log('原数组:',this.schedulingList);
-					this.getNowmonth()
-				}else{
-					uni.showModal({
-						title:'请求错误'
-					})
-				}
+					console.log('原数组:', this.schedulingList);
+					this.getNowmonth()
+				} else {
+					uni.showModal({
+						title: '请求错误'
+					})
+				}
 			},
 			/**
 			 * 获取现在的日期
@@ -310,9 +314,25 @@
 				this.year = d.getFullYear()
 				this.month = d.getMonth()
 				this.day = d.getDate()
-				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.mothonStart = this.year + '-' + (this.month + 1) + '-' + '01'
+				d.setFullYear(this.year, this.month + 1, 0);
+				this.mothonEnd = this.year + '-' + (this.month + 1) + '-' + d.getDate()
+
+				let yearList = [] //一年的月份
+				for (let x = 1; x < 13; x++) {
+					yearList.push({
+						label: x + "月",
+						value: x
+					})
+				}
+				for (let x = 0; x < 3; x++) {
+					this.timeList.push({
+						label: (this.year + x) + "年",
+						value: this.year + x,
+						children: yearList.slice(0)
+					})
+				}
+				this.timeList[0].children.splice(0, d.getMonth()) //删除之前的月份
 			},
 			/**
 			 * 拿到一个月的数据
@@ -330,108 +350,116 @@
 				}
 				this.empty = date.getDay()
 
-				date.setFullYear(this.year, this.month+1, 0); //查看这个月有几天
-				console.log('查看这个月有几天:',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.mothonEnd=this.year+'-'+(this.month+1)+'-'+date.getDate()
-				// this.getMonth();
-				
-				
-				
-				
+				console.log("本月最后一号", date.getDate());
+
+				this.mothonStart = this.year + '-' + (this.month + 1) + '-' + '01'
+
+				this.mothonEnd = this.year + '-' + (this.month + 1) + '-' + date.getDate()
+				// this.getMonth();
+
+
+
+
 				for (let c = 0; c < date.getDate(); c++) {
-					console.log(this.schedulingList[c].mon==""?0:this.schedulingList[c].mon==this.hospitalID?1:2 )
-					let months = (this.month+1);
-					if(months<10){
-						months = "0"+months;
-					}
-					let days = (c + 1);
-					if(days<10){
-						days = "0"+days;
+					console.log(this.schedulingList[c].mon == "" ? 0 : this.schedulingList[c].mon == this.hospitalID ? 1 : 2)
+					let months = (this.month + 1);
+					if (months < 10) {
+						months = "0" + months;
+					}
+					let days = (c + 1);
+					if (days < 10) {
+						days = "0" + days;
 					}
 					this.monthList.push({
-						text: c + 1,
-						date: this.year+'-'+months+'-'+ days,
-						week: this.getWeekList(this.year+'-'+months+'-'+ days),
+						text: c + 1,
+						date: this.year + '-' + months + '-' + days,
+						week: this.getWeekList(this.year + '-' + months + '-' + days),
 						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 ? 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
 					})
 				}
 				console.log(this.monthList)
-			},
-			
-			getWeekList(strs){;
-				var weekDay = [7, 1,2, 3,4, 5, 6];  
-				let times = strs.replace(/-/g,'/');
-				var myDate = new Date(Date.parse(times));  
-				return weekDay[myDate.getDay()];
-			},
-			
-			getimePate(str){
-				console.log(str);
-				var date = new Date(str.replace(/-/g,'/'));
-				console.log(date)
-				return Date.parse(date);
-				
-			},
-			
-			getListTime:async function(org_id){
-				let res= await this.$request.post('doctor/getOrgTimes',{org_id:org_id});
-				let newLists=[];
-				if(res.status==0){
-					if(res.data.length==0){
-						uni.showToast({
-							title:'请先去设置排班!'
-						})
-						return false;
-					}else{
-						this.hospitalTimes = res.data;
-						
-						console.log('时间:',this.hospitalTimes)
-					}
-				}
+			},
+
+			getWeekList(strs) {;
+				var weekDay = [7, 1, 2, 3, 4, 5, 6];
+				let times = strs.replace(/-/g, '/');
+				var myDate = new Date(Date.parse(times));
+				return weekDay[myDate.getDay()];
+			},
+
+			getimePate(str) {
+				console.log(str);
+				var date = new Date(str.replace(/-/g, '/'));
+				console.log(date)
+				return Date.parse(date);
+
+			},
+
+			getListTime: async function(org_id) {
+				let res = await this.$request.post('doctor/getOrgTimes', {
+					org_id: org_id
+				});
+				let newLists = [];
+				if (res.status == 0) {
+					if (res.data.length == 0) {
+						uni.showToast({
+							title: '请先去设置排班!'
+						})
+						return false;
+					} else {
+						this.hospitalTimes = res.data;
+
+						console.log('时间:', this.hospitalTimes)
+					}
+				}
 			},
 			/**
 			 * 切换医院
 			 * */
-			setSelectHospital (e) {
-
+			setSelectHospital(e) {
+
 				this.getListTime(e[0].value)
 				this.hospital = e[0].label
-				this.hospitalID = e[0].value+""
-				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?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 
+				this.hospitalID = e[0].value + ""
+				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 ?
+						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
 				}
 			},
 			/**
 			 * 点击对应日期
 			 * */
-			setDay(index,text) {
-				// 获取当前日期
-				var date = new Date();
-				// 获取当前月份
-				var nowMonth = date.getMonth() + 1;
-				// 获取当前是几号
-				var strDate = date.getDate();
-				// 添加分隔符“-”
-				var seperator = "-";	
-				// 最后拼接字符串,得到一个格式为(yyyy-MM-dd)的日期
-				var nowDate = date.getFullYear() + seperator + nowMonth + seperator + strDate
-				if(this.getimePate(nowDate)>this.getimePate(this.monthList[index].date)){
-					uni.showModal({
-						title:'只能修改今天之后的数据!'
-					})
-					return false;
+			setDay(index, text) {
+				// 获取当前日期
+				var date = new Date();
+				// 获取当前月份
+				var nowMonth = date.getMonth() + 1;
+				// 获取当前是几号
+				var strDate = date.getDate();
+				// 添加分隔符“-”
+				var seperator = "-";
+				// 最后拼接字符串,得到一个格式为(yyyy-MM-dd)的日期
+				var nowDate = date.getFullYear() + seperator + nowMonth + seperator + strDate
+				if (this.getimePate(nowDate) > this.getimePate(this.monthList[index].date)) {
+					uni.showModal({
+						title: '只能修改今天之后的数据!'
+					})
+					return false;
 				}
 				if (index >= this.empty) {
 					this.monthList.map(val => {
@@ -441,9 +469,9 @@
 					this.day = text
 					this.popupShow = true
 				}
-				
-			},
-			
+
+			},
+
 			/**
 			 * 跳转到年视图
 			 * */
@@ -454,65 +482,74 @@
 					})
 				}, 300)
 			},
+			/**
+			 * 确认选择年月
+			 * */
+			yearConfirm(e) {
+				this.year = e[0].value
+				this.month = e[1].value - 1
+				this.monthList = []
+				this.schedulingList = []
+				this.getMonth();
+				this.day = 0
+				console.log(e)
+			},
 			/**
 			 * 日视图按钮点击
 			 * id 1早上 2下午 3晚上
 			 * */
-			modify(id){
-				if(id==0){
-					this.monthList[this.day+this.empty-1].mon=1//
-					this.schedulingList[this.day-1].mon = this.hospitalID
-					
-					this.monthList[this.day+this.empty-1].aft=1//
-					this.schedulingList[this.day-1].aft = this.hospitalID
-					
-					this.monthList[this.day+this.empty-1].nig=1//
-					this.schedulingList[this.day-1].nig = this.hospitalID
-				}
-				if(this.allow){
-					this.saveDay = this.monthList[this.day+this.empty-1];
-					switch(id){
-						case 1 :
-							if(this.monthList[this.day+this.empty-1].mon==1){//当这个按钮状态为1 选择了医院且是当前医院
-								this.monthList[this.day+this.empty-1].mon=0//就取消选择
-								this.schedulingList[this.day-1].mon = 0
-							}else if(this.monthList[this.day+this.empty-1].mon==0){
-								this.monthList[this.day+this.empty-1].mon=1//
-								this.schedulingList[this.day-1].mon = this.hospitalID
+			modify(id) {
+				if (id == 0) {
+					this.monthList[this.day + this.empty - 1].mon = 1 //
+					this.schedulingList[this.day - 1].mon = this.hospitalID
+
+					this.monthList[this.day + this.empty - 1].aft = 1 //
+					this.schedulingList[this.day - 1].aft = this.hospitalID
+
+					this.monthList[this.day + this.empty - 1].nig = 1 //
+					this.schedulingList[this.day - 1].nig = this.hospitalID
+				} else {
+					this.saveDay = this.monthList[this.day + this.empty - 1];
+					switch (id) {
+						case 1:
+							if (this.monthList[this.day + this.empty - 1].mon == 1) { //当这个按钮状态为1 选择了医院且是当前医院
+								this.monthList[this.day + this.empty - 1].mon = 0 //就取消选择
+								this.schedulingList[this.day - 1].mon = 0
+							} else if (this.monthList[this.day + this.empty - 1].mon == 0) {
+								this.monthList[this.day + this.empty - 1].mon = 1 //
+								this.schedulingList[this.day - 1].mon = this.hospitalID
 							}
 							break;
-						case 2 :
-							if(this.monthList[this.day+this.empty-1].aft==1){//当这个按钮状态为1 选择了医院且是当前医院
-								this.monthList[this.day+this.empty-1].aft=0//就取消选择
-								this.schedulingList[this.day-1].aft = 0
-							}else if(this.monthList[this.day+this.empty-1].aft==0){
-								this.monthList[this.day+this.empty-1].aft=1//
-								this.schedulingList[this.day-1].aft = this.hospitalID
+						case 2:
+							if (this.monthList[this.day + this.empty - 1].aft == 1) { //当这个按钮状态为1 选择了医院且是当前医院
+								this.monthList[this.day + this.empty - 1].aft = 0 //就取消选择
+								this.schedulingList[this.day - 1].aft = 0
+							} else if (this.monthList[this.day + this.empty - 1].aft == 0) {
+								this.monthList[this.day + this.empty - 1].aft = 1 //
+								this.schedulingList[this.day - 1].aft = this.hospitalID
 							}
 							break;
-						case 3 :
-							if(this.monthList[this.day+this.empty-1].nig==1){//当这个按钮状态为1 选择了医院且是当前医院
-								this.monthList[this.day+this.empty-1].nig=0//就取消选择
-								this.schedulingList[this.day-1].nig = 0
-							}else if(this.monthList[this.day+this.empty-1].nig==0){
-								this.monthList[this.day+this.empty-1].nig=1//
-								this.schedulingList[this.day-1].nig = this.hospitalID
+						case 3:
+							if (this.monthList[this.day + this.empty - 1].nig == 1) { //当这个按钮状态为1 选择了医院且是当前医院
+								this.monthList[this.day + this.empty - 1].nig = 0 //就取消选择
+								this.schedulingList[this.day - 1].nig = 0
+							} else if (this.monthList[this.day + this.empty - 1].nig == 0) {
+								this.monthList[this.day + this.empty - 1].nig = 1 //
+								this.schedulingList[this.day - 1].nig = this.hospitalID
 							}
 							break;
 					}
 					// this.$forceUpdate();
-				}else{
-					console.log('到我了!');
-				}
+				} 
 			},
 			/**
 			 * 跳转周视图
 			 * */
-			jumpWeek(){
+			jumpWeek() {
 				uni.navigateTo({
-					url:'week_Scheduling'
+					url: 'week_Scheduling'
 				})
-			}
+			},
 		}
 	}
 </script>
@@ -529,21 +566,21 @@
 		justify-content: space-between;
 		align-items: center;
 		padding: 10rpx 15rpx;
-	}
-	
-	/* 底部按钮 */
-/* 	 .bottomButton {
-	  position: fixed;
-	  bottom: 0;
-	  left: 0;
-	  width: 100%;
-	  height: 100rpx;
-	  display: flex;
-	  align-items: center;
-	  justify-content: center;
-	  background-color: #0000ff;
-	  color: #FFFFFF;
-	  z-index: 1;
-	 
+	}
+
+	/* 底部按钮 */
+	/* 	 .bottomButton {
+	  position: fixed;
+	  bottom: 0;
+	  left: 0;
+	  width: 100%;
+	  height: 100rpx;
+	  display: flex;
+	  align-items: center;
+	  justify-content: center;
+	  background-color: #0000ff;
+	  color: #FFFFFF;
+	  z-index: 1;
+	 
 	 } */
 </style>