consultationRecord.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397
  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 17:06:24
  8. * @FilePath: \zyypt-ssb-vue_alipay\src\views\consultationRecord.vue
  9. -->
  10. <template>
  11. <div>
  12. <header>
  13. <div class="center">
  14. <div class="avatarImg">
  15. <img
  16. src="../assets/images/man.png"
  17. alt=""
  18. v-if="recordInfo.HZXB && recordInfo.HZXB == 1"
  19. />
  20. <img
  21. src="../assets/images/woman.png"
  22. alt=""
  23. v-else-if="recordInfo.HZXB && recordInfo.HZXB == 2"
  24. />
  25. <img src="../assets/images/avatar.png" alt="" v-else />
  26. </div>
  27. <div class="avatarInfo">
  28. <div class="name">
  29. <span>{{ info.name }}</span>
  30. <span @click="eye()" v-if="eyeLock"
  31. ><img src="../assets/images/openEye.png" alt=""
  32. /></span>
  33. <span @click="eye()" v-else
  34. ><img src="../assets/images/closeEye.png" alt=""
  35. /></span>
  36. </div>
  37. <div class="info">
  38. <span style="margin-left: 12px">{{
  39. recordInfo.HZXB != 1 && recordInfo.HZXB != 2
  40. ? "-"
  41. : recordInfo.HZXB == 1
  42. ? "男"
  43. : "女"
  44. }}</span>
  45. <span style="margin: 0 12px">|</span>
  46. <span style="font-family: 'PingFang SC-Regular'"
  47. >近一年就诊记录</span
  48. >
  49. </div>
  50. <div class="relativeinfo" @click="toRelative()" v-if="isRelative">
  51. <img src="../assets/images/relative.png" alt="" />
  52. <span>亲属信息</span>
  53. </div>
  54. </div>
  55. </div>
  56. <div class="bottom">
  57. <div class="bottomInfo">
  58. <div class="info">
  59. <p>证件号码</p>
  60. <p>{{ info.idcard }}</p>
  61. </div>
  62. <div class="info">
  63. <p>最近就诊</p>
  64. <p v-if="recordInfo.JLS == 0">--</p>
  65. <p v-else>{{ getDate(recordInfo.MXXQ[0].KFRQ) }}</p>
  66. </div>
  67. </div>
  68. </div>
  69. </header>
  70. <div id="main">
  71. <div v-if="recordInfo.JLS == 0" class="nodata">暂无数据</div>
  72. <div v-else>
  73. <div
  74. class="record"
  75. @click="toDetails(item)"
  76. v-for="(item, index) in recordInfo.MXXQ"
  77. :key="index"
  78. >
  79. <div class="code">
  80. <p>处方状态:</p>
  81. <p v-if="item.CLZT == 0">待处理(已收费)</p>
  82. <p v-else-if="item.CLZT == 1">已审方</p>
  83. <p v-else-if="item.CLZT == 2">代煎机构已确认</p>
  84. <p v-else-if="item.CLZT == 5">已配方</p>
  85. <p v-else-if="item.CLZT == 6">已浸泡</p>
  86. <p v-else-if="item.CLZT == 7">已煎煮</p>
  87. <p v-else-if="item.CLZT == 8">已包装</p>
  88. <p v-else-if="item.CLZT == 9">已快递</p>
  89. <p v-else-if="item.CLZT == 10">已发车</p>
  90. <p v-else-if="item.CLZT == 11">已签收</p>
  91. <p v-else-if="item.CLZT == 12">代煎企业退回</p>
  92. <p v-else-if="item.CLZT == 13">医疗机构退回</p>
  93. <p v-else-if="item.CLZT == 99">处方信息处理出现异常</p>
  94. </div>
  95. <div class="info">
  96. <div class="outDiv">
  97. <div class="title">医疗机构</div>
  98. <div class="name">{{ item.YLJGMC }}</div>
  99. </div>
  100. <div class="outDiv">
  101. <div class="title">处方日期</div>
  102. <div class="name" style="font-family: 'Avenir-Medium'">
  103. {{ getDate(item.KFRQ) }}
  104. </div>
  105. </div>
  106. </div>
  107. </div>
  108. </div>
  109. </div>
  110. </div>
  111. </template>
  112. <script>
  113. </script>
  114. <script>
  115. import { getDate } from "@/mixins/format";
  116. import { eye } from "@/mixins/eye";
  117. import {
  118. getTestAccesstoken,
  119. setParamLog,
  120. getAlipayUser,
  121. getAlipayService,
  122. } from "@/api/index";
  123. import { getCookies, setCookies } from "@/utils/auth";
  124. export default {
  125. name: "ConsultationRecord",
  126. mixins: [getDate(), eye()],
  127. data() {
  128. return {
  129. recordInfo: {
  130. JLS: 0,
  131. HZXB: "",
  132. MXXQ: [],
  133. },
  134. isRelative: true,
  135. };
  136. },
  137. created() {
  138. let query = this.$route.query;
  139. if (query.idcard) {
  140. setCookies("relativeInfo", JSON.stringify(query));
  141. this.info = JSON.parse(JSON.stringify(query));
  142. this.eye("refresh");
  143. setParamLog({type:'alipay',service:'WX001'})
  144. getAlipayService({
  145. Service: "WX001",
  146. ZJHM: query.idcard,
  147. }).then((res) => {
  148. this.recordInfo = res.data;
  149. if (!res.data.HZXB) {
  150. this.recordInfo.HZXB = "-";
  151. }
  152. });
  153. this.isRelative = false;
  154. } else {
  155. if (getCookies("myInfo")) {
  156. this.info = JSON.parse(getCookies("myInfo"));
  157. } else {
  158. this.info = false;
  159. }
  160. this.isRelative = true;
  161. if (this.info) {
  162. this.eye("refresh");
  163. setParamLog({type:'alipay',service:'WX001'})
  164. getAlipayService({
  165. Service: "WX001",
  166. ZJHM: getCookies("idcard"),
  167. }).then((res) => {
  168. if (res.data) {
  169. this.recordInfo = res.data;
  170. }
  171. });
  172. } else {
  173. this.getFirstInfo(() => {
  174. this.info = JSON.parse(getCookies("myInfo"));
  175. this.eye("refresh");
  176. setParamLog({type:'alipay',service:'WX001'})
  177. getAlipayService({
  178. Service: "WX001",
  179. ZJHM: getCookies("idcard"),
  180. }).then((res) => {
  181. if (res.data) {
  182. this.recordInfo = res.data;
  183. }
  184. });
  185. });
  186. }
  187. }
  188. //控制名称显隐
  189. // this.eye("refresh");
  190. },
  191. methods: {
  192. getUrlParms: function (name) {
  193. var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
  194. var getHref = decodeURI(window.location.search);
  195. var r = getHref.substr(1).match(reg);
  196. if (r != null) return unescape(r[2]);
  197. return null;
  198. },
  199. getFirstInfo(callback) {
  200. let accesstoken = this.getUrlParms("accesstoken");
  201. setParamLog({type:'alipay',service:'getAlipayUser'})
  202. getAlipayUser({ accesstoken: accesstoken }).then((res) => {
  203. setCookies("myInfo", JSON.stringify(res.data));
  204. setCookies("idcard", res.data.idcard);
  205. if (callback) callback();
  206. });
  207. // getTestAccesstoken().then((res) => {
  208. // let accesstoken = res.result.data;
  209. // });
  210. },
  211. //亲属信息按钮
  212. toRelative() {
  213. this.$router.push({
  214. name: "RelativeInfo",
  215. query: {
  216. XM: JSON.parse(getCookies("myInfo")).name,
  217. ZJHM: getCookies("idcard"),
  218. },
  219. });
  220. },
  221. toDetails(item) {
  222. setCookies("tabId",0)
  223. this.$router.push({
  224. name: "PrescriptionDetails",
  225. query: {
  226. YNCFBH: item.YNCFBH,
  227. YLJGDM: item.YLJGDM,
  228. KFRQ: item.KFRQ,
  229. CFTS: item.CFTS ? item.CFTS : 0,
  230. YLJGMC: item.YLJGMC,
  231. sex: this.recordInfo.HZXB,
  232. zjhm:this.$route.query.idcard?this.$route.query.idcard:getCookies("idcard")
  233. },
  234. });
  235. },
  236. },
  237. };
  238. </script>
  239. <style lang="scss" scoped>
  240. header {
  241. width: 100%;
  242. // height: 270px;
  243. background-color: #cbb486;
  244. border-bottom-left-radius: 15px;
  245. border-bottom-right-radius: 15px;
  246. padding-bottom: 10px;
  247. }
  248. .center {
  249. // height: 80px;
  250. display: flex;
  251. padding: 10px 15px;
  252. position: relative;
  253. }
  254. .avatarImg {
  255. height: 100%;
  256. img {
  257. width: 70px;
  258. height: 70px;
  259. border-radius: 50%;
  260. // margin-top: 15px;
  261. }
  262. }
  263. .avatarInfo {
  264. .name {
  265. color: #fff;
  266. font-size: 24px;
  267. height: 50px;
  268. display: flex;
  269. align-items: center;
  270. span {
  271. margin-left: 12px;
  272. font-weight: bolder;
  273. }
  274. img {
  275. width: 20px;
  276. }
  277. }
  278. .info {
  279. color: #fff;
  280. font-size: 12px;
  281. }
  282. .relativeinfo {
  283. position: absolute;
  284. top: 22px;
  285. right: 15px;
  286. width: 74px;
  287. padding: 3px 7px;
  288. display: flex;
  289. text-align: center;
  290. align-items: center;
  291. border-radius: 30px;
  292. background: linear-gradient(180deg, #eee5d2 0%, #fdfaf5 100%);
  293. font-family: "PingFang SC-Regular";
  294. color: #8b614d;
  295. font-size: 12px;
  296. img {
  297. width: 18px;
  298. margin-right: 5px;
  299. }
  300. }
  301. }
  302. .bottom {
  303. padding: 0 15px;
  304. height: 100px;
  305. .bottomInfo {
  306. background: rgba(111, 82, 38, 0.2);
  307. border-radius: 8px;
  308. width: 100%;
  309. height: 100%;
  310. display: flex;
  311. .info {
  312. width: 50%;
  313. height: 100%;
  314. flex-direction: column;
  315. display: flex;
  316. justify-content: center;
  317. color: #fff;
  318. font-family: "Avenir-Medium";
  319. p:nth-child(1) {
  320. padding-bottom: 20px;
  321. font-size: 12px;
  322. font-family: "PingFang SC-Regular";
  323. }
  324. p:nth-child(2) {
  325. font-size: 14px;
  326. }
  327. }
  328. .info:nth-child(1) {
  329. p {
  330. border-right: 2px solid;
  331. }
  332. }
  333. }
  334. }
  335. #main {
  336. padding: 10px 15px;
  337. font-family: "PingFang SC-Regular";
  338. .nodata {
  339. color: #7a7a7a;
  340. margin-top: 30px;
  341. }
  342. .record {
  343. margin-bottom: 15px;
  344. box-shadow: 0px 0px 10px 1px rgba(184, 160, 115, 0.3);
  345. border-radius: 8px;
  346. .code {
  347. display: flex;
  348. height: 50px;
  349. align-items: center;
  350. // justify-content: space-between;
  351. padding: 0 15px;
  352. border-bottom: 1px solid #e7e7e7;
  353. font-size: 14px;
  354. color: #000;
  355. text-align: left;
  356. line-height: 20px;
  357. p:nth-child(1) {
  358. width: 80px;
  359. }
  360. p:nth-child(2) {
  361. color: #8b614d;
  362. text-align: right;
  363. }
  364. }
  365. .info {
  366. display: flex;
  367. flex-direction: column;
  368. justify-content: center;
  369. text-align: left;
  370. }
  371. .outDiv:nth-child(1) {
  372. padding-top: 15px;
  373. line-height: 20px;
  374. }
  375. .outDiv:nth-child(2) {
  376. height: 40px;
  377. line-height: 40px;
  378. }
  379. .outDiv {
  380. display: flex;
  381. padding: 0px 15px;
  382. font-family: "PingFang SC-Regular";
  383. font-size: 14px;
  384. .title {
  385. width: 80px;
  386. text-align: left;
  387. color: #999999;
  388. }
  389. .name {
  390. color: #000;
  391. width: calc(100% - 80px);
  392. }
  393. }
  394. }
  395. }
  396. </style>