Bladeren bron

feat:新增小程序医生端

lsw 8 maanden geleden
bovenliggende
commit
aab79c861a

+ 1 - 1
app/App.vue

@@ -30,7 +30,7 @@ button::after {
 /**挂载iconfont字体图标*/
 @font-face {
 	font-family: 'iconfont';
-	src: url('https://at.alicdn.com/t/c/font_4620946_xu7r79yyesr.ttf?t=1723535617548') format('truetype');
+	src: url('https://at.alicdn.com/t/c/font_4620946_326zsnqu1yi.ttf?t=1723605976896') format('truetype');
 	/* src: url('~@/static/font/iconfont.ttf') format('truetype'); */
 }
 .icon {

+ 70 - 28
app/common/common.scss

@@ -1,8 +1,9 @@
 .main {
 	padding: 15px;
 	.form {
-		border-radius: 10px;
+		border-radius: 6px;
 		background-color: white;
+		overflow: hidden;
 	}
 }
 .tab {
@@ -32,7 +33,7 @@
 .mt20 {
 	margin-top: 20px !important;
 }
-.pdt0{
+.pdt0 {
 	padding-top: 0px;
 }
 .pl5 {
@@ -252,7 +253,7 @@
 		height: 55px;
 		border-radius: 50%;
 	}
-	.desc{
+	.desc {
 		float: right;
 		padding-top: 5px;
 		width: 72%;
@@ -284,9 +285,10 @@
 	}
 	.more {
 		position: absolute;
-		right: -10px;
+		right: -13px;
 		top: 20px;
 		font-weight: normal;
+		color: $font-c;
 	}
 }
 .detail {
@@ -334,7 +336,7 @@
 .bz {
 	font-size: 12px;
 	color: $font-c;
-	margin-top:7px;
+	margin-top: 7px;
 	.icon {
 		padding-right: 3px;
 	}
@@ -347,29 +349,69 @@
 	}
 }
 .message-bubble-received {
-  background: white;
-  border-radius: 10px;
-  padding: 13px;
-  width: 85%;
-  word-wrap: break-word;
-  position: relative;
-  margin-left: 10px;
-  float: left;
-  clear: both;
-  font-size: 14px;
-  color: #262626;
-  margin-bottom: 15px;
-  &::before {
-    content: '';
-    position: absolute;
-    width: 0;
-    height: 0;
-    border-style: solid;
-    border-width: 0 10px 10px 10px;
-    border-color: transparent transparent white transparent;
-    left: -10px;
-  }
+	background: white;
+	border-radius: 10px;
+	padding: 13px;
+	width: 85%;
+	word-wrap: break-word;
+	position: relative;
+	margin-left: 10px;
+	float: left;
+	clear: both;
+	font-size: 14px;
+	color: #262626;
+	margin-bottom: 15px;
+	&::before {
+		content: '';
+		position: absolute;
+		width: 0;
+		height: 0;
+		border-style: solid;
+		border-width: 0 10px 10px 10px;
+		border-color: transparent transparent white transparent;
+		left: -10px;
+	}
 }
 .ql-editor.ql-blank:before {
 	font-style: normal !important;
-}
+}
+.listv {
+	padding: 5px 12px 5px 10px;
+	background-color: white;
+	margin: 10px;
+	border-radius: 10px;
+	.item {
+		border-radius: 5px;
+		padding: 13px 8px 13px 8px;
+		margin-bottom: 10px;
+		overflow: hidden;
+		border-bottom: 1px solid $line;
+		&:last-child {
+			border: 0px;
+		}
+		.title {
+			font-size: 15px;
+			font-weight: bold;
+			.icon {
+				color: orangered;
+				padding-right: 3px;
+			}
+		}
+		.desc {
+			font-size: 14px;
+			padding-top: 10px;
+			color: $font-c;
+			text {
+				padding-right: 20px;
+			}
+			.state {
+				float: right;
+			}
+			.del {
+				color: red;
+				float: right;
+				padding-right: 0px;
+			}
+		}
+	}
+}

+ 28 - 0
app/pages.json

@@ -158,6 +158,34 @@
 			{
 				"navigationBarTitleText" : "新增知识库"
 			}
+		},
+		{
+			"path" : "pages/follow/doctor/index",
+			"style" : 
+			{
+				"navigationBarTitleText" : "随访记录"
+			}
+		},
+		{
+			"path" : "pages/follow/doctor/remind",
+			"style" : 
+			{
+				"navigationBarTitleText" : "复诊提醒"
+			}
+		},
+		{
+			"path" : "pages/follow/doctor/add",
+			"style" : 
+			{
+				"navigationBarTitleText" : "新增随访"
+			}
+		},
+		{
+			"path" : "pages/follow/doctor/selectUser",
+			"style" : 
+			{
+				"navigationBarTitleText" : "选择患者"
+			}
 		}
 	],
 	"tabBar": {

+ 96 - 0
app/pages/follow/doctor/add.vue

@@ -0,0 +1,96 @@
+<template>
+	<view class="main">
+		<view class="form">
+			<view class="form_group">
+				<view class="lable">所属科室</view>
+				<input v-model="item.title" placeholder="请输入标题" />
+			</view>
+			<view class="form_group">
+				<view class="lable">随访模板</view>
+				<picker :range="templateList" range-key="title" @change="picker($event, 'type')">
+					<input placeholder="请选择" v-model="item.type" :disabled="true" />
+					<view class="icon more">&#xe62b;</view>
+				</picker>
+			</view>
+			<view class="form_group">
+				<view class="lable">随访模板</view>
+				<picker @change="picker($event, 'type')">
+					<input placeholder="请选择" v-model="item.type" :disabled="true" />
+					<view class="icon more">&#xe62b;</view>
+				</picker>
+			</view>
+		</view>
+		<button class="btn" @click="add()">确认</button>
+	</view>
+</template>
+
+<script>
+export default {
+	data() {
+		return {
+			item: { state: 0 },
+			templateList: []
+		};
+	},
+	onLoad(e) {
+		this.getTemplateList();
+		if (e.id) {
+			this.http.request({
+				url: '/work/knowledge/detail/' + e.id,
+				success: (res) => {
+					this.item = res.data.data;
+					this.$refs.editor.setContents();
+					uni.setNavigationBarTitle({ title: '编辑知识库' });
+				}
+			});
+		}
+	},
+	methods: {
+		picker(e, tag) {
+			if (tag == 'type') {
+				this.item.type = this.type[e.detail.value].dictLabel;
+			} else {
+				this.item[tag] = e.detail.value;
+			}
+			this.$forceUpdate();
+		},
+		getTemplateList() {
+			this.http.request({
+				url: '/work/record/template/list',
+				success: (res) => {
+					this.templateList = res.data.data;
+				}
+			});
+		},
+		add() {
+			let rule = [
+				{ name: 'title', checkType: 'notnull', errorMsg: '请输入标题' },
+				{ name: 'type', checkType: 'notnull', errorMsg: '请选择分类' },
+				{ name: 'content', checkType: 'notnull', errorMsg: '请输入内容' }
+			];
+			if (!this.verify.check(this.item, rule)) {
+				uni.showModal({ content: this.verify.error, showCancel: false });
+				return false;
+			}
+			this.http.request({
+				url: this.item.id ? '/work/knowledge/edit' : '/work/knowledge/add',
+				method: 'POST',
+				data: this.item,
+				success: (res) => {
+					uni.showModal({
+						title: '提示',
+						content: '操作成功',
+						showCancel: false,
+						success: (res) => {
+							uni.$emit('knowledge');
+							uni.navigateBack();
+						}
+					});
+				}
+			});
+		}
+	}
+};
+</script>
+
+<style lang="scss"></style>

+ 113 - 0
app/pages/follow/doctor/index.vue

@@ -0,0 +1,113 @@
+<template>
+	<view>
+		<view class="search">
+			<u-search placeholder="搜索患者" v-model="param.patientName" bgColor="white" :showAction="false" @search="refresh()" @clear="(param.patientName = ''), refresh()"></u-search>
+		</view>
+		<view class="listv">
+			<view class="item" v-for="(item, index) in list" :key="index" @click="go('/pages/knowledge/doctor/add?id=' + item.id)">
+				<view class="title omit">
+					<text class="icon" v-if="item.top === 1">&#xe61f;</text>
+					<text>{{ item.templateName }}</text>
+				</view>
+				<view class="desc">
+					<text>{{ item.patientName }}</text>
+					<text>{{ item.createTime }}</text>
+					<text class="del" @click.stop="del(item, index)">删除</text>
+					<text class="icon state" :style="{ color: item.state == 0 ? '#4CAF50' : '#b5b5b5' }">&#xe830;{{ item.state == 0 ? '已回访' : '待回访' }}</text>
+				</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>
+		<view class="mfooter">
+			<button class="btn" @click="go('/pages/follow/doctor/add')">
+				<text class="icon">&#xe8d5;</text>
+				<text>新增</text>
+			</button>
+		</view>
+	</view>
+</template>
+
+<script>
+export default {
+	data() {
+		return {
+			tab: [],
+			current: 0,
+			list: [],
+			param: { pageNum: 1, pageSize: 10, type: 1, orderByColumn: 'k.id', isAsc: 'desc' },
+			loadMore: true
+		};
+	},
+	onLoad(e) {
+		this.getData();
+		uni.$on('knowledge', (res) => {
+			this.refresh();
+		});
+	},
+	methods: {
+		click(e) {
+			this.current = e.index;
+			this.param.type = e.dictValue;
+			this.refresh();
+		},
+		getData() {
+			this.http.request({
+				url: '/work/record/list',
+				data: this.param,
+				loading: 'false',
+				success: (res) => {
+					this.loadMore = res.data.pages > this.param.pageNum ? true : false;
+					res.data.rows.forEach((item) => {
+						item.createTime = uni.$u.timeFrom(Date.parse(item.createTime));
+						this.list.push(item);
+					});
+				}
+			});
+		},
+		del(item, index) {
+			uni.showModal({
+				title: '提示',
+				content: '确定删除该知识?',
+				success: (res) => {
+					if (res.confirm) {
+						this.http.request({
+							url: '/work/record/remove/' + item.id,
+							success: (res) => {
+								uni.showToast({ title: '删除成功' });
+								this.list.splice(index, 1);
+							}
+						});
+					}
+				}
+			});
+		},
+		go(url) {
+			uni.navigateTo({ url: url });
+		},
+		//刷新数据
+		refresh() {
+			this.loadMore = true;
+			this.param.pageNum = 1;
+			this.list = [];
+			this.getData();
+		}
+	},
+	//下拉刷新
+	onPullDownRefresh() {
+		setTimeout(() => {
+			this.refresh();
+			uni.stopPullDownRefresh();
+		}, 1000);
+	},
+	//上拉加载
+	onReachBottom() {
+		if (this.loadMore) {
+			this.param.pageNum++;
+			this.getData();
+		}
+	}
+};
+</script>
+
+<style lang="scss"></style>

+ 19 - 0
app/pages/follow/doctor/remind.vue

@@ -0,0 +1,19 @@
+<template>
+	<view>
+		
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				
+			};
+		}
+	}
+</script>
+
+<style lang="scss">
+
+</style>

+ 19 - 0
app/pages/follow/doctor/selectUser.vue

@@ -0,0 +1,19 @@
+<template>
+	<view>
+		
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				
+			};
+		}
+	}
+</script>
+
+<style lang="scss">
+
+</style>

+ 14 - 4
app/pages/knowledge/doctor/add.vue

@@ -12,7 +12,7 @@
 					<view class="icon more">&#xe62b;</view>
 				</picker>
 			</view>
-			<leditor v-model="item.content"></leditor>
+			<leditor ref="editor" v-model="item.content"></leditor>
 			<view class="form_group">
 				<view class="lable">状态</view>
 				<picker :range="state" @change="picker($event, 'state')">
@@ -34,8 +34,18 @@ export default {
 			state: ['启用', '停用']
 		};
 	},
-	onLoad() {
+	onLoad(e) {
 		this.getType();
+		if (e.id) {
+			this.http.request({
+				url: '/work/knowledge/detail/' + e.id,
+				success: (res) => {
+					this.item = res.data.data;
+					this.$refs.editor.setContents();
+					uni.setNavigationBarTitle({ title: '编辑知识库' });
+				}
+			});
+		}
 	},
 	methods: {
 		picker(e, tag) {
@@ -66,13 +76,13 @@ export default {
 				return false;
 			}
 			this.http.request({
-				url: '/work/knowledge/add',
+				url: this.item.id ? '/work/knowledge/edit' : '/work/knowledge/add',
 				method: 'POST',
 				data: this.item,
 				success: (res) => {
 					uni.showModal({
 						title: '提示',
-						content: '新增成功',
+						content: '操作成功',
 						showCancel: false,
 						success: (res) => {
 							uni.$emit('knowledge');

+ 13 - 8
app/pages/knowledge/doctor/index.vue

@@ -7,15 +7,16 @@
 			<u-tabs :list="tab" :current="current" keyName="dictLabel" @click="click"></u-tabs>
 		</view>
 		<view class="list">
-			<view class="item" v-for="(item, index) in list" :key="index" @click="go('/pages/knowledge/detail?id=' + item.id)">
+			<view class="item" v-for="(item, index) in list" :key="index" @click="go('/pages/knowledge/doctor/add?id=' + item.id)">
 				<view class="title omit">
 					<text class="icon" v-if="item.top === 1">&#xe61f;</text>
 					<text>{{ item.title }}</text>
 				</view>
 				<view class="desc">
 					<text>{{ item.type }}</text>
-					<text>发布于 {{ item.createTime }}</text>
+					<text>{{ item.createTime }}</text>
 					<text class="del" @click.stop="del(item, index)">删除</text>
+					<text class="icon state" :style="{ color: item.state == 0 ? '#4CAF50' : '#b5b5b5' }">&#xe830;{{ item.state == 0 ? '启用' : '停用' }}</text>
 				</view>
 			</view>
 			<view class="loading" v-if="loadMore"><u-loadmore :status="loadMore ? 'loading' : 'nomore'" /></view>
@@ -24,7 +25,7 @@
 		<view class="mfooter">
 			<button class="btn" @click="go('/pages/knowledge/doctor/add')">
 				<text class="icon">&#xe8d5;</text>
-				<text>发布</text>
+				<text>新增</text>
 			</button>
 		</view>
 	</view>
@@ -37,7 +38,7 @@ export default {
 			tab: [],
 			current: 0,
 			list: [],
-			param: { pageNum: 1, pageSize: 10 },
+			param: { pageNum: 1, pageSize: 10, orderByColumn: 'k.id', isAsc: 'desc' },
 			loadMore: true
 		};
 	},
@@ -125,17 +126,17 @@ export default {
 
 <style lang="scss">
 .list {
-	padding: 10px 12px;
+	padding: 5px 12px 5px 10px;
 	background-color: white;
 	margin: 10px;
 	border-radius: 10px;
 	.item {
 		border-radius: 5px;
-		padding: 13px 12px 13px 12px;
+		padding: 13px 8px 13px 8px;
 		margin-bottom: 10px;
 		overflow: hidden;
 		border-bottom: 1px solid $line;
-		&:last-child{
+		&:last-child {
 			border: 0px;
 		}
 		.title {
@@ -151,11 +152,15 @@ export default {
 			padding-top: 10px;
 			color: $font-c;
 			text {
-				padding-right: 30px;
+				padding-right: 20px;
+			}
+			.state {
+				float: right;
 			}
 			.del {
 				color: red;
 				float: right;
+				padding-right: 0px;
 			}
 		}
 	}

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

@@ -1,7 +1,7 @@
 <template>
 	<view class="main">
 		<view class="user">
-			<image :src="user.avatar ? ip + user.avatar : '../../static/favicon.png'" class="head"></image>
+			<image :src="user.avatar ? ip + user.avatar : '../../static/favicon.png'"></image>
 			<view class="con" v-if="user.id || user.token">
 				<view v-if="user.doctor" @click="go('/pages/user/info')">
 					<view class="nickName">{{ user.nickName }}</view>
@@ -24,18 +24,18 @@
 		<view class="cmd">
 			<!--医生菜单-->
 			<view v-if="user.doctor">
-				<view class="s_item" @click="go('/pages/follow/remind')">
-					<text class="icon ic" style="color: #03a9f4">&#xe6a3;</text>
+				<view class="s_item" @click="go('/pages/follow/doctor/remind')">
+					<text class="icon ic" style="color: #03a9f4">&#xe716;</text>
 					<text class="title">复诊提醒</text>
 					<text class="icon arrow">&#xe62b;</text>
 				</view>
-				<view class="s_item" @click="go('/pages/follow/index')">
+				<view class="s_item" @click="go('/pages/follow/doctor/index')">
 					<text class="icon ic" style="color: #607d8b">&#xe60b;</text>
-					<text class="title">访记录</text>
+					<text class="title">访记录</text>
 					<text class="icon arrow">&#xe62b;</text>
 				</view>
 				<view class="s_item" @click="go('/pages/knowledge/doctor/index')">
-					<text class="icon ic" style="color: #FF5722">&#xe69a;</text>
+					<text class="icon ic" style="color: #ff5722">&#xe69a;</text>
 					<text class="title">我的知识库</text>
 					<text class="icon arrow">&#xe62b;</text>
 				</view>
@@ -49,7 +49,7 @@
 				</view>
 				<view class="s_item" @click="go('/pages/follow/index')">
 					<text class="icon ic" style="color: #607d8b">&#xe60b;</text>
-					<text class="title">我的访</text>
+					<text class="title">我的访</text>
 					<text class="icon arrow">&#xe62b;</text>
 				</view>
 				<view class="s_item" @click="go('/pages/visit/index')">