JieShouHuiZhen.vue 11 KB

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