lineUp.vue 25KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581
  1. <template>
  2. <div class="main-contain">
  3. <div class="position">
  4. <bread-crumb :crumbs="crumbs"></bread-crumb>
  5. <el-button
  6. size="small"
  7. icon="el-icon-menu"
  8. @click="fullscreenboard"
  9. type="primary"
  10. >全屏投影</el-button
  11. >
  12. </div>
  13. <div id="fullscreenbroad" v-show="dialogTableVisible">
  14. <el-row class="fullRow">
  15. <el-button
  16. @click="openSetting"
  17. icon="el-icon-setting"
  18. circle
  19. id="fullscreenbroad-setting"
  20. ></el-button>
  21. <el-button
  22. type="primary"
  23. icon="el-icon-rank"
  24. v-if="showSetting"
  25. id="fullscreenbroad-setting"
  26. @click="togglefullscreen"
  27. >切换模式</el-button
  28. >
  29. <el-button
  30. type="primary"
  31. icon="el-icon-menu"
  32. v-if="showSetting"
  33. id="fullscreenbroad-setting"
  34. @click="outfullscreenboard"
  35. >退出全屏投影</el-button
  36. >
  37. </el-row>
  38. <div class="page_lineUp">
  39. <div class="lineUpTitle">
  40. <div>{{ this.$store.getters.xt_user.org.org_name }}<span>&nbsp;&nbsp;温馨提示:请注意排队叫号,依次叫号就诊上机,谢谢配合</span></div>
  41. <div>{{ newdate }}&nbsp;&nbsp;{{ time }}</div>
  42. </div>
  43. <div class="lineUpMain">
  44. <div class="lineUpMainLeft">
  45. <div class="lineUpMainLeftTitle">
  46. <p style="width:12%">排号</p>
  47. <p style="width:14%">姓名</p>
  48. <p style="width:14%">病例号</p>
  49. <p style="width:14%">床位号</p>
  50. <p style="width:14%">治疗状态</p>
  51. <p style="width:14%">上机时间</p>
  52. <p style="width:16%">预计下机时间</p>
  53. </div>
  54. <div class="lineUpList">
  55. <div class="lineUpListOne" v-for="(item,index) in lineUpList" :key="index">
  56. <p style="width:12%">{{ item.queue_no }}</p>
  57. <p style="width:14%">{{ item.patient_name }}</p>
  58. <p style="width:14%">{{ item.dialysis_no }}</p>
  59. <p style="width:14%">{{ item.partition_name + item.bed_name }}</p>
  60. <p style="width:14%">
  61. <span v-if="item.status == 1">待接诊</span>
  62. <span v-if="item.status == 2">接诊中</span>
  63. <span v-if="item.status == 3">待上机</span>
  64. <span v-if="item.status == 4">透析中</span>
  65. <span v-if="item.status == 5">已下机</span>
  66. </p>
  67. <p style="width:14%">{{ item.start_time ? item.start_time : '--' }}</p>
  68. <p style="width:16%">{{ item.end_time ? item.end_time : '--' }}</p>
  69. </div>
  70. </div>
  71. </div>
  72. <div class="callingBox">
  73. <div class="callingBoxLeft">
  74. <div class="callingTitle"><span style="margin: 0 auto;">接<br />诊<br />叫<br />号</span></div>
  75. <div style="flex: 1;">
  76. <div class="callingTop" style="margin-bottom:10px;">
  77. <div class="callingTopTip"><span style="margin: 0 auto;">正在<br />接诊</span></div>
  78. <div class="callingContent">
  79. <p style="margin:50px 0 14px;"><span v-for="(item,index) in receivingPatient.slice(0,3)" :key="index">{{ item.patient_name }}、</span></p>
  80. <p><span v-for="(item,index) in receivingPatient.slice(3,6)" :key="index">{{ item.patient_name }}、</span></p>
  81. </div>
  82. </div>
  83. <div class="callingTop" style="border-radius: 0 0 15px 0;">
  84. <div class="callingTopTip"><span style="margin: 0 auto;">等待<br />接诊</span></div>
  85. <div class="callingContent">
  86. <p style="margin:50px 0 14px;"><span v-for="(item,index) in waitDoctorList.slice(0,3)" :key="index">{{ item.patient_name }}、</span></p>
  87. <p><span v-for="(item,index) in waitDoctorList.slice(3,6)" :key="index">{{ item.patient_name }}、</span></p>
  88. </div>
  89. </div>
  90. </div>
  91. </div>
  92. <div class="callingBoxLeft">
  93. <div class="callingTitle newCallingTitle"><span style="margin: 0 auto;">上<br />机<br />叫<br />号</span></div>
  94. <div style="flex: 1;">
  95. <div class="callingTop" style="margin-bottom:10px;">
  96. <div class="callingTopTip newCallingTopTip"><span style="margin: 0 auto;">正在<br />叫号</span></div>
  97. <div class="callingContent newCallingContent">
  98. <p style="margin:50px 0 14px;"><span v-for="(item,index) in upPatientList.slice(0,3)" :key="index">{{ item.patient_name }}、</span></p>
  99. <p><span v-for="(item,index) in upPatientList.slice(3,6)" :key="index">{{ item.patient_name }}、</span></p>
  100. </div>
  101. </div>
  102. <div class="callingTop" style="border-radius: 0 0 15px 0;">
  103. <div class="callingTopTip newCallingTopTip"><span style="margin: 0 auto;">等待<br />叫号</span></div>
  104. <div class="callingContent newCallingContent">
  105. <p style="margin:50px 0 14px;"><span v-for="(item,index) in receivingPatient.slice(0,3)" :key="index">{{ item.patient_name }}、</span></p>
  106. <p><span v-for="(item,index) in receivingPatient.slice(3,6)" :key="index">{{ item.patient_name }}、</span></p>
  107. </div>
  108. </div>
  109. </div>
  110. </div>
  111. </div>
  112. </div>
  113. </div>
  114. </div>
  115. <div class="app-container">
  116. <div class="page_lineUp">
  117. <div class="lineUpTitle">
  118. <div>{{ this.$store.getters.xt_user.org.org_name }}<span>&nbsp;&nbsp;温馨提示:请注意排队叫号,依次叫号就诊上机,谢谢配合</span></div>
  119. <div>{{ newdate }}&nbsp;&nbsp;{{ time }}</div>
  120. </div>
  121. <div class="lineUpMain">
  122. <div class="lineUpMainLeft">
  123. <div class="lineUpMainLeftTitle">
  124. <p style="width:12%">排号</p>
  125. <p style="width:14%">姓名</p>
  126. <p style="width:14%">病例号</p>
  127. <p style="width:14%">床位号</p>
  128. <p style="width:14%">治疗状态</p>
  129. <p style="width:14%">上机时间</p>
  130. <p style="width:16%">预计下机时间</p>
  131. </div>
  132. <div class="lineUpList">
  133. <div class="lineUpListOne" v-for="(item,index) in lineUpList" :key="index">
  134. <p style="width:12%">{{ item.queue_no }}</p>
  135. <p style="width:14%">{{ item.patient_name }}</p>
  136. <p style="width:14%">{{ item.dialysis_no }}</p>
  137. <p style="width:14%">{{ item.partition_name + item.bed_name }}</p>
  138. <p style="width:14%">
  139. <span v-if="item.status == 1">待接诊</span>
  140. <span v-if="item.status == 2">接诊中</span>
  141. <span v-if="item.status == 3">待上机</span>
  142. <span v-if="item.status == 4">透析中</span>
  143. <span v-if="item.status == 5">已下机</span>
  144. </p>
  145. <p style="width:14%">{{ item.start_time ? item.start_time : '--' }}</p>
  146. <p style="width:16%">{{ item.end_time ? item.end_time : '--' }}</p>
  147. </div>
  148. </div>
  149. </div>
  150. <div class="callingBox">
  151. <div class="callingBoxLeft">
  152. <div class="callingTitle"><span style="margin: 0 auto;">接<br />诊<br />叫<br />号</span></div>
  153. <div style="flex: 1;">
  154. <div class="callingTop" style="margin-bottom:10px;">
  155. <div class="callingTopTip"><span style="margin: 0 auto;">正在<br />接诊</span></div>
  156. <div class="callingContent">
  157. <p style="margin:50px 0 14px;"><span v-for="(item,index) in receivingPatient.slice(0,3)" :key="index">{{ item.patient_name }}、</span></p>
  158. <p><span v-for="(item,index) in receivingPatient.slice(3,6)" :key="index">{{ item.patient_name }}、</span></p>
  159. </div>
  160. </div>
  161. <div class="callingTop" style="border-radius: 0 0 15px 0;">
  162. <div class="callingTopTip"><span style="margin: 0 auto;">等待<br />接诊</span></div>
  163. <div class="callingContent">
  164. <p style="margin:50px 0 14px;"><span v-for="(item,index) in waitDoctorList.slice(0,3)" :key="index">{{ item.patient_name }}、</span></p>
  165. <p><span v-for="(item,index) in waitDoctorList.slice(3,6)" :key="index">{{ item.patient_name }}、</span></p>
  166. </div>
  167. </div>
  168. </div>
  169. </div>
  170. <div class="callingBoxLeft">
  171. <div class="callingTitle newCallingTitle"><span style="margin: 0 auto;">上<br />机<br />叫<br />号</span></div>
  172. <div style="flex: 1;">
  173. <div class="callingTop" style="margin-bottom:10px;">
  174. <div class="callingTopTip newCallingTopTip"><span style="margin: 0 auto;">正在<br />叫号</span></div>
  175. <div class="callingContent newCallingContent">
  176. <p style="margin:50px 0 14px;"><span v-for="(item,index) in upPatientList.slice(0,3)" :key="index">{{ item.patient_name }}、</span></p>
  177. <p><span v-for="(item,index) in upPatientList.slice(3,6)" :key="index">{{ item.patient_name }}、</span></p>
  178. </div>
  179. </div>
  180. <div class="callingTop" style="border-radius: 0 0 15px 0;">
  181. <div class="callingTopTip newCallingTopTip"><span style="margin: 0 auto;">等待<br />叫号</span></div>
  182. <div class="callingContent newCallingContent">
  183. <p style="margin:50px 0 14px;"><span v-for="(item,index) in receivingPatient.slice(0,3)" :key="index">{{ item.patient_name }}、</span></p>
  184. <p><span v-for="(item,index) in receivingPatient.slice(3,6)" :key="index">{{ item.patient_name }}、</span></p>
  185. </div>
  186. </div>
  187. </div>
  188. </div>
  189. </div>
  190. </div>
  191. </div>
  192. </div>
  193. </div>
  194. </template>
  195. <script>
  196. const moment = require('moment')
  197. import BreadCrumb from "../components/bread-crumb";
  198. import screenfull from "screenfull";
  199. export default {
  200. components:{
  201. BreadCrumb
  202. },
  203. data(){
  204. return{
  205. crumbs: [
  206. { path: false, name: "签到排队" },
  207. { path: false, name: "排队窗口" }
  208. ],
  209. dialogTableVisible:false,
  210. showSetting: false,
  211. lineUpList:[],
  212. count:0,
  213. page:1,
  214. timer:null,
  215. receivingPatient:[],
  216. waitDoctorList:[],
  217. upPatientList:[],
  218. patient_id:'',
  219. timerID:null,
  220. time:'',
  221. newdate:'',
  222. voiceNum:1,
  223. voiceTime:null,
  224. voice:true,
  225. a:1
  226. }
  227. },
  228. computed: {
  229. websocket() {
  230. return this.$store.state.user.websocket;
  231. },
  232. },
  233. created(){
  234. this.initData = {
  235. cmd: "queue/join",
  236. data: {type:2,page:1,size:6},
  237. };
  238. this.websocketSend(this.initData)
  239. let newobj = {
  240. cmd: "queue/callreturn",
  241. data: {patient_id:0},
  242. };
  243. this.websocketSend(newobj)
  244. },
  245. beforeMount() {
  246. this.websocketMess();
  247. },
  248. mounted(){
  249. this.timer = setInterval(() => {
  250. if(this.page < Math.ceil(this.count / 6)){
  251. console.log('执行',Math.ceil(this.count / 6),this.page)
  252. this.page++
  253. let obj = {
  254. cmd: "queue/queuelist",
  255. data: {page:this.page,size:6}
  256. };
  257. this.websocketSend(obj)
  258. }else{
  259. console.log('执行22223333')
  260. this.page = 1
  261. let obj = {
  262. cmd: "queue/queuelist",
  263. data: {page:this.page,size:6}
  264. };
  265. this.websocketSend(obj)
  266. }
  267. }, 5000);
  268. this.timerID = setInterval(() => {
  269. this.updateTime()
  270. }, 1000);
  271. },
  272. beforeDestroy(){
  273. clearInterval(this.timer);  // 清除定时器
  274. this.timer = null
  275. clearInterval(this.timerID);
  276. this.timerID = null;  // 清除定时器
  277. // this.timer = null;
  278. // let obj = {
  279. // cmd: "queue/join",
  280. // data: {type:1},
  281. // };
  282. // this.websocketSend(obj)
  283. console.log('hhhhhhhhhhhhhhhhhhhhhh',this.timerID)
  284. },
  285. methods:{
  286. websocketSend(data) {
  287. try {
  288. this.websocket.send(JSON.stringify(data))
  289. } catch (error) {
  290. this.showError = true;
  291. this.showIndex = 4;
  292. this.errorInfo = "网络异常,请稍后退出重试!";
  293. }
  294. },
  295. websocketMess() {
  296. this.websocket.onmessage = e => {
  297. let res = JSON.parse(e.data);
  298. // let res = re.data;
  299. console.log('res',res)
  300. if(res.channel == 'queue/join'){
  301. this.lineUpList = res.data.patientQueueList.data
  302. this.receivingPatient = res.data.receivingPatient
  303. this.waitDoctorList = res.data.waitDoctorList
  304. this.upPatientList = res.data.upPatientList
  305. this.count = res.data.patientQueueList.count
  306. this.lineUpList.map(item => {
  307. item.create_time = moment(item.create_time * 1000).format('HH:mm:ss')
  308. // item.start_time = moment(item.start_time * 1000).format('HH:mm')
  309. })
  310. }else if(res.channel == 'queue/queuelist'){
  311. this.lineUpList = res.data.patientQueueList.data
  312. this.count = res.data.patientQueueList.count
  313. this.lineUpList.map(item => {
  314. item.create_time = moment(item.create_time * 1000).format('HH:mm:ss')
  315. // item.start_time = moment(item.start_time * 1000).format('HH:mm')
  316. if(item.start_time != null){
  317. item.start_time = moment(item.start_time * 1000).format('HH:mm:ss')
  318. }
  319. if(item.status == 4){
  320. item.end_time = moment(item.end_time * 1000).format('HH:mm:ss')
  321. }
  322. })
  323. }else if(res.channel == 'patientCallInfo'){
  324. console.log(999999999999,res.data)
  325. console.log('执行几次',this.voiceNum)
  326. if(this.voice == true){
  327. this.patient_id = res.data.patientInfo.patient_id
  328. this.voice = false
  329. // let time1 = null
  330. this.voicePrompt(res.data.callVolUrl)
  331. this.voiceTime = setInterval(() => {
  332. if(this.voiceNum < 3){
  333. this.voiceNum++
  334. this.voicePrompt(res.data.callVolUrl)
  335. }else{
  336. this.voiceNum = 1;
  337. this.voice = true
  338. let obj = {
  339. cmd: "queue/callreturn",
  340. data: {patient_id:this.patient_id},
  341. };
  342. this.websocketSend(obj)
  343. clearInterval(this.voiceTime);
  344. this.voiceTime = null
  345. }
  346. },6000)
  347. }else {
  348. this.$message({
  349. message: '警告哦,这是一条警告消息',
  350. type: 'warning'
  351. });
  352. }
  353. }else if(res.channel == 'updateCallList'){
  354. this.receivingPatient = res.data.queue_list
  355. }else if(res.channel == 'updateWaitCallList'){
  356. this.waitDoctorList = res.data.queue_list
  357. }else if(res.channel == 'updateUpCallList'){
  358. this.upPatientList = res.data.queue_list
  359. }
  360. // else if(res.channel == "patientQueueInfo"){
  361. // this.queueInfo = res.data.queueInfo
  362. // let obj = {
  363. // cmd: "queue/queuelist",
  364. // data: {page:1,size:10}
  365. // };
  366. // this.websocketSend(obj)
  367. // }
  368. }
  369. },
  370. updateTime() {
  371. var cd = new Date();
  372. var week = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'];
  373. console.log(1111111)
  374. this.time = this.zeroPadding(cd.getHours(), 2) + ':' + this.zeroPadding(cd.getMinutes(), 2) + ':' + this.zeroPadding(cd.getSeconds(), 2) + ' (' + week[cd.getDay()] + ")";
  375. this.newdate = this.zeroPadding(cd.getFullYear(), 4) + '-' + this.zeroPadding(cd.getMonth() + 1, 2) + '-' + this.zeroPadding(cd.getDate(), 2);
  376. },
  377. zeroPadding(num, digit) {
  378. var zero = '';
  379. for (var i = 0; i < digit; i++) {
  380. zero += '0';
  381. }
  382. return (zero + num).slice(-digit);
  383. },
  384. fullscreenboard: function() {
  385. this.dialogTableVisible = true;
  386. // let routeData = this.$router.resolve({ path: '/fullscreenboard' })
  387. // window.open(routeData.href, '_blank')
  388. },
  389. outfullscreenboard: function() {
  390. this.dialogTableVisible = false;
  391. this.showSetting = false;
  392. },
  393. togglefullscreen: function() {
  394. if (!screenfull.enabled) {
  395. this.$message({
  396. message: "你的浏览器不支持",
  397. type: "warning"
  398. });
  399. return false;
  400. }
  401. screenfull.toggle();
  402. this.showSetting = false;
  403. },
  404. openSetting() {
  405. if (this.showSetting == false) {
  406. this.showSetting = true;
  407. } else {
  408. this.showSetting = false;
  409. }
  410. },
  411. }
  412. }
  413. </script>
  414. <style lang="scss" scoped>
  415. .page_lineUp{
  416. .lineUpTitle{
  417. height: 50px;
  418. background: #1A82BF;
  419. display: flex;
  420. justify-content: space-between;
  421. align-items: center;
  422. padding: 0 20px;
  423. color:#fff;
  424. font-size: 20px;
  425. font-weight: 600;
  426. }
  427. .lineUpMain{
  428. background: linear-gradient(0deg, #76ECEC, #479CD2);
  429. height: 1080px;
  430. padding:10px;
  431. }
  432. .lineUpMainLeft{
  433. height: 620px;
  434. border-radius: 15px;
  435. }
  436. .lineUpMainLeftTitle{
  437. display: flex;
  438. justify-content: space-between;
  439. align-items: center;
  440. color:#fff;
  441. font-size: 38px;
  442. font-weight: 600;
  443. height:80px;
  444. background: #1A82BF;
  445. border-radius: 15px 15px 0 0;
  446. >p{
  447. text-align: center;
  448. }
  449. }
  450. .lineUpList{
  451. font-size: 35px;
  452. font-weight: 600;
  453. >div:nth-child(odd){
  454. background: #F9FDFF;
  455. }
  456. >div:nth-child(even){
  457. background: #CCEBFF;
  458. }
  459. >div:last-child{
  460. border-radius: 0 0 15px 15px;
  461. }
  462. .lineUpListOne{
  463. height:90px;
  464. display: flex;
  465. justify-content: space-between;
  466. align-items: center;
  467. color:#1C6895;
  468. >p{
  469. width:25%;
  470. text-align: center;
  471. }
  472. }
  473. }
  474. .callingBox{
  475. height: 430px;
  476. margin-top: 10px;
  477. display: flex;
  478. justify-content: space-between;
  479. .callingBoxLeft{
  480. width: 49.5%;
  481. height: 100%;
  482. display: flex;
  483. justify-content: space-between;
  484. .callingTitle{
  485. width: 130px;
  486. height: 100%;
  487. border-radius: 15px 0 0 15px;
  488. font-size: 66px;
  489. font-weight:600;
  490. text-align: center;
  491. color: #fff;
  492. background: #1A82BF;
  493. display: flex;
  494. align-items: center;
  495. margin-right: 5px;
  496. }
  497. .newCallingTitle{
  498. background: #1aa680;
  499. }
  500. }
  501. .callingTop{
  502. height: 210px;
  503. border-radius: 0 15px 0 0;
  504. background: #F9FDFF;
  505. display: flex;
  506. justify-content: space-between;
  507. .callingTopTip{
  508. width: 130px;
  509. height: 100%;
  510. color: #fff;
  511. font-size: 40px;
  512. font-weight: 600;
  513. background: #1A82BF;
  514. display: flex;
  515. align-items: center;
  516. }
  517. .newCallingTopTip{
  518. background: #1aa680;
  519. }
  520. .callingContent{
  521. flex: 1;
  522. display: flex;
  523. flex-direction: column;
  524. font-size: 50px;
  525. color:#1C6895;
  526. font-weight: 600;
  527. padding-left: 20px;
  528. >p{
  529. width:100%;
  530. text-align: left;
  531. line-height: 50px;
  532. }
  533. }
  534. .newCallingContent{
  535. color:#1aa680;
  536. }
  537. }
  538. }
  539. }
  540. #fullscreenbroad {
  541. position: fixed;
  542. top: 0;
  543. right: 0;
  544. bottom: 0;
  545. left: 0;
  546. overflow: auto;
  547. margin: 0;
  548. background: #fff;
  549. padding: 20px;
  550. z-index:5000;
  551. }
  552. #fullscreenbroad #fullscreenbroad-setting {
  553. float: right;
  554. }
  555. #fullscreenbroad .el-button + .el-button {
  556. margin-left: 0px;
  557. }
  558. #fullscreenbroad .el-button:nth-child(1) {
  559. margin-left: 10px;
  560. }
  561. #fullscreenbroad .el-button:nth-child(2) {
  562. margin-left: 10px;
  563. }
  564. .fullRow{
  565. margin-bottom: 10px;
  566. }
  567. </style>