logistics.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. <template>
  2. <div class="app-container">
  3. <div class="app-header-top" style="width: 100%;float: right;margin-bottom: 10px;">
  4. <div class="app-title">发货记录</div>
  5. <el-button type="primary" icon="el-icon-back" style="float: right;" @click="backToList">返回</el-button>
  6. </div>
  7. <el-card v-if="logisticsInfoVos.length === 0" class="box-card" style="text-align:center;">暂无发货记录.....</el-card>
  8. <el-card v-else class="box-card">
  9. <div v-for="(data,index) in logisticsInfoVos" :key="index" class="order-item">
  10. <el-row :gutter="24" class="box-row">
  11. <el-col :span="24"><b>发货时间:{{ data.logisticsBatch.deliveryTime }}</b></el-col>
  12. </el-row>
  13. <el-row v-for="Record in data.logisticsRecordList" :key="Record.id" :gutter="22" class="product-row">
  14. <el-col :span="2"><img :src="Record.image" width="75" height="75" alt=""></el-col>
  15. <el-col :span="22">
  16. <el-row style="margin-bottom: 10px;"><b>{{ Record.productName }}</b></el-row>
  17. <el-row>
  18. <el-col><div class="op-item"><b>购买数量:</b>{{ Record.buyNum }}</div></el-col>
  19. <el-col><div class="op-item"><b>发货数量:</b>{{ Record.num }}</div></el-col>
  20. </el-row>
  21. </el-col>
  22. </el-row>
  23. <el-row :gutter="24" class="box-row"><el-col :span="24" style="color:#417DE6;font-weight: bold;">物流详情</el-col></el-row>
  24. <div v-for="logistics in data.logisticsInformationList" :key="logistics.orderID" :gutter="22" class="product-row" style="padding: 0 12px;background: #fff;">
  25. <el-collapse accordion>
  26. <el-collapse-item>
  27. <template slot="title">
  28. <span class="nu-span">快递公司:{{ logistics.logisticsCompanyName }}</span>
  29. <span class="nu-span">物流单号:{{ logistics.nu }}</span>
  30. </template>
  31. <div v-if="logistics.logisticsDetailVos === null" class="none-logistice">暂无物流详情</div>
  32. <div v-for="(Detail, logIndex) in logistics.logisticsDetailVos" v-else :key="logIndex" class="logistics-item">
  33. <div><span>{{ Detail.time }}</span> <span>{{ Detail.desc }}</span></div>
  34. </div>
  35. </el-collapse-item>
  36. </el-collapse>
  37. </div>
  38. </div>
  39. </el-card>
  40. <template>
  41. <el-backtop style="right: 40px; bottom: 40px;">
  42. <i class="el-icon-upload2" />
  43. </el-backtop>
  44. </template>
  45. </div>
  46. </template>
  47. <script>
  48. import { getLogistics } from '@/api/order'
  49. export default {
  50. data() {
  51. return {
  52. activeName: '1',
  53. logisticsInfoVos: []
  54. }
  55. },
  56. computed: {
  57. orderID: function() {
  58. return window.location.href.split('/').reverse()[0] * 1
  59. }
  60. },
  61. created() {
  62. this.fetchData()
  63. },
  64. methods: {
  65. fetchData() {
  66. this.listLoading = true
  67. getLogistics({ orderID: this.orderID }).then(response => {
  68. this.order = response.data.order
  69. this.logisticsInfoVos = response.data
  70. this.listLoading = false
  71. }).catch(() => {
  72. this.listLoading = false
  73. })
  74. },
  75. backToList() {
  76. let parentPath = '/order/list'
  77. const parentView = this.$store.getters.visitedViews.slice(-2)[0]
  78. if (parentView) {
  79. const oid = parentView.fullPath.split('/').reverse()[0] * 1
  80. if (this.orderID === oid) {
  81. parentPath = parentView.fullPath
  82. }
  83. }
  84. this.$store.dispatch('tagsView/delView', this.$route).then(() => {
  85. this.$nextTick(() => {
  86. this.$router.replace({
  87. path: parentPath
  88. })
  89. })
  90. })
  91. }
  92. }
  93. }
  94. </script>
  95. <style lang="scss" scoped>
  96. .app-title{
  97. float: left;
  98. line-height: 36px;
  99. font-size: 18px;
  100. font-weight: bold;
  101. color: #999999;
  102. }
  103. h1{
  104. color: #409EFF;
  105. font-size: 24px;
  106. text-align: center;
  107. }
  108. h3{
  109. color: #409EFF;
  110. font-size: 16px;
  111. margin: 0;
  112. }
  113. .box-card{
  114. margin-top: 20px;
  115. font-size: 14px;
  116. }
  117. .box-row{
  118. padding: 10px 0;
  119. }
  120. .order-item{
  121. border-bottom: 1px solid #DCDFE6;
  122. background:#F2F6FC;
  123. margin-top: 20px;
  124. padding: 5px 15px 15px 15px;
  125. border-radius: 5px;
  126. &:first-child{
  127. margin-top: 0;
  128. }
  129. }
  130. .product-row{
  131. padding: 10px 0;
  132. background: #EBEEF5;
  133. border-top: 1px solid #e6ebf5;
  134. .el-collapse{
  135. border-top: none;
  136. border-bottom: none;
  137. }
  138. }
  139. .op-item{
  140. padding: 5px 0;
  141. }
  142. .nu-span{
  143. font-size: 14px;
  144. color: #E68341;
  145. margin-right: 15px;
  146. }
  147. .none-logistice{
  148. color: #999999;
  149. font-size: 12px;
  150. }
  151. </style>