Sfoglia il codice sorgente

提交新需求皆苦

liuyuanhang 4 anni fa
parent
commit
b79ed8c178
3 ha cambiato i file con 285 aggiunte e 101 eliminazioni
  1. 225 94
      pages/Scheduling.vue
  2. 1 1
      pages/index/index.vue
  3. 59 6
      pages/login/doctorRenzheng.vue

+ 225 - 94
pages/Scheduling.vue

xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd
@@ -48,7 +48,7 @@
 					<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>
+							 :disabled="hitem.disabled" @change="horg(index,hindex)"></u-checkbox>
 						</view>
 					</u-checkbox-group>
 				</view>
@@ -58,6 +58,7 @@
 		<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>
@@ -68,6 +69,7 @@
 			return {
 				//标题上显示的医院。也就是当前选中医院
 				hospital:'',
+				hosptialId:'',
 				//弹窗
 				modalShow: false,
 				//切换历史和新增
@@ -89,32 +91,23 @@
 				}],
 				//历史的排班选择
 				oldshow: false,
-				oldlist: [{
-					value: '1',
-					label: '历史'
-				}, {
-					value: '2',
-					label: '历史'
-				}, {
-					value: '3',
-					label: '历史'
-				}, {
-					value: '4',
-					label: '历史'
-				}],
+				oldlist: [],
 				//新增一周的数据   title不可更改  value日期   其余 上 下 晚
 				hospitalWeek: [{
 					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
 					}],
 				}, {
@@ -122,12 +115,15 @@
 					value: '10-27',
 					hospital: [{
 						name: '早上',
+						organization_id:0,
 						checked: false
 					}, {
 						name: '下午',
+						organization_id:0,
 						checked: false
 					}, {
 						name: '晚上',
+						organization_id:0,
 						checked: false
 					}],
 				}, {
@@ -135,12 +131,15 @@
 					value: '10-28',
 					hospital: [{
 						name: '早上',
+						organization_id:0,
 						checked: false
 					}, {
 						name: '下午',
+						organization_id:0,
 						checked: false
 					}, {
 						name: '晚上',
+						organization_id:0,
 						checked: false
 					}],
 				}, {
@@ -148,12 +147,15 @@
 					value: '10-29',
 					hospital: [{
 						name: '早上',
+						organization_id:0,
 						checked: false
 					}, {
 						name: '下午',
+						organization_id:0,
 						checked: false
 					}, {
 						name: '晚上',
+						organization_id:0,
 						checked: false
 					}],
 				}, {
@@ -161,12 +163,15 @@
 					value: '10-30',
 					hospital: [{
 						name: '早上',
+						organization_id:0,
 						checked: false
 					}, {
 						name: '下午',
+						organization_id:0,
 						checked: false
 					}, {
 						name: '晚上',
+						organization_id:0,
 						checked: false
 					}],
 				}, {
@@ -174,12 +179,15 @@
 					value: '10-31',
 					hospital: [{
 						name: '早上',
-						checked: false
+						organization_id:0,
+						checked: true
 					}, {
 						name: '下午',
+						organization_id:0,
 						checked: false
 					}, {
 						name: '晚上',
+						organization_id:0,
 						checked: false
 					}],
 				}, {
@@ -187,81 +195,133 @@
 					value: '11-01',
 					hospital: [{
 						name: '早上',
+						organization_id:0,
 						checked: false
 					}, {
 						name: '下午',
+						organization_id:0,
 						checked: false
 					}, {
 						name: '晚上',
+						organization_id:0,
 						checked: false
 					}],
 				}],
 
 				saveList: [{
-					organization_id: '',
-					schedule_date: '',
-					per_time_num: 10,
-					identifi: {
-						'zao': false,
-						'zhong': false,
-						'wan': false
-					}
+					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
+					}],
 				}, {
-					organization_id: '',
-					schedule_date: '',
-					per_time_num: 10,
-					identifi: {
-						'zao': false,
-						'zhong': false,
-						'wan': false
-					}
+					title: '周二',
+					value: '10-27',
+					hospital: [{
+						name: '早上',
+						organization_id:0,
+						checked: false
+					}, {
+						name: '下午',
+						organization_id:0,
+						checked: false
+					}, {
+						name: '晚上',
+						organization_id:0,
+						checked: false
+					}],
 				}, {
-					organization_id: '',
-					schedule_date: '',
-					per_time_num: 10,
-					identifi: {
-						'zao': false,
-						'zhong': false,
-						'wan': false
-					}
+					title: '周三',
+					value: '10-28',
+					hospital: [{
+						name: '早上',
+						organization_id:0,
+						checked: false
+					}, {
+						name: '下午',
+						organization_id:0,
+						checked: false
+					}, {
+						name: '晚上',
+						organization_id:0,
+						checked: false
+					}],
 				}, {
-					organization_id: '',
-					schedule_date: '',
-					per_time_num: 10,
-					identifi: {
-						'zao': false,
-						'zhong': false,
-						'wan': false
-					}
+					title: '周四',
+					value: '10-29',
+					hospital: [{
+						name: '早上',
+						organization_id:0,
+						checked: false
+					}, {
+						name: '下午',
+						organization_id:0,
+						checked: false
+					}, {
+						name: '晚上',
+						organization_id:0,
+						checked: false
+					}],
 				}, {
-					organization_id: '',
-					schedule_date: '',
-					per_time_num: 10,
-					identifi: {
-						'zao': false,
-						'zhong': false,
-						'wan': false
-					}
+					title: '周五',
+					value: '10-30',
+					hospital: [{
+						name: '早上',
+						organization_id:0,
+						checked: false
+					}, {
+						name: '下午',
+						organization_id:0,
+						checked: false
+					}, {
+						name: '晚上',
+						organization_id:0,
+						checked: false
+					}],
 				}, {
-					organization_id: '',
-					schedule_date: '',
-					per_time_num: 10,
-					identifi: {
-						'zao': false,
-						'zhong': false,
-						'wan': false
-					}
-
+					title: '周六',
+					value: '10-31',
+					hospital: [{
+						name: '早上',
+						organization_id:0,
+						checked: true
+					}, {
+						name: '下午',
+						organization_id:0,
+						checked: false
+					}, {
+						name: '晚上',
+						organization_id:0,
+						checked: false
+					}],
 				}, {
-					organization_id: '',
-					schedule_date: '',
-					per_time_num: 10,
-					identifi: {
-						'zao': false,
-						'zhong': false,
-						'wan': false
-					}
-				}, ],
+					title: '周日',
+					value: '11-01',
+					hospital: [{
+						name: '早上',
+						organization_id:0,
+						checked: false
+					}, {
+						name: '下午',
+						organization_id:0,
+						checked: false
+					}, {
+						name: '晚上',
+						organization_id:0,
+						checked: false
+					}],
+				}],
 
 				//历史记录的数组
 				oldWeek: [],
@@ -393,11 +453,28 @@
 				this.position.time = time
 				this.hospitalshow = true
 			},
-			//医院选择器的确认点击事件
-			confirmhospital(e) {
+			
+			/**
+			 * 选择医院逻辑
+			 * @author 刘远航
+			 * @param {Object} e
+			 */
+			confirmhospital:async function(e) {
 				//保存上一次操作并更换操作的医院
-				console.log(e)
+				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;
+							}
+						}
+					}
+				}
+				
 				
 				
 				
@@ -421,7 +498,11 @@
 			},
 
 
-			//保存
+			/**
+			 * 提交方法
+			 * @author Liu Yh
+			 * @param {Object} e
+			 */
 			bc: async function(e) {
 				console.log('hospitalWeek',this.hospitalWeek)
 				let that = this;
@@ -516,11 +597,20 @@
 				// 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() {
 				let that = this;
 				let startTime = '2020-' + that.hospitalWeek[0].value;
@@ -529,34 +619,40 @@
 					'start_date': startTime,
 					'end_date': endTime
 				});
-
+				console.log(res.data);
 				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 : '暂无';
+									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;
 								}
 							}
 						}
 
 					} 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 = '';
+							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;
 						}
 					}
 				}
@@ -564,6 +660,40 @@
 
 			},
 
+			/**
+			 * change事件
+			 * @author Liu Yh
+			 * @param {Object} index
+			 * @param {Object} hindex
+			 */
+			horg(index,hindex){
+				 if(this.hosptialId==''){
+					 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
+			},
 			/**
 			 * 获取医院
 			 */
@@ -576,12 +706,13 @@
 				console.log('我是医院', res);
 				//默认选中第一个医院
 				this.hospital = res.data[0].label
+				this.hosptialId = res.data[0].value
 			}
 		},
 		onLoad() {
+			this.gethospitalList();			
 			this.getTime();
-			this.gethospitalList();
-			this.getOldList();
+			// this.getOldList();
 			this.cliold()
 			console.log(this.time)
 		},

+ 1 - 1
pages/index/index.vue

xqd
@@ -676,7 +676,7 @@
 						}
 					})
 				} else {
-					if (this.docterInfo.is_then != 1) {
+					if (this.docterInfo.is_then != 0) {
 						uni.navigateTo({
 							url: '/pages/login/doctorRenzheng'
 						})

+ 59 - 6
pages/login/doctorRenzheng.vue

xqd xqd xqd xqd xqd xqd
@@ -77,8 +77,8 @@
 				<!-- 删除按钮 -->
 				<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 v-else-if="item.Submit==0" style="color:#EA970E;font-size: 28rpx;">状态:审核中</view>
+				<view v-else-if="item.Submit==1" style="color:#4CAD84;font-size: 28rpx;">状态:已审核</view>
 			</view>
 			<!-- 地区 -->
 			<view style="padding: 25rpx 10rpx;" class="flex align-center justify-around" @click="regionClick(index)">
@@ -122,6 +122,7 @@
 		onLoad() {
 			this.provinceconfirm()
 			this.addmechanism()
+			this.docterInfos();
 		},
 		mounted() {},
 		data() {
@@ -136,12 +137,14 @@
 						{
 							hospital: '', //医院id
 							department: '', //科室id
-							qualifications: '' //资质id
+							qualifications: '' ,//资质id
+							state:0
 						},
 						{
 							hospital: '', //医院id
 							department: '', //科室id
-							qualifications: '' //资质id
+							qualifications: '', //资质id
+							state:0
 						}
 					],
 					certificate: [], //证书
@@ -263,6 +266,54 @@
 		methods: {
 			/*****************view点击**********************/
 			//省市区选择器打开
+			
+			docterInfos:async function(){
+				let res = await this.$request.post("doctor/getRenInfo");
+				if(res.status==0){
+					if(res.data!=undefined || res.data!="undefined"){
+						if(res.data.info.length!=undefined || res.data.info.length!='undefined'){
+							this.form.name = res.data.info.name;
+							this.form.sex = res.data.info.sex==1?'男':'女';
+							this.form.ID = res.data.info.card_id; 
+							this.form.certificate = res.data.info.practice.split(',');
+							this.form.idPhoto = res.data.info.card_photo.split(',');
+							this.form.doctorQualification = res.data.info.is_quail.split(',');
+						}
+						
+						if(res.data.orgList.length!=0){
+							let orglist = res.data.orgList;
+							let oqflist = res.data.oqf;
+							// {
+							// 	hospital: '', //医院id
+							// 	department: '', //科室id
+							// 	qualifications: '' //资质id
+							// },
+							this.mechanismList.length=0;
+							this.form.works.length=0;
+							for(let i=0;i<orglist.length;i++){
+								// 获取到修改中数据
+								this.form.works.push({
+									hospital: orglist[i].organization.id, //医院id
+									department: oqflist[i].office.id, //科室id
+									qualifications: oqflist[i].qualification.id, //资质id
+									state:orglist[i].state,
+								})
+								
+								// 渲染页面数据
+								this.mechanismList.push({
+									title: '工作机构' + this.convertToChinese(this.mechanismList.length + 1), //工作机构名称
+									regionText: orglist[i].province +'-' + orglist[i].city +'-'+orglist[i].area, //地区信息文字
+									hospitalText: orglist[i].name +'-'+oqflist[i].office.name+'-'+oqflist[i].qualification.name, //机构信息文字
+									preservation: true, //是否已经保存
+									Submit: orglist[i].state, // 0=审核中,1=审核通过,2=审核拒绝 信息状态 0未提交 1审核中 2审核通过 3审核不通过
+								})
+							}
+						}
+						
+						
+					}
+				}
+			},
 			regionClick(index) {
 				if (this.mechanismList.length - 1 == index) {
 					this.regionShow = true
@@ -276,6 +327,7 @@
 			},
 			//机构选择器打开
 			hospitalClick(index) {
+				console.log(index);
 				if(this.mechanismList.length - 1 == index){
 					if (this.mechanismList[index].regionText!='') {
 					this.hospitalShow = true
@@ -360,8 +412,9 @@
 				let res = await this.$request.post('doctor/getCityList', {
 					'type': 1
 				});
-				console.log('省', res.data)
-				this.provincelist = this.provincelist2 = res.data
+				// console.log('省', res.data)
+				// this.provincelist = this.provincelist2 = res.data
+				this.regionlist = res.data
 			},
 			//市
 			cityconfirm: async function(e) {