Bladeren bron

修改排班页面逻辑

老狐\25396 4 jaren geleden
bovenliggende
commit
460dd4680f

+ 30 - 6
pages.json

xqd xqd xqd
@@ -91,20 +91,37 @@
 				// "navigationBarTitleText": "预约详情"
 			}
 		},
-		/*********************门诊排班*********************/
-		//门诊排班 Scheduling  不新建文件夹
+		/*********************门诊排班Scheduling*********************/
 		{
-			"path": "pages/Scheduling",
+			"path": "pages/scheduling/Scheduling",
 			"style": {
 				"navigationBarTitleText": "门诊排班"
 			}
 		},
 		{
-			"path": "pages/old_Scheduling",
+			"path": "pages/scheduling/old_Scheduling",
 			"style": {
 				"navigationBarTitleText": "门诊排班"
 			}
 		},
+		{
+			"path": "pages/scheduling/year_Scheduling",
+			"style": {
+				"navigationBarTitleText": "年视图"
+			}
+		},
+		{
+			"path": "pages/scheduling/month_Scheduling",
+			"style": {
+				"navigationBarTitleText": "排班设置"
+			}
+		},
+		{
+			"path": "pages/scheduling/week_Scheduling",
+			"style": {
+				"navigationBarTitleText": "周排班"
+			}
+		},
 		/*********************意见管理opinion*********************/
 		//意见管理opinion
 		{
@@ -180,7 +197,14 @@
 				"navigationBarTitleText": "我的评价"
 			}
 		}
-		
+		// ,
+		/*******医生标签******/
+		// {
+		// 	"path": "pages/information/doctor_label",
+		// 	"style": {
+		// 		"navigationBarTitleText": "标签管理"
+		// 	}
+		// }
 	],
 	"globalStyle": {
 		"navigationBarTextStyle": "black",
@@ -211,7 +235,7 @@
 		"current": 0, //当前激活的模式(list 的索引项)
 		"list": [{
 			"name": "test", //模式名称
-			"path": "pages/zixun/xiangqing", //启动页面,必选
+			"path": "pages/scheduling/month_Scheduling", //启动页面,必选
 			"query": "" //启动参数,在页面的onLoad函数里面得到
 		}]
 	}

+ 1 - 1
pages/index/index.vue

xqd
@@ -664,7 +664,7 @@
 				if (this.judgerenzheng()) {
 					if (this.mzModal) {
 						uni.navigateTo({
-							url: '/pages/old_Scheduling'
+							url: '/pages/scheduling/month_Scheduling'
 						})
 					} else {
 						uni.showToast({

+ 811 - 0
pages/scheduling/Scheduling.vue

xqd
@@ -0,0 +1,811 @@
+<template>
+	<view style="width: 100%;height: 100%;">
+		<!-- 选择周 -->
+		<u-select v-model="show" :list="list" @confirm="choiceNew"></u-select>
+		<!-- 选择医院 -->
+		<u-select v-model="hospitalshow" mode="single-column" :list="hospitalList" @confirm="confirmhospital"></u-select>
+		<!-- 新增-->
+		<view>
+			<view style="padding: 30rpx 35rpx;color: #666666;" class="flex justify-between ">
+				<view @click="show = true">
+					<text style="margin-right: 20rpx;">选择排班周</text>
+					<u-icon name="arrow-down" color="#666666" size="28" v-if="!show"></u-icon>
+					<u-icon name="arrow-up" color="#666666" size="28" v-else></u-icon>
+				</view>
+				<view @click="hospitalshow = true">
+					<text style="margin-right: 20rpx;">选择排班医院</text>
+					<u-icon name="arrow-down" color="#666666" size="28" v-if="!hospitalshow"></u-icon>
+					<u-icon name="arrow-up" color="#666666" size="28" v-else></u-icon>
+				</view>
+			</view>
+			<view class="flex justify-around align-center" style="height: 100rpx;width: 100%;background-color: #fff;font-size: 28rpx;font-weight: bold;border-bottom: 1rpx solid #cecece;">
+				<text>{{time==''?'请选择排班时间':time}}\n</text>
+				<text>{{hospital==''?'请选择排班医院':hospital}}</text>
+			</view>
+			<!-- 标题 -->
+			<view class="flex" style="background-color: #FFFFFF;">
+				<!-- 时间 -->
+				<view class="title" style="width: 20%;">时间</view>
+				<u-line color="#cecece" direction="col" />
+				<!-- 上午 -->
+				<view class="title" style="width: 26%;">上午</view>
+				<u-line color="#cecece" direction="col" />
+				<!-- 下午 -->
+				<view class="title" style="width: 26%;">下午</view>
+				<u-line color="#cecece" direction="col" />
+				<!-- 晚上 -->
+				<view class="title" style="width: 26%;">晚上</view>
+			</view>
+
+			<!-- 表格一条内容  循环七遍-->
+			<view v-for="(item,index) in hospitalWeek" :key='index'>
+				<u-line color="#cecece" />
+				<!-- 星期一 -->
+				<view class="flex" style="background-color: #FFFFFF;">
+					<view class="content" style="width: 20%;font-weight: bold;">
+						<view>
+							<view style="text-align: center;">{{item.value}}</view>
+							<view style="text-align: center;">{{item.title}}</view>
+						</view>
+					</view>
+					<u-checkbox-group style="width: 80%;height: 100%;">
+						<view class="flex justify-around align-center" style="padding: 40rpx 0;">
+							<u-checkbox v-model="hitem.checked" v-for="(hitem, hindex) in item.hospital" :key="hindex" :disabled="hitem.disabled"
+							 @change="horg(index,hindex)"></u-checkbox>
+						</view>
+					</u-checkbox-group>
+				</view>
+			</view>
+		</view>
+		<view style="height: 200rpx;"></view>
+		<!-- 保存 -->
+		<view class="bottomButton" @click="modalShow=!modalShow">
+			保存
+		</view>
+		<u-modal v-model="modalShow" content="确定要保存?" @confirm="bc" :show-cancel-button="true"></u-modal>
+		<u-modal v-model="remindshow" content="这天是法定节假日,确定要排班吗?" @confirm="remindshow=remind=false" :show-cancel-button="true"></u-modal>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				//标题上显示的医院。也就是当前选中医院
+				hospital: '',
+				hosptialId: '',
+				//标题上显示的
+				time:'',
+				//弹窗
+				modalShow: false,
+				//切换历史和新增
+				old: false,
+				//新增的排班选择   最多排四周
+				show: false,
+				list: [{
+					value: '0',
+					label: '2020.10.26 - 2020-11-1'
+				}, {
+					value: '1',
+					label: '2020.11.2 - 2020-11-8'
+				}, {
+					value: '2',
+					label: '2020.11.9 - 2020-11-15'
+				}, {
+					value: '3',
+					label: '2020.11.16 - 2020-11-22'
+				}],
+				//新增一周的数据   title不可更改  value日期   其余 上 下 晚
+				hospitalWeek: [{
+					title: '周一',
+					value: '10-26',
+					hospital: [{
+						name: '早上',
+						organization_id: 0,
+						checked: false,
+						disabled: false
+					}, {
+						organization_id: 0,
+						name: '下午',
+						checked: false,
+						disabled: false
+					}, {
+						name: '晚上',
+						organization_id: 0,
+						checked: false,
+						disabled: false
+					}],
+				}, {
+					title: '周二',
+					value: '10-27',
+					hospital: [{
+						name: '早上',
+						organization_id: 0,
+						checked: false,
+						disabled: false
+					}, {
+						name: '下午',
+						organization_id: 0,
+						checked: false,
+						disabled: false
+					}, {
+						name: '晚上',
+						organization_id: 0,
+						checked: false,
+						disabled: false
+					}],
+				}, {
+					title: '周三',
+					value: '10-28',
+					hospital: [{
+						name: '早上',
+						organization_id: 0,
+						checked: false,
+						disabled: false
+					}, {
+						name: '下午',
+						organization_id: 0,
+						checked: false,
+						disabled: false
+					}, {
+						name: '晚上',
+						organization_id: 0,
+						checked: false,
+						disabled: false
+					}],
+				}, {
+					title: '周四',
+					value: '10-29',
+					hospital: [{
+						name: '早上',
+						organization_id: 0,
+						checked: false,
+						disabled: false
+					}, {
+						name: '下午',
+						organization_id: 0,
+						checked: false,
+						disabled: false
+					}, {
+						name: '晚上',
+						organization_id: 0,
+						checked: false,
+						disabled: false
+					}],
+				}, {
+					title: '周五',
+					value: '10-30',
+					hospital: [{
+						name: '早上',
+						organization_id: 0,
+						checked: false,
+						disabled: false
+					}, {
+						name: '下午',
+						organization_id: 0,
+						checked: false,
+						disabled: false
+					}, {
+						name: '晚上',
+						organization_id: 0,
+						checked: false,
+						disabled: false
+					}],
+				}, {
+					title: '周六',
+					value: '10-31',
+					hospital: [{
+						name: '早上',
+						organization_id: 0,
+						checked: false,
+						disabled: false
+					}, {
+						name: '下午',
+						organization_id: 0,
+						checked: false,
+						disabled: false
+					}, {
+						name: '晚上',
+						organization_id: 0,
+						checked: false,
+						disabled: false
+					}],
+				}, {
+					title: '周日',
+					value: '11-01',
+					hospital: [{
+						name: '早上',
+						organization_id: 0,
+						checked: false,
+						disabled: false
+					}, {
+						name: '下午',
+						organization_id: 0,
+						checked: false,
+						disabled: false
+					}, {
+						name: '晚上',
+						organization_id: 0,
+						checked: false,
+						disabled: false
+					}],
+				}],
+
+				saveList: [{
+					title: '周一',
+					value: '10-26',
+					hospital: [{
+						name: '早上',
+						organization_id: 0,
+						checked: true,
+						disabled: true
+					}, {
+						organization_id: 0,
+						name: '下午',
+						checked: false
+					}, {
+						name: '晚上',
+						organization_id: 0,
+						checked: false
+					}],
+				}, {
+					title: '周二',
+					value: '10-27',
+					hospital: [{
+						name: '早上',
+						organization_id: 0,
+						checked: false
+					}, {
+						name: '下午',
+						organization_id: 0,
+						checked: false
+					}, {
+						name: '晚上',
+						organization_id: 0,
+						checked: false
+					}],
+				}, {
+					title: '周三',
+					value: '10-28',
+					hospital: [{
+						name: '早上',
+						organization_id: 0,
+						checked: false
+					}, {
+						name: '下午',
+						organization_id: 0,
+						checked: false
+					}, {
+						name: '晚上',
+						organization_id: 0,
+						checked: false
+					}],
+				}, {
+					title: '周四',
+					value: '10-29',
+					hospital: [{
+						name: '早上',
+						organization_id: 0,
+						checked: false
+					}, {
+						name: '下午',
+						organization_id: 0,
+						checked: false
+					}, {
+						name: '晚上',
+						organization_id: 0,
+						checked: false
+					}],
+				}, {
+					title: '周五',
+					value: '10-30',
+					hospital: [{
+						name: '早上',
+						organization_id: 0,
+						checked: false
+					}, {
+						name: '下午',
+						organization_id: 0,
+						checked: false
+					}, {
+						name: '晚上',
+						organization_id: 0,
+						checked: false
+					}],
+				}, {
+					title: '周六',
+					value: '10-31',
+					hospital: [{
+						name: '早上',
+						organization_id: 0,
+						checked: false
+					}, {
+						name: '下午',
+						organization_id: 0,
+						checked: false
+					}, {
+						name: '晚上',
+						organization_id: 0,
+						checked: false
+					}],
+				}, {
+					title: '周日',
+					value: '11-01',
+					hospital: [{
+						name: '早上',
+						organization_id: 0,
+						checked: false
+					}, {
+						name: '下午',
+						organization_id: 0,
+						checked: false
+					}, {
+						name: '晚上',
+						organization_id: 0,
+						checked: false
+					}],
+				}],
+
+				//选择医院
+				hospitalList: [],
+				hospitalshow: false,
+				//当前点击的位置
+				position: {
+					day: '',
+					time: '' //1早2下3晚
+				},
+				//选择排班提醒
+				remind: true,
+				remindshow: false
+			}
+		},
+		methods: {
+
+			cliold: async function(e) {
+
+				let times = e[0].label;
+				times = times.split(" 至 ");
+				let startime = times[0];
+				let endtime = times[1];
+				let weekArr = this.getDateStr(startime, endtime, 0);
+
+				let res = await this.$request.post("doctor/getLinsDetail", {
+					'start_date': startime,
+					'end_date': endtime
+				});
+				console.log('老得:', this.oldWeek);
+				console.log('新的', res.data);
+				if (res.status == 0) {
+					if (typeof res.data.list[0] != undefined && typeof res.data[0] != 'undefined') {
+						let data = res.data.list;
+						let arr = [];
+						for (let i = 0; i < this.oldWeek.length; i++) {
+							for (let p = 0; p < data.length; p++) {
+								if (this.oldWeek[i].value == data[p].schedule_date) {
+									this.oldWeek[i].morning = data[p].type.zao ? data[p].type.zao : '暂无';
+									this.oldWeek[i].afternoon = data[p].type.xia ? data[p].type.xia : '暂无';
+									this.oldWeek[i].night = data[p].type.wan ? data[p].type.wan : '暂无';
+								}
+							}
+						}
+
+					} else {
+						for (let i = 0; i < this.oldWeek.length; i++) {
+							this.oldWeek[i].morning = '暂无';
+							this.oldWeek[i].afternoon = '暂无';
+							this.oldWeek[i].night = '暂无';
+						}
+					}
+
+
+				}
+
+			},
+
+			getDateStr(startDate, endDate, dayLength) {
+				var str = startDate;
+				for (var i = 0;; i++) {
+					var getDate = this.getTargetDate(startDate, dayLength);
+					startDate = getDate;
+					if (getDate <= endDate) {
+						str += ',' + getDate;
+					} else {
+						break;
+					}
+				}
+				let dates = str.split(',');
+				let arr = [];
+				let obj;
+				for (let i = 0; i < 7; i++) {
+					obj = {
+						title: this.getweeks(dates[i]),
+						value: dates[i].substring(5),
+						morning: '暂无',
+						afternoon: '暂无',
+						night: '暂无',
+					}
+					arr.push(obj)
+				}
+				this.oldWeek = arr
+			},
+			getweeks(date) {
+				var weekDay = ["星期天", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"];
+				var dateStr = date;
+				var myDate = new Date(Date.parse(dateStr.replace(/-/g, "/")));
+				return weekDay[myDate.getDay()]
+
+			},
+
+			// startDate: 开始时间;dayLength:每隔几天,0-代表获取每天,1-代表日期间隔一天
+			getTargetDate(date, dayLength) {
+				dayLength = dayLength + 1;
+				var tempDate = new Date(date);
+				tempDate.setDate(tempDate.getDate() + dayLength);
+				var year = tempDate.getFullYear();
+				var month = tempDate.getMonth() + 1 < 10 ? "0" + (tempDate.getMonth() + 1) : tempDate.getMonth() + 1;
+				var day = tempDate.getDate() < 10 ? "0" + tempDate.getDate() : tempDate.getDate();
+
+				return year + "-" + month + "-" + day;
+			},
+
+			//点击新增周
+			choiceNew(e) {
+				this.hospitalWeek.map(val => {
+					val.hospital[0].disabled = false;
+					val.hospital[1].disabled = false;
+					val.hospital[2].disabled = false;
+				})
+				console.log(e)
+				this.time = e[0].label
+				var bData = new Date();
+				bData.setTime(bData.getTime() + 24 * 60 * 60 * 1000 * (8 - bData.getDay() + (7 * e[0].value)))
+				for (let i = 0; i < 7; i++) {
+					var week = (bData.getMonth() + 1) + "-" + this.Appendzero(bData.getDate());
+					bData.setTime(bData.getTime() + 24 * 60 * 60 * 1000 * 1);
+					this.hospitalWeek[i].value = week
+					this.saveList[i].schedule_date = '2020-' + week
+				}
+				this.getTemplate()
+				
+			},
+
+
+
+			//提示是节假日,每次进入页面只会提示一次
+			festival(day, time) {
+				if (day > 4 && this.remind) {
+					this.remindshow = true
+				}
+				this.position.day = day
+				this.position.time = time
+				this.hospitalshow = true
+			},
+
+			/**
+			 * 选择医院逻辑
+			 * @author 刘远航
+			 * @param {Object} e
+			 */
+			confirmhospital: async function(e) {
+				
+				if(this.hospital == ''){
+					this.hospital = e[0].label
+					this.confirmhospital(e)
+					this.hosptialId = e[0].value;
+					this.getTemplate()
+					 
+				}
+				console.log('选择医院:',e[0])
+				console.log('zhi:',this.hospital)
+				//保存上一次操作并更换操作的医院
+				this.hosptialId = e[0].value;
+				this.hospital = e[0].label
+				
+				for (let i = 0; i < this.hospitalWeek.length; i++) {
+					for (let k = 0; k < this.hospitalWeek[i].hospital.length; k++) {
+						if (this.hospitalWeek[i].hospital[k].organization_id != 0 && this.hospitalWeek[i].hospital[k].organization_id !=
+							this.hosptialId) {
+							this.hospitalWeek[i].hospital[k]['disabled'] = true;
+						} else {
+							if (this.hospitalWeek[i].hospital[k].flag == undefined || this.hospitalWeek[i].hospital[k].flag == 'undefined' ||
+								this.hospitalWeek[i].hospital[k].flag == false) {
+								this.hospitalWeek[i].hospital[k]['disabled'] = false;
+							}
+						}
+					}
+				}
+			},
+
+
+			/**
+			 * 提交方法
+			 * @author Liu Yh
+			 * @param {Object} e
+			 */
+			bc: async function(e) {
+				console.log('hospitalWeek', this.hospitalWeek)
+				let that = this;
+				let forms = JSON.stringify(that.saveList);
+				console.log("forms", that.saveList)
+				let res = await that.$request.post("doctor/scheduling", {
+					data: forms
+				});
+				if (res.status == 0) {
+					uni.showToast({
+						duration: 2000,
+						title: '排班成功'
+					})
+					uni.switchTab({
+						url: '/pages/index/index'
+					})
+				} else {
+					uni.showModal({
+						duration: 2000,
+						title: res.message,
+					})
+				}
+			},
+			//获取时间
+			getTime() {
+				var week = [{
+					value: 1,
+					label: ''
+				}, {
+					value: 2,
+					label: ''
+				}, {
+					value: 3,
+					label: ''
+				}, {
+					value: 4,
+					label: ''
+				}]
+
+				//直接获取这周五的时间,然后遍历 给选择器
+				var aData = new Date();
+				aData.setTime(aData.getTime() + 24 * 60 * 60 * 1000 * (7 - aData.getDay()))
+				for (let i = 0; i < 4; i++) {
+					aData.setTime(aData.getTime() + 24 * 60 * 60 * 1000 * 1)
+					var week1 = aData.getFullYear() + "." + (aData.getMonth() + 1) + "." + this.Appendzero(aData.getDate());
+					console.log('第', i + 1, '个周一的时间', week1) //周一的时间
+					//周日
+					aData.setTime(aData.getTime() + 24 * 60 * 60 * 1000 * (aData.getDay() + 5))
+					var week2 = aData.getFullYear() + "." + (aData.getMonth() + 1) + "." + this.Appendzero(aData.getDate());
+					console.log('第', i + 1, '个周日的时间', week2) //周日的时间
+					this.list[i].label = week1 + ' - ' + week2 //给选择器数组
+				}
+				//直接获取下周一时间,给表格
+				var bData = new Date();
+				bData.setTime(bData.getTime() + 24 * 60 * 60 * 1000 * (8 - bData.getDay()))
+				for (let i = 0; i < 7; i++) {
+					var week = (bData.getMonth() + 1) + "-" + this.Appendzero(bData.getDate());
+					console.log('号:', week)
+					bData.setTime(bData.getTime() + 24 * 60 * 60 * 1000 * 1);
+					this.hospitalWeek[i].value = week
+					this.saveList[i].schedule_date = '2020-' + week
+				}
+
+
+				// this.getTemplate()
+
+				//    var date = new Date();
+				//    var seperator1 = "-";
+				//    var seperator2 = ":";
+				//    //以下代码依次是获取当前时间的年月日时分秒
+				//    var year = date.getFullYear();
+				//    var month = date.getMonth() + 1;
+				//    var strDate = date.getDate();
+				//    var minute = date.getMinutes();
+				//    var hour = date.getHours();
+				//    var second = date.getSeconds();
+				//    //固定时间格式
+				//    if (month >= 1 && month <= 9) {
+				//      month = "0" + month;
+				//    }
+				//    if (strDate >= 0 && strDate <= 9) {
+				//      strDate = "0" + strDate;
+				//    }
+				//    var currentdate =  year + seperator1 + month + seperator1 + strDate 
+
+
+				// var dateArray = nowTime.split("-");
+				// var date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
+				// var week = "星期" + "日一二三四五六".charAt(date.getDay());
+				// this.nowWeek = week // 赋值本地数据
+				// alert(week)
+				// return currentdate;
+			},
+
+			/**
+			 * @author Liu Yh
+			 * 时间补0
+			 * @param {Object} obj
+			 */
+			Appendzero(obj) {
+				if (obj < 10) return "0" + "" + obj;
+				else return obj;
+			},
+
+			/**
+			 * @author Liu Yh
+			 * 获取信息模板
+			 */
+			getTemplate: async function() {
+				
+				for (let i = 0; i < this.hospitalWeek.length; i++) {
+					for (let k = 0; k < this.hospitalWeek[i].hospital.length; k++) {
+						this.hospitalWeek[i].hospital[0]['disabled'] = false;
+						this.hospitalWeek[i].hospital[1]['disabled'] = false;
+						this.hospitalWeek[i].hospital[2]['disabled'] = false;
+						
+						this.hospitalWeek[i].hospital[0].organization_id = 0;
+						this.hospitalWeek[i].hospital[1].organization_id = 0;
+						this.hospitalWeek[i].hospital[2].organization_id = 0;
+						
+						this.hospitalWeek[i].hospital[0].checked = false;
+						this.hospitalWeek[i].hospital[1].checked = false;
+						this.hospitalWeek[i].hospital[2].checked = false;
+					}
+				}
+				
+				
+				
+				// let that = this;
+				let startTime = '2020-' + this.hospitalWeek[0].value;
+				let endTime = '2020-' + this.hospitalWeek[6].value;
+				let res = await this.$request.post("doctor/getLinsDetail", {
+					'start_date': startTime,
+					'end_date': endTime
+				});
+				console.log(res.data);
+				if (res.status == 0) {
+					if (typeof res.data.list[0] != undefined && typeof res.data.list[0] != 'undefined') {
+						let data = res.data.list;
+						let arr = [];
+						for (let i = 0; i < this.hospitalWeek.length; i++) {
+							for (let p = 0; p < data.length; p++) {
+								if (this.hospitalWeek[i].value == data[p].schedule_date) {
+									this.saveList[i].hospital[0].organization_id = data[p].type.zao_id;
+									this.saveList[i].hospital[1].organization_id = data[p].type.xia_id;
+									this.saveList[i].hospital[2].organization_id = data[p].type.wan_id;
+
+									this.hospitalWeek[i].hospital[0].organization_id = data[p].type.zao_id;
+									this.hospitalWeek[i].hospital[1].organization_id = data[p].type.xia_id;
+									this.hospitalWeek[i].hospital[2].organization_id = data[p].type.wan_id;
+									this.hospitalWeek[i].hospital[0].checked = data[p].type.zao_id == 0 ? false : true;
+									this.hospitalWeek[i].hospital[1].checked = data[p].type.xia_id == 0 ? false : true;
+									this.hospitalWeek[i].hospital[2].checked = data[p].type.wan_id == 0 ? false : true;
+
+									// this.hospitalWeek[i].hospital[0]['flag'] = data[p].type.zao_flag;
+									// this.hospitalWeek[i].hospital[1]['flag'] = data[p].type.xia_flag;
+									// this.hospitalWeek[i].hospital[2]['flag'] = data[p].type.wan_flag;
+								}
+							}
+						}
+						
+						
+						for (let i = 0; i < this.hospitalWeek.length; i++) {
+							for (let k = 0; k < this.hospitalWeek[i].hospital.length; k++) {
+								if (this.hospitalWeek[i].hospital[k].organization_id != 0 && this.hospitalWeek[i].hospital[k].organization_id !=
+									this.hosptialId) {
+									this.hospitalWeek[i].hospital[k]['disabled'] = true;
+								}
+							}
+						}
+
+					} else {			
+						for (let i = 0; i < this.hospitalWeek.length; i++) {
+							this.saveList[i].hospital[0].organization_id = 0;
+							this.saveList[i].hospital[1].organization_id = 0;
+							this.saveList[i].hospital[2].organization_id = 0;
+							this.hospitalWeek[i].hospital[0].checked = false;
+							this.hospitalWeek[i].hospital[1].checked = false;
+							this.hospitalWeek[i].hospital[2].checked = false;
+						}
+					}
+					
+				}
+				
+				
+				
+
+
+			},
+
+			/**
+			 * change事件
+			 * @author Liu Yh
+			 * @param {Object} index
+			 * @param {Object} hindex
+			 */
+			horg(index, hindex) {
+				if (this.hosptialId == '' || this.time == '') {
+					uni.showModal({
+						title: '先选择医院否则无法提交',
+					})
+					return false;
+				}
+				
+				if (this.hospitalWeek[index].hospital[hindex].organization_id != 0 && this.hospitalWeek[index].hospital[hindex].organization_id !=
+					this.hosptialId) {
+					this.hospitalWeek[index].hospital[hindex]['disabled'] = true;
+				} else {
+					this.hospitalWeek[index].hospital[hindex]['disabled'] = false;
+				}
+
+				if (!this.hospitalWeek[index].hospital[hindex]['checked'] == false) {
+					this.hospitalWeek[index].hospital[hindex].organization_id = 0
+				} else {
+					this.hospitalWeek[index].hospital[hindex].organization_id = this.hosptialId;
+				}
+				var saveList = this.saveList
+				var lists;
+				let yeares = new Date().toISOString().slice(0, 4);
+				// 医院的id
+				saveList[index].hospital[hindex].organization_id = this.hospitalWeek[index].hospital[hindex].organization_id;
+				// 是否选中 因为是change不同步所以区反
+				saveList[index].hospital[hindex].checked = !this.hospitalWeek[index].hospital[hindex].checked;
+				// 日期
+				saveList[index].value = yeares + '-' + this.hospitalWeek[index].value
+			},
+			/**
+			 * 获取医院
+			 */
+			gethospitalList: async function() {
+				let that = this;
+				let res = await that.$request.post("doctor/organizationList");
+				if (res.status == 0) {
+					that.hospitalList = res.data
+				}
+				console.log('医院', res);
+			}
+		},
+		onLoad() {
+			this.gethospitalList();
+			this.getTime();
+			// this.getOldList();
+			// this.cliold()
+			console.log(this.time)
+			
+			this.time = this.list[0].label
+		},
+	}
+</script>
+
+<style>
+	page {
+		background-color: #f0f0f0
+	}
+
+	.title {
+		display: flex;
+		justify-content: center;
+		align-items: center;
+		padding: 30rpx 0;
+		font-weight: bold;
+	}
+
+	.content {
+		display: flex;
+		justify-content: center;
+		align-items: center;
+		padding: 30rpx 0;
+
+	}
+
+	/* 底部按钮 */
+	.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>

+ 391 - 0
pages/scheduling/month_Scheduling.vue

xqd
@@ -0,0 +1,391 @@
+<template>
+	<view style="width: 100%;height: 100%;">
+		<!--医院列表 -->
+		<u-select v-model="hospitalListShow" :list="hospitalList" @confirm="setSelectHospital"></u-select>
+		<!--日视图弹出层-->
+		<u-popup v-model="popupShow" mode="bottom" border-radius="50" @close="allow=false">
+			<!-- 标题按钮 -->
+			<view class="flex justify-center align-center" style="padding: 30rpx 0;font-size: 38rpx;font-weight: bold;background-color: #D2F1F0;">
+				<text style="flex-grow: 1;text-align: center;">{{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>
+			</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 style="width: 80%;">
+					<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>
+					<text>08:30 至 11.30</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>
+					<text>13:30 至 15.30</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>
+					<text>20:00 至 23.30</text>
+				</view>
+			</view>
+		</u-popup>
+		
+		<!-- 顶部标题和按钮 -->
+		<view class="flex justify-between align-center" style="margin: 40rpx 28rpx;">
+			<view style="font-size: 50rpx;flex-grow: 2;" @click="jumpYear">{{year}}年{{month}}月</view>
+			<view class="flex justify-around align-center" style="flex-grow: 3;">
+				<view class="drop-down" @click="hospitalListShow=!hospitalListShow">
+					<text>{{hospital}}</text>
+					<u-icon name="arrow-down-fill" size="32" color="#848484" v-show="!hospitalListShow"></u-icon>
+					<u-icon name="arrow-up-fill" size="32" color="#848484" v-show="hospitalListShow"></u-icon>
+				</view>
+				<view style="background-color: #5555ff; padding: 8rpx;border-radius: 5rpx;">
+					<u-icon name="list-dot" size="38" color="#fff" @click="jumpWeek"></u-icon>
+				</view>
+			</view>
+		</view>
+		<view>
+			<!-- 一排星期 -->
+			<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="" 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="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:#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:#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>
+					</view>
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		onLoad() {
+			this.$nextTick(function() {
+				this.getNowTime()
+				this.getNowmonth()
+			})
+			this.hospital = this.hospitalList[0].label
+			this.hospitalID = this.hospitalList[0].value+""
+		},
+		onShow() {
+			if (this.load) {
+				this.monthList = []
+				this.getNowmonth()
+				this.day = 0
+			}
+
+		},
+		data() {
+			return {
+				year: 0, //年
+				month: 0, //月
+				day: 0, //日
+				empty: 0, // 一号前面有几个空
+				load: false, //控制加载,从年视图返回执行onshow
+				popupShow: false, //控制弹窗弹出层
+				weekList: [{
+					text: "日"
+				}, {
+					text: "一"
+				}, {
+					text: "二"
+				}, {
+					text: "三"
+				}, {
+					text: "四"
+				}, {
+					text: "五"
+				}, {
+					text: "六"
+				}],
+				monthList: [],//这个月的数据,不要动
+
+				hospital: "",//现在选中的医院
+				hospitalID:"1",//选中的医院ID
+				hospitalListShow: false,//控制医院选择器
+				// 医院列表
+				hospitalList: [{
+						value: 1,
+						label: "测试医院1"
+					},
+					{
+						value: 2,
+						label: "测试医院2"
+					},
+					{
+						value: 3,
+						label: "测试医院3"
+					},
+					{
+						value: 4,
+						label: "测试医院4"
+					}
+				],
+				// 一个月的排班数据 从一号开始
+				//下标0为一号,值为医院ID
+				// 没有排班记录为0
+				schedulingList: [
+					{mon: "1",aft:"1",nig:"1"},
+					{mon: "2",aft:"2",nig:"2"},
+					{mon: "0",aft:"0",nig:"0"},
+					{mon: "0",aft:"1",nig:"0"},
+					{mon: "0",aft:"2",nig:"0"},
+					{mon: "1",aft:"0",nig:"0"},
+					{mon: "2",aft:"0",nig:"0"},
+					{mon: "1",aft:"1",nig:"0"},
+					{mon: "2",aft:"2",nig:"0"},
+					{mon: "1",aft:"1",nig:"1"},
+					{mon: "2",aft:"2",nig:"2"},
+					{mon: "1",aft:"1",nig:"2"},
+					{mon: "0",aft:"0",nig:"2"},
+					{mon: "0",aft:"2",nig:"0"},
+					{mon: "0",aft:"1",nig:"2"},
+					{mon: "2",aft:"0",nig:"2"},
+					{mon: "2",aft:"2",nig:"2"},
+					{mon: "2",aft:"0",nig:"0"},
+					{mon: "2",aft:"1",nig:"2"},
+					{mon: "2",aft:"0",nig:"2"},
+					{mon: "2",aft:"2",nig:"0"},
+					{mon: "2",aft:"0",nig:"2"},
+					{mon: "2",aft:"2",nig:"2"},
+					{mon: "2",aft:"0",nig:"2"},
+					{mon: "2",aft:"2",nig:"2"},
+					{mon: "2",aft:"0",nig:"2"},
+					{mon: "2",aft:"2",nig:"2"},
+					{mon: "2",aft:"0",nig:"2"},
+					{mon: "2",aft:"2",nig:"2"},
+					{mon: "2",aft:"2",nig:"2"},
+					{mon: "2",aft:"2",nig:"2"},
+					{mon: "2",aft:"2",nig:"2"},
+					{mon: "2",aft:"2",nig:"2"},
+					{mon: "2",aft:"2",nig:"2"},
+					{mon: "2",aft:"2",nig:"2"},
+					{mon: "2",aft:"2",nig:"2"},
+					{mon: "2",aft:"2",nig:"2"},
+					{mon: "2",aft:"2",nig:"2"},
+					{mon: "2",aft:"2",nig:"2"},
+					{mon: "2",aft:"2",nig:"2"},
+					{mon: "2",aft:"2",nig:"2"},
+					{mon: "2",aft:"2",nig:"2"},
+					{mon: "2",aft:"2",nig:"2"},
+					{mon: "2",aft:"2",nig:"2"},
+					{mon: "2",aft:"2",nig:"2"},
+					{mon: "2",aft:"2",nig:"2"},
+					{mon: "2",aft:"2",nig:"2"},
+					{mon: "2",aft:"2",nig:"2"},
+				],
+				
+				// 弹出层数据
+				allow:false ,//允许设置
+				//空按钮样式
+				nullStyle:{
+					backgroundColor: '#FFF',
+					color:'#000',
+					fontWeight: "bold",
+					margin:'20rpx 0 10rpx 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: {
+			/**
+			 * 获取现在的日期
+			 * */
+			getNowTime() {
+				var d = new Date();
+				this.year = d.getFullYear()
+				this.month = d.getMonth() + 1
+				this.day = d.getDate()
+
+			},
+			/**
+			 * 拿到一个月的数据
+			 * */
+			getNowmonth() {
+				let oneDayTime = 24 * 60 * 60 * 1000; //固定数据 一天的时长
+				var date = new Date()
+				this.day = date.getDate()
+				date.setFullYear(this.year, this.month - 1, 1); //这个月的一号
+				for (let b = 0; b < date.getDay(); b++) {
+					this.monthList.push({
+						text: "",
+						select: false
+					})
+				}
+				this.empty = date.getDay()
+				console.log(date.getDay())
+				date.setFullYear(this.year, this.month - 1, 0); //查看这个月有几天
+				
+				for (let c = 0; c < date.getDate(); c++) {
+					console.log(this.schedulingList[c].mon==""?0:this.schedulingList[c].mon==this.hospitalID?1:2 )
+					this.monthList.push({
+						text: c + 1,
+						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 
+					})
+				}
+				console.log(this.monthList)
+			},
+			/**
+			 * 切换医院
+			 * */
+			setSelectHospital (e) {
+				console.log(e)
+				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 
+				}
+			},
+			/**
+			 * 点击对应日期
+			 * */
+			setDay(index,text) {
+				if (index >= this.empty) {
+					this.monthList.map(val => {
+						val.select = false
+					})
+					this.monthList[index].select = true
+					this.day = text
+					this.popupShow = true
+				}
+				
+			},
+			/**
+			 * 跳转到年视图
+			 * */
+			jumpYear() {
+				setTimeout(function() {
+					uni.navigateTo({
+						url: "year_Scheduling"
+					})
+				}, 300)
+			},
+			/**
+			 * 日视图按钮点击
+			 * 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){
+					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
+							}
+							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
+							}
+							break;
+					}
+					this.$forceUpdate();
+				}else{
+					
+				}
+			},
+			/**
+			 * 跳转周视图
+			 * */
+			jumpWeek(){
+				uni.navigateTo({
+					url:'week_Scheduling'
+				})
+			}
+		}
+	}
+</script>
+
+<style>
+	/* 下拉按钮 */
+	.drop-down {
+		border: 1rpx solid #AAAAAA;
+		font-size: 32rpx;
+		flex-grow: 1;
+		margin-right: 30rpx;
+		border-radius: 15rpx;
+		display: flex;
+		justify-content: space-between;
+		align-items: center;
+		padding: 10rpx 15rpx;
+	}
+</style>

+ 464 - 0
pages/scheduling/old_Scheduling.vue

xqd
@@ -0,0 +1,464 @@
+<template>
+	<view style="width: 100%;height: 100%;">
+		<!-- 历史周选择 -->
+		<u-select v-model="oldshow" :list="oldlist" @confirm="choiceNew"></u-select>
+		<!-- 历史 -->
+		<view>
+			<view style="padding: 30rpx 35rpx;" class="flex justify-between">
+				<view style="color: #666666;" @click="oldshow = true">
+					<text style="margin-right: 20rpx;">选择排班周数</text>
+					<u-icon name="arrow-down" color="#666666" size="28" v-if="!show"></u-icon>
+					<u-icon name="arrow-up" color="#666666" size="28" v-else></u-icon>
+				</view>
+
+			</view>
+			<view class="flex" style="background-color: #FFFFFF;">
+				<!-- 时间 -->
+				<view class="title" style="width: 20%;">时间</view>
+				<u-line color="#cecece" direction="col" />
+				<!-- 上午 -->
+				<view class="title" style="width: 26%;">上午</view>
+				<u-line color="#cecece" direction="col" />
+				<!-- 下午 -->
+				<view class="title" style="width: 26%;">下午</view>
+				<u-line color="#cecece" direction="col" />
+				<!-- 晚上 -->
+				<view class="title" style="width: 26%;">晚上</view>
+			</view>
+
+			<!-- 表格一条内容  循环七遍-->
+			<view v-for="(item,index) in oldWeek" :key='index'>
+				<u-line color="#cecece" />
+				<!-- 星期一 -->
+				<view class="flex" style="background-color: #FFFFFF;">
+
+					<view class="content" style="width: 20%;font-weight: bold;">
+						<view>
+							<view style="text-align: center;">{{item.week}}</view>
+							<view style="text-align: center;">{{item.schedule_date}}</view>
+						</view>
+					</view>
+					<u-line color="#cecece" direction="col" />
+					<!-- 上午 -->
+					<view class="content" style="width: 26%;">
+						<view style="width: 80%;text-align: center;word-break:break-all">{{item.type.zao==false?'-':item.type.zao}}</view>
+					</view>
+					<u-line color="#cecece" direction="col" />
+					<!-- 下午 -->
+					<view class="content" style="width: 26%;">
+						<view style="width: 80%;text-align: center;word-break:break-all">{{item.type.xia==false?'-':item.type.xia}}</view>
+					</view>
+					<u-line color="#cecece" direction="col" />
+					<!-- 晚上 -->
+					<view class="content" style="width: 26%;">
+						<view style="width: 80%;text-align: center;word-break:break-all">{{item.type.wan==false?'-':item.type.wan}}</view>
+					</view>
+				</view>
+			</view>
+		</view>
+		<view style="height: 200rpx;"></view>
+		<!-- 保存 -->
+		<view class="bottomButton" @click="paiban" v-if="!old">
+			排班设置
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				//历史的排班选择
+				oldshow: false,
+
+				oldlist: [],
+
+				// title: '周一',
+				// value: '10-26',
+				// hospital: [{
+				// 	name: '早上',
+				// 	checked: true,
+				// 	disabled:true
+				// }, {
+				// 	name: '下午',
+				// 	checked: false
+				// }, {
+				// 	name: '晚上',
+				// 	checked: false
+				// }],
+				hospitalWeek: [],
+
+				//历史记录的数组
+				oldWeek: [ 
+				
+				],
+
+			}
+		},
+		methods: {
+			paiban() {
+				uni.navigateTo({
+					url: 'Scheduling'
+				})
+			},
+			
+			cliold: async function(e) {
+			
+				let times = e[0].label;
+				times = times.split(" 至 ");
+				let startime = times[0];
+				let endtime = times[1];
+				let weekArr = this.getDateStr(startime, endtime, 0);
+			
+				
+				console.log(res);
+				
+				
+				if (res.status == 0) {
+					/* if (typeof res.data.list[0] != undefined && typeof res.data[0] != 'undefined') {
+						let data = res.data.list;
+						let arr = [];
+						for (let i = 0; i < this.oldWeek.length; i++) {
+							for (let p = 0; p < data.length; p++) {
+								if (this.oldWeek[i].value == data[p].schedule_date) {
+									this.oldWeek[i].morning = data[p].type.zao ? data[p].type.zao : '暂无';
+									this.oldWeek[i].afternoon = data[p].type.xia ? data[p].type.xia : '暂无';
+									this.oldWeek[i].night = data[p].type.wan ? data[p].type.wan : '暂无';
+								}
+							}
+						}
+			
+					} else {
+						for (let i = 0; i < this.oldWeek.length; i++) {
+							this.oldWeek[i].morning = '暂无';
+							this.oldWeek[i].afternoon = '暂无';
+							this.oldWeek[i].night = '暂无';
+						}
+					} */
+				}
+			
+			},
+			
+			
+			getTimeList:async function(){
+				let res = await this.$request.post("doctor/getLinsList");
+				if(res.status==0){
+					if(res.data.service!=0){
+						let times = res.data.service.created_at.substring(0,10);
+						times = times.split('-');
+	
+						this.getweek(times[0],times[1],times[2]);
+					}
+					
+					if(res.data.list.length!=0){
+						let leng = this.oldlist.length;
+						let lists = res.data.list;
+						for(let i=0;i<lists.length;i++){
+							console.log('开始时间L',(lists[i].start_time.schedule_date).replace(/-/g,"/"))
+							this.oldlist.push({
+								label:(lists[i].start_time.schedule_date).replace(/-/g,"/") + "-" + (lists[i].end_time.schedule_date).replace(/-/g,"/"),
+								value: leng+1
+							})
+						}
+					}
+				}
+				console.log(res);
+			},
+			
+			
+			getTemplate: async function(startTime,endTime) {
+				let that = this;
+				// let startTime = '2020-' + that.hospitalWeek[0].value;
+				// let startTime = '2020-' + '11-30';
+				// let endTime = '2020-' + that.hospitalWeek[6].value;
+				// let endTime = '2020-' + '12-6';
+			 
+				let res = await that.$request.post("doctor/getLinsDetail", {
+					'start_date': startTime,
+					'end_date': endTime
+				});
+				console.log("res", res)
+				console.log('oldeList',this.oldlist)
+				// that.oldWeek = res.data.list
+				if (res.status == 0) {
+		
+				if (typeof res.data.list[0] != undefined && typeof res.data.list[0] != 'undefined') {
+					let data = res.data.list;
+					let arr = [];
+ 
+					for (let i = 0; i < this.oldWeek.length; i++) {
+						for (let p = 0; p < data.length; p++) {
+							if (this.oldWeek[i].schedule_date == data[p].schedule_date) {
+								this.oldWeek[i].type.zao = data[p].type.zao ? data[p].type.zao : '-';
+								this.oldWeek[i].type.xia = data[p].type.xia ? data[p].type.xia : '-';
+								this.oldWeek[i].type.wan = data[p].type.wan ? data[p].type.wan : '-';
+							}
+						}
+					}
+				} else {
+					for (let i = 0; i < this.oldWeek.length; i++) {
+						this.oldWeek[i].type.zao = '-';
+						this.oldWeek[i].type.xia = '-';
+						this.oldWeek[i].type.wan = '-';
+					}
+				}
+				}
+			},
+			
+			
+			
+			/**
+			 * 拿到开始日到今天的每周周一和周天数据
+			 * 传参:year开始年(num),month开始月(num),day开始日(num)
+			 * 
+			 * 
+			 * */
+			 getweek(startYear,startMonth,startDay){
+				 /**
+				  * startYear开始年份 例2020 
+				  * startMonth开始月份 例12
+				  * startDay开始日  例5
+				  * d  开始的时间对象
+				  * monday  开始时间的星期一
+				  * sunday  开始时间的星期天
+				  * nowday  今天的时间
+				  * nowMonday 今天的周一
+				  * weeknum 开始到今天有几周
+				  * */
+				// let startYear = 2020;//开始年
+				// let startMonth = 11;//开始月
+				// let startDay = 12;//开始的日
+				let startweek = 0; //开始时间是星期几
+				let oneDayTime = 24 * 60 * 60 * 1000;//固定数据 一天的时长
+				var d = new Date()
+				//把时间调到对应的日期
+				d.setFullYear(startYear, startMonth - 1, startDay);
+				console.log('今天', d.toLocaleDateString())
+				//本周第几天 因系统会把周日作为第0天
+				startweek = d.getDay() == 0 ? 7 : d.getDay();
+				console.log('这天星期', startweek)
+				//拿到当天的周一和周日
+				var monday = new Date(d.getTime() - (startweek - 1) * oneDayTime)
+				var sunday = new Date(monday.getTime() + 6 * oneDayTime)
+				console.log('这天星期一是', monday.toLocaleDateString())
+				console.log('这天星期日是', sunday.toLocaleDateString())
+				//拿到今天距离那天多少周
+				var nowday = new Date() //今天时间
+				var nowMonday = new Date(nowday.getTime() - ((nowday.getDay() == 0 ? 7 : nowday.getDay()) - 1) * oneDayTime) //这周星期一时间
+				console.log('今天的周一是', nowMonday.toLocaleDateString())
+				var weeknum = Math.ceil(this.getCountOfWeekX(d,nowMonday)+1); //计算从 ****----****有多少个周
+				console.log("有几个周", weeknum)
+				//开始循环,用开始的星期一到星期天,
+			
+				for(let i = 0; i < weeknum ; i++){
+					let mon = new Date(monday.getTime() + oneDayTime* (i*7))
+					// mon.setTime()
+					let	sun = new Date(mon.getTime() + oneDayTime* 6)
+					this.oldlist.push({
+						label: mon.getFullYear()+'/'+(mon.getMonth()+1)+'/'+mon.getDate() + "-" + sun.getFullYear()+'/'+(sun.getMonth()+1)+'/'+sun.getDate(),
+						value: i
+					})
+					mon.setTime(mon.getTime() + oneDayTime)
+				}
+				console.log("oldlist",this.oldlist)
+			 },
+			 getCountOfWeekX(startDate, endDate) {
+			 	var start = startDate.getTime();
+			 	var end = endDate.getTime()
+			 	let w=(endDate - startDate)/(7*24*60*60*1000);
+			 	return  w;
+			 },
+			
+			
+			Appendzero(obj) {
+				if (obj < 10) return "0" + "" + obj;
+				else return obj;
+			},
+			
+			getTime() {
+				var week = [{
+					value: 1,
+					label: ''
+				}, {
+					value: 2,
+					label: ''
+				}, {
+					value: 3,
+					label: ''
+				}, {
+					value: 4,
+					label: ''
+				}]
+
+				//直接获取这周五的时间,然后遍历 给选择器
+				// var aData = new Date();
+				// aData.setTime(aData.getTime() + 24 * 60 * 60 * 1000 * (7 - aData.getDay()))
+				// for (let i = 0; i < 4; i++) {
+				// 	aData.setTime(aData.getTime() + 24 * 60 * 60 * 1000 * 1)
+				// 	var week1 = aData.getFullYear() + "." + (aData.getMonth() + 1) + "." + this.Appendzero(aData.getDate());
+				// 	console.log('第', i + 1, '个周一的时间', week1) //周一的时间
+				// 	//周日
+				// 	aData.setTime(aData.getTime() + 24 * 60 * 60 * 1000 * (aData.getDay() + 5))
+				// 	var week2 = aData.getFullYear() + "." + (aData.getMonth() + 1) + "." + this.Appendzero(aData.getDate());
+				// 	console.log('第', i + 1, '个周日的时间', week2) //周日的时间
+				// 	this.oldlist[i].label = week1 + ' - ' + week2 //给选择器数组
+				// }
+				//直接获取下周一时间,给表格
+				
+				
+				var bData = new Date();
+				bData.setTime(bData.getTime() + 24 * 60 * 60 * 1000 * (1 - bData.getDay()))
+				for (let i = 0; i < 7; i++) {
+					var week = (bData.getMonth() + 1) + "-" + this.Appendzero(bData.getDate());
+					
+					bData.setTime(bData.getTime() + 24 * 60 * 60 * 1000 * 1);
+					this.oldWeek.push({
+						type: {
+							"zao": false,
+							"xia": false,
+							"wan": false,
+						},
+						week: this.getWeek(bData.getFullYear()+'-'+week),
+						schedule_date: week,
+					})
+					 
+				}
+				this.getTemplate(bData.getFullYear()+'-'+this.oldWeek[0].schedule_date,bData.getFullYear()+'-'+this.oldWeek[6].schedule_date)
+			},
+			
+			 getWeek(dateString) {
+			        var dateArray = dateString.split("-");
+			        let date = new Date(dateArray[0], parseInt(dateArray[1] - 1), dateArray[2]);
+			        return "周" + "日一二三四五六".charAt(date.getDay());
+			    },
+			
+			//点击新增周
+			choiceNew(e) {
+				this.hospitalWeek.map(val => {
+					val.hospital[0].disabled = false;
+					val.hospital[1].disabled = false;
+					val.hospital[2].disabled = false;
+				})
+				console.log(e)
+				this.time = e[0].label
+				let times = e[0].label;
+				   times = times.split("-");
+				   let startime = times[0].replace(/\//g, '-');
+				   let endtime = times[1].replace(/\//g, '-');
+				   this.getDateStr(startime,endtime,0)
+				
+				// var bData = new Date();
+				// bData.setTime(bData.getTime() + 24 * 60 * 60 * 1000 * (8 - bData.getDay() + (7 * e[0].value)))
+				// for (let i = 0; i < 7; i++) {
+				// 	var week = (bData.getMonth() + 1) + "-" + this.Appendzero(bData.getDate());
+				// 	bData.setTime(bData.getTime() + 24 * 60 * 60 * 1000 * 1);
+				// 	this.oldWeek[i].schedule_date = week
+				 
+				// }
+				this.getTemplate(startime,endtime)
+				
+			},
+			getDateStr(startDate, endDate, dayLength) {
+				var str = startDate;
+				for (var i = 0;; i++) {
+					var getDate = this.getTargetDate(startDate, dayLength);
+					startDate = getDate;
+					if (getDate <= endDate) {
+						str += ',' + getDate;
+					} else {
+						break;
+					}
+				}
+				let dates = str.split(',');
+				 
+				let arr = [];
+				let obj;
+				var bData = new Date();
+				for (let i = 0; i < 7; i++) {
+					obj = {
+						week: this.getweeks(dates[i]),
+						schedule_date: dates[i].substring(5),
+						type: {
+							"zao": '-',
+							"xia": '-',
+							"wan": '-',
+						},
+					}
+					arr.push(obj)
+				}
+				this.oldWeek = arr
+			},
+			// startDate: 开始时间;dayLength:每隔几天,0-代表获取每天,1-代表日期间隔一天
+			getTargetDate(date, dayLength) {
+				dayLength = dayLength + 1;
+				var tempDate = new Date(date);
+				tempDate.setDate(tempDate.getDate() + dayLength);
+				var year = tempDate.getFullYear();
+				var month = tempDate.getMonth() + 1 < 10 ? "0" + (tempDate.getMonth() + 1) : tempDate.getMonth() + 1;
+				var day = tempDate.getDate() < 10 ? "0" + tempDate.getDate() : tempDate.getDate();
+			
+				return year + "-" + month + "-" + day;
+			},
+			getweeks(date) {
+				var weekDay = ["星期天", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"];
+				var dateStr = date;
+				var myDate = new Date(Date.parse(dateStr.replace(/-/g, "/")));
+				return weekDay[myDate.getDay()]
+			
+			},
+			
+			
+		},
+		
+		
+		onLoad() {
+			// let res = this.getCurrentWeek();
+			// console.log(res);
+			// let startTime = '2020-' + '11-30';
+			// let endTime = '2020-' + that.hospitalWeek[6].value;
+			// let endTime = '2020-' + '12-07';
+			// this.getweek(2020,10,15);
+			this.getTime();
+			this.getTimeList();
+			// this.getTemplate(startTime,endTime)
+		},
+	}
+</script>
+
+<style>
+	page {
+		background-color: #f0f0f0
+	}
+
+	.title {
+		display: flex;
+		justify-content: center;
+		align-items: center;
+		padding: 30rpx 0;
+		font-weight: bold;
+	}
+
+	.content {
+		display: flex;
+		justify-content: center;
+		align-items: center;
+		padding: 30rpx 0;
+
+	}
+
+	/* 底部按钮 */
+	.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>

+ 245 - 0
pages/scheduling/week_Scheduling.vue

xqd
@@ -0,0 +1,245 @@
+<template>
+	<view style="width: 100%;height: 100%;">
+		<!--医院列表 -->
+		<u-select v-model="hospitalListShow" :list="hospitalList" @confirm="setSelectHospital"></u-select>
+
+		<!-- 顶部标题和按钮 -->
+		<view class="flex justify-between align-center" style="margin: 40rpx 28rpx;">
+			<view style="font-size: 50rpx;flex-grow: 2;">排班医院:</view>
+			<view class="flex justify-around align-center" style="flex-grow: 3;">
+				<view class="drop-down" @click="hospitalListShow=!hospitalListShow">
+					<text>{{hospital}}</text>
+					<u-icon name="arrow-down-fill" size="32" color="#848484" v-show="!hospitalListShow"></u-icon>
+					<u-icon name="arrow-up-fill" size="32" color="#848484" v-show="hospitalListShow"></u-icon>
+				</view>
+			</view>
+		</view>
+
+		<!-- 温馨提示 -->
+		<view style="margin: 10rpx 28rpx;">温馨提示:排班默认按周循环,特殊安排请在月视图调整</view>
+
+		<!-- 周 -->
+		<view v-for="item,index in weekList" class="week" :key="index">
+			<view style="flex-grow: 1;text-align: center;border-right: 2rpx solid #808080;font-size: 36rpx;margin-right: 30rpx;">{{weekTitlelist[index].text}}</view>
+			<view style="flex-grow: 2;">
+				<u-button :custom-style="item.mon == hospitalID ? monStyle : item.mon == 0 ? nullStyle :otherStyle" size="mini"
+				 shape="circle" @click="modify(1,index)" throttleTime="1000">上午</u-button>
+			</view>
+			<view style="flex-grow: 2;">
+				<u-button :custom-style="item.aft == hospitalID ? aftStyle : item.aft == 0 ? nullStyle :otherStyle" size="mini"
+				 shape="circle" @click="modify(2,index)" throttleTime="1000">下午</u-button>
+			</view>
+			<view style="flex-grow: 2;">
+				<u-button :custom-style="item.nig == hospitalID ? nigStyle : item.nig == 0 ? nullStyle :otherStyle" size="mini"
+				 shape="circle" @click="modify(3,index)" throttleTime="1000">晚上</u-button>
+			</view>
+		</view>
+		
+		<!-- 提交 -->
+		<view class="flex justify-center" style="margin-top: 40rpx;">
+			<u-button size="medium"
+			 shape="circle" @click="submit">确认提交</u-button>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		onLoad() {
+			this.$nextTick(function() {
+
+			})
+			this.hospital = this.hospitalList[0].label
+			this.hospitalID = this.hospitalList[0].value + ""
+		},
+		data() {
+			return {
+				hospital: "", //现在选中的医院
+				hospitalID: "1", //选中的医院ID
+				hospitalListShow: false, //控制医院选择器
+				// 医院列表
+				hospitalList: [{
+						value: 1,
+						label: "测试医院1"
+					},
+					{
+						value: 2,
+						label: "测试医院2"
+					},
+					{
+						value: 3,
+						label: "测试医院3"
+					},
+					{
+						value: 4,
+						label: "测试医院4"
+					}
+				],
+
+				weekTitlelist: [{
+					text: '周一'
+					}, {
+					text: '周二'
+					}, {
+					text: '周三'
+					}, {
+					text: '周四'
+					}, {
+					text: '周五'
+					}, {
+					text: '周六'
+					}, {
+					text: '周日'
+				}, ],
+				weekList: [{
+						mon: 1,
+						aft: 1,
+						nig: 1
+					},
+					{
+						mon: 2,
+						aft: 2,
+						nig: 2
+					},
+					{
+						mon: 0,
+						aft: 0,
+						nig: 0
+					},
+					{
+						mon: 1,
+						aft: 1,
+						nig: 2
+					},
+					{
+						mon: 1,
+						aft: 1,
+						nig: 2
+					},
+					{
+						mon: 1,
+						aft: 1,
+						nig: 2
+					},
+					{
+						mon: 1,
+						aft: 1,
+						nig: 2
+					},
+				],
+
+				//空按钮样式
+				nullStyle: {
+					backgroundColor: '#FFF',
+					color: '#000',
+					fontWeight: "bold",
+					margin: '20rpx 0 10rpx 0',
+					width: "80%"
+				},
+				//上午按钮样式
+				monStyle: {
+					backgroundColor: '#5667c8',
+					color: '#fff',
+					fontWeight: "bold",
+					margin: '20rpx 0 10rpx 0',
+					width: "80%"
+				},
+				//下午按钮样式
+				aftStyle: {
+					backgroundColor: '#ec9d75',
+					color: '#fff',
+					fontWeight: "bold",
+					margin: '20rpx 0 10rpx 0',
+					width: "80%"
+				},
+				//晚上按钮样式
+				nigStyle: {
+					backgroundColor: '#55aa7f',
+					color: '#fff',
+					fontWeight: "bold",
+					margin: '20rpx 0 10rpx 0',
+					width: "80%"
+				},
+				//其他医院按钮样式
+				otherStyle: {
+					backgroundColor: '#989898',
+					color: '#fff',
+					fontWeight: "bold",
+					margin: '20rpx 0 10rpx 0',
+					width: "80%"
+				}
+			}
+		},
+		methods: {
+			/**
+			 * 切换医院
+			 * */
+			setSelectHospital(e) {
+				console.log(e)
+				this.hospital = e[0].label
+				this.hospitalID = e[0].value + ""
+			},
+			/**
+			 * 点击排班
+			 * */
+			modify(id, index) {
+				switch (id) {
+					case 1:
+						if (this.weekList[index].mon == this.hospitalID) {
+							this.weekList[index].mon = 0;
+						} else if (this.weekList[index].mon == 0) {
+							this.weekList[index].mon = this.hospitalID
+						}
+						break;
+					case 2:
+						if (this.weekList[index].aft == this.hospitalID) {
+							this.weekList[index].aft = 0;
+						} else if (this.weekList[index].aft == 0) {
+							this.weekList[index].aft = this.hospitalID
+						}
+						break;
+					case 3:
+						if (this.weekList[index].nig == this.hospitalID) {
+							this.weekList[index].nig = 0;
+						} else if (this.weekList[index].nig == 0) {
+							this.weekList[index].nig = this.hospitalID
+						}
+						break;
+				}
+				console.log(this.weekList)
+				this.$forceUpdate();
+			},
+			submit(){
+				uni.navigateBack({
+					delta:1
+				})
+			}
+		}
+	}
+</script>
+
+<style>
+	/* 下拉按钮 */
+	.drop-down {
+		border: 1rpx solid #AAAAAA;
+		font-size: 32rpx;
+		flex-grow: 1;
+		margin-right: 30rpx;
+		border-radius: 15rpx;
+		display: flex;
+		justify-content: space-between;
+		align-items: center;
+		padding: 10rpx 15rpx;
+	}
+
+	/* 周 */
+	.week {
+		margin: 30rpx 28rpx;
+		border-radius: 20rpx;
+		box-shadow: 12rpx 12rpx 8rpx #c8c8c8;
+		padding: 20rpx;
+		background-color: #FFF;
+		display: flex;
+		align-items: center;
+	}
+</style>

+ 228 - 0
pages/scheduling/year_Scheduling.vue

xqd
@@ -0,0 +1,228 @@
+<!-- 年视图 -->
+<template style="background-color:#FFF ;">
+	<view style="width: 100%;height: 100%;background-color:#FFF ;">
+		<view style="height: 40rpx;"></view>
+		<view style="margin: 0 40rpx ;">
+			<view style="font-size: 50rpx;font-weight: 500;margin-bottom: 30rpx;display: flex;justify-content: space-around;">
+				<u-icon name="arrow-left" @click="reduce"></u-icon>
+				<text>{{year}}年</text>
+				<u-icon name="arrow-right" @click="plus"></u-icon>
+			</view>
+			<!-- 月 -->
+			<view v-if="load" class="flex justify-center align-center" style="height: 80vh;">
+				<u-loading mode="circle" size="50"></u-loading>
+			</view>
+
+			<view v-else>
+				<u-grid :col="3" :border="false" align="center">
+					<u-grid-item v-for="item,index in time" :key="index" @click="jumpMonth(index)">
+						<view style="font-size: 40rpx;width: 100%;">{{item.title}}</view>
+						<view style="height: 280rpx;">
+							<u-grid :col="7" style="font-size: 20rpx;" :border="false">
+								<u-grid-item>日</u-grid-item>
+								<u-grid-item>一</u-grid-item>
+								<u-grid-item>二</u-grid-item>
+								<u-grid-item>三</u-grid-item>
+								<u-grid-item>四</u-grid-item>
+								<u-grid-item>五</u-grid-item>
+								<u-grid-item>六</u-grid-item>
+								<u-grid-item v-for="mitem,mindex in item.month" :key="mindex">{{mitem.text}}</u-grid-item>
+							</u-grid>
+						</view>
+					</u-grid-item>
+				</u-grid>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		onLoad() {
+			this.load = true
+			this.getNowTime()
+			this.setWeek()
+			this.$nextTick(function() {
+				this.getweek()
+				this.load = false
+			})
+
+		},
+		data() {
+			return {
+				load: true, //加载列表展示
+				year: 0,
+				nowYear:0,
+				month: 0,
+				time: [{
+						title: '',
+						month: []
+					},
+					{
+						title: '',
+						month: []
+					},
+					{
+						title: '',
+						month: []
+					},
+					{
+						title: '',
+						month: []
+					},
+					{
+						title: '',
+						month: []
+					},
+					{
+						title: '',
+						month: []
+					},
+					{
+						title: '',
+						month: []
+					},
+					{
+						title: '',
+						month: []
+					},
+					{
+						title: '',
+						month: []
+					},
+					{
+						title: '',
+						month: []
+					},
+					{
+						title: '',
+						month: []
+					},
+					{
+						title: '',
+						month: []
+					},
+				],
+			}
+		},
+		methods: {
+			/**
+			 * 拿到当前年
+			 * */
+			getNowTime() {
+				var d = new Date();
+				this.year = d.getFullYear()
+				this.nowYear = d.getFullYear()
+				this.month = d.getMonth() //实际上1月值为0,配合下面下标判断,不加1
+			},
+			/**
+			 * 给所有数据加月
+			 * */
+			setWeek() {
+				for (let w = 0; w < 12; w++) {
+					this.time[w].title = (w + 1) + '月'
+				}
+				console.log(this.time)
+			},
+			/**
+			 * 拿到这年到一月一号的数据
+			 * */
+			getweek() {
+				let startYear = this.year; //开始年
+				let startMonth = 1; //开始月
+				let startDay = 1; //开始的日
+				let oneDayTime = 24 * 60 * 60 * 1000; //固定数据 一天的时长
+				for (let a = 0; a < 12; a++) {
+					var date = new Date()
+					date.setFullYear(this.year, a, 1); //今年每个月的一号
+					for (let b = 0; b < date.getDay(); b++) {
+						this.time[a].month.push({
+							text: ""
+						})
+					}
+					date.setFullYear(this.year, a + 1, 0); //查看这个月有几天
+					// console.log(date.getDate())
+					for (let c = 0; c < date.getDate(); c++) {
+						this.time[a].month.push({
+							text: c + 1
+						})
+					}
+				}
+			},
+			/**
+			 * 加年数
+			 * */
+			plus() {
+				this.time.map(val => {
+					val.month.splice(0, val.month.length)
+				})
+				this.year++
+				this.setWeek()
+				this.getweek()
+
+			},
+			/**
+			 * 减年数
+			 * */
+			reduce() {
+				if(this.year==2020){
+					uni.showToast({
+						icon:'none',
+						title:'无法跳转'
+					})
+				}else{
+					this.time.map(val => {
+					val.month.splice(0, val.month.length)
+				})
+				this.year--
+				this.setWeek()
+				this.getweek()
+				}
+				
+
+			},
+			/**
+			 * 跳转
+			 * */
+			jumpMonth(index) {
+				if (!(index < this.month)) {
+					let pages = getCurrentPages();
+					let prevPage = pages[pages.length - 2];
+					console.log(pages)
+					console.log(prevPage)
+					console.log(prevPage.$vm.year)
+					console.log(prevPage.$vm.month)
+					prevPage.$vm.year = this.year;
+					prevPage.$vm.month = index + 1;
+					prevPage.$vm.load = true;
+					uni.navigateBack({
+						delta: 1
+					})
+				} else {
+					if(this.year>this.nowYear){
+						let pages = getCurrentPages();
+						let prevPage = pages[pages.length - 2];
+						console.log(pages)
+						console.log(prevPage)
+						console.log(prevPage.$vm.year)
+						console.log(prevPage.$vm.month)
+						prevPage.$vm.year = this.year;
+						prevPage.$vm.month = index + 1;
+						prevPage.$vm.load = true;
+						uni.navigateBack({
+							delta: 1
+						})
+					}else{
+					uni.showToast({
+						icon:'none',
+						title:'只能选择'+(this.month+1)+'月以后的日期'+this.year+this.nowYear
+					})
+					}
+				}
+			}
+		}
+	}
+</script>
+
+<style>
+</style>

+ 3 - 3
uview-ui/components/u-grid-item/u-grid-item.vue

xqd xqd xqd
@@ -39,7 +39,7 @@
 				type: Object,
 				default() {
 					return {
-						padding: '30rpx 0'
+						padding: '15rpx 15rpx'
 					}
 				}
 			}
@@ -84,7 +84,7 @@
 	
 	.u-grid-item {
 		box-sizing: border-box;
-		background: #fff;
+
 		@include vue-flex;
 		align-items: center;
 		justify-content: center;
@@ -114,7 +114,7 @@
 	}
 
 	.u-grid-item-box {
-		padding: 30rpx 0;
+		padding: 10rpx 10rpx;
 		@include vue-flex;
 		align-items: center;
 		justify-content: center;