Index.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  1. <template>
  2. <page-view :title="title">
  3. <a-card :bordered="false">
  4. <detail-list title="退款申请">
  5. <detail-list-item term="取货单号">1000000000</detail-list-item>
  6. <detail-list-item term="状态">已取货</detail-list-item>
  7. <detail-list-item term="销售单号">1234123421</detail-list-item>
  8. <detail-list-item term="子订单">3214321432</detail-list-item>
  9. </detail-list>
  10. <a-divider style="margin-bottom: 32px"/>
  11. <detail-list title="用户信息">
  12. <detail-list-item term="用户姓名">付小小</detail-list-item>
  13. <detail-list-item term="联系电话">18100000000</detail-list-item>
  14. <detail-list-item term="常用快递">菜鸟仓储</detail-list-item>
  15. <detail-list-item term="取货地址">浙江省杭州市西湖区万塘路18号</detail-list-item>
  16. <detail-list-item term="备注"> 无</detail-list-item>
  17. </detail-list>
  18. <a-divider style="margin-bottom: 32px"/>
  19. <div class="title">退货商品</div>
  20. <s-table
  21. style="margin-bottom: 24px"
  22. row-key="id"
  23. :columns="goodsColumns"
  24. :data="loadGoodsData">
  25. </s-table>
  26. <div class="title">退货进度</div>
  27. <s-table
  28. style="margin-bottom: 24px"
  29. row-key="key"
  30. :columns="scheduleColumns"
  31. :data="loadScheduleData">
  32. <template
  33. slot="status"
  34. slot-scope="status">
  35. <a-badge :status="status" :text="status | statusFilter"/>
  36. </template>
  37. </s-table>
  38. </a-card>
  39. </page-view>
  40. </template>
  41. <script>
  42. import { PageView } from '@/layouts'
  43. import { STable } from '@/components'
  44. import DetailList from '@/components/tools/DetailList'
  45. const DetailListItem = DetailList.Item
  46. export default {
  47. components: {
  48. PageView,
  49. DetailList,
  50. DetailListItem,
  51. STable
  52. },
  53. data () {
  54. return {
  55. goodsColumns: [
  56. {
  57. title: '商品编号',
  58. dataIndex: 'id',
  59. key: 'id'
  60. },
  61. {
  62. title: '商品名称',
  63. dataIndex: 'name',
  64. key: 'name'
  65. },
  66. {
  67. title: '商品条码',
  68. dataIndex: 'barcode',
  69. key: 'barcode'
  70. },
  71. {
  72. title: '单价',
  73. dataIndex: 'price',
  74. key: 'price',
  75. align: 'right'
  76. },
  77. {
  78. title: '数量(件)',
  79. dataIndex: 'num',
  80. key: 'num',
  81. align: 'right'
  82. },
  83. {
  84. title: '金额',
  85. dataIndex: 'amount',
  86. key: 'amount',
  87. align: 'right'
  88. }
  89. ],
  90. // 加载数据方法 必须为 Promise 对象
  91. loadGoodsData: () => {
  92. return new Promise(resolve => {
  93. resolve({
  94. data: [
  95. {
  96. id: '1234561',
  97. name: '矿泉水 550ml',
  98. barcode: '12421432143214321',
  99. price: '2.00',
  100. num: '1',
  101. amount: '2.00'
  102. },
  103. {
  104. id: '1234562',
  105. name: '凉茶 300ml',
  106. barcode: '12421432143214322',
  107. price: '3.00',
  108. num: '2',
  109. amount: '6.00'
  110. },
  111. {
  112. id: '1234563',
  113. name: '好吃的薯片',
  114. barcode: '12421432143214323',
  115. price: '7.00',
  116. num: '4',
  117. amount: '28.00'
  118. },
  119. {
  120. id: '1234564',
  121. name: '特别好吃的蛋卷',
  122. barcode: '12421432143214324',
  123. price: '8.50',
  124. num: '3',
  125. amount: '25.50'
  126. }
  127. ],
  128. pageSize: 10,
  129. pageNo: 1,
  130. totalPage: 1,
  131. totalCount: 10
  132. })
  133. }).then(res => {
  134. return res
  135. })
  136. },
  137. scheduleColumns: [
  138. {
  139. title: '时间',
  140. dataIndex: 'time',
  141. key: 'time'
  142. },
  143. {
  144. title: '当前进度',
  145. dataIndex: 'rate',
  146. key: 'rate'
  147. },
  148. {
  149. title: '状态',
  150. dataIndex: 'status',
  151. key: 'status',
  152. scopedSlots: { customRender: 'status' }
  153. },
  154. {
  155. title: '操作员ID',
  156. dataIndex: 'operator',
  157. key: 'operator'
  158. },
  159. {
  160. title: '耗时',
  161. dataIndex: 'cost',
  162. key: 'cost'
  163. }
  164. ],
  165. loadScheduleData: () => {
  166. return new Promise(resolve => {
  167. resolve({
  168. data: [
  169. {
  170. key: '1',
  171. time: '2017-10-01 14:10',
  172. rate: '联系客户',
  173. status: 'processing',
  174. operator: '取货员 ID1234',
  175. cost: '5mins'
  176. },
  177. {
  178. key: '2',
  179. time: '2017-10-01 14:05',
  180. rate: '取货员出发',
  181. status: 'success',
  182. operator: '取货员 ID1234',
  183. cost: '1h'
  184. },
  185. {
  186. key: '3',
  187. time: '2017-10-01 13:05',
  188. rate: '取货员接单',
  189. status: 'success',
  190. operator: '取货员 ID1234',
  191. cost: '5mins'
  192. },
  193. {
  194. key: '4',
  195. time: '2017-10-01 13:00',
  196. rate: '申请审批通过',
  197. status: 'success',
  198. operator: '系统',
  199. cost: '1h'
  200. },
  201. {
  202. key: '5',
  203. time: '2017-10-01 12:00',
  204. rate: '发起退货申请',
  205. status: 'success',
  206. operator: '用户',
  207. cost: '5mins'
  208. }
  209. ],
  210. pageSize: 10,
  211. pageNo: 1,
  212. totalPage: 1,
  213. totalCount: 10
  214. })
  215. }).then(res => {
  216. return res
  217. })
  218. }
  219. }
  220. },
  221. filters: {
  222. statusFilter (status) {
  223. const statusMap = {
  224. 'processing': '进行中',
  225. 'success': '完成',
  226. 'failed': '失败'
  227. }
  228. return statusMap[status]
  229. }
  230. },
  231. computed: {
  232. title () {
  233. return this.$route.meta.title
  234. }
  235. }
  236. }
  237. </script>
  238. <style lang="less" scoped>
  239. .title {
  240. color: rgba(0,0,0,.85);
  241. font-size: 16px;
  242. font-weight: 500;
  243. margin-bottom: 16px;
  244. }
  245. </style>