渣渣宝 4 år sedan
förälder
incheckning
a181676be4
1 ändrade filer med 12 tillägg och 4 borttagningar
  1. 12 4
      pages/scheduling/month_Scheduling.vue

+ 12 - 4
pages/scheduling/month_Scheduling.vue

xqd xqd xqd xqd xqd
@@ -1,8 +1,8 @@
 <template>
 	<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-select v-model="hospitalListShow" :list="hospitalList" @confirm="setSelectHospital" ></u-select>
+		<u-select v-model="timeShow" mode="mutil-column-auto" :list="timeList" @confirm="yearConfirm" :default-value="defaultIndex"></u-select>
 		<!--日视图弹出层-->
 		<u-popup v-model="popupShow" mode="bottom" border-radius="50">
 			<!-- <view style="margin: 20rpx 0;" class="flex justify-center align-center">
@@ -122,6 +122,9 @@
 		},
 		data() {
 			return {
+				//保存医院下标
+				defaultIndex:[0,0],
+				
 				refresh:false,
 				timeShow: false,
 				timeList: [],
@@ -340,13 +343,15 @@
 				for (let x = 1; x < 13; x++) {
 					yearList.push({
 						label: x + "月",
-						value: x
+						value: x,
+						extra:x-1
 					})
 				}
 				for (let x = 0; x < 3; x++) {
 					this.timeList.push({
 						label: (this.year + x) + "年",
 						value: this.year + x,
+						extra: x,
 						children: yearList.slice(0)
 					})
 				}
@@ -451,7 +456,6 @@
 			 * 切换医院
 			 * */
 			setSelectHospital(e) {
-
 				this.getListTime(e[0].value)
 				this.hospital = e[0].label
 				this.hospitalID = e[0].value + ""
@@ -516,6 +520,10 @@
 			 * 确认选择年月
 			 * */
 			yearConfirm(e) {
+				console.log("选择了年月",e)
+				this.defaultIndex[0] = e[0].extra
+				this.defaultIndex[1] = e[1].extra
+				
 				this.year = e[0].value
 				this.month = e[1].value - 1
 				let d = new Date();