list.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. <template>
  2. <base-page>
  3. <view class="goodslist">
  4. <view class="goodslist-box">
  5. <view class="goodslist-left">
  6. <view class="goods-title">
  7. 退款记录
  8. <text class="iconfont icongengduo1"></text>
  9. </view>
  10. <view class="goods-search">
  11. <view class="search">
  12. <text class="iconfont icon31sousuo"></text>
  13. <input type="text" v-model="search_text" @input="search" placeholder="搜索退款编号/订单号/客户手机号" />
  14. </view>
  15. </view>
  16. <block v-if="refund_list.length > 0">
  17. <scroll-view scroll-y="true" class="goods-list-scroll" :show-scrollbar="false" @scrolltolower="getRefundList">
  18. <view
  19. class="item"
  20. @click="getRefundDetail(item.refund_id, index)"
  21. v-for="(item, index) in refund_list"
  22. :key="index"
  23. :class="index == refundIndex ? 'itemhover' : ''"
  24. >
  25. <view class="title">
  26. <view>退款编号:{{ item.refund_no }}</view>
  27. <view>{{ item.refund_status_name }}</view>
  28. </view>
  29. <view class="total-money-num">
  30. <view class="member-info">
  31. <view>客户:</view>
  32. <view v-if="item.member_id">{{ item.nickname }}</view>
  33. <view v-else>散客</view>
  34. </view>
  35. <view class="box">
  36. <view>退款金额</view>
  37. <view>¥{{ item.refund_money }}</view>
  38. </view>
  39. </view>
  40. </view>
  41. </scroll-view>
  42. </block>
  43. <view class="notYet" v-else-if="refund_list.length == 0">暂无数据</view>
  44. </view>
  45. <view class="goodslist-right">
  46. <view class="goods-title">退款详情</view>
  47. <block v-if="refund_detail">
  48. <view class="order-information">
  49. <view class="order-status">{{ refund_detail.refund_status_name }}</view>
  50. <view class="goods-info">
  51. <block v-for="(item, index) in refund_detail.item_list" :key="index">
  52. <view class="goods-item">
  53. <view class="image"><image :src="$util.img(item.img, { size: 'small' })" mode="widthFix"></image></view>
  54. <view class="info">
  55. <view class="content-text">{{ item.name }}</view>
  56. </view>
  57. <view>
  58. <view class="price">
  59. <text class="title">退款金额:</text>
  60. ¥{{ item.refund_pay_money }}
  61. </view>
  62. </view>
  63. </view>
  64. </block>
  65. </view>
  66. <view class="goods-info refund-info">
  67. <view class="info-item">
  68. <view class="title">退款类型</view>
  69. <view class="content">{{ refund_detail.refund_trade_type_name }}</view>
  70. </view>
  71. <view class="info-item">
  72. <view class="title">退款编号</view>
  73. <view class="content">{{ refund_detail.refund_no }}</view>
  74. </view>
  75. <view class="info-item">
  76. <view class="title">退款时间</view>
  77. <view class="content">{{ refund_detail.create_time | timeFormat }}</view>
  78. </view>
  79. <view class="info-item">
  80. <view class="title">退款方式</view>
  81. <view class="content">{{ refund_detail.refund_transfer_type_name }}</view>
  82. </view>
  83. <view class="info-item">
  84. <view class="title">退款说明</view>
  85. <view class="content">{{ refund_detail.refund_goods_remark }}</view>
  86. </view>
  87. <view class="info-item">
  88. <view class="title">退款金额</view>
  89. <view class="content">¥{{ refund_detail.refund_pay_money }}</view>
  90. </view>
  91. <view class="info-item">
  92. <view class="title">退还积分</view>
  93. <view class="content">{{ refund_detail.refund_point }}积分</view>
  94. </view>
  95. <view class="info-item">
  96. <view class="title">退还余额</view>
  97. <view class="content">¥{{ (parseFloat(refund_detail.refund_balance_money) + parseFloat(refund_detail.refund_balance)) | moneyFormat }}</view>
  98. </view>
  99. </view>
  100. </view>
  101. </block>
  102. <block v-else><image class="cart-empty" :src="$util.img('public/uniapp/cashier/cart_empty.png')" mode="widthFix"></image></block>
  103. </view>
  104. </view>
  105. </view>
  106. </base-page>
  107. </template>
  108. <script>
  109. export default {
  110. data() {
  111. return {
  112. refundIndex: 0,
  113. // 订购日志所需列表数据
  114. list: [],
  115. //获取订单的页数
  116. page: 1,
  117. //每次获取订单的条数
  118. page_size: 8,
  119. // 订单搜索是用到的数据
  120. search_text: '',
  121. // 订单列表数据
  122. refund_list: [],
  123. //订单详情数据
  124. refund_detail: null
  125. };
  126. },
  127. onLoad(option) {
  128. this.getRefundList();
  129. },
  130. methods: {
  131. // 搜索
  132. search() {
  133. this.page = 1;
  134. this.refund_list = [];
  135. this.getRefundList();
  136. },
  137. /**
  138. * 获取订单列表
  139. */
  140. getRefundList() {
  141. this.$api.sendRequest({
  142. url: '/cashier/storeapi/cashierorderrefund/lists',
  143. data: {
  144. page: this.page,
  145. page_size: this.page_size,
  146. search_text: this.search_text
  147. },
  148. success: res => {
  149. if (res.data.list.length == 0) {
  150. this.refund_detail = null;
  151. }
  152. if (res.code >= 0 && res.data.list.length != 0) {
  153. if (this.refund_list.length == 0) {
  154. this.refund_list = res.data.list;
  155. } else {
  156. this.refund_list = this.refund_list.concat(res.data.list);
  157. }
  158. //初始时加载一遍详情数据
  159. if (this.page == 1) {
  160. this.getRefundDetail(this.refund_list[0].refund_id);
  161. }
  162. this.page += 1;
  163. }
  164. }
  165. });
  166. },
  167. /**
  168. * 获取订单详情数据
  169. */
  170. getRefundDetail(refund_id, index = 0) {
  171. this.refundIndex = index;
  172. this.$api.sendRequest({
  173. url: '/cashier/storeapi/cashierorderrefund/detail',
  174. data: {
  175. refund_id
  176. },
  177. success: res => {
  178. if (res.code >= 0) {
  179. this.refund_detail = res.data;
  180. }
  181. }
  182. });
  183. }
  184. }
  185. };
  186. </script>
  187. <style scoped lang="scss">
  188. @import './public/css/list.scss';
  189. </style>