Procházet zdrojové kódy

完成医生端-就诊、报告

高大威猛 před 8 měsíci
rodič
revize
f26a37a6ff

+ 42 - 0
app/pages.json

@@ -207,6 +207,48 @@
 			{
 				"navigationBarTitleText" : "公告详情"
 			}
+		},
+		{
+			"path" : "pages/visit/doctor/selectUser",
+			"style" : 
+			{
+				"navigationBarTitleText" : "选择患者"
+			}
+		},
+		{
+			"path" : "pages/visit/doctor/list",
+			"style" : 
+			{
+				"navigationBarTitleText" : "就诊记录"
+			}
+		},
+		{
+			"path" : "pages/visit/doctor/detail",
+			"style" : 
+			{
+				"navigationBarTitleText" : "就诊详情"
+			}
+		},
+		{
+			"path" : "pages/detection/doctor/selectUser",
+			"style" : 
+			{
+				"navigationBarTitleText" : "选择患者"
+			}
+		},
+		{
+			"path" : "pages/detection/doctor/list",
+			"style" : 
+			{
+				"navigationBarTitleText" : "检测报告"
+			}
+		},
+		{
+			"path" : "pages/detection/doctor/detail",
+			"style" : 
+			{
+				"navigationBarTitleText" : "检测报告详情"
+			}
 		}
 	],
 	"tabBar": {

+ 95 - 0
app/pages/detection/doctor/detail.vue

@@ -0,0 +1,95 @@
+<template>
+	<view class="main">
+		<view class="content">
+			<view class="info">
+				<view class="title">{{item.medTechProName}}</view>
+				<view class="p5">报告编号:&nbsp;{{item.reportNo}}</view>
+				<view class="p5">就 诊 人:&nbsp;{{item.patientName}}</view>
+				<view class="p5">就诊卡号:&nbsp;{{item.cardId}}</view>
+				<view class="p5">申请科室:&nbsp;{{item.inspectionDepartmentName}}</view>
+				<view class="p5">申请医生:&nbsp;{{item.applyDoctorName}}</view>
+				<view class="p5">采集时间:&nbsp;{{item.sampleReceivedDate}}</view>
+				<view class="p5" style="padding-bottom: 10px;">报告时间:&nbsp;{{item.reportDate}}</view>
+			</view>
+			<view class="flex" style="font-weight: bold;font-size: 16px;margin: 10px 0;">
+				<view class="f">项目</view>
+				<view class="f">检查结果</view>
+				<view class="f">提示</view>
+				<view class="f">单位</view>
+				<view class="f">参考范围</view>
+			</view>
+			<view class="flex" v-for="(i,index) in list" style="font-size: 12px;margin: 10px 0;">
+				<view class="f">{{i.mecTechObsName}}</view>
+				<view class="f">{{i.obsProjectDetail}}</view>
+				<view class="f">
+					<text class="icon arrow" style="color: red;" v-if="i.sign == '1'">&#xe65d;</text>
+					<text class="icon arrow" style="color: red;" v-else-if="i.sign == '2'">&#xe65e;</text>
+					<text v-else></text>
+				</view>
+				<view class="f">{{i.unitCode}}</view>
+				<view class="f">{{i.result}}</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				item: {},
+				list:[],
+			}
+		},
+		onLoad(e) {
+			this.getData(e)
+		},
+		methods: {
+			getData(e){
+				console.log(e);
+				this.http.request({
+					url: '/work/result/getResults/' + e.id,
+					loading: 'true',
+					success: (res) => {
+						this.list = res.data.data
+					}
+				});
+				this.http.request({
+					url: '/work/report/getReportByObrId/'+ e.orcId,
+					loading: 'true',
+					success: (res) => {
+						this.item = res.data.data
+						this.item.patientName = e.patientName
+						this.item.sampleReceivedDate = e.sampleReceivedDate
+						this.item.reportDate = e.reportDate
+					}
+				});
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	.content {
+		padding: 15px;
+		background-color: white;
+		border-radius: 8px;
+
+		.info {
+			border-bottom: 1px solid $line;
+			font-size: 12px;
+			padding-bottom: 10px;
+
+			.title {
+				font-weight: bold;
+				font-size: 16px;
+				padding-bottom: 5px;
+			}
+		}
+
+	}
+
+	.p5 {
+		padding: 5px 0;
+	}
+</style>

+ 208 - 0
app/pages/detection/doctor/list.vue

@@ -0,0 +1,208 @@
+<template>
+	<view class="main">
+		<view class="top">
+			<view class="nameBox">
+				<view class="name">{{patientName}}</view>
+				<text class="icon arrow" style="margin-left: 10px;">&#xeb73;</text>
+				<view class="change" @click="go('/pages/detection/doctor/selectUser')">切换就诊人</view>
+			</view>
+			<view class="cardNum">{{cardId}}</view>
+			<view style="display: flex;text-align: center;margin: 5px;padding: 13px;font-size: 13px;"
+				@click="calendar = true">
+				<input placeholder="点击选择时间" :disabled="true" v-model="startTime" type="select" />
+				<view>至</view>
+				<input placeholder="点击选择时间" :disabled="true" v-model="endTime" type="select" />
+			</view>
+
+		</view>
+
+		<view class="tab">
+			<u-tabs :list="tab" :current="current" keyName="label" @click="click"></u-tabs>
+		</view>
+		<view class="content">
+			<view class="list">
+				<view class="item" v-for="(item, index) in list" @click="go(`/pages/detection/doctor/detail?orcId=${item.orcId}&patientName=${patientName}&id=${item.id}&reportDate=${item.reportDate}&sampleReceivedDate=${item.sampleReceivedDate}`)">
+					<view class="title omit">{{ item.medTechProName }}</view>
+					<view class="time">{{ item.reportCompleteTime }}</view>
+				</view>
+			</view>
+			<view class="loading" v-if="loadMore"><u-loadmore :status="loadMore ? 'loading' : 'nomore'" /></view>
+			<u-empty v-if="!loadMore && list.length == 0"></u-empty>
+		</view>
+		<u-calendar :show="calendar" monthNum="120" mode="range" :maxDate="util.getDate()" minDate="2020-01-01"
+			@confirm="confirm" @close="close()" :closeOnClickOverlay="true"></u-calendar>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				userList: [],
+				current: 0,
+				time: null,
+				tab: [{
+					label: '就诊记录'
+				}, ],
+				startTime: null,
+				endTime: null,
+				list: [],
+				param: {
+				
+				},
+				loadMore: true,
+				calendar: false,
+				user:{},
+				patId:null,
+				patientName:null,
+			}
+		},
+		onLoad(e) {
+			console.log(e);
+			this.setDefTime()
+			this.patId = e.patId
+			this.patientName = e.patientName
+			this.cardId = e.cardId
+			this.getData();
+		},
+		methods: {
+			setDefTime() {
+				const today = new Date();
+				const todayYear = today.getFullYear()
+				const todayMonth = (today.getMonth() + 1) < 10 ? "0" + (today.getMonth() + 1) : (today.getMonth() + 1)
+				const todayDay = today.getDate() < 10 ? "0" + today.getDate() : today.getDate()
+				this.param.endTime = todayYear + todayMonth + todayDay
+				this.endTime = todayYear + '-' + todayMonth + '-' + todayDay
+
+				let beforeTime = new Date(today.getTime() - 24 * 60 * 60 * 1000 * 30);
+				//一个月前
+				let beforeTimeYear = beforeTime.getFullYear();
+				let beforeTimeMonth = beforeTime.getMonth() + 1;
+				let beforeTimeDay = beforeTime.getDate();
+				beforeTimeMonth = beforeTimeMonth < 10 ? "0" + beforeTimeMonth : beforeTimeMonth;
+				beforeTimeDay = beforeTimeDay < 10 ? "0" + beforeTimeDay : beforeTimeDay;
+				this.param.startTime = beforeTimeYear + beforeTimeMonth + beforeTimeDay
+				this.startTime = beforeTimeYear + "-" + beforeTimeMonth + "-" + beforeTimeDay
+
+			},
+			confirm(e) {
+				this.calendar = false;
+				this.param.startTime = e[0].replace(/-/g, '');;
+				this.param.endTime = e[e.length - 1].replace(/-/g, '');;
+				this.startTime = e[0]
+				this.endTime = e[e.length - 1]
+				this.refresh();
+			},
+			close() {
+				this.calendar = false;
+			},
+			getData() {
+				this.http.request({
+					url: '/work/request/patid/' + this.patId,
+					data:this.param,
+					success: (res) => {
+						this.list = res.data.rows
+						this.loadMore = false
+						//暂时没有分页
+						// this.loadMore = res.data.pages > this.param.pageNum ? true : false;
+						// this.list.push(...res.data.rows);
+					}
+				});
+			},
+			click(e) {
+				this.current = e.index;
+				this.param.type = e.dictValue;
+				this.refresh();
+			},
+			selectTime(e) {
+				console.log(e);
+			},
+			go(url) {
+				uni.navigateTo({
+					url: url
+				});
+			},
+			//刷新数据
+			refresh() {
+				this.loadMore = true;
+				// this.param.pageNum = 1;
+				this.list = [];
+				this.getData();
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	.top {
+		padding: 15px;
+		background-color: white;
+		border-radius: 8px;
+
+		.nameBox {
+			display: flex;
+			align-items: center;
+
+			.name {
+				font-weight: bold;
+				font-size: 16px;
+			}
+
+			.change {
+				color: royalblue;
+				margin-left: 20px;
+			}
+		}
+
+		.cardNum {
+			padding-top: 10px;
+			font-size: 14px;
+		}
+	}
+
+	.content {
+		padding: 15px;
+		background-color: white;
+		border-radius: 8px;
+
+		.list {
+			.item {
+				overflow: hidden;
+				padding: 13px 0;
+				border-bottom: 1px solid $line;
+				margin-bottom: 10px;
+
+				.title {
+					font-size: 18px;
+					font-weight: bold;
+				}
+
+				.time {
+					font-size: 14px;
+					padding-top: 15px;
+					color: $font-c;
+				}
+			}
+		}
+	}
+
+	.userChangeTitle {
+		display: flex;
+		justify-content: center;
+		align-items: center;
+		height: 48px;
+		font-weight: bold;
+	}
+
+	.userChangeItem {
+		width: 100%;
+
+		.userChangeItemName {
+			padding: 5px 10px;
+		}
+
+		.userChangeCartNo {
+			padding: 5px 10px;
+		}
+	}
+</style>

+ 104 - 0
app/pages/detection/doctor/selectUser.vue

@@ -0,0 +1,104 @@
+<template>
+	<view class="main">
+		<view style="padding: 15px 0;">
+			<u-search placeholder="患者姓名" v-model="param.patientName" bgColor="white" :showAction="false" @search="refresh()" @clear="(param.patientName = ''), refresh()"></u-search>
+		</view>
+		<view class="list">
+			<view class="item" v-for="(item, index) in list" :key="index" @click="go('/pages/detection/doctor/list?cardId='+item.cardId+'&patId=' + item.patId+'&patientName='+ item.name)">
+				<view class="title omit">
+					<text>{{ item.name }}</text>
+						<text class="check">({{ item.cardId }})</text>
+				</view>
+			</view>
+			<u-empty v-if="list.length == 0" text="暂无患者"></u-empty>
+		</view>
+	</view>
+</template>
+
+<script>
+export default {
+	data() {
+		return {
+			list: [],
+			param:{
+				pageNum:1,
+				pageSize:20,
+			},
+			loadMore: true
+		};
+	},
+	onLoad(e) {
+		this.getData();
+		uni.$on('bind', (res) => {
+			this.getData();
+		});
+	},
+	methods: {
+		getData() {
+			this.http.request({
+				url: '/system/user/deptTree',
+				success: (res) => {
+					console.log(res);
+					this.param.departmentName = res.data.data[0].label
+					this.http.request({
+						url: '/work/visit/patientCard',
+						data: this.param,
+						success: (res) => {
+							this.loadMore = res.data.pages > this.param.pageNum ? true : false;
+							res.data.rows.forEach((item) => {
+								this.list.push(item);
+							});
+						}
+					});
+				}
+			});
+		},
+		go(url) {
+			uni.navigateTo({ url: url });
+		},
+		//刷新数据
+		refresh() {
+			this.loadMore = true;
+			this.param.pageNum = 1;
+			this.list = [];
+			this.getData();
+		},
+		
+	},
+	//上拉加载
+	onReachBottom() {
+		if (this.loadMore) {
+			this.param.pageNum++;
+			this.getData();
+		}
+	}
+};
+</script>
+
+<style lang="scss">
+.list {
+	background-color: white;
+	border-radius: 10px;
+	.item {
+		padding: 16px 12px 16px 12px;
+		border-bottom: 1px solid $line;
+		overflow: hidden;
+		.title {
+			font-size: 15px;
+			font-weight: bold;
+			.check {
+				color: #737373;
+				font-size: 13px;
+				font-weight: normal;
+				padding-left: 5px;
+			}
+		}
+		.del {
+			color: #f44336;
+			float: right;
+			margin-top: -20px;
+			font-size: 20px;
+		}
+	}
+}
+</style>

+ 33 - 26
app/pages/detection/index.vue

@@ -2,11 +2,11 @@
 	<view class="main">
 		<view class="top">
 			<view class="nameBox">
-				<view class="name">{{param.patientName}}</view>
+				<view class="name">{{ user.patientName ? user.patientName : '还未绑定就诊人' }}</view>
 				<text class="icon arrow" style="margin-left: 10px;">&#xeb73;</text>
 				<view class="change" @click="showChange = true">切换就诊人</view>
 			</view>
-			<view class="cardNum">{{param.patientId}}</view>
+			<view class="cardNum">{{param.patientName ? user.patientId : '还未绑定就诊人'}}</view>
 			<view style="display: flex;text-align: center;margin: 5px;padding: 13px;font-size: 13px;"
 				@click="calendar = true">
 				<input placeholder="点击选择时间" :disabled="true" v-model="startTime" type="select" />
@@ -21,7 +21,8 @@
 		</view>
 		<view class="content">
 			<view class="list">
-				<view class="item" v-for="(item, index) in list" @click="go(`/pages/detection/detail?id=${item.id}&orcId=${item.orcId}&patientName=${param.patientName}&patientId=${param.patientId}&reportCompleteTime=${item.reportCompleteTime}&sampleReceivedDate=${item.sampleReceivedDate}`)">
+				<view class="item" v-for="(item, index) in list"
+					@click="go(`/pages/detection/detail?id=${item.id}&orcId=${item.orcId}&patientName=${param.patientName}&patientId=${param.patientId}&reportCompleteTime=${item.reportCompleteTime}&sampleReceivedDate=${item.sampleReceivedDate}`)">
 					<view class="title omit">{{ item.medTechProName }}</view>
 					<view class="time">{{ item.dischargeTime }}</view>
 				</view>
@@ -35,15 +36,15 @@
 			<view>
 				<view class="userChangeTitle">请选择就诊人</view>
 				<scroll-view scroll-y="true" class="scroll-Y" style="height: 300px;">
-						<u-radio-group v-model="param.patientId" iconPlacement="left" placement="column">
-							<u-radio v-for="(item,index) in userList" :name="item.patientId"  @change="groupChange(item)"
-								:customStyle="{ backgroundColor: '#F8F8F8', margin:'5px 20px',borderRadius: '10px',padding: '10px'}">
-								<view class="userChangeItem" @click="groupChange(item)">
-									<view class="userChangeItemName">{{ item.patientName }}</view>
-									<view class="userChangeCartNo">{{ item.patientId }}</view>
-								</view>
-							</u-radio>
-						</u-radio-group>
+					<u-radio-group v-model="param.patientId" iconPlacement="left" placement="column">
+						<u-radio v-for="(item,index) in userList" :name="item.patientId" @change="groupChange(item)"
+							:customStyle="{ backgroundColor: '#F8F8F8', margin:'5px 20px',borderRadius: '10px',padding: '10px'}">
+							<view class="userChangeItem" @click="groupChange(item)">
+								<view class="userChangeItemName">{{ item.patientName }}</view>
+								<view class="userChangeCartNo">{{ item.patientId }}</view>
+							</view>
+						</u-radio>
+					</u-radio-group>
 				</scroll-view>
 			</view>
 		</u-popup>
@@ -68,19 +69,20 @@
 				param: {
 					// pageNum: 1,
 					// pageSize: 10,
-					patientId:'',
-					patientName:'',
+					patientId: '',
+					patientName: '',
 				},
 				loadMore: true,
 				calendar: false,
-				user:{},
+				user: {},
+				userInfo: {},
 			}
 		},
 		onLoad() {
 			this.setDefTime()
+			this.user = this.getUser();
 			this.getUserList();
 			this.getUserInfo()
-			
 		},
 		methods: {
 			getUserInfo() {
@@ -158,16 +160,21 @@
 				this.calendar = false;
 			},
 			getData() {
-				this.http.request({
-					url: '/app/obrRequest/' + this.param.patientId,
-					data:this.param,
-					success: (res) => {
-						this.list = res.data.data
-						this.loadMore = false
-						// this.loadMore = res.data.pages > this.param.pageNum ? true : false;
-						// this.list.push(...res.data.rows);
-					}
-				});
+				//判断是否有绑定患者
+				if (this.param.patientName) {
+					this.http.request({
+						url: '/app/obrRequest/' + this.param.patientId,
+						data: this.param,
+						success: (res) => {
+							this.list = res.data.data
+							this.loadMore = false
+							// this.loadMore = res.data.pages > this.param.pageNum ? true : false;
+							// this.list.push(...res.data.rows);
+						}
+					});
+				} else {
+					this.loadMore = false
+				}
 			},
 			click(e) {
 				this.current = e.index;

+ 1 - 1
app/pages/user/index.vue

@@ -44,7 +44,7 @@
 					<text class="title">就诊记录</text>
 					<text class="icon arrow">&#xe62b;</text>
 				</view>
-				<view class="s_item" @click="go('/pages/detection/index')">
+				<view class="s_item" @click="go('/pages/detection/doctor/selectUser')">
 					<text class="icon ic" style="color: #ff9800">&#xe63a;</text>
 					<text class="title">检测报告</text>
 					<text class="icon arrow">&#xe62b;</text>

+ 4 - 22
app/pages/visit/detail.vue

@@ -4,13 +4,13 @@
 			<view class="nameBox">
 				<view class="name">{{patientName}}</view>
 			</view>
-			<view class="cardNum">{{patientId}}</view>
+			<view class="cardNum">{{cardId}}</view>
 			<view class="list">
 				<view class="item" v-for="(item, index) in item">
 					<view class="topTitle">{{ titleType(item.diagnosticType) }}</view>
 					<view class="title">{{ item.diagnosticName }}</view>
 					<view class="botBox">
-						<view class="time">诊断时间: 20130529145258 </view>
+						<view class="time">诊断时间: {{item.diagnosisTime}} </view>
 						<view class="type">{{ diaCode(item.diagnosticCategoryCode) }}</view>
 					</view>
 				</view>
@@ -25,31 +25,13 @@
 			return {
 				item: [],
 				patientName:'',
-				patientId:'',
+				cardId:'',
 			}
 		},
 		onLoad(e) {
 			console.log(e);
 			this.patientName = e.patientName
-			this.patientId = e.patientId
-			// this.item = [
-			// 	{
-			// 		topTile:'主要诊断:',
-			// 		title:'慢性支气管炎急性发作',
-			// 		time:'20130529145258',
-			// 		type:'门诊诊断'
-			// 	},{
-			// 		topTile:'第一辅诊:',
-			// 		title:'树枝状角膜炎',
-			// 		time:'20130529145258',
-			// 		type:'入院诊断'
-			// 	},{
-			// 		topTile:'第二辅诊:',
-			// 		title:'脑梗死',
-			// 		time:'20130529145258',
-			// 		type:'出院诊断'
-			// 	},
-			// ]
+			this.cardId = e.cardId
 			this.http.request({
 				url: '/app/diagnosis/' + e.id,
 				loading: 'true',

+ 176 - 0
app/pages/visit/doctor/detail.vue

@@ -0,0 +1,176 @@
+<template>
+	<view class="main">
+		<view class="content">
+			<view class="nameBox">
+				<view class="name">{{patientName}}</view>
+			</view>
+			<view class="cardNum">{{patId}}</view>
+			<view class="list">
+				<view class="item" v-for="(item, index) in item">
+					<view class="topTitle">{{ titleType(item.diagnosticType) }}</view>
+					<view class="title">{{ item.diagnosticName }}</view>
+					<view class="botBox">
+						<view class="time">诊断时间: {{item.diagnosisTime}} </view>
+						<view class="type">{{ diaCode(item.diagnosticCategoryCode) }}</view>
+					</view>
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				item: [],
+				patientName:'',
+				patId:'',
+			}
+		},
+		onLoad(e) {
+			console.log(e);
+			this.patId = e.patId
+			this.patientName = e.patientName
+			this.http.request({
+				url: '/work/diagnosis/list?visitId=' + e.id,
+				loading: 'true',
+				success: (res) => {
+					console.log(res);
+					this.item = res.data.rows
+				}
+			});
+		},
+		methods: {
+			titleType(type) {
+				// 诊断类型代码:
+				// 0-主要诊断
+				// 1-第一辅诊
+				// 2-第二辅诊
+				switch (type) {
+					case '0':
+						return "主要诊断:"
+						break;
+					case '1':
+						return "第一辅诊:"
+						break;
+					case '2':
+						return "第二辅诊:"
+						break;
+				}
+			},
+			diaCode(code) {
+				// 诊断类别代码:
+				// 0-门诊诊断
+				// 1-入院诊断
+				// 2-出院诊断
+				// 3-中医入院诊断
+				// 4-中医出院诊断
+				// 5-修正诊断
+				// 6-最终诊断
+				// 7-初步诊断
+				// 8 目前诊断
+				// 9-术前诊断
+				// 10-术后诊断
+				// 11-产后诊断
+				// 99-其他诊断
+				switch (code) {
+					case '0':
+						return "门诊诊断"
+						break;
+					case '1':
+						return "入院诊断"
+						break;
+					case '2':
+						return "出院诊断"
+						break;
+					case '3':
+						return "中医入院诊断"
+						break;
+					case '4':
+						return "中医出院诊断"
+						break;
+					case '5':
+						return "修正诊断"
+						break;
+					case '6':
+						return "最终诊断"
+						break;
+					case '7':
+						return "初步诊断"
+						break;
+					case '8':
+						return "目前诊断"
+						break;
+					case '9':
+						return "术前诊断"
+						break;
+					case '10':
+						return "术后诊断"
+						break;
+					case '11':
+						return "产后诊断"
+						break;
+					case '99':
+						return "其他诊断"
+						break;
+				}
+			},
+		}
+	}
+</script>
+
+<style lang="scss">
+	.content {
+		padding: 15px;
+		background-color: white;
+		border-radius: 8px;
+
+		.nameBox {
+			display: flex;
+			align-items: center;
+
+			.name {
+				font-weight: bold;
+				font-size: 16px;
+			}
+		}
+
+		.cardNum {
+			padding-top: 10px;
+			font-size: 14px;
+		}
+
+		.list {
+			.item {
+				overflow: hidden;
+				padding: 13px 0;
+				border-bottom: 1px solid $line;
+				margin-bottom: 10px;
+				
+				.topTitle{
+					font-size: 18px;
+					font-weight: bold;
+				}
+
+				.title {
+					font-size: 24px;
+					font-weight: bold;
+				}
+
+				.botBox {
+					display: flex;
+					justify-content: space-between;
+					align-items: center;
+
+					.time,
+					.type {
+						font-size: 14px;
+						padding-top: 15px;
+						color: $font-c;
+					}
+				}
+			}
+		}
+	}
+</style>

+ 228 - 0
app/pages/visit/doctor/list.vue

@@ -0,0 +1,228 @@
+<template>
+	<view class="main">
+		<view class="top">
+			<view class="nameBox">
+				<view class="name">{{param.patientName}}</view>
+				<text class="icon arrow" style="margin-left: 10px;">&#xeb73;</text>
+				<view class="change" @click="go('/pages/visit/doctor/selectUser')">切换就诊人</view>
+			</view>
+			<view class="cardNum">{{param.cardId}}</view>
+			<view style="display: flex;text-align: center;margin: 5px;padding: 13px;font-size: 13px;"
+				@click="calendar = true">
+				<input placeholder="点击选择时间" :disabled="true" v-model="startTime" type="select" />
+				<view>至</view>
+				<input placeholder="点击选择时间" :disabled="true" v-model="endTime" type="select" />
+			</view>
+
+		</view>
+
+		<view class="tab">
+			<u-tabs :list="tab" :current="current" keyName="label" @click="click"></u-tabs>
+		</view>
+		<view class="content">
+			<view class="list">
+				<view class="item" v-for="(item, index) in list" @click="go(`/pages/visit/doctor/detail?cardId=${param.cardId}&patientName=${param.patientName}&id=${item.id}`)">
+					<view class="title omit">{{ item.department }}</view>
+					<view class="time">{{ item.admissionTime }}</view>
+				</view>
+			</view>
+			<view class="loading" v-if="loadMore"><u-loadmore :status="loadMore ? 'loading' : 'nomore'" /></view>
+			<u-empty v-if="!loadMore && list.length == 0"></u-empty>
+		</view>
+		<u-calendar :show="calendar" monthNum="120" mode="range" :maxDate="util.getDate()" minDate="2020-01-01"
+			@confirm="confirm" @close="close()" :closeOnClickOverlay="true"></u-calendar>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				userList: [],
+				current: 0,
+				time: null,
+				tab: [{
+					label: '就诊记录'
+				}, ],
+				startTime: null,
+				endTime: null,
+				list: [],
+				param: {
+					// pageNum: 1,
+					// pageSize: 10,
+					cardId:null,
+					patientName:null,
+				},
+				loadMore: true,
+				calendar: false,
+				user:{},
+			}
+		},
+		onLoad(e) {
+			console.log(e);
+			this.setDefTime()
+			this.param.cardId = e.cardId
+			this.param.patientName = e.patientName
+			this.getData();
+		},
+		methods: {
+			groupChange(n) {
+				uni.showModal({
+					title: '提示',
+					content: '确定切换就诊人',
+					success: (res) => {
+						if (res.confirm) {
+							this.http.request({
+								url: '/app/user/bind/change/' + n.id,
+								success: (res) => {
+									this.param.patientName = n.patientName
+									this.param.cardId = n.cardId
+									this.closePopup()
+									this.refresh()
+								}
+							});
+						}
+					}
+				});
+			},
+			setDefTime() {
+				const today = new Date();
+				const todayYear = today.getFullYear()
+				const todayMonth = (today.getMonth() + 1) < 10 ? "0" + (today.getMonth() + 1) : (today.getMonth() + 1)
+				const todayDay = today.getDate() < 10 ? "0" + today.getDate() : today.getDate()
+				this.param.endTime = todayYear + todayMonth + todayDay
+				this.endTime = todayYear + '-' + todayMonth + '-' + todayDay
+
+				let beforeTime = new Date(today.getTime() - 24 * 60 * 60 * 1000 * 30);
+				//一个月前
+				let beforeTimeYear = beforeTime.getFullYear();
+				let beforeTimeMonth = beforeTime.getMonth() + 1;
+				let beforeTimeDay = beforeTime.getDate();
+				beforeTimeMonth = beforeTimeMonth < 10 ? "0" + beforeTimeMonth : beforeTimeMonth;
+				beforeTimeDay = beforeTimeDay < 10 ? "0" + beforeTimeDay : beforeTimeDay;
+				this.param.startTime = beforeTimeYear + beforeTimeMonth + beforeTimeDay
+				this.startTime = beforeTimeYear + "-" + beforeTimeMonth + "-" + beforeTimeDay
+
+			},
+			confirm(e) {
+				this.calendar = false;
+				this.param.startTime = e[0].replace(/-/g, '');;
+				this.param.endTime = e[e.length - 1].replace(/-/g, '');;
+				this.startTime = e[0]
+				this.endTime = e[e.length - 1]
+				this.refresh();
+			},
+			close() {
+				this.calendar = false;
+			},
+			getData() {
+				console.log(this.param.cardId);
+				this.http.request({
+					url: '/work/visit/list?cardId=' + this.param.cardId,
+					data:this.param,
+					success: (res) => {
+						this.list = res.data.rows
+						this.loadMore = false
+						//暂时没有分页
+						// this.loadMore = res.data.pages > this.param.pageNum ? true : false;
+						// this.list.push(...res.data.rows);
+					}
+				});
+			},
+			click(e) {
+				this.current = e.index;
+				this.param.type = e.dictValue;
+				this.refresh();
+			},
+			selectTime(e) {
+				console.log(e);
+			},
+			go(url) {
+				uni.navigateTo({
+					url: url
+				});
+			},
+			//刷新数据
+			refresh() {
+				this.loadMore = true;
+				// this.param.pageNum = 1;
+				this.list = [];
+				this.getData();
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	.top {
+		padding: 15px;
+		background-color: white;
+		border-radius: 8px;
+
+		.nameBox {
+			display: flex;
+			align-items: center;
+
+			.name {
+				font-weight: bold;
+				font-size: 16px;
+			}
+
+			.change {
+				color: royalblue;
+				margin-left: 20px;
+			}
+		}
+
+		.cardNum {
+			padding-top: 10px;
+			font-size: 14px;
+		}
+	}
+
+	.content {
+		padding: 15px;
+		background-color: white;
+		border-radius: 8px;
+
+		.list {
+			.item {
+				overflow: hidden;
+				padding: 13px 0;
+				border-bottom: 1px solid $line;
+				margin-bottom: 10px;
+
+				.title {
+					font-size: 18px;
+					font-weight: bold;
+				}
+
+				.time {
+					font-size: 14px;
+					padding-top: 15px;
+					color: $font-c;
+				}
+			}
+		}
+	}
+
+	.userChangeTitle {
+		display: flex;
+		justify-content: center;
+		align-items: center;
+		height: 48px;
+		font-weight: bold;
+	}
+
+	.userChangeItem {
+		width: 100%;
+
+		.userChangeItemName {
+			padding: 5px 10px;
+		}
+
+		.userChangeCartNo {
+			padding: 5px 10px;
+		}
+	}
+</style>

+ 103 - 0
app/pages/visit/doctor/selectUser.vue

@@ -0,0 +1,103 @@
+<template>
+	<view class="main">
+		<view style="padding: 15px 0;">
+			<u-search placeholder="患者姓名" v-model="param.patientName" bgColor="white" :showAction="false" @search="refresh()" @clear="(param.patientName = ''), refresh()"></u-search>
+		</view>
+		<view class="list">
+			<view class="item" v-for="(item, index) in list" :key="index" @click="go('/pages/visit/doctor/list?cardId=' + item.cardId+'&patientName='+ item.name)">
+				<view class="title omit">
+					<text>{{ item.name }}</text>
+						<text class="check">({{ item.cardId }})</text>
+				</view>
+			</view>
+			<u-empty v-if="list.length == 0" text="暂无患者"></u-empty>
+		</view>
+	</view>
+</template>
+
+<script>
+export default {
+	data() {
+		return {
+			list: [],
+			param:{
+				pageNum:1,
+				pageSize:20,
+			},
+			loadMore: true
+		};
+	},
+	onLoad(e) {
+		this.getData();
+		uni.$on('bind', (res) => {
+			this.getData();
+		});
+	},
+	methods: {
+		getData() {
+			this.http.request({
+				url: '/system/user/deptTree',
+				success: (res) => {
+					console.log(res);
+					this.param.departmentName = res.data.data[0].label
+					this.http.request({
+						url: '/work/visit/patientCard',
+						data: this.param,
+						success: (res) => {
+							this.loadMore = res.data.pages > this.param.pageNum ? true : false;
+							res.data.rows.forEach((item) => {
+								this.list.push(item);
+							});
+						}
+					});
+				}
+			});
+		},
+		go(url) {
+			uni.navigateTo({ url: url });
+		},
+		//刷新数据
+		refresh() {
+			this.loadMore = true;
+			this.param.pageNum = 1;
+			this.list = [];
+			this.getData();
+		}
+	},
+	//上拉加载
+	onReachBottom() {
+		if (this.loadMore) {
+			this.param.pageNum++;
+			this.getData();
+		}
+	}
+};
+</script>
+
+<style lang="scss">
+.list {
+	background-color: white;
+	border-radius: 10px;
+	.item {
+		padding: 16px 12px 16px 12px;
+		border-bottom: 1px solid $line;
+		overflow: hidden;
+		.title {
+			font-size: 15px;
+			font-weight: bold;
+			.check {
+				color: #737373;
+				font-size: 13px;
+				font-weight: normal;
+				padding-left: 5px;
+			}
+		}
+		.del {
+			color: #f44336;
+			float: right;
+			margin-top: -20px;
+			font-size: 20px;
+		}
+	}
+}
+</style>