123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706 |
- <!--
- * @Description: file content
- * @Version: 2.0
- * @Author: ljl
- * @Date: 2022-06-16 09:49:18
- * @LastEditors: ljl
- * @LastEditTime: 2022-12-12 13:43:36
- * @FilePath: \zyypt-ssb-vue_alipay\src\views\prescriptionDetails.vue
- -->
- <template>
- <div>
- <header>
- <div class="center">
- <div class="avatarImg">
- <img src="../assets/images/man.png" alt="" v-if="sex == 1" />
- <img src="../assets/images/woman.png" alt="" v-else-if="sex == 2" />
- <img src="../assets/images/avatar.png" alt="" v-else />
- </div>
- <div class="avatarInfo">
- <div class="name">
- <span>{{ info.name }}</span>
- <span @click="eye()" v-if="eyeLock"
- ><img src="../assets/images/openEye.png" alt=""
- /></span>
- <span @click="eye()" v-else
- ><img src="../assets/images/closeEye.png" alt=""
- /></span>
- </div>
- </div>
- </div>
- <div class="bottom">
- <div class="bottomInfo">
- <div class="info">
- <span><img src="../assets/images/hospital.png" alt="" /></span>
- <span>{{ $route.query.YLJGMC }}</span>
- </div>
- <div class="info">
- <span><img src="../assets/images/date.png" alt="" /></span>
- <span class="date">{{ getDate($route.query.KFRQ) }}</span>
- </div>
- </div>
- </div>
- </header>
- <div id="main">
- <van-tabs
- v-model="tabId"
- title-active-color="#8b614d"
- color="#8b614d"
- title-inactive-color="#c4c4c4"
- background="#fff"
- line-width="70px"
- line-height="3px"
- duration="0.2"
- sticky
- >
- <van-tab title="处方状态">
- <div class="ge"></div>
- <van-loading type="spinner" class="load" vertical v-show="presShow"
- >加载中...</van-loading
- >
- <div
- v-if="prescriptionStatus.JLS == 0"
- class="nodata"
- v-show="!presShow"
- >
- 暂无数据
- </div>
- <div class="content" v-else v-show="!presShow">
- <div v-for="(item1, index1) in MXXQ" :key="index1">
- <div
- class="outDiv1"
- v-for="(item2, index2) in item1.children"
- :key="index2"
- >
- <div class="datetime">
- <p
- class="date"
- :style="index1 == 0 && index2 == 0 ? 'color: #000' : ''"
- v-if="index2 == 0 && item1.date"
- >
- {{ item1.date ? getDate(item1.date) : "" }}
- </p>
- <p
- class="time"
- :style="index1 == 0 && index2 == 0 ? 'color: #7a7a7a' : ''"
- >
- {{ item2.FSSJ ? getTime(item2.FSSJ) : "-" }}
- </p>
- </div>
- <div class="lian">
- <img
- src="../assets/images/quan.png"
- alt=""
- style="width: 18px"
- v-if="index1 == 0 && index2 == 0"
- />
- <img src="../assets/images/quan2.png" alt="" v-else />
- <div
- v-if="
- !(
- index1 == MXXQ.length - 1 &&
- index2 == item1.children.length - 1
- )
- "
- class="line"
- :style="index1 == 0 && index2 == 0 ? 'top: 18px' : ''"
- ></div>
- </div>
- <div
- class="status"
- :style="
- index1 == 0 && index2 == 0
- ? 'background: #faf8f3; color: #8b614d'
- : ''
- "
- >
- <span v-if="item2.CLZT == 0">待处理(已收费)</span>
- <span v-else-if="item2.CLZT == 1">已审方</span>
- <span v-else-if="item2.CLZT == 2">代煎机构已确认</span>
- <span v-else-if="item2.CLZT == 5">已配方</span>
- <span v-else-if="item2.CLZT == 6">已浸泡</span>
- <span v-else-if="item2.CLZT == 7">已煎煮</span>
- <span v-else-if="item2.CLZT == 8">已包装</span>
- <span v-else-if="item2.CLZT == 9">已快递</span>
- <span v-else-if="item2.CLZT == 10">已发车</span>
- <span v-else-if="item2.CLZT == 11">已签收</span>
- <span v-else-if="item2.CLZT == 12">代煎企业退回</span>
- <span v-else-if="item2.CLZT == 13">医疗机构退回</span>
- <span v-else-if="item2.CLZT == 99">处方信息处理出现异常</span>
- </div>
- </div>
- </div>
- </div>
- </van-tab>
- <van-tab title="物流信息">
- <div class="ge"></div>
- <van-loading type="spinner" class="load" vertical v-show="logShow"
- >加载中...</van-loading
- >
- <div v-if="logisticsInfo.JLS == 0" class="nodata" v-show="!logShow">
- 暂无数据
- </div>
- <div class="content" v-else v-show="!logShow">
- <div
- class="outDiv2"
- v-for="(item, index) in logisticsInfo.MXXQ"
- :key="index"
- >
- <div class="lian">
- <img
- src="../assets/images/quan.png"
- alt=""
- style="width: 18px"
- v-if="index == 0"
- />
- <img src="../assets/images/quan2.png" alt="" v-else />
- <div
- class="line"
- :style="index == 0 ? 'top: 18px' : ''"
- v-if="index != logisticsInfo.JLS - 1"
- ></div>
- </div>
- <div class="info" :style="index == 0 ? 'color: #000' : ''">
- <div class="datetime">
- <span>{{ item.FSSJ ? getDateTime(item.FSSJ) : "-" }}</span>
- </div>
- <div class="status">
- <span>{{ item.JDMS }}</span>
- </div>
- </div>
- </div>
- </div>
- </van-tab>
- <van-tab title="处方内容">
- <div class="ge"></div>
- <van-loading type="spinner" class="load" vertical v-show="precShow"
- >加载中...</van-loading
- >
- <div
- v-if="prescriptionContent.JLS == 0"
- class="nodata"
- v-show="!precShow"
- >
- 暂无数据
- </div>
- <div class="outDiv3 content" v-else v-show="!precShow">
- <p class="title">
- 处方总帖数: <span>{{ CFTS }}</span
- >,单帖处方内容如下
- </p>
- <div class="drugList">
- <div class="listHead">
- <div style="width: 100%">药品名称</div>
- <!-- <div style="width: 50%">药品名称</div>
- <div style="width: 50%">产地</div> -->
- </div>
- <van-list
- v-model="loading"
- :finished="finished"
- @load="onLoad"
- finished-text="没有更多了"
- >
- <div
- class="listBody"
- v-for="(item, index) in prescriptionContentMXXQ"
- :key="index"
- >
- <!-- <div class="name">{{ item.YPMC }}</div>
- <div class="address">{{ item.CD ? item.CD : "-" }}</div> -->
- <!-- <div class="jiantou">
- <img src="../assets/images/open.png" alt="" />
- </div> -->
- <div class="name" @click="goDrugTrace1(item)">
- <span>{{ item.YPMC1 }}</span>
- <img src="../assets/images/syIcon.png" class="drugIcon" alt="" v-if="item.YPSYBM1 && item.YPSYBM1 != -1"/>
- </div>
- <div class="name" @click="goDrugTrace2(item)">
- <span>{{ item.YPMC2 }}</span>
- <img src="../assets/images/syIcon.png" class="drugIcon" alt="" v-if="item.YPSYBM2 && item.YPSYBM2 != -1"/>
- </div>
- </div>
- </van-list>
- </div>
- </div>
- </van-tab>
- </van-tabs>
- </div>
- </div>
- </template>
- <script>
- import Vue from "vue";
- import { Tab, Tabs, List, Loading } from "vant";
- Vue.use(Tab).use(Tabs).use(List).use(Loading);
- import { getDate, getTime, getDateTime } from "@/mixins/format";
- import { eye } from "@/mixins/eye";
- import { getCookies } from "@/utils/auth";
- import { setParamLog,getAlipayService } from "@/api/index";
- export default {
- name: "PrescriptionDetails",
- mixins: [getDate(), getTime(), getDateTime(), eye()],
- data() {
- return {
- sex: "",
- tabId: 0,
- MXXQ: [],
- prescriptionContentMXXQ: [],
- loading: false,
- finished: false,
- presShow: false,
- logShow: false,
- precShow: false,
- CFTS: 0,
- prescriptionStatus: {
- JLS: 0,
- MXXQ: [],
- },
- logisticsInfo: {
- JLS: 0,
- MXXQ: [],
- },
- prescriptionContent: {
- JLS: 0,
- MXXQ: [],
- },
- strArray:[],
- MXXQArray:[]
- };
- },
- created() {
- let query = {
- YNCFBH: this.$route.query.YNCFBH,
- YLJGDM: this.$route.query.YLJGDM,
- KFRQ: this.$route.query.KFRQ,
- };
- this.CFTS = this.$route.query.CFTS
- this.presShow = true;
- this.logShow = true;
- this.precShow = true;
- setParamLog({type:'alipay',service:'WX002',jgdm:query.YLJGDM,zjhm:this.$route.query.zjhm})
- getAlipayService({ Service: "WX002", ...query }).then((res) => {
- let prescriptionStatus = res.data.MXXQ;
- this.MXXQ = this.toTree(prescriptionStatus);
- // this.MXXQ = this.toTree(this.prescriptionStatus.MXXQ);
- this.prescriptionStatus = res.data;
- this.presShow = false;
- });
- setParamLog({type:'alipay',service:'WX003'})
- getAlipayService({ Service: "WX003", ...query }).then((res) => {
- this.logisticsInfo = res.data;
- this.logShow = false;
- });
- setParamLog({type:'alipay',service:'WX004'})
- getAlipayService({ Service: "WX004", ...query }).then((res) => {
- res.data.MXXQ.forEach(item1=>{
- this.strArray.forEach(item2=>{
- if(item2.YPSYBM && item1.YPYBDM == item2.YPYBDM){
- item1.YPSYBM = item2.YPSYBM
- }
- })
- })
- // this.prescriptionContent = res.data;
- // this.prescriptionContentMXXQ = res.data.MXXQ.slice(0, 5);
- let prescriptionContentMXXQ = this.toArr(res.data.MXXQ);
- this.prescriptionContent = {
- // JLS: Math.ceil(res.data.JLS / 2),
- JLS: res.data.JLS,
- MXXQ: prescriptionContentMXXQ,
- };
- this.prescriptionContentMXXQ = prescriptionContentMXXQ.slice(0, 5);
- this.precShow = false;
- });
- setParamLog({type:'alipay',service:'WX006'})
- getAlipayService({ Service: "WX006", ...query }).then((res) => {
- this.MXXQArray = res.data.MXXQ
- var str1 = JSON.parse(res.data.MXXQ[0].mxxq)
- var str2 = JSON.parse(res.data.MXXQ[1].mxxq)
- this.strArray = str1.concat(str2)
- });
- if (this.$route.query.sex) {
- this.sex = this.$route.query.sex.trim();
- } else {
- this.sex = "-";
- }
- },
- mounted() {
- if (getCookies("relativeInfo")) {
- this.info = JSON.parse(getCookies("relativeInfo"));
- } else {
- this.info = JSON.parse(getCookies("myInfo"));
- }
- this.eye("refresh");
- let tabId = getCookies("tabId");
- if (!tabId) {
- this.tabId = 0;
- } else {
- this.tabId = Number(tabId);
- }
- },
- methods: {
- toArr(oldArr) {
- let newArr = [];
- if (oldArr.length > 0) {
- oldArr.forEach((item, index, arr) => {
- if ((index + 1) % 2 == 1) {
- let obj = {
- YPMC1: item.YPMC,
- YPMC2: arr[index + 1] ? arr[index + 1].YPMC : "",
- YPSYBM1: item.YPSYBM,
- YPSYBM2: arr[index + 1] ? arr[index + 1].YPSYBM : "",
- };
- newArr.push(obj);
- }
- });
- }
- return newArr;
- },
- toTree(list) {
- var newobj = {},
- newArr = [];
- for (var i = 0; i < list.length; i++) {
- var item = list[i];
- if (!newobj[item["FSSJ"].substring(0, 8)]) {
- newobj[item["FSSJ"].substring(0, 8)] = newArr.push(
- item["FSSJ"].substring(0, 8)
- );
- }
- }
- let outArr = [];
- newArr.forEach((ele) => {
- let insideArr = [];
- list.forEach((item) => {
- if (item.FSSJ) {
- if (ele.indexOf(item.FSSJ.substring(0, 8)) != -1) {
- item.FSSJ = item.FSSJ.substring(8, 14);
- insideArr.push(item);
- }
- }
- if (!ele) {
- if (!item.FSSJ) {
- insideArr.push(item);
- }
- }
- });
- if (ele != -1) {
- outArr.push({
- date: ele,
- children: insideArr,
- });
- }
- });
- return outArr;
- },
- getYPCDM(YPSYBM){
- if(this.MXXQArray[0].mxxq.indexOf(YPSYBM) != '-1'){
- return this.MXXQArray[0].ypcdm
- }
- if(this.MXXQArray[1].mxxq.indexOf(YPSYBM) != '-1'){
- return this.MXXQArray[1].ypcdm
- }
- },
- onLoad() {
- // 异步更新数据
- // setTimeout 仅做示例,真实场景中一般为 ajax 请求
- setTimeout(() => {
- for (let i = 0; i < 5; i++) {
- if (
- this.prescriptionContentMXXQ.length >=
- this.prescriptionContent.MXXQ.length
- ) {
- this.finished = true;
- } else {
- this.prescriptionContentMXXQ.push(
- this.prescriptionContent.MXXQ[this.prescriptionContentMXXQ.length]
- );
- }
- // console.log(
- // this.prescriptionContent.MXXQ[this.prescriptionContentMXXQ.length]
- // );
- }
- // 加载状态结束
- this.loading = false;
- // 数据全部加载完成
- }, 1000);
- },
- goDrugTrace1(item) {
- let ypcdm = this.getYPCDM(item.YPSYBM1)
- if(item.YPSYBM1 && item.YPSYBM1 != -1){
- this.$router.push({
- name: "DrugTrace",
- query: {
- YPSYBM: item.YPSYBM1,
- YPCDM:ypcdm,
- },
- });
- }
- },
- goDrugTrace2(item) {
- let ypcdm = this.getYPCDM(item.YPSYBM2)
- if(item.YPSYBM2 && item.YPSYBM2 != -1){
- this.$router.push({
- name: "DrugTrace",
- query: {
- YPSYBM: item.YPSYBM2,
- YPCDM:ypcdm,
- },
- });
- }
- },
- },
- };
- </script>
- <style lang="scss" scoped>
- header {
- width: 100%;
- // height: 270px;
- background-color: #cbb486;
- border-bottom-left-radius: 15px;
- border-bottom-right-radius: 15px;
- padding-bottom: 10px;
- }
- .center {
- // height: 80px;
- display: flex;
- padding: 10px 15px;
- position: relative;
- }
- .avatarImg {
- height: 100%;
- img {
- width: 70px;
- height: 70px;
- border-radius: 50%;
- // margin-top: 15px;
- }
- }
- .avatarInfo {
- .name {
- color: #fff;
- font-size: 24px;
- height: 50px;
- display: flex;
- align-items: center;
- span {
- margin-left: 12px;
- font-weight: bolder;
- }
- img {
- width: 20px;
- }
- }
- }
- .bottom {
- padding: 0 15px;
- height: 100px;
- font-size: 14px;
- text-align: left;
- .bottomInfo {
- background: rgba(111, 82, 38, 0.2);
- border-radius: 8px;
- width: 100%;
- height: 100%;
- .info {
- color: #fff;
- font-family: "PingFang SC-Regular";
- height: 50%;
- display: flex;
- align-items: center;
- padding-left: 12px;
- img {
- width: 20px;
- margin-right: 8px;
- }
- .date {
- // font-family: "Avenir-Roman";
- font-family: "Avenir-Medium";
- }
- }
- }
- }
- ::v-deep #main {
- font-family: "PingFang SC-Regular";
- .van-tab {
- font-size: 18px;
- }
- .van-tabs--line .van-tabs__wrap {
- border-bottom: 1px solid #dcdee2;
- }
- .load {
- margin-top: 50px;
- }
- .content {
- padding: 0 15px;
- padding-top: 20px;
- }
- .nodata {
- color: #7a7a7a;
- margin-top: 30px;
- }
- .ge {
- background: #f8f8f8;
- height: 10px;
- }
- .outDiv1 {
- display: flex;
- justify-content: space-around;
- align-items: center;
- height: 70px;
- .datetime {
- width: 90px;
- text-align: right;
- color: #c4c4c4;
- .date {
- font-family: "Avenir-Medium";
- margin-bottom: 10px;
- }
- .time {
- // font-family: "Avenir-Roman";
- font-family: "Avenir-Medium";
- font-size: 14px;
- }
- }
- img {
- width: 16px;
- }
- .status {
- width: 180px;
- background: #f6f6f6;
- color: #c4c4c4;
- border-radius: 4px;
- padding: 10px 0;
- }
- .lian {
- width: 30px;
- position: relative;
- }
- .line {
- width: 2px;
- height: 55px;
- background: #e7e7e7;
- position: absolute;
- top: 16px;
- left: 50%;
- transform: translateX(-50%);
- }
- }
- .outDiv2 {
- display: flex;
- // height: 70px;
- padding-bottom: 20px;
- position: relative;
- img {
- width: 16px;
- }
- .lian {
- width: 30px;
- // position: relative;
- margin-left: 10px;
- }
- .line {
- width: 1px;
- // height: 75px;
- height: calc(100% - 16px);
- background: #e7e7e7;
- position: absolute;
- top: 16px;
- left: 24px;
- // left: 50%;
- // transform: translateX(-50%);
- }
- .info {
- text-align: left;
- margin-left: 20px;
- color: #999999;
- width: calc(100% - 50px);
- }
- .datetime {
- margin-bottom: 10px;
- height: 18px;
- line-height: 18px;
- font-family: "Avenir-Medium";
- }
- .status {
- font-size: 14px;
- line-height: 20px;
- font-family: "PingFang SC-Regular";
- }
- }
- .outDiv3 {
- text-align: left;
- color: #999999;
- font-size: 14px;
- font-family: "PingFang SC-Regular";
- .title {
- span {
- color: #fc7a73;
- }
- }
- .drugList {
- background: #ffffff;
- box-shadow: 0px 0px 10px 1px rgba(184, 160, 115, 0.3);
- border-radius: 4px;
- margin-top: 20px;
- font-size: 14px;
- .listHead {
- display: flex;
- height: 60px;
- border-bottom: 1px solid #e7e7e7;
- align-items: center;
- text-align: center;
- font-size: 16px;
- }
- .listBody {
- display: flex;
- height: 60px;
- border-bottom: 1px solid #e7e7e7;
- align-items: center;
- text-align: center;
- // .name {
- // width: 50%;
- // color: #fc7a73;
- // }
- .name {
- text-align: center;
- width: 50%;
- color: #000000;
- display: flex;
- justify-content: center;
- height: 100%;
- flex-direction: column;
- height: 100%;
- line-height: 22px;
- padding: 0 10px;
- position: relative;
- // span:nth-child(1) {
- // color: #fc7a73;
- // }
- }
- .name:nth-child(1) {
- border-right: 1px solid #e7e7e7;
- }
- .drugIcon{
- width: 20px;
- position: absolute;
- right: 3px;
- top: 3px;
- }
- .address {
- width: 50%;
- color: #000000;
- }
- .jantou {
- width: 10%;
- }
- img {
- width: 18px;
- }
- }
- }
- }
- }
- </style>
|