Preview.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467
  1. <template>
  2. <div class="preview" ref="preview">
  3. <div class="personMsg">
  4. <p class="baseMsg">{{pathInfo.patientName}}&nbsp;&nbsp;&nbsp;&nbsp;{{pathInfo.patientSex}}&nbsp;&nbsp;&nbsp;&nbsp;{{pathInfo.patientAge}}岁</p>
  5. <table>
  6. <tr>
  7. <td colspan="2">挂号科室:{{pathInfo.selfDeptName}}</td>
  8. </tr>
  9. <tr>
  10. <td>门诊号:{{pathInfo.recordId}}</td>
  11. <td>预约医生:{{pathInfo.doctorName}}</td>
  12. </tr>
  13. <tr>
  14. <td colspan="2">就诊时间:{{pathInfo.systemTime}}</td>
  15. </tr>
  16. </table>
  17. <div class="line"></div>
  18. <p>采集时间:{{pathInfo.systemTime}}</p>
  19. </div>
  20. <div class="personMsg personMsg2">
  21. <ul class="previewParts">
  22. <!-- <li v-if="symptom.choose.length>0"> -->
  23. <li>
  24. <h4><i :style="{'background': '#FF9A9A'}"></i> 主诉:</h4>
  25. <p>
  26. <span v-for="(item,idx) in symptom.choose" :key="item.name+idx">{{item.name+(idx == symptom.choose.length-1?'':'、')}}</span>
  27. </p>
  28. </li>
  29. <!-- <li v-if="diagnose.text.length>0||symptom.choose.length>0"> -->
  30. <li>
  31. <h4><i :style="{'background': '#3D69D9'}"></i> 现病史:</h4>
  32. <p>
  33. <span v-for="(item,idx) in symptom.text" :key="item.text+idx">{{item.textP+(idx == symptom.choose.length-1?'。':';')}}</span>
  34. </p>
  35. <p>
  36. <span v-for="(item,idx) in diagnose.text" :key="item.text+idx">{{item.textP+(idx == diagnose.text.length-1?'。':';')}}</span>
  37. </p>
  38. </li>
  39. <li v-if="showLis[moduleCP['other']]==1">
  40. <h4><i></i> 其他史:</h4>
  41. <p>
  42. <span v-for="(item,idx) in others.text" :key="item.text+idx">{{item.textP+(idx == others.text.length-1?'。':';')}}</span>
  43. </p>
  44. </li>
  45. <li v-if="showLis[moduleCP['suplement']]==1">
  46. <h4><i></i> 补充内容:</h4>
  47. <p>{{addContent.txt}}</p>
  48. </li>
  49. <li v-if="JSON.stringify(diagnose.imgSrc) !='{}'" class="imgLis">
  50. <h4 class="imgTitle"><i></i> 最近一次治疗报告:</h4>
  51. <div v-for="(value,key,idx) in diagnose.imgSrc" class="imgView">
  52. <img :src="value" alt="">
  53. </div>
  54. </li>
  55. </ul>
  56. </div>
  57. <div class="foot">
  58. <span
  59. class="back"
  60. @click="back"
  61. >{{'返回'+ preName}}</span>
  62. <span
  63. class="next"
  64. @click="saveAllImage"
  65. >提 交</span>
  66. </div>
  67. <Submit
  68. v-if="submit"
  69. :showType="showType"
  70. @showSubmit="showSubmit"
  71. ></Submit>
  72. <Loading v-if="loadingShow"></Loading>
  73. <div class="doctorData" @click="handleClick(true)">医生端数据展示</div>
  74. <div class="personMsgDoc" v-if="showDoc">
  75. <div class="personMsgDocModal" @click.prevent="handleClick(false)"></div>
  76. <div class="personMsgDocDetail">
  77. <img class="close" src="../images/small-close.png" alt="" @click="handleClick(false)">
  78. <div class="personMsg personMsg2">
  79. <ul class="previewParts">
  80. <!-- <li v-if="symptom.choose.length>0"> -->
  81. <li>
  82. <h4><i :style="{'background': '#FF9A9A'}"></i> 主诉:</h4>
  83. <p>
  84. <span v-for="(item,idx) in symptom.choose" :key="item.name+idx">{{item.name+(idx == symptom.choose.length-1?'':'、')}}</span>
  85. </p>
  86. </li>
  87. <!-- <li v-if="diagnose.text.length>0||symptom.choose.length>0"> -->
  88. <li>
  89. <h4><i :style="{'background': '#3D69D9'}"></i> 现病史:</h4>
  90. <p>
  91. <span v-for="(item,idx) in symptom.text" :key="item.text+idx">{{item.text+(idx == symptom.choose.length-1?'。':';')}}</span>
  92. </p>
  93. <p>
  94. <span v-for="(item,idx) in diagnose.text" :key="item.text+idx">{{item.text+(idx == diagnose.text.length-1?'。':';')}}</span>
  95. </p>
  96. </li>
  97. <li v-if="showLis[moduleCP['other']]==1">
  98. <h4><i></i> 其他史:</h4>
  99. <p>
  100. <span v-for="(item,idx) in others.text" :key="item.text+idx">{{item.text+(idx == others.text.length-1?'。':';')}}</span>
  101. </p>
  102. </li>
  103. <li v-if="showLis[moduleCP['suplement']]==1">
  104. <h4><i></i> 补充内容:</h4>
  105. <p>{{addContent.txtDoc}}</p>
  106. </li>
  107. <li v-if="JSON.stringify(diagnose.imgSrc) !='{}'" class="imgLis">
  108. <h4 class="imgTitle"><i></i> 最近一次治疗报告:</h4>
  109. <div v-for="(value,key,idx) in diagnose.imgSrc" class="imgView">
  110. <img :src="value" alt="">
  111. </div>
  112. </li>
  113. </ul>
  114. </div>
  115. </div>
  116. </div>
  117. </div>
  118. </template>
  119. <script>
  120. import api from '@utils/api.js';
  121. import Submit from '../common/Submit';
  122. import Loading from '../common/Loading';
  123. import {moduleCP} from '@utils/tools.js'
  124. export default {
  125. props: ['preName','showLis','loadingShow'],
  126. data() {
  127. const { pathInfo, originDatas,loadingShow } = this.$store.state;
  128. let symptomDate = this.$store.state.symptom;
  129. let diagnoseDate = this.$store.state.diagnose;
  130. let othersDate = this.$store.state.others;
  131. let addContentDate = this.$store.state.addContent;
  132. return {
  133. msg: '预览',
  134. pathInfo: pathInfo,
  135. symptom: symptomDate,
  136. diagnose: diagnoseDate,
  137. others: othersDate,
  138. addContent: addContentDate,
  139. submit: false,
  140. showType: 'fail',
  141. imgList:[],
  142. // show:loadingShow,//提交等待的动画loading
  143. tmpNum:0,
  144. moduleCP:moduleCP,
  145. showDoc:false
  146. }
  147. },
  148. methods: {
  149. handleClick(flg){
  150. if(flg){
  151. this.$refs.preview.style.overflow = 'hidden'
  152. }else{
  153. this.$refs.preview.style.overflow = 'auto'
  154. }
  155. this.showDoc = flg
  156. },
  157. showSubmit(flg) {
  158. this.submit = flg
  159. },
  160. back() {
  161. this.$emit('back', 'preview')
  162. },
  163. saveAllImage() {
  164. let formData = new FormData();
  165. let imgList = this.diagnose.imgFile;
  166. // let tmpNum = this.tmpNum;
  167. // var dateBegin = new Date();//获取当前时间
  168. if (imgList.length > 0) {//有图片先上传图片
  169. this.$store.commit('handleToggleShow', true);
  170. for (let i = 0; i < imgList.length; i++) {
  171. let pageFile = imgList[i].file
  172. formData.append('upfiles', imgList[i].file);
  173. // formData.append('upfile', imgList[i].file);
  174. formData.append('type', imgList[i].type);
  175. // api.uploadImageThum(formData).then((res)=>{
  176. // console.log(res)
  177. // let result = res.data;
  178. // if (result.code == 0) {
  179. // this.tmpNum = ++tmpNum
  180. // if(this.tmpNum == imgList.length){
  181. // var dateEnd = new Date();//获取当前时间
  182. // var dateDiff = dateEnd.getTime() - dateBegin.getTime();//时间差的毫秒数
  183. // var dayDiff = dateDiff / 1000;//计算出秒数
  184. // alert('图片上传完成:'+dayDiff+'s')
  185. // }
  186. // }
  187. // })
  188. }
  189. // return
  190. api.uploadImageThums(formData).then((res) => {//获取图片
  191. let result = res.data;
  192. if (result.code == 0) {//图片提交成功再保存数据
  193. // this.showType = 'success'
  194. // this.submit = true
  195. let reportList = []
  196. for(let i = 0;i < result.length;i++){
  197. let obg = {}
  198. obg.narrowImage = result[i].thumbnail.url
  199. obg.narrowName = result[i].thumbnail.original
  200. obg.originalImage = result[i].source.url
  201. obg.originalName = result[i].source.original
  202. obg.orderNum = i+1
  203. obg.type = result[i].source.type
  204. reportList.push(obg)
  205. }
  206. this.imgList = reportList
  207. // var dateEnd = new Date();//获取当前时间
  208. // var dateDiff = dateEnd.getTime() - dateBegin.getTime();//时间差的毫秒数
  209. // var dayDiff = dateDiff / 1000;//计算出秒数
  210. // alert('图片上传完成:'+dayDiff+'s')
  211. this.saveAllDate()
  212. } else {//提交失败提示
  213. this.defaultWaring(res)
  214. }
  215. }).catch((err)=>{
  216. this.defaultWaring(err)
  217. })
  218. return;
  219. } else {//没有图片直接保存数据
  220. this.$store.commit('handleToggleShow', true);
  221. this.saveAllDate()
  222. }
  223. },
  224. getStr(arr,flg){
  225. let tmpStr = '',tmpStrDoc = '',obg={};
  226. for(let i = 0;i<arr.length;i++){
  227. tmpStr+=arr[i].text+';'
  228. tmpStrDoc+=arr[i].textP+';'
  229. }
  230. obg.content=tmpStr
  231. obg.contentValue=tmpStrDoc
  232. obg.type=flg
  233. return obg;
  234. },
  235. saveAllDate() {
  236. const {pathInfo,symptom,diagnose,others,addContent} = this
  237. let detailList = []
  238. if(symptom.text.length>0){
  239. detailList.push(this.getStr(symptom.text,1))
  240. }
  241. if(diagnose.text.length>0){
  242. detailList.push(this.getStr(diagnose.text,2))
  243. }
  244. if(others.text.length>0){
  245. let obg = {}
  246. detailList.push(this.getStr(others.text,3))
  247. }
  248. if(addContent.txt){
  249. let obg = {}
  250. obg.content=addContent.txtDoc
  251. obg.contentValue=addContent.txt
  252. obg.type=4
  253. detailList.push(obg)
  254. }
  255. let params = {
  256. "dataJson": "1",
  257. "detailList": detailList,
  258. "hospitalId": pathInfo.hospitalId,//医院id
  259. "hospitalName": pathInfo.hospitalName,//医院名称
  260. "hospitalCode": pathInfo.hospitalCode,//医院编码
  261. "doctorId": pathInfo.doctorId,//医生id
  262. "doctorCode": pathInfo.doctorCode,//医生编码
  263. "doctorName": pathInfo.doctorName,//医生name
  264. "hospitalDeptCode": pathInfo.hospitalDeptCode,//医院科室编码
  265. "hospitalDeptId": pathInfo.hospitalDeptId,//科室id
  266. "hospitalDeptName": pathInfo.hospitalDeptName,//科室name
  267. "inquiryCode": pathInfo.recordId,//就诊序列号,目前是门诊号
  268. "patientBirthday": pathInfo.birthday+':00',//患者出生日期,格式为:2018-11-28 17:25:30
  269. "patientCode": pathInfo.patientCode,//患者编号
  270. "patientId": pathInfo.patientId,//患者id
  271. "patientIdNo": pathInfo.patientIdNo,//患者证件号码(病历号)
  272. "patientName": pathInfo.patientName,//患者姓名
  273. // "patientPhone": pathInfo,//患者联系电话(非)
  274. "patientSex": pathInfo.patientSex=='男'?1:2,//患者性别:1男2女(非)
  275. // "regVisitedState": pathInfo,//就诊状态(0待接诊,1接诊中,2完成接诊)(非)
  276. "reportList": this.imgList,
  277. // "type": 0//病历分类(1:门诊,2:住院)
  278. }
  279. // console.log(params)
  280. api.saveInquiry(params).then((res) => {
  281. if (res.data.code == 0) {
  282. this.$store.commit('handleToggleShow', false);
  283. this.showType = 'success'
  284. this.submit = true
  285. } else {
  286. this.defaultWaring(res)
  287. }
  288. }).catch((err)=>{
  289. this.defaultWaring(err)
  290. })
  291. },
  292. defaultWaring(res){
  293. this.$store.commit('handleToggleShow', false);
  294. this.showType = 'fail'
  295. this.submit = true
  296. let timer = setTimeout(() => {
  297. this.submit = false
  298. clearTimeout(timer)
  299. }, 2000);
  300. }
  301. },
  302. components: {
  303. Submit,
  304. Loading,
  305. }
  306. }
  307. </script>
  308. <style lang="less" scoped>
  309. @import "../less/base.less";
  310. .foot {
  311. .dbfooter;
  312. }
  313. .doctorData {
  314. float: right;
  315. color: #0043E8;
  316. margin-bottom: 30px;
  317. }
  318. .preview {
  319. color: red;
  320. background-color: #f2f2f5;
  321. position: fixed;
  322. width: 100%;
  323. height: 100%;
  324. top: 0;
  325. left: 0;
  326. box-sizing: border-box;
  327. padding: 0.3rem 0.4rem 1rem .4rem;
  328. overflow: auto;
  329. -webkit-overflow-scrolling:touch;
  330. }
  331. .imgView {
  332. width: 1.86rem;
  333. height: 1.9rem;
  334. float: left;
  335. border: 1px solid #dfe0e4;
  336. margin: 0 0.2rem 0.3rem 0;
  337. box-sizing: border-box;
  338. position: relative;
  339. overflow: hidden;
  340. img {
  341. position: absolute;
  342. left: 50%;
  343. top: 50%;
  344. width: 100%;
  345. transform: translate(-50%, -50%);
  346. }
  347. }
  348. .imgTitle {
  349. padding-bottom: .20rem;
  350. }
  351. .personMsg {
  352. padding: 0.3rem 0.4rem;
  353. box-sizing: border-box;
  354. background-color: #fff;
  355. border-radius: 0.16rem;
  356. margin-bottom: 0.38rem;
  357. .previewParts {
  358. li {
  359. padding: .1rem .3rem;
  360. overflow: hidden;
  361. }
  362. li.imgLis {
  363. padding-right: 0;
  364. padding-left: 0;
  365. }
  366. h4 {
  367. color: #000;
  368. font-size: .32rem;
  369. font-weight: bold;
  370. position: relative;
  371. i {
  372. width: .16rem;
  373. height: .16rem;
  374. border-radius: 50%;
  375. background: #767676;
  376. display: inline-block;
  377. position: absolute;
  378. top: .15rem;
  379. left: -0.3rem;
  380. }
  381. }
  382. p {
  383. font-size: .28rem;
  384. color: #424242;
  385. margin: .2rem 0;
  386. word-break: break-all;
  387. }
  388. }
  389. .baseMsg {
  390. font-size: 0.32rem;
  391. color: #000000;
  392. letter-spacing: 0;
  393. text-align: justify;
  394. font-weight: bold;
  395. margin-bottom: 0.13rem;
  396. }
  397. table {
  398. width: 100%;
  399. font-size: 0.26rem;
  400. color: #333333;
  401. letter-spacing: 0;
  402. text-align: justify;
  403. margin-top: .2rem;
  404. tr {
  405. padding: .2rem 0;
  406. line-height: .5rem;
  407. }
  408. }
  409. .line {
  410. opacity: 0.3;
  411. background: #d8d8d8;
  412. margin: 0.2rem 0;
  413. height: 1px;
  414. }
  415. }
  416. .personMsg2 {
  417. padding-right: 0;
  418. }
  419. .personMsgDoc {
  420. position: fixed;
  421. height: 100%;
  422. width: 100%;
  423. top: 0;
  424. left: 0;
  425. overflow: auto;
  426. z-index: 999;
  427. .personMsgDocModal {
  428. .mask;
  429. position: fixed;
  430. width: 100%;
  431. height: 100%;
  432. top: 0;
  433. left: 0;
  434. z-index: 999;
  435. }
  436. .personMsgDocDetail {
  437. position: fixed;
  438. z-index: 1000;
  439. top: 50%;
  440. left: 50%;
  441. transform: translate(-50%, -50%);
  442. // padding: 0 .4rem;
  443. background-color: #fff;
  444. box-sizing: border-box;
  445. width: 90%;
  446. border-radius: .1rem;
  447. overflow: hidden;
  448. .personMsg {
  449. max-height: 9rem;
  450. overflow: auto;
  451. width: 100%;
  452. border-radius: 0;
  453. -webkit-overflow-scrolling:touch;
  454. }
  455. }
  456. }
  457. .close {
  458. width: .34rem;
  459. height: .34rem;
  460. position: absolute;
  461. right: 0;
  462. top: 0;
  463. padding: 8px;
  464. z-index: 1001;
  465. }
  466. </style>