Commit c79e4e7b by chenwq

feat(订单管理): 添加自营商品子订单确认收货功能

- 在platformGoods.js中添加subOrderReceive接口方法
- 在订单列表页和详情页添加确认收货按钮及处理逻辑
- 调整订单详情页金额显示字段和发货时间显示
- 优化地址信息显示格式和订单状态显示
1 parent 09779cda
......@@ -132,6 +132,15 @@ const subOrderExpress = params => {
returnAll: true
})
}
// 子订单确认收货(自营商品)
const subOrderReceive = params => {
params.method = 'scrm.api.shopmall.platform.web.confirm.receipt'
return http({
url,
data: params,
returnAll: true
})
}
// 售后列表
const getSaleOrderList = params => {
......@@ -345,6 +354,7 @@ export default {
getOrderList,
getOrderDetail,
subOrderExpress,
subOrderReceive,
getSaleOrderList,
getAfterSalesDetail,
getYZHAfterSalesDetail,
......
......@@ -3,26 +3,22 @@
<div class="ctnr">
<div class="stutas-wrap">
<span>订单状态:</span>
<span v-if="!isLoading" class="stutas-circle"
:style="{ backgroundColor: transfStatus(orderInfo.payStatus, orderInfo.orderStatus, orderInfo.orderType).color }"></span>
<span v-if="!isLoading" class="stutas-circle" :style="{ backgroundColor: transfStatus(orderInfo.payStatus, orderInfo.orderStatus, orderInfo.orderType).color }"></span>
<span v-if="!isLoading">{{ transfStatus(orderInfo.payStatus, orderInfo.orderStatus, orderInfo.orderType).name }}</span>
</div>
<div class="info-wrap order-info">
<div class="title">订单信息</div>
<div class="detail">
<glsxCombiForm ref="editFormRef" labelWidth="154px" defaultWidth="214px" :formObj="orderInfo"
:formData="editFormData"></glsxCombiForm>
<glsxCombiForm ref="editFormRef" labelWidth="154px" defaultWidth="214px" :formObj="orderInfo" :formData="editFormData"></glsxCombiForm>
</div>
</div>
<div class="info-wrap">
<div class="title">商品信息</div>
<div class="detail">
<GLTable :hasPage="false" ref="goodsTableRef" :tableParams="tableParams"
:tableData="orderInfo.subOrderGoodsList">
<GLTable :hasPage="false" ref="goodsTableRef" :tableParams="tableParams" :tableData="orderInfo.subOrderGoodsList">
<div slot="goodsNameSlot" class="goodsNameSlot" slot-scope="scope">
<img :src="scope.scope.goodsImageUrl" alt="">
<el-tooltip class="item" effect="dark"
:content="(scope.scope.brandName || '') + (scope.scope.goodsSkuName || '')" placement="top">
<el-tooltip class="item" effect="dark" :content="(scope.scope.brandName || '') + (scope.scope.goodsSkuName || '')" placement="top">
<span class="name">{{ scope.scope.brandName }} {{ scope.scope.goodsSkuName }}</span>
</el-tooltip>
</div>
......@@ -38,19 +34,16 @@
<div class="info-wrap">
<div class="title">发货信息</div>
<div class="detail">
<GLTable :hasPage="false" ref="shipmentsRef" :tableParams="shipmentsParams"
:tableData="orderInfo.subOrderGoodsList">
<GLTable :hasPage="false" ref="shipmentsRef" :tableParams="shipmentsParams" :tableData="orderInfo.subOrderGoodsList">
<div slot="goodsNameSlot" class="goodsNameSlot" slot-scope="scope">
<img :src="scope.scope.goodsImageUrl" alt="">
<el-tooltip class="item" effect="dark"
:content="(scope.scope.brandName || '') + (scope.scope.goodsSkuName || '')" placement="top">
<el-tooltip class="item" effect="dark" :content="(scope.scope.brandName || '') + (scope.scope.goodsSkuName || '')" placement="top">
<span class="name">{{ scope.scope.brandName }} {{ scope.scope.goodsSkuName }}</span>
</el-tooltip>
</div>
<div slot="effectiveDays">
<span v-show="orderInfo.logisticsStatus" class="circle"
:style="{backgroundColor: '#5850FF'}"></span>
<span v-show="orderInfo.logisticsStatus" class="circle" :style="{backgroundColor: '#5850FF'}"></span>
<span>{{
{
1000: '待揽件',
......@@ -123,6 +116,13 @@ export default {
// 1004: '拒收'
// }[this.orderInfo.logisticsStatus] || '--'
// }
},
{
label: '发货时间',
prop: 'deliverTime',
formatter: cell => {
return this.orderInfo.deliverTime ? util.dateFormat(this.orderInfo.deliverTime, 'YYYY-MM-DD HH:mm:ss') : '--'
}
}
]
},
......@@ -179,7 +179,7 @@ export default {
type: 'showTxt'
},
{
label: '支付金额',
label: '商品总价',
name: 'payPrice',
type: 'showTxt'
},
......@@ -217,6 +217,11 @@ export default {
label: '运费',
name: 'freightAmount',
type: 'showTxt'
},
{
label: '实付金额',
name: 'totalScore',
type: 'showTxt'
}
]
}
......@@ -234,7 +239,7 @@ export default {
methods: {
transfStatus: util.transfStatus,
getDetailById() {
const {id} = this.$route.params
const { id } = this.$route.params
const loading = this.$loading({
lock: true,
text: 'Loading',
......@@ -242,17 +247,24 @@ export default {
background: 'rgba(0, 0, 0, 0.3)'
})
this.isLoading = true
this.$apis.platformGoods.getOrderDetail({subOrderCode: id}).then(res => {
this.$apis.platformGoods.getOrderDetail({ subOrderCode: id }).then(res => {
loading.close()
this.isLoading = false
if (res?.id) {
const {receiveName, receiveMobile, provinceName, cityName, townName, address} = res?.receiveAddress || {}
res.addInfo = `${receiveName} ${receiveMobile} ${provinceName}${cityName}${townName}${address}`
const { receiveName, receiveMobile, provinceName, cityName, countyName, townName, address } = res?.receiveAddress || {}
res.addInfo = `${receiveName} ${receiveMobile} ${provinceName}${cityName}${countyName}${townName}${address}`
res.addInfo = res.addInfo.replaceAll('null', '')
res.payPrice = res.redeemPoints ? res.redeemPoints + '积分' + '+' + (res.payPrice || 0) + '元' : res.payPrice + '元'
res.totalScore = res.totalScore + '积分'
res.subOrderGoodsList = res?.subOrderGoodsList?.length ? res?.subOrderGoodsList : []
// res.logisticsStatus = undefined
this.orderInfo = res
// 1.云中鹤 2.自营商品;只有自营商品有发货时间
if(res.orderType != '2') {
const tableIdx = this.shipmentsParams.tableColumns.findIndex(item => item.prop == 'deliverTime')
console.log(tableIdx, 'tableIdx')
this.shipmentsParams.tableColumns.splice(tableIdx, 1)
}
}
}).catch(err => {
this.isLoading = false
......@@ -280,7 +292,7 @@ export default {
border-radius: 50%;
width: 10px;
height: 10px;
background: #FDB757;
background: #fdb757;
margin-right: 10px;
vertical-align: middle;
}
......@@ -293,7 +305,7 @@ export default {
.title {
height: 60px;
line-height: 60px;
border-bottom: 1px solid #E5E5E5;
border-bottom: 1px solid #e5e5e5;
padding: 0 20px;
font-weight: 500;
font-size: 20px;
......@@ -306,11 +318,10 @@ export default {
}
.order-info {
}
}
.orderAmount {
color: #2CCA74;
color: #2cca74;
}
</style>
......@@ -106,6 +106,18 @@ export default {
listeners: {
click: row => this.handleOrderExpress(row.scope)
}
},
{
type: 'el-button',
name: '确认收货',
attrs: {
type: 'text',
fn: '确认收货'
},
condition: row => row.scope.goodsSource == 2 && row.scope.orderStatus == 1008,
listeners: {
click: row => this.handleOrderReceive(row.scope)
}
}
],
searchForm: {},
......@@ -205,7 +217,7 @@ export default {
prop: 'sellQty'
},
{
label: '实收金额 (元)',
label: '商品总价',
width: 150,
line: 1,
align: 'right',
......@@ -381,6 +393,30 @@ export default {
.finally(() => {
this.batchLoading = false
})
},
handleOrderReceive(row) {
this.$messageBox.confirm('请先与收货人确认收货后再进行此操作。是否确认收货?', '确认收货', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: action => {
if (action == 'confirm') {
this.$apis.platformGoods
.subOrderReceive({
subOrderCode: row.subOrderCode
})
.then(res => {
let { code, message } = res
if (code == 0) {
this.$message.success('操作成功')
this.handleSearch()
} else {
this.$message.error(message)
}
})
}
}
})
}
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!