signIn.vue 15KB

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