| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208 | <template>	<view class="content">		<view class="inner">			<view  v-for="(item,index) in patient" :key="index" @click.stop="selectPatient(item)" class="peop-item">				<view class="info" >					<view class="name">{{item.patientName}}</view>					<view class="detail">						<text class="text" v-if="item.sex==1">男</text>						<text class="text" v-if="item.sex==2">女</text>						<text class="text">{{$getAge(item.birthday)}}岁</text>						<text class="text">{{$parseIdCard(item.idCard)}}</text>					</view>				</view>				<view class="operat-box">					<image src="../../static/images/del.png" mode="" @click.stop="delPatient(item)" ></image>					<image src="../../static/images/edit.png" mode="" @click.stop="editPatient(item)"></image>				</view>			</view>			<view v-if="patient.length == 0" class="no-data-box" @click="getPatientList()">				<image src="https://cos.his.cdwjyyh.com/fs/20240423/cf4a86b913a04341bb44e34bb4d37aa2.png" mode="aspectFit"></image>				<view class="empty-title">暂无数据</view>			</view>		</view>		<view class="btn-box">			<view class="sub-btn" @click="addPatient">创建就诊人</view>		</view>	</view></template><script>	import {getPatientList,delPatient} from '@/api/patient'	export default {		data() {			return {				patient:[],			}		},		onLoad() {			this.getPatientList()			uni.$on('refreshPatient', () => {				this.getPatientList()			})		},		methods: {			selectPatient(item){				uni.$emit('refreshOrderPatient',item);				uni.navigateBack({			  		delta: 1				})			},			editPatient(item){				uni.navigateTo({					url: './addEditPatient?type=edit&patientId='+item.patientId				})			},			delPatient(item){				uni.showModal({					title:"提示",					content:"确认删除吗?",					showCancel:true,					cancelText:'取消',					confirmText:'确定',					success:res=>{						if(res.confirm){							// 用户点击确定							var data={patientId:item.patientId}							delPatient(data).then(								res => {									if(res.code==200){										 uni.showToast({										 	icon:'success',										 	title: "操作成功",										 });										 this.getPatientList()									}else{										uni.showToast({											icon:'none',											title: "请求失败",										});									}								},								rej => {}							);																				}else{							// 否则点击了取消  						}					}				})			},			getPatientList(){				// uni.showLoading({				// 	title:"正在加载中"				// })				getPatientList().then(					res => {						uni.hideLoading()						if(res.code==200){							this.patient=res.data;						}else{							uni.showToast({								icon:'none',								title: "请求失败",							});						}					},					rej => {}				);			},			addPatient() {				uni.navigateTo({					url: './addEditPatient?type=add'				})			}			 		}	}</script><style lang="scss">	page{		height: 100%;	}	.content{		height: 100%;		display: flex;		flex-direction: column;		justify-content: space-between;		.inner{			flex: 1;			padding: 20upx 20upx 160upx;			.peop-item{				box-sizing: border-box;				height: 184upx;				background: #FFFFFF;				border-radius: 16upx;				padding: 50upx 40upx 50upx 30upx;				display: flex;				align-items: center;				justify-content: space-between;				margin-bottom: 20upx;				.info{					.name{						font-size: 30upx;						font-family: PingFang SC;						font-weight: bold;						color: #111111;						line-height: 1;					}					.detail{						display: flex;						align-items: center;						margin-top: 30upx;						.text{							font-size: 26upx;							font-family: PingFang SC;							font-weight: 500;							color: #999999;							line-height: 1;							margin-right: 30upx;							&:last-child{								margin-right: 0;							}						}					}				}				.operat-box{					display: flex;					align-items: center;					image{						padding: 15rpx;						width: 30upx;						height: 30upx;						margin-left: 10upx;						&:first-child{							margin-left: 0;						}					}				}			}		}		.btn-box{			z-index: 9999;			width: 100%;			padding: 30upx;			position: fixed;			bottom: 0;			left: 0;			box-sizing: border-box;			background: #FFFFFF;				 			.sub-btn{				width: 100%;				height: 88upx;				line-height: 88upx;				text-align: center;				font-size: 30upx;				font-family: PingFang SC;				font-weight: bold;				color: #FFFFFF;				background: #C39A58;				border-radius: 44upx;			}		}		 	}</style>
 |