JieShouHuiZhen.vue 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. <template>
  2. <page-layer>
  3. <template #header>
  4. <el-date-picker v-model="dateRange"
  5. :shortcuts="shortcuts"
  6. style="width: 220px"
  7. end-placeholder="结束日期"
  8. range-separator="至"
  9. start-placeholder="开始日期"
  10. type="daterange"/>
  11. <el-checkbox v-model="history" label="历史" @change="historyFunc"/>
  12. <el-button icon="Search" type="primary" @click="getHuiZhenDataClick">检索</el-button>
  13. <el-button icon="Upload" type="primary" @click="baoCunHuiZhenClick" v-if="!history">保存</el-button>
  14. <el-button icon="Printer" type="success" @click="daYingClick">打印</el-button>
  15. <el-button icon="View" type="info" @click="dianJiChaKanHuanZheJianYan">查看患者检验</el-button>
  16. <el-button type="primary" @click="enterMedicalOrder" v-if="!history">医嘱录入</el-button>
  17. <el-tag type="danger">会诊意见限制 1100 个字</el-tag>
  18. </template>
  19. <template #main>
  20. <pat-infomation-dialog
  21. v-if="dialog"
  22. @closed="dialog = false"
  23. :pat-no="rowData.inpatientNo"
  24. :times="rowData.admissTimes"
  25. :leave-hospital="1"
  26. :dics="dics"/>
  27. <el-container>
  28. <el-aside width="500px">
  29. <xc-table :local-data="huanZeData" :final-height="windowSize.h / 1.1" @row-click="dianJiDanYuanGe">
  30. <el-table-column label="床号" prop="bedNo" width="40px"></el-table-column>
  31. <el-table-column label="住院号_次数" prop="inpatientNo">
  32. <template #default="scope"> {{ scope.row.inpatientNo }}_{{ scope.row.admissTimes }}</template>
  33. </el-table-column>
  34. <el-table-column label="姓名_申请次数" prop="name">
  35. <template #default="scope"> {{ scope.row.name }}_{{ scope.row.reqTimes }}</template>
  36. </el-table-column>
  37. <el-table-column label="患者科室" prop="deptCodeName">
  38. <template #default="scope">
  39. {{ scope.row.deptCodeName }}
  40. </template>
  41. </el-table-column>
  42. <el-table-column label="会诊科室" prop="reqDept1Name"></el-table-column>
  43. <el-table-column label="会诊级别" prop="hzType">
  44. <template #default="scope">
  45. {{ hzJiBie(scope.row.hzType) }}
  46. </template>
  47. </el-table-column>
  48. <el-table-column fixed="left" label="信息">
  49. <template #default="{row}">
  50. <el-button @click.stop="information(row)">信息</el-button>
  51. </template>
  52. </el-table-column>
  53. </xc-table>
  54. </el-aside>
  55. <el-main>
  56. <div style="overflow: auto;" :style="{height: windowSize.h - 30 + 'px'}">
  57. <print-the-consultation-form ref="daYingHuiZhenRef"/>
  58. </div>
  59. </el-main>
  60. </el-container>
  61. </template>
  62. </page-layer>
  63. </template>
  64. <script setup>
  65. import {getHuanZheXinXi, getHuiZhenData, wanChenHuiZhen} from '@/api/case-front-sheet/jie-shou-hui-zhen'
  66. import store from '@/store'
  67. import {getDateRangeFormatDate, getDatetime, getFormatDatetime} from '@/utils/date'
  68. import {ElMessage, ElMessageBox} from 'element-plus'
  69. import {computed, onMounted, ref} from 'vue'
  70. import {stringIsBlank} from '@/utils/blank-utils'
  71. import {shortcuts} from '@/data/shortcuts'
  72. import router from '@/router'
  73. import {getServerDateApi} from '@/api/public-api'
  74. import PageLayer from "@/layout/PageLayer";
  75. import PrintTheConsultationForm from "@/components/hui-zhen-da-ying/PrintTheConsultationForm.vue";
  76. import XcTable from "@/components/xiao-chan/xc-table/XcTable.vue";
  77. import PatInfomationDialog from "@/components/pat-info-list/PatInfomationDialog.vue";
  78. import {getAllDictionary} from "@/api/case-front-sheet";
  79. import {operations} from "@/data";
  80. import {autopsies, haveOrNot, yesOrNo} from "@/views/hospitalization/case-front-sheet/common";
  81. ////////////////////////////// 获取屏幕高度 /////////////////////////////////////////
  82. const windowSize = computed(() => {
  83. return store.state.app.windowSize
  84. })
  85. const daYingHuiZhenRef = ref(null)
  86. ////////////////////////////// 获取患者信息 /////////////////////////////////////////
  87. const dateRange = ref([])
  88. const huanZeData = ref([])
  89. const history = ref(false)
  90. const getHuiZhenDataClick = () => {
  91. let {startTime, endTime} = getDateRangeFormatDate(dateRange.value)
  92. getHuiZhenData(startTime, endTime, history.value).then((res) => {
  93. huanZeData.value = res
  94. })
  95. }
  96. const historyFunc = () => {
  97. huanZeData.value = []
  98. huanZheXinXi.value = {}
  99. daYingHuiZhenRef.value.huiZhenXinXiXiangQing({})
  100. }
  101. //////////////////////////////////////////// 点击右边的表格 ///////////////////////////////////////////////////////////
  102. const huanZheXinXi = ref({})
  103. const dianJiDanYuanGe = (val) => {
  104. getHuanZheXinXi(val.admissTimes, val.reqTimes, val.inpatientNo).then((res) => {
  105. huanZheXinXi.value = res
  106. daYingHuiZhenRef.value.huiZhenXinXiXiangQing(res)
  107. })
  108. }
  109. /**
  110. * 点击保存 会诊信息
  111. * 要判断 一下 是仅保存 还是 完成会诊
  112. */
  113. const baoCunHuiZhenClick = () => {
  114. if (!huanZheXinXi.value.name) {
  115. ElMessage({
  116. message: '请先选择患者',
  117. showClose: true,
  118. type: 'error',
  119. })
  120. return
  121. }
  122. if (stringIsBlank(huanZheXinXi.value.hzComment)) {
  123. return ElMessage({
  124. message: '请填写会诊意见',
  125. showClose: true,
  126. type: 'error',
  127. })
  128. }
  129. ElMessageBox.confirm('是否保存【' + huanZheXinXi.value.name + '】的会诊信息', '提示', {
  130. type: 'warning',
  131. distinguishCancelAndClose: true,
  132. cancelButtonText: '仅保存',
  133. confirmButtonText: '完成会诊',
  134. })
  135. .then(async () => {
  136. huanZheXinXi.value.statusFlag = 2
  137. // 完成 会诊 发送 axios
  138. await wanChenHuiZhen(huanZheXinXi.value)
  139. await getHuiZhenDataClick()
  140. huanZheXinXi.value = {}
  141. daYingHuiZhenRef.value.huanZheXinXi.value = {}
  142. })
  143. .catch((e) => {
  144. if (e === 'cancel') {
  145. huanZheXinXi.value.statusFlag = 1
  146. wanChenHuiZhen(huanZheXinXi.value)
  147. }
  148. })
  149. }
  150. ///////////////////////////////////////////////////////// 开启打印 ///////////////////////////////////////////////////////////////////////////////
  151. const daYingClick = () => {
  152. if (!huanZheXinXi.value.inpatientNo) {
  153. ElMessage.error({
  154. message: '请先选择患者',
  155. showClose: true,
  156. })
  157. return
  158. }
  159. daYingHuiZhenRef.value.daYing()
  160. }
  161. ///////////////////////////// 查看患者检验
  162. const dianJiChaKanHuanZheJianYan = () => {
  163. if (!huanZheXinXi.value.inpatientNo) {
  164. return ElMessage({
  165. message: '请先选择患者',
  166. showClose: true,
  167. type: 'error',
  168. })
  169. } else {
  170. let end = ''
  171. getServerDateApi().then((res) => {
  172. end = getFormatDatetime(res, 'YYYY-MM-DD')
  173. router.push({
  174. name: 'inspectionReportIndex',
  175. params: {
  176. passRule: true,
  177. patNo: huanZheXinXi.value.inpatientNo,
  178. start: huanZheXinXi.value.admissDate,
  179. end: end,
  180. },
  181. })
  182. })
  183. }
  184. }
  185. // 跳转到医嘱录入页面
  186. const enterMedicalOrder = () => {
  187. if (!huanZheXinXi.value.inpatientNo) {
  188. return ElMessage({
  189. message: '请先选择患者',
  190. showClose: true,
  191. type: 'error',
  192. })
  193. } else {
  194. router.push({
  195. name: 'yiZhuLuRu',
  196. params: {
  197. inpatientNo: huanZheXinXi.value.inpatientNo,
  198. admissTimes: huanZheXinXi.value.admissTimes
  199. }
  200. })
  201. }
  202. }
  203. const rowData = ref({})
  204. const dialog = ref(false)
  205. const dics = ref({})
  206. const information = (row) => {
  207. rowData.value = row
  208. dialog.value = true
  209. }
  210. onMounted(() => {
  211. dateRange.value[0] = shortcuts[0].value[0]
  212. dateRange.value[1] = shortcuts[0].value[1]
  213. getHuiZhenDataClick()
  214. getAllDictionary().then(res => {
  215. res.getOperations = operations;
  216. res.getYesOrNo = yesOrNo;
  217. res.getHaveOrNot = haveOrNot;
  218. res.getAutopsies = autopsies;
  219. dics.value = res
  220. })
  221. })
  222. // 会诊级别
  223. function hzJiBie(val) {
  224. switch (val) {
  225. case '1':
  226. return '主治医师'
  227. case '2':
  228. return '副主任医生'
  229. case '3':
  230. return '主任医生'
  231. }
  232. }
  233. </script>
  234. <style></style>