refund.vue 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  1. <template>
  2. <div class="app-container">
  3. <div class="filter-container">
  4. <div class="filter-control">
  5. <span>退款编号:</span>
  6. <el-input
  7. v-model="listQuery.returnedNo"
  8. style="width: 180px"
  9. placeholder="退款编号"
  10. clearable
  11. @keyup.enter.native="getList"
  12. @clear="getList"
  13. />
  14. </div>
  15. <div class="filter-control">
  16. <span>订单ID:</span>
  17. <el-input
  18. v-model="listQuery.orderId"
  19. style="width: 180px"
  20. placeholder="订单ID"
  21. clearable
  22. @keyup.enter.native="getList"
  23. @clear="getList"
  24. />
  25. </div>
  26. <div class="filter-control">
  27. <span>订单编号:</span>
  28. <el-input
  29. v-model="listQuery.orderNo"
  30. style="width: 180px"
  31. placeholder="订单编号"
  32. clearable
  33. @keyup.enter.native="getList"
  34. @clear="getList"
  35. />
  36. </div>
  37. <div class="filter-control">
  38. <span>机构名称:</span>
  39. <el-input
  40. v-model="listQuery.clubName"
  41. style="width: 180px"
  42. placeholder="机构名称"
  43. clearable
  44. @keyup.enter.native="getList"
  45. @clear="getList"
  46. />
  47. </div>
  48. <!-- <div class="filter-control">
  49. <span>退款审核状态:</span>
  50. <el-select v-model="listQuery.status" style="width:180px;" clearable @change="getList">
  51. <el-option value="" label="所有" />
  52. <el-option label="待审核" value="1" />
  53. <el-option label="审核通过" value="2" />
  54. <el-option label="审核不通过" value="3" />
  55. </el-select>
  56. </div> -->
  57. <div class="filter-control">
  58. <span>申请时间:</span>
  59. <el-date-picker
  60. v-model="time"
  61. type="daterange"
  62. unlink-panels
  63. range-separator="至"
  64. start-placeholder="开始日期"
  65. end-placeholder="结束日期"
  66. :picker-options="pickerOptions"
  67. @change="getList"
  68. />
  69. </div>
  70. <div class="filter-control">
  71. <el-button type="primary" icon="el-icon-search" @click="getList">查询</el-button>
  72. </div>
  73. </div>
  74. <el-table
  75. v-loading="listLoading"
  76. :data="list"
  77. element-loading-text="Loading"
  78. border
  79. fit
  80. highlight-current-row
  81. :header-cell-style="{ background: '#eef1f6', color: '#606266' }"
  82. >
  83. <el-table-column label="退款编号" align="center" prop="returnedNo" />
  84. <el-table-column label="订单编号(ID)" align="center" prop="orderNo" width="200">
  85. <template slot-scope="{ row }">{{
  86. row.shopOrderReturnedList[0].shopOrderNo +
  87. "(" +
  88. row.shopOrderReturnedList[0].shopOrderId +
  89. ")"
  90. }}</template>
  91. </el-table-column>
  92. <el-table-column label="机构" align="center" prop="clubName" />
  93. <el-table-column label="退款金额" align="center" prop="refundFee" width="110">
  94. <template
  95. slot-scope="{ row }"
  96. >¥{{ row.refundFee | toThousandFloatFilter }}</template>
  97. </el-table-column>
  98. <el-table-column label="退款方式" align="center" prop="returnedWay" min-width="130">
  99. <template slot-scope="{ row }">
  100. <template v-if="row.returnedWay * 1 === 4">未支付无退款</template>
  101. <template v-else-if="row.returnedWay * 1 === 1">
  102. <p v-if="row.refundBalanceFee * 1 !== 0">
  103. 余额账户:¥{{ row.refundBalanceFee | toThousandFloatFilter }}
  104. </p>
  105. <p v-if="row.refundOnlineFee * 1 !== 0">
  106. 线上退回:¥{{ row.refundOnlineFee | toThousandFloatFilter }}
  107. </p>
  108. <p v-if="row.refundOfflineFee * 1 !== 0">
  109. 线下转账:¥{{ row.refundOfflineFee | toThousandFloatFilter }}
  110. </p>
  111. </template>
  112. <template v-else>----</template>
  113. </template>
  114. </el-table-column>
  115. <el-table-column
  116. label="申请人"
  117. align="center"
  118. prop="applicationUserName"
  119. width="100"
  120. >
  121. <template slot-scope="{ row }">
  122. <span>{{ row.applicationUserName ? row.applicationUserName : "--" }}</span>
  123. </template>
  124. </el-table-column>
  125. <el-table-column align="center" label="申请时间" prop="returnTime">
  126. <template v-if="row.returnTime" slot-scope="{ row }">
  127. <span>{{ row.returnTime | parseTime("{y}-{m}-{d} {h}:{i}:{s}") }}</span>
  128. </template>
  129. </el-table-column>
  130. <!-- <el-table-column label="审核人" align="center" prop="reviewUserName" width="100">
  131. <template slot-scope="{row}">
  132. <span>{{ row.reviewUserName ? row.reviewUserName : '--' }}</span>
  133. </template>
  134. </el-table-column>
  135. <el-table-column align="center" label="审核时间" prop="confirmReturnTime">
  136. <template v-if="row.confirmReturnTime" slot-scope="{row}">
  137. <span>{{ row.confirmReturnTime | parseTime('{y}-{m}-{d} {h}:{i}:{s}') }}</span>
  138. </template>
  139. </el-table-column>
  140. <el-table-column label="退款审核状态" align="center" prop="status" width="90">
  141. <template slot-scope="{row}">
  142. <el-tag v-if="row.status*1===1" type="warning" size="small">待审核</el-tag>
  143. <el-tag v-if="row.status*1===2" type="success" size="small">审核通过</el-tag>
  144. <el-tag v-if="row.status*1===3" type="danger" size="small">审核不通过</el-tag>
  145. </template>
  146. </el-table-column> -->
  147. <el-table-column label="操作" align="center">
  148. <template slot-scope="{ row }">
  149. <el-button
  150. type="primary"
  151. size="mini"
  152. @click="handleDetailes(row)"
  153. >查看详情</el-button>
  154. <el-button
  155. v-if="row.status == 2 && row.refundOnlineFee * 1 !== 0"
  156. type="warning"
  157. size="mini"
  158. @click="revokeRefund(row)"
  159. >撤销退款</el-button>
  160. </template>
  161. </el-table-column>
  162. </el-table>
  163. <pagination
  164. v-show="total > 10"
  165. :total="total"
  166. :page.sync="listQuery.index"
  167. :limit.sync="listQuery.pageSize"
  168. @pagination="getList"
  169. />
  170. <template>
  171. <el-backtop style="right: 40px; bottom: 40px">
  172. <i class="el-icon-upload2" />
  173. </el-backtop>
  174. </template>
  175. </div>
  176. </template>
  177. <script>
  178. import { getRefundList, revokeApply } from '@/api/order'
  179. import pickerOptions from '@/utils/time-picker.js'
  180. export default {
  181. data() {
  182. return {
  183. time: '',
  184. pickerOptions,
  185. list: null,
  186. listLoading: true,
  187. total: 0,
  188. searchTimeVal: '',
  189. listQuery: {
  190. index: 1,
  191. pageSize: 10,
  192. organizeId: this.$store.getters.organizeId,
  193. returnedNo: '',
  194. orderId: '',
  195. orderNo: '',
  196. userName: '',
  197. beginReturnTime: '',
  198. endReturnTime: '',
  199. status: ''
  200. }
  201. }
  202. },
  203. computed: {},
  204. created() {
  205. this.getList()
  206. },
  207. methods: {
  208. async getList() {
  209. this.listLoading = true
  210. if (this.time && this.time.length > 0) {
  211. this.listQuery.beginReturnTime = this.time[0]
  212. this.listQuery.endReturnTime = this.time[1]
  213. } else {
  214. this.listQuery.beginReturnTime = ''
  215. this.listQuery.endReturnTime = ''
  216. }
  217. try {
  218. const res = await getRefundList(this.listQuery)
  219. this.list = res.data.results
  220. console.log(this.list)
  221. this.total = res.data.totalRecord
  222. this.listLoading = false
  223. } catch (error) {
  224. console.log('error', error)
  225. this.listLoading = false
  226. }
  227. },
  228. handleFilter() {
  229. this.getList()
  230. },
  231. handleDetailes(row) {
  232. this.$router.push({ path: '/order/refund-detail', query: { id: row.id }})
  233. },
  234. revokeRefund(row) {
  235. this.$confirm('确定撤销本次退款吗?', '提示', {
  236. confirmButtonText: '确定',
  237. cancelButtonText: '取消',
  238. type: 'warning'
  239. })
  240. .then(async() => {
  241. try {
  242. await revokeApply({
  243. organizeId: 4,
  244. id: row.id,
  245. orderId: row.orderId,
  246. shopOrderId: row.shopOrderReturnedList[0].shopOrderId
  247. })
  248. this.getList()
  249. } catch (error) {
  250. console.log(error)
  251. }
  252. })
  253. .catch(() => {})
  254. }
  255. }
  256. }
  257. </script>
  258. <style scoped>
  259. .el-form-item {
  260. margin-bottom: 0;
  261. }
  262. .date-box {
  263. margin-right: 0;
  264. }
  265. </style>