signIn.vue 15KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444
  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_signIn">
  39. <div class="signInTitle">
  40. <div>{{ this.$store.getters.xt_user.org.org_name }}</div>
  41. <div>{{ newdate }}&nbsp;&nbsp;{{ time }}</div>
  42. </div>
  43. <div class="signInMain">
  44. <div style="display: flex;justify-content: space-between;padding:10px;">
  45. <div class="signInMainLeft">
  46. <div class="signInMainLeftTitle">
  47. <p>排号</p>
  48. <p>姓名</p>
  49. <p>病历号</p>
  50. <p>签到时间</p>
  51. </div>
  52. <div class="signInList">
  53. <div class="signInListOne" v-for="(item,index) in signInList" :key="index">
  54. <p>{{ item.queue_no }}</p>
  55. <p>{{ item.patient_name }}</p>
  56. <p>{{ item.dialysis_no }}</p>
  57. <p>{{ item.create_time }}</p>
  58. </div>
  59. </div>
  60. </div>
  61. <div class="signInMainRight">
  62. <div class="signInMainRightTitle"><span style="margin:0 auto;" v-if='Object.keys(queueInfo).length>0'>{{ queueInfo.patient_name }}</span></div>
  63. <div class="signInMainRightContent">
  64. <p style="margin: 0 auto;display:flex;align-items: center;" v-if='Object.keys(queueInfo).length>0'><span>排号&nbsp;</span><span style="font-size:180px;">{{ queueInfo.queue_no }}</span></p>
  65. </div>
  66. <div class="signInMianRightBottom"><span style="margin:0 auto;" v-if='Object.keys(queueInfo).length>0'>签到成功</span></div>
  67. </div>
  68. </div>
  69. <div class="signInTip">
  70. 温馨提示:请注意排队叫号,依次叫号就诊上机,谢谢配合
  71. </div>
  72. </div>
  73. </div>
  74. </div>
  75. <div class="app-container">
  76. <div class="page_signIn">
  77. <div class="signInTitle">
  78. <div>{{ this.$store.getters.xt_user.org.org_name }}</div>
  79. <div>{{ newdate }}&nbsp;&nbsp;{{ time }}</div>
  80. </div>
  81. <div class="signInMain">
  82. <div style="display: flex;justify-content: space-between;padding:10px;">
  83. <div class="signInMainLeft">
  84. <div class="signInMainLeftTitle">
  85. <p>排号</p>
  86. <p>姓名</p>
  87. <p>病历号</p>
  88. <p>签到时间</p>
  89. </div>
  90. <div class="signInList">
  91. <div class="signInListOne" v-for="(item,index) in signInList" :key="index">
  92. <p>{{ item.queue_no }}</p>
  93. <p>{{ item.patient_name }}</p>
  94. <p>{{ item.dialysis_no }}</p>
  95. <p>{{ item.create_time }}</p>
  96. </div>
  97. </div>
  98. </div>
  99. <div class="signInMainRight">
  100. <div class="signInMainRightTitle"><span style="margin:0 auto;" v-if='Object.keys(queueInfo).length>0'>{{ queueInfo.patient_name }}</span></div>
  101. <div class="signInMainRightContent">
  102. <p style="margin: 0 auto;display:flex;align-items: center;" v-if='Object.keys(queueInfo).length>0'><span>排号&nbsp;</span><span style="font-size:180px;">{{ queueInfo.queue_no }}</span></p>
  103. </div>
  104. <div class="signInMianRightBottom"><span style="margin:0 auto;" v-if='Object.keys(queueInfo).length>0'>签到成功</span></div>
  105. </div>
  106. </div>
  107. <div class="signInTip">
  108. 温馨提示:请注意排队叫号,依次叫号就诊上机,谢谢配合
  109. </div>
  110. </div>
  111. </div>
  112. </div>
  113. </div>
  114. </template>
  115. <script>
  116. const moment = require('moment')
  117. import BreadCrumb from "../components/bread-crumb";
  118. import screenfull from "screenfull";
  119. export default {
  120. components:{
  121. BreadCrumb
  122. },
  123. data(){
  124. return{
  125. crumbs: [
  126. { path: false, name: "签到排队" },
  127. { path: false, name: "签到窗口" }
  128. ],
  129. dialogTableVisible:false,
  130. showSetting: false,
  131. signInList:[],
  132. queueInfo:{},
  133. count:0,
  134. page:1,
  135. timer:null,
  136. timerID:null,
  137. time:'',
  138. newdate:''
  139. }
  140. },
  141. computed: {
  142. websocket() {
  143. return this.$store.state.user.websocket;
  144. },
  145. },
  146. created(){
  147. this.initData = {
  148. cmd: "queue/join",
  149. data: {type:1,page:1,size:10},
  150. };
  151. this.websocketSend(this.initData)
  152. },
  153. beforeMount() {
  154. // if (this.websocket) {
  155. // if (this.websocket.readyState == 1) {
  156. // this.websocketMess();
  157. // } else {
  158. // setTimeout(() => {
  159. // this.websocketMess();
  160. // }, 1000);
  161. // }
  162. // } else {
  163. // setTimeout(() => {
  164. // if (this.websocket.readyState == 1) {
  165. // this.websocketMess();
  166. // } else {
  167. // setTimeout(() => {
  168. // this.websocketMess();
  169. // }, 1000);
  170. // }
  171. // }, 1000);
  172. // }
  173. // setTimeout(() => {s
  174. this.websocketMess();
  175. // }, 1000);
  176. },
  177. mounted(){
  178. this.timer = setInterval(() => {
  179. if(this.page < Math.ceil(this.count / 10)){
  180. console.log('执行')
  181. this.page++
  182. let obj = {
  183. cmd: "queue/queuelist",
  184. data: {page:this.page,size:10}
  185. };
  186. this.websocketSend(obj)
  187. }else{
  188. console.log('执行2222')
  189. this.page = 1
  190. let obj = {
  191. cmd: "queue/queuelist",
  192. data: {page:this.page,size:10}
  193. };
  194. this.websocketSend(obj)
  195. }
  196. }, 5000);
  197. this.timerID = setInterval(() => {
  198. this.updateTime()
  199. }, 1000);
  200. // this.updateTime();
  201. },
  202. beforeDestroy(){
  203. clearInterval(this.timer);  // 清除定时器
  204. clearInterval(this.timerID);  // 清除定时器
  205. this.timer = null;
  206. let obj = {
  207. cmd: "queue/join",
  208. data: {type:1},
  209. };
  210. this.websocketSend(obj)
  211. },
  212. methods:{
  213. websocketSend(data) {
  214. try {
  215. this.websocket.send(JSON.stringify(data))
  216. } catch (error) {
  217. this.showError = true;
  218. this.showIndex = 4;
  219. this.errorInfo = "网络异常,请稍后退出重试!";
  220. }
  221. },
  222. websocketMess() {
  223. this.websocket.onmessage = e => {
  224. let res = JSON.parse(e.data);
  225. // let res = re.data;
  226. console.log('res',res)
  227. if(res.channel == 'queue/join'){
  228. this.signInList = res.data.patientQueueList.data
  229. this.count = res.data.patientQueueList.count
  230. this.signInList.map(item => {
  231. item.create_time = moment(item.create_time * 1000).format('HH:mm:ss')
  232. })
  233. }else if(res.channel == "patientQueueInfo"){
  234. this.queueInfo = res.data.queueInfo
  235. let obj = {
  236. cmd: "queue/queuelist",
  237. data: {page:1,size:10}
  238. };
  239. this.websocketSend(obj)
  240. }else if(res.channel == 'queue/queuelist'){
  241. console.log(11111111111,res.data)
  242. this.signInList = res.data.patientQueueList.data
  243. this.count = res.data.patientQueueList.count
  244. this.signInList.map(item => {
  245. item.create_time = moment(item.create_time * 1000).format('HH:mm:ss')
  246. })
  247. }
  248. // console.log("action", re.action);
  249. // console.log("data", JSON.stringify(res));
  250. }
  251. },
  252. updateTime() {
  253. var cd = new Date();
  254. var week = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'];
  255. this.time = this.zeroPadding(cd.getHours(), 2) + ':' + this.zeroPadding(cd.getMinutes(), 2) + ':' + this.zeroPadding(cd.getSeconds(), 2) + ' (' + week[cd.getDay()] + ")";
  256. this.newdate = this.zeroPadding(cd.getFullYear(), 4) + '-' + this.zeroPadding(cd.getMonth() + 1, 2) + '-' + this.zeroPadding(cd.getDate(), 2);
  257. },
  258. zeroPadding(num, digit) {
  259. var zero = '';
  260. for (var i = 0; i < digit; i++) {
  261. zero += '0';
  262. }
  263. return (zero + num).slice(-digit);
  264. },
  265. fullscreenboard: function() {
  266. this.dialogTableVisible = true;
  267. // let routeData = this.$router.resolve({ path: '/fullscreenboard' })
  268. // window.open(routeData.href, '_blank')
  269. },
  270. outfullscreenboard: function() {
  271. this.dialogTableVisible = false;
  272. this.showSetting = false;
  273. },
  274. togglefullscreen: function() {
  275. if (!screenfull.enabled) {
  276. this.$message({
  277. message: "你的浏览器不支持",
  278. type: "warning"
  279. });
  280. return false;
  281. }
  282. screenfull.toggle();
  283. this.showSetting = false;
  284. },
  285. openSetting() {
  286. if (this.showSetting == false) {
  287. this.showSetting = true;
  288. } else {
  289. this.showSetting = false;
  290. }
  291. },
  292. }
  293. }
  294. </script>
  295. <style lang="scss" scoped>
  296. .page_signIn{
  297. .signInTitle{
  298. height: 50px;
  299. background: #1A82BF;
  300. display: flex;
  301. justify-content: space-between;
  302. align-items: center;
  303. padding: 0 20px;
  304. color:#fff;
  305. font-size: 20px;
  306. font-weight: 600;
  307. }
  308. .signInMain{
  309. background: linear-gradient(0deg, #76ECEC, #479CD2);
  310. height: 1040px;
  311. }
  312. .signInMainLeft{
  313. width:65%;
  314. height: 980px;
  315. border-radius: 15px;
  316. }
  317. .signInMainLeftTitle{
  318. display: flex;
  319. justify-content: space-between;
  320. align-items: center;
  321. color:#fff;
  322. font-size: 38px;
  323. font-weight: 600;
  324. height:80px;
  325. background: #1A82BF;
  326. border-radius: 15px 15px 0 0;
  327. >p{
  328. width:25%;
  329. text-align: center;
  330. }
  331. }
  332. .signInList{
  333. font-size: 36px;
  334. font-weight: 600;
  335. >div:nth-child(odd){
  336. background: #F9FDFF;
  337. }
  338. >div:nth-child(even){
  339. background: #CCEBFF;
  340. }
  341. >div:last-child{
  342. border-radius: 0 0 15px 15px;
  343. }
  344. .signInListOne{
  345. height:90px;
  346. display: flex;
  347. justify-content: space-between;
  348. align-items: center;
  349. color:#1C6895;
  350. >p{
  351. width:25%;
  352. text-align: center;
  353. }
  354. }
  355. }
  356. .signInMainRight{
  357. width: 34%;
  358. height: 980px;
  359. }
  360. .signInMainRightTitle{
  361. height: 260px;
  362. border-radius: 15px 15px 0 0;
  363. background: #1A82BF;
  364. font-size: 120px;
  365. font-weight: 600;
  366. color:#fff;
  367. display: flex;
  368. align-items: center;
  369. justify-content: space-between;
  370. }
  371. .signInMainRightContent{
  372. background: #F9FDFF;
  373. height: 450px;
  374. text-align: center;
  375. font-weight: 600;
  376. color:#1C6895;
  377. box-sizing: border-box;
  378. font-size:90px;
  379. display:flex;
  380. align-items:center;
  381. }
  382. .signInMianRightBottom{
  383. height: 270px;
  384. background: #1A82BF;
  385. border-radius: 0 0 15px 15px;
  386. font-size: 90px;
  387. font-weight: 600;
  388. color:#fff;
  389. display: flex;
  390. justify-content: space-between;
  391. align-items: center;
  392. }
  393. .signInTip{
  394. color:#fff;
  395. font-size: 18px;
  396. font-weight: 600;
  397. display: flex;
  398. align-items: center;
  399. height: 50px;
  400. background: linear-gradient(0deg, #42A9E7, #3686B9, #42A9E7);
  401. margin-top: 1px;
  402. padding-left:20px;
  403. }
  404. }
  405. #fullscreenbroad {
  406. position: fixed;
  407. top: 0;
  408. right: 0;
  409. bottom: 0;
  410. left: 0;
  411. overflow: auto;
  412. margin: 0;
  413. background: #fff;
  414. padding: 20px;
  415. z-index:5000;
  416. }
  417. #fullscreenbroad #fullscreenbroad-setting {
  418. float: right;
  419. }
  420. #fullscreenbroad .el-button + .el-button {
  421. margin-left: 0px;
  422. }
  423. #fullscreenbroad .el-button:nth-child(1) {
  424. margin-left: 10px;
  425. }
  426. #fullscreenbroad .el-button:nth-child(2) {
  427. margin-left: 10px;
  428. }
  429. .fullRow{
  430. margin-bottom: 10px;
  431. }
  432. </style>