detail.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. <template>
  2. <div class="w-full min-h-[100%]" v-loading="loading">
  3. <div class="main-container" v-if="Object.values(detail).length">
  4. <el-breadcrumb class="my-[20px]" :separator-icon="ArrowRight">
  5. <el-breadcrumb-item>
  6. <span class="cursor-pointer text-[#333]" @click="router.push('/')">{{ t('index') }}</span>
  7. </el-breadcrumb-item>
  8. <el-breadcrumb-item>
  9. <span class="cursor-pointer text-[#333]" @click="router.push('/refund/list')">{{ t('refundList') }}</span>
  10. </el-breadcrumb-item>
  11. <el-breadcrumb-item >
  12. <span class="text-[#666]">{{ t('refunddetail') }}</span>
  13. </el-breadcrumb-item>
  14. </el-breadcrumb>
  15. <div class="">
  16. <div class="px-[30px] py-[18px] mb-[20px] bg-[#fff] rounded-[var(--rounded-big)]">
  17. <div class="text-[20px] font-500 text-[#333] mb-[15px]" v-if="detail.status_name">{{ detail.status_name }}</div>
  18. <div v-if="['1'].indexOf(detail.status) != -1" class="text-[#666] text-[14px] font-400 oppoSans-R">退款前请与商家协商一致,有助于更好的处理售后问题。</div>
  19. <div v-if="['2','6','7'].indexOf(detail.status) != -1" class="text-[#666] text-[14px] font-400 oppoSans-R">商家已同意您的退款,若您已收到商品请您尽快退回,感谢您对我们的支持!</div>
  20. <div v-if="['4'].indexOf(detail.status) != -1" class="text-[#666] text-[14px] font-400 oppoSans-R">商家确认收货后进行退款,请您耐心等待,若有异议请联系平台客服处理!</div>
  21. <div v-if="['3','5'].indexOf(detail.status) != -1" class="text-[#666] text-[14px] font-400 oppoSans-R">{{ detail.shop_reason }}</div>
  22. <div v-if="['8'].indexOf(detail.status) != -1" class="text-[#666] text-[14px] font-400 oppoSans-R">商家已为您退款,若商家已寄出商品请您尽快寄回,感谢您对我们的支持!</div>
  23. <div v-if="['-1'].indexOf(detail.status) != -1" class="text-[#666] text-[14px] font-400 oppoSans-R">此退款单已关闭,若对此订单存在疑问,请联系商家协商处理。</div>
  24. </div>
  25. <div class="bg-[#fff] p-[30px] mb-[20px] rounded-[var(--rounded-big)]">
  26. <div class="text-[16px] text-[#333] mb-[30px]">{{ t('refundInfo') }}</div>
  27. <div class="flex justify-between">
  28. <div class="w-[540px] text-[#333] text-[14px]">
  29. <div class="mb-[20px] oppoSans-R">{{ t('refundNo') }}{{ detail.order_refund_no }}</div>
  30. <div class="mb-[20px] oppoSans-R">{{ t('applyTime') }}{{ detail.create_time }}</div>
  31. <div class="mb-[20px] oppoSans-R">{{ t('refundMethod') }}{{ detail.refund_type_name }}</div>
  32. <div class="oppoSans-R" v-if="detail.status == 3||detail.status == 5">{{ t('merchantRefuse') }}{{ detail.shop_reason }}</div>
  33. </div>
  34. <div class="w-[1px] h-[102px] bg-[#eee]"></div>
  35. <div class="ml-[30px] w-[565px] text-[#333] text-[14px]">
  36. <div class="mb-[20px] oppoSans-R">{{ t('refundReason') }}{{ detail.reason || '--' }}</div>
  37. <div class="mb-[20px] oppoSans-R">
  38. <span>{{ t('refundMoney') }}</span>
  39. <span class="price-font">¥{{ detail.status == 1 ? parseFloat(detail.apply_money).toFixed(2) : parseFloat(detail.money).toFixed(2) }}</span>
  40. </div>
  41. <div class="oppoSans-R">{{ t('refundRemark') }}{{ detail.remark }}</div>
  42. </div>
  43. </div>
  44. </div>
  45. <div class="p-[30px] mb-[20px] bg-[#fff] rounded-[var(--rounded-big)]">
  46. <div class="mb-[30px] text-[16px] text-[#333] leading-[20px]">{{ t('goodsInfo') }}</div>
  47. <div class="flex justify-between items-center mb-[30px]">
  48. <div class="flex">
  49. <div class="flex items-center flex-shrink-0">
  50. <el-image class="w-[100px] h-[100px] rounded-[var(--rounded-mid)]" :src="img(detail.order_goods.goods_image ? detail.order_goods.goods_image : '')" fit="cover">
  51. <template #error>
  52. <img src="@/assets/images/goods_default.png" class="w-[100px] h-[100px] rounded-[var(--rounded-mid)]">
  53. </template>
  54. </el-image>
  55. </div>
  56. <div class="ml-[20px] flex flex-col justify-center">
  57. <div class="text-[14px] text-[#333] font-500 w-[420px] truncate mb-[14px]">{{ detail.order_goods.goods_name }}</div>
  58. <div class="text-[14px] text-[#333] oppoSans-R" v-if="detail.order_goods.sku_name"> 规格:{{ detail.order_goods.sku_name }}</div>
  59. </div>
  60. </div>
  61. <div class="flex items-center justify-center">
  62. <div class="w-[160px] text-[14px] text-[#333] oppoSans-R">¥{{detail.order_goods.price}}</div>
  63. </div>
  64. </div>
  65. </div>
  66. <div class="px-[30px] bg-[#fff] py-[18px] mb-[20px] rounded-[var(--rounded-big)]" v-if="detail.refund_log.length">
  67. <div class="flex justify-between items-center leading-[26px] text-[14px]">
  68. <span>{{ t('consultRecord') }}</span>
  69. <div class="text-[var(--el-color-primary)] cursor-pointer" @click="recordShow = !recordShow">{{ t('consultRecord') }}
  70. <i class="iconfont icon-xiajiantou !text-[14px]" v-if="!recordShow"></i>
  71. <i class="iconfont icon-xiangshangjiantou !text-[14px]" v-else></i>
  72. </div>
  73. </div>
  74. <div class="mt-[10px]" v-show="recordShow">
  75. <div class="flex" v-for="(item, index) in detail.refund_log" :key="index">
  76. <div>
  77. <div class="w-[12px] h-[12px] flex items-center bg-[#e4e7ed] rounded-[999px]"></div>
  78. <div class="w-[2px] h-[70px] bg-[#e4e7ed] mx-auto" v-if="index + 1 != detail.refund_log.length"></div>
  79. </div>
  80. <div>
  81. <div class="leading-[1] ml-[18px] text-[13px] text-[#909399]">
  82. {{item.create_time}}
  83. </div>
  84. <div class="leading-[1] ml-[18px] text-[14px] mt-[8px] font-bold">
  85. {{item.main_name}}
  86. </div>
  87. <div class="leading-[1] ml-[18px] text-[14px] mt-[8px]">
  88. {{item.type_name || '--'}}
  89. </div>
  90. </div>
  91. </div>
  92. </div>
  93. </div>
  94. <div class="px-[30px] py-[18px] bg-[#fff] flex justify-end items-center rounded-[var(--rounded-big)]" v-if="['2','3','5'].indexOf(detail.status) != -1 || ['6','7','8','-1'].indexOf(detail.status) == -1">
  95. <el-button v-if="['6','7','8','-1'].indexOf(detail.status) == -1" type="primary" round class="oppoSans-M" @click="refundConfirm(detail)" >{{ t('refundApply') }}</el-button>
  96. <el-button v-if="['3'].indexOf(detail.status) != -1" type="primary" round class="oppoSans-M" @click="refundBtnFn(detail,'edit')">{{ t('edit') }}</el-button>
  97. <el-button v-if="['2'].indexOf(detail.status) != -1" type="primary" round class="oppoSans-M" @click="trackingFn(detail,false)">{{ t('writeLogistic') }}</el-button>
  98. <el-button v-if="['5'].indexOf(detail.status) != -1" type="primary" round class="oppoSans-M" @click="trackingFn(detail,true)">{{ t('editLogistic') }}</el-button>
  99. </div>
  100. </div>
  101. </div>
  102. <logistics-tracking ref="trackingRef" @complete="refundDetailFn"></logistics-tracking>
  103. </div>
  104. </template>
  105. <script setup lang="ts">
  106. import { ref } from 'vue'
  107. import { ArrowRight } from '@element-plus/icons-vue'
  108. import { useRouter, useRoute } from 'vue-router'
  109. import { getRefundDetail, closeRefund} from '@/addon/mall/api/refund'
  110. import logisticsTracking from '@/addon/mall/pages/refund/components/logistics-tracking.vue'
  111. const route = useRoute()
  112. const router = useRouter()
  113. let orderRefundNo = route.query.order_refund_no
  114. const recordShow = ref(false)
  115. let detail = ref({})
  116. let loading = ref(true)
  117. const refundDetailFn = () => {
  118. loading.value = true
  119. getRefundDetail(orderRefundNo).then((res) => {
  120. detail.value = res.data;
  121. loading.value = false;
  122. }).catch(() => {
  123. loading.value = false;
  124. })
  125. }
  126. refundDetailFn()
  127. // 申请退款
  128. const refundConfirm = (data)=>{
  129. ElMessageBox.confirm('撤销之后本次申请将会关闭,如后续仍有问题可再次发起申请。', '提示',
  130. {
  131. confirmButtonText: t('confirm'),
  132. cancelButtonText: t('cancel'),
  133. type: 'warning'
  134. }
  135. ).then(() => {
  136. closeRefund(data.order_refund_no).then((res) => {
  137. refundDetailFn(orderRefundNo)
  138. }).catch(() => {
  139. })
  140. })
  141. }
  142. // 物流弹框
  143. const trackingRef = ref(null)
  144. const trackingFn = (data,status) =>{
  145. trackingRef.value.setFormData(data.order_refund_no,status)
  146. trackingRef.value.showDialog = true
  147. }
  148. const refundBtnFn = (data, type) => {
  149. if(type == 'edit'){
  150. router.push(`/refund/apply?order_refund_no=${data.order_refund_no}`)
  151. }
  152. }
  153. </script>
  154. <style lang="scss" scoped>
  155. /* 多行超出隐藏 */
  156. .multi-hidden {
  157. word-break: break-all;
  158. text-overflow: ellipsis;
  159. overflow: hidden;
  160. display: -webkit-box;
  161. -webkit-line-clamp: 2;
  162. -webkit-box-orient: vertical;
  163. }
  164. </style>