JieShouHuiZhen.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302
  1. <template>
  2. <el-container>
  3. <el-header height="36px" style="margin-top: 8px">
  4. <el-date-picker v-model="dateRange" type="daterange" range-separator="至" start-placeholder="开始日期"
  5. end-placeholder="结束日期"></el-date-picker>
  6. <el-button @click="getHuiZhenDataClick" type="primary" icon="el-icon-search">检索</el-button>
  7. <el-button icon="el-icon-upload" type="primary" @click="baoCunHuiZhenClick">保存</el-button>
  8. <el-button icon="el-icon-printer" type="success" @click="daYingClick">打印</el-button>
  9. <el-tag type="danger">会诊意见限制 1100 个字</el-tag>
  10. </el-header>
  11. <el-container>
  12. <el-aside width="400px">
  13. <el-table :data="huanZeData" :height="tableHeight" @row-click="dianJiDanYuanGe" stripe highlight-current-row>
  14. <el-table-column label="床号" prop="bedNo" width="40px"></el-table-column>
  15. <el-table-column label="住院号" prop="inpatientNo"></el-table-column>
  16. <el-table-column label="住院次数" prop="admissTimes"></el-table-column>
  17. <el-table-column label="姓名" prop="name"></el-table-column>
  18. <el-table-column label="申请次数" prop="reqTimes"></el-table-column>
  19. </el-table>
  20. <el-pagination
  21. :pager-count="5"
  22. small
  23. :total="total"
  24. layout="prev, pager, next,total"
  25. :current-page="currentPage"
  26. :page-size="pageSize"
  27. @current-change="handleCurrentChange"
  28. ></el-pagination>
  29. </el-aside>
  30. <el-main>
  31. <div :style="mainInfo" class="main-info-parent">
  32. <div id="huiZhenXinXiDaYin">
  33. <h1 style="text-align: center; font-size: 30px">湖南泰和医院</h1>
  34. <h4 style="text-align: center; font-size: 17px; margin-top: 0px">会 诊 记 录 单</h4>
  35. <div class="divHuanZheXinXi">
  36. <div class="huanZheXinXi" style="margin-left: 20px">住院号:{{ huanZheXinXi.inpatientNo }}</div>
  37. <div class="huanZheXinXi" style="margin-left: 25px">姓名:{{ huanZheXinXi.name }}</div>
  38. <div class="huanZheXinXi">性别:{{ cptSex(huanZheXinXi.sex) }}</div>
  39. <div class="huanZheXinXi" style="width: 90px">年龄:{{ huanZheXinXi.age }}</div>
  40. <div class="huanZheXinXi" style="width: 140px">科室:{{ huanZheXinXi.deptCodeName }}</div>
  41. <div class="huanZheXinXi">床号:{{ huanZheXinXi.bedNo }}</div>
  42. </div>
  43. <div class="huiZhenBody">
  44. <div>
  45. <div>
  46. <div class="reqDept">{{ huanZheXinXi.reqDept1 }}</div>
  47. 会诊
  48. <div class="huiZhenJiBie">会诊类别:{{ hzLeiBie(huanZheXinXi.hzType) }}</div>
  49. </div>
  50. </div>
  51. <!-- 病情简介 -->
  52. <div class="zhenDuanBianJu">
  53. 病情简介 <br/>
  54. <textarea v-model="huanZheXinXi.reqComment" readonly="value" class="zhenDuanTextarea"
  55. style="height: 154px"/>
  56. </div>
  57. <!-- 目前主要诊断 -->
  58. <div class="zhenDuanBianJu">
  59. 目前主要诊断 <br/>
  60. <textarea v-model="huanZheXinXi.hzZd" readonly="value" class="zhenDuanTextarea"
  61. style="height: 50px"></textarea>
  62. </div>
  63. <!-- 会诊目的 -->
  64. <div class="zhenDuanBianJu">
  65. 会诊目的 <br/>
  66. <textarea v-model="huanZheXinXi.hzMd" readonly="value" class="zhenDuanTextarea"
  67. style="height: 50px"></textarea>
  68. </div>
  69. <div class="qingQiuHuiZhenXinXi">
  70. <div class="div1">请求会诊科室:{{ huanZheXinXi.deptCodeName }}</div>
  71. <div class="div2">会诊申请医师:{{ huanZheXinXi.reqDoctor }}</div>
  72. <div>申请时间:{{ huanZheXinXi.reqDate }}</div>
  73. </div>
  74. </div>
  75. <!-- 会诊意见 -->
  76. <div class="huiZhenBody">
  77. <!-- 会诊意见 -->
  78. <div class="zhenDuanBianJu">
  79. 会诊意见 <br/>
  80. <textarea
  81. maxlength="1100"
  82. autoHeight="true"
  83. v-model="huanZheXinXi.hzComment"
  84. class="zhenDuanTextarea"
  85. style="height: 329px"
  86. onkeydown="javascript:if(event.keyCode == 13)event.returnValue = false;"
  87. >
  88. </textarea>
  89. </div>
  90. <div class="qingQiuHuiZhenXinXi">
  91. <div class="div1">会诊科室:{{ deptName }}</div>
  92. <div class="div2">医师:{{ doctorName }}</div>
  93. <div>会诊时间:{{ shiShidate }}</div>
  94. </div>
  95. </div>
  96. </div>
  97. </div>
  98. </el-main>
  99. </el-container>
  100. </el-container>
  101. </template>
  102. <script>
  103. import {ref} from '@vue/reactivity'
  104. import {getDeptName, getHuanZheXinXi, getHuiZhenData, wanChenHuiZhen} from '@/api/case-front-sheet/jie-shou-hui-zhen'
  105. import {cptSex} from '@/utils/computed'
  106. import store from '@/store'
  107. import {getDateRangeFormatDate, getDate, getDatetime} from '@/utils/date'
  108. import {onActivated, onDeactivated, onMounted} from '@vue/runtime-core'
  109. import {ElMessage, ElMessageBox} from 'element-plus'
  110. import '@/css/hui-zhen-ji-lv-dan.css'
  111. import {initLodop, getLodop} from '@/utils/c-lodop'
  112. import {huiZhenJiLvDanCss} from '../../../data/css-for-print'
  113. export default {
  114. setup() {
  115. ////////////////////////////// 获取屏幕高度 /////////////////////////////////////////
  116. const windowSize = store.state.app.windowSize
  117. const tableHeight = windowSize.h - 70
  118. const deptName = ref('')
  119. const doctorName = store.state.user.info.name
  120. const shiShidate = ref('')
  121. onMounted(() => {
  122. initLodop()
  123. let MoRenRiQi = getDate(new Date())
  124. dateRange.value[0] = MoRenRiQi
  125. dateRange.value[1] = MoRenRiQi
  126. getHuiZhenDataClick()
  127. getDeptName(store.state.user.info.deptCode).then((res) => {
  128. deptName.value = res
  129. })
  130. })
  131. /**
  132. * 实时获取 时间 先定义一个专门赋值的 函数
  133. * 在开启 计时器 1秒一次 在页面进入的时候 清除计时器 然后在打开
  134. * 在离开页面的时候也要开启
  135. */
  136. function shiJian() {
  137. shiShidate.value = getDatetime(new Date())
  138. }
  139. var interval = setInterval(shiJian, 1000)
  140. onActivated(() => {
  141. clearInterval(interval)
  142. interval = setInterval(shiJian, 1000)
  143. })
  144. onDeactivated(() => {
  145. clearInterval(interval)
  146. })
  147. ////////////////////////////// 获取患者信息 需分页 /////////////////////////////////////////
  148. const dateRange = ref([])
  149. const huanZeData = ref([])
  150. const currentPage = ref(1)
  151. const pageSize = ref(10)
  152. const total = ref(0)
  153. const getHuiZhenDataClick = () => {
  154. let riQi = getDateRangeFormatDate(dateRange.value)
  155. getHuiZhenData(store.state.user.info.deptCode, currentPage.value, pageSize.value, riQi.startTime, riQi.endTime).then((res) => {
  156. huanZeData.value = res.records
  157. total.value = res.total
  158. })
  159. }
  160. /// 点击下一页触发
  161. const handleCurrentChange = (val) => {
  162. currentPage.value = val
  163. getHuiZhenDataClick()
  164. }
  165. //////////////////////////////////////////// 点击右边的表格 ///////////////////////////////////////////////////////////
  166. const huanZheXinXi = ref({})
  167. const dianJiDanYuanGe = (val) => {
  168. getHuanZheXinXi(val.admissTimes, val.reqTimes, val.inpatientNo).then((res) => {
  169. huanZheXinXi.value = res
  170. })
  171. }
  172. /**
  173. * 点击保存 会诊信息
  174. * 要判断 一下 是仅保存 还是 完成会诊
  175. */
  176. const baoCunHuiZhenClick = () => {
  177. if (!huanZheXinXi.value.name) {
  178. ElMessage.error({
  179. message: '请先选择患者',
  180. showClose: true,
  181. })
  182. return
  183. }
  184. ElMessageBox.confirm('是否保存【' + huanZheXinXi.value.name + '】的会诊信息', '提示', {
  185. type: 'warning',
  186. closeOnClickModal: false,
  187. closeOnPressEscape: false,
  188. showClose: false,
  189. cancelButtonText: '仅保存',
  190. confirmButtonText: '完成会诊',
  191. })
  192. .then(() => {
  193. huanZheXinXi.value.statusFlag = 2
  194. // 完成 会诊 发送 axios
  195. wanChenHuiZhen(huanZheXinXi.value)
  196. getHuiZhenDataClick()
  197. huanZheXinXi.value = []
  198. })
  199. .catch(() => {
  200. huanZheXinXi.value.statusFlag = 1
  201. wanChenHuiZhen(huanZheXinXi.value)
  202. })
  203. }
  204. ///////////////////////////////////////////////////////// 开启打印 ///////////////////////////////////////////////////////////////////////////////
  205. const daYingClick = () => {
  206. if (!huanZheXinXi.value.name) {
  207. ElMessage.error({
  208. message: '请先选择患者',
  209. showClose: true,
  210. })
  211. return
  212. }
  213. // 在vue 中使用 v-model 绑定的 都需要 这样不然没有数据
  214. const allTextArea = document.body.getElementsByTagName('textarea')
  215. const textInput = document.body.getElementsByTagName('input')
  216. for (var i = 0; i < textInput.length; i++) {
  217. textInput[i].setAttribute('value', textInput[i].value)
  218. }
  219. for (let i = 0; i < allTextArea.length; i++) {
  220. allTextArea[i].innerText = allTextArea[i].value
  221. }
  222. // A4: 210毫米 × 297毫米 = 793.70px * 1122.52px
  223. let LODOP = getLodop()
  224. // 导入css样式,以及 内容
  225. var strFormHtml = huiZhenJiLvDanCss + '<body>' + document.getElementById('huiZhenXinXiDaYin').innerHTML + '</body>'
  226. LODOP.PRINT_INIT('会诊记录单') // 初始化打印机 名字
  227. LODOP.SET_PRINT_PAGESIZE(1, '210mm', '297mm', '') // 设置纸张大小 A4
  228. LODOP.SET_PRINT_MODE('FULL_WIDTH_FOR_OVERFLOW', true) // 整宽不变形
  229. LODOP.ADD_PRINT_HTM('2mm', '5mm', '100%', '100%', strFormHtml) //要打印的内容
  230. LODOP.SET_PRINT_STYLE('ItemType', 3) //设置对象风格
  231. LODOP.ADD_PRINT_TEXT('290mm', '190mm', '20mm', '2mm', '第#页/共&页') //增加纯文本项
  232. LODOP.PREVIEW() // 关闭
  233. }
  234. const mainInfo = {
  235. height: windowSize.h - 45 + 'px',
  236. padding: '0 20px',
  237. overflowY: 'scroll',
  238. }
  239. return {
  240. doctorName,
  241. tableHeight,
  242. huanZeData,
  243. currentPage,
  244. pageSize,
  245. total,
  246. cptSex,
  247. handleCurrentChange,
  248. huanZheXinXi,
  249. dianJiDanYuanGe,
  250. dateRange,
  251. getHuiZhenDataClick,
  252. baoCunHuiZhenClick,
  253. mainInfo,
  254. daYingClick,
  255. hzLeiBie,
  256. getDatetime,
  257. deptName,
  258. shiShidate,
  259. }
  260. },
  261. }
  262. function hzLeiBie(val) {
  263. switch (val) {
  264. case '1':
  265. return '常规会诊'
  266. case '2':
  267. return '疑难病例会诊'
  268. case '3':
  269. return '急救会诊'
  270. }
  271. }
  272. </script>
  273. <style></style>