signIn.vue 15KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445
  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. console.log('哈哈哈哈')
  256. this.time = this.zeroPadding(cd.getHours(), 2) + ':' + this.zeroPadding(cd.getMinutes(), 2) + ':' + this.zeroPadding(cd.getSeconds(), 2) + ' (' + week[cd.getDay()] + ")";
  257. this.newdate = this.zeroPadding(cd.getFullYear(), 4) + '-' + this.zeroPadding(cd.getMonth() + 1, 2) + '-' + this.zeroPadding(cd.getDate(), 2);
  258. },
  259. zeroPadding(num, digit) {
  260. var zero = '';
  261. for (var i = 0; i < digit; i++) {
  262. zero += '0';
  263. }
  264. return (zero + num).slice(-digit);
  265. },
  266. fullscreenboard: function() {
  267. this.dialogTableVisible = true;
  268. // let routeData = this.$router.resolve({ path: '/fullscreenboard' })
  269. // window.open(routeData.href, '_blank')
  270. },
  271. outfullscreenboard: function() {
  272. this.dialogTableVisible = false;
  273. this.showSetting = false;
  274. },
  275. togglefullscreen: function() {
  276. if (!screenfull.enabled) {
  277. this.$message({
  278. message: "你的浏览器不支持",
  279. type: "warning"
  280. });
  281. return false;
  282. }
  283. screenfull.toggle();
  284. this.showSetting = false;
  285. },
  286. openSetting() {
  287. if (this.showSetting == false) {
  288. this.showSetting = true;
  289. } else {
  290. this.showSetting = false;
  291. }
  292. },
  293. }
  294. }
  295. </script>
  296. <style lang="scss" scoped>
  297. .page_signIn{
  298. .signInTitle{
  299. height: 50px;
  300. background: #1A82BF;
  301. display: flex;
  302. justify-content: space-between;
  303. align-items: center;
  304. padding: 0 20px;
  305. color:#fff;
  306. font-size: 20px;
  307. font-weight: 600;
  308. }
  309. .signInMain{
  310. background: linear-gradient(0deg, #76ECEC, #479CD2);
  311. height: 1040px;
  312. }
  313. .signInMainLeft{
  314. width:65%;
  315. height: 980px;
  316. border-radius: 15px;
  317. }
  318. .signInMainLeftTitle{
  319. display: flex;
  320. justify-content: space-between;
  321. align-items: center;
  322. color:#fff;
  323. font-size: 38px;
  324. font-weight: 600;
  325. height:80px;
  326. background: #1A82BF;
  327. border-radius: 15px 15px 0 0;
  328. >p{
  329. width:25%;
  330. text-align: center;
  331. }
  332. }
  333. .signInList{
  334. font-size: 36px;
  335. font-weight: 600;
  336. >div:nth-child(odd){
  337. background: #F9FDFF;
  338. }
  339. >div:nth-child(even){
  340. background: #CCEBFF;
  341. }
  342. >div:last-child{
  343. border-radius: 0 0 15px 15px;
  344. }
  345. .signInListOne{
  346. height:90px;
  347. display: flex;
  348. justify-content: space-between;
  349. align-items: center;
  350. color:#1C6895;
  351. >p{
  352. width:25%;
  353. text-align: center;
  354. }
  355. }
  356. }
  357. .signInMainRight{
  358. width: 34%;
  359. height: 980px;
  360. }
  361. .signInMainRightTitle{
  362. height: 260px;
  363. border-radius: 15px 15px 0 0;
  364. background: #1A82BF;
  365. font-size: 120px;
  366. font-weight: 600;
  367. color:#fff;
  368. display: flex;
  369. align-items: center;
  370. justify-content: space-between;
  371. }
  372. .signInMainRightContent{
  373. background: #F9FDFF;
  374. height: 450px;
  375. text-align: center;
  376. font-weight: 600;
  377. color:#1C6895;
  378. box-sizing: border-box;
  379. font-size:90px;
  380. display:flex;
  381. align-items:center;
  382. }
  383. .signInMianRightBottom{
  384. height: 270px;
  385. background: #1A82BF;
  386. border-radius: 0 0 15px 15px;
  387. font-size: 90px;
  388. font-weight: 600;
  389. color:#fff;
  390. display: flex;
  391. justify-content: space-between;
  392. align-items: center;
  393. }
  394. .signInTip{
  395. color:#fff;
  396. font-size: 18px;
  397. font-weight: 600;
  398. display: flex;
  399. align-items: center;
  400. height: 50px;
  401. background: linear-gradient(0deg, #42A9E7, #3686B9, #42A9E7);
  402. margin-top: 1px;
  403. padding-left:20px;
  404. }
  405. }
  406. #fullscreenbroad {
  407. position: fixed;
  408. top: 0;
  409. right: 0;
  410. bottom: 0;
  411. left: 0;
  412. overflow: auto;
  413. margin: 0;
  414. background: #fff;
  415. padding: 20px;
  416. z-index:5000;
  417. }
  418. #fullscreenbroad #fullscreenbroad-setting {
  419. float: right;
  420. }
  421. #fullscreenbroad .el-button + .el-button {
  422. margin-left: 0px;
  423. }
  424. #fullscreenbroad .el-button:nth-child(1) {
  425. margin-left: 10px;
  426. }
  427. #fullscreenbroad .el-button:nth-child(2) {
  428. margin-left: 10px;
  429. }
  430. .fullRow{
  431. margin-bottom: 10px;
  432. }
  433. </style>