1
0

search.vue 12 KB

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