1
0
Selaa lähdekoodia

Merge remote-tracking branch 'origin/dev1.0' into dev1.0

lmx 8 kuukautta sitten
vanhempi
commit
5809ebbb36

+ 29 - 0
admin-ui/src/assets/styles/extend.scss

@@ -149,6 +149,9 @@
 .el-steps--horizontal {
   margin-top: 10px;
 }
+.el-textarea.is-disabled .el-textarea__inner {
+    color: #808080 !important;
+}
 .logItem {
   padding-bottom: 8px;
 }
@@ -199,6 +202,31 @@
   padding: 80px 35px 90px 35px;
   margin: 0 auto;
   margin-top: -10px;
+.message-bubble-received {
+  background: #dcf8c6;
+  border-radius: 10px;
+  padding: 10px;
+  max-width: 80%;
+  word-wrap: break-word;
+  position: relative;
+  margin-left: 10px;
+  float: left;
+  clear: both;
+  font-size: 14px;
+  margin-top: 20px;
+  color: #262626;
+
+  &::before {
+    content: '';
+    position: absolute;
+    width: 0;
+    height: 0;
+    border-style: solid;
+    border-width: 0 10px 10px 10px;
+    border-color: transparent transparent #dcf8c6 transparent;
+    left: -10px;
+  }
+}
 }
 .guise-mobile-2 {
   left: 20%;
@@ -350,6 +378,7 @@
         border-radius: 3px;
         float: left;
         color: #656363;
+        line-height: 14px;
         &.active {
           background-color: #4581fb;
           color: white;

+ 70 - 22
admin-ui/src/views/work/follow/record/edit.vue

@@ -1,22 +1,63 @@
 <template>
   <div class="cmain">
-    <el-form ref="form" :model="form" :rules="rules" label-width="100px">
-      <el-form-item label="所属科室" prop="deptName">
-        <el-input v-model="form.deptName" placeholder="请输入标题" disabled />
-      </el-form-item>
-      <el-form-item label="回访模板" prop="templateName">
-        <el-select v-model="form.templateName" placeholder="请选择模板" @change="change">
-          <el-option v-for="item in templateList" :key="item.title" :label="item.title" :value="item.title" clearable></el-option>
-        </el-select>
-      </el-form-item>
-      <el-form-item label="发送患者" prop="templateList">
-        <div class="patients">
-          <el-tag size="medium" class="patient" v-for="item in form.patientList" :key="item.name" closable @close="del(item)">{{ item.name }}</el-tag>
-          <el-button type="primary" icon="el-icon-search" @click="selectPatient()" class="btn">添加</el-button>
-        </div>
-      </el-form-item>
+    <el-form ref="form" :model="form" :rules="rules" :disabled="param.detail" label-width="100px">
+      <el-row>
+        <el-col :span="14">
+          <el-form-item label="所属科室" prop="deptName">
+            <el-input :value="$store.state.user.deptNameStr" placeholder="请输入标题" disabled />
+          </el-form-item>
+          <el-form-item label="提醒标题" prop="templateName" v-if="form.type == 0">
+            <el-input v-model="form.templateName" placeholder="请输入提醒标题, 例如:体检异常复检" clearable />
+          </el-form-item>
+          <el-form-item label="回访模板" prop="templateName" v-if="form.type == 1">
+            <el-select v-model="form.templateName" placeholder="请选择模板" @change="change">
+              <el-option v-for="item in templateList" :key="item.title" :label="item.title" :value="item.title" clearable></el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="发送患者" :prop="form.id ? '' : 'patientList'">
+            <div v-if="form.id">
+              <el-tag size="medium" class="patient">{{ param.patientName }}</el-tag>
+            </div>
+            <div class="patients" v-else>
+              <el-tag size="medium" class="patient" v-for="item in form.patientList" :key="item.name" closable @close="del(item)">{{ item.name }}</el-tag>
+              <el-button type="primary" icon="el-icon-plus" @click="selectPatient()" class="btn">添加</el-button>
+            </div>
+          </el-form-item>
+          <el-form-item label="提醒内容" prop="op" v-if="form.type == 0">
+            <el-input v-model="form.op" type="textarea" placeholder="例如:根据您于本院做的体检结果异常,请到岑溪人民医院做复诊" rows="5" clearable />
+          </el-form-item>
+        </el-col>
+        <el-col :span="10">
+          <div class="div-mc">
+            <div class="guise-mobile">
+              <div class="guise-mobile-show" ref="scrollbar">
+                <div class="mttv">{{ form.templateName }}</div>
+                <div class="message-bubble-received" v-if="form.type == 0">{{ form.op }}</div>
+                <div class="items" v-for="(item, index) in op" :key="index">
+                  <div class="vtitle" style="font-weight: normal; font-size: 14px">
+                    <span class="ifnull" v-if="item.ifnull == '必填'">*</span>
+                    <span class="index">{{ index + 1 }},</span>
+                    <span class="tm">{{ item.name }} ({{ item.input }})</span>
+                  </div>
+                  <div class="mts">
+                    <input v-if="item.input == '填空'" placeholder="请输入" :disabled="true" />
+                    <textarea v-if="item.input == '多行文本'" :disabled="true" placeholder="请输入"></textarea>
+                    <input type="number" v-if="item.input == '数字'" placeholder="请输入" :disabled="true" />
+                    <div class="ops">
+                      <div v-for="(op, i) in item.selects" :key="op.name">
+                        <div class="op">{{ op.name }}</div>
+                      </div>
+                    </div>
+                  </div>
+                </div>
+                <el-button type="primary" class="tjiao" v-if="form.type == 1 && form.templateName != null">提交</el-button>
+              </div>
+            </div>
+          </div>
+        </el-col>
+      </el-row>
     </el-form>
-    <div class="mfooter">
+    <div class="mfooter" v-if="!param.detail">
       <el-button type="primary" @click="submitForm">确 定</el-button>
       <el-button @click="$layer.close(layerid)">取 消</el-button>
     </div>
@@ -29,21 +70,30 @@ export default {
   data() {
     return {
       form: {
-        deptName: this.$store.state.user.deptNameStr,
+        op: '根据您于本院做的体检结果异常,请到岑溪人民医院做复诊',
         patientList: []
       },
       templateList: [],
+      op: [],
       rules: {
-        templateName: [{ required: true, message: '不能为空', trigger: 'blur' }]
+        templateName: [{ required: true, message: '不能为空', trigger: 'blur' }],
+        patientList: [{ required: true, message: '不能为空', trigger: 'blur' }],
+        op: [{ required: true, message: '不能为空', trigger: 'blur' }]
       }
     };
   },
   mounted() {
-    this.getTemplate();
+    if (this.param.type == 1) {
+      this.getTemplate();
+    }
     if (this.param.id) {
       this.ajax({ url: '/work/record/detail/' + this.param.id }).then((response) => {
         this.form = response.data;
+        this.op = JSON.parse(response.data.op);
       });
+    } else {
+      this.form.type = this.param.type;
+      this.$forceUpdate();
     }
   },
   methods: {
@@ -55,6 +105,7 @@ export default {
     change(e) {
       let item = this.templateList.filter((item) => item.title == e)[0];
       this.form.op = item.op;
+      this.op = JSON.parse(item.op);
     },
     selectPatient() {
       this.iframe({ obj: selectPatient, param: {}, title: '选择推送患者', width: '60%', height: '75%' });
@@ -89,8 +140,5 @@ export default {
   .patient {
     margin-right: 10px;
   }
-  .btn {
-    margin-left: 15px;
-  }
 }
 </style>

+ 26 - 21
admin-ui/src/views/work/follow/record/index.vue

@@ -1,14 +1,11 @@
 <template>
   <div class="app-container">
     <el-form :model="queryParams" ref="queryForm" :inline="true" @submit.native.prevent>
-      <el-form-item label="问题模板id" prop="templateId">
-        <el-input v-model="queryParams.templateId" placeholder="请输入问题模板id" @keyup.enter.native="handleQuery" clearable class="inp" />
+      <el-form-item label="科室" prop="deptId">
+        <dtree v-model="queryParams.deptId" @handleQuery="handleQuery" :tree="false"></dtree>
       </el-form-item>
-      <el-form-item label="患者id" prop="userId">
-        <el-input v-model="queryParams.userId" placeholder="请输入患者id" @keyup.enter.native="handleQuery" clearable class="inp" />
-      </el-form-item>
-      <el-form-item label="状态" prop="state">
-        <el-input v-model="queryParams.state" placeholder="请输入状态" @keyup.enter.native="handleQuery" clearable class="inp" />
+      <el-form-item label="患者姓名" prop="patientName">
+        <el-input v-model="queryParams.patientName" placeholder="请输入患者姓名" @keyup.enter.native="handleQuery" clearable class="inp" />
       </el-form-item>
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
@@ -16,25 +13,32 @@
       </el-form-item>
     </el-form>
     <el-row :gutter="10" class="mb8">
-      <el-button type="primary" icon="el-icon-plus" :disabled="ids.length > 0" @click="op('add')" v-hasPermi="['work:record:add']">新增</el-button>
+      <el-button type="primary" icon="el-icon-plus" :disabled="ids.length > 0" @click="op('add')" v-hasPermi="['work:record:add']">{{ queryParams.type == 0 ? '新增提醒' : '新增回访' }}</el-button>
       <el-button type="danger" icon="el-icon-delete" :disabled="ids.length == 0" @click="del" v-hasPermi="['work:record:remove']">删除{{ ids.length > 0 ? '(' + ids.length + ')' : '' }}</el-button>
     </el-row>
 
     <el-table :data="response.rows" border @selection-change="selects" height="calc(100vh - 270px)">
       <el-table-column type="selection" width="55" align="center" />
-      <el-table-column label="回访模板" align="center" prop="templateName" />
-      <el-table-column label="患者姓名" align="center" prop="patientName" />
+      <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">
         <template slot-scope="scope">
-          <el-tag type="danger" v-if="scope.row.state == 0">待回访</el-tag>
-          <el-tag type="success" v-if="scope.row.state == 1">已回访</el-tag>
+          <div v-if="queryParams.type == 0">
+            <el-tag type="success">已推送</el-tag>
+          </div>
+          <div v-else>
+            <el-tag type="danger" v-if="scope.row.state == 0">待回访</el-tag>
+            <el-tag type="success" v-if="scope.row.state == 1">已回访</el-tag>
+          </div>
         </template>
       </el-table-column>
-      <el-table-column label="创建人" align="center" prop="createBy" width="130" />
+      <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" />
-      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+      <el-table-column label="操作" align="center" width="180">
         <template slot-scope="scope">
+          <el-button size="mini" type="text" icon="el-icon-view" @click="op('detail', scope.row)" v-hasPermi="['work:record:list']">查看</el-button>
+          <el-button size="mini" type="text" icon="el-icon-edit" @click="op('edit', scope.row)" v-hasPermi="['work:knowledge:edit']">编辑</el-button>
           <el-button size="mini" type="text" icon="el-icon-delete" @click="del(scope.row)" v-hasPermi="['work:record:remove']">删除</el-button>
         </template>
       </el-table-column>
@@ -55,17 +59,16 @@ export default {
       queryParams: {
         pageNum: 1,
         pageSize: 10,
-        templateId: null,
-        userId: null,
         state: null,
-        doctorId: null,
         deptId: null,
-        orderByColumn: 'id', //排序字段
+        patientName: null,
+        orderByColumn: 'k.id', //排序字段
         isAsc: 'desc' //排序方式
       }
     };
   },
   created() {
+    this.queryParams.type = this.$route.path == '/follow/up' ? 0 : 1;
     this.getList();
   },
   methods: {
@@ -87,11 +90,13 @@ export default {
     },
     op(tag, row) {
       if (tag == 'add') {
-        this.iframe({ obj: edit, param: {}, title: '新增', width: '45%', height: '55%' });
+        this.iframe({ obj: edit, param: { type: this.queryParams.type }, title: this.queryParams.type == 0 ? '新增提醒' : '新增回访', width: '55%', height: '77%' });
       }
       if (tag == 'edit') {
-        const id = row.id || this.ids[0];
-        this.iframe({ obj: edit, param: { id: id }, title: '编辑', width: '50%', height: '50%' });
+        this.iframe({ obj: edit, param: { id: row.id, type: this.queryParams.type, patientName: row.patientName }, title: '编辑', width: '55%', height: '77%' });
+      }
+      if (tag == 'detail') {
+        this.iframe({ obj: edit, param: { id: row.id, detail: true, patientName: row.patientName }, title: '查看详情', width: '55%', height: '77%' });
       }
     },
     del(row) {

+ 4 - 1
admin-ui/src/views/work/follow/template/index.vue

@@ -8,7 +8,10 @@
         <el-input v-model="queryParams.title" placeholder="请输入标题" @keyup.enter.native="handleQuery" clearable class="inp" />
       </el-form-item>
       <el-form-item label="状态" prop="state">
-        <el-input v-model="queryParams.state" placeholder="请输入状态" @keyup.enter.native="handleQuery" clearable class="inp" />
+        <el-select v-model="queryParams.state" placeholder="请选择状态" clearable class="se">
+          <el-option value="0" label="启用"></el-option>
+          <el-option value="1" label="停用"></el-option>
+        </el-select>
       </el-form-item>
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>

+ 6 - 4
app/pages/user/index.vue

@@ -5,7 +5,7 @@
 			<view class="con" v-if="user.id">
 				<view class="nickName">
 					{{ user.patientName ? user.patientName : '还未绑定就诊人' }}
-					<text class="icon" v-if="user.bindUserList.length > 1" @click.stop="show = true">&#xe6a7;</text>
+					<text class="icon" v-if="user.bindUserList.length > 1" @click.stop="show = true">&#xe6a7;切换就诊人</text>
 				</view>
 				<view class="welcome">欢迎使用岑溪人民医院小程序</view>
 			</view>
@@ -136,14 +136,16 @@ export default {
 			padding-left: 15px;
 			.nickName {
 				padding-top: 5px;
+				.icon {
+					padding-left: 6px;
+					font-size: 13px;
+					color: $main-color;
+				}
 			}
 			.welcome {
 				font-size: 14px;
 				padding-top: 5px;
 				color: #989898;
-				.icon {
-					padding-right: 3px;
-				}
 			}
 		}
 		.edit {

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

@@ -21,8 +21,8 @@ public class FollowRecord extends BaseData {
 
     private Long id;
 
-    @ApiModelProperty(value = "医生id")
-    private Long userId;
+    @ApiModelProperty(value = "提醒类型:0=复诊,1=回访")
+    private Integer type;
 
     @ApiModelProperty(value = "患者id")
     private Long patientId;
@@ -39,9 +39,6 @@ public class FollowRecord extends BaseData {
     @ApiModelProperty(value = "状态:0=未回访,1=已回访")
     private Integer state;
 
-    @ApiModelProperty(value = "部门ID")
-    private Long deptId;
-
     @TableField(exist = false)
     private List<Patient> patientList;
 }

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

@@ -1,6 +1,7 @@
 package com.ruoyi.web.work.service.impl;
 
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ruoyi.common.annotation.DataScope;
 import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.exception.ServiceException;
 import com.ruoyi.web.work.api.util.AppUtil;
@@ -25,6 +26,7 @@ public class FollowRecordServiceImpl extends ServiceImpl<FollowRecordMapper, Fol
     @Autowired
     private FollowRecordMapper followRecordMapper;
 
+    @DataScope(deptAlias = "k")
     @Override
     public List<FollowRecord> selectList(FollowRecord followRecord) {
         return followRecordMapper.selectList(followRecord);
@@ -71,6 +73,7 @@ public class FollowRecordServiceImpl extends ServiceImpl<FollowRecordMapper, Fol
         List<FollowRecord> followRecordList = new ArrayList<>();
         followRecord.getPatientList().forEach(e -> {
             FollowRecord record = new FollowRecord();
+            record.setType(followRecord.getType());
             record.setTemplateName(followRecord.getTemplateName());
             record.setOp(followRecord.getOp());
             record.setPatientId(e.getId());

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

@@ -17,10 +17,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         tb_follow_record k
         LEFT JOIN sys_dept d ON d.dept_id = k.dept_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>
             <if test="patientId != null "> AND k.patient_id = #{patientId}</if>
             <if test="userId != null "> and k.user_id = #{userId}</if>
             <if test="state != null "> and k.state = #{state}</if>
             <if test="deptId != null "> and k.dept_id = #{deptId}</if>
+            <if test="deptId != null and deptId != 0">AND (k.dept_id = #{deptId} OR k.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{deptId}, ancestors) ))</if>
+            <!-- 数据范围过滤 -->
+            ${params.dataScope}
     </select>
 
     <select id="selectAppList" resultType="com.ruoyi.web.work.domain.FollowRecord">