registrationlist.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. <template>
  2. <view class="box">
  3. <view class="tab bgfff dflex">
  4. <view :class="'li ' + (currentTab == 0 ? 'active' : '')" @tap="tab(0)">全部</view>
  5. <view :class="'li ' + (currentTab == 1 ? 'active' : '')" @tap="tab(1)">待预约</view>
  6. <view :class="'li ' + (currentTab == 4 ? 'active' : '')" @tap="tab(4)">待就诊</view>
  7. <view :class="'li ' + (currentTab == 7 ? 'active' : '')" @tap="tab(7)">已就诊</view>
  8. </view>
  9. <view v-if="pageList&&pageList.length>0">
  10. <view class="box-item" v-for="(item,index) in pageList" :key="index">
  11. <view v-for="(it,idx) in item.products" :key="idx" @tap="jumpUrl('/onlineregistration/detail/detail?id=' + item.id)">
  12. <view class="box-item-title">
  13. <text>{{item.merchantName}}</text>
  14. <view class="color-gray" v-if="it.history&&it.history.diagnosisNo">就诊序号 <text class="register-num">{{it.history.diagnosisNo}}</text></view>
  15. </view>
  16. <view class="box-item-contentbox">
  17. <view class="doctor-header">
  18. <image :src="it.history.headUrl?it.history.headUrl:'../static/onlineregistration/image/doctorPic.png'" mode="aspectFill"></image>
  19. </view>
  20. <view>
  21. <view class="box-item-content">
  22. <view class="box-item-content-item">
  23. <view class="item-name">预约医生</view>
  24. <view class="item-text">{{it.history.sysUidName}}</view>
  25. </view>
  26. </view>
  27. <view class="box-item-content">
  28. <view class="box-item-content-item">
  29. <view class="item-name">预约科室</view>
  30. <view class="item-text">{{it.history.departmentName}}</view>
  31. </view>
  32. </view>
  33. <view class="box-item-content">
  34. <view class="box-item-content-item">
  35. <view class="item-name">就诊时间段</view>
  36. <view class="item-text color-orange">{{captureTime(it.history.endTime,false)}} {{captureTime(it.history.startTime,true)}}~{{captureTime(it.history.endTime,true)}}</view>
  37. </view>
  38. </view>
  39. </view>
  40. </view>
  41. </view>
  42. <view class="pay-info" v-if="item.money>0">
  43. <text><!-- 共1个挂号 -->预约费</text>
  44. <text class="color-orange">¥{{item.money}}</text>
  45. </view>
  46. <view class="box-item-footer">
  47. <view class="footer-status">
  48. {{item.state==4?'待就诊':item.state==8?'已取消':item.state==7?'已就诊':item.stateName}}
  49. </view>
  50. <view class="footer-btn">
  51. <!-- <view class="footer-btn-item">查看详情</view> -->
  52. <view class="footer-btn-item" v-if="item.state==1||item.state==4" @click="cancelOrder(item,index)">取消预约</view>
  53. <view class="footer-btn-item color-orange border-orange" @click="payOrder(item.id)" v-if="item.state==1">立即预约</view>
  54. </view>
  55. </view>
  56. </view>
  57. </view>
  58. <view class="nodata" v-if="ishow">
  59. <image :src="picUrlss+'empty_dd.png'"></image>
  60. <text>还没有预约哦</text>
  61. </view>
  62. </view>
  63. </template>
  64. <script>
  65. // mine/coupons/coupons.js
  66. const req = require("../../utils/request.js");
  67. const api = require("../../utils/api.js");
  68. const util = require("../../utils/util.js");
  69. const app = getApp();
  70. export default {
  71. data() {
  72. return {
  73. picUrlss: req.public.picUrls,
  74. currentTab:0,
  75. form: {
  76. page: 1,
  77. limit: 10
  78. },
  79. pageList: [],
  80. isLoad: true,
  81. ishow: false
  82. };
  83. },
  84. components: {},
  85. props: {},
  86. onLoad() {
  87. this.getList()
  88. },
  89. onShow: function() {
  90. },
  91. methods: {
  92. captureTime(time,isTime){
  93. return util.captureTime(time,isTime)
  94. },
  95. tab(index) {
  96. let that = this;
  97. if (that.currentTab === index) return false;
  98. that.currentTab = index
  99. this.isLoad = true
  100. this.form.page = 1
  101. this.getList()
  102. },
  103. getList(){
  104. if(!this.isLoad) return false;
  105. this.isLoad = false;
  106. let form = this.form
  107. form.orderType = '47'
  108. if(this.currentTab > 0){
  109. form.state = this.currentTab
  110. }else delete form.state
  111. req.getRequest('/api/order/list',form,data=>{
  112. if(data&&data.length>0){
  113. data.map(it=>{
  114. it.products.map(pit=>{
  115. pit.history = JSON.parse(pit.history);
  116. })
  117. return it;
  118. })
  119. }
  120. if(data&&data.length == this.form.limit) this.isLoad = true
  121. if(this.form.page > 1) data = this.pageList.concat(data);
  122. if (data.length == 0) this.ishow = true
  123. else this.ishow = false
  124. this.pageList = data;
  125. })
  126. },
  127. payOrder(id){
  128. req.payOrders(id,success=>{
  129. uni.navigateTo({
  130. url: '/onlineregistration/detail/detail?id='+id
  131. })
  132. },'registered')
  133. },
  134. cancelOrder(item,index){
  135. let that = this;
  136. req.msgConfirm('确认取消预约吗',suc=>{
  137. if(item.state == 1){
  138. req.postRequest('/api/order/cancel',{id:item.id},data=>{
  139. req.msg('预约已取消');
  140. that.pageList[index].state = 8
  141. that.pageList[index].stateName = '已取消'
  142. })
  143. }else{
  144. req.postRequest(api.orderRefund_whole,{orderId:item.id},data=>{
  145. req.msg('预约已取消');
  146. that.pageList[index].state = 30
  147. that.pageList[index].stateName = '售后待审核'
  148. })
  149. }
  150. })
  151. },
  152. jumpUrl(url) {
  153. uni.navigateTo({
  154. url: url
  155. })
  156. },
  157. }
  158. };
  159. </script>
  160. <style>
  161. @import './registrationlist.css';
  162. </style>