Treated.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. <template>
  2. <el-container>
  3. <el-main>
  4. <div style="height: 10px"></div>
  5. <div style="width: 320px; margin-bottom: 8px">
  6. <el-input v-model="searchContent" size="small" clearable placeholder="请输入患者姓名 / ID号">
  7. <template #prepend>检索患者</template>
  8. </el-input>
  9. </div>
  10. <el-table :data="cptPatients.slice((currentPage - 1) * pageSize, currentPage * pageSize)" stripe highlight-current-row :height="tableHeight" size="middle">
  11. <el-table-column fixed prop="fzNo" label="分诊号" sortable></el-table-column>
  12. <el-table-column fixed prop="name" label="姓名"></el-table-column>
  13. <el-table-column prop="patientId" label="id号"></el-table-column>
  14. <el-table-column prop="deptName" label="科室"></el-table-column>
  15. <el-table-column prop="roomName" label="诊室"></el-table-column>
  16. <el-table-column prop="doctorName" label="医生"></el-table-column>
  17. <el-table-column prop="serialNo" label="流水号" sortable></el-table-column>
  18. <el-table-column label="状态">
  19. <template #default="scope">
  20. {{ statusFlagFilter(scope.row.statusFlag) }}
  21. </template>
  22. </el-table-column>
  23. <el-table-column fixed="right" label="操作">
  24. <template #default="scope">
  25. <el-button type="primary" @click="getDepts(scope.row)">复诊</el-button>
  26. </template>
  27. </el-table-column>
  28. </el-table>
  29. <el-pagination
  30. @size-change="handleSizeChange"
  31. @current-change="handleCurrentChange"
  32. :current-page="currentPage"
  33. :page-sizes="[15, 30, 45, 70, 100]"
  34. :page-size="pageSize"
  35. layout="total, sizes, prev, pager, next, jumper"
  36. :total="patients.length"
  37. style="margin-top: 5px"
  38. ></el-pagination>
  39. <el-dialog v-model="showTriageDialog" title="选择诊室" width="50%">
  40. <div style="background-color: lightblue; padding: 4px 8px; margin-top: -16px; border-radius: 4px; color: red">
  41. <div class="dialog-head">
  42. <div style="width: 20%">病人Id:{{ currentPatient.patientId }}</div>
  43. <div style="width: 20%">姓名:{{ currentPatient.name }}</div>
  44. <div style="width: 40%">挂号时间:{{ currentPatient.visitDate }}</div>
  45. <div style="width: 20%">诊查费:{{ currentPatient.clinicFee }}</div>
  46. </div>
  47. <div class="dialog-head">
  48. <div style="width: 20%">科室:{{ currentPatient.deptName }}</div>
  49. <div style="width: 20%">医生:{{ currentPatient.doctorName }}</div>
  50. <div style="width: 40%">号别:{{ currentPatient.reqName }}</div>
  51. <div style="width: 20%">挂号费:{{ currentPatient.ghFee }}</div>
  52. </div>
  53. </div>
  54. <div style="display: flex">
  55. <div style="width: 25%">
  56. <el-table ref="chosenDeptsTable" :data="chosenDepts" stripe highlight-current-row height="350" @row-click="fetchRooms">
  57. <el-table-column type="index" label="序号"></el-table-column>
  58. <el-table-column prop="name" label="科室"></el-table-column>
  59. </el-table>
  60. </div>
  61. <div style="width: 75%">
  62. <el-table ref="roomTable" :data="rooms" height="350" stripe highlight-current-row>
  63. <el-table-column fixed label="操作">
  64. <template #default="scope">
  65. <el-button type="primary" @click="executeTriage(scope.row)">分诊</el-button>
  66. </template>
  67. </el-table-column>
  68. <el-table-column prop="roomNo" label="诊室号"></el-table-column>
  69. <el-table-column prop="roomName" label="诊室名称"></el-table-column>
  70. <el-table-column prop="doctorName" label="医生"></el-table-column>
  71. <el-table-column prop="reqName" label="号别"></el-table-column>
  72. </el-table>
  73. </div>
  74. </div>
  75. </el-dialog>
  76. </el-main>
  77. </el-container>
  78. </template>
  79. <script>
  80. import { ref } from 'vue'
  81. import { watch } from '@vue/runtime-core'
  82. import store from '@/store'
  83. import { fenZhen, getTreatedPatients, getChosenDept, getRooms } from '@/api/triage/triage'
  84. import { onActivated } from 'vue'
  85. import { ElMessage } from 'element-plus'
  86. export default {
  87. setup() {
  88. const windowSize = store.state.app.windowSize
  89. const tableHeight = windowSize.h - 100
  90. const patients = ref([])
  91. const searchContent = ref('')
  92. const pageSize = ref(30)
  93. const currentPage = ref(1)
  94. const handleSizeChange = (val) => {
  95. pageSize.value = val
  96. }
  97. const handleCurrentChange = (val) => {
  98. currentPage.value = val
  99. }
  100. const fetchTreatedPatients = () => {
  101. getTreatedPatients().then((res) => {
  102. patients.value = res
  103. })
  104. }
  105. const cptPatients = computed(() => {
  106. if (!searchContent.value) {
  107. return patients.value
  108. }
  109. return patients.value.filter((item) => {
  110. return item.patientId.indexOf(searchContent.value) !== -1 || item.name.indexOf(searchContent.value) !== -1
  111. })
  112. })
  113. watch(
  114. () => cptPatients.value,
  115. () => {
  116. currentPage.value = 1
  117. }
  118. )
  119. const showTriageDialog = ref(false)
  120. const chosenDeptsTable = ref(null)
  121. const roomTable = ref(null)
  122. const currentPatient = ref({})
  123. const chosenDepts = ref([])
  124. const rooms = ref([])
  125. const getDepts = (row) => {
  126. currentPatient.value = row
  127. getChosenDept().then((res) => {
  128. chosenDepts.value = res
  129. showTriageDialog.value = true
  130. res.forEach((item) => {
  131. if (item.code === row.deptCode.trim()) {
  132. setTimeout(() => {
  133. chosenDeptsTable.value.setCurrentRow(item)
  134. fetchRooms(item)
  135. }, 100)
  136. }
  137. })
  138. })
  139. }
  140. const fetchRooms = (row) => {
  141. getRooms(row.code).then((res) => {
  142. rooms.value = res
  143. res.forEach((item) => {
  144. if (item.doctorCode.trim() === currentPatient.value.doctorCode.trim()) {
  145. setTimeout(() => {
  146. roomTable.value.setCurrentRow(item)
  147. }, 100)
  148. }
  149. })
  150. })
  151. }
  152. const executeTriage = (row) => {
  153. row.serialNo = currentPatient.value.serialNo
  154. row.fuzhenFlag = 1
  155. fenZhen(row).then((res) => {
  156. showTriageDialog.value = false
  157. ElMessage({
  158. message: res,
  159. type: 'success',
  160. duration: 2000,
  161. showClose: true,
  162. })
  163. })
  164. }
  165. onActivated(() => {
  166. fetchTreatedPatients()
  167. })
  168. return {
  169. tableHeight,
  170. statusFlagFilter,
  171. roomStatusFilter,
  172. patients,
  173. searchContent,
  174. cptPatients,
  175. pageSize,
  176. currentPage,
  177. handleSizeChange,
  178. handleCurrentChange,
  179. getChosenDept,
  180. getDepts,
  181. showTriageDialog,
  182. currentPatient,
  183. chosenDeptsTable,
  184. chosenDepts,
  185. rooms,
  186. fetchRooms,
  187. executeTriage,
  188. roomTable,
  189. }
  190. },
  191. }
  192. function statusFlagFilter(val) {
  193. switch (val) {
  194. case '0':
  195. return '初值'
  196. case '1':
  197. return '报到'
  198. case '2':
  199. return '可通知'
  200. case '3':
  201. return '已通知'
  202. case '4':
  203. return '检查'
  204. case '9':
  205. return '就诊'
  206. }
  207. }
  208. function roomStatusFilter(val) {
  209. return val === 0 ? '在线' : '离线'
  210. }
  211. </script>
  212. <style scoped>
  213. .dialog-head {
  214. display: flex;
  215. height: 26px;
  216. line-height: 26px;
  217. }
  218. </style>