<template>
|
<div>
|
<list-condition-template ref="table" :form="listQuery" :formLabel="formLabel"
|
:tableData="tableData" :total="total"
|
@page-info-change="handlePageInfoChange" :dataKey="'key'">
|
<template slot="otherElement">
|
<el-col :span="24" :offset="0" class="buttonPosition">
|
<el-button size="mini" type="primary" @click="queryData">查询</el-button>
|
<el-button size="mini" @click="resetQuery">重置</el-button>
|
</el-col>
|
</template>
|
<template slot="operationSection">
|
<el-button size="mini" type="success" @click="distributionAdd">配货</el-button>
|
</template>
|
<template slot="columns">
|
<el-table-column type="expand">
|
<template slot-scope="props">
|
<el-table border :data="props.row.orderItemsAll.omsOrderItems">
|
<el-table-column type="index" align="center" label="序号" width="80px">
|
</el-table-column>
|
<el-table-column label="商品图片" align="center">
|
<template slot-scope="scope">
|
<product-img :imgUrl="scope.row.imgUrl"></product-img>
|
</template>
|
</el-table-column>
|
<el-table-column label="商品" prop="spuName">
|
<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">
|
{{ JSON.parse(scope.row.skuProps).length ? JSON.parse(scope.row.skuProps).map(item=>item.propValueName).join('/') : '-'}}
|
</template>
|
</el-table-column>
|
<el-table-column label="数量">
|
<template slot-scope="scope">
|
{{scope.row.buyQuantity}} * {{JSON.parse(scope.row.expInfo).skuReduceStorage}}
|
({{scope.row.spuUnit}})
|
</template>
|
</el-table-column>
|
<el-table-column label="售后状态">
|
<template slot-scope="scope">
|
{{ getRefundStatus(scope.row.refundStatus) }}
|
</template>
|
</el-table-column>
|
</el-table>
|
</template>
|
</el-table-column>
|
<el-table-column label="订单编号" prop="orderId" width="170px" show-overflow-tooltip>
|
<template slot-scope="scope">
|
<el-link class="urlLink" @click="lookOrderInfo(scope.row)">{{ scope.row.orderId }}</el-link>
|
</template>
|
</el-table-column>
|
<el-table-column label="收货人姓名" prop="marketShopInfo.linkMan"></el-table-column>
|
<el-table-column label="收货人电话" prop="marketShopInfo.linkPhone"></el-table-column>
|
<el-table-column label="关联经销商" prop="marketShopInfo.ecMarketMerchant.merchantName">
|
</el-table-column>
|
<el-table-column label="订单状态" prop="orderStatus">
|
<template slot-scope="scope">
|
{{getDistributionOrder(scope.row.orderStatus,scope.row.deliveryStatus)}}
|
</template>
|
</el-table-column>
|
<el-table-column label="下单时间" prop="orderTime"></el-table-column>
|
<el-table-column label="门店名称" prop="marketShopInfo.shopName" show-overflow-tooltip>
|
</el-table-column>
|
<el-table-column label="操作" :width="`${$store.getters.colSize+1}px`">
|
<template slot-scope="scope">
|
<wly-btn @click="lookInfo(scope.row)">详情</wly-btn>
|
</template>
|
</el-table-column>
|
</template>
|
</list-condition-template>
|
<el-dialog :visible.sync="dialogVisible" title="订单详情" :close-on-click-modal="false"
|
:modal-append-to-body="false" width="40%">
|
<details-info></details-info>
|
<div slot="footer" class="dialog-footer">
|
<el-button size="mini" @click="dialogVisible=false">关闭</el-button>
|
</div>
|
</el-dialog>
|
</div>
|
</template>
|
<script>
|
import orderMgtApi from '@/api/orderMgt'
|
import detailsInfo from '@/views/orderMgt/info.vue'
|
import productImg from '@/views/product/components/productImg.vue'
|
export default {
|
components: { detailsInfo, productImg },
|
data () {
|
return {
|
listQuery: {
|
orderId: null,
|
status: null,
|
contactName: null,
|
contactPhone: null,
|
deliveryStatus: null
|
},
|
formLabel: [
|
{
|
model: 'orderId',
|
label: '订单编号',
|
type: 'input'
|
// rule: /[^\w]/g // 可输入数字字母
|
},
|
{
|
model: 'status',
|
label: '订单状态',
|
type: 'select',
|
opts: [
|
{
|
id: '0',
|
name: '仓库待出库'
|
},
|
{
|
id: '03',
|
name: '仓库已出库'
|
},
|
{
|
id: '04',
|
name: '门店待入库'
|
},
|
{
|
id: '05',
|
name: '门店已入库'
|
}
|
]
|
},
|
{
|
model: 'contactName',
|
label: '收货人姓名',
|
type: 'input',
|
labelWidth: '90px'
|
},
|
{
|
model: 'contactPhone',
|
label: '收货人电话',
|
type: 'input',
|
labelWidth: '90px'
|
}
|
],
|
tableData: [],
|
show: false,
|
title: null,
|
row: {},
|
dialogVisible: false,
|
form: {},
|
total: 0,
|
rows: []
|
}
|
},
|
/**
|
* 数据变化后刷新列表
|
*/
|
activated () {
|
this.queryList(this.$refs.table.getPageInfo())
|
},
|
methods: {
|
/**
|
* 获取售后状态
|
*/
|
getRefundStatus (status) {
|
switch (status) {
|
case '10':
|
return '售后中'
|
case '20':
|
return '退款失败'
|
case '30':
|
return '退款成功'
|
default:
|
return '-'
|
}
|
},
|
/**
|
* '分页信息改变时查询列表
|
*/
|
handlePageInfoChange (pageInfo) {
|
this.queryList(pageInfo)
|
},
|
/**
|
* 重置
|
*/
|
resetQuery () {
|
this.$refs.table.reloadCurrent()
|
},
|
/**
|
* 点击查询按钮
|
*/
|
queryData () {
|
this.$refs.table.changeCondition()
|
},
|
/**
|
* 跳转到配货订单
|
*/
|
distributionAdd () {
|
this.$router.push({
|
name: 'distributionAdd'
|
})
|
},
|
/**
|
* 查看详情
|
*/
|
lookInfo (row) {
|
this.$router.push({
|
name: 'distributionInfo',
|
query: {
|
orderId: row.orderId
|
}
|
})
|
},
|
/**
|
* 查看订单详情
|
*/
|
lookOrderInfo (row) {
|
this.$router.push({
|
name: 'orderMgtInfo',
|
query: {
|
orderId: row.orderId,
|
promotionStatus: row.promotionStatus
|
}
|
})
|
},
|
/**
|
*获取订单的状态,在列表中的展示
|
*/
|
getDistributionOrder (orderStatus, deliveryStatus) {
|
let str = null
|
switch (orderStatus) {
|
case '03':
|
str = deliveryStatus === '0' || !deliveryStatus ? '仓库待出库' : '仓库已出库'
|
break
|
case '04':
|
str = deliveryStatus === '1' ? '门店待入库' : null
|
break
|
case '05':
|
str = '门店已入库'
|
break
|
default:
|
break
|
}
|
return str
|
},
|
/**
|
* 设置查询时的订单状态
|
*/
|
setDistributionOrder () {
|
switch (this.listQuery.status) {
|
case '0':
|
this.listQuery.deliveryStatus = '0'
|
break
|
case '03':
|
this.listQuery.deliveryStatus = '1'
|
break
|
case '04':
|
this.listQuery.deliveryStatus = '1'
|
break
|
case '05':
|
this.listQuery.deliveryStatus = null
|
break
|
default:
|
this.listQuery.deliveryStatus = null
|
break
|
}
|
this.listQuery.orderStatus = this.listQuery.status === '0' ? '03' : this.listQuery.status
|
},
|
/**
|
* 查询列表
|
*/
|
queryList (pageInfo = { pageNum: 1, pageSize: 10 }) {
|
this.listQuery.bizId = 'B02'
|
this.listQuery.isMarketOrder = '1'
|
this.setDistributionOrder()
|
orderMgtApi.getList({ ...this.listQuery, ...pageInfo }).then((res) => {
|
if (res.data) {
|
this.setKey(res.data.list, pageInfo)
|
this.tableData = res.data.list
|
this.total = res.data.total
|
}
|
})
|
},
|
/**
|
* 设置表格行唯一key
|
*/
|
setKey (data, pageInfo) {
|
if (data && data.length) {
|
data.forEach((item, index) => {
|
const curIndex = index + 1
|
item.key = (pageInfo.pageNum - 1) * pageInfo.pageSize + curIndex
|
})
|
}
|
}
|
}
|
}
|
</script>
|
<style>
|
.hideSelectAll .cell .el-checkbox {
|
display: none !important;
|
}
|
</style>
|