activist.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338
  1. <template>
  2. <div class="box">
  3. <div class="null-page" v-show="yes"></div>
  4. <el-card class="box-card order-list">
  5. <div slot="header" class="clearfix"><span>退款/售后</span></div>
  6. <div v-loading="loading">
  7. <nav>
  8. <li>商品信息</li>
  9. <li>退款金额</li>
  10. <li>退款类型</li>
  11. <li>退款状态</li>
  12. <li>操作</li>
  13. </nav>
  14. <div class="list" v-if="refundList.length > 0">
  15. <div class="item" v-for="(refundItem, refundIndex) in refundList" :key="refundIndex">
  16. <div class="head">
  17. <span class="create-time">{{ $util.timeStampTurnTime(refundItem.refund_action_time) }}</span>
  18. <span class="order-no">退款编号:{{ refundItem.refund_no }}</span>
  19. <router-link :to="'/shop-' + refundItem.site_id" target="_blank">{{ refundItem.site_name }}</router-link>
  20. <span class="order-type">{{ refundItem.refund_status == 3 ? '退款成功' : '退款中' }}</span>
  21. </div>
  22. <ul>
  23. <li>
  24. <div class="img-wrap" @click="$util.pushToTab('/sku/' + refundItem.sku_id)"><img :src="$img(refundItem.sku_image, { size: 'mid' })" @error="imageError(refundIndex)" /></div>
  25. <div class="info-wrap">
  26. <h5 @click="$util.pushToTab('/sku/' + refundItem.sku_id)">{{ refundItem.sku_name }}</h5>
  27. <!-- <span>规格:规格值</span> -->
  28. </div>
  29. </li>
  30. <li>
  31. <span>¥{{ refundItem.refund_apply_money }}</span>
  32. </li>
  33. <li>
  34. <span>{{ refundItem.refund_type == 1 ? '退款' : '退货' }}</span>
  35. </li>
  36. <li>
  37. <span class="ns-text-color">{{ refundItem.refund_status_name }}</span>
  38. <el-link :underline="false" @click="orderDetail(refundItem)">退款详情</el-link>
  39. </li>
  40. <li>
  41. <template v-if="refundItem.refund_action.length > 0">
  42. <el-button
  43. type="primary"
  44. size="mini"
  45. :plain="true"
  46. v-for="(operationItem, operationIndex) in refundItem.refund_action"
  47. :key="operationIndex"
  48. @click="operation(operationItem.event, refundItem)"
  49. >
  50. {{ operationItem.title }}
  51. </el-button>
  52. </template>
  53. </li>
  54. </ul>
  55. </div>
  56. </div>
  57. <div v-else-if="!loading && refundList.length == 0" class="empty-wrap">暂无相关订单</div>
  58. </div>
  59. <div class="pager">
  60. <el-pagination
  61. background
  62. :pager-count="5"
  63. :total="total"
  64. prev-text="上一页"
  65. next-text="下一页"
  66. :current-page.sync="currentPage"
  67. :page-size.sync="pageSize"
  68. @size-change="handlePageSizeChange"
  69. @current-change="handleCurrentPageChange"
  70. hide-on-single-page
  71. ></el-pagination>
  72. </div>
  73. </el-card>
  74. </div>
  75. </template>
  76. <script>
  77. import { mapGetters } from 'vuex';
  78. import { refundList, cancleRefund } from '@/api/order/refund';
  79. export default {
  80. name: 'activist',
  81. layout: "member",
  82. components: {},
  83. data: () => {
  84. return {
  85. orderStatus: 'all',
  86. loading: true,
  87. refundList: [],
  88. currentPage: 1,
  89. pageSize: 10,
  90. total: 0,
  91. yes: true
  92. };
  93. },
  94. created() {
  95. this.orderStatus = this.$route.query.status || 'all';
  96. this.getrefundList();
  97. },
  98. layout: 'member',
  99. computed: {
  100. ...mapGetters(['defaultGoodsImage'])
  101. },
  102. mounted() {
  103. let self = this;
  104. setTimeout(function() {
  105. self.yes = false
  106. }, 300)
  107. },
  108. methods: {
  109. handleClick(tab, event) {
  110. this.currentPage = 1;
  111. this.orderStatus = tab.name;
  112. this.refresh();
  113. },
  114. getrefundList() {
  115. refundList({
  116. page: this.currentPage,
  117. page_size: this.pageSize
  118. })
  119. .then(res => {
  120. let list = [];
  121. if (res.code == 0 && res.data) {
  122. list = res.data.list;
  123. this.total = res.data.count;
  124. }
  125. this.refundList = list;
  126. this.loading = false;
  127. })
  128. .catch(res => {
  129. this.loading = false;
  130. });
  131. },
  132. handlePageSizeChange(size) {
  133. this.pageSize = size;
  134. this.refresh();
  135. },
  136. handleCurrentPageChange(page) {
  137. this.currentPage = page;
  138. this.refresh();
  139. },
  140. refresh() {
  141. this.loading = true;
  142. this.getrefundList();
  143. },
  144. operation(action, orderData) {
  145. switch (action) {
  146. case 'orderRefundCancel': // 撤销维权
  147. this.cancleRefund(orderData.order_goods_id);
  148. break;
  149. case 'orderRefundDelivery': // 退款发货
  150. this.$router.push({ path: '/order/refund_detail', query: { order_goods_id: orderData.order_goods_id, action: 'returngoods' } });
  151. break;
  152. case 'orderRefundAsk':
  153. this.$router.push({ path: '/order/refund?order_goods_id=' + orderData.order_goods_id });
  154. break;
  155. }
  156. },
  157. orderDetail(data) {
  158. this.$router.push({ path: '/order/refund_detail', query: { order_goods_id: data.order_goods_id } });
  159. },
  160. imageError(refundIndex) {
  161. this.refundList[refundIndex].sku_image = this.defaultGoodsImage;
  162. },
  163. cancleRefund(order_goods_id) {
  164. this.$confirm('撤销之后本次申请将会关闭,如后续仍有问题可再次发起申请', '提示', {
  165. confirmButtonText: '确认撤销',
  166. cancelButtonText: '暂不撤销',
  167. type: 'warning'
  168. })
  169. .then(() => {
  170. if (this.isSub) return;
  171. this.isSub = true;
  172. cancleRefund({ order_goods_id: order_goods_id })
  173. .then(res => {
  174. const { code, message, data } = res;
  175. if (code >= 0) {
  176. this.$message({
  177. message: '撤销成功',
  178. type: 'success'
  179. });
  180. this.getrefundList();
  181. } else {
  182. this.$message({ message: message, type: 'warning' });
  183. }
  184. })
  185. .catch(err => {
  186. this.$message.error(err.message);
  187. });
  188. })
  189. .catch(() => {});
  190. }
  191. }
  192. };
  193. </script>
  194. <style lang="scss" scoped>
  195. .box {
  196. width: 100%;
  197. position: relative;
  198. }
  199. .null-page {
  200. width: 100%;
  201. height: 730px;
  202. background-color: #FFFFFF;
  203. position: absolute;
  204. top: 0;
  205. left: 0;
  206. z-index: 9;
  207. }
  208. .order-list {
  209. nav {
  210. overflow: hidden;
  211. padding: 10px 0;
  212. background: #fff;
  213. margin-bottom: 10px;
  214. border-bottom: 1px solid #eeeeee;
  215. li {
  216. float: left;
  217. &:nth-child(1) {
  218. width: 45%;
  219. }
  220. &:nth-child(2) {
  221. width: 15%;
  222. }
  223. &:nth-child(3) {
  224. width: 10%;
  225. }
  226. &:nth-child(4) {
  227. width: 15%;
  228. }
  229. &:nth-child(5) {
  230. width: 15%;
  231. }
  232. }
  233. }
  234. .list {
  235. .item {
  236. margin-bottom: 20px;
  237. border: 1px solid #eeeeee;
  238. border-top: 0;
  239. .head {
  240. padding: 8px 10px;
  241. background: #f7f7f7;
  242. font-size: 12px;
  243. .create-time {
  244. margin-right: 10px;
  245. }
  246. border-bottom: 1px solid #eeeeee;
  247. a {
  248. margin: 0 10px 0 20px;
  249. }
  250. .order-type {
  251. margin-left: 30px;
  252. }
  253. }
  254. }
  255. ul {
  256. background-color: #fff;
  257. padding: 10px;
  258. overflow: hidden;
  259. li {
  260. float: left;
  261. line-height: 60px;
  262. &:nth-child(1) {
  263. width: 45%;
  264. line-height: inherit;
  265. .img-wrap {
  266. width: 60px;
  267. height: 60px;
  268. float: left;
  269. margin-right: 10px;
  270. cursor: pointer;
  271. }
  272. .info-wrap {
  273. margin-left: 70px;
  274. h5 {
  275. font-weight: normal;
  276. font-size: $ns-font-size-base;
  277. display: -webkit-box;
  278. -webkit-box-orient: vertical;
  279. -webkit-line-clamp: 2;
  280. overflow: hidden;
  281. margin-right: 10px;
  282. cursor: pointer;
  283. display: inline-block;
  284. &:hover {
  285. color: $base-color;
  286. }
  287. }
  288. span {
  289. font-size: $ns-font-size-sm;
  290. color: #9a9a9a;
  291. }
  292. }
  293. }
  294. &:nth-child(2) {
  295. width: 15%;
  296. }
  297. &:nth-child(3) {
  298. width: 10%;
  299. }
  300. &:nth-child(4) {
  301. width: 14%;
  302. line-height: 30px;
  303. a {
  304. display: block;
  305. }
  306. }
  307. &:nth-child(5) {
  308. width: 15%;
  309. line-height: initial;
  310. button {
  311. margin-left: 0;
  312. margin-bottom: 10px;
  313. &:last-child {
  314. margin-bottom: 0;
  315. }
  316. }
  317. }
  318. }
  319. }
  320. }
  321. .empty-wrap {
  322. text-align: center;
  323. padding: 10px;
  324. }
  325. }
  326. </style>