<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>
|