Preview.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358
  1. <template>
  2. <div class="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>
  74. </template>
  75. <script>
  76. import api from '@utils/api.js';
  77. import Submit from '../common/Submit';
  78. import Loading from '../common/Loading';
  79. import {moduleCP} from '@utils/tools.js'
  80. export default {
  81. props: ['preName','showLis','loadingShow'],
  82. data() {
  83. const { pathInfo, originDatas,loadingShow } = this.$store.state;
  84. let symptomDate = this.$store.state.symptom;
  85. let diagnoseDate = this.$store.state.diagnose;
  86. let othersDate = this.$store.state.others;
  87. let addContentDate = this.$store.state.addContent;
  88. return {
  89. msg: '预览',
  90. pathInfo: pathInfo,
  91. symptom: symptomDate,
  92. diagnose: diagnoseDate,
  93. others: othersDate,
  94. addContent: addContentDate,
  95. submit: false,
  96. showType: 'fail',
  97. imgList:[],
  98. // show:loadingShow,//提交等待的动画loading
  99. tmpNum:0,
  100. moduleCP:moduleCP
  101. }
  102. },
  103. methods: {
  104. showSubmit(flg) {
  105. this.submit = flg
  106. },
  107. back() {
  108. this.$emit('back', 'preview')
  109. },
  110. saveAllImage() {
  111. let formData = new FormData();
  112. let imgList = this.diagnose.imgFile;
  113. // let tmpNum = this.tmpNum;
  114. // var dateBegin = new Date();//获取当前时间
  115. if (imgList.length > 0) {//有图片先上传图片
  116. this.$store.commit('handleToggleShow', true);
  117. for (let i = 0; i < imgList.length; i++) {
  118. let pageFile = imgList[i].file
  119. formData.append('upfiles', imgList[i].file);
  120. // formData.append('upfile', imgList[i].file);
  121. formData.append('type', imgList[i].type);
  122. // api.uploadImageThum(formData).then((res)=>{
  123. // console.log(res)
  124. // let result = res.data;
  125. // if (result.code == 0) {
  126. // this.tmpNum = ++tmpNum
  127. // if(this.tmpNum == imgList.length){
  128. // var dateEnd = new Date();//获取当前时间
  129. // var dateDiff = dateEnd.getTime() - dateBegin.getTime();//时间差的毫秒数
  130. // var dayDiff = dateDiff / 1000;//计算出秒数
  131. // alert('图片上传完成:'+dayDiff+'s')
  132. // }
  133. // }
  134. // })
  135. }
  136. // return
  137. api.uploadImageThums(formData).then((res) => {//获取图片
  138. let result = res.data;
  139. if (result.code == 0) {//图片提交成功再保存数据
  140. // this.showType = 'success'
  141. // this.submit = true
  142. let reportList = []
  143. for(let i = 0;i < result.length;i++){
  144. let obg = {}
  145. obg.narrowImage = result[i].thumbnail.url
  146. obg.narrowName = result[i].thumbnail.original
  147. obg.originalImage = result[i].source.url
  148. obg.originalName = result[i].source.original
  149. obg.orderNum = i+1
  150. obg.type = result[i].source.type
  151. reportList.push(obg)
  152. }
  153. this.imgList = reportList
  154. // var dateEnd = new Date();//获取当前时间
  155. // var dateDiff = dateEnd.getTime() - dateBegin.getTime();//时间差的毫秒数
  156. // var dayDiff = dateDiff / 1000;//计算出秒数
  157. // alert('图片上传完成:'+dayDiff+'s')
  158. this.saveAllDate()
  159. } else {//提交失败提示
  160. this.defaultWaring(res)
  161. }
  162. }).catch((err)=>{
  163. this.defaultWaring(err)
  164. })
  165. return;
  166. } else {//没有图片直接保存数据
  167. this.$store.commit('handleToggleShow', true);
  168. this.saveAllDate()
  169. }
  170. },
  171. getStr(arr,flg){
  172. let tmpStr = '',tmpStrDoc = '',obg={};
  173. for(let i = 0;i<arr.length;i++){
  174. tmpStr+=arr[i].text+';'
  175. tmpStrDoc+=arr[i].textP+';'
  176. }
  177. obg.content=tmpStr
  178. obg.contentValue=tmpStrDoc
  179. obg.type=flg
  180. return obg;
  181. },
  182. saveAllDate() {
  183. const {pathInfo,symptom,diagnose,others,addContent} = this
  184. let detailList = []
  185. if(symptom.text.length>0){
  186. detailList.push(this.getStr(symptom.text,1))
  187. }
  188. if(diagnose.text.length>0){
  189. detailList.push(this.getStr(diagnose.text,2))
  190. }
  191. if(others.text.length>0){
  192. let obg = {}
  193. detailList.push(this.getStr(others.text,3))
  194. }
  195. if(addContent.txt){
  196. let obg = {}
  197. obg.content=addContent.txtDoc
  198. obg.contentValue=addContent.txt
  199. obg.type=4
  200. detailList.push(obg)
  201. }
  202. let params = {
  203. "dataJson": "1",
  204. "detailList": detailList,
  205. "hospitalId": pathInfo.hospitalId,//医院id
  206. "hospitalName": pathInfo.hospitalName,//医院名称
  207. "hospitalCode": pathInfo.hospitalCode,//医院编码
  208. "doctorId": pathInfo.doctorId,//医生id
  209. "doctorCode": pathInfo.doctorCode,//医生编码
  210. "doctorName": pathInfo.doctorName,//医生name
  211. "hospitalDeptCode": pathInfo.hospitalDeptCode,//医院科室编码
  212. "hospitalDeptId": pathInfo.hospitalDeptId,//科室id
  213. "hospitalDeptName": pathInfo.hospitalDeptName,//科室name
  214. "inquiryCode": pathInfo.recordId,//就诊序列号,目前是门诊号
  215. "patientBirthday": pathInfo.birthday+':00',//患者出生日期,格式为:2018-11-28 17:25:30
  216. "patientCode": pathInfo.patientCode,//患者编号
  217. "patientId": pathInfo.patientId,//患者id
  218. "patientIdNo": pathInfo.patientIdNo,//患者证件号码(病历号)
  219. "patientName": pathInfo.patientName,//患者姓名
  220. // "patientPhone": pathInfo,//患者联系电话(非)
  221. "patientSex": pathInfo.patientSex=='男'?1:2,//患者性别:1男2女(非)
  222. // "regVisitedState": pathInfo,//就诊状态(0待接诊,1接诊中,2完成接诊)(非)
  223. "reportList": this.imgList,
  224. // "type": 0//病历分类(1:门诊,2:住院)
  225. }
  226. // console.log(params)
  227. api.saveInquiry(params).then((res) => {
  228. if (res.data.code == 0) {
  229. this.$store.commit('handleToggleShow', false);
  230. this.showType = 'success'
  231. this.submit = true
  232. } else {
  233. this.defaultWaring(res)
  234. }
  235. }).catch((err)=>{
  236. this.defaultWaring(err)
  237. })
  238. },
  239. defaultWaring(res){
  240. this.$store.commit('handleToggleShow', false);
  241. this.showType = 'fail'
  242. this.submit = true
  243. let timer = setTimeout(() => {
  244. this.submit = false
  245. clearTimeout(timer)
  246. }, 2000);
  247. }
  248. },
  249. components: {
  250. Submit,
  251. Loading,
  252. }
  253. }
  254. </script>
  255. <style lang="less" scoped>
  256. @import "../less/base.less";
  257. .foot {
  258. .dbfooter;
  259. }
  260. .preview {
  261. color: red;
  262. background-color: #f2f2f5;
  263. position: fixed;
  264. width: 100%;
  265. height: 100%;
  266. top: 0;
  267. left: 0;
  268. box-sizing: border-box;
  269. padding: 0.3rem 0.4rem 1rem .4rem;
  270. overflow: auto;
  271. }
  272. .imgView {
  273. width: 1.86rem;
  274. height: 1.9rem;
  275. float: left;
  276. border: 1px solid #dfe0e4;
  277. margin: 0 0.2rem 0.3rem 0;
  278. box-sizing: border-box;
  279. position: relative;
  280. overflow: hidden;
  281. img {
  282. position: absolute;
  283. left: 50%;
  284. top: 50%;
  285. transform: translate(-50%, -50%);
  286. }
  287. }
  288. .imgTitle {
  289. padding-bottom: .20rem;
  290. }
  291. .personMsg {
  292. padding: 0.3rem 0.4rem;
  293. box-sizing: border-box;
  294. background-color: #fff;
  295. border-radius: 0.16rem;
  296. margin-bottom: 0.38rem;
  297. .previewParts {
  298. li {
  299. padding: .1rem .3rem;
  300. overflow: hidden;
  301. }
  302. li.imgLis {
  303. padding-right: 0;
  304. padding-left: 0;
  305. }
  306. h4 {
  307. color: #000;
  308. font-size: .32rem;
  309. font-weight: bold;
  310. position: relative;
  311. i {
  312. width: .16rem;
  313. height: .16rem;
  314. border-radius: 50%;
  315. background: #767676;
  316. display: inline-block;
  317. position: absolute;
  318. top: .15rem;
  319. left: -0.3rem;
  320. }
  321. }
  322. p {
  323. font-size: .28rem;
  324. color: #424242;
  325. margin: .2rem 0;
  326. }
  327. }
  328. .baseMsg {
  329. font-size: 0.32rem;
  330. color: #000000;
  331. letter-spacing: 0;
  332. text-align: justify;
  333. font-weight: bold;
  334. margin-bottom: 0.13rem;
  335. }
  336. table {
  337. width: 100%;
  338. font-size: 0.26rem;
  339. color: #333333;
  340. letter-spacing: 0;
  341. text-align: justify;
  342. margin-top: .2rem;
  343. tr {
  344. padding: .2rem 0;
  345. line-height: .5rem;
  346. }
  347. }
  348. .line {
  349. opacity: 0.3;
  350. background: #d8d8d8;
  351. margin: 0.2rem 0;
  352. height: 1px;
  353. }
  354. }
  355. .personMsg2 {
  356. padding-right: 0;
  357. }
  358. </style>