1
0

search.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. <template>
  2. <div class="container" style="height: 80vh; width: 87vw">
  3. <el-row :gutter="10">
  4. <el-col :span="5">
  5. <!-- 左边的导航菜单 -->
  6. <div class="left-body">
  7. <el-menu default-active="1">
  8. <el-menu-item index="1" @click="activePatient(1)">
  9. <i class="el-icon-user"></i>
  10. <span>患者基本信息/亲属</span>
  11. </el-menu-item>
  12. <el-submenu index="2">
  13. <template slot="title">
  14. <i class="el-icon-document"></i>
  15. <span>就诊信息</span>
  16. </template>
  17. <el-submenu v-for="(mouths, year) in groupedDates" :key="year" :index="year.toString()">
  18. <template slot="title">
  19. <span>{{year}}年</span>
  20. </template>
  21. <el-submenu v-for="(days,month) in mouths" :key="month" :index="year.toString() + month.toString()">
  22. <template slot="title">
  23. <span>{{month}}月</span>
  24. </template>
  25. <el-menu-item v-for="item in days" @click="getCard(item.id); activePatient(2); getDgList()" :key="item.id" :index="item.id">
  26. {{year}}年{{month}}月{{item.day}}日
  27. </el-menu-item>
  28. </el-submenu>
  29. </el-submenu>
  30. </el-submenu>
  31. </el-menu>
  32. </div>
  33. </el-col>
  34. <el-col :span="19">
  35. <!-- 右边的信息显示 -->
  36. <div class="right-body">
  37. <!-- 患者基本信息/亲属 -->
  38. <div class="patient-info-nk" v-if="active === 1">
  39. <!-- 患者基本信息 -->
  40. <div class="patient-info">
  41. <el-descriptions style="width: 69vw; margin-top: 10px" title="患者信息" :column="3" border>
  42. <el-descriptions-item label="患者标识符">{{patientInfo.patientCode}}</el-descriptions-item>
  43. <el-descriptions-item label="就诊卡号">{{patientInfo.cardNumber}}</el-descriptions-item>
  44. <el-descriptions-item label="姓名">{{patientInfo.name}}</el-descriptions-item>
  45. <el-descriptions-item label="性别">
  46. <dict-tag :options="dict.type.patient_sex" :value="patientInfo.sex"/>
  47. </el-descriptions-item>
  48. <el-descriptions-item label="身份证号" prop="sfzh">{{patientInfo.sfzh}}</el-descriptions-item>
  49. <el-descriptions-item label="出生时间" prop="birthDate">{{patientInfo.birthDate}}</el-descriptions-item>
  50. <el-descriptions-item label="居住地址" prop="address">{{patientInfo.address}}</el-descriptions-item>
  51. <el-descriptions-item label="联系电话" prop="phone">{{patientInfo.phone}}</el-descriptions-item>
  52. <el-descriptions-item label="婚姻状况" prop="marital">
  53. <dict-tag :options="dict.type.patient_marital" :value="patientInfo.marital" />
  54. </el-descriptions-item>
  55. <el-descriptions-item label="民族" prop="nation">{{patientInfo.nation}}</el-descriptions-item>
  56. <el-descriptions-item label="职业" prop="career">{{patientInfo.career}}</el-descriptions-item>
  57. <el-descriptions-item label="国籍" prop="nationality">{{patientInfo.nationality}}</el-descriptions-item>
  58. <el-descriptions-item label="病历号" prop="blh">{{patientInfo.blh}}</el-descriptions-item>
  59. <el-descriptions-item label="病人卡号" prop="brkh">{{patientInfo.brkh}}</el-descriptions-item>
  60. <el-descriptions-item label="婴儿序号" prop="yexh">{{patientInfo.yexh}}</el-descriptions-item>
  61. </el-descriptions>
  62. </div>
  63. <!-- 患者亲属 -->
  64. <div class="patient-nk" style="margin-top: 10px">
  65. <el-table style="width:69vw;" height="calc(75vh - 270px)" :data="nkList" highlight-current-row>
  66. <el-table-column label="姓名" align="center" prop="name"></el-table-column>
  67. <el-table-column label="所属关系" align="center" prop="kinship"></el-table-column>
  68. <el-table-column label="近亲地址" align="center" prop="address"></el-table-column>
  69. <el-table-column label="联系电话" align="center" prop="phone"></el-table-column>
  70. <el-table-column label="工作名称" align="center" prop="workName"></el-table-column>
  71. <el-table-column label="工作类别" align="center" prop="workCode"></el-table-column>
  72. </el-table>
  73. <pagination v-show="totalNk > 0" :total="totalNk" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getNkList" />
  74. </div>
  75. </div>
  76. <!-- 诊断信息 -->
  77. <div class="dg-info" v-if="active === 2">
  78. <!-- 单次就诊的详细信息 -->
  79. <div class="pv">
  80. <el-descriptions :column="3" border style="width: 69vw; margin-top: 10px" title="就诊信息">
  81. <el-descriptions-item label="患者类别">
  82. <dict-tag :options="dict.type.patient_category" :value="pvList.patientCategory"></dict-tag>
  83. </el-descriptions-item>
  84. <el-descriptions-item label="所在病区">{{pvList.wardName}}</el-descriptions-item>
  85. <el-descriptions-item label="主治医生">{{pvList.physician}}</el-descriptions-item>
  86. <el-descriptions-item label="主管护士">{{pvList.nurseCode}}</el-descriptions-item>
  87. <el-descriptions-item label="在院状态">
  88. <dict-tag :options="dict.type.hospital_status" :value="pvList.hospitalStatus"/>
  89. </el-descriptions-item>
  90. <el-descriptions-item label="入院次数">{{pvList.hospitalizedNumber}}</el-descriptions-item>
  91. <el-descriptions-item label="就诊号码">{{pvList.cardId}}</el-descriptions-item>
  92. <el-descriptions-item label="出院方式">
  93. <dict-tag :options="dict.type.discharge_method" :value="pvList.dischargeMothod"/>
  94. </el-descriptions-item>
  95. <el-descriptions-item label="入院时间">{{pvList.admissionTime}}</el-descriptions-item>
  96. <el-descriptions-item label="出院时间">{{pvList.dischargeTime}}</el-descriptions-item>
  97. <el-descriptions-item label="危重级别">{{pvList.level}}</el-descriptions-item>
  98. <el-descriptions-item label="入区时间">{{pvList.entryTime}}</el-descriptions-item>
  99. <el-descriptions-item label="出区时间">{{pvList.exitTime}}</el-descriptions-item>
  100. <el-descriptions-item label="出区原因">{{pvList.reasonArea}}</el-descriptions-item>
  101. </el-descriptions>
  102. </div>
  103. <!-- 诊断结果列表 -->
  104. <div class="dg" style="margin-top: 10px">
  105. <el-table style=" width:69vw;" height="calc(75vh - 270px)" :data="dgList" highlight-current-row>
  106. <el-table-column label="诊断名称" align="center" prop="diagnosticName"></el-table-column>
  107. <el-table-column label="诊断代码" align="center" prop="diagnosticCode"></el-table-column>
  108. <el-table-column label="诊断时间" align="center" prop="diagnosisTime"></el-table-column>
  109. <el-table-column label="诊断类型" align="center" prop="diagnosticType">
  110. <template slot-scope="scope">
  111. <dict-tag :options="dict.type.diagnostic_type" :value="scope.row.diagnosticType"/>
  112. </template>
  113. </el-table-column>
  114. <el-table-column label="诊断类别" align="center" prop="diagnosticCategoryCode">
  115. <template slot-scope="scope">
  116. <dict-tag :options="dict.type.diagnostic_category_code" :value="scope.row.diagnosticCategoryCode"/>
  117. </template>
  118. </el-table-column>
  119. </el-table>
  120. <pagination v-show="totalDg > 0" :total="totalDg" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getDgList" />
  121. </div>
  122. </div>
  123. </div>
  124. </el-col>
  125. </el-row>
  126. </div>
  127. </template>
  128. <script>
  129. export default {
  130. dicts: ['patient_category','diagnostic_type', 'diagnostic_category_code','hospital_status','discharge_method','patient_sex','patient_marital'],
  131. data(){
  132. return{
  133. //groupDates的变量
  134. year:undefined,
  135. month:undefined,
  136. day:undefined,
  137. id:undefined,
  138. //显示的界面标记
  139. active:1,
  140. //获取就诊时间的记录
  141. timeList:null,
  142. //处理时间的分组
  143. groupedDates: {},
  144. //亲属表数据总条数
  145. totalNk:0,
  146. //诊断表数据总条数
  147. totalDg:0,
  148. //dg表数据
  149. dgList:null,
  150. //pv表数据
  151. pvList:null,
  152. //nk表数据
  153. nkList:null,
  154. //患者详细信息
  155. patientInfo:null,
  156. //就诊详细信息
  157. pvInfo:null,
  158. //查询参数
  159. queryParams:{
  160. pageNum:1,
  161. pageSize:10,
  162. visitId:undefined,
  163. }
  164. }
  165. },
  166. watch:{
  167. },
  168. created() {
  169. this.getTime();
  170. this.getPatient();
  171. this.activePatient(1);
  172. this.getNkList();
  173. },
  174. methods:{
  175. activePatient(sign) {
  176. if (sign === 1) {
  177. this.active = sign;
  178. }
  179. if (sign === 2) {
  180. this.active = sign;
  181. }
  182. },
  183. /** 查询某一次的就诊信息 */
  184. getCard(id){
  185. this.queryParams.visitId = id;
  186. this.get({
  187. url:'/work/visit/list',
  188. data:{
  189. id:id
  190. }
  191. }).then((response)=>{
  192. this.pvList = response.rows[0];
  193. })
  194. },
  195. /** 查询某科室某个病人的就诊记录 */
  196. getTime(){
  197. this.get({
  198. url:'/work/visit/list',
  199. data:{
  200. patId:this.param.id,
  201. department:this.param.department
  202. }
  203. }).then( (response) => {
  204. console.log(typeof response.rows[0].id)
  205. this.timeList = response.rows;
  206. console.log(this.timeList)
  207. this.groupDates(this.timeList);
  208. })
  209. },
  210. groupDates(dates) {
  211. dates.forEach(date => {
  212. this.year = date.admissionTime.substring(0, 4);
  213. this.month = date.admissionTime.substring(5, 7);
  214. this.day = date.admissionTime.substring(8, 10);
  215. this.id = date.id;
  216. if (!this.groupedDates[this.year]) {
  217. this.groupedDates[this.year] = {};
  218. }
  219. if (!this.groupedDates[this.year][this.month]) {
  220. this.groupedDates[this.year][this.month] = [];
  221. }
  222. this.groupedDates[this.year][this.month].push({id: this.id, day: this.day});
  223. })
  224. this.$forceUpdate();
  225. },
  226. /** 查询患者信息 */
  227. getPatient(){
  228. this.get({
  229. url:'/work/patient/detail/'+this.param.id,
  230. }).then((response)=>{
  231. this.patientInfo = response.data;
  232. })
  233. },
  234. /** 查询亲属表 */
  235. getNkList() {
  236. this.get({
  237. url:'/work/nk/list',
  238. data:{
  239. patId:this.param.id,
  240. ...this.queryParams
  241. }
  242. }).then((response)=>{
  243. this.nkList = response.rows;
  244. this.totalNk = response.total;
  245. })
  246. },
  247. /** 查询诊断记录表 */
  248. getDgList(){
  249. this.get({
  250. url:'/work/diagnosis/list',
  251. data: this.queryParams
  252. }).then((response)=>{
  253. this.dgList = response.rows;
  254. this.totalDg = response.total;
  255. })
  256. }
  257. }
  258. }
  259. </script>