血透系统PC前端

index.vue 21KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698
  1. <template>
  2. <section class="app-main-bg">
  3. <div class="home-page">
  4. <div class="search clearfix">
  5. <input type="text" class="search-input" placeholder="病人姓名/透析号" v-model="searchKey" >
  6. <button class="search-button" @click="clickSearch">搜索</button>
  7. </div>
  8. <div class="ui-step clearfix">
  9. <h2 class="ui-step-tit">病人透析治疗流程</h2>
  10. <ul class="ui-step-ul">
  11. <li v-for="(item, index) in steps" :key="index" class="ui-step-done">
  12. <div class="ui-step-number"><i /></div>
  13. <div class="ui-step-title">{{ item.title }}</div>
  14. </li>
  15. </ul>
  16. </div>
  17. <!-- <el-steps :active="5" align-center>
  18. <el-step v-for="(item, index) in steps" :key="index" :title="item.title"></el-step>
  19. </el-steps> -->
  20. <div class="config-process">
  21. <h2 class="title">系统使用配置流程</h2>
  22. <ul class="process">
  23. <router-link v-for="(item, index) in process" tag="li" class="items" :key="index" :to="item.link">
  24. <img :src="item.imgUrl" >
  25. <p class="name">{{ item.name }}</p>
  26. </router-link>
  27. </ul>
  28. </div>
  29. </div>
  30. <div class="main-r">
  31. <div class="res-widget">
  32. <ul>
  33. <li class="taocan-title clearfix">
  34. <div class="taocan-h2 ">{{subscibeBan.used}}</div>
  35. <div class="bar"></div>
  36. <div class="taocan-h1 ">{{subscibeBan.name}}</div>
  37. </li>
  38. <li class="taocan-item">
  39. <div class="ng-binding" :title="subscibeBan.desc">{{subscibeBan.desc}}</div>
  40. </li>
  41. <li class="taocan-item">
  42. <div class="ng-binding" :title="subscibeBan.detail">{{subscibeBan.detail}}</div>
  43. </li>
  44. <li class="taocan-item" v-if="this.subscibe.state==3 || this.subscibe.state==2 || leftTime<0">
  45. <div class="ng-binding" style="color:red" >如果您已经购买,请尝试重新登录刷新</div>
  46. </li>
  47. <li class="taocan-xufei">
  48. <div class="m-t-md" v-if="subscibeBan.leave"><div class="taocan-left-tip">{{subscibeBan.leave}}</div></div>
  49. <div class="taocan-leftday">
  50. <div class="taocan-left"></div>
  51. <div class="taocan-use clearfix" :style="subscibeBan.pce"></div>
  52. </div>
  53. <a class="btn clearfix" v-if="subscibeBan.pay_status" href="javascript:0" @click="openPay">立即购买</a>
  54. </li>
  55. </ul>
  56. </div>
  57. <!-- <div class="res-widget">
  58. <ul class="notice-widget">
  59. <li class="notice-title clearfix">
  60. <div class="pull-right"><a class="notice-more" href="">更多</a></div>
  61. <div class="bar"></div>
  62. <div class="notice-h1">公告</div>
  63. </li>
  64. <li class="notice-item">
  65. <div class="text-muted">9-18</div>
  66. <div class="text"><a href="">微商城分销数据等模块更新优化上线</a></div>
  67. </li>
  68. <li class="notice-item">
  69. <div class="text-muted">9-18</div>
  70. <div class="text"><a href="">微商城商品、装修模块功能更新优化上线</a></div>
  71. </li>
  72. <li>
  73. <li class="notice-item">
  74. <div class="text-muted">9-18</div>
  75. <div class="text"><a href="">微商城分销、装修、子账号管理等多个模块更新优化上线</a></div>
  76. </li>
  77. </ul>
  78. </div>
  79. <div class="res-widget">
  80. <ul class="notice-widget">
  81. <li class="notice-title clearfix">
  82. <div class="pull-right"><a class="notice-more" href="">更多</a></div>
  83. <div class="bar"></div>
  84. <div class="notice-h1">常见问题</div>
  85. </li>
  86. <li class="notice-item">
  87. <div class="text"><a href="">小程序授权绑定常见问题汇总</a></div>
  88. </li>
  89. <li class="notice-item">
  90. <div class="text"><a href="">店铺装修问题汇总</a></div>
  91. </li>
  92. <li>
  93. <li class="notice-item">
  94. <div class="text"><a href="">商品管理常见问题汇总</a></div>
  95. </li>
  96. </ul>
  97. </div> -->
  98. </div>
  99. </section>
  100. </template>
  101. <script>
  102. // import analyze from '../../assets/home/analyze.png'
  103. // import equipment from '../../assets/home/equipment.png'
  104. // import prescription from '../../assets/home/prescription.png'
  105. // import record from '../../assets/home/record.png'
  106. // import scheduling from '../../assets/home/scheduling.png'
  107. // import sick from '../../assets/home/sick.png'
  108. // import user from '../../assets/home/user.png'
  109. import {GetServerTime} from '@/api/public';
  110. import {GetPatientTotal} from '@/api/patient';
  111. export default {
  112. name: "Home",
  113. data() {
  114. return {
  115. searchKey: "",
  116. patientTotal:0,
  117. steps: [
  118. { title: "透析处方" },
  119. { title: "接诊评估" },
  120. { title: "透前评估" },
  121. { title: "临时医嘱" },
  122. { title: "透析上机" },
  123. { title: "双人核对" },
  124. { title: "透析监测" },
  125. { title: "透析下机" },
  126. { title: "透后评估" },
  127. { title: "治疗小结" }
  128. ],
  129. process: [
  130. {
  131. imgUrl: require("../../assets/home/equipment.png"),
  132. name: "设备管理",
  133. link: "/device/main"
  134. },
  135. {
  136. imgUrl: require("../../assets/home/user.png"),
  137. name: "病人管理",
  138. link: "/patients/patients"
  139. },
  140. // { imgUrl: require('../../assets/home/sick.png'), name: '登记病人', link: '/patients/create' },
  141. // { imgUrl: require('../../assets/home/prescription.png'), name: '透析处方', link: '/dialysis/paper' },
  142. {
  143. imgUrl: require("../../assets/home/scheduling.png"),
  144. name: "病人排班",
  145. link: "/workforce/appointment"
  146. },
  147. {
  148. imgUrl: require("../../assets/home/record.png"),
  149. name: "透析记录",
  150. link: "/dialysis/dialysisrecord"
  151. },
  152. {
  153. imgUrl: require("../../assets/home/analyze.png"),
  154. name: "透析监控",
  155. link: "/dialysis/watch"
  156. }
  157. ],
  158. subscibe:{},
  159. subscibeBan:{
  160. used:'已使用0天',
  161. name:'免费版本',
  162. desc:'当前为免费版',
  163. detail:'可管理100位(含)以下患者',
  164. leave:'剩余0天',
  165. pay_status:false,
  166. },
  167. serverTime:0,
  168. leftTime:false,
  169. };
  170. },
  171. methods: {
  172. GetPatientTotal(){
  173. GetPatientTotal().then(response=>{
  174. if(response.data.state==1) {
  175. this.patientTotal = response.data.data.total;
  176. }else {
  177. this.$message.error(response.data.msg);
  178. }
  179. }).catch(e=>{
  180. });
  181. },
  182. clickSearch() {
  183. if (this.searchKey.length > 0) {
  184. this.$router.push("/patients/patients?keyword=" + this.searchKey);
  185. } else {
  186. this.$router.push("/patients/patients");
  187. }
  188. },
  189. openPay(){
  190. this.$router.push('/service/buy');
  191. },
  192. GetServerTime(){
  193. GetServerTime().then(response=>{
  194. if (response.data.state==1) {
  195. this.serverTime = response.data.data.timestamp;
  196. }else {
  197. this.serverTime = Math.round(new Date().getTime()/1000);
  198. }
  199. }).catch(() => {
  200. this.serverTime = Math.round(new Date().getTime()/1000);
  201. });
  202. },
  203. initSubscibe() {
  204. // state:1正版(标准),2试用(免费),3其他无效状态,8专业,9(永久免费),标准版和专业版会过期
  205. var used = Math.ceil((this.serverTime - this.subscibe.period_start)/86400);
  206. var leave = "";
  207. var pce = '';
  208. var leaveTime = 0;
  209. switch (this.subscibe.state) {
  210. case 9:
  211. this.subscibeBan={
  212. used:'已使用'+used+'天',
  213. name:'永久版',
  214. desc:'当前为永久免费版本',
  215. detail:'该版本不会过期,并可使用所有功能',
  216. leave:'',
  217. pay_status:false,
  218. pce:"width:100%",
  219. };
  220. break;
  221. case 2:
  222. //免费版本不会过期,但有人数限制,免费版,可以管理20位(含)以下患者,当患者数过了20位,系统不能正常使用,达到18位时,要提醒购买,超过60位,要购买专业版
  223. pce = 0;
  224. if(this.patientTotal>200) {
  225. leave = "管理患者数已达"+this.patientTotal+"位,请购买专业版";
  226. pce = 100;
  227. }else if(this.patientTotal>100) {
  228. leave = "管理患者数已达"+this.patientTotal+"位,请购买标准版";
  229. pce = 100;
  230. }else if(this.patientTotal>=90) {
  231. leave = "管理患者数已达"+this.patientTotal+"位,建议购买标准版";
  232. pce = Math.round(this.patientTotal/100*100)
  233. }
  234. pce = "width:"+pce+"%";
  235. this.subscibeBan={
  236. used:'已使用'+used+'天',
  237. name:'免费版',
  238. desc:'当前为免费版',
  239. detail:'可管理100位(含)以下患者',
  240. leave:leave,
  241. pay_status:leave?true:false,
  242. pce:pce,
  243. };
  244. break;
  245. case 8:
  246. leaveTime = this.subscibe.period_end - this.serverTime;
  247. this.leftTime = leaveTime;
  248. if (leaveTime<0){
  249. leave = "已经过期";
  250. pce = "100";
  251. } else {
  252. leave = Math.floor(leaveTime/86400);
  253. leave = leave>30?"":'剩余'+leave+'天';
  254. pce = 100 - Math.round(leaveTime/(this.subscibe.period_end - this.subscibe.period_start)*100);
  255. }
  256. pce = "width:"+pce+"%";
  257. this.subscibeBan={
  258. used:'已使用'+used+'天',
  259. name:'专业版',
  260. desc:'当前为专业版',
  261. detail:'不限患者',
  262. leave:leave,
  263. pay_status:leave?true:false,
  264. pce:pce,
  265. };
  266. break;
  267. case 1:
  268. leaveTime = this.subscibe.period_end - this.serverTime;
  269. this.leftTime = leaveTime;
  270. if (leaveTime<0){
  271. leave = "已经过期";
  272. pce = "100";
  273. } else if(this.patientTotal>200) {
  274. leave = "管理患者数已达"+this.patientTotal+"位,请购买专业版";
  275. pce = "width:100%";
  276. } else if(this.patientTotal>=190) {
  277. leave = "管理患者数已达"+this.patientTotal+"位,建议购买专业版";
  278. pce = Math.round(this.patientTotal/200*100);
  279. } else {
  280. leave = Math.floor(leaveTime/86400);
  281. leave = leave>30?"":'剩余'+leave+'天,建议购买标准版';
  282. pce = 100 - Math.round(leaveTime/(this.subscibe.period_end - this.subscibe.period_start)*100);
  283. }
  284. pce = "width:"+pce+"%";
  285. this.subscibeBan={
  286. used:'已使用'+used+'天',
  287. name:'标准版',
  288. desc:'当前为标准版',
  289. detail:'可管理200位(含)以下患者',
  290. leave:leave,
  291. pay_status:leave?true:false,
  292. pce:pce,
  293. };
  294. break;
  295. default:
  296. this.subscibeBan={
  297. used:'',
  298. name:'未订阅服务',
  299. desc:'当前未订阅服务',
  300. detail:'无法使用血透系统',
  301. leave:"",
  302. pay_status:true,
  303. pce:"",
  304. };
  305. break;
  306. }
  307. },
  308. },
  309. created(){
  310. this.subscibe = this.$store.getters.xt_user.subscibe;
  311. this.GetPatientTotal();
  312. this.GetServerTime();
  313. },
  314. watch:{
  315. serverTime:function () {
  316. if(this.serverTime>0 && this.patientTotal>0) {
  317. this.initSubscibe();
  318. }
  319. },
  320. patientTotal:function () {
  321. if(this.serverTime>0 && this.patientTotal>0) {
  322. this.initSubscibe();
  323. }
  324. }
  325. }
  326. };
  327. </script>
  328. <style rel="stylesheet/scss" lang="scss" scoped>
  329. .app-main-bg {
  330. background: #f6f8f9;
  331. min-height: calc(100vh - 84px);
  332. overflow: hidden;
  333. display: -webkit-box;
  334. display: -ms-flexbox;
  335. display: flex;
  336. padding: 10px;
  337. .home-page {
  338. font-family: "Microsoft Yahei";
  339. -webkit-box-flex: 1;
  340. -ms-flex: 1;
  341. flex: 1;
  342. .search {
  343. margin: 0 auto;
  344. margin-top: 16px;
  345. width: 472px;
  346. .search-input {
  347. width: 400px;
  348. height: 42px;
  349. line-height: 42px;
  350. padding-left: 15px;
  351. border: 1px #ebeef0 solid;
  352. border-right: none;
  353. outline: none;
  354. float: left;
  355. border-radius: 6px 0 0 6px;
  356. font-size: 14px;
  357. color: #333;
  358. background: #fff;
  359. box-shadow: 3px 3px 4px rgba(135, 135, 135, 0.05);
  360. }
  361. .search-button {
  362. background-color: #409eff;
  363. color: #fff;
  364. font-size: 15px;
  365. text-align: center;
  366. height: 42px;
  367. line-height: 42px;
  368. float: left;
  369. outline: none;
  370. width: 70px;
  371. border: none;
  372. border-radius: 0 6px 6px 0;
  373. font-family: "Microsoft Yahei";
  374. cursor: pointer;
  375. -webkit-box-shadow: 3px 3px 4px rgba(135, 135, 135, 0.05);
  376. box-shadow: 3px 3px 4px rgba(135, 135, 135, 0.05);
  377. }
  378. }
  379. .ui-step {
  380. margin: 20px 6px 0 6px;
  381. padding: 10px 0 20px 0;
  382. zoom: 1;
  383. background: #fff;
  384. box-shadow: 0 4px 12px rgba(135, 135, 135, 0.15);
  385. .ui-step-tit {
  386. font-size: 18px;
  387. text-align: center;
  388. color: #34495e;
  389. font-weight: 700;
  390. height: 50px;
  391. line-height: 50px;
  392. }
  393. .ui-step-ul {
  394. list-style: none;
  395. .ui-step-done {
  396. float: left;
  397. position: relative;
  398. -webkit-box-sizing: border-box;
  399. -moz-box-sizing: border-box;
  400. box-sizing: border-box;
  401. text-align: center;
  402. width: 10%;
  403. &:before,
  404. &:after {
  405. position: absolute;
  406. left: 0;
  407. top: 21px;
  408. display: block;
  409. content: " ";content: " ";
  410. width: 50%;
  411. height: 1px;
  412. background: #409eff;
  413. z-index: 1;
  414. }
  415. &:after {
  416. left: 50%;
  417. }
  418. &:first-child:before,
  419. &:last-child::after {
  420. width: 0;
  421. }
  422. .ui-step-title {
  423. color: #34495e;
  424. font-size: 13px;
  425. font-weight: normal;
  426. line-height: 18px;
  427. }
  428. .ui-step-number {
  429. position: relative;
  430. display: inline-block;
  431. width: 22px;
  432. height: 22px;
  433. margin: 10px 0;
  434. line-height: 22px;
  435. background: #409eff;
  436. color: #fff;
  437. border-radius: 100%;
  438. -webkit-box-sizing: border-box;
  439. -moz-box-sizing: border-box;
  440. box-sizing: border-box;
  441. z-index: 2;
  442. border: 1px #409eff solid;
  443. i {
  444. position: absolute;
  445. left: 4px;
  446. top: 6px;
  447. width: 12px;
  448. height: 6px;
  449. border: 2px #fff solid;
  450. color: #fff;
  451. z-index: 9;
  452. border-top: none;
  453. border-right: none;
  454. transform: rotate(-45deg);
  455. -webkit-transform: rotate(-45deg);
  456. -moz-transform: rotate(-45deg);
  457. -ms-transform: rotate(-45deg);
  458. -o-transform: rotate(-45deg);
  459. }
  460. }
  461. }
  462. }
  463. }
  464. .config-process {
  465. margin-top: 30px;
  466. .title {
  467. font-size: 18px;
  468. text-align: center;
  469. color: #34495e;
  470. font-weight: 700;
  471. height: 50px;
  472. line-height: 50px;
  473. }
  474. .process {
  475. display: -webkit-box;
  476. display: -ms-flexbox;
  477. display: flex;
  478. -webkit-box-align: center;
  479. -ms-flex-align: center;
  480. align-items: center;
  481. justify-content: center;
  482. text-align: center;
  483. padding-left: 0;
  484. .items {
  485. list-style: none;
  486. box-shadow: 0 4px 12px rgba(135, 135, 135, 0.15);
  487. -webkit-box-flex: 1;
  488. -ms-flex: 1;
  489. flex: 1;
  490. margin: 0 6px;
  491. background: #fff;
  492. padding: 22px 0 ;
  493. cursor: pointer;
  494. .name {
  495. font-size: 14px;
  496. color: #34495e;
  497. line-height: 24px;
  498. }
  499. }
  500. }
  501. }
  502. }
  503. .main-r {
  504. min-width: 290px;
  505. margin: 0 0 0 10px;
  506. .res-widget {
  507. min-height: 80px;
  508. background: #fff;
  509. padding: 10px 20px;
  510. margin-bottom: 15px;
  511. border-radius: 2px;
  512. // box-shadow: 0 0 4px 0 rgba(200, 200, 200, 0.5);
  513. -webkit-box-shadow: 0 4px 12px rgba(135, 135, 135, 0.15);
  514. box-shadow: 0 4px 12px rgba(135, 135, 135, 0.15);
  515. background-color: #fff;
  516. color: #34495e;
  517. font-size: 12px;
  518. ul {
  519. padding: 0;
  520. margin: 0;
  521. .taocan-title {
  522. font-weight: 700;
  523. padding: 10px 0;
  524. list-style: none;
  525. .taocan-h2 {
  526. font-weight: 400;
  527. float: right;
  528. font-size: 12px;
  529. color: gray;
  530. }
  531. .bar {
  532. display: inline-block;
  533. width: 3px;
  534. height: 14px;
  535. background-color: #2589ff;
  536. float: left;
  537. margin-top: 1px;
  538. }
  539. .taocan-h1 {
  540. padding-left: 5px;
  541. overflow: hidden;
  542. display: inline-block;
  543. font-size: 14px;
  544. font-weight: 700;
  545. float: left;
  546. }
  547. }
  548. .taocan-item {
  549. border-bottom: 1px solid #f1f1f1;
  550. padding: 10px 0;
  551. font-size: 12px;
  552. }
  553. .taocan-xufei {
  554. text-align: center;
  555. .m-t-md {
  556. margin-top: 20px;
  557. text-align: right;
  558. .taocan-left-tip {
  559. position: relative;
  560. font-size: 11px;
  561. border-radius: 1px;
  562. padding: 2px;
  563. display: inline-block;
  564. color: #ff7979;
  565. &::before {
  566. content: "";
  567. position: absolute;
  568. top: 0;
  569. left: 0;
  570. right: 0;
  571. bottom: 0;
  572. background: #ff7979;
  573. opacity: 0.2;
  574. border-radius: 1px;
  575. }
  576. }
  577. }
  578. .taocan-leftday {
  579. position: relative;
  580. height: 4px;
  581. margin: 5px 0 10px;
  582. .taocan-left {
  583. z-index: 1;
  584. position: absolute;
  585. left: 0;
  586. right: 0;
  587. top: 0;
  588. bottom: 0;
  589. border-radius: 2px;
  590. background: #f2f2f6;
  591. }
  592. .taocan-use {
  593. max-width: 100%;
  594. position: absolute;
  595. left: 0;
  596. z-index: 2;
  597. top: 0;
  598. bottom: 0;
  599. border-radius: 2px;
  600. background: #ff7979;
  601. text-align: center;
  602. }
  603. }
  604. .btn {
  605. display: inline-block;
  606. margin-bottom: 0;
  607. font-weight: 400;
  608. text-align: center;
  609. vertical-align: middle;
  610. -ms-touch-action: manipulation;
  611. touch-action: manipulation;
  612. cursor: pointer;
  613. background-image: none;
  614. border: 1px solid transparent;
  615. white-space: nowrap;
  616. padding: 6px 12px;
  617. font-size: 12px;
  618. line-height: 1.3rem;
  619. border-radius: 4px;
  620. -webkit-user-select: none;
  621. -moz-user-select: none;
  622. -ms-user-select: none;
  623. user-select: none;
  624. width: 100%;
  625. background-color: #ff7979;
  626. border-color: #ff7979;
  627. color: #fff;
  628. }
  629. }
  630. }
  631. .notice-widget {
  632. .notice-title {
  633. font-weight: 700;
  634. padding: 10px 0;
  635. .pull-right {
  636. display: inline-block !important;
  637. float: right !important;
  638. .notice-more {
  639. color: #409eff !important;
  640. font-weight: 400 !important;
  641. }
  642. }
  643. .bar {
  644. display: inline-block;
  645. width: 3px;
  646. height: 14px;
  647. background-color: #2589ff;
  648. float: left;
  649. }
  650. .notice-h1 {
  651. padding-left: 5px;
  652. overflow: hidden;
  653. font-size: 14px;
  654. }
  655. }
  656. .notice-item {
  657. border-bottom: 1px solid #f1f1f1;
  658. padding: 10px 0;
  659. .text-muted {
  660. color: #9797a1 !important;
  661. display: inline-block !important;
  662. float: right !important;
  663. font-size: 12px;
  664. margin: 3px 0 0 0;
  665. }
  666. .text {
  667. a {
  668. line-height: 20px;
  669. }
  670. }
  671. }
  672. }
  673. }
  674. }
  675. }
  676. @media (min-width: 768px) {
  677. .main-r {
  678. width: 16.66666667%;
  679. }
  680. }
  681. </style>