Explorar el Código

随访导出excel修改

lsw hace 3 meses
padre
commit
a38cfdb480

+ 3 - 1
admin-ui/src/views/work/follow/record/index.vue

@@ -22,7 +22,8 @@
       <el-table-column type="selection" width="55" align="center" />
       <el-table-column :label="queryParams.type == 0 ? '提醒标题' : '模板名称'" align="left" prop="templateName" />
       <el-table-column label="患者姓名" align="center" prop="patientName" width="160" />
-      <el-table-column label="状态" align="center" prop="state" width="140">
+      <el-table-column label="住院号" align="center" prop="blh" width="160" />
+      <el-table-column label="随访状态" align="center" prop="state" width="140">
         <template slot-scope="scope">
           <div v-if="queryParams.type == 0">
             <el-tag type="success">已推送</el-tag>
@@ -33,6 +34,7 @@
           </div>
         </template>
       </el-table-column>
+      <el-table-column label="随访时间" align="center" prop="returnTime" width="160" />
       <el-table-column label="创建人" align="center" prop="createBy" width="160" />
       <el-table-column label="创建时间" align="center" prop="createTime" width="160" />
       <el-table-column label="所属科室" align="center" prop="deptName" width="160" />

+ 1 - 0
app/pages/follow/index.vue

@@ -12,6 +12,7 @@
 					<text class="icon" v-if="item.state == 0">&#xe749;</text>
 					<text class="icon" v-else>&#xe6c6;</text>
 					<text>{{ item.state == 0 ? '去填写' : '已填写' }}</text>
+					<text v-if="item.returnTime" style="padding-left: 5px;">{{ item.returnTime }}</text>
 				</button>
 			</view>
 			<view class="loading" v-if="loadMore"><u-loadmore :status="loadMore ? 'loading' : 'nomore'" /></view>

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

@@ -1,5 +1,6 @@
 <template>
 	<view class="main">
+		<u-notify ref="uNotify" message="Hi uView"></u-notify>
 		<view class="user" @click="go(user.doctor ? '/pages/user/info' : '/pages/user/bind/index')">
 			<image :src="user.avatar ? ip + user.avatar : '../../static/favicon.png'" :class="user.avatar ? 'head' : ''"></image>
 			<view class="con" v-if="user.id || user.token">
@@ -9,7 +10,7 @@
 				</view>
 				<view v-else>
 					<view class="nickName">
-						<text v-if="user.bindUserList&&user.bindUserList.length > 0">{{ user.patientName ? user.patientName : '未设置当前就诊人' }}</text>
+						<text v-if="user.bindUserList && user.bindUserList.length > 0">{{ user.patientName ? user.patientName : '未设置当前就诊人' }}</text>
 						<text v-else>还未绑定就诊人</text>
 						<text v-if="user.relationship" class="relationship">({{ user.relationship }})</text>
 						<text class="icon" v-if="user.bindUserList && user.bindUserList.length > 0" @click.stop="show = true">&#xe6a7;切换就诊人</text>
@@ -121,6 +122,11 @@ export default {
 				url: '/app/user/info',
 				success: (res) => {
 					this.user = res.data.data;
+					if (this.user.follow > 0) {
+						setTimeout(() => {
+							this.$refs.uNotify.show({ top: -30, message: '你有' + this.user.follow + '条随访待填写', fontSize: 15, duration: 5000 });
+						}, 1500);
+					}
 				}
 			});
 		},

+ 165 - 164
app/uni_modules/uview-ui/components/u-notify/u-notify.vue

@@ -1,14 +1,6 @@
 <template>
-	<u-transition
-		mode="slide-down"
-		:customStyle="containerStyle"
-		:show="open"
-	>
-		<view
-			class="u-notify"
-			:class="[`u-notify--${tmpConfig.type}`]"
-			:style="[backgroundColor, $u.addStyle(customStyle)]"
-		>
+	<u-transition mode="slide-down" :customStyle="containerStyle" :show="open">
+		<view class="u-notify" :class="[`u-notify--${tmpConfig.type}`]" :style="[backgroundColor, $u.addStyle(customStyle)]">
 			<u-status-bar v-if="tmpConfig.safeAreaInsetTop"></u-status-bar>
 			<view class="u-notify__warpper">
 				<slot name="icon">
@@ -17,7 +9,7 @@
 						:name="tmpConfig.icon"
 						:color="tmpConfig.color"
 						:size="1.3 * tmpConfig.fontSize"
-						:customStyle="{marginRight: '4px'}"
+						:customStyle="{ marginRight: '4px' }"
 					></u-icon>
 				</slot>
 				<text
@@ -26,186 +18,195 @@
 						fontSize: $u.addUnit(tmpConfig.fontSize),
 						color: tmpConfig.color
 					}"
-				>{{ tmpConfig.message }}</text>
+				>
+					{{ tmpConfig.message }}
+				</text>
 			</view>
 		</view>
 	</u-transition>
 </template>
 
 <script>
-	import props from './props.js';
-	/**
-	 * notify 顶部提示
-	 * @description 该组件一般用于页面顶部向下滑出一个提示,尔后自动收起的场景
-	 * @tutorial
-	 * @property {String | Number}	top					到顶部的距离 ( 默认 0 )
-	 * @property {String}			type				主题,primary,success,warning,error ( 默认 'primary' )
-	 * @property {String}			color				字体颜色 ( 默认 '#ffffff' )
-	 * @property {String}			bgColor				背景颜色
-	 * @property {String}			message				展示的文字内容
-	 * @property {String | Number}	duration			展示时长,为0时不消失,单位ms ( 默认 3000 )
-	 * @property {String | Number}	fontSize			字体大小 ( 默认 15 )
-	 * @property {Boolean}			safeAreaInsetTop	是否留出顶部安全距离(状态栏高度) ( 默认 false )
-	 * @property {Object}			customStyle			组件的样式,对象形式
-	 * @event {Function}	open	开启组件时调用的函数
-	 * @event {Function}	close	关闭组件式调用的函数
-	 * @example <u-notify message="Hi uView"></u-notify>
-	 */
-	export default {
-		name: 'u-notify',
-		mixins: [uni.$u.mpMixin, uni.$u.mixin,props],
-		data() {
-			return {
-				// 是否展示组件
-				open: false,
-				timer: null,
-				config: {
-					// 到顶部的距离
-					top: uni.$u.props.notify.top,
-					// type主题,primary,success,warning,error
-					type: uni.$u.props.notify.type,
-					// 字体颜色
-					color: uni.$u.props.notify.color,
-					// 背景颜色
-					bgColor: uni.$u.props.notify.bgColor,
-					// 展示的文字内容
-					message: uni.$u.props.notify.message,
-					// 展示时长,为0时不消失,单位ms
-					duration: uni.$u.props.notify.duration,
-					// 字体大小
-					fontSize: uni.$u.props.notify.fontSize,
-					// 是否留出顶部安全距离(状态栏高度)
-					safeAreaInsetTop: uni.$u.props.notify.safeAreaInsetTop
-				},
-				// 合并后的配置,避免多次调用组件后,可能会复用之前使用的配置参数
-				tmpConfig: {}
+import props from './props.js';
+/**
+ * notify 顶部提示
+ * @description 该组件一般用于页面顶部向下滑出一个提示,尔后自动收起的场景
+ * @tutorial
+ * @property {String | Number}	top					到顶部的距离 ( 默认 0 )
+ * @property {String}			type				主题,primary,success,warning,error ( 默认 'primary' )
+ * @property {String}			color				字体颜色 ( 默认 '#ffffff' )
+ * @property {String}			bgColor				背景颜色
+ * @property {String}			message				展示的文字内容
+ * @property {String | Number}	duration			展示时长,为0时不消失,单位ms ( 默认 3000 )
+ * @property {String | Number}	fontSize			字体大小 ( 默认 15 )
+ * @property {Boolean}			safeAreaInsetTop	是否留出顶部安全距离(状态栏高度) ( 默认 false )
+ * @property {Object}			customStyle			组件的样式,对象形式
+ * @event {Function}	open	开启组件时调用的函数
+ * @event {Function}	close	关闭组件式调用的函数
+ * @example <u-notify message="Hi uView"></u-notify>
+ */
+export default {
+	name: 'u-notify',
+	mixins: [uni.$u.mpMixin, uni.$u.mixin, props],
+	data() {
+		return {
+			// 是否展示组件
+			open: false,
+			timer: null,
+			config: {
+				// 到顶部的距离
+				top: uni.$u.props.notify.top,
+				// type主题,primary,success,warning,error
+				type: uni.$u.props.notify.type,
+				// 字体颜色
+				color: uni.$u.props.notify.color,
+				// 背景颜色
+				bgColor: uni.$u.props.notify.bgColor,
+				// 展示的文字内容
+				message: uni.$u.props.notify.message,
+				// 展示时长,为0时不消失,单位ms
+				duration: uni.$u.props.notify.duration,
+				// 字体大小
+				fontSize: uni.$u.props.notify.fontSize,
+				// 是否留出顶部安全距离(状态栏高度)
+				safeAreaInsetTop: uni.$u.props.notify.safeAreaInsetTop
+			},
+			// 合并后的配置,避免多次调用组件后,可能会复用之前使用的配置参数
+			tmpConfig: {}
+		};
+	},
+	computed: {
+		containerStyle() {
+			let top = 0;
+			if (this.tmpConfig.top === 0) {
+				// #ifdef H5
+				// H5端,导航栏为普通元素,需要将组件移动到导航栏的下边沿
+				// H5的导航栏高度为44px
+				top = 44;
+				// #endif
 			}
+			const style = {
+				top: uni.$u.addUnit(this.tmpConfig.top === 0 ? top : this.tmpConfig.top),
+				// 因为组件底层为u-transition组件,必须将其设置为fixed定位
+				// 让其出现在导航栏底部
+				position: 'fixed',
+				left: 0,
+				right: 0,
+				zIndex: 10076
+			};
+			return style;
 		},
-		computed: {
-			containerStyle() {
-				let top = 0
-				if (this.tmpConfig.top === 0) {
-					// #ifdef H5
-					// H5端,导航栏为普通元素,需要将组件移动到导航栏的下边沿
-					// H5的导航栏高度为44px
-					top = 44
-					// #endif
-				}
-				const style = {
-					top: uni.$u.addUnit(this.tmpConfig.top === 0 ? top : this.tmpConfig.top),
-					// 因为组件底层为u-transition组件,必须将其设置为fixed定位
-					// 让其出现在导航栏底部
-					position: 'fixed',
-					left: 0,
-					right: 0,
-					zIndex: 10076
-				}
-				return style
-			},
-			// 组件背景颜色
-			backgroundColor() {
-				const style = {}
-				if (this.tmpConfig.bgColor) {
-					style.backgroundColor = this.tmpConfig.bgColor
-				}
-				return style
-			},
-			// 默认主题下的图标
-			icon() {
-				let icon
-				if (this.tmpConfig.type === 'success') {
-					icon = 'checkmark-circle'
-				} else if (this.tmpConfig.type === 'error') {
-					icon = 'close-circle'
-				} else if (this.tmpConfig.type === 'warning') {
-					icon = 'error-circle'
-				}
-				return icon
+		// 组件背景颜色
+		backgroundColor() {
+			const style = {};
+			if (this.tmpConfig.bgColor) {
+				style.backgroundColor = this.tmpConfig.bgColor;
 			}
+			return style;
 		},
-		created() {
-			// 通过主题的形式调用toast,批量生成方法函数
-			['primary', 'success', 'error', 'warning'].map(item => {
-				this[item] = message => this.show({
+		// 默认主题下的图标
+		icon() {
+			let icon;
+			if (this.tmpConfig.type === 'success') {
+				icon = 'checkmark-circle';
+			} else if (this.tmpConfig.type === 'error') {
+				icon = 'close-circle';
+			} else if (this.tmpConfig.type === 'warning') {
+				icon = 'error-circle';
+			}
+			return icon;
+		}
+	},
+	created() {
+		// 通过主题的形式调用toast,批量生成方法函数
+		['primary', 'success', 'error', 'warning'].map(item => {
+			this[item] = message =>
+				this.show({
 					type: item,
 					message
-				})
-			})
-		},
-		methods: {
-			show(options) {
-				// 不将结果合并到this.config变量,避免多次调用u-toast,前后的配置造成混乱
-				this.tmpConfig = uni.$u.deepMerge(this.config, options)
-				// 任何定时器初始化之前,都要执行清除操作,否则可能会造成混乱
-				this.clearTimer()
-				this.open = true
-				if (this.tmpConfig.duration > 0) {
-					this.timer = setTimeout(() => {
-						this.open = false
-						// 倒计时结束,清除定时器,隐藏toast组件
-						this.clearTimer()
-						// 判断是否存在callback方法,如果存在就执行
-						typeof(this.tmpConfig.complete) === 'function' && this.tmpConfig.complete()
-					}, this.tmpConfig.duration)
-				}
-			},
-			// 关闭notify
-			close() {
-				this.clearTimer()
-			},
-			clearTimer() {
-				this.open = false
-				// 清除定时器
-				clearTimeout(this.timer)
-				this.timer = null
+				});
+		});
+	},
+	methods: {
+		show(options) {
+			// 不将结果合并到this.config变量,避免多次调用u-toast,前后的配置造成混乱
+			this.tmpConfig = uni.$u.deepMerge(this.config, options);
+			// 任何定时器初始化之前,都要执行清除操作,否则可能会造成混乱
+			this.clearTimer();
+			this.open = true;
+			if (this.tmpConfig.duration > 0) {
+				this.timer = setTimeout(() => {
+					this.open = false;
+					// 倒计时结束,清除定时器,隐藏toast组件
+					this.clearTimer();
+					// 判断是否存在callback方法,如果存在就执行
+					typeof this.tmpConfig.complete === 'function' && this.tmpConfig.complete();
+				}, this.tmpConfig.duration);
 			}
 		},
-		beforeDestroy() {
-			this.clearTimer()
+		// 关闭notify
+		close() {
+			this.clearTimer();
+		},
+		clearTimer() {
+			this.open = false;
+			// 清除定时器
+			clearTimeout(this.timer);
+			this.timer = null;
 		}
+	},
+	beforeDestroy() {
+		this.clearTimer();
 	}
+};
 </script>
 
 <style lang="scss" scoped>
-	@import "../../libs/css/components.scss";
+@import '../../libs/css/components.scss';
 
-	$u-notify-padding: 8px 10px !default;
-	$u-notify-text-font-size: 15px !default;
-	$u-notify-primary-bgColor: $u-primary !default;
-	$u-notify-success-bgColor: $u-success !default;
-	$u-notify-error-bgColor: $u-error !default;
-	$u-notify-warning-bgColor: $u-warning !default;
+$u-notify-padding: 8px 10px !default;
+$u-notify-text-font-size: 15px !default;
+$u-notify-primary-bgColor: $u-primary !default;
+$u-notify-success-bgColor: $u-success !default;
+$u-notify-error-bgColor: $u-error !default;
+$u-notify-warning-bgColor: $u-warning !default;
 
+.u-notify {
+	padding: $u-notify-padding;
+	width: 35%;
+	margin: 0 auto;
+	border-radius: 20px;
+	margin-top: 55px;
+	box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.3);
+	@media screen and(min-width:$min-width) {
+		width: 15%;
+	}
+	&__warpper {
+		@include flex;
+		align-items: center;
+		text-align: center;
+		justify-content: center;
 
-	.u-notify {
-		padding: $u-notify-padding;
-
-		&__warpper {
-			@include flex;
-			align-items: center;
+		&__text {
+			font-size: $u-notify-text-font-size;
 			text-align: center;
-			justify-content: center;
-
-			&__text {
-				font-size: $u-notify-text-font-size;
-				text-align: center;
-			}
 		}
+	}
 
-		&--primary {
-			background-color: $u-notify-primary-bgColor;
-		}
+	&--primary {
+		background-color: $u-notify-primary-bgColor;
+	}
 
-		&--success {
-			background-color: $u-notify-success-bgColor;
-		}
+	&--success {
+		background-color: $u-notify-success-bgColor;
+	}
 
-		&--error {
-			background-color: $u-notify-error-bgColor;
-		}
+	&--error {
+		background-color: $u-notify-error-bgColor;
+	}
 
-		&--warning {
-			background-color: $u-notify-warning-bgColor;
-		}
+	&--warning {
+		background-color: $u-notify-warning-bgColor;
 	}
+}
 </style>

+ 14 - 2
ruoyi-admin/src/main/java/com/ruoyi/web/work/domain/FollowRecord.java

@@ -2,6 +2,7 @@ package com.ruoyi.web.work.domain;
 
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
 import com.ruoyi.common.annotation.Excel;
 import com.ruoyi.common.core.domain.BaseData;
 import io.swagger.annotations.ApiModelProperty;
@@ -12,6 +13,7 @@ import javax.validation.constraints.Max;
 import javax.validation.constraints.Min;
 import javax.validation.constraints.NotBlank;
 import javax.validation.constraints.NotNull;
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -39,21 +41,31 @@ public class FollowRecord extends BaseData {
 
     @NotBlank(message = "模板名称或提醒标题不能为空")
     @ApiModelProperty(value = "模板名称")
-    @Excel(name = "模板名称",sort =1)
+    @Excel(name = "模板名称",sort =1,width=40)
     private String templateName;
 
     @ApiModelProperty(value = "患者姓名")
     @Excel(name = "患者姓名",sort =2)
     private String patientName;
 
+    @ApiModelProperty(value = "住院号")
+    @Excel(name = "住院号",sort =3)
+    @TableField(exist = false)
+    private String blh;
+
     @NotBlank(message = "回访内容或者提醒内容不能为空")
     @ApiModelProperty(value = "回访内容")
     private String op;
 
     @ApiModelProperty(value = "状态:0=未回访,1=已回访")
-    @Excel(name = "账户状态", readConverterExp = "0=未回访,1=已回访",sort =3)
+    @Excel(name = "随访状态", readConverterExp = "0=未回访,1=已回访",sort =7)
     private Integer state;
 
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "回访时间",dateFormat = "yyyy-MM-dd HH:mm",sort =300,width=30)
+    private Date returnTime;
+
+
     @TableField(exist = false)
     private List<Patient> patientList;
 }

+ 3 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/domain/vo/FollowRecordVoList.java

@@ -35,4 +35,7 @@ public class FollowRecordVoList {
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
     private Date createTime;
 
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
+    private Date returnTime;
+
 }

+ 2 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/service/impl/FollowRecordServiceImpl.java

@@ -21,6 +21,7 @@ import org.springframework.core.env.Environment;
 import org.springframework.stereotype.Service;
 
 import java.util.ArrayList;
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -61,6 +62,7 @@ public class FollowRecordServiceImpl extends ServiceImpl<FollowRecordMapper, Fol
         }
         followRecord.setOp(dto.getOp());
         followRecord.setState(1);
+        followRecord.setReturnTime(new Date());
         if (!updateById(followRecord)) {
             throw new ServiceException("提交回访记录失败");
         }

+ 5 - 1
ruoyi-admin/src/main/resources/mapper/work/FollowRecordMapper.xml

@@ -12,10 +12,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         k.state,
         k.create_time,
         k.create_by,
-        d.dept_name AS deptName
+        k.return_time,
+        d.dept_name AS deptName,
+        p.blh
         FROM
         tb_follow_record k
         LEFT JOIN sys_dept d ON d.dept_id = k.dept_id
+        LEFT JOIN tb_patient p ON p.id=k.patient_id
         WHERE 1=1
             <if test="type != null "> and k.type = #{type}</if>
             <if test="patientName != null  and patientName != ''"> AND k.patient_name like concat('%', #{patientName}, '%')</if>
@@ -35,6 +38,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         r.op,
         r.state,
         r.create_time,
+        r.return_time,
         d.dept_name,
         u.nick_name AS doctorName
         FROM

+ 3 - 1
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/BaseData.java

@@ -31,6 +31,7 @@ public class BaseData {
 
     //部门名称
     @TableField(exist = false)
+    @Excel(name = "出院科室",sort =4)
     private String deptName;
 
     //开始日期
@@ -44,11 +45,12 @@ public class BaseData {
     private String dateEnd;
 
     @TableField(fill = FieldFill.INSERT)
+    @Excel(name = "随访发起人员",sort =5)
     private String createBy;
 
     @TableField(fill = FieldFill.INSERT)
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-    @Excel(name = "创建时间",dateFormat = "yyyy-MM-dd HH:mm",sort =100,width=30)
+    @Excel(name = "随访发起时间",dateFormat = "yyyy-MM-dd HH:mm",sort =6,width=30)
     private Date createTime;
 
     @TableField(fill = FieldFill.UPDATE)