index.php 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  1. <?php
  2. use common\helpers\ComponentHelper;
  3. ComponentHelper::loadComponentView('../components/com-title', __DIR__);
  4. ComponentHelper::loadComponentView('com-list-page');
  5. ComponentHelper::loadComponentView('com-list-table');
  6. ?>
  7. <com-list-page :crumbs="crumbs" id="application">
  8. <com-list-table
  9. ref="table"
  10. :api="'star-chain/refund/index'"
  11. :search-list="searchList"
  12. >
  13. <el-table-column type="selection"></el-table-column>
  14. <el-table-column prop="order_no" align="center" label="订单编号">
  15. <template slot-scope="scope">
  16. <a href="javascript:void(0);" @click="mallOrder(scope.row.refund.id)">
  17. {{ scope.row.refund.order_no }}
  18. </a>
  19. </template>
  20. </el-table-column>
  21. <el-table-column prop="goods" align="center" width="200px" label="商品">
  22. <template slot-scope="scope">
  23. <div class="goods">
  24. <div class="goods-img">
  25. <el-avatar shape="square" :src="getUrl(scope.row.goods.carousel_img_list)" fit="fill" style="width: 60px; height: 60px"></el-avatar>
  26. </div>
  27. <div class="goods-name">
  28. <span>{{ sub(scope.row.goods.name) }}</span>
  29. </div>
  30. </div>
  31. </template>
  32. </el-table-column>
  33. <el-table-column prop="attr" align="center" label="商品属性">
  34. <template slot-scope="scope">
  35. {{ scope.row.detail.goods_attr_name }}
  36. </template>
  37. </el-table-column>
  38. <el-table-column prop="price" label="实际支付" align="center">
  39. <template slot-scope="scope">
  40. {{ scope.row.order.goods_price }}
  41. +
  42. {{ scope.row.order.shipping_money }}
  43. </template>
  44. </el-table-column>
  45. <el-table-column prop="price" label="申请退款" align="center">
  46. <template slot-scope="scope">
  47. {{ scope.row.refund.refund_price }}
  48. </template>
  49. </el-table-column>
  50. <el-table-column prop="status" label="推送状态" align="center">
  51. <template slot-scope="scope">
  52. {{ scope.row.status_text }}
  53. </template>
  54. </el-table-column>
  55. <el-table-column prop="refund_status_text" label="推送状态" align="center">
  56. </el-table-column>
  57. <el-table-column prop="error_msg" label="错误信息" align="center">
  58. <template slot-scope="scope">
  59. {{ scope.row.error_msg }}
  60. </template>
  61. </el-table-column>
  62. <el-table-column align="center" label="操作">
  63. <template slot-scope="scope">
  64. <el-button type="text" :loading="btnLoading" @click="showDetail(scope.row)">订单详情</el-button>
  65. </template>
  66. </el-table-column>
  67. </com-list-table>
  68. <!-- 订单详情 -->
  69. <el-dialog title="订单详情" :visible.sync="dialogVisible" width="50%">
  70. <el-descriptions class="margin-top" title="" :column="2" border v-if="refund">
  71. <el-descriptions-item>
  72. <template slot="label">
  73. 售后订单编号
  74. </template>
  75. {{ refund.order_no }}
  76. </el-descriptions-item>
  77. <el-descriptions-item>
  78. <template slot="label">
  79. 售后类型
  80. </template>
  81. {{ refund.type_text }}
  82. </el-descriptions-item>
  83. <el-descriptions-item>
  84. <template slot="label">
  85. 售后原因
  86. </template>
  87. {{ refund.reason }}
  88. </el-descriptions-item>
  89. <el-descriptions-item>
  90. <template slot="label">
  91. 售后金额
  92. </template>
  93. {{ refund.refund_price }}
  94. </el-descriptions-item>
  95. <el-descriptions-item span="2" v-if="chain_refund_sn">
  96. <template slot="label">
  97. 供应链端售后订单号
  98. </template>
  99. {{ chain_refund_sn }}
  100. </el-descriptions-item>
  101. <el-descriptions-item span="2">
  102. <template slot="label">
  103. 售后备注
  104. </template>
  105. {{ refund.remark }}
  106. </el-descriptions-item>
  107. <el-descriptions-item span="2">
  108. <template slot="label">
  109. 售后凭证
  110. </template>
  111. <el-image :src="item" v-for="item in refund.pic_list" :preview-src-list="refund.pic_list" style="height:80px;margin-right:5px"></el-image>
  112. </el-descriptions-item>
  113. </el-descriptions>
  114. <span slot="footer" class="dialog-footer" v-if="status == 0 && refund_status == 0">
  115. <el-button type="warning" @click="reject">驳回售后</el-button>
  116. <el-button type="primary" @click="agree">推送售后</el-button>
  117. </span>
  118. </el-dialog>
  119. </com-list-page>
  120. <script>
  121. const application = new Vue({
  122. el: '#application',
  123. data: {
  124. crumbs: [
  125. {
  126. title: '首页',
  127. router: 'mall/overview/index',
  128. },
  129. {
  130. title: '售后管理',
  131. }
  132. ],
  133. refund: {},
  134. dialogVisible: false,
  135. searchList: [
  136. {
  137. key: 'name',
  138. title: '商品名称',
  139. type: 'text',
  140. },
  141. {
  142. key: 'order_no',
  143. title: '订单号',
  144. type: 'text',
  145. },
  146. {
  147. key: 'data',
  148. title: '日期',
  149. type: 'date-time-range',
  150. },
  151. ],
  152. btnLoading: false,
  153. id: 0,
  154. refund: '',
  155. chain_refund_sn: '',
  156. status: 0,
  157. refund_status: 0,
  158. },
  159. methods: {
  160. /**
  161. * 字符串裁剪
  162. */
  163. sub(string) {
  164. string = string + ''
  165. var reg = /[\u4e00-\u9fa5]/g, //专业匹配中文
  166. slice = string.substring(0, 15),
  167. chineseCharNum = (~~(slice.match(reg) && slice.match(reg).length)),
  168. realen = slice.length * 2 - chineseCharNum;
  169. return string.substr(0, realen) + (realen < string.length ? "..." : "");
  170. },
  171. /**
  172. * 跳转到商城商品
  173. */
  174. mallOrder(id) {
  175. this.$navigate({
  176. r: 'mall/order/refund-detail',
  177. id: id
  178. })
  179. },
  180. /**
  181. * 展示订单详情
  182. */
  183. showDetail(row) {
  184. this.btnLoading = true
  185. this.id = row.id
  186. this.refund = row.refund
  187. this.chain_refund_sn = row.chain_refund_sn
  188. this.status = row.status
  189. this.refund_status = row.refund_status
  190. this.dialogVisible = true
  191. this.btnLoading = false
  192. },
  193. /**
  194. * 同意申请
  195. */
  196. agree() {
  197. this.$confirm('确认操作吗?').then(() => {
  198. request({
  199. params: {
  200. r: 'star-chain/refund/agree',
  201. },
  202. method: 'post',
  203. data: {
  204. id: this.id
  205. },
  206. }).then(e => {
  207. if (e.data.code === 0) {
  208. this.$message.success('操作成功');
  209. let self = this
  210. setTimeout(() => {
  211. self.dialogVisible = false
  212. self.$refs['table'].reload()
  213. }, 1500);
  214. } else {
  215. this.$message.error(e.data.msg);
  216. }
  217. this.listLoading = false
  218. }).
  219. catch(e => {
  220. console.log(e);
  221. })
  222. }).catch(_ => {})
  223. },
  224. /**
  225. * 驳回申请
  226. */
  227. reject() {
  228. this.$confirm('确认操作吗?').then(() => {
  229. request({
  230. params: {
  231. r: 'star-chain/refund/reject',
  232. },
  233. method: 'post',
  234. data: {
  235. id: this.id
  236. },
  237. }).then(e => {
  238. if (e.data.code === 0) {
  239. this.$message.success('操作成功');
  240. let self = this
  241. setTimeout(() => {
  242. self.dialogVisible = false
  243. self.$refs['table'].reload()
  244. }, 1500);
  245. } else {
  246. this.$message.error(e.data.msg);
  247. }
  248. this.listLoading = false
  249. }).
  250. catch(e => {
  251. console.log(e);
  252. })
  253. }).catch(_ => {})
  254. },
  255. /**
  256. * 获取图片地址
  257. */
  258. getUrl(urls) {
  259. return urls ? urls[0] : ''
  260. },
  261. },
  262. })
  263. </script>
  264. <style>
  265. .goods {
  266. display: flex;
  267. }
  268. .goods-name {
  269. margin-left: 5px;
  270. }
  271. </style>