PatientBaseList.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. <template>
  2. <el-select v-model="currentWard"
  3. :clearable="wardsClearable"
  4. style="width: 110px"
  5. @change="fetchOverviews">
  6. <el-option v-for="item in allWards"
  7. :key="item.code"
  8. :label="item.name"
  9. :value="item.code"/>
  10. </el-select>
  11. <el-input v-model="queryPatNo" clearable style="width: 90px" placeholder="住院号"
  12. @keyup.enter="queryPatientInfoClick"></el-input>
  13. <el-button icon="Search" type="primary" @click="queryPatientInfoClick">查询</el-button>
  14. <br>
  15. <el-table :data="cptOverviews"
  16. height="800"
  17. @row-click="handleClickOverview"
  18. ref="elTableRef"
  19. highlight-current-row
  20. class="remove_hover"
  21. @selection-change="handleSelectionChange"
  22. >
  23. <el-table-column fixed v-if="props.selectFlag" type="selection" width="35"></el-table-column>
  24. <el-table-column label="床" prop="bedNo" width="30"/>
  25. <el-table-column label="姓名" width="70" prop="name">
  26. <template #default="{row}">
  27. <span>
  28. {{ row.name }}
  29. </span>
  30. </template>
  31. </el-table-column>
  32. <el-table-column label="住院号" prop="inpatientNo" width="65">
  33. <template #default="{row}">
  34. <div :style="{color: row.dismissOrder ===1 ? 'red' : '#19e63c'}">
  35. {{ row.inpatientNo }}
  36. </div>
  37. </template>
  38. </el-table-column>
  39. <el-table-column label="性别" prop="sex" width="65">
  40. <template #default="scope">
  41. {{ cptSex(scope.row.sex) }}
  42. </template>
  43. </el-table-column>
  44. </el-table>
  45. </template>
  46. <script setup name='PatientBaseList'>
  47. import {computed, onMounted, ref} from "vue";
  48. import {getOverView} from "@/api/inpatient/patient";
  49. import {allWardsVisible} from "@/utils/permission";
  50. import {cptSex} from "@/utils/computed";
  51. import {cqYzPrint, lsYzPrint,queryPatientInfo,queryYz,getPatientBaseInfo} from "@/api/medical-advice/medical-advice-management";
  52. import {getAllWards} from "@/api/zhu-yuan-yi-sheng/resident-doctor";
  53. import sleep from "@/utils/sleep";
  54. const selections = ref([])
  55. const myPatient = ref(false)
  56. const queryPatNo = ref('')
  57. const wardsClearable = allWardsVisible()
  58. const allWards = ref([])
  59. const currentWard = ref()
  60. const overviews = ref([])
  61. const emit = defineEmits(['selectPatientInfo','allPatientList']);
  62. const props = defineProps({
  63. yzType: {
  64. type: String
  65. },
  66. selectFlag : {
  67. type: Boolean
  68. }
  69. })
  70. const fetchOverviews = () => {
  71. getOverView(currentWard.value).then((res) => {
  72. overviews.value = res
  73. })
  74. }
  75. const queryPatientInfoClick=()=>{
  76. queryPatientInfo(currentWard.value,queryPatNo.value).then((res) => {
  77. overviews.value = res
  78. })
  79. }
  80. const cptOverviews = computed(() => {
  81. if(props.selectFlag){
  82. emit('allPatientList',overviews.value)
  83. }
  84. return overviews.value
  85. })
  86. const elTableRef = ref(null)
  87. //行点击事件
  88. const handleClickOverview = (row) => {
  89. if(props.yzType=='cq'){
  90. cqYzPrint(row.inpatientNo,row.admissTimes).then((res) => {
  91. let val = {patientInfo:res.patientInfo,yzPrintVOList:res.yzPrintVOList}
  92. emit('selectPatientInfo',val)
  93. })
  94. }else if(props.yzType=='ls'){
  95. lsYzPrint(row.inpatientNo,row.admissTimes).then((res) => {
  96. let val = {patientInfo:res.patientInfo,yzPrintVOList:res.yzPrintVOList}
  97. emit('selectPatientInfo',val)
  98. })
  99. }else if(props.yzType=='cxyz'){
  100. let queryData ={
  101. patNo:row.inpatientNo,
  102. times:row.admissTimes,
  103. queryRange:'0',
  104. statusFlag:'3'
  105. }
  106. queryYz(queryData).then((res) => {
  107. let val = {patientInfo:res.patientInfo,
  108. yzDataList:res.yzDataList,
  109. queryRange:queryData.queryRange,
  110. statusFlag:queryData.statusFlag
  111. }
  112. emit('selectPatientInfo',val)
  113. })
  114. }else {
  115. let params = {inpatientNo:row.inpatientNo,
  116. admissTimes:row.admissTimes}
  117. getPatientBaseInfo(params).then((res) => {
  118. let val = {patientInfo:res}
  119. emit('selectPatientInfo',val)
  120. })
  121. }
  122. }
  123. const handleSelectionChange = (val) => {
  124. if(props.selectFlag){
  125. selections.value = val
  126. emit('selectPatientInfo',val)
  127. }
  128. }
  129. onMounted(() => {
  130. getAllWards().then((res) => {
  131. if (res.length > 0) {
  132. allWards.value = res
  133. currentWard.value = wardsClearable ? '' : res[0].code
  134. fetchOverviews()
  135. }
  136. })
  137. })
  138. </script>
  139. <style scoped lang="scss">
  140. .el_table__current {
  141. background-color: #a7d3ff;
  142. }
  143. </style>