Ver código fonte

feat:推送随访

lsw 8 meses atrás
pai
commit
1595f23b21

+ 42 - 30
app/common/common.scss

@@ -39,6 +39,9 @@
 .mt20 {
 	margin-top: 20px !important;
 }
+.pdt0{
+	padding-top: 0px;
+}
 .pl5 {
 	padding-left: 5px;
 }
@@ -196,9 +199,11 @@
 	}
 }
 .form_group {
-	padding: 9px 0px 9px 0px;
+	padding: 9px 15px 9px 15px;
 	overflow: hidden;
 	position: relative;
+	background-color: white;
+	border-bottom: 1px solid $line;
 	&.form_group:last-child {
 		border-bottom: 0px;
 	}
@@ -207,6 +212,15 @@
 		text-align: left;
 		position: relative;
 		font-weight: bold;
+		float: left;
+		color: $font-c;
+		margin-top: 7px;
+		.limit {
+			padding-left: 8px;
+			font-size: 13px;
+			font-weight: normal;
+			color: darkgray;
+		}
 	}
 	.re {
 		&::before {
@@ -215,16 +229,16 @@
 			height: 0px;
 			color: red;
 			position: absolute;
-			top: -11px;
+			top: -7px;
+			left: -8px;
 			font-weight: bold;
 		}
 	}
 	.bgm {
-		border: 1px solid $line;
+		color: white;
 		border-radius: 5px;
 		margin-top: 12px;
 		position: relative;
-		background-color: white;
 		.input {
 			border: 0px;
 			width: 75%;
@@ -234,7 +248,6 @@
 			position: absolute;
 			right: 10px;
 			top: 9px;
-			color: $main-color;
 		}
 	}
 	.avatar {
@@ -245,42 +258,41 @@
 		height: 55px;
 		border-radius: 50%;
 	}
-	picker {
-		position: relative;
-		.more {
-			position: absolute;
-			right: 7px;
-			top: 13px;
-			font-weight: normal;
-		}
+	.desc{
+		float: right;
+		padding-top: 5px;
+		width: 72%;
+		text-align: right;
 	}
 	input {
 		font-size: 15px;
 		border-radius: 5px;
-		padding: 10px;
-		margin-top: 12px;
-		border: 1px solid $line;
-		background-color: white;
+		padding: 10px 5px 10px 10px;
+		width: 72%;
+		float: right;
+		text-align: right;
+	}
+	picker {
+		position: relative;
+		text-align: right;
+		width: 72%;
+		float: right;
+		line-height: 0px;
 	}
 	textarea {
 		font-size: 15px;
 		border-radius: 5px;
 		padding: 10px;
-		margin-top: 12px;
+		margin-top: 40px;
 		height: 120px;
 		width: 93%;
-		border: 1px solid $line;
-		background-color: white;
-	}
-	.start {
-		flex: 1;
-		margin-top: -17px;
-		text-align: left;
+		background-color: #f1f1f1;
 	}
-	.hor {
-		flex: 0.7;
-		text-align: center;
-		padding-top: 5px;
+	.more {
+		position: absolute;
+		right: -10px;
+		top: 20px;
+		font-weight: normal;
 	}
 }
 .detail {
@@ -328,7 +340,7 @@
 .bz {
 	font-size: 12px;
 	color: $font-c;
-	margin-top: -5px;
+	margin-top:7px;
 	.icon {
 		padding-right: 3px;
 	}

+ 33 - 36
app/pages.json

@@ -72,66 +72,63 @@
 			}
 		},
 		{
-			"path" : "pages/follow/index",
-			"style" : 
-			{
-				"navigationBarTitleText" : "我的回访"
+			"path": "pages/follow/index",
+			"style": {
+				"navigationBarTitleText": "我的回访"
 			}
 		},
 		{
-			"path" : "pages/department/index",
-			"style" : 
-			{
-				"navigationBarTitleText" : "科室介绍"
+			"path": "pages/department/index",
+			"style": {
+				"navigationBarTitleText": "科室介绍"
 			}
 		},
 		{
-			"path" : "pages/doctor/detail",
-			"style" : 
-			{
-				"navigationBarTitleText" : "医生介绍"
+			"path": "pages/doctor/detail",
+			"style": {
+				"navigationBarTitleText": "医生介绍"
 			}
 		},
 		{
-			"path" : "pages/user/bind/index",
-			"style" : 
-			{
-				"navigationBarTitleText" : "我的就诊人"
+			"path": "pages/user/bind/index",
+			"style": {
+				"navigationBarTitleText": "我的就诊人"
 			}
 		},
 		{
-			"path" : "pages/user/bind/add",
-			"style" : 
-			{
-				"navigationBarTitleText" : "绑定就诊人"
+			"path": "pages/user/bind/add",
+			"style": {
+				"navigationBarTitleText": "绑定就诊人"
 			}
 		},
 		{
-			"path" : "pages/detection/index",
-			"style" : 
-			{
-				"navigationBarTitleText" : "检测报告"
+			"path": "pages/detection/index",
+			"style": {
+				"navigationBarTitleText": "检测报告"
 			}
 		},
 		{
-			"path" : "pages/visit/index",
-			"style" : 
-			{
-				"navigationBarTitleText" : "就诊记录"
+			"path": "pages/visit/index",
+			"style": {
+				"navigationBarTitleText": "就诊记录"
 			}
 		},
 		{
-			"path" : "pages/visit/detail",
-			"style" : 
-			{
-				"navigationBarTitleText" : "就诊详情"
+			"path": "pages/visit/detail",
+			"style": {
+				"navigationBarTitleText": "就诊详情"
 			}
 		},
 		{
-			"path" : "pages/detection/detail",
-			"style" : 
-			{
-				"navigationBarTitleText" : "检测报告详情"
+			"path": "pages/detection/detail",
+			"style": {
+				"navigationBarTitleText": "检测报告详情"
+			}
+		},
+		{
+			"path": "pages/user/bind/detail",
+			"style": {
+				"navigationBarTitleText": "就诊人信息"
 			}
 		}
 	],

+ 35 - 8
app/pages/user/bind/add.vue

@@ -1,12 +1,22 @@
 <template>
 	<view class="main">
-		<view class="form_group">
-			<view class="lable re">手机号</view>
-			<input type="digit" v-model="item.phone" placeholder="请输入手机号" />
-		</view>
-		<view class="bz">
-			<text class="icon">&#xe627;</text>
-			<text>请输入在医院预留的手机号</text>
+		<view class="bgm">
+			<view class="form_group">
+				<view class="lable">绑定方式</view>
+				<picker :range="bindType" @change="picker">
+					<input placeholder="请选择" :value="bindType[item.type]" :disabled="true" />
+					<view class="icon more">&#xe62b;</view>
+				</picker>
+			</view>
+			<view class="form_group">
+				<view class="lable">姓名</view>
+				<input v-model="item.name" placeholder="请输入姓名" />
+			</view>
+			<view class="form_group">
+				<view class="lable">{{ item.type == 0 ? '手机号' : '身份证号' }}</view>
+				<input type="tel" v-model="item.value" placeholder="请输入手机号" v-if="item.type == 0" />
+				<input type="idcard" v-model="item.value" placeholder="请输入身份证" v-else />
+			</view>
 		</view>
 		<button class="btn" @click="add()">确认</button>
 	</view>
@@ -16,11 +26,24 @@
 export default {
 	data() {
 		return {
-			item: {}
+			item: { type: 0 },
+			bindType: ['手机号', '身份证']
 		};
 	},
 	methods: {
+		picker(e) {
+			this.item.type = e.detail.value;
+			this.$forceUpdate();
+		},
 		add() {
+			let rule = [
+				{ name: 'name', checkType: 'notnull', errorMsg: '请输入姓名' },
+				{ name: 'value', checkType: 'notnull', errorMsg: this.item.type == 0 ? '请输入手机号' : '请输入身份证' }
+			];
+			if (!this.verify.check(this.item, rule)) {
+				uni.showModal({ content: this.verify.error, showCancel: false });
+				return false;
+			}
 			this.http.request({
 				url: '/app/user/bind',
 				method: 'POST',
@@ -43,6 +66,10 @@ export default {
 </script>
 
 <style lang="scss">
+.bgm {
+	border-radius: 5px;
+	overflow: hidden;
+}
 .btn {
 	margin-top: 35px;
 }

+ 82 - 0
app/pages/user/bind/detail.vue

@@ -0,0 +1,82 @@
+<template>
+	<view class="main pdt0">
+		<view class="bgm">
+			<view class="form_group">
+				<view class="lable">姓名</view>
+				<view class="desc">{{ item.name }}</view>
+			</view>
+			<view class="form_group">
+				<view class="lable">性别</view>
+				<view class="desc">{{ item.sex == 'F' ? '女' : '男' }}</view>
+			</view>
+			<view class="form_group">
+				<view class="lable">生日</view>
+				<view class="desc" v-if="item.birthDate">{{ item.birthDate.substring(0, 11) }}</view>
+			</view>
+			<view class="form_group">
+				<view class="lable">国籍</view>
+				<view class="desc">{{ item.nationality }}</view>
+			</view>
+			<view class="form_group">
+				<view class="lable">民族</view>
+				<view class="desc">{{ item.nation }}</view>
+			</view>
+			<view class="form_group">
+				<view class="lable">电话</view>
+				<view class="desc">{{ item.phone }}</view>
+			</view>
+			<view class="form_group">
+				<view class="lable">身份证</view>
+				<view class="desc">{{ item.sfzh }}</view>
+			</view>
+			<view class="form_group">
+				<view class="lable">婚姻状况</view>
+				<view class="desc">
+					<text v-if="item.marital == 'S'">未婚</text>
+					<text v-if="item.marital == 'M'">已婚</text>
+					<text v-if="item.marital == 'D'">离异</text>
+					<text v-if="item.marital == 'W'">丧偶</text>
+					<text v-if="item.marital == 'U'">未知</text>
+				</view>
+			</view>
+			<view class="form_group">
+				<view class="lable">职业</view>
+				<view class="desc">{{ item.career }}</view>
+			</view>
+			<view class="form_group">
+				<view class="lable">地址</view>
+				<view class="desc">{{ item.address }}</view>
+			</view>
+		</view>
+		<view class="bz">
+			<text class="icon">&#xe627;</text>
+			<text>预留在医院的信息</text>
+		</view>
+	</view>
+</template>
+
+<script>
+export default {
+	data() {
+		return {
+			item: {}
+		};
+	},
+	onLoad(e) {
+		this.http.request({
+			url: '/app/user/bind/detail/' + e.id,
+			success: (res) => {
+				this.item = res.data.data;
+			}
+		});
+	},
+	methods: {}
+};
+</script>
+
+<style lang="scss">
+.bgm {
+	border-radius: 5px;
+	overflow: hidden;
+}
+</style>

+ 5 - 3
app/pages/user/bind/index.vue

@@ -1,10 +1,10 @@
 <template>
 	<view class="main">
 		<view class="list">
-			<view class="item" v-for="(item, index) in list" :key="index" @click="go(item)">
+			<view class="item" v-for="(item, index) in list" :key="index" @click="go('/pages/user/bind/detail?id=' + item.id)">
 				<view class="title omit">
 					<text>{{ item.patientName }}</text>
-					<text class="icon check" v-if="item.state == 1">&#xe63b;</text>
+					<text class="check" v-if="item.state == 1">(当前就诊人)</text>
 				</view>
 				<view class="icon del" @click.stop="del(item)">&#xe641;</view>
 			</view>
@@ -78,7 +78,9 @@ export default {
 			font-size: 15px;
 			font-weight: bold;
 			.check {
-				color: $main-color;
+				color: #737373;
+				font-size: 13px;
+				font-weight: normal;
 				padding-left: 5px;
 			}
 		}

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

@@ -16,9 +16,9 @@
 			<view class="icon edit">&#xe62b;</view>
 		</view>
 		<view class="cmd">
-			<view class="s_item" @click="go('/pages/help/my')">
-				<text class="icon ic" style="color: #03a9f4">&#xe685;</text>
-				<text class="title">我的体检</text>
+			<view class="s_item" @click="go('/pages/follow/index')">
+				<text class="icon ic" style="color: #607d8b">&#xe60b;</text>
+				<text class="title">我的复诊</text>
 				<text class="icon arrow">&#xe62b;</text>
 			</view>
 			<view class="s_item" @click="go('/pages/follow/index')">

+ 5 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/api/Api_UserController.java

@@ -40,6 +40,11 @@ public class Api_UserController extends BaseController {
         return bindUserService.bind(dto);
     }
 
+    @GetMapping(value = "/bind/detail/{id}")
+    public AjaxResult bindDetail(@PathVariable("id") Long id) {
+        return bindUserService.bindDetail(id);
+    }
+
     @GetMapping(value = "/bind/remove/{id}")
     public AjaxResult remove(@PathVariable("id") Long id) throws ServerException {
         return bindUserService.remove(id);

+ 14 - 4
ruoyi-admin/src/main/java/com/ruoyi/web/work/domain/dto/BindDto.java

@@ -1,14 +1,24 @@
 package com.ruoyi.web.work.domain.dto;
 
-import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
+import javax.validation.constraints.Max;
+import javax.validation.constraints.Min;
 import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
 
 @Data
 public class BindDto {
 
-    @NotBlank(message = "手机号不能为空")
-    @ApiModelProperty(value = "预留手机号")
-    private String phone;
+    @NotNull(message = "绑定方式不能为空")
+    @Min(value = 0, message = "只能选择手机号或身份证绑定")
+    @Max(value = 1, message = "只能选择手机号或身份证绑定")
+    private Integer type;
+
+    @NotBlank(message = "姓名不能为空")
+    private String name;
+
+    @NotBlank(message = "手机号或身份证不能为空")
+    private String value;
+
 }

+ 2 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/work/mapper/BindUserMapper.java

@@ -3,6 +3,7 @@ package com.ruoyi.web.work.mapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.ruoyi.web.work.domain.BindUser;
 import com.ruoyi.web.work.domain.Patient;
+import com.ruoyi.web.work.domain.dto.BindDto;
 
 import java.util.List;
 
@@ -13,7 +14,7 @@ import java.util.List;
 public interface BindUserMapper extends BaseMapper<BindUser> {
     List<BindUser> selectList(BindUser bindUser);
 
-    Patient selectPatient(Patient patient);
+    Patient selectPatient(BindDto dto);
 
     BindUser selectBindUser(BindUser bindUser);
 

+ 8 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/service/IBindUserService.java

@@ -38,4 +38,12 @@ public interface IBindUserService extends IService<BindUser> {
      * @return
      */
     AjaxResult change(Long id) throws ServerException;
+
+    /**
+     * 就诊人详情
+     *
+     * @param id
+     * @return
+     */
+    AjaxResult bindDetail(Long id);
 }

+ 24 - 2
ruoyi-admin/src/main/java/com/ruoyi/web/work/service/impl/BindUserServiceImpl.java

@@ -10,6 +10,7 @@ import com.ruoyi.web.work.domain.User;
 import com.ruoyi.web.work.domain.dto.BindDto;
 import com.ruoyi.web.work.mapper.BindUserMapper;
 import com.ruoyi.web.work.service.IBindUserService;
+import com.ruoyi.web.work.service.IPatientService;
 import com.ruoyi.web.work.service.IUserService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -33,6 +34,9 @@ public class BindUserServiceImpl extends ServiceImpl<BindUserMapper, BindUser> i
     @Autowired
     private TokenServices tokenService;
 
+    @Autowired
+    private IPatientService patientService;
+
     @Override
     public List<BindUser> selectList(BindUser bindUser) {
         return bindUserMapper.selectList(bindUser);
@@ -41,9 +45,9 @@ public class BindUserServiceImpl extends ServiceImpl<BindUserMapper, BindUser> i
     @Transactional
     @Override
     public AjaxResult bind(BindDto dto) throws ServerException {
-        Patient patient = bindUserMapper.selectPatient(new Patient().setPhone(dto.getPhone()));
+        Patient patient = bindUserMapper.selectPatient(dto);
         if (patient == null) {
-            return AjaxResult.error("预留的就诊人手机号不存在");
+            return AjaxResult.error("预留的信息不存在或输入错误");
         }
         BindUser bindUser = new BindUser();
         bindUser.setPatientId(patient.getId());
@@ -79,6 +83,14 @@ public class BindUserServiceImpl extends ServiceImpl<BindUserMapper, BindUser> i
         if (!removeById(id)) {
             throw new ServerException("删除就诊人失败");
         }
+        //如果移除的是当前就诊人删除其缓存信息
+        if (bindUser.getPatientId().equals(AppUtil.getUser().getPatientId())) {
+            User user = AppUtil.getUser();
+            user.setPatientName("");
+            user.setPatientId(null);
+            userService.updateById(user);
+            tokenService.setLoginUser(user);
+        }
         return AjaxResult.success();
     }
 
@@ -101,4 +113,14 @@ public class BindUserServiceImpl extends ServiceImpl<BindUserMapper, BindUser> i
         tokenService.setLoginUser(userService.getById(AppUtil.getUser().getId()).setToken(AppUtil.getUser().getToken()));
         return AjaxResult.success();
     }
+
+    @Override
+    public AjaxResult bindDetail(Long id) {
+        BindUser bindUser = getById(id);
+        if (bindUser == null || !bindUser.getUserId().equals(AppUtil.getUser().getId())) {
+            return AjaxResult.error("数据不存在或非法操作");
+        }
+        Patient patient = patientService.getById(bindUser.getPatientId());
+        return AjaxResult.success(patient);
+    }
 }

+ 6 - 1
ruoyi-admin/src/main/resources/mapper/work/BindUserMapper.xml

@@ -20,7 +20,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </select>
 
     <select id="selectPatient" resultType="com.ruoyi.web.work.domain.Patient">
-        SELECT * FROM tb_patient WHERE phone=#{phone}
+        SELECT * FROM tb_patient
+        <where>
+            <if test="name != null  and name != ''"> and name = #{name}</if>
+            <if test="type==0"> and phone = #{value}</if>
+            <if test="type==1"> and sfzh = #{value}</if>
+        </where>
     </select>
 
     <select id="selectBindUser" resultType="com.ruoyi.web.work.domain.BindUser">