PathInfo.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406
  1. <template>
  2. <div class="path-wrap">
  3. <div class="content">
  4. <div class="topContent">
  5. <h2>{{pathInfo.sonHospitalName||pathInfo.hospitalName}}</h2>
  6. <p class="hospitalName">智能预问诊</p>
  7. </div>
  8. <div class="minContent">
  9. <p class="msg"><i class="person"></i>挂号信息</p>
  10. <p class="perLine">
  11. <span class="msgTitle">姓名</span>
  12. <i>:</i>
  13. <span>{{pathInfo.patientName}}</span>
  14. </p>
  15. <p class="perLine">
  16. <span class="msgTitle">性别</span>
  17. <i>:</i>
  18. <span>{{pathInfo.patientSex}}</span>
  19. </p>
  20. <p class="perMsg perLine">
  21. <span class="msgTitle">年龄</span>
  22. <i>:</i>
  23. <span class="perDetail">{{pathInfo.patientAge}}岁</span>
  24. </p>
  25. <p class="emptyLine"></p>
  26. <p class="perLine" v-if="pathInfo.doctorName">
  27. <span class="msgTitle">{{pathInfo.doctorName?'预约医生':''}}</span>
  28. <i v-if="pathInfo.doctorName">:</i>
  29. <span>{{pathInfo.doctorName}}</span>
  30. </p>
  31. <p class="perLine" v-if="pathInfo.hospitalDeptName">
  32. <span class="msgTitle">{{pathInfo.hospitalDeptName?'科室':''}}</span>
  33. <i v-if="pathInfo.hospitalDeptName">:</i>
  34. <span>{{pathInfo.hospitalDeptName}}</span>
  35. </p>
  36. <p class="perLine" v-if="pathInfo.recordId">
  37. <span class="msgTitle">{{pathInfo.recordId?'排队号':''}}</span>
  38. <i v-if="pathInfo.recordId">:</i>
  39. <span>{{pathInfo.recordId}}</span>
  40. </p>
  41. <p class="perLine" v-if="time">
  42. <span class="msgTitle">{{time?'预约时间':''}}</span>
  43. <i v-if="time">:</i>
  44. <span>{{time}}</span>
  45. </p>
  46. </div>
  47. <p class="explain">注:请核对您的挂号信息,如有错误请到窗口询问</p>
  48. <div class="btmContent" @click="getStart">确认并继续</div>
  49. <p class="jishu">朗通医疗提供技术支持</p>
  50. <!-- <div class="con">
  51. <p class="already" v-if="type !== 1">{{text[type]}}</p>
  52. </div> -->
  53. </div>
  54. <Toast
  55. :message="message"
  56. :show="showToast"
  57. @comfirn="comfirnDel"
  58. @cancel="cancelDel"
  59. />
  60. <Submit
  61. v-if="submit"
  62. :fail="tipMsg"
  63. showType="fail"
  64. ></Submit>
  65. <StartPage v-if="showStart" :showStart="showStart"/>
  66. </div>
  67. </template>
  68. <script type="text/javascript">
  69. import api from '@utils/api.js'
  70. import Submit from '../common/Submit';
  71. import Toast from '../common/Toast.vue';
  72. import {setScroll,dateParser,setTitle,moduleConfig,getUrlArgObject } from '@utils/tools.js'
  73. import StartPage from "../common/HomePage";
  74. import BScroll from 'better-scroll';
  75. import {mapState} from 'vuex';
  76. export default {
  77. name:'PathInfo',
  78. data(){
  79. return {
  80. pathInfo:{},
  81. // child:[],
  82. type:null, //1-未做过;3-只做过问诊;4-只做过体质辨识;6-都做过
  83. text:{
  84. "3":'您已完成过一次预问诊,是否再次录入',
  85. // "4":'您已完成过一次儿童体质辨识,是否再次录入',
  86. // "6":'您已完成过一次预问诊和儿童体质辨识,是否再次录入',
  87. "6":'您已完成过一次预问诊,是否再次录入',
  88. },
  89. isReady:false,
  90. // hideChild:true, //隐藏儿童
  91. submit:false,
  92. scroll:null,
  93. tipMsg:'',
  94. time:'',
  95. params:{},
  96. showToast:false,
  97. message:'您已完成一次预问诊,是否重新录入?',
  98. showStart:false,
  99. allMoudles:{}
  100. }
  101. },
  102. computed:{
  103. ...mapState({
  104. config: state => state.sysConfig,
  105. tmpAllMoudles: state => state.allMoudles,
  106. }),
  107. },
  108. created(){
  109. const showDoctor = getUrlArgObject("showDoctor");
  110. this.$store.commit("setShowDoctor",showDoctor);
  111. this.getPathInfo();
  112. this.$store.commit('initAllData');//初始化store数据
  113. },
  114. mounted(){
  115. let tmpModule = moduleConfig(this.config,this.tmpAllMoudles);
  116. this.allMoudles = tmpModule;
  117. this.$store.commit('setActiveModule', tmpModule);
  118. this.$nextTick(()=>{
  119. let scroll = setScroll(BScroll,true,'.path-wrap')
  120. this.scroll = scroll
  121. })
  122. },
  123. methods:{
  124. comfirnDel() {
  125. this.goNext()
  126. },
  127. cancelDel() {
  128. this.showToast = false
  129. },
  130. getPathInfo(){
  131. let query = this.$route.query
  132. let hasQuery = JSON.stringify(query) == '{}'
  133. let tmpTime = dateParser(!hasQuery&&query.recordTime) || (localStorage.getItem('loginParam')&&dateParser(JSON.parse(localStorage.getItem('loginParam')).time))
  134. this.time = tmpTime
  135. const params = {
  136. 'hospitalCode':!hasQuery&&query.hospitalCode||'',
  137. 'hospitalDeptCode':!hasQuery&&query.hospitalDeptCode||'',
  138. 'doctorCode':!hasQuery&&query.doctorCode||'',
  139. 'patientCode':!hasQuery&&query.patientCode||'',
  140. 'recordId':!hasQuery&&query.recordId||'',
  141. 'recordTime':!hasQuery&&query.recordTime||'',
  142. "sonHospitalCode": !hasQuery&&query.sonHospitalCode||''
  143. }
  144. if(!hasQuery&&query.scan){//扫码进入的
  145. localStorage.removeItem('loginParam')
  146. localStorage.removeItem('loginData')
  147. localStorage.setItem('scan',true)//保存扫码标记
  148. localStorage.setItem('infoParam',JSON.stringify(params))//保存扫码信息,登录进入需删除该参数
  149. this.getSysConfig();
  150. }else{//登陆进入的
  151. localStorage.removeItem('infoParam')
  152. localStorage.removeItem('scan')
  153. this.getSysConfig(1);
  154. if(localStorage.getItem("startPage") == 1){
  155. this.showStart = true;
  156. document.title = '智能预问诊';
  157. }
  158. }
  159. api.getPathInfo(params).then((res)=>{
  160. const result = res.data;
  161. if(result.code==0){
  162. this.pathInfo = result.data;
  163. this.$store.commit('savePathInfo',result.data);
  164. this.getAll(); //获取模板
  165. this.getUsualSymptom(); //获取科室常用症状
  166. }
  167. })
  168. },
  169. getSysConfig(flg){
  170. let query = this.$route.query
  171. let hasQuery = JSON.stringify(query) == '{}';
  172. const param = {
  173. 'hospitalCode':!hasQuery&&query.hospitalCode||'',
  174. }
  175. api.getSysConfig(param).then((res)=>{
  176. const result = res.data;
  177. if(result.code==0){
  178. const datas = result.data;
  179. this.$store.commit('saveSysConfig',datas)
  180. if(flg){return}
  181. for(let i = 0;i < datas.length;i++){
  182. if(datas[i].code == 'homepage_show' && localStorage.getItem("startPage") === null){
  183. if(+datas[i].value==1){
  184. localStorage.setItem('startPage',1)
  185. //显示启动页
  186. this.showStart = true;
  187. document.title = '智能预问诊';
  188. }else{
  189. document.title = '挂号详情';
  190. localStorage.setItem('startPage',0)
  191. }
  192. }
  193. }
  194. }
  195. })
  196. },
  197. getUsualSymptom(){
  198. const param = {
  199. "age": this.pathInfo.patientAge,
  200. "deptName": this.pathInfo.selfDeptName,
  201. "sexType": this.pathInfo.sexType
  202. };
  203. api.getSymptom(param).then((res) => {
  204. const result = res.data;
  205. if (result.code == 0) {
  206. this.$store.commit("setUsualSymptom",result.data);
  207. }else{
  208. this.defaultWaring('常用症状获取失败,请稍后重试!')
  209. }
  210. })
  211. },
  212. recordCheck(){
  213. const param = {
  214. 'doctorId':this.pathInfo.doctorId,
  215. 'hospitalDeptId':this.pathInfo.hospitalDeptId,
  216. 'hospitalId':this.pathInfo.hospitalId,
  217. 'inquiryCode':this.pathInfo.recordId,
  218. 'patientId':this.pathInfo.patientId
  219. };
  220. api.recordCheck(param).then((res)=>{
  221. const result = res.data;
  222. if(result.code==0){
  223. let type = result.data.type;
  224. if(type == 3||type == 6){//有预问诊信息
  225. this.showToast = true
  226. }else{
  227. this.goNext();
  228. }
  229. }
  230. })
  231. },
  232. goNext(){
  233. if(this.isReady){
  234. this.$router.push({path:'/tab'})
  235. }else{
  236. this.defaultWaring('请先维护症状模块')
  237. }
  238. },
  239. getAll(){
  240. const param = {
  241. 'age':this.pathInfo.patientAge,
  242. 'relationId':this.pathInfo.selfDeptId,
  243. 'mouduleType':1, //根据科室划分
  244. 'sexType':this.pathInfo.patientSex=='男'?1:(this.pathInfo.patientSex=='女'?2:3),
  245. }
  246. api.getAll(param).then((res)=>{
  247. const result = res.data;
  248. if(result.code==0){
  249. const datas = result.data;
  250. this.$store.commit('saveAll',datas)
  251. let access = datas.filter(item=>item.type == 1).length>0
  252. this.isReady=access
  253. }else{
  254. this.defaultWaring(result.msg)
  255. }
  256. })
  257. },
  258. getStart(){
  259. const pathInfo = this.pathInfo;
  260. if(JSON.stringify(pathInfo)=='{}'){
  261. this.defaultWaring('网络异常请稍后重试');
  262. return
  263. }
  264. this.recordCheck(); //校验是否填过
  265. },
  266. defaultWaring(msg){
  267. this.submit = true
  268. this.tipMsg = msg
  269. let timer = setTimeout(() => {
  270. this.submit = false
  271. clearTimeout(timer)
  272. }, 2000);
  273. },
  274. },
  275. components:{
  276. Submit,
  277. Toast,
  278. StartPage
  279. }
  280. }
  281. </script>
  282. <style lang="less" scoped>
  283. @import '../less/base.less';
  284. .path-wrap{
  285. font-size: .28rem;
  286. position: absolute;
  287. width: 100%;
  288. height: 100%;
  289. .content {
  290. padding-bottom: .16rem;
  291. box-sizing: border-box;
  292. position: absolute;
  293. width: 100%;
  294. height: 100%;
  295. }
  296. .topContent {
  297. // background-color: #6678FF;
  298. height: 3.8rem;
  299. padding-top: .3rem;
  300. box-sizing: border-box;
  301. background:url(../images/topContent.png) no-repeat;
  302. background-size: cover;
  303. .hospitalName {
  304. color: #FFFFFF;
  305. font-size: .32rem;
  306. text-align: center;
  307. }
  308. h2 {
  309. text-align: center;
  310. font-size: .46rem;
  311. padding: .3rem 0 .18rem 0;
  312. color: #fff;
  313. }
  314. .explain {
  315. font-size: .24rem;
  316. color: #fff;
  317. line-height: .4rem;
  318. }
  319. }
  320. .explain {
  321. font-size: .24rem;
  322. color: #AAAAAA;
  323. padding:0 .4rem;
  324. line-height: .4rem;
  325. position: relative;
  326. bottom: 1.1rem;
  327. }
  328. .minContent {
  329. padding: .3rem .6rem .3rem .6rem;
  330. box-sizing: border-box;
  331. border-radius: 5px;
  332. width: 90%;
  333. box-shadow:0px 12px 24px 0px rgba(198,187,224,0.15);
  334. position: relative;
  335. top: -1.3rem;
  336. background-color: #fff;
  337. margin: 0 auto;
  338. height: 6.4rem;
  339. .msg {
  340. font-size: .32rem;
  341. padding-bottom: .18rem;
  342. border-bottom: 1px solid #E6E6E6;
  343. margin-bottom: .4rem;
  344. .person {
  345. display: inline-block;
  346. width: .38rem;
  347. height: .4rem;
  348. background: url(../images/person.png) no-repeat;
  349. background-size: cover;
  350. margin-right: .3rem;
  351. position: relative;
  352. top: .06rem;
  353. }
  354. }
  355. .perLine {
  356. font-size: .3rem;
  357. padding-bottom: .2rem;
  358. }
  359. .msgTitle {
  360. display: inline-block;
  361. width: 1.3rem;
  362. color: #777777;
  363. }
  364. i {
  365. color: #777777;
  366. position: relative;
  367. bottom: 1px;
  368. }
  369. .perMsg {
  370. .perDetail {
  371. margin-right: .24rem;
  372. }
  373. }
  374. }
  375. .btmContent {
  376. width: 6.9rem;
  377. height: .88rem;
  378. line-height: .88rem;
  379. text-align: center;
  380. background-color: #colors[btn];
  381. font-size: #font[title];
  382. color: #fff;
  383. margin: 0 auto;
  384. border-radius: .44rem;
  385. position: absolute;
  386. bottom: 1.2rem;
  387. transform: translateX(-50%);
  388. left: 50%;
  389. }
  390. .emptyLine {
  391. height: 0.22rem;
  392. }
  393. }
  394. .jishu {
  395. position: absolute;
  396. bottom: 0.4rem;
  397. left: 50%;
  398. text-align: center;
  399. color: #AAA;
  400. transform: translateX(-50%);
  401. }
  402. </style>