inquiryOrderDetails.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662
  1. <template>
  2. <view class="content">
  3. <view class="cont">
  4. <view class="other-info" v-if="order!=null">
  5. <view class="title">付款详情</view>
  6. <view class="item">
  7. <view class="left">
  8. <text class="label">订单类型:</text>
  9. <text class="text">{{$getDictLabelName(inquiryTypeOptions,order.inquiryType)}}</text>
  10. <text class="text">-{{$getDictLabelName(orderTypeOptions,order.orderType)}}</text>
  11. </view>
  12. <view class="status red" v-if="order.status==1">
  13. {{$getDictLabelName(orderStatusOptions,order.status)}}
  14. </view>
  15. <view class="status red" v-if="order.status==2">
  16. {{$getDictLabelName(orderStatusOptions,order.status)}}
  17. </view>
  18. <view class="status green" v-if="order.status==3">
  19. {{$getDictLabelName(orderStatusOptions,order.status)}}
  20. </view>
  21. <view class="status green" v-if="order.status==4">
  22. {{$getDictLabelName(orderStatusOptions,order.status)}}
  23. </view>
  24. <view class="status gray" v-if="order.status<0">
  25. {{$getDictLabelName(orderStatusOptions,order.status)}}
  26. </view>
  27. </view>
  28. </view>
  29. <view class="doc-box" v-if="doctor!=null">
  30. <view class="title">医生详情</view>
  31. <view class="doc-name-box">
  32. <view class="doc-name">
  33. {{doctor.doctorName}}
  34. </view>
  35. <view class="doc-star">
  36. <u-rate activeColor="#ffc603" count="5" readonly v-model="doctor.pingStar"></u-rate>
  37. </view>
  38. </view>
  39. <view class="doc-dept-box">
  40. {{department.deptName}}|{{doctor.position}}
  41. </view>
  42. <view class="doc-his-box">
  43. {{hospital.hospitalName}}
  44. </view>
  45. <view class="doc-spec-box">
  46. <view class="left">
  47. <view class="title">擅长:</view>
  48. <view class="spec">{{doctor.speciality}}</view>
  49. </view>
  50. <view class="right">
  51. <view class="btn" @click="navTo('/pages/doctor/doctorDetails?doctorId='+doctor.doctorId)" >详情</view>
  52. </view>
  53. </view>
  54. </view>
  55. <view class="other-info" v-if="patient!=null&&order.inquiryType==1">
  56. <view class="title">咨询内容</view>
  57. <view class="item">
  58. <view class="left">
  59. <text class="label">患者信息:</text>
  60. <text class="text">{{patient.patientName}} {{patient.sex==1?"男":"女"}} {{patient.age}}岁</text>
  61. </view>
  62. </view>
  63. <view class="item">
  64. <view class="left">
  65. <text class="label">病情描述:</text>
  66. <text class="text">{{patient.title}}</text>
  67. </view>
  68. </view>
  69. <view class="item">
  70. <view class="left">
  71. <text class="label">患病时间:</text>
  72. <text class="text">{{patient.duration}}</text>
  73. </view>
  74. </view>
  75. <view class="item">
  76. <view class="left">
  77. <text class="label">就诊情况:</text>
  78. <text class="text">{{patient.isVisit}}</text>
  79. </view>
  80. </view>
  81. </view>
  82. <view class="other-info" v-if="patient!=null&&order.inquiryType==2">
  83. <view class="title">咨询内容</view>
  84. <view class="item">
  85. <view class="left">
  86. <text class="label">患者信息:</text>
  87. <text class="text">{{patient.patientName}} {{patient.sex==1?"男":"女"}} {{patient.age}}岁</text>
  88. </view>
  89. </view>
  90. <view class="item">
  91. <view class="left">
  92. <text class="label">身高(CM):</text>
  93. <text class="text">{{patient.height}}</text>
  94. </view>
  95. </view>
  96. <view class="item">
  97. <view class="left">
  98. <text class="label">体重(KG):</text>
  99. <text class="text">{{patient.weight}}</text>
  100. </view>
  101. </view>
  102. <view class="item">
  103. <view class="left">
  104. <text class="label">联系电话:</text>
  105. <text class="text">{{patient.mobile}}</text>
  106. </view>
  107. </view>
  108. <view class="item">
  109. <view class="left">
  110. <text class="label">学习进度:</text>
  111. <text class="text">{{patient.study}}</text>
  112. </view>
  113. </view>
  114. <view class="item">
  115. <view class="left">
  116. <text class="label">期望会诊方式:</text>
  117. <text class="text">{{patient.usage}}</text>
  118. </view>
  119. </view>
  120. <view class="item">
  121. <view class="left">
  122. <text class="label">病情描述:</text>
  123. <text class="text">{{patient.title}}</text>
  124. </view>
  125. </view>
  126. <view class="item">
  127. <view class="left">
  128. <text class="label">正在服用药品:</text>
  129. <text class="text">{{patient.drugs}}</text>
  130. </view>
  131. </view>
  132. <view class="item">
  133. <view class="left">
  134. <text class="label">本次患病时间:</text>
  135. <text class="text">{{patient.duration}}</text>
  136. </view>
  137. </view>
  138. <view class="item">
  139. <view class="left">
  140. <text class="label">是否就诊过:</text>
  141. <text class="text">{{patient.isVisit}}</text>
  142. </view>
  143. </view>
  144. <view class="item">
  145. <view class="left">
  146. <text class="label">舌苔照片:</text>
  147. </view>
  148. </view>
  149. <view>
  150. <u-album :urls="tongueImages"></u-album>
  151. </view>
  152. <view class="item">
  153. <view class="left">
  154. <text class="label">面部照片:</text>
  155. </view>
  156. </view>
  157. <view>
  158. <u-album :urls="faceImages"></u-album>
  159. </view>
  160. <view class="item">
  161. <view class="left">
  162. <text class="label">检测报告或患处照片:</text>
  163. </view>
  164. </view>
  165. <view>
  166. <u-album :urls="reportImages"></u-album>
  167. </view>
  168. </view>
  169. <view class="other-info" v-if="patient!=null&&order.inquiryType==3">
  170. <view class="title">咨询内容</view>
  171. <view class="item">
  172. <view class="left">
  173. <text class="label">患者信息:</text>
  174. <text class="text">{{patient.patientName}} {{patient.sex==1?"男":"女"}} {{patient.age}}岁</text>
  175. </view>
  176. </view>
  177. <view class="item">
  178. <view class="left">
  179. <text class="label">病情描述:</text>
  180. <text class="text">{{patient.title}}</text>
  181. </view>
  182. </view>
  183. <view class="item">
  184. <view class="left">
  185. <text class="label">正在服用药品:</text>
  186. <text class="text">{{patient.drugs}}</text>
  187. </view>
  188. </view>
  189. <view class="item">
  190. <view class="left">
  191. <text class="label">本次患病时间:</text>
  192. <text class="text">{{patient.duration}}</text>
  193. </view>
  194. </view>
  195. <view class="item">
  196. <view class="left">
  197. <text class="label">是否就诊过:</text>
  198. <text class="text">{{patient.isVisit}}</text>
  199. </view>
  200. </view>
  201. <view class="item">
  202. <view class="left">
  203. <text class="label">检测报告或患处照片:</text>
  204. </view>
  205. </view>
  206. <view>
  207. <u-album :urls="reportImages"></u-album>
  208. </view>
  209. <view class="item">
  210. <view class="left">
  211. <text class="label">舌苔照片:</text>
  212. </view>
  213. </view>
  214. <view>
  215. <u-album :urls="tongueImages"></u-album>
  216. </view>
  217. <view class="item">
  218. <view class="left">
  219. <text class="label">面部照片:</text>
  220. </view>
  221. </view>
  222. <view>
  223. <u-album :urls="faceImages"></u-album>
  224. </view>
  225. </view>
  226. <view class="other-info" v-if="report!=null&&order.status>=3" >
  227. <view class="title">体检信息</view>
  228. <view class="item" v-for="(item) in forms">
  229. <view class="left">
  230. <text class="label">{{item.title}}:</text>
  231. <text class="text">
  232. <u-tag size="mini" plain type="success" style="margin-right: 5rpx;margin-bottom: 5rpx;" v-for="(tag) in item.option" :text="tag"></u-tag>
  233. </text>
  234. </view>
  235. </view>
  236. </view>
  237. <view class="other-info" v-if="order!=null">
  238. <view class="title">订单信息</view>
  239. <view class="item">
  240. <view class="left">
  241. <text class="label">订单号码:</text>
  242. <text class="text">{{order.orderSn}}</text>
  243. </view>
  244. <view class="item-btn" @click="copyOrderSn">复制</view>
  245. </view>
  246. <view class="item">
  247. <view class="left">
  248. <text class="label">下单时间:</text>
  249. <text class="text">{{order.createTime}}</text>
  250. </view>
  251. </view>
  252. <view class="item">
  253. <view class="left">
  254. <text class="label">订单金额:</text>
  255. <text class="text">{{order.money.toFixed(2)}}</text>
  256. </view>
  257. </view>
  258. <view class="item">
  259. <view class="left">
  260. <text class="label">优惠金额:</text>
  261. <text class="text">{{order.discountMoney.toFixed(2)}}</text>
  262. </view>
  263. </view>
  264. <view class="item">
  265. <view class="left">
  266. <text class="label">支付金额:</text>
  267. <text class="text">{{order.payMoney.toFixed(2)}}</text>
  268. </view>
  269. </view>
  270. </view>
  271. </view>
  272. <view class="btn-box" v-if="order!=null">
  273. <view class="btn" v-if="report!=null&&order.status>=3" @click="navTo('/pages_order/inquiryOrderReport?orderId='+order.orderId)" >查看报告</view>
  274. </view>
  275. </view>
  276. </template>
  277. <script >
  278. import store from "@/store";
  279. import {getCompanyUserInquiryOrderById,cancel} from '@/api/inquiryOrder.js'
  280. import {getDictByKey} from '@/api/common.js'
  281. export default {
  282. data() {
  283. return {
  284. report:null,
  285. patient:null,
  286. hospital:null,
  287. department:null,
  288. doctor:null,
  289. order:null,
  290. orderId:null,
  291. orderStatusOptions:[],
  292. orderTypeOptions:[],
  293. inquiryTypeOptions:[],
  294. reportImages: [],
  295. tongueImages:[],
  296. faceImages:[],
  297. forms:[],
  298. }
  299. },
  300. onLoad(options) {
  301. this.orderId=options.orderId;
  302. this.getDictByKey("sys_inquiry_order_type");
  303. this.getDictByKey("sys_inquiry_type");
  304. this.getDictByKey("sys_inquiry_status");
  305. },
  306. onShow() {
  307. this.getCompanyUserInquiryOrderById();
  308. },
  309. methods: {
  310. cancel(){
  311. var that=this;
  312. uni.showModal({
  313. title:"提示",
  314. content:"确认取消订单吗?",
  315. showCancel:true,
  316. cancelText:'取消',
  317. confirmText:'确定',
  318. success:res=>{
  319. if(res.confirm){
  320. // 用户点击确定
  321. var data={orderId:this.orderId}
  322. cancel(data).then(
  323. res => {
  324. if(res.code==200){
  325. that.getMyInquiryOrderById()
  326. uni.showToast({
  327. icon:'success',
  328. title: "操作成功",
  329. });
  330. }else{
  331. uni.showToast({
  332. icon:'none',
  333. title: res.msg,
  334. });
  335. }
  336. },
  337. rej => {}
  338. );
  339. }else{
  340. // 否则点击了取消
  341. }
  342. }
  343. })
  344. },
  345. ping(){
  346. uni.navigateTo({
  347. url: "/pages_order/pingOrder?orderId="+this.orderId+"&doctorId="+this.order.doctorId
  348. })
  349. },
  350. pay(){
  351. uni.navigateTo({
  352. url: "/pages_order/inquiryPay?orderId="+this.orderId
  353. })
  354. },
  355. toIM(){
  356. var that=this;
  357. var id="C2CD-"+this.doctor.doctorId;
  358. console.log(uni.$TUIKit.TUIConversationServer)
  359. store.commit("timStore/setConversationID", id);
  360. //uni.$TUIKit.TUIChatServer.updateStore(conversationId)
  361. uni.$TUIKit.TUIConversationServer.setMessageRead(id);
  362. uni.$TUIKit.TUIConversationServer.getConversationProfile(id)
  363. .then((res) => {
  364. uni.$TUIKit.TUIConversationServer.setConversationValue(id,that.orderId)
  365. .then((res) => {
  366. console.log("更新order")
  367. })
  368. .catch((err) => {
  369. });
  370. console.log(res)
  371. //通知 TUIChat 关闭当前会话
  372. const { conversation } = res.data;
  373. store.commit("timStore/setImType", 1);
  374. store.commit("timStore/setConversation", conversation);
  375. let url = "/pages/TUIKit/TUIPages/TUIChat/index";
  376. const { nick: name } = conversation.userProfile;
  377. url = `${url}?conversationName=${
  378. conversation.userProfile.nick?.nick ||
  379. conversation.userProfile.userID
  380. }`;
  381. uni.redirectTo({ url });
  382. })
  383. .catch((err) => {
  384. console.warn("获取 group profile 异常 = ", err);
  385. });
  386. },
  387. navTo(url){
  388. uni.navigateTo({
  389. url: url
  390. })
  391. },
  392. copyOrderSn() {
  393. uni.setClipboardData({
  394. data: this.order.orderSn,
  395. success: function () {
  396. uni.showToast({
  397. title:'复制成功',
  398. icon:'none'
  399. })
  400. }
  401. })
  402. },
  403. getCompanyUserInquiryOrderById(){
  404. var that=this;
  405. var data={orderId:this.orderId}
  406. getCompanyUserInquiryOrderById(data).then(
  407. res => {
  408. if(res.code==200){
  409. this.order=res.data.order;
  410. this.report=res.data.report;
  411. this.patient=JSON.parse(res.data.order.patientJson);
  412. if(this.report!=null&&this.report.formJson!=null){
  413. this.forms=JSON.parse(this.report.formJson)
  414. }
  415. if(that.patient.reportImages!=null){
  416. that.reportImages=that.patient.reportImages.split(",");
  417. }
  418. if(that.patient.tongueImages!=null){
  419. that.tongueImages=that.patient.tongueImages.split(",");
  420. }
  421. if(that.patient.faceImages!=null){
  422. that.faceImages=that.patient.faceImages.split(",");
  423. }
  424. this.doctor=res.data.doctor;
  425. this.department=res.data.department;
  426. this.hospital=res.data.hospital;
  427. }
  428. },
  429. err => {
  430. }
  431. );
  432. },
  433. getDictByKey(key){
  434. var data={key:key}
  435. getDictByKey(data).then(
  436. res => {
  437. if(res.code==200){
  438. if(key=="sys_inquiry_order_type"){
  439. this.orderTypeOptions=res.data;
  440. }
  441. if(key=="sys_inquiry_type"){
  442. this.inquiryTypeOptions=res.data;
  443. }
  444. if(key=="sys_inquiry_status"){
  445. this.orderStatusOptions=res.data;
  446. }
  447. }
  448. },
  449. err => {
  450. }
  451. );
  452. },
  453. navTo(url){
  454. uni.navigateTo({
  455. url: url
  456. })
  457. }
  458. }
  459. }
  460. </script>
  461. <style lang="scss">
  462. page{
  463. background: #f6f6f6;
  464. }
  465. </style>
  466. <style scoped lang="scss">
  467. .content{
  468. position: relative;
  469. .cont{
  470. position: relative;
  471. padding: 0rpx 20rpx 120rpx;
  472. z-index: 999;
  473. width: 100%;
  474. display: flex;
  475. flex-direction: column;
  476. }
  477. .doc-box{
  478. margin: 20rpx 0rpx 0rpx;
  479. padding: 0rpx 30rpx;
  480. background-color: #fff;
  481. border-radius: 20upx;
  482. .title{
  483. height: 80upx;
  484. line-height: 80upx;
  485. font-size: 30upx;
  486. color: #000;
  487. font-weight: bold;
  488. border-bottom: 2upx solid #eeeeee;
  489. }
  490. .doc-name-box{
  491. margin-top: 15rpx;
  492. display: flex;
  493. align-items: center;
  494. justify-content: flex-start;
  495. .doc-name{
  496. font-size: 38rpx;
  497. font-weight: bold;
  498. }
  499. .doc-star{
  500. margin-left: 10rpx;
  501. }
  502. }
  503. .doc-dept-box{
  504. display: flex;
  505. align-items: center;
  506. justify-content: flex-start;
  507. margin-top: 15rpx;
  508. font-size: 28upx;
  509. font-family: PingFang SC;
  510. color: #2d2b36;
  511. }
  512. .doc-his-box{
  513. display: flex;
  514. align-items: center;
  515. justify-content: flex-start;
  516. margin-top: 15rpx;
  517. font-size: 28upx;
  518. font-family: PingFang SC;
  519. color: #9a9a9c;
  520. }
  521. .doc-spec-box{
  522. display: flex;
  523. align-items: center;
  524. justify-content: space-between;
  525. .left{
  526. display: flex;
  527. align-items: center;
  528. justify-content: flex-start;
  529. .title{
  530. font-size: 28upx;
  531. font-family: PingFang SC;
  532. color: #9a9a9c;
  533. }
  534. .spec{
  535. margin-left: 10rpx;
  536. font-size: 28upx;
  537. font-family: PingFang SC;
  538. color: #9a9a9c;
  539. }
  540. }
  541. .right{
  542. .btn{
  543. font-size: 28upx;
  544. font-family: PingFang SC;
  545. color: #C39A58;
  546. }
  547. }
  548. }
  549. }
  550. .other-info{
  551. margin-top: 20upx;
  552. background-color: #fff;
  553. border-radius: 20upx;
  554. padding: 0 30upx;
  555. .title{
  556. height: 80upx;
  557. line-height: 80upx;
  558. font-size: 30upx;
  559. color: #000;
  560. font-weight: bold;
  561. border-bottom: 2upx solid #eeeeee;
  562. }
  563. .item{
  564. min-height: 80upx;
  565. display: flex;
  566. align-items: center;
  567. justify-content: space-between;
  568. &:last-child{
  569. border-bottom: none;
  570. }
  571. .left{
  572. flex: 1;
  573. display: flex;
  574. align-items: center;
  575. .label{
  576. min-width: 140rpx;
  577. font-size: 28upx;
  578. color: #000;
  579. }
  580. .text{
  581. font-size: 28upx;
  582. color: #1b1b1b;
  583. }
  584. }
  585. .status{
  586. font-size: 28upx;
  587. font-family: PingFang SC;
  588. font-weight: bold;
  589. }
  590. .red{
  591. color: #db5053;
  592. }
  593. .green{
  594. color: #C39A58;
  595. }
  596. .gray{
  597. color: #9c9c9c;
  598. }
  599. .item-btn{
  600. max-width: 200rpx;
  601. padding: 0rpx 15rpx;
  602. height: 48upx;
  603. border-radius: 24upx;
  604. line-height: 48upx;
  605. font-size: 24upx;
  606. color: #000;
  607. border: 1upx solid #d8d8d8;
  608. display: flex;
  609. align-items: center;
  610. justify-content: center;
  611. }
  612. }
  613. }
  614. .btn-box{
  615. height: 100rpx;
  616. z-index: 9999;
  617. width: 100%;
  618. padding: 0rpx 30upx;
  619. position: fixed;
  620. bottom: 0;
  621. left: 0;
  622. box-sizing: border-box;
  623. background-color: #ffffff;
  624. display: flex;
  625. align-items: center;
  626. justify-content: flex-end;
  627. .btn{
  628. padding: 15rpx 30rpx;
  629. margin-left: 10rpx;
  630. text-align: center;
  631. font-size: 28upx;
  632. font-family: PingFang SC;
  633. color: #FFFFFF;
  634. background: #C39A58;
  635. border-radius: 45upx;
  636. }
  637. }
  638. }
  639. </style>