Commit 4eca7e76 by 徐忆琳

Merge branch 'v3.15.1_10' into 'v3.15.1'

修改订单状态取值

See merge request !16
2 parents 30187bb7 683c9147
<!-- 秒杀活动 -->
<template>
<div class="ctnr">
<div class="stutas-wrap">
<span>售后状态:</span>
<span v-if="!isLoading" class="stutas-circle" :style="{backgroundColor: (orderInfo.returnOrderStatus == 1003 || orderInfo.returnOrderStatus == 1006) ? '#2CCA74': '#5850FF'}"></span>
<span v-if="!isLoading">{{ (orderInfo.returnOrderStatus == 1003 || orderInfo.returnOrderStatus == 1006) ? '售后完成': '售后中'}}</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">
<div slot="addDescImgSlot" class="addDescImgSlot">
<el-image class="img" v-for="(item,index) in orderInfo.imgUrlList" :preview-src-list="orderInfo.imgUrlList" :key="index" :src="item" ></el-image>
<span v-if="!orderInfo.imgUrlList || orderInfo.imgUrlList.length==0">--</span>
</div>
</glsxCombiForm>
</div>
</div>
<div class="info-wrap">
<div class="title">商品信息</div>
<div class="detail">
<GLTable :hasPage="false" ref="goodsTableRef" :tableParams="tableParams" :tableData="orderInfo.goodsInfoTableDate">
<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">
<span class="name">{{ scope.scope.brandName }} {{ scope.scope.goodsSkuName }}</span>
</el-tooltip>
</div>
</GLTable>
</div>
</div>
<div v-if="showEmailInfo" class="info-wrap">
<div class="title">商品寄回</div>
<div class="detail">
<GLTable :hasPage="false" ref="shipmentsRef" :tableParams="shipmentsParams" :tableData="orderInfo.expressInfo">
<div class="ctnr">
<div class="stutas-wrap">
<span>售后状态:</span>
<span v-if="!isLoading" class="stutas-circle"
:style="{backgroundColor: (orderInfo.returnOrderStatus == 1003 || orderInfo.returnOrderStatus == 1006) ? '#2CCA74': '#5850FF'}"></span>
<span
v-if="!isLoading">{{ (orderInfo.returnOrderStatus == 1003 || orderInfo.returnOrderStatus == 1006) ? '售后完成' : '售后中' }}</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">
<div slot="addDescImgSlot" class="addDescImgSlot">
<el-image class="img" v-for="(item,index) in orderInfo.imgUrlList" :preview-src-list="orderInfo.imgUrlList"
:key="index" :src="item"></el-image>
<span v-if="!orderInfo.imgUrlList || orderInfo.imgUrlList.length==0">--</span>
</div>
</glsxCombiForm>
</div>
</div>
<div class="info-wrap">
<div class="title">商品信息</div>
<div class="detail">
<GLTable :hasPage="false" ref="goodsTableRef" :tableParams="tableParams"
:tableData="orderInfo.goodsInfoTableDate">
<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">
<span class="name">{{ scope.scope.brandName }} {{ scope.scope.goodsSkuName }}</span>
</el-tooltip>
</div>
</GLTable>
</div>
</div>
<div v-if="showEmailInfo" class="info-wrap">
<div class="title">商品寄回</div>
<div class="detail">
<GLTable :hasPage="false" ref="shipmentsRef" :tableParams="shipmentsParams" :tableData="orderInfo.expressInfo">
</GLTable>
</div>
</div>
<GLFooter>
<el-button style="margin-top: 16px;" @click="$router.back()" size="medium">取消</el-button>
</GLFooter>
</GLTable>
</div>
</div>
<GLFooter>
<el-button style="margin-top: 16px;" @click="$router.back()" size="medium">取消</el-button>
</GLFooter>
</div>
</template>
<script>
import glsxCombiForm from '@/components/glsx-combi-form'
import util from '@/util/util'
const reasonObj = {1001:'商品无货',1002:'发货时间问题',1003:'不想要了/不喜欢',1004:'商品信息填写错误',1005:'地址信息填写错误',1006:'商品降价',1007:'其他',1008:'尺码不合适',1009:'无理由退货',1010:'发票问题',1011:'商品与页面描述不符',1012:'发错货',1013:'质量问题',1014:'买错尺码/颜色/型号',1015:'商品缺少或破损',1016:'买错了'}
const refundStatusObj = {1000:'待审核',1001: '审核通过',1002: '已收货',1003: '已退款',1004: '已生成新订单',1005: '审核不通过'}
const outRefundTypeObj = {0:'退款成功',1:'退款关闭',2:'退款处理中',3:'退款异常'}
const reasonObj = {
1001: '商品无货',
1002: '发货时间问题',
1003: '不想要了/不喜欢',
1004: '商品信息填写错误',
1005: '地址信息填写错误',
1006: '商品降价',
1007: '其他',
1008: '尺码不合适',
1009: '无理由退货',
1010: '发票问题',
1011: '商品与页面描述不符',
1012: '发错货',
1013: '质量问题',
1014: '买错尺码/颜色/型号',
1015: '商品缺少或破损',
1016: '买错了'
}
const refundStatusObj = {
1000: '待审核',
1001: '审核通过',
1002: '已收货',
1003: '已退款',
1004: '已生成新订单',
1005: '审核不通过'
}
const outRefundTypeObj = {0: '退款成功', 1: '退款关闭', 2: '退款处理中', 3: '退款异常'}
export default {
name: 'goodsOrderDetail',
data() {
return {
editForm: {
name: 123
},
isLoading: false,
showEmailInfo: false,
orderInfo: {},
shipmentsParams: {
listName: 'shipments',
tableOption: false,
tableColumns: [
{
label: '快递公司',
prop: 'expressName'
},
{
label: '快递单号',
prop: 'expressNo'
},
{
label: '寄回时间',
prop: 'returnTime'
}
]
},
tableParams: {
listName: 'list',
tableOption: false,
tableColumns: [
{
label: '商品名称',
prop: 'goodsName',
addHtml: 'goodsNameSlot'
},
{
label: '申请数量',
prop: 'applyQty'
},
{
label: '申请金额 (元)',
prop: 'refundPrice',
formatter: cell => {
return cell.redeemPoints ? cell.redeemPoints + '积分' + '+' + cell.refundPrice + '元' : cell.refundPrice + '元'
}
},
{
label: '平台订单编号',
prop: 'tparReturnOrderCode'
},
{
label: '订单状态',
prop: 'refundStatus'
}
]
},
editFormData: [
{
label: '第三方售后编号',
name: 'returnOrderCode',
type: 'showTxt'
},
name: 'goodsOrderDetail',
data() {
return {
editForm: {
name: 123
},
isLoading: false,
showEmailInfo: false,
orderInfo: {},
shipmentsParams: {
listName: 'shipments',
tableOption: false,
tableColumns: [
{
label: '平台订单编号',
name: 'tparReturnOrderCode',
type: 'showTxt'
label: '快递公司',
prop: 'expressName'
},
{
label: '申请时间',
name: 'createdDate',
type: 'showTxt'
label: '快递单号',
prop: 'expressNo'
},
{
label: '售后类型',
name: 'returnType',
type: 'showTxt'
},
label: '寄回时间',
prop: 'returnTime'
}
]
},
tableParams: {
listName: 'list',
tableOption: false,
tableColumns: [
{
label: '售后原因',
name: 'returnReasonType',
type: 'showTxt'
label: '商品名称',
prop: 'goodsName',
addHtml: 'goodsNameSlot'
},
{
label: '用户名称',
name: 'accountName',
type: 'showTxt'
label: '申请数量',
prop: 'applyQty'
},
{
label: '用户手机号',
name: 'customerPhone',
type: 'showTxt'
label: '申请金额 (元)',
prop: 'refundPrice',
formatter: cell => {
return cell.redeemPoints ? cell.redeemPoints + '积分' + '+' + cell.refundPrice + '元' : cell.refundPrice + '元'
}
},
{
label: '申请描述',
name: 'returnContent',
type: 'showTxt'
label: '平台订单编号',
prop: 'tparReturnOrderCode'
},
{
label: '描述图片',
name: 'imgUrlList',
addHtml: 'addDescImgSlot'
label: '订单状态',
prop: 'refundStatus'
}
]
}
},
components: {
glsxCombiForm
},
created() {
this.getDetailById()
},
mounted() {
},
methods: {
getDetailById(){
const { id } = this.$route.params
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.3)'
})
this.isLoading = true
this.$apis.platformGoods.getSaleOrderDetail({afterSalesOrderCode:id}).then(res =>{
loading.close()
this.isLoading = false
if(res?.id){
let {applyQty, refundPrice, outRefundType, refundStatus, tparReturnOrderCode, returnType, returnReasonType, returnTime} = res || {}
const {brandName, goodsSkuName, goodsImageUrl} = res.orderGoods || {}
this.showEmailInfo = returnType == 1001
res.returnType = {1001: '退货退款', 1002: '仅退款', 1003:'退货换货'}[returnType] || '--'
res.returnReasonType = reasonObj[returnReasonType]
refundStatus = refundStatus!=1003 ? refundStatusObj[refundStatus] : outRefundTypeObj[outRefundType]
res.goodsInfoTableDate = [{brandName, goodsSkuName, goodsImageUrl, applyQty, refundPrice, refundStatus, tparReturnOrderCode}]
res.createdDate = res.createdDate ? util.dateFormat(res.createdDate, 'YYYY-MM-DD HH:mm:ss') : '--'
res.returnTime = returnTime ? util.dateFormat(returnTime, 'YYYY-MM-DD HH:mm:ss') : '--'
res.expressInfo = [{expressName: res.expressName, expressNo: res.expressNo, returnTime: res.returnTime}]
this.orderInfo = res
}
}).catch(err=>{
this.isLoading = false
loading.close()
console.log(err)
})
},
editFormData: [
{
label: '第三方售后编号',
name: 'returnOrderCode',
type: 'showTxt'
},
{
label: '平台订单编号',
name: 'tparReturnOrderCode',
type: 'showTxt'
},
{
label: '申请时间',
name: 'createdDate',
type: 'showTxt'
},
{
label: '售后类型',
name: 'returnType',
type: 'showTxt'
},
{
label: '售后原因',
name: 'returnReasonType',
type: 'showTxt'
},
{
label: '用户名称',
name: 'accountName',
type: 'showTxt'
},
{
label: '用户手机号',
name: 'customerPhone',
type: 'showTxt'
},
{
label: '申请描述',
name: 'returnContent',
type: 'showTxt'
},
{
label: '描述图片',
name: 'imgUrlList',
addHtml: 'addDescImgSlot'
}
]
}
},
components: {
glsxCombiForm
},
created() {
this.getDetailById()
},
mounted() {
},
methods: {
getDetailById() {
const {id} = this.$route.params
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.3)'
})
this.isLoading = true
this.$apis.platformGoods.getSaleOrderDetail({afterSalesOrderCode: id}).then(res => {
loading.close()
this.isLoading = false
if (res?.id) {
let {
applyQty,
refundPrice,
outRefundType,
refundStatus,
returnOrderStatus,
tparReturnOrderCode,
returnType,
returnReasonType,
returnTime
} = res || {}
const {brandName, goodsSkuName, goodsImageUrl} = res.orderGoods || {}
this.showEmailInfo = returnType == 1001
res.returnType = {1001: '退货退款', 1002: '仅退款', 1003: '退货换货'}[returnType] || '--'
res.returnReasonType = reasonObj[returnReasonType]
refundStatus = returnOrderStatus != 1003 ? refundStatusObj[returnOrderStatus] : outRefundTypeObj[outRefundType]
res.goodsInfoTableDate = [{
brandName,
goodsSkuName,
goodsImageUrl,
applyQty,
refundPrice,
refundStatus,
tparReturnOrderCode
}]
res.createdDate = res.createdDate ? util.dateFormat(res.createdDate, 'YYYY-MM-DD HH:mm:ss') : '--'
res.returnTime = returnTime ? util.dateFormat(returnTime, 'YYYY-MM-DD HH:mm:ss') : '--'
res.expressInfo = [{expressName: res.expressName, expressNo: res.expressNo, returnTime: res.returnTime}]
this.orderInfo = res
}
}).catch(err => {
this.isLoading = false
loading.close()
console.log(err)
})
},
}
}
</script>
<style scoped lang="scss">
.ctnr{
.stutas-wrap{
background-color: #fff;
height: 72px;
line-height: 72px;
font-weight: 500;
font-size: 20px;
color: #333333;
padding: 0 20px;
.stutas-circle{
display: inline-block;
border-radius: 50%;
width: 10px;
height: 10px;
background: #FDB757;
margin-right: 10px;
vertical-align: middle;
}
.ctnr {
.stutas-wrap {
background-color: #fff;
height: 72px;
line-height: 72px;
font-weight: 500;
font-size: 20px;
color: #333333;
padding: 0 20px;
.stutas-circle {
display: inline-block;
border-radius: 50%;
width: 10px;
height: 10px;
background: #FDB757;
margin-right: 10px;
vertical-align: middle;
}
.info-wrap{
background-color: #fff;
margin-top: 16px;
.title{
height: 60px;
line-height: 60px;
border-bottom: 1px solid #E5E5E5;
padding: 0 20px;
font-weight: 500;
font-size: 20px;
color: #333333;
}
.detail{
padding: 20px;
.addDescImgSlot{
.img{
width: 36px;
height: 36px;
margin-right: 8px;
}
}
}
}
.info-wrap {
background-color: #fff;
margin-top: 16px;
.title {
height: 60px;
line-height: 60px;
border-bottom: 1px solid #E5E5E5;
padding: 0 20px;
font-weight: 500;
font-size: 20px;
color: #333333;
}
.order-info{
.detail {
padding: 20px;
.addDescImgSlot {
.img {
width: 36px;
height: 36px;
margin-right: 8px;
}
}
}
}
.order-info {
}
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!