prescriptionDetails.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706
  1. <!--
  2. * @Description: file content
  3. * @Version: 2.0
  4. * @Author: ljl
  5. * @Date: 2022-06-16 09:49:18
  6. * @LastEditors: ljl
  7. * @LastEditTime: 2022-12-12 13:43:36
  8. * @FilePath: \zyypt-ssb-vue_alipay\src\views\prescriptionDetails.vue
  9. -->
  10. <template>
  11. <div>
  12. <header>
  13. <div class="center">
  14. <div class="avatarImg">
  15. <img src="../assets/images/man.png" alt="" v-if="sex == 1" />
  16. <img src="../assets/images/woman.png" alt="" v-else-if="sex == 2" />
  17. <img src="../assets/images/avatar.png" alt="" v-else />
  18. </div>
  19. <div class="avatarInfo">
  20. <div class="name">
  21. <span>{{ info.name }}</span>
  22. <span @click="eye()" v-if="eyeLock"
  23. ><img src="../assets/images/openEye.png" alt=""
  24. /></span>
  25. <span @click="eye()" v-else
  26. ><img src="../assets/images/closeEye.png" alt=""
  27. /></span>
  28. </div>
  29. </div>
  30. </div>
  31. <div class="bottom">
  32. <div class="bottomInfo">
  33. <div class="info">
  34. <span><img src="../assets/images/hospital.png" alt="" /></span>
  35. <span>{{ $route.query.YLJGMC }}</span>
  36. </div>
  37. <div class="info">
  38. <span><img src="../assets/images/date.png" alt="" /></span>
  39. <span class="date">{{ getDate($route.query.KFRQ) }}</span>
  40. </div>
  41. </div>
  42. </div>
  43. </header>
  44. <div id="main">
  45. <van-tabs
  46. v-model="tabId"
  47. title-active-color="#8b614d"
  48. color="#8b614d"
  49. title-inactive-color="#c4c4c4"
  50. background="#fff"
  51. line-width="70px"
  52. line-height="3px"
  53. duration="0.2"
  54. sticky
  55. >
  56. <van-tab title="处方状态">
  57. <div class="ge"></div>
  58. <van-loading type="spinner" class="load" vertical v-show="presShow"
  59. >加载中...</van-loading
  60. >
  61. <div
  62. v-if="prescriptionStatus.JLS == 0"
  63. class="nodata"
  64. v-show="!presShow"
  65. >
  66. 暂无数据
  67. </div>
  68. <div class="content" v-else v-show="!presShow">
  69. <div v-for="(item1, index1) in MXXQ" :key="index1">
  70. <div
  71. class="outDiv1"
  72. v-for="(item2, index2) in item1.children"
  73. :key="index2"
  74. >
  75. <div class="datetime">
  76. <p
  77. class="date"
  78. :style="index1 == 0 && index2 == 0 ? 'color: #000' : ''"
  79. v-if="index2 == 0 && item1.date"
  80. >
  81. {{ item1.date ? getDate(item1.date) : "" }}
  82. </p>
  83. <p
  84. class="time"
  85. :style="index1 == 0 && index2 == 0 ? 'color: #7a7a7a' : ''"
  86. >
  87. {{ item2.FSSJ ? getTime(item2.FSSJ) : "-" }}
  88. </p>
  89. </div>
  90. <div class="lian">
  91. <img
  92. src="../assets/images/quan.png"
  93. alt=""
  94. style="width: 18px"
  95. v-if="index1 == 0 && index2 == 0"
  96. />
  97. <img src="../assets/images/quan2.png" alt="" v-else />
  98. <div
  99. v-if="
  100. !(
  101. index1 == MXXQ.length - 1 &&
  102. index2 == item1.children.length - 1
  103. )
  104. "
  105. class="line"
  106. :style="index1 == 0 && index2 == 0 ? 'top: 18px' : ''"
  107. ></div>
  108. </div>
  109. <div
  110. class="status"
  111. :style="
  112. index1 == 0 && index2 == 0
  113. ? 'background: #faf8f3; color: #8b614d'
  114. : ''
  115. "
  116. >
  117. <span v-if="item2.CLZT == 0">待处理(已收费)</span>
  118. <span v-else-if="item2.CLZT == 1">已审方</span>
  119. <span v-else-if="item2.CLZT == 2">代煎机构已确认</span>
  120. <span v-else-if="item2.CLZT == 5">已配方</span>
  121. <span v-else-if="item2.CLZT == 6">已浸泡</span>
  122. <span v-else-if="item2.CLZT == 7">已煎煮</span>
  123. <span v-else-if="item2.CLZT == 8">已包装</span>
  124. <span v-else-if="item2.CLZT == 9">已快递</span>
  125. <span v-else-if="item2.CLZT == 10">已发车</span>
  126. <span v-else-if="item2.CLZT == 11">已签收</span>
  127. <span v-else-if="item2.CLZT == 12">代煎企业退回</span>
  128. <span v-else-if="item2.CLZT == 13">医疗机构退回</span>
  129. <span v-else-if="item2.CLZT == 99">处方信息处理出现异常</span>
  130. </div>
  131. </div>
  132. </div>
  133. </div>
  134. </van-tab>
  135. <van-tab title="物流信息">
  136. <div class="ge"></div>
  137. <van-loading type="spinner" class="load" vertical v-show="logShow"
  138. >加载中...</van-loading
  139. >
  140. <div v-if="logisticsInfo.JLS == 0" class="nodata" v-show="!logShow">
  141. 暂无数据
  142. </div>
  143. <div class="content" v-else v-show="!logShow">
  144. <div
  145. class="outDiv2"
  146. v-for="(item, index) in logisticsInfo.MXXQ"
  147. :key="index"
  148. >
  149. <div class="lian">
  150. <img
  151. src="../assets/images/quan.png"
  152. alt=""
  153. style="width: 18px"
  154. v-if="index == 0"
  155. />
  156. <img src="../assets/images/quan2.png" alt="" v-else />
  157. <div
  158. class="line"
  159. :style="index == 0 ? 'top: 18px' : ''"
  160. v-if="index != logisticsInfo.JLS - 1"
  161. ></div>
  162. </div>
  163. <div class="info" :style="index == 0 ? 'color: #000' : ''">
  164. <div class="datetime">
  165. <span>{{ item.FSSJ ? getDateTime(item.FSSJ) : "-" }}</span>
  166. </div>
  167. <div class="status">
  168. <span>{{ item.JDMS }}</span>
  169. </div>
  170. </div>
  171. </div>
  172. </div>
  173. </van-tab>
  174. <van-tab title="处方内容">
  175. <div class="ge"></div>
  176. <van-loading type="spinner" class="load" vertical v-show="precShow"
  177. >加载中...</van-loading
  178. >
  179. <div
  180. v-if="prescriptionContent.JLS == 0"
  181. class="nodata"
  182. v-show="!precShow"
  183. >
  184. 暂无数据
  185. </div>
  186. <div class="outDiv3 content" v-else v-show="!precShow">
  187. <p class="title">
  188. 处方总帖数: <span>{{ CFTS }}</span
  189. >,单帖处方内容如下
  190. </p>
  191. <div class="drugList">
  192. <div class="listHead">
  193. <div style="width: 100%">药品名称</div>
  194. <!-- <div style="width: 50%">药品名称</div>
  195. <div style="width: 50%">产地</div> -->
  196. </div>
  197. <van-list
  198. v-model="loading"
  199. :finished="finished"
  200. @load="onLoad"
  201. finished-text="没有更多了"
  202. >
  203. <div
  204. class="listBody"
  205. v-for="(item, index) in prescriptionContentMXXQ"
  206. :key="index"
  207. >
  208. <!-- <div class="name">{{ item.YPMC }}</div>
  209. <div class="address">{{ item.CD ? item.CD : "-" }}</div> -->
  210. <!-- <div class="jiantou">
  211. <img src="../assets/images/open.png" alt="" />
  212. </div> -->
  213. <div class="name" @click="goDrugTrace1(item)">
  214. <span>{{ item.YPMC1 }}</span>
  215. <img src="../assets/images/syIcon.png" class="drugIcon" alt="" v-if="item.YPSYBM1 && item.YPSYBM1 != -1"/>
  216. </div>
  217. <div class="name" @click="goDrugTrace2(item)">
  218. <span>{{ item.YPMC2 }}</span>
  219. <img src="../assets/images/syIcon.png" class="drugIcon" alt="" v-if="item.YPSYBM2 && item.YPSYBM2 != -1"/>
  220. </div>
  221. </div>
  222. </van-list>
  223. </div>
  224. </div>
  225. </van-tab>
  226. </van-tabs>
  227. </div>
  228. </div>
  229. </template>
  230. <script>
  231. import Vue from "vue";
  232. import { Tab, Tabs, List, Loading } from "vant";
  233. Vue.use(Tab).use(Tabs).use(List).use(Loading);
  234. import { getDate, getTime, getDateTime } from "@/mixins/format";
  235. import { eye } from "@/mixins/eye";
  236. import { getCookies } from "@/utils/auth";
  237. import { setParamLog,getAlipayService } from "@/api/index";
  238. export default {
  239. name: "PrescriptionDetails",
  240. mixins: [getDate(), getTime(), getDateTime(), eye()],
  241. data() {
  242. return {
  243. sex: "",
  244. tabId: 0,
  245. MXXQ: [],
  246. prescriptionContentMXXQ: [],
  247. loading: false,
  248. finished: false,
  249. presShow: false,
  250. logShow: false,
  251. precShow: false,
  252. CFTS: 0,
  253. prescriptionStatus: {
  254. JLS: 0,
  255. MXXQ: [],
  256. },
  257. logisticsInfo: {
  258. JLS: 0,
  259. MXXQ: [],
  260. },
  261. prescriptionContent: {
  262. JLS: 0,
  263. MXXQ: [],
  264. },
  265. strArray:[],
  266. MXXQArray:[]
  267. };
  268. },
  269. created() {
  270. let query = {
  271. YNCFBH: this.$route.query.YNCFBH,
  272. YLJGDM: this.$route.query.YLJGDM,
  273. KFRQ: this.$route.query.KFRQ,
  274. };
  275. this.CFTS = this.$route.query.CFTS
  276. this.presShow = true;
  277. this.logShow = true;
  278. this.precShow = true;
  279. setParamLog({type:'alipay',service:'WX002',jgdm:query.YLJGDM,zjhm:this.$route.query.zjhm})
  280. getAlipayService({ Service: "WX002", ...query }).then((res) => {
  281. let prescriptionStatus = res.data.MXXQ;
  282. this.MXXQ = this.toTree(prescriptionStatus);
  283. // this.MXXQ = this.toTree(this.prescriptionStatus.MXXQ);
  284. this.prescriptionStatus = res.data;
  285. this.presShow = false;
  286. });
  287. setParamLog({type:'alipay',service:'WX003'})
  288. getAlipayService({ Service: "WX003", ...query }).then((res) => {
  289. this.logisticsInfo = res.data;
  290. this.logShow = false;
  291. });
  292. setParamLog({type:'alipay',service:'WX004'})
  293. getAlipayService({ Service: "WX004", ...query }).then((res) => {
  294. res.data.MXXQ.forEach(item1=>{
  295. this.strArray.forEach(item2=>{
  296. if(item2.YPSYBM && item1.YPYBDM == item2.YPYBDM){
  297. item1.YPSYBM = item2.YPSYBM
  298. }
  299. })
  300. })
  301. // this.prescriptionContent = res.data;
  302. // this.prescriptionContentMXXQ = res.data.MXXQ.slice(0, 5);
  303. let prescriptionContentMXXQ = this.toArr(res.data.MXXQ);
  304. this.prescriptionContent = {
  305. // JLS: Math.ceil(res.data.JLS / 2),
  306. JLS: res.data.JLS,
  307. MXXQ: prescriptionContentMXXQ,
  308. };
  309. this.prescriptionContentMXXQ = prescriptionContentMXXQ.slice(0, 5);
  310. this.precShow = false;
  311. });
  312. setParamLog({type:'alipay',service:'WX006'})
  313. getAlipayService({ Service: "WX006", ...query }).then((res) => {
  314. this.MXXQArray = res.data.MXXQ
  315. var str1 = JSON.parse(res.data.MXXQ[0].mxxq)
  316. var str2 = JSON.parse(res.data.MXXQ[1].mxxq)
  317. this.strArray = str1.concat(str2)
  318. });
  319. if (this.$route.query.sex) {
  320. this.sex = this.$route.query.sex.trim();
  321. } else {
  322. this.sex = "-";
  323. }
  324. },
  325. mounted() {
  326. if (getCookies("relativeInfo")) {
  327. this.info = JSON.parse(getCookies("relativeInfo"));
  328. } else {
  329. this.info = JSON.parse(getCookies("myInfo"));
  330. }
  331. this.eye("refresh");
  332. let tabId = getCookies("tabId");
  333. if (!tabId) {
  334. this.tabId = 0;
  335. } else {
  336. this.tabId = Number(tabId);
  337. }
  338. },
  339. methods: {
  340. toArr(oldArr) {
  341. let newArr = [];
  342. if (oldArr.length > 0) {
  343. oldArr.forEach((item, index, arr) => {
  344. if ((index + 1) % 2 == 1) {
  345. let obj = {
  346. YPMC1: item.YPMC,
  347. YPMC2: arr[index + 1] ? arr[index + 1].YPMC : "",
  348. YPSYBM1: item.YPSYBM,
  349. YPSYBM2: arr[index + 1] ? arr[index + 1].YPSYBM : "",
  350. };
  351. newArr.push(obj);
  352. }
  353. });
  354. }
  355. return newArr;
  356. },
  357. toTree(list) {
  358. var newobj = {},
  359. newArr = [];
  360. for (var i = 0; i < list.length; i++) {
  361. var item = list[i];
  362. if (!newobj[item["FSSJ"].substring(0, 8)]) {
  363. newobj[item["FSSJ"].substring(0, 8)] = newArr.push(
  364. item["FSSJ"].substring(0, 8)
  365. );
  366. }
  367. }
  368. let outArr = [];
  369. newArr.forEach((ele) => {
  370. let insideArr = [];
  371. list.forEach((item) => {
  372. if (item.FSSJ) {
  373. if (ele.indexOf(item.FSSJ.substring(0, 8)) != -1) {
  374. item.FSSJ = item.FSSJ.substring(8, 14);
  375. insideArr.push(item);
  376. }
  377. }
  378. if (!ele) {
  379. if (!item.FSSJ) {
  380. insideArr.push(item);
  381. }
  382. }
  383. });
  384. if (ele != -1) {
  385. outArr.push({
  386. date: ele,
  387. children: insideArr,
  388. });
  389. }
  390. });
  391. return outArr;
  392. },
  393. getYPCDM(YPSYBM){
  394. if(this.MXXQArray[0].mxxq.indexOf(YPSYBM) != '-1'){
  395. return this.MXXQArray[0].ypcdm
  396. }
  397. if(this.MXXQArray[1].mxxq.indexOf(YPSYBM) != '-1'){
  398. return this.MXXQArray[1].ypcdm
  399. }
  400. },
  401. onLoad() {
  402. // 异步更新数据
  403. // setTimeout 仅做示例,真实场景中一般为 ajax 请求
  404. setTimeout(() => {
  405. for (let i = 0; i < 5; i++) {
  406. if (
  407. this.prescriptionContentMXXQ.length >=
  408. this.prescriptionContent.MXXQ.length
  409. ) {
  410. this.finished = true;
  411. } else {
  412. this.prescriptionContentMXXQ.push(
  413. this.prescriptionContent.MXXQ[this.prescriptionContentMXXQ.length]
  414. );
  415. }
  416. // console.log(
  417. // this.prescriptionContent.MXXQ[this.prescriptionContentMXXQ.length]
  418. // );
  419. }
  420. // 加载状态结束
  421. this.loading = false;
  422. // 数据全部加载完成
  423. }, 1000);
  424. },
  425. goDrugTrace1(item) {
  426. let ypcdm = this.getYPCDM(item.YPSYBM1)
  427. if(item.YPSYBM1 && item.YPSYBM1 != -1){
  428. this.$router.push({
  429. name: "DrugTrace",
  430. query: {
  431. YPSYBM: item.YPSYBM1,
  432. YPCDM:ypcdm,
  433. },
  434. });
  435. }
  436. },
  437. goDrugTrace2(item) {
  438. let ypcdm = this.getYPCDM(item.YPSYBM2)
  439. if(item.YPSYBM2 && item.YPSYBM2 != -1){
  440. this.$router.push({
  441. name: "DrugTrace",
  442. query: {
  443. YPSYBM: item.YPSYBM2,
  444. YPCDM:ypcdm,
  445. },
  446. });
  447. }
  448. },
  449. },
  450. };
  451. </script>
  452. <style lang="scss" scoped>
  453. header {
  454. width: 100%;
  455. // height: 270px;
  456. background-color: #cbb486;
  457. border-bottom-left-radius: 15px;
  458. border-bottom-right-radius: 15px;
  459. padding-bottom: 10px;
  460. }
  461. .center {
  462. // height: 80px;
  463. display: flex;
  464. padding: 10px 15px;
  465. position: relative;
  466. }
  467. .avatarImg {
  468. height: 100%;
  469. img {
  470. width: 70px;
  471. height: 70px;
  472. border-radius: 50%;
  473. // margin-top: 15px;
  474. }
  475. }
  476. .avatarInfo {
  477. .name {
  478. color: #fff;
  479. font-size: 24px;
  480. height: 50px;
  481. display: flex;
  482. align-items: center;
  483. span {
  484. margin-left: 12px;
  485. font-weight: bolder;
  486. }
  487. img {
  488. width: 20px;
  489. }
  490. }
  491. }
  492. .bottom {
  493. padding: 0 15px;
  494. height: 100px;
  495. font-size: 14px;
  496. text-align: left;
  497. .bottomInfo {
  498. background: rgba(111, 82, 38, 0.2);
  499. border-radius: 8px;
  500. width: 100%;
  501. height: 100%;
  502. .info {
  503. color: #fff;
  504. font-family: "PingFang SC-Regular";
  505. height: 50%;
  506. display: flex;
  507. align-items: center;
  508. padding-left: 12px;
  509. img {
  510. width: 20px;
  511. margin-right: 8px;
  512. }
  513. .date {
  514. // font-family: "Avenir-Roman";
  515. font-family: "Avenir-Medium";
  516. }
  517. }
  518. }
  519. }
  520. ::v-deep #main {
  521. font-family: "PingFang SC-Regular";
  522. .van-tab {
  523. font-size: 18px;
  524. }
  525. .van-tabs--line .van-tabs__wrap {
  526. border-bottom: 1px solid #dcdee2;
  527. }
  528. .load {
  529. margin-top: 50px;
  530. }
  531. .content {
  532. padding: 0 15px;
  533. padding-top: 20px;
  534. }
  535. .nodata {
  536. color: #7a7a7a;
  537. margin-top: 30px;
  538. }
  539. .ge {
  540. background: #f8f8f8;
  541. height: 10px;
  542. }
  543. .outDiv1 {
  544. display: flex;
  545. justify-content: space-around;
  546. align-items: center;
  547. height: 70px;
  548. .datetime {
  549. width: 90px;
  550. text-align: right;
  551. color: #c4c4c4;
  552. .date {
  553. font-family: "Avenir-Medium";
  554. margin-bottom: 10px;
  555. }
  556. .time {
  557. // font-family: "Avenir-Roman";
  558. font-family: "Avenir-Medium";
  559. font-size: 14px;
  560. }
  561. }
  562. img {
  563. width: 16px;
  564. }
  565. .status {
  566. width: 180px;
  567. background: #f6f6f6;
  568. color: #c4c4c4;
  569. border-radius: 4px;
  570. padding: 10px 0;
  571. }
  572. .lian {
  573. width: 30px;
  574. position: relative;
  575. }
  576. .line {
  577. width: 2px;
  578. height: 55px;
  579. background: #e7e7e7;
  580. position: absolute;
  581. top: 16px;
  582. left: 50%;
  583. transform: translateX(-50%);
  584. }
  585. }
  586. .outDiv2 {
  587. display: flex;
  588. // height: 70px;
  589. padding-bottom: 20px;
  590. position: relative;
  591. img {
  592. width: 16px;
  593. }
  594. .lian {
  595. width: 30px;
  596. // position: relative;
  597. margin-left: 10px;
  598. }
  599. .line {
  600. width: 1px;
  601. // height: 75px;
  602. height: calc(100% - 16px);
  603. background: #e7e7e7;
  604. position: absolute;
  605. top: 16px;
  606. left: 24px;
  607. // left: 50%;
  608. // transform: translateX(-50%);
  609. }
  610. .info {
  611. text-align: left;
  612. margin-left: 20px;
  613. color: #999999;
  614. width: calc(100% - 50px);
  615. }
  616. .datetime {
  617. margin-bottom: 10px;
  618. height: 18px;
  619. line-height: 18px;
  620. font-family: "Avenir-Medium";
  621. }
  622. .status {
  623. font-size: 14px;
  624. line-height: 20px;
  625. font-family: "PingFang SC-Regular";
  626. }
  627. }
  628. .outDiv3 {
  629. text-align: left;
  630. color: #999999;
  631. font-size: 14px;
  632. font-family: "PingFang SC-Regular";
  633. .title {
  634. span {
  635. color: #fc7a73;
  636. }
  637. }
  638. .drugList {
  639. background: #ffffff;
  640. box-shadow: 0px 0px 10px 1px rgba(184, 160, 115, 0.3);
  641. border-radius: 4px;
  642. margin-top: 20px;
  643. font-size: 14px;
  644. .listHead {
  645. display: flex;
  646. height: 60px;
  647. border-bottom: 1px solid #e7e7e7;
  648. align-items: center;
  649. text-align: center;
  650. font-size: 16px;
  651. }
  652. .listBody {
  653. display: flex;
  654. height: 60px;
  655. border-bottom: 1px solid #e7e7e7;
  656. align-items: center;
  657. text-align: center;
  658. // .name {
  659. // width: 50%;
  660. // color: #fc7a73;
  661. // }
  662. .name {
  663. text-align: center;
  664. width: 50%;
  665. color: #000000;
  666. display: flex;
  667. justify-content: center;
  668. height: 100%;
  669. flex-direction: column;
  670. height: 100%;
  671. line-height: 22px;
  672. padding: 0 10px;
  673. position: relative;
  674. // span:nth-child(1) {
  675. // color: #fc7a73;
  676. // }
  677. }
  678. .name:nth-child(1) {
  679. border-right: 1px solid #e7e7e7;
  680. }
  681. .drugIcon{
  682. width: 20px;
  683. position: absolute;
  684. right: 3px;
  685. top: 3px;
  686. }
  687. .address {
  688. width: 50%;
  689. color: #000000;
  690. }
  691. .jantou {
  692. width: 10%;
  693. }
  694. img {
  695. width: 18px;
  696. }
  697. }
  698. }
  699. }
  700. }
  701. </style>