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
<template>
  <div class="orderTable">
    <list-condition-template ref="table" :dataKey="'orderId'" :tableData="tableData" :total="total"
                             @page-info-change="handlePageInfoChange" v-loading="loading">
      <template slot="columns">
        <el-table-column label="订单编号" prop="orderId" width="170px">
          <template slot-scope="scope">
            {{scope.row.orderId}}
          </template>
        </el-table-column>
        <el-table-column label="订单金额" prop="orderPrice">
          <template slot-scope="scope">
            {{scope.row.orderPrice !== null ? '¥'+scope.row.orderPrice.toFixed(2):'-'}}
          </template>
        </el-table-column>
        <el-table-column label="实收金额" prop="orderPayPrice">
          <template
                    slot-scope="scope">{{scope.row.orderPayPrice !== null ? '¥ '+scope.row.orderPayPrice.toFixed(2) : '-'}}</template>
        </el-table-column>
        <el-table-column label="数量" width="100px" align="center" show-overflow-tooltip>
          <template slot-scope="scope">
            {{scope.row.orderItemsAll.omsOrderItems ? scope.row.orderItemsAll.omsOrderItems[0].buyQuantity : '-'}}
          </template>
        </el-table-column>
        <el-table-column label="订单状态" prop="orderStatus">
          <template slot-scope="scope">
            {{scope.row.orderStatus ? scope.row.orderStatusName:'-'}}
          </template>
        </el-table-column>
        <el-table-column label="下单用户" width="150px">
          <template
                    slot-scope="scope">{{scope.row.creatorName ? scope.row.creatorName : '-' }}</template>
        </el-table-column>
        <el-table-column label="下单时间" prop="orderTime" width="155px"></el-table-column>
        <el-table-column label="收货人名称" width="100px">
          <template slot-scope="scope">
            {{scope.row.omsOrderDelivery && scope.row.omsOrderDelivery.contactName ? scope.row.omsOrderDelivery.contactName :'-'}}
          </template>
        </el-table-column>
        <el-table-column label="收货人电话" width="150px">
          <template slot-scope="scope">
            {{scope.row.omsOrderDelivery && scope.row.omsOrderDelivery.contactPhone ? scope.row.omsOrderDelivery.contactPhone :'-'}}
          </template>
        </el-table-column>
        <el-table-column label="收货地址" width="200px" show-overflow-tooltip>
          <template slot-scope="scope">
            {{scope.row.omsOrderDelivery && scope.row.omsOrderDelivery.fullAdd}}
          </template>
        </el-table-column>
      </template>
    </list-condition-template>
  </div>
</template>
<script>
import orderMgtApi from '@/api/orderMgt'
import orderStatus from '@/utils/constant/orderStatus'
import { getArrayLable } from '@/utils/getArrayLable'
 
export default {
  props: ['idList'],
  data () {
    return {
      orderStatus: orderStatus,
      listQuery: {
        idList: null // 批量查询的订单id
      },
      tableData: [],
      total: 0,
      loading: false
    }
  },
  methods: {
    /**
       * '分页信息改变时查询列表
       */
    handlePageInfoChange (pageInfo) {
      this.queryList(pageInfo)
    },
    /**
         * 获取数组的label
         */
    getLabel (array, id, row) {
      if (row && row.orderType === 'T05') {
        switch (id) {
          case '88':
            return '售后中'
          case '10':
            return '售后成功'
          case '06':
            return '已完成'
          default:
            return getArrayLable(array, id)
        }
      } else {
        return getArrayLable(array, id)
      }
    },
    /**
         * 查询列表
         */
    queryList (pageInfo = { pageNum: 1, pageSize: 10 }, idList) {
      this.listQuery.isMarketOrder = '0'
      this.listQuery.idList = idList || this.idList
      this.loading = true
      orderMgtApi.getList({ ...this.listQuery, ...pageInfo }, false).then((res) => {
        if (res.data) {
          this.tableData = res.data.list
          this.total = res.data.total
          this.exportQuery = JSON.parse(JSON.stringify(this.listQuery))
          this.$refs.table.clearTableSelected() // 清空表格勾选项
          this.loading = false
        } else {
          this.loading = false
        }
      }).catch(() => {
        this.loading = false
      })
    }
  }
}
</script>
<style lang="scss">
</style>