Preview.vue 20 KB

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