fuliqi
2024-01-24 29c1e7eb5ac16e90d8991a86c1c071bc312ec8d9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
<template>
  <div>
    <div class="orderTitle">商品信息</div>
    <div class="omsOrderShops">
      <el-table border :data="form.omsOrderItems">
        <el-table-column type="index" align="center" label="序号" width="80px"></el-table-column>
        <el-table-column label="商品主编码" prop="spuNum" show-overflow-tooltip width="160px">
        </el-table-column>
        <!-- <el-table-column label="赠品图片" :key="Math.random()" align="center">
          <template slot-scope="scope">
            <product-img :imgUrl="scope.row.imgUrl"></product-img>
          </template>
        </el-table-column> -->
        <el-table-column label="商品名称" prop="spuName" show-overflow-tooltip>
          <template slot-scope="scope">
            <span class="giftStyle" v-if="scope.row.promotionType === '2'">赠</span>
            <span class="giftStyle" v-if="scope.row.refundStatus && scope.row.refundStatus!== '00'">
              退
            </span>
            <span>{{scope.row.spuName}}</span>
          </template>
        </el-table-column>
        <el-table-column label="商品规格">
          <template slot-scope="scope">
            {{scope.row.skuProps && JSON.parse(scope.row.skuProps).length ? JSON.parse(scope.row.skuProps).map(item=>item.propValueName).join('/') : '-'}}
          </template>
        </el-table-column>
        <template v-if="form.omsOrderDelivery.logisticSupplier === 'JD'">
          <el-table-column label="计量单位/单位计数" width="150px">
            <template slot-scope="scope">
              <el-select v-model="scope.row.specificationCode" multiple placeholder="请选择" disabled>
                <el-option v-for="item in scope.row.specificationCodeList" :key="item.prodSkuNo"
                           :label="item.unitOfMeasurement + '*'+ item.skuUnit"
                           :value="item.prodSkuNo">
                </el-option>
              </el-select>
            </template>
          </el-table-column>
          <el-table-column label="发货数量" width="160px">
            <template slot-scope="scope">
              <span v-if="scope.row.shipmentsCountList.length">
                <el-input-number :min="1" v-model="item.shipmentsCount"
                                 v-for="(item,index) in scope.row.shipmentsCountList" :key="index"
                                 disabled size="small" style="margin-bottom:10px">
                </el-input-number>
              </span>
            </template>
          </el-table-column>
        </template>
        <el-table-column :key="Math.random()" label="总数量(瓶)">
          <template slot-scope="scope">
            <span v-if="form.omsOrderDelivery.logisticSupplier === 'JD'">{{scope.row.buyQuantity}}</span>
            <span v-else>{{scope.row.buyQuantity}} * {{JSON.parse(scope.row.expInfo).skuReduceStorage}}
              ({{scope.row.spuUnit ? scope.row.spuUnit : '瓶'}})</span>
          </template>
        </el-table-column>
        <el-table-column label="售后状态">
          <template slot-scope="scope">
            {{ getRefundStatus(scope.row.refundStatus) }}
          </template>
        </el-table-column>
        <el-table-column align="center"
                         v-if="form.omsOrderDelivery.commonCarrier&&form.omsOrderDelivery.commonCarrier !== '3'"
                         label="物流跟踪">
          <template slot-scope="scope">
            <el-button type="text" v-if="!scope.row.rightExchange"
                       @click="logisticsDetails(scope.row)">查看物流</el-button>
          </template>
        </el-table-column>
      </el-table>
    </div>
    <el-dialog title="物流跟踪" class="ogisticsFormInfo" :visible.sync="logisticsVisible"
               :close-on-click-modal="false" :modal-append-to-body="false" width="750px">
      <logistics-tracking-component :formData="logisticsForm"></logistics-tracking-component>
      <span slot="footer" class="dialog-footer">
        <el-button size="mini" @click="logisticsVisible = false">关闭</el-button>
      </span>
    </el-dialog>
  </div>
</template>
<script>
// import productImg from '@/views/product/components/productImg.vue'
import orderMgtApi from '@/api/orderMgt'
import logisticsTrackingComponent from './logisticsTrackingComponent.vue'
 
export default {
  components: { logisticsTrackingComponent },
  props: ['form'],
  data() {
    return {
      dialogVisible: false,
      loading: false,
      logisticsVisible: false,
      logisticsForm: null // 物流信息
    }
  },
  methods: {
    /**
     * 获取售后状态
     */
    getRefundStatus(status) {
      switch (status) {
        case '10':
          return '售后中'
        case '20':
          return '退款失败'
        case '30':
          return '退款成功'
        default:
          return '-'
      }
    },
    /**
     * 查看商品物流信息
     */
    async logisticsDetails(row) {
      const params = {
        orderNo: this.form.orderId,
        prodCode: row.spuNum
      }
      const res = await orderMgtApi.queryByExpressInfoList(params)
      if (res.code === '0') {
        this.logisticsVisible = true
        this.logisticsForm = res.data
      }
    }
  }
}
</script>
<style lang="scss">
.omsOrderShops {
  padding-left: 100px;
  padding-right: 20px;
}
.el-table__body img {
  width: 50px;
}
.ogisticsFormInfo {
  .el-dialog__body {
    max-height: 600px;
    overflow-y: auto;
    width: 90%;
    margin: 0 auto;
    &::-webkit-scrollbar {
      display: none;
    }
  }
}
</style>