Просмотр исходного кода

Ltb2020年11月28日
更改门诊排班逻辑
更改认证页面逻辑

老狐\25396 4 лет назад
Родитель
Сommit
ad8fc65810
6 измененных файлов с 1182 добавлено и 740 удалено
  1. 6 0
      pages.json
  2. 136 185
      pages/Scheduling.vue
  3. 62 41
      pages/index/index.vue
  4. 294 513
      pages/login/doctorRenzheng.vue
  5. 653 0
      pages/old_Scheduling.vue
  6. 31 1
      pages/zixun/xiangqing.vue

+ 6 - 0
pages.json

xqd
@@ -99,6 +99,12 @@
 				"navigationBarTitleText": "门诊排班"
 			}
 		},
+		{
+			"path": "pages/old_Scheduling",
+			"style": {
+				"navigationBarTitleText": "门诊排班"
+			}
+		},
 		/*********************意见管理opinion*********************/
 		//意见管理opinion
 		{

+ 136 - 185
pages/Scheduling.vue

xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd
@@ -1,23 +1,24 @@
 <template>
 	<view style="width: 100%;height: 100%;">
-		<!--  -->
+		<!-- 选择周 -->
 		<u-select v-model="show" :list="list" @confirm="choiceNew"></u-select>
-		<!-- 历史 -->
-		<u-select v-model="oldshow" :list="oldlist" @confirm=""></u-select>
-		<u-select v-model="oldshow" :list="oldlist" @confirm="cliold"></u-select>
-		<!-- 医院 -->
-		<u-select v-model="hospitalshow" mode="single-column" :list="hospitalList" @confirm="confirmhospital" value="0"></u-select>
+		<!-- 选择医院 -->
+		<u-select v-model="hospitalshow" mode="single-column" :list="hospitalList" @confirm="confirmhospital"></u-select>
 		<!-- 新增-->
-		<view v-if="!old">
-			<view style="padding: 30rpx 35rpx;" class="flex justify-between">
-				<view style="color: #666666;" @click="show = true">
+		<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 style="color: #666666;" @click="old = true">历史排班</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-center align-center" style="height: 100rpx;width: 100%;background-color: #fff;font-size: 36rpx;font-weight: bold;border-bottom: 1rpx solid #cecece;">{{hospital}}排班</view>
 			<!-- 标题 -->
 			<view class="flex" style="background-color: #FFFFFF;">
 				<!-- 时间 -->
@@ -38,94 +39,25 @@
 				<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-line color="#cecece" direction="col" />
-					<!-- 上午 -->
-					<view class="content" style="width: 26%;" @click="clickMorning(index)">
-						<view style="width: 80%;text-align: center;word-break:break-all">{{item.morning}}</view>
-						<u-icon name="arrow-down" color="#999999" size="28"></u-icon>
-					</view>
-					<u-line color="#cecece" direction="col" />
-					<!-- 下午 -->
-					<view class="content" style="width: 26%;" @click="clickAfternoon(index)">
-						<view style="width: 80%;text-align: center;word-break:break-all">{{item.afternoon}}</view>
-						<u-icon name="arrow-down" color="#999999" size="28"></u-icon>
-					</view>
-					<u-line color="#cecece" direction="col" />
-					<!-- 晚上 -->
-					<view class="content" style="width: 26%;" @click="clicknight(index)">
-						<view style="width: 80%;text-align: center;word-break:break-all">{{item.night}}</view>
-						<u-icon name="arrow-down" color="#999999" size="28"></u-icon>
-					</view>
-				</view>
-			</view>
-		</view>
-
-		<!-- 历史 -->
-		<view v-else>
-			<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 style="color: #666666;" @click="old=false">新增排班</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.value}}</view>
-							<view style="text-align: center;">{{item.title}}</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"></u-checkbox>
 						</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.morning}}</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.afternoon}}</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.night}}</view>
-					</view>
+					</u-checkbox-group>
 				</view>
 			</view>
 		</view>
 		<!-- 保存 -->
-		<view class="bottomButton" @click="modalShow=!modalShow" v-if="!old">
+		<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>
@@ -134,8 +66,8 @@
 	export default {
 		data() {
 			return {
-				//已经保存?
-				fixed: true,
+				//标题上显示的医院。也就是当前选中医院
+				hospital:'',
 				//弹窗
 				modalShow: false,
 				//切换历史和新增
@@ -174,45 +106,95 @@
 				hospitalWeek: [{
 					title: '周一',
 					value: '10-26',
-					morning: '',
-					afternoon: '',
-					night: ''
+					hospital: [{
+						name: '早上',
+						checked: true,
+						disabled:true
+					}, {
+						name: '下午',
+						checked: false
+					}, {
+						name: '晚上',
+						checked: false
+					}],
 				}, {
 					title: '周二',
 					value: '10-27',
-					morning: '',
-					afternoon: '',
-					night: ''
+					hospital: [{
+						name: '早上',
+						checked: false
+					}, {
+						name: '下午',
+						checked: false
+					}, {
+						name: '晚上',
+						checked: false
+					}],
 				}, {
 					title: '周三',
 					value: '10-28',
-					morning: '',
-					afternoon: '',
-					night: ''
+					hospital: [{
+						name: '早上',
+						checked: false
+					}, {
+						name: '下午',
+						checked: false
+					}, {
+						name: '晚上',
+						checked: false
+					}],
 				}, {
 					title: '周四',
 					value: '10-29',
-					morning: '',
-					afternoon: '',
-					night: ''
+					hospital: [{
+						name: '早上',
+						checked: false
+					}, {
+						name: '下午',
+						checked: false
+					}, {
+						name: '晚上',
+						checked: false
+					}],
 				}, {
 					title: '周五',
 					value: '10-30',
-					morning: '',
-					afternoon: '',
-					night: ''
+					hospital: [{
+						name: '早上',
+						checked: false
+					}, {
+						name: '下午',
+						checked: false
+					}, {
+						name: '晚上',
+						checked: false
+					}],
 				}, {
 					title: '周六',
 					value: '10-31',
-					morning: '',
-					afternoon: '',
-					night: ''
+					hospital: [{
+						name: '早上',
+						checked: false
+					}, {
+						name: '下午',
+						checked: false
+					}, {
+						name: '晚上',
+						checked: false
+					}],
 				}, {
 					title: '周日',
 					value: '11-01',
-					morning: '',
-					afternoon: '',
-					night: ''
+					hospital: [{
+						name: '早上',
+						checked: false
+					}, {
+						name: '下午',
+						checked: false
+					}, {
+						name: '晚上',
+						checked: false
+					}],
 				}],
 
 				saveList: [{
@@ -284,7 +266,6 @@
 				//历史记录的数组
 				oldWeek: [],
 				//选择医院
-				hospital: '',
 				hospitalList: [],
 				hospitalshow: false,
 				//当前点击的位置
@@ -293,32 +274,14 @@
 					time: '' //1早2下3晚
 				},
 				//选择排班提醒
-				remind:true,
-				remindshow:false
+				remind: true,
+				remindshow: false
 			}
 		},
 		methods: {
-			getOldList: async function() {
-				let res = await this.$request.post("doctor/getLinsList");
-				if (res.status == 0) {
-					if (res.data != null) {
-						let datas = JSON.parse(JSON.stringify(res.data))
-						let lists = []
-						var obj;
-						for (let i = 0; i < datas.length; i++) {
-							obj = {
-								value: datas[i].start_time.id + ' 至 ' + datas[i].end_time.id,
-								label: datas[i].start_time.schedule_date + ' 至 ' + datas[i].end_time.schedule_date,
-							}
-							lists.push(obj)
-						}
-						this.oldlist = lists
-					}
-				}
-			},
-
+			
 			cliold: async function(e) {
-				
+
 				let times = e[0].label;
 				times = times.split(" 至 ");
 				let startime = times[0];
@@ -419,30 +382,12 @@
 			},
 
 
-			// 早下晚的点击事件
-			clickMorning(index) {
-				if (this.fixed) {
-					this.festival(index,1)
-					
-				}
-			},
-			clickAfternoon(index) {
-				if (this.fixed) {
-					this.festival(index,2)
-					
-				}
-			},
-			clicknight(index) {
-				if (this.fixed) {
-					this.festival(index,3)
-					
-				}
-			},
+			
 			//提示是节假日,每次进入页面只会提示一次
-			festival(day,time){
-				if(day>4&&this.remind){
+			festival(day, time) {
+				if (day > 4 && this.remind) {
 					this.remindshow = true
-					
+
 				}
 				this.position.day = day
 				this.position.time = time
@@ -450,31 +395,35 @@
 			},
 			//医院选择器的确认点击事件
 			confirmhospital(e) {
-				let es = JSON.parse(JSON.stringify(e));
-
-				var lists;
-
-				if (this.position.time == 1) {
-					this.hospitalWeek[this.position.day].morning = es[0].label
-					this.saveList[this.position.day].identifi.zao = es[0].value;
-				} else if (this.position.time == 2) {
-					this.hospitalWeek[this.position.day].afternoon = es[0].label
-					this.saveList[this.position.day].identifi.zhong = es[0].value;
-				} else if (this.position.time == 3) {
-					this.hospitalWeek[this.position.day].night = es[0].label
-					this.saveList[this.position.day].identifi.wan = es[0].value
-				}
-				this.saveList[this.position.day].organization_id = es[0].value
-				// this.saveList[this.position.day].schedule_date ='2020-'+this.hospitalWeek[this.position.day].value
-				this.position.day = '';
-				this.position.time = '';
-				this.hospitalshow = false;
+				//保存上一次操作并更换操作的医院
+				console.log(e)
+				this.hospital = e[0].label
+				
+				
+				
+				// let es = JSON.parse(JSON.stringify(e));
+				// var lists;
+				// if (this.position.time == 1) {
+				// 	this.hospitalWeek[this.position.day].morning = es[0].label
+				// 	this.saveList[this.position.day].identifi.zao = es[0].value;
+				// } else if (this.position.time == 2) {
+				// 	this.hospitalWeek[this.position.day].afternoon = es[0].label
+				// 	this.saveList[this.position.day].identifi.zhong = es[0].value;
+				// } else if (this.position.time == 3) {
+				// 	this.hospitalWeek[this.position.day].night = es[0].label
+				// 	this.saveList[this.position.day].identifi.wan = es[0].value
+				// }
+				// this.saveList[this.position.day].organization_id = es[0].value
+				// // this.saveList[this.position.day].schedule_date ='2020-'+this.hospitalWeek[this.position.day].value
+				// this.position.day = '';
+				// this.position.time = '';
+				// this.hospitalshow = false;
 			},
 
 
 			//保存
 			bc: async function(e) {
-
+				console.log('hospitalWeek',this.hospitalWeek)
 				let that = this;
 				let forms = JSON.stringify(that.saveList);
 				console.log("forms", that.saveList)
@@ -489,10 +438,10 @@
 					uni.switchTab({
 						url: '/pages/index/index'
 					})
-				}else{
+				} else {
 					uni.showModal({
-						duration:2000,
-						title:res.message,
+						duration: 2000,
+						title: res.message,
 					})
 				}
 			},
@@ -530,7 +479,7 @@
 				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)
+					console.log('号:', week)
 					bData.setTime(bData.getTime() + 24 * 60 * 60 * 1000 * 1);
 					this.hospitalWeek[i].value = week
 					this.saveList[i].schedule_date = '2020-' + week
@@ -566,11 +515,11 @@
 				// alert(week)
 				// return currentdate;
 			},
-			
-			Appendzero(obj){
-			            if(obj<10) return "0" +""+ obj;
-			            else return obj;
-			        },
+
+			Appendzero(obj) {
+				if (obj < 10) return "0" + "" + obj;
+				else return obj;
+			},
 
 			getTemplate: async function() {
 				let that = this;
@@ -580,13 +529,13 @@
 					'start_date': startTime,
 					'end_date': endTime
 				});
-			 
+
 				if (res.status == 0) {
 					this.fixed = res.data.save_flag
 					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) {
@@ -625,6 +574,8 @@
 					that.hospitalList = res.data
 				}
 				console.log('我是医院', res);
+				//默认选中第一个医院
+				this.hospital = res.data[0].label
 			}
 		},
 		onLoad() {

+ 62 - 41
pages/index/index.vue

xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd
@@ -11,8 +11,7 @@
 						<view class="plr20 pt20 m-dpflex m-justify-start " style="margin-bottom: 60rpx;">
 							<view>
 								<image binderror="_binderror" mode="scaleToFill" :src="src" style="width: 100rpx;height: 100rpx;border-radius: 50%;"></image>
-								<view v-if="!docterInfo.is_then" class="flex justify-center align-center" style="border-radius:30rpx ;font-size: 20rpx;padding: 10rpx;background-color: #EEAA3F;color: #FFFFFF;position: relative;top: -20rpx;"
-								 @click="gorz">未认证</view>
+								<view v-if="docterInfo.is_then!='1'" class="flex justify-center align-center" style="border-radius:30rpx ;font-size: 20rpx;padding: 10rpx;background-color: #EEAA3F;color: #FFFFFF;position: relative;top: -20rpx;">未认证</view>
 								<view v-else class="flex justify-center align-center" style="border-radius:30rpx ;font-size: 20rpx;padding: 10rpx;background-color: #84BB43;color: #FFFFFF;position: relative;top: -20rpx;">已认证</view>
 							</view>
 							<view style="margin-left: 30rpx;">
@@ -25,7 +24,6 @@
 								</view>
 								<view style="color:#666666 ;">
 									{{docterInfo.sign}}
-
 								</view>
 							</view>
 							<view class="pr tr m-flex" style="height: 100%;">
@@ -33,7 +31,11 @@
 									<image class="header-img" src="https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/home/bianji.png"
 									 @click="grxx"></image>
 								</navigator>
+								<view style="margin-top: 50rpx;">
+									<text @click="gorz" style="color: #096CBB;">认证中心</text>
+								</view>
 							</view>
+
 						</view>
 						<view class="pr m-xcenter mt30 plr20">
 							<view class="m-flex tl f14 m-ycenter dpb">
@@ -224,9 +226,9 @@
 				docterMessageList: [],
 				//认证弹窗
 				rzModal: false,
-				mzModal:false,
-				twModel:false,
-				dhModel:false,
+				mzModal: false,
+				twModel: false,
+				dhModel: false,
 
 				//没登录头像
 				nosrc: '../../static/login/moren.png',
@@ -274,7 +276,7 @@
 			this.getDocterInfo();
 			// 获取当前登录人接收消息
 			this.getDocterMessage();
-			
+
 			this.getStatus();
 		},
 
@@ -286,10 +288,10 @@
 				let res = await this.$request.post("doctor/doctorInfor", {});
 				if (res.data.name.length > 5) {
 					this.docterInfo.name = res.data.name.substring(0, 5) + "...";
-				}else{
+				} else {
 					this.docterInfo.name = res.data.name;
 				}
-				
+
 				this.src = res.data.avatar;
 				this.docterInfo.eva_num = res.data.eva_num;
 				this.docterInfo.is_then = res.data.is_then;
@@ -298,6 +300,7 @@
 				this.docterInfo.score = res.data.score;
 				this.docterInfo.service_days = res.data.service_days;
 				this.docterInfo.service_persons = res.data.service_persons;
+				console.log('认证', this.docterInfo.is_then)
 			},
 			getDocterMessage: async function() {
 
@@ -531,7 +534,7 @@
 					})
 					return false;
 				} else {
-					if(this.docterInfo.is_then!=1){
+					if (this.docterInfo.is_then != 1) {
 						uni.showModal({
 							title: "提示",
 							content: "请您先认证",
@@ -544,16 +547,18 @@
 							}
 						})
 						return false;
-					}else{
+					} else {
 						return true;
 					}
-					
+
 				}
 			},
-			getStatus:async function(){
-				let res = await this.$request.post('doctor/getSettingList',{'type':1});
-				 
-				if(res.status==0){
+			getStatus: async function() {
+				let res = await this.$request.post('doctor/getSettingList', {
+					'type': 1
+				});
+
+				if (res.status == 0) {
 					this.mzModal = res.data.is_appoint
 					this.dhModel = res.data.is_phone
 					this.twModel = res.data.is_chat
@@ -594,34 +599,34 @@
 			//跳转患者咨询
 			zixun() {
 				if (this.judgerenzheng()) {
-					 if(this.twModel&&this.dhModel){
+					if (this.twModel && this.dhModel) {
 						uni.navigateTo({
 							url: '/pages/zixun/zixun'
-						}) 
-					 }else{
-						 uni.showToast({
-						 	title:'您未开启图文和电话咨询',
-						 	icon:'none'
-						 })
-					 }
-					
+						})
+					} else {
+						uni.showToast({
+							title: '您未开启图文和电话咨询',
+							icon: 'none'
+						})
+					}
+
 				}
 			},
 			//排班
 			pb() {
 				this.getStatus();
 				if (this.judgerenzheng()) {
-					if(this.mzModal){
+					if (this.mzModal) {
 						uni.navigateTo({
-							url: '/pages/Scheduling'
+							url: '/pages/old_Scheduling'
 						})
-					}else{
+					} else {
 						uni.showToast({
-							title:'您未开启门诊',
-							icon:'none'
+							title: '您未开启门诊',
+							icon: 'none'
 						})
 					}
-					
+
 				}
 			},
 			//意见
@@ -635,17 +640,17 @@
 			//门诊
 			mz() {
 				if (this.judgerenzheng()) {
-					if(this.mzModal){
+					if (this.mzModal) {
 						uni.navigateTo({
 							url: '/pages/menzhen/menzhen'
 						})
-					}else{
+					} else {
 						uni.showToast({
-							title:'您未开启门诊',
-							icon:'none'
+							title: '您未开启门诊',
+							icon: 'none'
 						})
 					}
-					
+
 				}
 			},
 			//个人信息 右上角的编辑按钮
@@ -656,10 +661,26 @@
 					})
 				}
 			},
-			//点击认证
+			//点击认证中心
 			gorz() {
-				if (this.judgerenzheng()) {
-					this.rzModal = true
+				if (!this.hasLogin) {
+					uni.showModal({
+						title: "提示",
+						content: "尚未登录,请前往登录",
+						confirmText: "去登录",
+						showCancel: false,
+						success() {
+							uni.navigateTo({
+								url: "../login/login"
+							})
+						}
+					})
+				} else {
+					if (this.docterInfo.is_then != 1) {
+						uni.navigateTo({
+							url: '/pages/login/doctorRenzheng'
+						})
+					}
 				}
 			},
 			evaluate() {
@@ -677,9 +698,9 @@
 				}
 			},
 			// 联系我们
-			lxwm(){
+			lxwm() {
 				uni.makePhoneCall({
-				    phoneNumber: '110' //仅为示例
+					phoneNumber: '110' //仅为示例
 				});
 			}
 		},

+ 294 - 513
pages/login/doctorRenzheng.vue

xqd xqd xqd xqd xqd xqd xqd xqd xqd
@@ -1,203 +1,35 @@
 <template>
-	<view style="width: 100%;height: 100%;">
+	<view style="width: 100%;height: 100%;background-color: #FFF;">
 		<!-- 性别选择器 -->
 		<u-select v-model="sexshow" :list="sexlist" @confirm="sexconfirm"></u-select>
-		<!-- 省 -->
-		<u-select v-model="provinceshow" :list="provincelist" @confirm="sheng" value-name="id" label-name="name"></u-select>
-		<u-select v-model="provinceshow2" :list="provincelist2" @confirm="sheng2" value-name="id" label-name="name"></u-select>
-		<!-- 市 -->
-		<u-select v-model="cityshow" :list="citylist" @confirm="shi" value-name="id" label-name="name"></u-select>
-		<u-select v-model="cityshow2" :list="citylist2" @confirm="shi2" value-name="id" label-name="name"></u-select>
-		<!-- 区县 -->
-		<u-select v-model="areashow" :list="arealist" @confirm="qu" value-name="id" label-name="name"></u-select>
-		<u-select v-model="areashow2" :list="arealist2" @confirm="qu2" value-name="id" label-name="name"></u-select>
-		<!-- 医院 -->
-		<u-select v-model="hospitalshow" :list="hospitallist" @confirm="yy" value-name="id" label-name="name"></u-select>
-		<u-select v-model="hospitalshow2" :list="hospitallist2" @confirm="yy2" value-name="id" label-name="name"></u-select>
-		<!-- 科室 -->
-		<u-select v-model="departmentshow" :list="departmentlist" @confirm="ks" value-name="id" label-name="name"></u-select>
-		<u-select v-model="departmentshow2" :list="departmentlist2" @confirm="ks2" value-name="id" label-name="name"></u-select>
-		<!-- 资质 -->
-		<u-select v-model="qualificationsshow" :list="qualificationslist" @confirm="zz" value-name="id" label-name="name"></u-select>
-		<u-select v-model="qualificationsshow2" :list="qualificationslist2" @confirm="zz2" value-name="id" label-name="name"></u-select>
-
+		<!-- 省市区选择 -->
+		<u-select v-model="regionShow" mode="mutil-column-auto" :list="regionlist" @confirm="regionChoice"></u-select>
+		<!-- 机构科室资质选择 -->
+		<u-select v-model="hospitalShow" mode="mutil-column-auto" :list="hospitallist" @confirm="hospitalChoice"></u-select>
 
 
 		<u-gap height="30" bg-color="#f0f2f5"></u-gap>
 		<!-- 姓名 性别 身份证 -->
 		<view style="padding: 0 28rpx;">
-			<view class="flex align-center" style="margin: 20rpx 0;">
-				<view style="width: 30%;font-weight: bold;" class="felx align-center">
-					<view>医生姓名</view>
-				</view>
-				<view style="width: 70%;">
-					<u-input v-model="form.name" type="text" :border="false"  placeholder="请填写真实姓名" input-align="right" maxlength="6"/>
-				</view>
+			<view class="flex align-center justify-between" style="margin: 20rpx 0;">
+				<view style="width: 30%;font-weight: bold;" class="felx align-center">医生姓名</view>
+				<text v-if="allupload">form.name</text>
+				<u-input v-model="form.name" type="text" :border="false" placeholder="请填写真实姓名" input-align="right" maxlength="6" v-else/>
 			</view>
 			<u-line color="#f0f2f5" />
-			<view class="flex align-center" style="margin: 20rpx 0;">
-				<view style="width: 30%;font-weight: bold;" class="felx align-center">
-					<view>性别</view>
-				</view>
-				<view style="width: 60%;margin-right: 40rpx;">
-					<u-input v-model="form.sex" type="text" :border="false" disabled="true" @click="sexshow = true" placeholder="请选择性别" input-align="right" />
-				</view>
-				<view style="5%" class="flex justify-center align-center">
-					<u-icon name="arrow-down" color="#dddfe1" @click="sexshow = true"></u-icon>
-				</view>
+			<view class="flex align-center justify-between" style="margin: 20rpx 0;">
+				<view style="width: 30%;font-weight: bold;" class="felx align-center">性别</view>
+				<text v-if="allupload">form.sex</text>
+				<u-icon name="arrow-down" color="#dddfe1" @click="sexshow = true" :label="form.sex==''?'请选择性别':form.sex" label-pos="left" :label-color="form.sex==''?'#c7c9ca':'#000000'" v-else></u-icon>
 			</view>
 			<u-line color="#f0f2f5" />
-			<view class="flex align-center" style="margin: 20rpx 0;">
-				<view style="width: 30%;font-weight: bold;" class="felx align-center">
-					<view>身份证</view>
-				</view>
-				<view style="width: 70%;">
-					<u-input v-model="form.ID" type="idcard" :border="false" placeholder="请填写身份证号" input-align="right" maxlength="18"/>
-				</view>
-			</view>
-		</view>
-
-		<u-gap height="30" bg-color="#f0f2f5"></u-gap>
-		<!-- 工作机构一 -->
-		<view style="padding: 45rpx 28rpx 30rpx 28rpx;background-color: #FFFFFF;">
-			<view style="margin-bottom: 50rpx;font-weight: bold;font-size: 30rpx;">
-				{{form.work1.name}}
-			</view>
-			<view class="flex">
-				<!--  ****************省份**************** -->
-				<view class="xiala" @click="viewsheng1" style="border-right: 1rpx solid #dddfe1;">
-					<!-- 	图标 -->
-					<view style="margin:0 20rpx;">
-						<u-icon name="arrow-down" color="#dddfe1"></u-icon>
-					</view>
-					<!-- 文字 -->
-					<view style="color:#999999">{{form.work1.province}}</view>
-				</view>
-				<!-- ********************* 城市*************** -->
-				<view class="xiala" @click="viewshi1">
-					<!-- 图标 -->
-					<view style="margin:0 20rpx;">
-						<u-icon name="arrow-down" color="#dddfe1"></u-icon>
-					</view>
-					<!-- 文字 -->
-					<view style="color:#999999">{{form.work1.city}}</view>
-				</view>
-			</view>
-			<u-gap height="40" bg-color="#ffffff"></u-gap>
-			<view class="flex">
-				<!-- **********************区县******************* -->
-				<view class="xiala" @click="viewqu1" style="border-right: 1rpx solid #dddfe1;">
-					<!-- 图标 -->
-					<view style="margin:0 20rpx;">
-						<u-icon name="arrow-down" color="#dddfe1"></u-icon>
-					</view>
-					<!-- 文字 -->
-					<view style="color:#999999">{{form.work1.area}}</view>
-				</view>
-				<!-- **********************医院********************** -->
-				<view class="xiala" @click="viewyy1">
-					<!-- 图标 -->
-					<view style="margin:0 20rpx;">
-						<u-icon name="arrow-down" color="#dddfe1"></u-icon>
-					</view>
-					<!-- 文字 -->
-					<view style="color:#999999">{{form.work1.hospital}}</view>
-				</view>
-			</view>
-
-			<view style="margin:50rpx 0;font-weight: bold;font-size: 30rpx;">科室资质</view>
-			<view class="flex">
-				<!-- ********************************科室************************************ -->
-				<view class="xiala" @click="viewks1" style="border-right: 1rpx solid #dddfe1;">
-					<!-- 图标 -->
-					<view style="margin:0 20rpx;">
-						<u-icon name="arrow-down" color="#dddfe1"></u-icon>
-					</view>
-					<!-- 文字 -->
-					<view style="color:#999999">{{form.work1.department}}</view>
-				</view>
-				<!-- ***********************************资质***************** -->
-				<view class="xiala" @click="viewzz1">
-					<!-- 图标 -->
-					<view style="margin:0 20rpx;">
-						<u-icon name="arrow-down" color="#dddfe1"></u-icon>
-					</view>
-					<!-- 文字 -->
-					<view style="color:#999999">{{form.work1.qualifications}}</view>
-				</view>
+			<view class="flex align-center justify-between" style="margin: 20rpx 0;">
+				<view style="width: 30%;font-weight: bold;" class="felx align-center">身份证</view>
+				<text v-if="allupload">form.ID</text>
+				<u-input v-model="form.ID" type="idcard" :border="false" placeholder="请填写身份证号" input-align="right" maxlength="18" v-else/>
 			</view>
 		</view>
-		<u-gap height="30" bg-color="#f0f2f5"></u-gap>
 
-		<!-- 工作机构二 -->
-		<view style="padding: 45rpx 28rpx 30rpx 28rpx;background-color: #FFFFFF;">
-			<view style="margin-bottom: 50rpx;font-weight: bold;font-size: 30rpx;">
-				{{form.work2.name}}
-			</view>
-			<view class="flex">
-				<!--  ****************省份**************** -->
-				<view class="xiala" @click="viewsheng2" style="border-right: 1rpx solid #dddfe1;">
-					<!-- 	图标 -->
-					<view style="margin:0 20rpx;">
-						<u-icon name="arrow-down" color="#dddfe1"></u-icon>
-					</view>
-					<!-- 文字 -->
-					<view style="color:#999999">{{form.work2.province}}</view>
-				</view>
-				<!-- ********************* 城市*************** -->
-				<view class="xiala" @click="viewshi2">
-					<!-- 图标 -->
-					<view style="margin:0 20rpx;">
-						<u-icon name="arrow-down" color="#dddfe1"></u-icon>
-					</view>
-					<!-- 文字 -->
-					<view style="color:#999999">{{form.work2.city}}</view>
-				</view>
-			</view>
-			<u-gap height="40" bg-color="#ffffff"></u-gap>
-			<view class="flex">
-				<!-- **********************区县******************* -->
-				<view class="xiala" @click="viewqu2" style="border-right: 1rpx solid #dddfe1;">
-					<!-- 图标 -->
-					<view style="margin:0 20rpx;">
-						<u-icon name="arrow-down" color="#dddfe1"></u-icon>
-					</view>
-					<!-- 文字 -->
-					<view style="color:#999999">{{form.work2.area}}</view>
-				</view>
-				<!-- **********************医院********************** -->
-				<view class="xiala" @click="viewyy2">
-					<!-- 图标 -->
-					<view style="margin:0 20rpx;">
-						<u-icon name="arrow-down" color="#dddfe1"></u-icon>
-					</view>
-					<!-- 文字 -->
-					<view style="color:#999999">{{form.work2.hospital}}</view>
-				</view>
-			</view>
-
-			<view style="margin:50rpx 0;font-weight: bold;font-size: 30rpx;">科室资质</view>
-			<view class="flex">
-				<!-- ********************************科室************************************ -->
-				<view class="xiala" @click="viewks2" style="border-right: 1rpx solid #dddfe1;">
-					<!-- 图标 -->
-					<view style="margin:0 20rpx;">
-						<u-icon name="arrow-down" color="#dddfe1"></u-icon>
-					</view>
-					<!-- 文字 -->
-					<view style="color:#999999">{{form.work2.department}}</view>
-				</view>
-				<!-- ***********************************资质***************** -->
-				<view class="xiala" @click="viewzz2">
-					<!-- 图标 -->
-					<view style="margin:0 20rpx;">
-						<u-icon name="arrow-down" color="#dddfe1"></u-icon>
-					</view>
-					<!-- 文字 -->
-					<view style="color:#999999">{{form.work2.qualifications}}</view>
-				</view>
-			</view>
-		</view>
 		<u-gap height="30" bg-color="#f0f2f5"></u-gap>
 		<!-- 照片上传 -->
 		<view style="border-bottom: 0.5rpx solid #EFEFEF;padding: 10rpx 25rpx;">
@@ -207,7 +39,7 @@
 			</view>
 			<!-- 上传 -->
 			<view>
-				<u-upload :action="action" :file-list="form.certificate" max-count="2" ref="Upractice" :auto-upload="true"></u-upload>
+				<u-upload :action="action" :file-list="form.certificate" max-count="2" ref="Upractice" :auto-upload="true" :deletable="!allupload"></u-upload>
 			</view>
 		</view>
 		<view style="border-bottom: 0.5rpx solid #EFEFEF;padding: 10rpx 25rpx;">
@@ -217,7 +49,7 @@
 			</view>
 			<!-- 上传 -->
 			<view>
-				<u-upload :action="action" :file-list="form.idPhoto" max-count="2" ref="Ucard_photo" :auto-upload="true"></u-upload>
+				<u-upload :action="action" :file-list="form.idPhoto" max-count="2" ref="Ucard_photo" :auto-upload="true" :deletable="!allupload"></u-upload>
 			</view>
 
 		</view>
@@ -228,14 +60,58 @@
 			</view>
 			<!-- 上传 -->
 			<view>
-				<u-upload :action="action" :file-list="form.doctorQualification" max-count="2" ref="Uis_quali" :auto-upload="true"></u-upload>
+				<u-upload :action="action" :file-list="form.doctorQualification" max-count="2" ref="Uis_quali" :auto-upload="true" :deletable="!allupload"></u-upload>
 			</view>
+		</view>
+
+		<u-gap height="30" bg-color="#f0f2f5"></u-gap>
+		<view style="padding: 36rpx 28rpx 0rpx 28rpx;;background-color: #FFF;" class="flex align-center">
+			<view style="font-size: 28rpx;margin-right: 20rpx;font-weight: bold;font-size: 32rpx;">认证机构</view>
+		</view>
 
+		<!-- 工作机构一 -->
+		<view style="padding: 45rpx 28rpx 30rpx 28rpx;" v-for="item,index in mechanismList" :key="index">
+			<view style="margin-bottom: 20rpx;font-weight: bold;font-size: 30rpx;" class="flex justify-between">
+				<!-- 标题 -->
+				<text>{{item.title}}</text>
+				<!-- 删除按钮 -->
+				<u-icon name="close" size="30" @click="closemechanism" style="margin-right:20rpx;" v-if="index != 0&&item.Submit==0"></u-icon>
+				<!-- 状态  1审核中 2审核通过 3审核不通过    -->
+				<view v-else-if="item.Submit==1" style="color:#EA970E;font-size: 28rpx;">状态:审核中</view>
+				<view v-else-if="item.Submit==2" style="color:#4CAD84;font-size: 28rpx;">状态:已审核</view>
+			</view>
+			<!-- 地区 -->
+			<view style="padding: 25rpx 10rpx;" class="flex align-center justify-around" @click="regionClick(index)">
+				<view style="width: 95%;font-size: 28rpx;background-color: ;">{{item.regionText==""?'请选择 省-市-区':item.regionText}}</view>
+				<view class="flex align-center">
+					<u-icon name="arrow-right" color="#C0C0C0"></u-icon>
+				</view>
+			</view>
+			<!-- 机构 -->
+			<view style="padding: 25rpx 10rpx;" class="flex align-center justify-around" @click="hospitalClick(index)">
+				<view style="width: 95%;font-size: 28rpx;background-color: ;">{{item.hospitalText==""?'请选择 机构-科室-资质':item.hospitalText}}</view>
+				<view class="flex align-center">
+					<u-icon name="arrow-right" color="#C0C0C0"></u-icon>
+				</view>
+			</view>
 		</view>
-		<u-gap height="200" bg-color="#f0f2f5"></u-gap>
-		<view class="bottomButton" @click="bc">
-			提交
+		<view style="height: 100rpx;background-color: #f0f2f5;" class="flex align-center justify-center" v-if="mechanismList[mechanismList.length-1].preservation">
+			<view style="font-size: 28rpx;color: #096CBB;border:1rpx solid #C0C0C0;border-radius: 15rpx;padding: 10rpx 20rpx;background-color: #FFF;"
+			 @click="addmechanism">
+				<text>添加认证机构</text>
+				<u-icon name="plus" color="#096CBB"></u-icon>
+			</view>
 		</view>
+		<view style="height: 100rpx;background-color: #f0f2f5;" class="flex align-center justify-center" v-else>
+			<view style="font-size: 28rpx;color: #096CBB;border:1rpx solid #C0C0C0;border-radius: 15rpx;padding: 10rpx 20rpx;background-color: #096CBB;"
+			 @click="bcmechanism">
+				<text style="color: #FFF;">点击保存</text>
+			</view>
+		</view>
+
+		<u-gap height="200" bg-color="#f0f2f5"></u-gap>
+		<view class="bottomButton" @click="bc" >提交</view>
+		<!-- <view class="bottomButton" @click="jxrz" style="background-color: #FFF;color: #0000FF;">继续认证</view> -->
 	</view>
 
 </template>
@@ -245,18 +121,13 @@
 		components: {},
 		onLoad() {
 			this.provinceconfirm()
+			this.addmechanism()
 		},
 		mounted() {},
 		data() {
 			return {
 				action: 'https://xiaoyunimg.top/api/v2/Common/uploadFile',
 				//保存选择的列数
-				province: '', //省
-				city: '', //市
-				area: '', //区
-				hospital: '', //医院
-				department: '', //科室
-				qualifications: '', //资质
 				form: {
 					name: '', //姓名
 					sex: '', //性别
@@ -273,34 +144,9 @@
 							qualifications: '' //资质id
 						}
 					],
-					work1: { //工作机构
-						name: '工作机构一',
-						province: '选择省份', //省
-						city: '选择城市', //市
-						area: '选择县区', //区
-						hospital: '选择医院', //医院
-						department: '科室名称', //科室
-						qualifications: '默认资质' //资质
-					},
-					work2: {
-						name: '工作机构二',
-						province: '选择省份', //省
-						city: '选择城市', //市
-						area: '选择县区', //区
-						hospital: '选择医院', //医院
-						department: '科室名称', //科室
-						qualifications: '默认资质' //资质
-					},
-					// url: 图片地址
-					// error:组件内部使用,不应根据此值判断上传是否成功,而应根据progress属性
-					// progress:如果值为100,表示图片上传成功
-					// response:上传成功后,服务器返回的数据,这是最有用的了
 					certificate: [], //证书
 					idPhoto: [], //身份证
 					doctorQualification: [], //医生资格
-					// practice: ["https://dss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=3363295869,2467511306&fm=26&gp=0.jpg",'https://dss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=3363295869,2467511306&fm=26&gp=0.jpg'], // 医师执业证书(清晰照片和信息页面) 必须两个都传,不可以只上传一个
-					// card_photo: ["https://dss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=3363295869,2467511306&fm=26&gp=0.jpg","https://dss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=3363295869,2467511306&fm=26&gp=0.jpg"], //身份证 , 必须两个都传,不可以只上传一个
-					// is_quail: ["https://dss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=3363295869,2467511306&fm=26&gp=0.jpg","https://dss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=3363295869,2467511306&fm=26&gp=0.jpg"] //医生资格, 必须两个都传,不可以只上传一个
 				},
 				//性别选择
 				sexshow: false,
@@ -313,186 +159,193 @@
 						label: '女'
 					}
 				],
-				//省
-				provinceshow: false,
-				provinceshow2: false,
-				provincelist: [],
-				provincelist2: [],
-				//市
-				cityshow: false,
-				cityshow2: false,
-				citylist: [],
-				citylist2: [],
-				//区
-				areashow: false,
-				areashow2: false,
-				arealist: [],
-				arealist2: [],
-				//医院
-				hospitalshow: false,
-				hospitalshow2: false,
-				hospitallist: [],
-				hospitallist2: [],
-				//科室
-				departmentshow: false,
-				departmentshow2: false,
-				departmentlist: [],
-				departmentlist2: [],
-				//资质
-				qualificationsshow: false,
-				qualificationsshow2: false,
-				qualificationslist: [],
-				qualificationslist2: [],
-				/**已经选择的id***/
-				id1: {
-					sheng: '',
-					shi: '',
-					qu: ''
-				},
-				id2: {
-					sheng: '',
-					shi: '',
-					qu: ''
-				},
-				//提交的数据
-				work: [{ //工作机构
-					id: '',
-					depart: '', //科室id
-					qualifications: '', //资质id
-
-				}, {
-					id: '',
-					depart: '', //科室id
-					qualifications: '', //资质id
-				}],
+				//机构列表
+				mechanismList: [],
 
+				//省市区选择器
+				regionShow: false,
+				regionlist: [{
+						value: 1,
+						label: '中国',
+						children: [{
+								value: 2,
+								label: '广东',
+								children: [{
+										value: 3,
+										label: '深圳'
+									},
+									{
+										value: 4,
+										label: '广州'
+									}
+								]
+							},
+							{
+								value: 5,
+								label: '广西',
+								children: [{
+										value: 6,
+										label: '南宁'
+									},
+									{
+										value: 7,
+										label: '桂林'
+									}
+								]
+							}
+						]
+					},
+					{
+						value: 8,
+						label: '美国',
+						children: [{
+							value: 9,
+							label: '纽约',
+							children: [{
+								value: 10,
+								label: '皇后街区'
+							}]
+						}]
+					}
+				],
+				regindex: 0, //记录点击的地方
+				//机构科室资质选择器
+				hospitalShow: false,
+				hospitallist: [{
+						value: 1,
+						label: '机构1',
+						children: [{
+								value: 2,
+								label: '机构1的科室1',
+								children: [{
+										value: 3,
+										label: '机构1的科室1的主任'
+									},
+									{
+										value: 4,
+										label: '机构1的科室1的副主任'
+									}
+								]
+							},
+							{
+								value: 5,
+								label: '机构1的科室2',
+								children: [{
+										value: 6,
+										label: '机构1的科室2的主任'
+									},
+									{
+										value: 7,
+										label: '机构1的科室2的主任'
+									}
+								]
+							}
+						]
+					},
+					{
+						value: 8,
+						label: '机构2',
+						children: [{
+							value: 9,
+							label: '机构2的科室1',
+							children: [{
+								value: 10,
+								label: '机构2的科室1的主任'
+							}]
+						}]
+					}
+				],
+				hosindex: 0, //记录点击的地方
+				//提交之后不能修改姓名 身份证 性别 证书
+				allupload: false //是否已经提交过并且审核通过
 			}
 		},
 		methods: {
-			
 			/*****************view点击**********************/
-			//省
-			viewsheng1(e) {
-				this.provinceshow = true, this.province = 1
-			},
-			viewsheng2(e) {
-				this.provinceshow2 = true, this.province = 2
-			},
-			//市   判断是否选择了省,不然不让选择
-			viewshi1(e) {
-				if (this.form.work1.province == '选择省份') {
-					uni.showToast({
-						title: '请选择省份',
-						icon: 'none'
-					})
-				} else {
-					this.cityshow = true
-					this.city = 1
-				}
-			},
-			viewshi2(e) {
-				if (this.form.work2.province == '选择省份') {
-					uni.showToast({
-						title: '请选择省份',
-						icon: 'none'
-					})
+			//省市区选择器打开
+			regionClick(index) {
+				if (this.mechanismList.length - 1 == index) {
+					this.regionShow = true
+					this.regindex = index //保存点击的地方
 				} else {
-					this.cityshow2 = true
-					this.city = 2
-				}
-			},
-			//区
-			viewqu1(e) {
-				if (this.form.work1.city == '选择城市') {
 					uni.showToast({
-						title: '请选择城市',
+						title: '无法修改',
 						icon: 'none'
 					})
-				} else {
-					this.areashow = true
-					this.area = 1
 				}
 			},
-			viewqu2(e) {
-				if (this.form.work2.city == '选择城市') {
-					uni.showToast({
-						title: '请选择城市',
-						icon: 'none'
-					})
-				} else {
-					this.areashow2 = true
-					this.area = 2
-				}
-			},
-			//医院
-			viewyy1(e) {
-				if (this.form.work1.area == '选择县区') {
-					uni.showToast({
-						title: '请选择县区',
-						icon: 'none'
-					})
+			//机构选择器打开
+			hospitalClick(index) {
+				if(this.mechanismList.length - 1 == index){
+					if (this.mechanismList[index].regionText!='') {
+					this.hospitalShow = true
+					this.hosindex = index //保存点击的地方
+					}else{
+						uni.showToast({
+							title: '请先填写地区数据',
+							icon: 'none'
+						})
+					}
 				} else {
-					this.hospitalshow = true
-					this.hospital = 1
-				}
-			},
-			viewyy2(e) {
-				if (this.form.work2.area == '选择县区') {
 					uni.showToast({
-						title: '请选择县区',
+						title: '无法修改',
 						icon: 'none'
 					})
-				} else {
-					this.hospitalshow2 = true
-					this.hospital = 2
 				}
 			},
-			//科室
-			viewks1(e) {
-				if (this.form.work1.hospital == '选择医院') {
-					uni.showToast({
-						title: '请选择医院',
-						icon: 'none'
-					})
-				} else {
-					this.departmentshow = true
-					this.department = 1
+			//省市区选择器确认
+			regionChoice(e) {
+				console.log(e)
+				this.mechanismList[this.regindex].regionText = e[0].label + '-' + e[1].label + '-' + e[2].label //利用保存的地方赋值
+			},
+			//机构选择
+			hospitalChoice(e) {
+				console.log(e)
+				this.mechanismList[this.hosindex].hospitalText = e[0].label + '-' + e[1].label + '-' + e[2].label
+			},
+			//数字转文字
+			convertToChinese(num) {
+				var N = [
+					"零", "一", "二", "三", "四", "五", "六", "七", "八", "九"
+				];
+				var str = num.toString();
+				var len = num.toString().length;
+				var C_Num = [];
+				for (var i = 0; i < len; i++) {
+					C_Num.push(N[str.charAt(i)]);
 				}
-			},
-			viewks2(e) {
-				if (this.form.work1.hospital == '选择医院') {
+				return C_Num.join('');
+			},
+			//添加机构
+			addmechanism() {
+				this.mechanismList.push({
+					title: '工作机构' + this.convertToChinese(this.mechanismList.length + 1), //工作机构名称
+					regionText: '', //地区信息文字
+					hospitalText: '', //机构信息文字
+					preservation: false, //是否已经保存
+					Submit: 0, // 信息状态 0未提交 1审核中 2审核通过 3审核不通过
+				})
+			},
+			//保存机构
+			bcmechanism() {
+				if (this.mechanismList[this.mechanismList.length - 1].regionText == '' && this.mechanismList[this.mechanismList.length -
+						1].hospitalText == '') {
 					uni.showToast({
-						title: '请选择医院',
+						title: '请完善机构信息',
 						icon: 'none'
 					})
 				} else {
-					this.departmentshow2 = true
-					this.department = 2
-				}
-			},
-			//资质
-			viewzz1(e) {
-				if (this.form.work1.department == '科室名称') {
+					this.mechanismList[this.mechanismList.length - 1].preservation = true
 					uni.showToast({
-						title: '请选择科室',
-						icon: 'none'
+						title: '保存成功'
 					})
-				} else {
-					this.qualificationsshow = true
-					this.qualifications = 1
 				}
 			},
-			viewzz2(e) {
-				if (this.form.work2.department == '科室名称') {
-					uni.showToast({
-						title: '请选择科室',
-						icon: 'none'
-					})
-				} else {
-					this.qualificationsshow2 = true
-					this.qualifications = 2
-				}
+			//删除机构
+			closemechanism() {
+				this.mechanismList.splice(this.mechanismList.length - 1, 1)
 			},
+
 			/************************/
 			// 性别
 			sexconfirm(e) {
@@ -500,87 +353,6 @@
 				this.form.sex = e[0].label
 				console.log(this.form.sex);
 			},
-			/********************选择器点击事件******************************/
-			//省选择器
-			sheng(e) {
-				console.log('打开了省选择器1')
-				this.form.work1.province = e[0].label
-				this.cityconfirm(e[0].value)
-				this.id1.sheng = e[0].value //把id存到这里
-			},
-			sheng2(e) {
-				console.log('打开了省选择器2')
-				this.form.work2.province = e[0].label
-				this.cityconfirm(e[0].value)
-				this.id2.sheng = e[0].value
-			},
-			//市选择器
-			shi(e) {
-				console.log('打开了市选择器1')
-				this.form.work1.city = e[0].label
-				this.areaconfirm(e[0].value)
-				this.id1.shi = e[0].value
-
-			},
-			shi2(e) {
-				console.log('打开了市选择器2')
-				this.form.work2.city = e[0].label
-				this.areaconfirm(e[0].value)
-				this.id2.shi = e[0].value
-			},
-			//区选择器
-			qu(e) {
-				console.log('打开了区选择器')
-				this.form.work1.area = e[0].label
-				this.id1.qu = e[0].value
-				this.hospitalconfirm(this.id1.sheng, this.id1.shi, this.id1.qu)
-			},
-			qu2(e) {
-				console.log('打开了区选择器2')
-				this.form.work2.area = e[0].label
-				this.id2.qu = e[0].value
-				this.hospitalconfirm(this.id2.sheng, this.id2.shi, this.id2.qu)
-
-			},
-			//医院选择器
-			yy(e) {
-				console.log('打开了医院选择器1', e)
-				this.form.work1.hospital = e[0].label
-				this.form.works[0].hospital = e[0].value;
-
-				this.departmentconfirm()
-			},
-			yy2(e) {
-				console.log('打开了医院选择器2', e)
-				this.form.work2.hospital = e[0].label
-				this.form.works[1].hospital = e[0].value;
-				this.departmentconfirm()
-			},
-			//科室
-			ks(e) {
-				console.log('打开了科室选择器1', e)
-				this.form.work1.department = e[0].label
-				this.form.works[0].department = e[0].value;
-
-				this.qualificationsconfirm()
-			},
-			ks2(e) {
-				console.log('打开了科室选择器2', e)
-				this.form.work2.department = e[0].label
-				this.form.works[1].department = e[0].value;
-				this.qualificationsconfirm()
-			},
-			//资质
-			zz(e) {
-				console.log('打开了资质选择器1')
-				this.form.work1.qualifications = e[0].label
-				this.form.works[0].qualifications = e[0].value;
-			},
-			zz2(e) {
-				console.log('打开了资质选择器2')
-				this.form.work2.qualifications = e[0].label
-				this.form.works[1].qualifications = e[0].value;
-			},
 			/*******************接口*********************/
 			//省
 			provinceconfirm: async function() {
@@ -665,64 +437,73 @@
 			},
 			// 保存
 			bc: async function() {
-				//照片
-				let practice = []	//证书
-				let card_photo = []	//身份证
-				let is_quali = []	//资格
-				// 通过filter,筛选出上传进度为100的文件(因为某些上传失败的文件,进度值不为100,这个是可选的操作)
-				// practice = this.$refs.uUpload.lists.filter(val => {
-				// 	return val.progress == 100;
-				// })
-				// card_photo = this.$refs.uUpload.lists.filter(val => {
-				// 	return val.progress == 100;
-				// })
-				// is_quail = this.$refs.uUpload.lists.filter(val => {
-				// 	return val.progress == 100;
-				// })
-				// 如果您不需要进行太多的处理,直接如下即可
-				practice = this.$refs.Upractice.lists;//证书
-				card_photo = this.$refs.Ucard_photo.lists;//身份证
-				is_quali = this.$refs.Uis_quali.lists;//资格
-				 
-				if(typeof practice[0]=='undefined' ||typeof practice[1]=='undefined'){
-					uni.showToast({
-						'title':'医师职业证书必填',
-						icon:"none"
-					})
-					return false;
-				}
-				
-				if(typeof card_photo[0]=='undefined' ||typeof card_photo[1]=='undefined'){
-					uni.showToast({
-						'title':'身份证必填',
-						icon:"none"
-					})
-					return false;
-				}
-				if(typeof is_quali[0]=='undefined' ||typeof is_quali[1]=='undefined'){
-					uni.showToast({
-						'title':'资格证必填',
-						icon:"none"
-					})
-					return false;
-				}
-				this.form.certificate = [practice[0].response.data.url,practice[1].response.data.url]
-				this.form.idPhoto = [card_photo[0].response.data.url,card_photo[1].response.data.url]
-				this.form.doctorQualification = [is_quali[0].response.data.url,is_quali[1].response.data.url]
-			 
-		
-				if (typeof this.form.works != 'string') {
-					this.form.works = JSON.stringify(this.form.works);
-				}
+				this.allupload = true
+				//保存之后改变机构信息状态
+				this.mechanismList.map(val => {
+					//判断是不是新增的数据    状态为0
+					if(val.Submit==0){
+						val.Submit = 1;
+					}
+				})
 				
-				// 注意要 {'doctor_name':'ddd',doctor_sex:1....}分开传值因为我方便拦截垃圾数据
-				let res = await this.$request.post('doctor/addthen', this.form);
-				console.log('res...:', res);
-				if (res.status == 0) {
-					uni.switchTab({
-						url: '../index/index'
-					})
-				}
+				// //照片
+				// let practice = [] //证书
+				// let card_photo = [] //身份证
+				// let is_quali = [] //资格
+				// // 通过filter,筛选出上传进度为100的文件(因为某些上传失败的文件,进度值不为100,这个是可选的操作)
+				// // practice = this.$refs.uUpload.lists.filter(val => {
+				// // 	return val.progress == 100;
+				// // })
+				// // card_photo = this.$refs.uUpload.lists.filter(val => {
+				// // 	return val.progress == 100;
+				// // })
+				// // is_quail = this.$refs.uUpload.lists.filter(val => {
+				// // 	return val.progress == 100;
+				// // })
+				// // 如果您不需要进行太多的处理,直接如下即可
+				// practice = this.$refs.Upractice.lists; //证书
+				// card_photo = this.$refs.Ucard_photo.lists; //身份证
+				// is_quali = this.$refs.Uis_quali.lists; //资格
+
+				// if (typeof practice[0] == 'undefined' || typeof practice[1] == 'undefined') {
+				// 	uni.showToast({
+				// 		'title': '医师职业证书必填',
+				// 		icon: "none"
+				// 	})
+				// 	return false;
+				// }
+
+				// if (typeof card_photo[0] == 'undefined' || typeof card_photo[1] == 'undefined') {
+				// 	uni.showToast({
+				// 		'title': '身份证必填',
+				// 		icon: "none"
+				// 	})
+				// 	return false;
+				// }
+				// if (typeof is_quali[0] == 'undefined' || typeof is_quali[1] == 'undefined') {
+				// 	uni.showToast({
+				// 		'title': '资格证必填',
+				// 		icon: "none"
+				// 	})
+				// 	return false;
+				// }
+				// this.form.certificate = [practice[0].response.data.url, practice[1].response.data.url]
+				// this.form.idPhoto = [card_photo[0].response.data.url, card_photo[1].response.data.url]
+				// this.form.doctorQualification = [is_quali[0].response.data.url, is_quali[1].response.data.url]
+
+
+				// if (typeof this.form.works != 'string') {
+				// 	this.form.works = JSON.stringify(this.form.works);
+				// }
+
+				// // 注意要 {'doctor_name':'ddd',doctor_sex:1....}分开传值因为我方便拦截垃圾数据
+				// let res = await this.$request.post('doctor/addthen', this.form);
+				// console.log('res...:', res);
+				// if (res.status == 0) {
+				// 	uni.switchTab({
+				// 		url: '../index/index'
+				// 	})
+				// }
 
 			},
 			ChooseImage() {

+ 653 - 0
pages/old_Scheduling.vue

xqd
@@ -0,0 +1,653 @@
+<template>
+	<view style="width: 100%;height: 100%;">
+		<!-- 历史周选择 -->
+		<u-select v-model="oldshow" :list="oldlist" @confirm="cliold"></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.value}}</view>
+							<view style="text-align: center;">{{item.title}}</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.morning}}</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.afternoon}}</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.night}}</view>
+					</view>
+				</view>
+			</view>
+		</view>
+		<!-- 保存 -->
+		<view class="bottomButton" @click="paiban" v-if="!old">
+			排班设置
+		</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:'',
+				//弹窗
+				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'
+				}],
+				//历史的排班选择
+				oldshow: false,
+				oldlist: [{
+					value: '1',
+					label: '历史'
+				}, {
+					value: '2',
+					label: '历史'
+				}, {
+					value: '3',
+					label: '历史'
+				}, {
+					value: '4',
+					label: '历史'
+				}],
+				//新增一周的数据   title不可更改  value日期   其余 上 下 晚
+				hospitalWeek: [{
+					title: '周一',
+					value: '10-26',
+					hospital: [{
+						name: '早上',
+						checked: true,
+						disabled:true
+					}, {
+						name: '下午',
+						checked: false
+					}, {
+						name: '晚上',
+						checked: false
+					}],
+				}, {
+					title: '周二',
+					value: '10-27',
+					hospital: [{
+						name: '早上',
+						checked: false
+					}, {
+						name: '下午',
+						checked: false
+					}, {
+						name: '晚上',
+						checked: false
+					}],
+				}, {
+					title: '周三',
+					value: '10-28',
+					hospital: [{
+						name: '早上',
+						checked: false
+					}, {
+						name: '下午',
+						checked: false
+					}, {
+						name: '晚上',
+						checked: false
+					}],
+				}, {
+					title: '周四',
+					value: '10-29',
+					hospital: [{
+						name: '早上',
+						checked: false
+					}, {
+						name: '下午',
+						checked: false
+					}, {
+						name: '晚上',
+						checked: false
+					}],
+				}, {
+					title: '周五',
+					value: '10-30',
+					hospital: [{
+						name: '早上',
+						checked: false
+					}, {
+						name: '下午',
+						checked: false
+					}, {
+						name: '晚上',
+						checked: false
+					}],
+				}, {
+					title: '周六',
+					value: '10-31',
+					hospital: [{
+						name: '早上',
+						checked: false
+					}, {
+						name: '下午',
+						checked: false
+					}, {
+						name: '晚上',
+						checked: false
+					}],
+				}, {
+					title: '周日',
+					value: '11-01',
+					hospital: [{
+						name: '早上',
+						checked: false
+					}, {
+						name: '下午',
+						checked: false
+					}, {
+						name: '晚上',
+						checked: false
+					}],
+				}],
+
+				saveList: [{
+					organization_id: '',
+					schedule_date: '',
+					per_time_num: 10,
+					identifi: {
+						'zao': false,
+						'zhong': false,
+						'wan': false
+					}
+				}, {
+					organization_id: '',
+					schedule_date: '',
+					per_time_num: 10,
+					identifi: {
+						'zao': false,
+						'zhong': false,
+						'wan': false
+					}
+				}, {
+					organization_id: '',
+					schedule_date: '',
+					per_time_num: 10,
+					identifi: {
+						'zao': false,
+						'zhong': false,
+						'wan': false
+					}
+				}, {
+					organization_id: '',
+					schedule_date: '',
+					per_time_num: 10,
+					identifi: {
+						'zao': false,
+						'zhong': false,
+						'wan': false
+					}
+				}, {
+					organization_id: '',
+					schedule_date: '',
+					per_time_num: 10,
+					identifi: {
+						'zao': false,
+						'zhong': false,
+						'wan': false
+					}
+				}, {
+					organization_id: '',
+					schedule_date: '',
+					per_time_num: 10,
+					identifi: {
+						'zao': false,
+						'zhong': false,
+						'wan': false
+					}
+
+				}, {
+					organization_id: '',
+					schedule_date: '',
+					per_time_num: 10,
+					identifi: {
+						'zao': false,
+						'zhong': false,
+						'wan': false
+					}
+				}, ],
+
+				//历史记录的数组
+				oldWeek: [],
+				//选择医院
+				hospitalList: [],
+				hospitalshow: false,
+				//当前点击的位置
+				position: {
+					day: '',
+					time: '' //1早2下3晚
+				},
+				//选择排班提醒
+				remind: true,
+				remindshow: false
+			}
+		},
+		methods: {
+			paiban(){
+				uni.navigateTo({
+					url:'Scheduling'
+				})
+			},
+			getOldList: async function() {
+				let res = await this.$request.post("doctor/getLinsList");
+				if (res.status == 0) {
+					if (res.data != null) {
+						let datas = JSON.parse(JSON.stringify(res.data))
+						let lists = []
+						var obj;
+						for (let i = 0; i < datas.length; i++) {
+							obj = {
+								value: datas[i].start_time.id + ' 至 ' + datas[i].end_time.id,
+								label: datas[i].start_time.schedule_date + ' 至 ' + datas[i].end_time.schedule_date,
+							}
+							lists.push(obj)
+						}
+						this.oldlist = lists
+					}
+				}
+			},
+
+			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) {
+				console.log(e)
+				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
+			},
+			//医院选择器的确认点击事件
+			confirmhospital(e) {
+				//保存上一次操作并更换操作的医院
+				console.log(e)
+				this.hospital = e[0].label
+				
+				
+				
+				// let es = JSON.parse(JSON.stringify(e));
+				// var lists;
+				// if (this.position.time == 1) {
+				// 	this.hospitalWeek[this.position.day].morning = es[0].label
+				// 	this.saveList[this.position.day].identifi.zao = es[0].value;
+				// } else if (this.position.time == 2) {
+				// 	this.hospitalWeek[this.position.day].afternoon = es[0].label
+				// 	this.saveList[this.position.day].identifi.zhong = es[0].value;
+				// } else if (this.position.time == 3) {
+				// 	this.hospitalWeek[this.position.day].night = es[0].label
+				// 	this.saveList[this.position.day].identifi.wan = es[0].value
+				// }
+				// this.saveList[this.position.day].organization_id = es[0].value
+				// // this.saveList[this.position.day].schedule_date ='2020-'+this.hospitalWeek[this.position.day].value
+				// this.position.day = '';
+				// this.position.time = '';
+				// this.hospitalshow = false;
+			},
+
+
+			//保存
+			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;
+			},
+
+			Appendzero(obj) {
+				if (obj < 10) return "0" + "" + obj;
+				else return obj;
+			},
+
+			getTemplate: async function() {
+				let that = this;
+				let startTime = '2020-' + that.hospitalWeek[0].value;
+				let endTime = '2020-' + that.hospitalWeek[6].value;
+				let res = await that.$request.post("doctor/getLinsDetail", {
+					'start_date': startTime,
+					'end_date': endTime
+				});
+
+				if (res.status == 0) {
+					this.fixed = res.data.save_flag
+					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].identifi.zao = data[p].type.zao_id ? data[p].type.zao_id : false;
+									this.saveList[i].identifi.zhong = data[p].type.xia_id ? data[p].type.xia_id : false;
+									this.saveList[i].identifi.wan = data[p].type.wan_id ? data[p].type.wan_id : false;
+									this.hospitalWeek[i].morning = data[p].type.zao ? data[p].type.zao : '暂无';
+									this.hospitalWeek[i].afternoon = data[p].type.xia ? data[p].type.xia : '暂无';
+									this.hospitalWeek[i].night = data[p].type.wan ? data[p].type.wan : '暂无';
+								}
+							}
+						}
+
+					} else {
+						for (let i = 0; i < this.hospitalWeek.length; i++) {
+							this.saveList[i].identifi.zao = false;
+							this.saveList[i].identifi.zhong = false;
+							this.saveList[i].identifi.wan = false;
+							this.hospitalWeek[i].morning = '';
+							this.hospitalWeek[i].afternoon = '';
+							this.hospitalWeek[i].night = '';
+						}
+					}
+				}
+
+
+			},
+
+			/**
+			 * 获取医院
+			 */
+			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);
+				//默认选中第一个医院
+				this.hospital = res.data[0].label
+			}
+		},
+		onLoad() {
+			this.getTime();
+			this.gethospitalList();
+			this.getOldList();
+			this.cliold()
+			console.log(this.time)
+		},
+	}
+</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>

+ 31 - 1
pages/zixun/xiangqing.vue

xqd xqd
@@ -73,7 +73,7 @@
 				<view class="nr" v-if="zl ==2">
 					<view class="left">图片:</view>
 					<view class="right" v-for="(item,index) in potolList" :key="index" style="width: auto;">
-						<image style="width: 124rpx;height: 124rpx;margin-right: 10rpx;" :src="item"></image>
+						<image style="width: 124rpx;height: 124rpx;margin-right: 10rpx;" :src="item" @click="TanPreviewImage(item)"></image>
 					</view>
 				</view>
 			</view>
@@ -285,6 +285,36 @@
 			}
 		},
 		methods: {
+			//图片预览
+			 TanPreviewImage(imageUrl){ 
+			        console.log(imageUrl) // http://192.168.100.251:8970/6_1597822634094.png
+			        var images = [];
+			        images.push(imageUrl);
+			        console.log(images)  // ["http://192.168.100.251:8970/6_1597822634094.png"]
+			        uni.previewImage({ // 预览图片  图片路径必须是一个数组 => ["http://192.168.100.251:8970/6_1597822634094.png"]
+			            current:0,
+			            urls:images,
+			            longPressActions: {  //长按保存图片到相册
+			                itemList: ['保存图片'],
+			                success: (data)=> {
+			                    console.log(data);
+			                    uni.saveImageToPhotosAlbum({ //保存图片到相册
+			                        filePath: payUrl,
+			                        success: function () {
+			                            uni.showToast({icon:'success',title:'保存成功'})
+			                        },
+			                        fail: (err) => {
+			                            uni.showToast({icon:'none',title:'保存失败,请重新尝试'})
+			                        }
+			                    });
+			                },
+			                fail: (err)=> {
+			                    console.log(err.errMsg);
+			                }
+			        }
+			        });
+			    },
+			//
 			phone:async function(){
 				let res = await this.$request.post("patient/callPhones",{'patient_id':this.patient_id,'user_id':this.user_id});
 				if(res.status==0){