JieShouHuiZhen.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  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. <el-container>
  21. <el-aside width="500px">
  22. <xc-table :local-data="huanZeData" :final-height="windowSize.h / 1.1" @row-click="dianJiDanYuanGe">
  23. <el-table-column label="床号" prop="bedNo" width="40px"></el-table-column>
  24. <el-table-column label="住院号_次数" prop="inpatientNo">
  25. <template #default="scope"> {{ scope.row.inpatientNo }}_{{ scope.row.admissTimes }}</template>
  26. </el-table-column>
  27. <el-table-column label="姓名_申请次数" prop="name">
  28. <template #default="scope"> {{ scope.row.name }}_{{ scope.row.reqTimes }}</template>
  29. </el-table-column>
  30. <el-table-column label="患者科室" prop="deptCodeName">
  31. <template #default="scope">
  32. {{ scope.row.deptCodeName }}
  33. </template>
  34. </el-table-column>
  35. <el-table-column label="会诊科室" prop="reqDept1Name"></el-table-column>
  36. <el-table-column label="会诊级别" prop="hzType">
  37. <template #default="scope">
  38. {{ hzJiBie(scope.row.hzType) }}
  39. </template>
  40. </el-table-column>
  41. </xc-table>
  42. </el-aside>
  43. <el-main>
  44. <div style="overflow: auto;" :style="{height: windowSize.h - 30 + 'px'}">
  45. <print-the-consultation-form ref="daYingHuiZhenRef"/>
  46. </div>
  47. </el-main>
  48. </el-container>
  49. </template>
  50. </page-layer>
  51. </template>
  52. <script setup>
  53. import {getHuanZheXinXi, getHuiZhenData, wanChenHuiZhen} from '@/api/case-front-sheet/jie-shou-hui-zhen'
  54. import store from '@/store'
  55. import {getDateRangeFormatDate, getDatetime, getFormatDatetime} from '@/utils/date'
  56. import {ElMessage, ElMessageBox} from 'element-plus'
  57. import {computed, onMounted, ref} from 'vue'
  58. import {stringIsBlank} from '@/utils/blank-utils'
  59. import {shortcuts} from '@/data/shortcuts'
  60. import router from '@/router'
  61. import {getServerDateApi} from '@/api/public-api'
  62. import PageLayer from "@/layout/PageLayer";
  63. import PrintTheConsultationForm from "@/components/hui-zhen-da-ying/PrintTheConsultationForm.vue";
  64. import XcTable from "@/components/xiao-chan/xc-table/XcTable.vue";
  65. ////////////////////////////// 获取屏幕高度 /////////////////////////////////////////
  66. const windowSize = computed(() => {
  67. return store.state.app.windowSize
  68. })
  69. const daYingHuiZhenRef = ref(null)
  70. onMounted(() => {
  71. dateRange.value[0] = shortcuts[0].value[0]
  72. dateRange.value[1] = shortcuts[0].value[1]
  73. getHuiZhenDataClick()
  74. })
  75. ////////////////////////////// 获取患者信息 /////////////////////////////////////////
  76. const dateRange = ref([])
  77. const huanZeData = ref([])
  78. const history = ref(true)
  79. const getHuiZhenDataClick = () => {
  80. let {startTime, endTime} = getDateRangeFormatDate(dateRange.value)
  81. getHuiZhenData(startTime, endTime, history.value).then((res) => {
  82. console.log(res)
  83. huanZeData.value = res
  84. })
  85. }
  86. const historyFunc = () => {
  87. huanZeData.value = []
  88. huanZheXinXi.value = {}
  89. daYingHuiZhenRef.value.huiZhenXinXiXiangQing({})
  90. }
  91. //////////////////////////////////////////// 点击右边的表格 ///////////////////////////////////////////////////////////
  92. const huanZheXinXi = ref({})
  93. const dianJiDanYuanGe = (val) => {
  94. getHuanZheXinXi(val.admissTimes, val.reqTimes, val.inpatientNo).then((res) => {
  95. huanZheXinXi.value = res
  96. daYingHuiZhenRef.value.huiZhenXinXiXiangQing(res)
  97. })
  98. }
  99. /**
  100. * 点击保存 会诊信息
  101. * 要判断 一下 是仅保存 还是 完成会诊
  102. */
  103. const baoCunHuiZhenClick = () => {
  104. if (!huanZheXinXi.value.name) {
  105. ElMessage({
  106. message: '请先选择患者',
  107. showClose: true,
  108. type: 'error',
  109. })
  110. return
  111. }
  112. if (stringIsBlank(huanZheXinXi.value.hzComment)) {
  113. return ElMessage({
  114. message: '请填写会诊意见',
  115. showClose: true,
  116. type: 'error',
  117. })
  118. }
  119. ElMessageBox.confirm('是否保存【' + huanZheXinXi.value.name + '】的会诊信息', '提示', {
  120. type: 'warning',
  121. distinguishCancelAndClose: true,
  122. cancelButtonText: '仅保存',
  123. confirmButtonText: '完成会诊',
  124. })
  125. .then(() => {
  126. huanZheXinXi.value.statusFlag = 2
  127. // 完成 会诊 发送 axios
  128. wanChenHuiZhen(huanZheXinXi.value)
  129. getHuiZhenDataClick()
  130. huanZheXinXi.value = {}
  131. daYingHuiZhenRef.value.huanZheXinXi.value = {}
  132. })
  133. .catch((e) => {
  134. if (e === 'cancel') {
  135. huanZheXinXi.value.statusFlag = 1
  136. wanChenHuiZhen(huanZheXinXi.value)
  137. }
  138. })
  139. }
  140. ///////////////////////////////////////////////////////// 开启打印 ///////////////////////////////////////////////////////////////////////////////
  141. const daYingClick = () => {
  142. if (!huanZheXinXi.value.inpatientNo) {
  143. ElMessage.error({
  144. message: '请先选择患者',
  145. showClose: true,
  146. })
  147. return
  148. }
  149. daYingHuiZhenRef.value.daYing()
  150. }
  151. ///////////////////////////// 查看患者检验
  152. const dianJiChaKanHuanZheJianYan = () => {
  153. if (!huanZheXinXi.value.inpatientNo) {
  154. return ElMessage({
  155. message: '请先选择患者',
  156. showClose: true,
  157. type: 'error',
  158. })
  159. } else {
  160. let end = ''
  161. getServerDateApi().then((res) => {
  162. end = getFormatDatetime(res, 'YYYY-MM-DD')
  163. router.push({
  164. name: 'inspectionReportIndex',
  165. params: {
  166. passRule: true,
  167. patNo: huanZheXinXi.value.inpatientNo,
  168. start: huanZheXinXi.value.admissDate,
  169. end: end,
  170. },
  171. })
  172. })
  173. }
  174. }
  175. // 跳转到医嘱录入页面
  176. const enterMedicalOrder = () => {
  177. if (!huanZheXinXi.value.inpatientNo) {
  178. return ElMessage({
  179. message: '请先选择患者',
  180. showClose: true,
  181. type: 'error',
  182. })
  183. } else {
  184. router.push({
  185. name: 'yiZhuLuRu',
  186. params: {
  187. inpatientNo: huanZheXinXi.value.inpatientNo,
  188. admissTimes: huanZheXinXi.value.admissTimes
  189. }
  190. })
  191. }
  192. }
  193. // 会诊级别
  194. function hzJiBie(val) {
  195. switch (val) {
  196. case '1':
  197. return '主治医师'
  198. case '2':
  199. return '副主任医生'
  200. case '3':
  201. return '主任医生'
  202. }
  203. }
  204. function hzLeiBie(val) {
  205. switch (val) {
  206. case '1':
  207. return '常规会诊'
  208. case '2':
  209. return '疑难病例会诊'
  210. case '3':
  211. return '急救会诊'
  212. }
  213. }
  214. </script>
  215. <style></style>