Preview.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545
  1. <template>
  2. <div class="wrapper">
  3. <div class="preview previewper">
  4. <div class="content">
  5. <div class="tmpDiv"></div>
  6. <div class="personMsg personMsg1">
  7. <p class="baseMsg">{{pathInfo.patientName}}&nbsp;&nbsp;&nbsp;&nbsp;{{pathInfo.patientSex}}&nbsp;&nbsp;&nbsp;&nbsp;{{pathInfo.patientAge}}岁</p>
  8. <table>
  9. <tr>
  10. <td><span>挂号科室:</span>{{pathInfo.selfDeptName}}</td>
  11. </tr>
  12. <tr v-if="pathInfo.recordId">
  13. <td><span>排队号:</span>{{pathInfo.recordId}}</td>
  14. </tr>
  15. <tr v-if="pathInfo.doctorName">
  16. <td><span>预约医生:</span>{{pathInfo.doctorName}}</td>
  17. </tr>
  18. <tr v-if="time">
  19. <td><span>就诊时间:</span>{{time}}</td>
  20. </tr>
  21. </table>
  22. <!-- <div class="line"></div>
  23. <p>采集时间:{{pathInfo.systemTime}}</p> -->
  24. </div>
  25. <div class="personMsg personMsg2">
  26. <ul class="previewParts">
  27. <li>
  28. <h4><i></i>主诉:</h4>
  29. <p>
  30. <span v-for="(item,idx) in symptom.choose" :key="item.name+idx" v-if="item.idx == 1">
  31. {{item.specialP?(item.description||item.name)+item.specialP:(item.description||item.name)}}
  32. </span>
  33. </p>
  34. </li>
  35. <li>
  36. <h4><i></i> 现病史:</h4>
  37. <p>
  38. <template v-for="(value,index) in checkText">
  39. <!-- 患者于时间单位前诱因出现症状,其余题目的内容; -->
  40. <span :key="index" v-if="index==0">{{(value.idx==1?'':'伴')+value.textP}}{{checkText.length==1?'':','}}</span>
  41. <span :key="index" v-if="index==1">{{(checkText[0].idx == 1?'伴':'')+value.textP}}{{checkText.length==2?'':'、'}}</span>
  42. <span :key="index" v-if="index>1">{{value.textP}}{{index == checkText.length-1?'':'、'}}</span>
  43. </template>
  44. </p>
  45. <p><span>{{getDetailText(diagnose.text,false).view}}</span></p>
  46. </li>
  47. <li v-if="tabType[moduleCP['other']]==1">
  48. <h4><i></i> 其他史:</h4>
  49. <p>
  50. <span>{{getDetailText(others.text,false).view}}</span>
  51. </p>
  52. </li>
  53. <li v-if="tabType[moduleCP['suplement']]==1">
  54. <h4><i></i> 补充内容:</h4>
  55. <p>{{addContent.txt}}</p>
  56. </li>
  57. <li v-if="JSON.stringify(diagnose.imgSrc) !='{}'" class="imgLis">
  58. <h4 class="imgTitle"><i></i> 最近一次治疗报告:</h4>
  59. <div v-for="(value,key,idx) in diagnose.imgSrc" class="imgView">
  60. <img :src="value" alt="">
  61. </div>
  62. </li>
  63. </ul>
  64. </div>
  65. <!--<div class="doctorData" @click="handleClick(true)">医生端数据展示</div>-->
  66. </div>
  67. </div>
  68. <!--<div class="foot">
  69. <span
  70. class="back"
  71. @click="back"
  72. >上一步</span>
  73. <span
  74. class="submit-btn"
  75. @click="saveAllImage"
  76. >提交给医生</span>
  77. </div>-->
  78. <div class="realSure sure" @click="saveAllDate">
  79. 提交给医生
  80. </div>
  81. <Submit
  82. v-if="submit"
  83. :showType="showType"
  84. @showSubmit="showSubmit"
  85. ></Submit>
  86. <Loading v-if="this.$store.state.loadingShow"></Loading>
  87. <!--<div class="personMsgDoc" v-show="showDoc">
  88. <div class="personMsgDocModal" @click="handleClick(false)"></div>
  89. <div class="personMsgDocDetail">
  90. <img class="close" src="../images/small-close.png" alt="" @click="handleClick(false)">
  91. <div class="personMsg personMsg2 modal">
  92. <ul class="previewParts">
  93. <li>
  94. <h4><i></i> 主诉:</h4>
  95. <p>
  96. <span v-for="(item,idx) in symptom.choose" :key="item.name+idx" v-if="item.idx == 1">
  97. {{item.special?item.name+item.special:item.name}}
  98. </span>
  99. </p>
  100. </li>
  101. <li>
  102. <h4><i></i> 现病史:</h4>
  103. <p>
  104. <template v-for="(value,index) in checkText">
  105. &lt;!&ndash; 患者于时间单位前诱因出现症状,其余题目的内容; &ndash;&gt;
  106. <span :key="index" v-if="index==0">{{(value.idx==1?'':'伴')+value.text}}{{checkText.length==1?'':','}}</span>
  107. <span :key="index" v-if="index==1">{{(checkText[0].idx == 1?'伴':'')+value.text}}{{checkText.length==2?'':'、'}}</span>
  108. <span :key="index" v-if="index>1">{{value.text}}{{index == checkText.length-1?'':'、'}}</span>
  109. </template>
  110. </p>
  111. <p><span>{{getDetailText(diagnose.text,false).content}}</span></p>
  112. </li>
  113. <li v-if="tabType[moduleCP['other']]==1">
  114. <h4><i></i> 其他史:</h4>
  115. <p>
  116. <span>{{getDetailText(others.text,false).content}}</span>
  117. </p>
  118. </li>
  119. <li v-if="tabType[moduleCP['suplement']]==1">
  120. <h4><i></i> 补充内容:</h4>
  121. <p>{{addContent.txtDoc}}</p>
  122. </li>
  123. <li v-if="JSON.stringify(diagnose.imgSrc) !='{}'" class="imgLis">
  124. <h4 class="imgTitle"><i></i> 最近一次治疗报告:</h4>
  125. <div v-for="(value,key,idx) in diagnose.imgSrc" class="imgView">
  126. <img :src="value" alt="">
  127. </div>
  128. </li>
  129. </ul>
  130. </div>
  131. </div>
  132. </div>-->
  133. </div>
  134. </template>
  135. <script>
  136. import api from '@utils/api.js';
  137. import Submit from '../common/Submit';
  138. import Loading from '../common/Loading';
  139. import BScroll from 'better-scroll';
  140. import {moduleCP,trimDots,setScroll,dateParser} from '@utils/tools.js'
  141. import { mapState } from 'vuex';
  142. export default {
  143. data() {
  144. const { pathInfo, originDatas } = this.$store.state;
  145. let sysConfig = this.$store.state.sysConfig;
  146. let symptomDate = this.$store.state.symptom;
  147. let diagnoseDate = this.$store.state.diagnose;
  148. let othersDate = this.$store.state.others;
  149. let addContentDate = this.$store.state.addContent;
  150. console.log(symptomDate)
  151. return {
  152. msg: '预览',
  153. pathInfo: pathInfo,
  154. symptom: symptomDate,
  155. diagnose: diagnoseDate,
  156. others: othersDate,
  157. addContent: addContentDate,
  158. checkText: symptomDate.text, //症状情况文字
  159. submit: false,
  160. showType: 'fail',
  161. imgList:[],
  162. tmpNum:0,
  163. moduleCP:moduleCP,
  164. showDoc:false,
  165. trimDots:trimDots,
  166. time:''
  167. }
  168. },
  169. computed:{
  170. ...mapState({
  171. tabType: state => state.tabType,
  172. config: state => state.sysConfig,
  173. pathInfo: state => state.pathInfo,
  174. addBuriedSomeList:state=>state.addBuriedSomeList
  175. })
  176. },
  177. created(){
  178. this.getTime();
  179. if (this.config.length == 0) {//登录进去返回到列表页,扫码返回到开始页
  180. let scan = localStorage.getItem('scan');
  181. let params = JSON.parse(localStorage.getItem('infoParam'));
  182. let param = JSON.parse(localStorage.getItem('loginParam'));
  183. let data = JSON.parse(localStorage.getItem('loginData'));
  184. if(!scan){
  185. if(data.length>1){
  186. this.$router.push({path:'/department'});
  187. }else{
  188. this.$router.push({path:'/home',query:param});
  189. }
  190. }else{
  191. this.$router.push({path:'/home',query:Object.assign({}, params,{scan:true})});
  192. }
  193. }
  194. },
  195. mounted() {
  196. let scroll = setScroll(BScroll,true,'.previewper')
  197. this.scroll = scroll
  198. },
  199. methods: {
  200. getTime() {
  201. let scan = localStorage.getItem('scan');
  202. let params = JSON.parse(localStorage.getItem('infoParam'));
  203. let param = JSON.parse(localStorage.getItem('loginParam'));
  204. let tmpArr = localStorage.getItem('recordTime')
  205. let tmpTime = tmpArr&&Array.isArray(JSON.parse(tmpArr))?JSON.parse(tmpArr):[];
  206. if(!scan){
  207. this.time = dateParser(param.time)
  208. }else{
  209. this.time = dateParser(params.recordTime)
  210. }
  211. },
  212. handleClick(flg){
  213. this.showDoc = flg
  214. },
  215. showSubmit(flg) {
  216. this.submit = flg
  217. },
  218. back() {
  219. this.$router.go(-1);
  220. },
  221. getDetailText(textArr,flg){
  222. let msg = "",obg={},msgP = "";
  223. if(flg == 1){
  224. // for(let k in textArr){
  225. let item = textArr[0];
  226. if(item.special){
  227. msg+=item.name+item.special
  228. msgP+=item.name+item.specialP
  229. }else{
  230. msg+=item.name
  231. msgP+=item.name
  232. }
  233. // }
  234. }else{
  235. for(let k in textArr){
  236. if(textArr[k] && Array.isArray(textArr[k])){
  237. let temp = textArr[k];
  238. for(let j in temp){
  239. if(temp[j]){
  240. msg += temp[j].text + ','
  241. msgP += temp[j].textP + ','
  242. }
  243. }
  244. }else if(textArr[k]){
  245. msg += textArr[k].text + ','
  246. msgP += textArr[k].textP + ','
  247. }
  248. }
  249. }
  250. obg.view=trimDots(msgP.replace(/,$/,''))
  251. obg.content=trimDots(msg.replace(/,$/,''))
  252. obg.contentJson=trimDots(msg.replace(/,$/,''))
  253. obg.contentValue=trimDots(msg.replace(/,$/,''))
  254. obg.type=flg
  255. return obg;
  256. },
  257. saveAllDate() {
  258. const {pathInfo,symptom,diagnose,others,addContent} = this
  259. let tmpSymptom = JSON.parse(JSON.stringify(symptom))
  260. let detailList = [{type:1},{type:2},{type:3},{type:4}]
  261. for(let i = 0;i < detailList.length;i++){
  262. if(i == 0){
  263. detailList[0]=this.getDetailText(tmpSymptom.choose,1)
  264. }else if(i == 1){
  265. let tmpArr = []
  266. let tmpStr = this.getDetailText(diagnose.text,2).content
  267. for(let j = 0;j < tmpSymptom.text.length;j++){
  268. if(j == 1){
  269. let tmpTxt = '伴'+tmpSymptom.text[1].text
  270. tmpSymptom.text[1].text = tmpTxt
  271. }
  272. tmpArr.push(tmpSymptom.text[j].text)
  273. }
  274. tmpStr.length>0?tmpArr.push(tmpStr):null
  275. detailList[1].content=tmpArr.join()
  276. detailList[1].contentJson=JSON.stringify(tmpArr)
  277. detailList[1].contentValue=tmpArr.join()
  278. }else if(i == 2){
  279. detailList[2] = this.getDetailText(others.text,3)
  280. }else if(i == 3){
  281. detailList[3].content=addContent.txtDoc
  282. detailList[3].contentJson=addContent.txtDoc
  283. detailList[3].contentValue=addContent.txtDoc
  284. }
  285. }
  286. let params = {
  287. "dataJson": "1",
  288. "detailList": detailList,
  289. "hospitalId": pathInfo.hospitalId,//医院id
  290. "hospitalName": pathInfo.hospitalName,//医院名称
  291. "hospitalCode": pathInfo.hospitalCode,//医院编码
  292. "doctorId": pathInfo.doctorId,//医生id
  293. "doctorCode": pathInfo.doctorCode,//医生编码
  294. "doctorName": pathInfo.doctorName,//医生name
  295. "hospitalDeptCode": pathInfo.hospitalDeptCode,//医院科室编码
  296. "hospitalDeptId": pathInfo.hospitalDeptId,//科室id
  297. "hospitalDeptName": pathInfo.hospitalDeptName,//科室name
  298. "inquiryCode": pathInfo.recordId,//就诊序列号,目前是门诊号
  299. "patientBirthday": pathInfo.birthday+':00',//患者出生日期,格式为:2018-11-28 17:25:30
  300. "patientCode": pathInfo.patientCode,//患者编号
  301. "patientId": pathInfo.patientId,//患者id
  302. "patientIdNo": pathInfo.patientIdNo,//患者证件号码(病历号)
  303. "patientName": pathInfo.patientName,//患者姓名
  304. // "patientPhone": pathInfo,//患者联系电话(非)
  305. "patientSex": pathInfo.patientSex=='男'?1:2,//患者性别:1男2女(非)
  306. // "regVisitedState": pathInfo,//就诊状态(0待接诊,1接诊中,2完成接诊)(非)
  307. "reportList": this.imgList,
  308. "sonHospitalCode": pathInfo.sonHospitalCode,
  309. "sonHospitalId": pathInfo.sonHospitalId,
  310. "sonHospitalName": pathInfo.sonHospitalName,
  311. // "type": 0//病历分类(1:门诊,2:住院)
  312. }
  313. // console.log(params)
  314. this.saveBuriedSome()//埋点
  315. api.saveInquiry(params).then((res) => {
  316. if (res.data.code == 0) {
  317. this.$store.commit('handleToggleShow', false);
  318. this.showType = 'success'
  319. this.submit = true
  320. } else {
  321. this.defaultWaring(res)
  322. }
  323. }).catch((err)=>{
  324. this.defaultWaring(err)
  325. })
  326. },
  327. saveBuriedSome(){
  328. let params = {
  329. "doctorId": this.pathInfo.doctorId||'',
  330. "hospitalDeptId": this.pathInfo.hospitalDeptId||'',
  331. "hospitalId": this.pathInfo.hospitalDeptId||'',
  332. "inquiryCode": this.pathInfo.hospitalDeptId||'',
  333. "patientId": this.pathInfo.hospitalDeptId||'',
  334. "taggeds": this.addBuriedSomeList||[]
  335. }
  336. api.saveBuriedSome(params).then((res)=>{
  337. console.log('埋点')
  338. })
  339. },
  340. defaultWaring(res){
  341. this.$store.commit('handleToggleShow', false);
  342. this.showType = 'fail'
  343. this.submit = true
  344. let timer = setTimeout(() => {
  345. this.submit = false
  346. clearTimeout(timer)
  347. }, 2000);
  348. }
  349. },
  350. components: {
  351. Submit,
  352. Loading,
  353. }
  354. }
  355. </script>
  356. <style lang="less" scoped>
  357. @import "../less/base.less";
  358. .foot {
  359. .dbfooter;
  360. z-index: 998;
  361. }
  362. .doctorData {
  363. float: right;
  364. color: #0043E8;
  365. margin-bottom: 30px;
  366. font-size: 14px;
  367. }
  368. .preview {
  369. color: red;
  370. background-color: #fff;
  371. position: fixed;
  372. width: 100%;
  373. height: 100%;
  374. top: 0;
  375. left: 0;
  376. box-sizing: border-box;
  377. padding: 0 0.4rem 1rem .4rem;
  378. overflow: hidden;
  379. -webkit-overflow-scrolling:touch;
  380. .btscroll;
  381. .content {
  382. padding-top: 0;
  383. padding-bottom: 2rem;
  384. }
  385. }
  386. .tmpDiv {
  387. height: .3rem;
  388. }
  389. .imgView {
  390. width: 1.86rem;
  391. height: 1.9rem;
  392. float: left;
  393. border: 1px solid #dfe0e4;
  394. margin: 0 0.2rem 0.3rem 0;
  395. box-sizing: border-box;
  396. position: relative;
  397. overflow: hidden;
  398. border-radius: 0.08rem;
  399. img {
  400. position: absolute;
  401. left: 50%;
  402. top: 50%;
  403. width: 100%;
  404. transform: translate(-50%, -50%);
  405. }
  406. }
  407. .imgTitle {
  408. padding-bottom: .20rem;
  409. }
  410. .personMsg {
  411. padding: 0.3rem 0.4rem;
  412. box-sizing: border-box;
  413. background-color: #fff;
  414. border-radius: 0.16rem;
  415. margin-bottom: 0.38rem;
  416. box-shadow:0px 3px 20px 0px rgba(192,187,224,0.23);
  417. .previewParts {
  418. li {
  419. padding: .1rem .3rem;
  420. overflow: hidden;
  421. }
  422. li.imgLis {
  423. padding-right: 0;
  424. padding-left: 0;
  425. }
  426. h4 {
  427. color: #colors[quest];
  428. font-size: .32rem;
  429. font-weight: bold;
  430. position: relative;
  431. i {
  432. width: .12rem;
  433. height: .12rem;
  434. border-radius: 50%;
  435. background: #FFAD00;
  436. display: inline-block;
  437. position: absolute;
  438. top: .15rem;
  439. left: -0.3rem;
  440. }
  441. }
  442. p {
  443. font-size: .28rem;
  444. color: #424242;
  445. margin: .2rem 0;
  446. word-break: break-all;
  447. }
  448. }
  449. .baseMsg {
  450. font-size: 0.32rem;
  451. color: #colors[quest];
  452. letter-spacing: 0;
  453. text-align: justify;
  454. font-weight: bold;
  455. margin-bottom: 0.15rem;
  456. }
  457. table {
  458. width: 100%;
  459. font-size: 0.3rem;
  460. color: #333333;
  461. letter-spacing: 0;
  462. text-align: justify;
  463. margin-top: .2rem;
  464. tr {
  465. padding: .2rem 0;
  466. line-height: .5rem;
  467. td {
  468. padding-bottom: 0.1rem;
  469. }
  470. span {
  471. color:#777;
  472. width: 1.6rem;
  473. display: inline-block;
  474. }
  475. }
  476. }
  477. .line {
  478. opacity: 0.3;
  479. background: #d8d8d8;
  480. margin: 0.2rem 0;
  481. height: 1px;
  482. }
  483. }
  484. .personMsg2 {
  485. padding-right: 0;
  486. }
  487. .personMsg2.modal {
  488. margin-bottom: 0;
  489. }
  490. .personMsgDoc {
  491. position: fixed;
  492. height: 100%;
  493. width: 100%;
  494. top: 0;
  495. left: 0;
  496. overflow: auto;
  497. z-index: 999;
  498. .personMsgDocModal {
  499. .mask;
  500. position: fixed;
  501. width: 100%;
  502. height: 100%;
  503. top: 0;
  504. left: 0;
  505. z-index: 999;
  506. }
  507. .personMsgDocDetail {
  508. position: fixed;
  509. z-index: 1000;
  510. top: 50%;
  511. left: 50%;
  512. transform: translate(-50%, -50%);
  513. // padding: 0 .4rem;
  514. background-color: #fff;
  515. box-sizing: border-box;
  516. width: 90%;
  517. border-radius: .1rem;
  518. overflow: hidden;
  519. .personMsg {
  520. max-height: 9rem;
  521. overflow: auto;
  522. width: 100%;
  523. border-radius: 0;
  524. -webkit-overflow-scrolling:touch;
  525. }
  526. }
  527. }
  528. .close {
  529. width: .34rem;
  530. height: .34rem;
  531. position: absolute;
  532. right: 0;
  533. top: 0;
  534. padding: 8px;
  535. z-index: 1001;
  536. }
  537. .sure{
  538. position: fixed;
  539. bottom: 0;
  540. z-index: 100;
  541. }
  542. </style>