Authored by jiran.zhao

合并财务一件发货功能

Showing 45 changed files with 2764 additions and 11 deletions
... ... @@ -7,15 +7,18 @@ import statistics from './statistics';
import finance from './finance';
import user from './user';
import kol from './kol';
import order from './order';
import logistics from './logistics';
export default {
product,
home,
shop,
repository,
statistics,
finance,
trade,
user,
kol
product,
home,
shop,
repository,
statistics,
finance,
trade,
user,
kol,
order,
logistics,
};
... ...
<template>
<Modal v-model="showModal" :title="title" width="600">
<div class="deliver-modal">
<div class="deliver-info">
<Row class-name="info-row">
<Col span="5" class-name="info-col">模版名称*:</Col>
<Col span="19"><Input v-model="templateName" placeholder=""/></Col>
</Row>
<Row class-name="info-row">
<Col span="5" class-name="info-col">设置默认运费*:</Col>
<Col span="19"><Input v-model="defaultFee" placeholder=""/></Col>
</Row>
<Row class-name="info-row">
<Col span="5">设置包邮条件:</Col><Col span="2">满</Col>
<Col span="5"><Input v-model="freeMount" placeholder=""/></Col>
<Col span="6">&nbsp;&nbsp;元包邮</Col>
</Row>
</div>
</div>
<div slot="footer">
<Button type="text" size="large" @click="hide">取消</Button>
<Button type="primary" size="large" :loading="showLoading" @click="submit(templateId)">提交</Button>
</div>
</Modal>
</template>
<script>
export default {
name: 'TemplateEdit',
props: [],
data() {
return {
title: '新增运费模版',
showModal: false,
showLoading: false,
templateName: '',
defaultFee: '',
freeMount: '',
templateId: 0,
};
},
watch: {
defaultFee: {
handler(newValue) {
if (newValue > 50) {
this.defaultFee = '';
this.$Message.error('默认运费不能大于50元!');
}
},
deep: true,
},
},
methods: {
show() {
this.title = '新增运费模版';
this.templateName = '';
this.defaultFee = '';
this.freeMount = '';
this.templateId = 0;
this.showModal = true;
},
hide() {
this.showLoading = false;
this.showModal = false;
},
//提交
submit() {
this.showLoading = true;
this.$emit('submit', {
templateName: this.templateName,
defaultFee: this.defaultFee,
freeMount: this.freeMount,
id: this.templateId,
});
},
//编辑
edit(params) {
this.title = '编辑运费魔板';
const { templateName, defaultFee, freeMount, id } = params;
this.templateName = templateName;
this.defaultFee = defaultFee;
this.freeMount = freeMount;
this.templateId = id;
this.showModal = true;
},
},
};
</script>
<style lang="scss">
.deliver-modal {
padding: 30px;
.info-row {
line-height: 40px;
}
.info-tip {
margin-top: 20px;
color: #f00;
text-align: center;
}
.ivu-modal {
width: 50%;
}
}
</style>
... ...
import AddEditTemplate from './add-edit-template';
export { AddEditTemplate };
... ...
<template>
<router-view></router-view>
</template>
<script>
export default {
data() {
return {};
},
};
</script>
<style lang="scss">
table.template-table {
width: 100%;
height: auto;
thead {
background: #000000;
th {
padding: 8px 0;
border: 1px solid #cccccc;
color: #ffffff;
text-align: center;
}
}
tbody {
tr {
height: 35px;
td {
border: 1px solid #cccccc;
border-top: none;
border-right: none;
text-align: center;
padding: 5px;
span {
margin-left: 10px;
margin-right: 20px;
}
}
td:last-child {
border-right: 1px solid #cccccc;
}
}
}
}
</style>
... ...
import childrenViews from './views';
export default {
path: '/freight',
name: 'freight',
children: childrenViews,
component: () => import(/* webpackChunkName: "logistics.freight" */ './freight'),
};
... ...
export default [
{
path: 'template.html',
name: 'template',
component: () => import(/* webpackChunkName: "product.create" */ './template'),
meta: {
pageName: '运费模板',
},
},
];
... ...
<template>
<layout-body>
<layout-filter>
<Button type="primary" @click="addTemplate">新增运费模版</Button>
</layout-filter>
<layout-list>
<Table border :columns="tableCols" :data="tableData"></Table>
<Page :total="pageData.total" :current="pageData.current" :page-size="20" show-total @on-change="pageChange">
</Page>
</layout-list>
<add-edit-template ref="showTemplateEdit" :show="showTemplateEdit" @submit="submit"></add-edit-template>
</layout-body>
</template>
<script>
import { AddEditTemplate } from '../components';
import { FreightService } from 'services/logistics';
import timeFormat from 'filters/time-format';
import _ from 'lodash';
export default {
components: { AddEditTemplate },
data() {
return {
showTemplateEdit: false,
query: {
size: 20,
page: 1,
},
pageData: {
total: 0,
current: 1,
},
tableCols: [
{
title: '启用模板',
align: 'center',
render: (h, params) => {
const id = params.row.id;
const checked = params.row.status ? 'checked' : '';
return (
<div>
<input
type="radio"
name="default"
checked={checked}
value={id}
onClick={() => this.useDefaultTemplate(id)}
/>
<span> 默认</span>
</div>
);
},
},
{
title: '模版名称',
key: 'templateName',
align: 'center',
},
{
title: '默认运费(元)',
key: 'defaultFee',
align: 'center',
},
{
title: '免邮条件',
width: 200,
align: 'center',
render: (h, params) => {
const freeMount = params.row.freeMount;
return (
<div>
<span>满 {freeMount} 免运费 </span>
</div>
);
},
},
{
title: '创建时间',
align: 'center',
render: (h, params) => {
return (
<div>
<span>{timeFormat(params.row.createTime)}</span>
</div>
);
},
},
{
title: '更新时间',
align: 'center',
render: (h, params) => {
return (
<div>
<span>{params.row.updateTime ? timeFormat(params.row.updateTime) : ''}</span>
</div>
);
},
},
{
title: '操作',
align: 'center',
render: (h, params) => {
const id = params.row.id;
return (
<div>
<i-button type="primary" onClick={() => this.editTemplate(id)}>
编辑
</i-button>
&nbsp;
<i-button type="error" onClick={() => this.deleteTemplate(id)}>
删除
</i-button>
</div>
);
},
},
],
tableData: [],
};
},
created() {
this.freightService = new FreightService();
this.getTemplateList();
},
methods: {
//获取模板列表
getTemplateList() {
this.freightService.getShopTransportFeeList(this.query).then(ret => {
this.tableData = _.get(ret, 'data.rows', []);
this.pageData.total = _.get(ret, 'data.total', 0);
this.pageData.pageNo = _.get(ret, 'data.currentPage', 1);
});
},
editTemplate(id) {
this.getTemplateInfo(id);
},
pageChange(page) {
this.pageData.current = page;
this.query.page = page;
this.search();
},
addTemplate() {
this.$refs.showTemplateEdit.show();
},
//开启魔板
useDefaultTemplate(templateId) {
const _this = this;
this.$Modal.confirm({
title: '开启模板',
content: `你确定设置为默认模板?`,
onOk() {
_this.freightService.selectDefaultShopTransportFee({ id: +templateId }).then(ret => {
if (ret.code === 200) {
this.$Message.info(ret.message);
_this.getTemplateList();
} else {
this.$Message.error(ret.message);
}
});
},
});
},
//删除魔板
deleteTemplate(templateId) {
const _this = this;
this.$Modal.confirm({
title: '删除模板',
content: `你确定 删除 商品分类吗?`,
onOk() {
_this.freightService.deleteShopTransportFee({ id: +templateId }).then(ret => {
if (ret.code === 200) {
this.$Message.info(ret.message);
_this.getTemplateList();
} else {
this.$Message.error(ret.message);
}
});
},
});
},
//获取模板的基本信息
getTemplateInfo(templateId) {
//获取模板详情
this.freightService.getShopTransportFeeDetailById({ id: +templateId }).then(ret => {
const info = _.get(ret, 'data', []);
this.$refs.showTemplateEdit.edit(info);
});
},
// 保存魔板
submit(params) {
this.freightService.addOrUpdateShopTransportFee(params).then(ret => {
if (ret.code === 200) {
this.$Message.info(ret.message);
this.$refs.showTemplateEdit.hide();
this.getTemplateList();
} else {
this.$Message.error(ret.message);
}
});
},
},
};
</script>
... ...
import freight from './freight';
export default { freight };
... ...
import orderGoodsInfo from './order-goods-info';
import orderUserInfo from './order-user-info';
import orderListTable from './order-list-table';
import orderBaseInfo from './order-base-info';
export { orderGoodsInfo, orderUserInfo, orderListTable, orderBaseInfo };
... ...
<template>
<div class="ivu-card">
<div class="ivu-card-head">
<p slot="title">订单信息</p>
</div>
<div class="ivu-card-body">
<Row>
<i-col span="24">订购人:{{ orderInfo.mobile }}</i-col>
</Row>
<br />
<Row>
<i-col span="4">订单号:{{ orderInfo.orderCode }}</i-col>
<i-col span="4">下单时间:{{ orderInfo.createTime | timeFormat }}</i-col>
<i-col span="4">发货时间:{{ orderInfo.arriveTime | timeFormat }}</i-col>
</Row>
<br />
<Row>
<i-col span="4">订单状态:{{ orderStatus[orderInfo.orderStatus] }}</i-col>
<i-col span="4">提交时间:{{ orderInfo.checkTime | timeFormat }}</i-col>
<i-col span="4">成交时间:{{ orderInfo.deliveryTime | timeFormat }}</i-col>
</Row>
</div>
</div>
</template>
<script>
export default {
name: 'OrderBaseInfo',
props: ['orderInfo', 'orderStatus'],
data() {
return {};
},
};
</script>
... ...
<template>
<table cellspacing="0" cellpadding="0" class="order-detail">
<thead>
<tr>
<template v-for="(cols, index) in tableCols">
<th :key="index" :style="'width: ' + cols.width">{{ cols.title }}</th>
</template>
</tr>
</thead>
<tbody>
<template v-for="(goods, index) in tableData">
<tr :key="index">
<td>{{ goods.productSku }}</td>
<td>
<img
:src="
'http://shopmanage.yohobuy.com/platform/product/getRemoteImageUrlBySku?sku_id=' +
goods.productSku +
'&size=40x60'
"
/>
</td>
<td style="text-align: left">
<p>{{ goods.productName }}</p>
<p>{{ goods.prodcutCode }}</p>
<p>尺码:{{ goods.sizeName }} 颜色:{{ goods.colorName }}</p>
</td>
<td>{{ goods.buyNumber }}</td>
<td>{{ goods.productPrice && goods.productPrice.retailPrice ? goods.productPrice.retailPrice : '' }}</td>
<td>{{ goods.salePrice }}</td>
<td>{{ goods.lastPrice }}</td>
<td>
{{
goodsPromos[goods.id] && goodsPromos[goods.id].couponsDiscountAmount
? goodsPromos[goods.id].couponsDiscountAmount
: 0
}}
</td>
<td>{{ goodsPromos[goods.id] && goodsPromos[goods.id].yohoCoin ? goodsPromos[goods.id].yohoCoin : 0 }}</td>
<td>
{{ goodsPromos[goods.id] && goodsPromos[goods.id].redPackage ? goodsPromos[goods.id].redPackage : 0 }}
</td>
<td>
{{
goodsPromos[goods.id] && goodsPromos[goods.id].giftCardAmount ? goodsPromos[goods.id].giftCardAmount : 0
}}
</td>
<td>
{{
goodsPromos[goods.id] && goodsPromos[goods.id].activityAmount ? goodsPromos[goods.id].activityAmount : 0
}}
</td>
<td>{{ goods.subtotal }}</td>
</tr>
</template>
</tbody>
<tfoot>
<tr>
<td colspan="13" style="text-align: left">
<span>实付金额:¥{{ orderInfo.lastOrderAmount }}</span>
<span>快递费:¥{{ orderInfo.shippingCost }}</span>
</td>
</tr>
<tr>
<td td colspan="13">
<div class="ivu-card">
<div class="ivu-card-head" style="text-align: left">
<p slot="title">使用优惠券</p>
</div>
<i-table border :columns="couponsTableCols" :data="couponsData"></i-table>
</div>
</td>
</tr>
<tr>
<td colspan="13">
<template v-if="orderPromos">
<template v-for="(item, index) in orderPromos">
<Row :key="index">{{ item.promotionTitle }} {{ item.beginTime }} — {{ item.endTime }}</Row>
</template>
</template>
<template v-else>
<span>没有参加活动.</span>
</template>
</td>
</tr>
</tfoot>
</table>
</template>
<script>
export default {
name: 'OrderGoodsInfo',
props: ['orderInfo', 'tableData', 'couponsData', 'goodsPromos', 'orderPromos'],
data() {
return {
tableCols: [
{ title: 'sku', width: '8%' },
{ title: '商品图片', width: '8%' },
{ title: '商品信息', width: '10%' },
{ title: '数量', width: '6%' },
{ title: '吊牌价', width: '6%' },
{ title: '销售价', width: '6%' },
{ title: '成交价', width: '6%' },
{ title: '优惠券', width: '6%' },
{ title: 'YOHO币', width: '6%' },
{ title: '红包', width: '6%' },
{ title: '礼品卡', width: '6%' },
{ title: '活动优惠', width: '6%' },
{ title: '小计', width: '6%' },
],
couponsTableCols: [
{
title: '优惠券名称',
key: 'couponTitle',
},
{
title: '优惠券面值',
key: 'couponAmount',
},
{
title: '优惠券金额调整',
key: 'couponAdjustAmount',
},
{
title: '费用承担类型',
key: 'feeSharingTypeStr',
},
{
title: '费用承担比例',
key: 'feeSharingRatio',
},
],
};
},
};
</script>
<style lang="scss">
table.order-detail {
width: 100%;
height: auto;
thead {
th {
padding: 8px 0;
border: 1px solid #cccccc;
text-align: center;
}
}
tbody,
tfoot {
tr {
height: 35px;
td {
border: 1px solid #cccccc;
border-top: none;
border-right: none;
text-align: center;
padding: 5px;
span {
margin-left: 10px;
margin-right: 20px;
}
}
td:last-child {
border-right: 1px solid #cccccc;
}
}
}
}
</style>
... ...
<template>
<table cellspacing="0" cellpadding="0" class="order-table">
<thead>
<tr>
<template v-for="(cols, index) in tableCols">
<th :key="index" :style="'width: ' + cols.width">{{ cols.title }}</th>
</template>
</tr>
</thead>
<tbody>
<template v-for="(item, tindex) in tableData">
<tr :key="tindex">
<td colspan="12" style="text-align: left">
<span>订单号:{{ item.orderCode }}</span>
<span>父订单号:{{ item.parentOrderCode }}</span>
<span>创建时间:{{ item.createTime | timeFormat }}</span>
</td>
</tr>
<template v-for="(goods, gindex) in item.goodsList">
<tr :key="tindex + '_' + gindex">
<td>
<img
:src="
'http://shopmanage.yohobuy.com/platform/product/getRemoteImageUrlBySku?sku_id=' +
goods.productSku +
'&size=40x60'
"
/>
</td>
<td style="text-align: left">
<p>{{ goods.prodcutName }}</p>
<p>{{ goods.prodcutCode }}</p>
<p>尺码:{{ goods.sizeName }} 颜色:{{ goods.colorName }}</p>
</td>
<td>{{ goods.salePrice }}</td>
<td>{{ goods.buyNumber }}</td>
<td>{{ goods.productSkn }}</td>
<td>{{ goods.productSku }}</td>
<template v-if="gindex == 0">
<td :rowspan="item.goodsList.length">{{ item.consigneeName }}</td>
<td :rowspan="item.goodsList.length">{{ paymentStatusArr[item.paymentStatus] }}</td>
<td :rowspan="item.goodsList.length">{{ item.lastOrderAmount }}</td>
<td :rowspan="item.goodsList.length">{{ orderStatusArr[item.orderStatus] }}</td>
<td :rowspan="item.goodsList.length">
<i-button type="default" size="small" @click="goToDetail(item.orderCode)">查看订单</i-button>
</td>
</template>
</tr>
</template>
</template>
</tbody>
</table>
</template>
<script>
export default {
name: 'OrderListTable',
props: {
tableData: {
type: Array,
},
paymentStatusArr: {
type: Object,
},
orderStatusArr: {
type: Object,
},
},
data() {
return {
tableCols: [
{ title: '图片', width: '8%' },
{ title: '商品信息', width: '20%' },
{ title: '单价', width: '8%' },
{ title: '数量', width: '5%' },
{ title: 'SKN', width: '5%' },
{ title: 'SKU', width: '5%' },
{ title: '收货人', width: '5%' },
{ title: '支付状态', width: '5%' },
{ title: '实收金额', width: '5%' },
{ title: '订单状态', width: '5%' },
{ title: '操作', width: '10%' },
],
};
},
methods: {
goToDetail(code) {
this.$router.push({
name: 'order.detail',
params: {},
query: {
orderCode: code,
},
});
},
},
};
</script>
<style lang="scss">
table.order-table {
width: 100%;
height: auto;
thead {
background: #000000;
th {
padding: 8px 0;
border: 1px solid #cccccc;
color: #ffffff;
text-align: center;
}
}
tbody {
tr {
height: 35px;
td {
border: 1px solid #cccccc;
border-top: none;
border-right: none;
text-align: center;
padding: 5px;
span {
margin-left: 10px;
margin-right: 20px;
}
}
td:last-child {
border-right: 1px solid #cccccc;
}
}
}
}
</style>
... ...
<template>
<div class="ivu-card">
<div class="ivu-card-head">
<p slot="title">物流信息</p>
</div>
<div class="ivu-card-body">
<Row>
<i-col span="24">收货人:{{ orderInfo.consigneeName }} &nbsp;&nbsp;&nbsp;手机号:{{ orderInfo.mobile }} </i-col>
</Row>
<Row>
<i-col span="24">
送货地址:{{ orderInfo.province }} {{ orderInfo.city }} {{ orderInfo.district }}
{{ orderInfo.street }}
</i-col>
</Row>
<Row>
<i-col span="24">详细地址:{{ orderInfo.address }}</i-col>
</Row>
<Row>
<i-col span="24">邮政编码:{{ orderInfo.zipCode > 0 ? orderInfo.zipCode : '' }}</i-col>
</Row>
<Row>
<i-col span="24">
物流公司:
<template v-for="(item, index) in logisticsList">
<span v-if="item.id == orderInfo.expressId" :key="index">{{ item.companyName }}</span>
</template>
</i-col>
</Row>
<Row>
<i-col span="24">运单号:{{ orderInfo.expressNumber > 0 ? orderInfo.expressNumber : '' }} </i-col>
</Row>
</div>
</div>
</template>
<script>
import _ from 'lodash';
import LogisticsService from 'services/logistics/logistics-service';
export default {
name: 'OrderUserInfo',
props: ['orderInfo'],
data() {
return {
logisticsList: [],
};
},
created() {
this.LogisticsService = new LogisticsService();
this.getLogisticsList();
},
methods: {
//获取物流公司列表
getLogisticsList() {
this.LogisticsService.logisticsList().then(ret => {
this.logisticsList = _.get(ret, 'data', []);
});
},
},
};
</script>
... ...
import OrderConfig from './order';
export { OrderConfig };
... ...
export default {
//订单状态
orderStatus: {
0: '待审核',
20: '已付订金',
40: '待付尾款',
100: '已审核',
200: '备货中',
300: '调拨中',
400: '已发货',
500: '运输中',
600: '已交寄',
700: '订单完成',
900: '用户取消',
901: '客服取消',
902: '备货中取消',
903: '配货中取消',
904: '发货后取消',
905: '运输中取消',
906: '超时取消',
907: '拒收',
},
//支付状态
paymentStatus: {
0: '未支付',
1: '已支付',
2: '部分支付',
},
//费用分摊类型
feeSharingType: {
0: '未知',
1: '我司承担',
2: '供应商承担',
3: '分摊-合同结算',
4: '分摊-我司承担比例',
5: '会员营销券-阶梯折扣',
},
/**
* 退换货原因
* @var unknown
*/
returnedReasonArr: {
1: '尺寸不合适',
2: '性价比不高',
3: '不喜欢',
4: '质量瑕疵',
5: '快递延迟',
6: '发错货',
7: '商品有色差',
8: '图片与实物不符',
11: '价格变化',
12: '撤销',
13: '拒收',
14: '赠品',
},
/**
* 商家退货状态
*/
returnedGoodsShopStatus: {
0: '待商家审核售后申请',
11: '待买家寄回商品',
12: '待商家同意退款',
24: '退款中',
30: '已退款',
90: '已撤销',
},
};
... ...
export default [
{
path: 'step1.html',
name: 'step1',
component: () => import(/* webpackChunkName: "product.create" */ './step1'),
meta: {
pageName: '确认订单信息',
},
},
{
path: 'step2.html',
name: 'step2',
component: () => import(/* webpackChunkName: "product.create" */ './step2'),
meta: {
pageName: '确认发货/退货地址信息',
},
},
{
path: 'step3.html',
name: 'step3',
component: () => import(/* webpackChunkName: "product.create" */ './step3'),
meta: {
pageName: '选择物流服务',
},
},
];
... ...
<template>
<div>
<Row>
<order-goods-info
:table-data="tableData"
:coupons-data="couponsData"
:goods-promos="goodsPromos"
:order-info="orderInfo"
:order-promos="orderPromos"
>
</order-goods-info>
</Row>
<i-button type="primary" @click="nextStep(orderCode)">下一步</i-button>
</div>
</template>
<script>
import { orderGoodsInfo } from '../../components';
import OrderService from 'services/order/order-service';
import _ from 'lodash';
export default {
components: { orderGoodsInfo },
props: ['current', 'orderCode', 'orderInfo'],
data() {
return {
couponsData: [],
tableData: [],
goodsPromos: [],
orderPromos: [],
};
},
created() {
this.$emit('nextStep', 0);
this.orderService = new OrderService();
this.getOrderGoods();
this.getGoodsPromos();
this.getOrderCoupons();
this.getOrderPromos();
},
methods: {
nextStep(code) {
this.$router.push({
name: 'order.deliver.step2',
params: {},
query: {
orderCode: code,
},
});
},
//获取订单商品
getOrderGoods() {
this.orderService.queryOrderGoods({ orderCode: +this.orderCode }).then(ret => {
this.tableData = _.get(ret, 'data', []);
});
},
//获取订单商品促销信息
getGoodsPromos() {
this.orderService.queryOrderGoodsPromos({ orderCode: +this.orderCode }).then(ret => {
this.goodsPromos = _.get(ret, 'data', []);
});
},
//获取订单优惠券
getOrderCoupons() {
this.orderService.queryOrderCoupons({ orderCode: +this.orderCode }).then(ret => {
this.couponsData = _.get(ret, 'data', {});
_.each(this.couponsData, coupons => {
coupons['feeSharingTypeStr'] = this.feeSharingType[coupons.feeSharingType] || '无';
});
});
},
//获取订单促销信息
getOrderPromos() {
this.orderService.queryOrderPromos({ orderCode: +this.orderCode }).then(ret => {
this.orderPromos = _.get(ret, 'data', {});
});
},
},
};
</script>
... ...
<template>
<div>
<Row :gutter="16">
<i-col span="8">
<order-user-info :order-info="orderInfo"></order-user-info>
</i-col>
<i-col span="8">
<div class="ivu-card">
<div class="ivu-card-head">
<p slot="title">退货地址信息</p>
</div>
<div class="ivu-card-body">
<Row>
<i-col span="24">
{{ shopsAddressInfo.province }}
{{ shopsAddressInfo.city }}
{{ shopsAddressInfo.county }}
{{ shopsAddressInfo.street }}
</i-col>
</Row>
<Row>
<i-col span="24">{{ shopsAddressInfo.detailAdd }}</i-col>
</Row>
<Row>
<i-col span="24">{{ customerTel }}</i-col>
</Row>
</div>
</div>
</i-col>
</Row>
<Button type="primary" @click="prevStep(orderCode)">上一步</Button>
<Button type="primary" @click="nextStep(orderCode)">下一步</Button>
</div>
</template>
<script>
import { orderUserInfo } from '../../components';
import ShopService from 'services/shop/shop-service';
export default {
components: { orderUserInfo },
props: ['current', 'orderCode', 'orderInfo'],
data() {
return {
shopsAddressInfo: [],
customerTel: '',
};
},
created() {
this.shopService = new ShopService();
this.getShopInfo();
this.$emit('nextStep', 1);
},
methods: {
getShopInfo() {
this.shopService.getShop().then(res => {
const { shopsAddressInfo, customerTel } = res.data;
this.shopsAddressInfo = shopsAddressInfo;
this.customerTel = customerTel;
});
},
nextStep(code) {
this.$router.push({
name: 'order.deliver.step3',
params: {},
query: {
orderCode: code,
},
});
},
prevStep(code) {
this.$router.push({
name: 'order.deliver.step1',
params: {},
query: {
orderCode: code,
},
});
},
},
};
</script>
... ...
<template>
<div>
<Row>
<Tabs>
<Tab-pane label="自己联系物流">
<layout-filter ref="filter">
<Row>
<filter-item label="快递公司">
<Select v-model.trim="orderInfo.expressId" clearable>
<Option v-for="option in logisticsList" :key="option.id" :value="option.id">
{{ option.companyName }}
</Option>
</Select>
</filter-item>
</Row>
<Row>
<filter-item label="快递单号">
<Input v-model.trim="orderInfo.expressNumber" />
</filter-item>
</Row>
<filter-item>
<Button
type="success"
:loading="showExpressLoading"
:disabled="orderInfo.orderStatus >= 600 ? true : false"
@click="confirmExpress"
>
确认快递单
</Button>
<Button
type="primary"
:loading="showDeliverLoading"
:disabled="orderInfo.orderStatus >= 600 ? true : false"
@click="confirmDeliver"
>
确认发货
</Button>
<Button type="default" @click="cancel">取消</Button>
</filter-item>
</layout-filter>
</Tab-pane>
<Tab-pane label="无需物流">
<div>虚拟商品可直接确认发货</div>
<Button
type="primary"
:loading="showNoExpressLoading"
:disabled="orderInfo.orderStatus >= 600 ? true : false"
@click="confirmDeliverNoExpress"
>
确认发货
</Button>
</Tab-pane>
<Tab-pane label="自助打单发货" disabled></Tab-pane>
</Tabs>
</Row>
</div>
</template>
<script>
import LogisticsService from 'services/logistics/logistics-service';
import OrderService from 'services/order/order-service';
import _ from 'lodash';
export default {
props: ['current', 'orderCode', 'orderInfo'],
data() {
return {
logisticsList: [],
showExpressLoading: false,
showDeliverLoading: false,
showNoExpressLoading: false,
};
},
created() {
this.LogisticsService = new LogisticsService();
this.OrderService = new OrderService();
this.$emit('nextStep', 2);
this.getLogisticsList();
},
methods: {
//获取物流公司列表
getLogisticsList() {
this.LogisticsService.logisticsList().then(ret => {
this.logisticsList = _.get(ret, 'data', []);
});
},
//确认快递
confirmExpress() {
this.showExpressLoading = true;
this.OrderService.confirmExpress({
orderCode: +this.orderCode,
expressId: +this.orderInfo.expressId,
expressNumber: this.orderInfo.expressNumber,
}).then(ret => {
this.showExpressLoading = false;
if (ret.code === 200) {
this.$Message.info(ret.message);
this.$router.go(0);
} else {
this.$Message.error(ret.message);
}
});
},
//确认发货
confirmDeliver() {
this.showDeliverLoading = true;
this.LogisticsService.proxyOutStorage({
orderCode: +this.orderCode,
expressId: +this.orderInfo.expressId,
expressNumber: this.orderInfo.expressNumber,
}).then(ret => {
if (ret.code === 200) {
this.$Message.info(ret.message);
this.$router.go(0);
} else {
this.$Message.error(ret.message);
}
});
},
//确认发货无需物流
confirmDeliverNoExpress() {
this.LogisticsService.proxyOutStorage({}).then(ret => {
if (ret.code === 200) {
this.$Message.info(ret.message);
} else {
this.$Message.error(ret.message);
}
});
},
//取消操作
cancel() {
this.$router.push({
name: 'order.detail',
params: {},
query: {
orderCode: this.orderCode,
},
});
},
},
};
</script>
... ...
<template>
<div>
<Row>
<Steps :current="current">
<Step title="确认订单信息"></Step>
<Step title="确认发货/退货地址信息"></Step>
<Step title="选择物流服务"></Step>
</Steps>
</Row>
<Row class="deliver-step">
<router-view :current="current" :order-code="orderCode" :order-info="orderInfo" @nextStep="nextStep">
</router-view>
</Row>
</div>
</template>
<script>
import OrderService from 'services/order/order-service';
import _ from 'lodash';
export default {
data() {
return {
orderCode: this.$route.query.orderCode,
current: 0,
orderInfo: [],
};
},
created() {
this.orderService = new OrderService();
this.getOrderInfo();
},
methods: {
nextStep(step) {
this.current = step;
},
//获取订单详情
getOrderInfo() {
this.orderService.orderDetail({ orderCode: +this.orderCode }).then(ret => {
this.orderInfo = _.get(ret, 'data', []);
});
},
},
};
</script>
<style lang="scss">
.deliver-step {
padding: 20px;
button {
margin-top: 20px;
}
}
</style>
... ...
import childrenViews from './components';
export default {
path: '/deliver',
name: 'deliver',
children: childrenViews,
component: () => import(/* webpackChunkName: "order.deliver" */ './deliver'),
meta: {},
};
... ...
<template>
<div class="ivu-row">
<div class="ivu-card">
<div class="ivu-card-head">
<p slot="title" style="height: 35px">
当前订单状态:{{ orderStatus[orderInfo.orderStatus] }}
<template v-if="orderInfo.orderStatus >= 100 && orderInfo.orderStatus < 600">
<i-button size="large" type="success" style="margin-left: 50px;" @click="deliver(orderCode)">发货</i-button>
</template>
</p>
</div>
<div class="ivu-card-body">
若订单一直未发货,买家会有投诉风险,建议您及时点击发货 查看未发货超时规则 <br />
若买家存在恶意购买行为,您可以联系平台处理
</div>
</div>
<order-base-info :order-info="orderInfo" :order-status="orderStatus"></order-base-info>
<order-user-info :order-info="orderInfo"></order-user-info>
<div class="ivu-card">
<div class="ivu-card-head">
<p slot="title">商品信息</p>
</div>
<div class="ivu-card-body">
<order-goods-info
:table-data="tableData"
:coupons-data="couponsData"
:goods-promos="goodsPromos"
:order-info="orderInfo"
:order-promos="orderPromos"
>
</order-goods-info>
</div>
</div>
</div>
</template>
<script>
import { orderGoodsInfo, orderUserInfo, orderBaseInfo } from '../components';
import { OrderConfig } from '../configs';
import OrderService from 'services/order/order-service';
import _ from 'lodash';
export default {
components: { orderGoodsInfo, orderUserInfo, orderBaseInfo },
data() {
return {
orderCode: this.$route.query.orderCode,
orderStatus: OrderConfig.orderStatus,
feeSharingType: OrderConfig.feeSharingType,
orderInfo: [],
couponsData: [],
tableData: [],
goodsPromos: [],
orderPromos: [],
};
},
created() {
this.orderService = new OrderService();
this.getOrderInfo();
this.getOrderGoods();
this.getGoodsPromos();
this.getOrderCoupons();
this.getOrderPromos();
},
methods: {
deliver(code) {
this.$router.push({
name: 'order.deliver.step1',
params: {},
query: {
orderCode: code,
},
});
},
//获取订单详情
getOrderInfo() {
this.orderService.orderDetail({ orderCode: +this.orderCode }).then(ret => {
this.orderInfo = _.get(ret, 'data', []);
});
},
//获取订单商品
getOrderGoods() {
this.orderService.queryOrderGoods({ orderCode: +this.orderCode }).then(ret => {
this.tableData = _.get(ret, 'data', []);
});
},
//获取订单商品促销信息
getGoodsPromos() {
this.orderService.queryOrderGoodsPromos({ orderCode: +this.orderCode }).then(ret => {
this.goodsPromos = _.get(ret, 'data', []);
});
},
//获取订单优惠券
getOrderCoupons() {
this.orderService.queryOrderCoupons({ orderCode: +this.orderCode }).then(ret => {
this.couponsData = _.get(ret, 'data', {});
_.each(this.couponsData, coupons => {
coupons['feeSharingTypeStr'] = this.feeSharingType[coupons.feeSharingType] || '无';
});
});
},
//获取订单促销信息
getOrderPromos() {
this.orderService.queryOrderPromos({ orderCode: +this.orderCode }).then(ret => {
this.orderPromos = _.get(ret, 'data', {});
});
},
},
};
</script>
<style lang="scss"></style>
... ...
export default {
path: '/detail.html',
name: 'detail',
component: () => import(/* webpackChunkName: "order.detail" */ './detail'),
meta: {
pageName: '订单详情',
},
};
... ...
import list from './list';
import detail from './detail';
import deliver from './deliver';
import returned from './returened';
export default { list, detail, deliver, returned };
... ...
<template>
<table cellspacing="0" cellpadding="0" class="order-table">
<thead>
<tr>
<template v-for="(cols, index) in tableCols">
<th :key="index" :style="'width: ' + cols.width">{{ cols.title }}</th>
</template>
</tr>
</thead>
<tbody>
<template v-for="(item, tindex) in tableData">
<tr :key="tindex">
<td colspan="12" style="text-align: left">
<span>订单号:{{ item.orderCode }}</span>
<span>父订单号:{{ item.parentOrderCode }}</span>
<span>创建时间:{{ item.createTime | timeFormat }}</span>
</td>
</tr>
<template v-for="(goods, gindex) in item.goodsList">
<tr :key="tindex + '_' + gindex">
<td>
<img
:src="
'http://shopmanage.yohobuy.com/platform/product/getRemoteImageUrlBySku?sku_id=' +
goods.productSku +
'&size=40x60'
"
/>
</td>
<td style="text-align: left">
<p>{{ goods.productName }}</p>
<p>尺码:{{ goods.sizeName }} 颜色:{{ goods.colorName }}</p>
</td>
<td>{{ goods.salePrice }}</td>
<td>{{ goods.buyNumber }}</td>
<td>{{ goods.productSkn }}</td>
<td>{{ goods.productSku }}</td>
<template v-if="gindex == 0">
<td :rowspan="item.goodsList.length">{{ item.consigneeName }}</td>
<td :rowspan="item.goodsList.length">{{ paymentStatusArr[item.paymentStatus] }}</td>
<td :rowspan="item.goodsList.length">{{ item.lastOrderAmount }}</td>
<td :rowspan="item.goodsList.length">{{ orderStatusArr[item.orderStatus] }}</td>
<td :rowspan="item.goodsList.length">
<i-button type="default" size="small" @click="goToDetail(item.orderCode)">查看订单</i-button>
</td>
</template>
</tr>
</template>
</template>
</tbody>
</table>
</template>
<script>
export default {
name: 'DataTable',
props: {
tableData: {
type: Array,
},
paymentStatusArr: {
type: Object,
},
orderStatusArr: {
type: Object,
},
},
data() {
return {
tableCols: [
{ title: '图片', width: '8%' },
{ title: '商品信息', width: '20%' },
{ title: '单价', width: '8%' },
{ title: '数量', width: '5%' },
{ title: 'SKN', width: '5%' },
{ title: 'SKU', width: '5%' },
{ title: '收货人', width: '5%' },
{ title: '支付状态', width: '5%' },
{ title: '实收金额', width: '5%' },
{ title: '订单状态', width: '5%' },
{ title: '操作', width: '10%' },
],
};
},
methods: {
goToDetail(code) {
this.$router.push({
name: 'order.detail',
params: {},
query: {
orderCode: code,
},
});
},
},
};
</script>
<style lang="scss">
table.order-table {
width: 100%;
height: auto;
thead {
background: #000000;
th {
padding: 8px 0;
border: 1px solid #cccccc;
color: #ffffff;
text-align: center;
}
}
tbody {
tr {
height: 35px;
td {
border: 1px solid #cccccc;
border-top: none;
border-right: none;
text-align: center;
padding: 5px;
span {
margin-left: 10px;
margin-right: 20px;
}
}
td:last-child {
border-right: 1px solid #cccccc;
}
}
}
}
</style>
... ...
import ListTabs from './list-tabs';
import DataTable from './data-table';
export { ListTabs, DataTable };
... ...
<template>
<layout-tab>
<Tabs :value="activate" :animated="false" @on-click="switchTab">
<Tab-pane :label="tab1.label" :name="tab1.name"></Tab-pane>
<Tab-pane :label="tab2.label" :name="tab2.name"></Tab-pane>
<Tab-pane :label="tab3.label" :name="tab3.name"></Tab-pane>
<Tab-pane :label="tab4.label" :name="tab4.name"></Tab-pane>
</Tabs>
</layout-tab>
</template>
<script>
export default {
name: 'ListTabs',
data() {
return {
tab1: {
label: '全部订单',
name: '0',
},
tab2: {
label: '待发货订单',
name: '1',
},
tab3: {
label: '已发货订单',
name: '2',
},
tab4: {
label: '已完成订单',
name: '3',
},
activate: '',
};
},
methods: {
switchTab(type) {
this.$emit('change-tabs', type);
},
},
};
</script>
... ...
export default {
path: '/list.html',
name: 'list',
component: () => import(/* webpackChunkName: "order.list" */ './list'),
meta: {
pageName: '一件代发订单管理',
},
};
... ...
<template>
<layout-body>
<layout-filter ref="filter" :model="query">
<filter-item label="订单号">
<Input v-model.trim="query.orderCode" />
</filter-item>
<filter-item label="SKN">
<Input v-model.trim="query.productSkn" />
</filter-item>
<filter-item label="SKU">
<Input v-model.trim="query.productSku" />
</filter-item>
<filter-item label="收货人">
<Input v-model.trim="query.consigneeName" />
</filter-item>
<filter-item label="商品名称">
<Input v-model.trim="query.productName" />
</filter-item>
<filter-item label="订单状态">
<Select v-model.trim="query.orderStatus" clearable>
<Option v-for="(option, key) in orderStatusArr" :key="key" :value="key">
{{ option }}
</Option>
</Select>
</filter-item>
<filter-item>
<Button type="primary" @click="search">筛选</Button>
<Button @click="reset">全部</Button>
<Button type="success" @click="exportData">导出</Button>
</filter-item>
</layout-filter>
<layout-list>
<list-tabs @change-tabs="onChangeTabs"></list-tabs>
<data-table :table-data="tableData" :payment-status-arr="paymentStatusArr" :order-status-arr="orderStatusArr">
</data-table>
<Page :total="pageData.total" :current="pageData.current" :page-size="20" show-total @on-change="pageChange">
</Page>
</layout-list>
</layout-body>
</template>
<script>
import { ListTabs, DataTable } from './components';
import { OrderService } from 'services/order';
import _ from 'lodash';
import { OrderConfig } from '../configs';
import qs from 'querystringify';
export default {
components: { ListTabs, DataTable },
data() {
return {
paymentStatusArr: OrderConfig.paymentStatus,
query: {
orderCode: '',
productSkn: '',
productSku: '',
prodName: '',
consigneeName: '',
orderStatus: '',
pageSize: 20,
pageNo: 1,
orderStatusStr: '',
orderStatusType: 0,
},
tableData: [],
orderStatusArr: OrderConfig.orderStatus,
pageData: {
total: 0,
current: 1,
},
};
},
created() {
this.orderService = new OrderService();
this.search();
},
methods: {
onChangeTabs(type) {
this.query.orderStatusType = +type;
this.reset();
},
search() {
this.orderService.orderList(this.query).then(ret => {
this.tableData = _.get(ret, 'data.records', []);
this.pageData.total = _.get(ret, 'data.totalCount', 0);
this.pageData.pageNo = _.get(ret, 'data.pageNo', 1);
});
},
pageChange(page) {
this.pageData.current = page;
this.query.pageNo = page;
this.search();
},
reset() {
this.query.orderCode = '';
this.query.productSkn = '';
this.query.productSku = '';
this.query.prodName = '';
this.query.nickName = '';
this.query.userName = '';
this.query.orderStatus = '';
this.query.pageSize = 20;
this.query.pageNo = 1;
this.search();
},
exportData() {
const querystring = qs.stringify(this.query, true);
const href = `${OrderService.exportOrdersByStatus}${querystring}`;
window.open(href, '_blank');
},
},
};
</script>
<style lang="scss">
table.order-table {
width: 100%;
height: auto;
thead {
background: #000000;
th {
padding: 8px 0;
border: 1px solid #cccccc;
color: #ffffff;
text-align: center;
}
}
tbody {
tr {
height: 35px;
td {
border: 1px solid #cccccc;
border-top: none;
border-right: none;
text-align: center;
padding: 5px;
span {
margin-left: 10px;
margin-right: 20px;
}
}
td:last-child {
border-right: 1px solid #cccccc;
}
}
}
}
</style>
... ...
import ReturnedListTable from './returned-list-table';
import ReturnedGoodsInfo from './returned-goods-info';
import ModalReject from './modal-reject';
export { ReturnedListTable, ReturnedGoodsInfo, ModalReject };
... ...
<template>
<Modal v-model="showModal" :title="title" width="600">
<div class="deliver-modal">
<div class="deliver-info">
<Row class-name="info-row">
<Col span="5" class-name="info-col">拒绝原因*:</Col>
<Col span="19">
<Select v-model="rejectReason">
<Option v-for="(item, idx) in refuseReasonList" :key="idx" :value="item.id">
{{ item.reason }}
</Option>
</Select>
</Col>
</Row>
</div>
</div>
<div slot="footer">
<Button type="text" size="large" @click="hide">取消</Button>
<Button type="primary" size="large" :loading="showLoading" @click="submit()">提交</Button>
</div>
</Modal>
</template>
<script>
export default {
name: 'ModalReject',
data() {
return {
rejectReason: 0,
title: '商家驳回售后申请',
showModal: false,
showLoading: false,
refuseReasonList: [],
};
},
methods: {
show(refuseReasonList) {
this.showModal = true;
this.refuseReasonList = refuseReasonList;
},
hide() {
this.showLoading = false;
this.showModal = false;
},
//提交
submit() {
this.showLoading = true;
this.$emit('submitReject', this.rejectReason);
},
},
};
</script>
<style lang="scss">
.deliver-modal {
padding: 30px;
.info-row {
line-height: 40px;
}
.info-tip {
margin-top: 20px;
color: #f00;
text-align: center;
}
.ivu-modal {
width: 50%;
}
}
</style>
... ...
<template>
<div class="ivu-card">
<div class="ivu-card-head">
<h3>退款商品信息</h3>
</div>
<div class="ivu-card-body">
<table cellspacing="0" cellpadding="0" class="order-detail">
<thead>
<tr>
<template v-for="(cols, index) in tableCols">
<th :key="index" :style="'width: ' + cols.width">{{ cols.title }}</th>
</template>
</tr>
</thead>
<tbody>
<template v-for="(goods, index) in tableData">
<tr :key="index">
<td>{{ goods.productSku }}</td>
<td><img :src="goods.imageUrl" /></td>
<td style="text-align: left">
<p>{{ goods.productName }}</p>
<p>尺码:{{ goods.sizeName }} 颜色:{{ goods.colorName }}</p>
</td>
<td>1</td>
<td>{{ goods.lastPrice }}</td>
<td>{{ goods.couponsDiscountAmount }}</td>
<td>{{ goods.yohoCoin }}</td>
<td>{{ goods.redPackage }}</td>
<td>{{ goods.giftCardAmount }}</td>
<td>{{ goods.activityDiscount }}</td>
<td>{{ returnedReason[goods.returnedReason] }}</td>
</tr>
<tr v-if="goods.mark || goods.imperfectImage" :key="index + '_1'">
<td colspan="14">
<span v-if="goods.mark">买家备注:{{ goods.mark }}</span>
<Row>
<template v-for="(img, imgIndex) in goods.imperfectImage">
<img :key="imgIndex" :src="img.imageUrl" />
</template>
</Row>
</td>
</tr>
</template>
</tbody>
</table>
</div>
</div>
</template>
<script>
export default {
name: 'ReturnedGoodsInfo',
props: ['tableData', 'returnedReason'],
data() {
return {
tableCols: [
{ title: 'sku', width: '8%' },
{ title: '商品图片', width: '8%' },
{ title: '商品信息', width: '10%' },
{ title: '数量', width: '6%' },
{ title: '成交价', width: '6%' },
{ title: '优惠券', width: '6%' },
{ title: 'YOHO币', width: '6%' },
{ title: '红包', width: '6%' },
{ title: '礼品卡', width: '6%' },
{ title: '活动优惠', width: '6%' },
{ title: '退款原因', width: '6%' },
],
};
},
};
</script>
<style lang="scss">
table.order-detail {
width: 100%;
height: auto;
thead {
th {
padding: 8px 0;
border: 1px solid #cccccc;
text-align: center;
}
}
tfoot,
tbody {
tr {
height: 35px;
td {
border: 1px solid #cccccc;
border-top: none;
border-right: none;
text-align: center;
padding: 5px;
span {
margin-left: 10px;
margin-right: 20px;
}
}
td:last-child {
border-right: 1px solid #cccccc;
}
}
}
}
</style>
... ...
<template>
<table cellspacing="0" cellpadding="0" class="order-table">
<thead>
<tr>
<template v-for="(cols, index) in tableCols">
<th :key="index" :style="'width:' + cols.width">{{ cols.title }}</th>
</template>
</tr>
</thead>
<tbody>
<template v-for="(item, index) in tableData">
<tr :key="index">
<td colspan="12" style="text-align: left">
<span>订单号:{{ item.orderCode }}</span>
<span>父订单号:{{ item.parentOrderCode }}</span>
<span>创建时间:{{ item.createTime }}</span>
</td>
</tr>
<template v-for="(goods, key) in item.returnedGoodsListBoArray">
<tr :key="index + '_' + key">
<td>
<img
:src="
'http://shopmanage.yohobuy.com/platform/product/getRemoteImageUrlBySku?sku_id=' +
goods.productSku +
'&size=40x60'
"
/>
</td>
<td style="text-align: left">
<p>{{ goods.productName }}</p>
<p>尺码:{{ goods.sizeName }} 颜色:{{ goods.colorName }}</p>
</td>
<td>{{ goods.lastPrice }}</td>
<td>{{ goods.productSkn }}</td>
<td>{{ goods.productSku }}</td>
<template v-if="key == 0">
<td :rowspan="item.returnedGoodsListBoArray.length">{{ item.consigneeName }}</td>
<td :rowspan="item.returnedGoodsListBoArray.length">{{ item.realReturnedAmount }}</td>
<td :rowspan="item.returnedGoodsListBoArray.length">退货</td>
<td :rowspan="item.returnedGoodsListBoArray.length">{{ shopStatus[item.shopStatus] || '无' }}</td>
<td :rowspan="item.returnedGoodsListBoArray.length">
<i-button type="default" size="small" @click="goToDetail(item.id, item.orderCode)">查看订单</i-button>
<i-button type="primary" size="small" @click="goToHandle(item.id, item.orderCode)">处理</i-button>
</td>
</template>
</tr>
</template>
</template>
</tbody>
</table>
</template>
<script>
export default {
name: 'ReturnedListTable',
props: ['tableData', 'shopStatus'],
data() {
return {
tableCols: [
{ title: '图片', width: '8%' },
{ title: '商品信息', width: '20%' },
{ title: '单价', width: '8%' },
{ title: 'SKN', width: '5%' },
{ title: 'SKU', width: '5%' },
{ title: '收货人', width: '5%' },
{ title: '退款金额', width: '5%' },
{ title: '售后类型', width: '5%' },
{ title: '退款状态', width: '5%' },
{ title: '操作', width: '10%' },
],
};
},
methods: {
goToDetail(operateId, code) {
this.$router.push({
name: 'order.returned.detail',
params: {},
query: {
id: operateId,
orderCode: code,
},
});
},
goToHandle(operateId, code) {
this.$router.push({
name: 'order.returned.operate',
params: {},
query: {
id: operateId,
orderCode: code,
},
});
},
},
};
</script>
<style lang="scss">
table.order-table {
width: 100%;
height: auto;
thead {
background: #000000;
th {
padding: 8px 0;
border: 1px solid #cccccc;
color: #ffffff;
text-align: center;
}
}
tbody {
tr {
height: 35px;
td {
border: 1px solid #cccccc;
border-top: none;
border-right: none;
text-align: center;
padding: 5px;
span {
margin-left: 10px;
margin-right: 20px;
}
}
td:last-child {
border-right: 1px solid #cccccc;
}
}
}
}
</style>
... ...
export default [
{
path: '/detail.html',
name: 'detail',
component: () => import(/* webpackChunkName: "order.detail" */ './views/detail'),
meta: {
pageName: '退货申请详情',
},
},
{
path: '/list.html',
name: 'list',
component: () => import(/* webpackChunkName: "order.detail" */ './views/list'),
meta: {
pageName: '退货申请详情',
},
},
{
path: '/operate.html',
name: 'operate',
component: () => import(/* webpackChunkName: "order.detail" */ './views/operate'),
meta: {
pageName: '退货申请详情',
},
},
];
... ...
<template>
<div class="ivu-row">
<div class="ivu-card">
<div class="ivu-card-head">
<p slot="title" style="height: 35px">
当前订单状态:{{ orderStatus[orderInfo.orderStatus] }}
<i-button size="large" type="success" style="margin-left: 50px;" @click="goToHandle(id, orderCode)">
去处理
</i-button>
</p>
</div>
</div>
<order-base-info :order-info="orderInfo" :order-status="orderStatus"></order-base-info>
<order-user-info :order-info="orderInfo"></order-user-info>
<div class="ivu-card">
<div class="ivu-card-head">
<p slot="title">商品信息</p>
</div>
<div class="ivu-card-body">
<order-goods-info
:table-data="tableData"
:coupons-data="couponsData"
:goods-promos="goodsPromos"
:order-info="orderInfo"
:order-promos="orderPromos"
>
</order-goods-info>
</div>
</div>
</div>
</template>
<script>
import { orderGoodsInfo, orderUserInfo, orderBaseInfo } from '../../components';
import { OrderConfig } from '../../configs';
import OrderService from 'services/order/order-service';
import _ from 'lodash';
export default {
components: { orderBaseInfo, orderGoodsInfo, orderUserInfo },
data() {
return {
orderCode: this.$route.query.orderCode,
id: this.$route.query.id,
orderStatus: OrderConfig.orderStatus,
feeSharingType: OrderConfig.feeSharingType,
orderInfo: [],
couponsData: [],
tableData: [],
goodsPromos: [],
orderPromos: [],
};
},
created() {
this.orderService = new OrderService();
this.getOrderInfo();
this.getOrderGoods();
this.getGoodsPromos();
this.getOrderCoupons();
this.getOrderPromos();
},
methods: {
goToHandle(operateId, code) {
this.$router.push({
name: 'order.returned.operate',
params: {},
query: {
id: operateId,
orderCode: code,
},
});
},
//获取订单详情
getOrderInfo() {
this.orderService.orderDetail({ orderCode: +this.orderCode }).then(ret => {
this.orderInfo = _.get(ret, 'data', []);
});
},
//获取订单商品
getOrderGoods() {
this.orderService.queryOrderGoods({ orderCode: +this.orderCode }).then(ret => {
this.tableData = _.get(ret, 'data', []);
});
},
//获取订单商品促销信息
getGoodsPromos() {
this.orderService.queryOrderGoodsPromos({ orderCode: +this.orderCode }).then(ret => {
this.goodsPromos = _.get(ret, 'data', []);
});
},
//获取订单优惠券
getOrderCoupons() {
this.orderService.queryOrderCoupons({ orderCode: +this.orderCode }).then(ret => {
this.couponsData = _.get(ret, 'data', {});
_.each(this.couponsData, coupons => {
coupons['feeSharingTypeStr'] = this.feeSharingType[coupons.feeSharingType] || '无';
});
});
},
//获取订单促销信息
getOrderPromos() {
this.orderService.queryOrderPromos({ orderCode: +this.orderCode }).then(ret => {
this.orderPromos = _.get(ret, 'data', {});
});
},
},
};
</script>
<style lang="scss"></style>
... ...
<template>
<layout-body>
<layout-filter ref="filter" :model="query">
<filter-item label="订单号">
<Input v-model.trim="query.orderCode" />
</filter-item>
<filter-item label="SKN">
<Input v-model.trim="query.productSkn" />
</filter-item>
<filter-item label="SKU">
<Input v-model.trim="query.productSku" />
</filter-item>
<filter-item label="收货人">
<Input v-model.trim="query.userName" />
</filter-item>
<filter-item label="商品名称">
<Input v-model.trim="query.prodName" />
</filter-item>
<filter-item label="售后状态">
<Select v-model.trim="query.shopStatus">
<Option :key="-1" value="-1">全部</Option>
<Option v-for="(option, key) in returnedGoodsShopStatus" :key="key" :value="key">
{{ option }}
</Option>
</Select>
</filter-item>
<filter-item>
<Button type="primary" @click="search">筛选</Button>
<Button @click="reset">清空条件</Button>
</filter-item>
</layout-filter>
<layout-list>
<returned-list-table :table-data="tableData" :shop-status="returnedGoodsShopStatus"></returned-list-table>
<Page :total="pageData.total" :current="pageData.current" :page-size="20" show-total @on-change="pageChange">
</Page>
</layout-list>
</layout-body>
</template>
<script>
import { ReturnedListTable } from '../components';
import { ReturnedService } from 'services/order';
import { OrderConfig } from 'pages/order/configs';
import _ from 'lodash';
export default {
components: { ReturnedListTable },
data() {
return {
paymentStatusArr: OrderConfig.paymentStatus,
query: {
orderCode: '',
productSkn: '',
productSku: '',
prodName: '',
nickName: '',
userName: '',
pageSize: 20,
pageNo: 1,
queryType: 1,
shopStatus: '-1',
},
returnedGoodsShopStatus: OrderConfig.returnedGoodsShopStatus,
pageData: {
total: 0,
current: 1,
},
tableData: [],
};
},
created() {
this.ReturnedService = new ReturnedService();
this.search();
},
methods: {
search() {
this.query.shopStatus = this.query.shopStatus >= 0 ? +this.query.shopStatus : '-1';
this.ReturnedService.queryReturnedOrderList(this.query).then(ret => {
this.tableData = _.get(ret, 'data.records', []);
this.pageData.total = _.get(ret, 'data.totalCount', 0);
this.pageData.pageNo = _.get(ret, 'data.pageNo', 1);
});
},
pageChange(page) {
this.pageData.current = page;
this.query.pageNo = page;
this.search();
},
reset() {
this.query.orderCode = '';
this.query.productSkn = '';
this.query.productSku = '';
this.query.prodName = '';
this.query.nickName = '';
this.query.userName = '';
this.query.orderStatus = 0;
this.query.pageSize = 20;
this.query.pageNo = 1;
this.query.orderStatusStr = '';
this.search();
},
},
};
</script>
<style lang="scss">
table.order-table {
width: 100%;
height: auto;
thead {
background: #000000;
th {
padding: 8px 0;
border: 1px solid #cccccc;
color: #ffffff;
text-align: center;
}
}
tbody {
tr {
height: 35px;
td {
border: 1px solid #cccccc;
border-top: none;
border-right: none;
text-align: center;
padding: 5px;
span {
margin-left: 10px;
margin-right: 20px;
}
}
td:last-child {
border-right: 1px solid #cccccc;
}
}
}
}
</style>
... ...
<template>
<div class="ivu-row">
<div class="ivu-card">
<div class="ivu-card-head">
<h3>退货申请处理</h3>
</div>
<div class="ivu-card-body">
{{ returnedGoodsShopStatus[returnedInfo.status] }}
<Row>
<i-col span="4">退货ID:{{ id }}</i-col>
<i-col span="4">退款申请时间:{{ returnedInfo.createTime | timeFormat }}</i-col>
<i-col span="4">退货状态:{{ returnedGoodsShopStatus[returnedInfo.status] }}</i-col>
</Row>
<Row>
<i-col span="4">退款总金额:{{ returnedInfo.realReturnedAmount }}</i-col>
<i-col span="4">
退款成功时间:<span v-if="returnedInfo.refundTime">{{ returnedInfo.refundTime | timeFormat }}</span>
</i-col>
</Row>
</div>
</div>
<!--订单基本信息-->
<order-base-info :order-info="orderInfo" :order-status="orderStatus"></order-base-info>
<!--退货商品信息-->
<returned-goods-info :table-data="returnGoods" :returned-reason="returnedReasonArr"></returned-goods-info>
<div class="ivu-card">
<div class="ivu-card-head">
<h3>寄回物流信息</h3>
</div>
<div class="ivu-card-body">
<Row>
<i-col span="24">
物流公司:
<template v-for="(item, index) in logisticsList">
<span v-if="item.id == orderInfo.expressId" :key="index">{{ item.companyName }}</span>
</template>
</i-col>
</Row>
<Row>
<i-col span="24">运单号:{{ orderInfo.expressNumber }}</i-col>
</Row>
</div>
</div>
<div class="ivu-card">
<div class="ivu-card-body">
<p class="red">若您同意退货,待买家寄回后,将退款给买家,若有异议请与平台联系</p>
<p class="red">若您未响应申请,视作同意退货</p>
<p class="red">若您不同意退货可点击驳回,若买家向平台投诉,如核实是您的责任,将会影响店铺评分</p>
<p class="red">-若您同意退款,将直接退款给买家</p>
<p class="red">-若您逾期未响应,视作同意退款,系统将自动打款给买家</p>
<br />
<template v-if="returnedInfo.status === 0">
<i-button type="info" @click="pass()">同意</i-button>
</template>
<template v-if="returnedInfo.status < 20">
<i-button type="error" @click="showRejectModal()">驳回</i-button>
</template>
<template v-if="returnedInfo.status === 10">
<i-button type="info" @click="submitRefund">同意退款</i-button>
</template>
</div>
</div>
<modal-reject ref="showReject" :show="showReject" @submitReject="submitReject"></modal-reject>
</div>
</template>
<script>
import { ReturnedGoodsInfo, ModalReject } from '../components';
import { ReturnedService, OrderService } from 'services/order';
import { LogisticsService } from 'services/logistics';
import { orderBaseInfo } from '../../components';
import { OrderConfig } from '../../configs';
import _ from 'lodash';
export default {
components: { ReturnedGoodsInfo, ModalReject, orderBaseInfo },
data() {
return {
orderInfo: [],
orderStatus: OrderConfig.orderStatus,
showReject: false,
orderCode: this.$route.query.orderCode,
id: this.$route.query.id,
couponsData: [],
returnGoods: [],
refuseReasonList: [],
returnedReasonArr: OrderConfig.returnedReasonArr,
returnedInfo: [],
logisticsList: [],
expressName: '',
expressId: 0,
returnedGoodsShopStatus: OrderConfig.returnedGoodsShopStatus,
};
},
created() {
this.returnedService = new ReturnedService();
this.orderService = new OrderService();
this.logisticsService = new LogisticsService();
this.getOrderInfo();
this.getReturnedGoods();
this.getRefuseReason();
this.getReturnedInfo();
this.getLogisticsList();
},
methods: {
//获取申请单详情
getReturnedInfo() {
this.returnedService.getReturnedInfo({ id: +this.id }).then(ret => {
this.returnedInfo = _.get(ret, 'data', []);
});
},
//获取订单详情
getOrderInfo() {
this.orderService.orderDetail({ orderCode: +this.orderCode }).then(ret => {
this.orderInfo = _.get(ret, 'data', []);
});
},
//弹出驳回框
showRejectModal() {
this.$refs.showReject.show(this.refuseReasonList);
},
// 提交审核驳回
submitReject(refuseReasonId) {
this.returnedService.returnedReject({ id: +this.id, refuseReason: refuseReasonId }).then(ret => {
if (ret.code === 200) {
this.$Message.info(ret.message);
this.$router.go(0);
} else {
this.$Message.error(ret.message);
}
});
},
//获取退货申请的商品
getReturnedGoods() {
this.returnedService.queryReturnedGoods({ returnRequestId: this.id }).then(ret => {
this.returnGoods = _.get(ret, 'data', []);
});
},
//审核通过
pass() {
const _this = this;
this.$Modal.confirm({
title: '同意退货申请',
content: `你确定同意退货申请吗?`,
onOk() {
_this.returnedService.returnedGoodsAudit({ id: this.id }).then(ret => {
if (ret.code === 200) {
this.$Message.info(ret.message);
this.$router.go(0);
} else {
this.$Message.error(ret.message);
}
});
},
});
},
//获取物流公司列表
getLogisticsList() {
this.logisticsService.logisticsList().then(ret => {
this.logisticsList = _.get(ret, 'data', []);
});
},
//获取驳回原因
getRefuseReason() {
this.returnedService.queryRefuseReason({}).then(ret => {
this.refuseReasonList = _.get(ret, 'data', []);
});
},
//同意退款
submitRefund() {
const _this = this;
this.$Modal.confirm({
title: '退款',
content: `你确定 同意退款吗?`,
onOk() {
_this.logisticsService.proxyReturnedGoodsInstorage({ requestId: +_this.id }).then(ret => {
if (ret.code === 200) {
this.$Message.info(ret.message);
this.$router.go(0);
} else {
this.$Message.error(ret.message);
}
});
},
});
},
},
};
</script>
<style lang="scss">
.red {
color: red;
}
</style>
... ...
import Service from '../service';
const apiUrl = {
shopTransportFeeList: '/platform/shopTransportFeeList',
addOrUpdateShopTransportFee: '/platform/addOrUpdateShopTransportFee',
getShopTransportFeeDetailById: '/platform/getShopTransportFeeDetailById',
deleteShopTransportFee: '/platform/deleteShopTransportFee',
selectDefaultShopTransportFee: '/platform/selectDefaultShopTransportFee',
};
class FreightService extends Service {
/**
* 获取运费魔板列表
* @param params
* @return {*}
*/
getShopTransportFeeList() {
return this.post(apiUrl.shopTransportFeeList);
}
/**
* 新增或者修改运费模板
* @return {*}
*/
addOrUpdateShopTransportFee(params) {
return this.post(apiUrl.addOrUpdateShopTransportFee, params);
}
/**
* 查看模板详情
* @param params
*/
getShopTransportFeeDetailById(params) {
return this.post(apiUrl.getShopTransportFeeDetailById, params);
}
/**
* 删除运费模板
* @param params
*/
deleteShopTransportFee(params) {
return this.post(apiUrl.deleteShopTransportFee, params);
}
/**
* 选中默认的运费模板
* @param params
*/
selectDefaultShopTransportFee(params) {
return this.post(apiUrl.selectDefaultShopTransportFee, params);
}
}
export default FreightService;
... ...
import LogisticsService from './logistics-service';
import FreightService from './freight-service';
export { LogisticsService, FreightService };
... ...
import Service from '../service';
const apiUrl = {
queryLogisticsList: '/erp/queryLogisticsList',
proxyOutStorage: '/erp/proxyOutStorage',
proxyReturnedGoodsInstorage: '/erp/proxyReturnedGoodsInstorage',
};
class LogisticsService extends Service {
/**
* 获取物流公司列表
* @param params
* @return {*}
*/
logisticsList() {
return this.post(apiUrl.queryLogisticsList);
}
/**
* 订单发货
*/
proxyOutStorage(params) {
return this.post(apiUrl.proxyOutStorage, params);
}
/**
* 一件代发退货入库(同意退款)
*/
proxyReturnedGoodsInstorage(params) {
return this.post(apiUrl.proxyReturnedGoodsInstorage, params);
}
}
export default LogisticsService;
... ...
import OrderService from './order-service';
import ReturnedService from './returned-service';
export { OrderService, ReturnedService };
... ...
import Service from '../service';
const apiUrl = {
orderList: '/erp/orderList',
orderDetail: '/erp/orderDetail',
orderGoods: '/erp/queryOrderGoods',
orderGoodsPromos: '/erp/queryOrderGoodsPromos',
orderCoupons: '/erp/queryOrderCoupons',
orderPromos: '/erp/queryOrderPromos',
confirmExpress: '/erp/confirmExpress',
};
class OrderService extends Service {
/**
* 订单列表
* @param params
* @return {*}
*/
orderList(params) {
return this.post(apiUrl.orderList, params);
}
/**
* 订单详情
* @param params
* @return {*}
*/
orderDetail(params) {
return this.post(apiUrl.orderDetail, params);
}
/**
* 根据订单号获取订单商品
* @param params
*/
queryOrderGoods(params) {
return this.post(apiUrl.orderGoods, params);
}
/**
* 获取订单商品的促销
* @param params
*/
queryOrderGoodsPromos(params) {
return this.post(apiUrl.orderGoodsPromos, params);
}
/**
* 获取订单的优惠券信息
* @param parmas
* @return {*}
*/
queryOrderCoupons(parmas) {
return this.post(apiUrl.orderCoupons, parmas);
}
/**
* 获取订单促销
* @param parmas
*/
queryOrderPromos(params) {
return this.post(apiUrl.orderPromos, params);
}
/**
* 订单确认物流信息
* @param params
*/
confirmExpress(params) {
return this.post(apiUrl.confirmExpress, params);
}
}
OrderService.exportOrdersByStatus = '/Api/erp/exportOrdersByStatus';
export default OrderService;
... ...
import Service from '../service';
const apiUrl = {
shopReturnedList: '/erp/shopReturnedList',
returnedDetail: '/erp/returnedDetail',
queryReturnedGoods: '/erp/queryReturnedGoods',
returnedGoodsAudit: '/erp/returnedGoodsAudit',
queryRefuseReason: '/erp/queryRefuseReason',
returnedReject: '/erp/returnedReject',
getReturnedInfo: '/erp/getReturnedInfo',
};
class ReturnedService extends Service {
/**
* 退货申请详情
* @param params
* @return {*}
*/
queryReturnedDetail(params) {
return this.post(apiUrl.returnedDetail, params);
}
/**
* 退货申请列表
* @param params
* @return {*}
*/
queryReturnedOrderList(params) {
return this.post(apiUrl.shopReturnedList, params);
}
/**
* 获取退货商品列表
* @param params
*/
queryReturnedGoods(params) {
return this.post(apiUrl.queryReturnedGoods, params);
}
/**
* 审核通过
* @param params
* @return {*}
*/
returnedGoodsAudit(params) {
return this.post(apiUrl.returnedGoodsAudit, params);
}
/**
* 获取驳回原因
* @param parmas
* @constructor
*/
queryRefuseReason(params) {
return this.post(apiUrl.queryRefuseReason, params);
}
/**
* 退货审核驳回
* @param params
*/
returnedReject(params) {
return this.post(apiUrl.returnedReject, params);
}
/**
* 获取退货申请详情
* @param params
*/
getReturnedInfo(params) {
return this.post(apiUrl.getReturnedInfo, params);
}
}
export default ReturnedService;
... ...
{
"name": "yoho-shop-manage",
"version": "1.1.15",
"version": "6.9.24-beta2",
"description": "",
"main": "app.js",
"scripts": {
... ...
... ... @@ -92,6 +92,30 @@ const domainApis = {
exportFavoriteClearingDetail: '/erp-gateway-web/export/favoriteClearingDetail',
exportFavoriteBalanceDetail: '/erp-gateway-web/export/exportFavoriteBalanceDetail',
//订单管理
orderList: '/erp-gateway-web/shop/orders/queryPageOrdersByStatus', //订单列表
orderDetail: '/erp-gateway-web/shop/orders/queryOrdersDetail', //订单详情
queryOrderGoods: '/erp-gateway-web/shop/orders/queryOrdersGoodsAndPrice', //获取订单商品
queryOrderGoodsPromos: '/erp-gateway-web/cs/order/goodspromos/query', //获取订单商品的促销
queryOrderCoupons: '/erp-gateway-web/cs/order/coupons', //获取订单优惠券
queryOrderPromos: '/erp-gateway-web/cs/order/promotions', //获取订单促销
confirmExpress: '/erp-gateway-web/shop/orders/ordersUpdateExpress', //订单确认物流
exportOrdersByStatus: '/erp-gateway-web/shop/export/exportOrdersByStatus', //导出订单列表
//物流接口
queryLogisticsList: '/erp-gateway-web/logistics_company/list', //获取物流公司列表
proxyOutStorage: '/erp-gateway-web/outStorageV2/proxyOutStorage', //发货
proxyReturnedGoodsInstorage: '/erp-gateway-web/inStorageV2/proxyReturnedGoodsInstorage',
//退货
shopReturnedList: '/erp-gateway-web/shop/returnedGoods/queryPage', //退货申请列表
returnedDetail: '/erp-gateway-web/cs/return/orderSummary',
queryReturnedGoods: '/erp-gateway-web/cs/return/goods',
returnedGoodsAudit: '/erp-gateway-web/shop/returnedGoods/returnedGoodsAudit',
queryRefuseReason: '/erp-gateway-web/cs/refuseReason/queryAll',
returnedReject: '/erp-gateway-web/shop/returnedGoods/returnedGoodsReject',
getReturnedInfo: '/erp-gateway-web/shop/returnedGoods/queryById',
// 提现申请管理
shopWithdrawList: '/erp-gateway-web/shop/withdraw/list', //资金操作明细列表
shopWithdrawApplyById: '/erp-gateway-web/shop/withdraw/applyById', //资金操作明细-提现明细
... ... @@ -159,6 +183,13 @@ const domainApis = {
queryBrandsByShopId: '/SellerShopsBrandsController/queryBrandsByShopId', // 根据店铺Id获取品牌列表下拉框数据
queryProductInvoicingOverview: '/merchant/queryProductInvoicingOverview', // 商家进销存报表查询
exportProductInvoicingOverview: '/merchant/exportProductInvoicingOverview', // 商家进销存报表导出
//运费
shopTransportFeeList: '/ShopTransportFeeController/getShopTransportFeeList', //店铺运费列表
addOrUpdateShopTransportFee: '/ShopTransportFeeController/addOrUpdateShopTransportFee', //新增或者修改运费模板
getShopTransportFeeDetailById: '/ShopTransportFeeController/getShopTransportFeeDetailById', //查看详情
deleteShopTransportFee: '/ShopTransportFeeController/deleteShopTransportFee', //删除运费模板
selectDefaultShopTransportFee: '/ShopTransportFeeController/selectDefaultShopTransportFee', //选中默认的运费模板
},
shop: {
login: '/loginInter',
... ...