Browse Source

feat:新增小程序医生端

lsw 8 months ago
parent
commit
e40e4f0603

+ 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_326zsnqu1yi.ttf?t=1723605976896') format('truetype');
+	src: url('https://at.alicdn.com/t/c/font_4620946_d1f699zeqx.ttf?t=1723622501301') format('truetype');
 	/* src: url('~@/static/font/iconfont.ttf') format('truetype'); */
 }
 .icon {

+ 4 - 1
app/common/common.scss

@@ -402,11 +402,14 @@
 			padding-top: 10px;
 			color: $font-c;
 			text {
-				padding-right: 20px;
+				padding-right: 15px;
 			}
 			.state {
 				float: right;
 			}
+			.edit{
+				float: right;
+			}
 			.del {
 				color: red;
 				float: right;

+ 7 - 0
app/pages.json

@@ -186,6 +186,13 @@
 			{
 				"navigationBarTitleText" : "选择患者"
 			}
+		},
+		{
+			"path" : "pages/follow/doctor/detail",
+			"style" : 
+			{
+				"navigationBarTitleText" : "查看详情"
+			}
 		}
 	],
 	"tabBar": {

+ 37 - 27
app/pages/follow/doctor/add.vue

@@ -3,21 +3,22 @@
 		<view class="form">
 			<view class="form_group">
 				<view class="lable">所属科室</view>
-				<input v-model="item.title" placeholder="请输入标题" />
+				<input :value="user.dept.deptName || '无科室'" disabled />
 			</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" />
+				<picker :range="templateList" range-key="title" @change="picker">
+					<input placeholder="请选择" v-model="item.templateName" :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="lable">指定患者</view>
+				<picker @click="go()" disabled v-if="item.patientList">
+					<input placeholder="请选择" :value="item.patientList.length > 0 ? '已选择:' + item.patientList.length + '人' : ''" :disabled="true" />
 					<view class="icon more">&#xe62b;</view>
 				</picker>
+				<input :value="item.patientName" v-else />
 			</view>
 		</view>
 		<button class="btn" @click="add()">确认</button>
@@ -28,30 +29,35 @@
 export default {
 	data() {
 		return {
-			item: { state: 0 },
+			user: this.getUser(),
+			item: { templateName: '', patientList: [] },
 			templateList: []
 		};
 	},
 	onLoad(e) {
+		this.item.type = e.type || 0;
 		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: '编辑知识库' });
-				}
-			});
-		}
+		this.getDeatil(e);
+		uni.$on('selectUser', (res) => {
+			this.item.patientList = res;
+		});
 	},
 	methods: {
-		picker(e, tag) {
-			if (tag == 'type') {
-				this.item.type = this.type[e.detail.value].dictLabel;
-			} else {
-				this.item[tag] = e.detail.value;
+		getDeatil(e) {
+			if (e.id) {
+				this.http.request({
+					url: '/work/record/detail/' + e.id,
+					success: (res) => {
+						this.item = res.data.data;
+						this.item.patientName = e.patientName;
+						uni.setNavigationBarTitle({ title: '编辑随访' });
+					}
+				});
 			}
+		},
+		picker(e, tag) {
+			this.item.templateName = this.templateList[e.detail.value].title;
+			this.item.op = this.templateList[e.detail.value].op;
 			this.$forceUpdate();
 		},
 		getTemplateList() {
@@ -62,18 +68,22 @@ export default {
 				}
 			});
 		},
+		go() {
+			uni.navigateTo({
+				url: '/pages/follow/doctor/selectUser?selected=' + JSON.stringify(this.item.patientList)
+			});
+		},
 		add() {
 			let rule = [
-				{ name: 'title', checkType: 'notnull', errorMsg: '请输入标题' },
-				{ name: 'type', checkType: 'notnull', errorMsg: '请选择分类' },
-				{ name: 'content', checkType: 'notnull', errorMsg: '请输入内容' }
+				{ name: 'templateName', checkType: 'notnull', errorMsg: '请选择随访模板' },
+				{ name: 'patientList', 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',
+				url: this.item.id ? '/work/record/edit' : '/work/record/add',
 				method: 'POST',
 				data: this.item,
 				success: (res) => {
@@ -82,7 +92,7 @@ export default {
 						content: '操作成功',
 						showCancel: false,
 						success: (res) => {
-							uni.$emit('knowledge');
+							uni.$emit('record');
 							uni.navigateBack();
 						}
 					});

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

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

+ 5 - 11
app/pages/follow/doctor/index.vue

@@ -4,7 +4,7 @@
 			<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="item" v-for="(item, index) in list" :key="index" @click="go('/pages/follow/doctor/detail?id=' + item.id)">
 				<view class="title omit">
 					<text class="icon" v-if="item.top === 1">&#xe61f;</text>
 					<text>{{ item.templateName }}</text>
@@ -13,14 +13,15 @@
 					<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>
+					<text class="edit" @click.stop="go('/pages/follow/doctor/add?id=' + item.id + ' &patientName=' + item.patientName)">编辑</text>
+					<text class="icon state" :style="{ color: item.state == 0 ? '#b5b5b5' : '#4CAF50' }">&#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')">
+			<button class="btn" @click="go('/pages/follow/doctor/add?type=1')">
 				<text class="icon">&#xe8d5;</text>
 				<text>新增</text>
 			</button>
@@ -32,8 +33,6 @@
 export default {
 	data() {
 		return {
-			tab: [],
-			current: 0,
 			list: [],
 			param: { pageNum: 1, pageSize: 10, type: 1, orderByColumn: 'k.id', isAsc: 'desc' },
 			loadMore: true
@@ -41,16 +40,11 @@ export default {
 	},
 	onLoad(e) {
 		this.getData();
-		uni.$on('knowledge', (res) => {
+		uni.$on('record', (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',

+ 68 - 8
app/pages/follow/doctor/selectUser.vue

@@ -1,19 +1,79 @@
 <template>
-	<view>
-		
+	<view class="main">
+		<view class="list">
+			<view class="item" v-for="(item, index) in list" :key="index" @click="check(item)">
+				<view class="title omit">
+					<text class="icon check" v-if="item.check" style="color: #4581fb">&#xe6ad;</text>
+					<text class="icon check" v-else>&#xe8bb;</text>
+					<text>{{ item.name }}</text>
+				</view>
+			</view>
+			<u-empty v-if="list.length == 0" text="暂无患者"></u-empty>
+		</view>
+		<view class="mfooter">
+			<button class="btn" @click="go()" v-if="selected.length > 0">选中{{ selected.length }}人</button>
+		</view>
 	</view>
 </template>
 
 <script>
-	export default {
-		data() {
-			return {
-				
-			};
+export default {
+	data() {
+		return {
+			list: [],
+			selected: []
+		};
+	},
+	onLoad(e) {
+		this.getData();
+		this.selected = JSON.parse(e.selected) || [];
+	},
+	methods: {
+		getData() {
+			this.http.request({
+				url: '/work/record/visit/list',
+				data: this.param,
+				success: (res) => {
+					this.list = res.data.data;
+					this.list.forEach((item) => {
+						item.check = this.selected.some((i) => i.id === item.id);
+					});
+					this.$forceUpdate();
+				}
+			});
+		},
+		check(item) {
+			item.check = !item.check;
+			this.selected = this.list.filter((item) => item.check);
+			this.$forceUpdate();
+		},
+		go() {
+			uni.$emit('selectUser', this.selected);
+			uni.navigateBack();
 		}
 	}
+};
 </script>
 
 <style lang="scss">
-
+.list {
+	background-color: white;
+	border-radius: 10px;
+	margin-top: -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-right: 5px;
+			}
+		}
+	}
+}
 </style>

+ 2 - 3
ruoyi-admin/src/main/java/com/ruoyi/web/work/controller/FollowRecordController.java

@@ -48,11 +48,10 @@ public class FollowRecordController extends BaseController {
 
     @PreAuthorize("@ss.hasPermi('work:record:list')")
     @GetMapping("/visit/list")
-    public TableDataInfo visitList(VisitDto dto) {
+    public AjaxResult visitList(VisitDto dto) {
         dto.setDoctorCode(getLoginUser().getUsername());
-        startPage();
         List<VisitVoList> list = followRecordService.selectVisitList(dto);
-        return getDataTable(list);
+        return AjaxResult.success(list);
     }
 
     @PreAuthorize("@ss.hasAnyPermi('work:record:list,work:up:list')")