signIn.vue 14KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423
  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. this.websocketMess();
  155. },
  156. mounted(){
  157. this.timer = setInterval(() => {
  158. if(this.page < Math.ceil(this.count / 10)){
  159. console.log('执行')
  160. this.page++
  161. let obj = {
  162. cmd: "queue/queuelist",
  163. data: {page:this.page,size:10}
  164. };
  165. this.websocketSend(obj)
  166. }else{
  167. console.log('执行2222')
  168. this.page = 1
  169. let newobj = {
  170. cmd: "queue/queuelist",
  171. data: {page:this.page,size:10}
  172. };
  173. this.websocketSend(newobj)
  174. }
  175. }, 5000);
  176. this.timerID = setInterval(() => {
  177. this.updateTime()
  178. }, 1000);
  179. // this.updateTime();
  180. },
  181. beforeDestroy(){
  182. clearInterval(this.timer);  // 清除定时器
  183. clearInterval(this.timerID);  // 清除定时器
  184. this.timer = null;
  185. let obj = {
  186. cmd: "queue/unjoin",
  187. data: {type:1},
  188. };
  189. this.websocketSend(obj)
  190. },
  191. methods:{
  192. websocketSend(data) {
  193. try {
  194. this.websocket.send(JSON.stringify(data))
  195. } catch (error) {
  196. this.showError = true;
  197. this.showIndex = 4;
  198. this.errorInfo = "网络异常,请稍后退出重试!";
  199. }
  200. },
  201. websocketMess() {
  202. this.websocket.onmessage = e => {
  203. let res = JSON.parse(e.data);
  204. // let res = re.data;
  205. console.log('res',res)
  206. if(res.channel == 'queue/join'){
  207. this.signInList = res.data.patientQueueList.data
  208. this.count = res.data.patientQueueList.count
  209. this.signInList.map(item => {
  210. item.create_time = moment(item.create_time * 1000).format('HH:mm:ss')
  211. })
  212. }else if(res.channel == "patientQueueInfo"){
  213. this.queueInfo = res.data.queueInfo
  214. let obj = {
  215. cmd: "queue/queuelist",
  216. data: {page:1,size:10}
  217. };
  218. this.websocketSend(obj)
  219. }else if(res.channel == 'queue/queuelist'){
  220. console.log(11111111111,res.data)
  221. this.signInList = res.data.patientQueueList.data
  222. this.count = res.data.patientQueueList.count
  223. this.signInList.map(item => {
  224. item.create_time = moment(item.create_time * 1000).format('HH:mm:ss')
  225. })
  226. }
  227. // console.log("action", re.action);
  228. // console.log("data", JSON.stringify(res));
  229. }
  230. },
  231. updateTime() {
  232. var cd = new Date();
  233. var week = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'];
  234. this.time = this.zeroPadding(cd.getHours(), 2) + ':' + this.zeroPadding(cd.getMinutes(), 2) + ':' + this.zeroPadding(cd.getSeconds(), 2) + ' (' + week[cd.getDay()] + ")";
  235. this.newdate = this.zeroPadding(cd.getFullYear(), 4) + '-' + this.zeroPadding(cd.getMonth() + 1, 2) + '-' + this.zeroPadding(cd.getDate(), 2);
  236. },
  237. zeroPadding(num, digit) {
  238. var zero = '';
  239. for (var i = 0; i < digit; i++) {
  240. zero += '0';
  241. }
  242. return (zero + num).slice(-digit);
  243. },
  244. fullscreenboard: function() {
  245. this.dialogTableVisible = true;
  246. // let routeData = this.$router.resolve({ path: '/fullscreenboard' })
  247. // window.open(routeData.href, '_blank')
  248. },
  249. outfullscreenboard: function() {
  250. this.dialogTableVisible = false;
  251. this.showSetting = false;
  252. },
  253. togglefullscreen: function() {
  254. if (!screenfull.enabled) {
  255. this.$message({
  256. message: "你的浏览器不支持",
  257. type: "warning"
  258. });
  259. return false;
  260. }
  261. screenfull.toggle();
  262. this.showSetting = false;
  263. },
  264. openSetting() {
  265. if (this.showSetting == false) {
  266. this.showSetting = true;
  267. } else {
  268. this.showSetting = false;
  269. }
  270. },
  271. }
  272. }
  273. </script>
  274. <style lang="scss" scoped>
  275. .page_signIn{
  276. .signInTitle{
  277. height: 50px;
  278. background: #1A82BF;
  279. display: flex;
  280. justify-content: space-between;
  281. align-items: center;
  282. padding: 0 20px;
  283. color:#fff;
  284. font-size: 20px;
  285. font-weight: 600;
  286. }
  287. .signInMain{
  288. background: linear-gradient(0deg, #76ECEC, #479CD2);
  289. height: 1040px;
  290. }
  291. .signInMainLeft{
  292. width:65%;
  293. height: 980px;
  294. border-radius: 15px;
  295. }
  296. .signInMainLeftTitle{
  297. display: flex;
  298. justify-content: space-between;
  299. align-items: center;
  300. color:#fff;
  301. font-size: 38px;
  302. font-weight: 600;
  303. height:80px;
  304. background: #1A82BF;
  305. border-radius: 15px 15px 0 0;
  306. >p{
  307. width:25%;
  308. text-align: center;
  309. }
  310. }
  311. .signInList{
  312. font-size: 36px;
  313. font-weight: 600;
  314. >div:nth-child(odd){
  315. background: #F9FDFF;
  316. }
  317. >div:nth-child(even){
  318. background: #CCEBFF;
  319. }
  320. >div:last-child{
  321. border-radius: 0 0 15px 15px;
  322. }
  323. .signInListOne{
  324. height:90px;
  325. display: flex;
  326. justify-content: space-between;
  327. align-items: center;
  328. color:#1C6895;
  329. >p{
  330. width:25%;
  331. text-align: center;
  332. }
  333. }
  334. }
  335. .signInMainRight{
  336. width: 34%;
  337. height: 980px;
  338. }
  339. .signInMainRightTitle{
  340. height: 260px;
  341. border-radius: 15px 15px 0 0;
  342. background: #1A82BF;
  343. font-size: 120px;
  344. font-weight: 600;
  345. color:#fff;
  346. display: flex;
  347. align-items: center;
  348. justify-content: space-between;
  349. }
  350. .signInMainRightContent{
  351. background: #F9FDFF;
  352. height: 450px;
  353. text-align: center;
  354. font-weight: 600;
  355. color:#1C6895;
  356. box-sizing: border-box;
  357. font-size:90px;
  358. display:flex;
  359. align-items:center;
  360. }
  361. .signInMianRightBottom{
  362. height: 270px;
  363. background: #1A82BF;
  364. border-radius: 0 0 15px 15px;
  365. font-size: 90px;
  366. font-weight: 600;
  367. color:#fff;
  368. display: flex;
  369. justify-content: space-between;
  370. align-items: center;
  371. }
  372. .signInTip{
  373. color:#fff;
  374. font-size: 18px;
  375. font-weight: 600;
  376. display: flex;
  377. align-items: center;
  378. height: 50px;
  379. background: linear-gradient(0deg, #42A9E7, #3686B9, #42A9E7);
  380. margin-top: 1px;
  381. padding-left:20px;
  382. }
  383. }
  384. #fullscreenbroad {
  385. position: fixed;
  386. top: 0;
  387. right: 0;
  388. bottom: 0;
  389. left: 0;
  390. overflow: auto;
  391. margin: 0;
  392. background: #fff;
  393. padding: 20px;
  394. z-index:5000;
  395. }
  396. #fullscreenbroad #fullscreenbroad-setting {
  397. float: right;
  398. }
  399. #fullscreenbroad .el-button + .el-button {
  400. margin-left: 0px;
  401. }
  402. #fullscreenbroad .el-button:nth-child(1) {
  403. margin-left: 10px;
  404. }
  405. #fullscreenbroad .el-button:nth-child(2) {
  406. margin-left: 10px;
  407. }
  408. .fullRow{
  409. margin-bottom: 10px;
  410. }
  411. </style>