|
|
|
@ -1,29 +1,77 @@ |
|
|
|
<style lang="less"> |
|
|
|
@import "@/styles/table-common.less"; |
|
|
|
@import "./orderManage.less"; |
|
|
|
|
|
|
|
.refund-goods-row { |
|
|
|
display: flex; |
|
|
|
align-items: center; |
|
|
|
padding: 10px 0; |
|
|
|
border-bottom: 1px solid #eee; |
|
|
|
} |
|
|
|
|
|
|
|
.refund-goods-name { |
|
|
|
flex: 1; |
|
|
|
} |
|
|
|
|
|
|
|
.refund-goods-num { |
|
|
|
width: 80px; |
|
|
|
text-align: center; |
|
|
|
} |
|
|
|
|
|
|
|
.refund-goods-price { |
|
|
|
width: 100px; |
|
|
|
text-align: right; |
|
|
|
} |
|
|
|
|
|
|
|
.refund-goods-empty { |
|
|
|
padding: 30px 0; |
|
|
|
color: #999; |
|
|
|
text-align: center; |
|
|
|
} |
|
|
|
|
|
|
|
.group-order-card { |
|
|
|
margin-bottom: 12px; |
|
|
|
padding: 12px; |
|
|
|
border: 1px solid #eee; |
|
|
|
border-radius: 6px; |
|
|
|
} |
|
|
|
|
|
|
|
.group-order-head, |
|
|
|
.group-order-row, |
|
|
|
.group-goods-row { |
|
|
|
display: flex; |
|
|
|
align-items: center; |
|
|
|
padding: 6px 0; |
|
|
|
} |
|
|
|
|
|
|
|
.group-order-code { |
|
|
|
flex: 1; |
|
|
|
font-weight: 700; |
|
|
|
} |
|
|
|
|
|
|
|
.group-order-status { |
|
|
|
color: #ff6b35; |
|
|
|
font-weight: 700; |
|
|
|
} |
|
|
|
|
|
|
|
.group-order-row span:first-child { |
|
|
|
width: 80px; |
|
|
|
color: #777; |
|
|
|
} |
|
|
|
|
|
|
|
.group-order-fee { |
|
|
|
padding-top: 8px; |
|
|
|
text-align: right; |
|
|
|
} |
|
|
|
</style> |
|
|
|
<template> |
|
|
|
<div class="search"> |
|
|
|
<Card> |
|
|
|
<Tabs v-model="tabName" :animated="false" @on-click="changeOrderTab"> |
|
|
|
<TabPane label="饭团订单" name="1"></TabPane> |
|
|
|
<TabPane label="快递订单" name="2"></TabPane> |
|
|
|
<TabPane label="跑腿订单" name="3"></TabPane> |
|
|
|
<TabPane v-for="item in orderTypeTabs" :key="item.name" :label="getOrderTypeTabLabel(item)" :name="item.name"></TabPane> |
|
|
|
</Tabs> |
|
|
|
<Tabs v-model="tabName1" :animated="false" @on-click="changeTab"> |
|
|
|
<TabPane label="全部" name="10"></TabPane> |
|
|
|
<TabPane label="待支付" name="0"></TabPane> |
|
|
|
<TabPane label="待成团" name="1"></TabPane> |
|
|
|
<TabPane label="待消费" name="2"></TabPane> |
|
|
|
<TabPane label="待接单" name="3"></TabPane> |
|
|
|
<TabPane label="待出餐" name="13"></TabPane> |
|
|
|
<TabPane label="待取货" name="4"></TabPane> |
|
|
|
<TabPane label="待送达" name="5"></TabPane> |
|
|
|
<TabPane label="已完成" name="6"></TabPane> |
|
|
|
<TabPane label="待退款/售后" name="11"></TabPane> |
|
|
|
<TabPane label="已退款" name="8"></TabPane> |
|
|
|
<TabPane label="已取消" name="9"></TabPane> |
|
|
|
<TabPane label="已售后" name="12"></TabPane> |
|
|
|
<Tabs v-if="!isRefundTab" v-model="tabName1" :animated="false" @on-click="changeTab"> |
|
|
|
<TabPane v-for="item in currentStatusTabs" :key="item.name" :label="item.label" :name="item.name"></TabPane> |
|
|
|
</Tabs> |
|
|
|
<Row v-show="openSearch" @keydown.enter.native="handleSearch"> |
|
|
|
<Form ref="searchForm" :model="searchForm" inline :label-width="100"> |
|
|
|
@ -70,30 +118,80 @@ |
|
|
|
<span class="select-count">{{ selectList.length }}</span> 项 |
|
|
|
<a class="select-clear" @click="clearSelectAll">清空</a> |
|
|
|
</Alert> |
|
|
|
<Table :loading="loading" border :columns="columns" :data="data" :size="tableSize" sortable="custom" |
|
|
|
<Table class="order-manage-table" :loading="loading" border :columns="currentColumns" :data="data" :size="tableSize" sortable="custom" |
|
|
|
@on-sort-change="changeSort" @on-selection-change="showSelect" ref="table"></Table> |
|
|
|
<Row type="flex" justify="end" class="page"> |
|
|
|
<Page :current="searchForm.pageNum" :total="total" :page-size="searchForm.pageSize" |
|
|
|
<Page :current="currentPageNum" :total="total" :page-size="currentPageSize" |
|
|
|
@on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]" |
|
|
|
size="small" show-total show-elevator show-sizer></Page> |
|
|
|
</Row> |
|
|
|
</Card> |
|
|
|
<!-- 订单详情 --> |
|
|
|
<Modal :title="订单详情" v-model="Visiable" :mask-closable="false" :scrollabele="true" :width="1000"> |
|
|
|
<logistics-address v-if="Visiable" @closePage="changeTab(11)" ref="dialog"></logistics-address> |
|
|
|
<Modal title="订单详情" v-model="Visiable" :mask-closable="false" :scrollabele="true" :width="1000"> |
|
|
|
<logistics-address v-if="Visiable" @closePage="closePage" ref="dialog"></logistics-address> |
|
|
|
<div slot="footer" v-show="Visiable"> |
|
|
|
<Button type="text" @click="Visiable = false">关闭</Button> |
|
|
|
</div> |
|
|
|
</Modal> |
|
|
|
|
|
|
|
<addEdit :data="form" :type="showType" v-model="showOrder" @on-submit="getLogisticsInfo" /> |
|
|
|
<Modal title="拒绝原因" v-model="rejectModalVisible" :mask-closable="false" :width="520"> |
|
|
|
<Input type="textarea" v-model="rejectReason" :rows="4" maxlength="100" show-word-limit placeholder="请输入拒绝原因" /> |
|
|
|
<div slot="footer"> |
|
|
|
<Button @click="closeRejectModal">取消</Button> |
|
|
|
<Button type="primary" :loading="submitLoading" @click="confirmReject">确认拒绝</Button> |
|
|
|
</div> |
|
|
|
</Modal> |
|
|
|
<Modal title="商品详情" v-model="refundGoodsVisible" :mask-closable="false" :width="680"> |
|
|
|
<div v-if="refundGoodsList.length > 0"> |
|
|
|
<div class="refund-goods-row" v-for="(item,index) in refundGoodsList" :key="index"> |
|
|
|
<div class="refund-goods-name">{{ item.productName }}</div> |
|
|
|
<div class="refund-goods-num">X{{ item.quantity }}</div> |
|
|
|
<div class="refund-goods-price">¥{{ item.price }}</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div v-else class="refund-goods-empty">暂无商品详情</div> |
|
|
|
<div slot="footer"> |
|
|
|
<Button type="primary" @click="refundGoodsVisible = false">关闭</Button> |
|
|
|
</div> |
|
|
|
</Modal> |
|
|
|
<Modal title="拼团详情" v-model="groupOrderVisible" :mask-closable="false" :width="760"> |
|
|
|
<div v-if="groupOrderList.length > 0"> |
|
|
|
<div class="group-order-card" v-for="(item,index) in groupOrderList" :key="index"> |
|
|
|
<div class="group-order-head"> |
|
|
|
<div class="group-order-code">订单-{{ item.numberCode || item.id }}</div> |
|
|
|
<div class="group-order-status">{{ getOrderStatusText(item) }}</div> |
|
|
|
</div> |
|
|
|
<div class="group-order-row"> |
|
|
|
<span>订单号</span> |
|
|
|
<span>{{ item.id }}</span> |
|
|
|
</div> |
|
|
|
<div class="group-order-row"> |
|
|
|
<span>订单时间</span> |
|
|
|
<span>{{ formatDateTime(item.createTime) }}</span> |
|
|
|
</div> |
|
|
|
<div class="group-goods-row" v-for="(goods,goodsIndex) in item.goodsList" :key="goodsIndex"> |
|
|
|
<div class="refund-goods-name">{{ goods.productName }}</div> |
|
|
|
<div class="refund-goods-num">X{{ goods.quantity }}</div> |
|
|
|
<div class="refund-goods-price">¥{{ goods.price }}</div> |
|
|
|
</div> |
|
|
|
<div class="group-order-fee">配送费:¥{{ item.deliveryFee || 0 }}</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div v-else class="refund-goods-empty">暂无拼团订单</div> |
|
|
|
<div slot="footer"> |
|
|
|
<Button type="primary" @click="groupOrderVisible = false">关闭</Button> |
|
|
|
</div> |
|
|
|
</Modal> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import { |
|
|
|
getOrderList, |
|
|
|
getReturnOrderList |
|
|
|
getReturnOrderList, |
|
|
|
returnOrNoOrder, |
|
|
|
getGroupOrdersByOrderId |
|
|
|
} from "@/api/index"; |
|
|
|
import addEdit from "./addEdit.vue"; |
|
|
|
import logisticsAddress from "@/views/sys/order-manage/logisticsAddress"; |
|
|
|
@ -112,21 +210,188 @@ |
|
|
|
openSearch: true, |
|
|
|
openTip: true, |
|
|
|
loading: true, |
|
|
|
refundTodoCount: 0, |
|
|
|
rejectModalVisible: false, |
|
|
|
rejectReason: "", |
|
|
|
rejectItem: null, |
|
|
|
submitLoading: false, |
|
|
|
submitRefundId: "", |
|
|
|
refundGoodsVisible: false, |
|
|
|
refundGoodsList: [], |
|
|
|
groupOrderVisible: false, |
|
|
|
groupOrderList: [], |
|
|
|
drop: false, |
|
|
|
dropDownContent: "展开", |
|
|
|
dropDownIcon: "ios-arrow-down", |
|
|
|
selectList: [], |
|
|
|
tabName: "1", |
|
|
|
tabName1: "10", |
|
|
|
orderTypeTabs: [{ |
|
|
|
label: "饭团订单", |
|
|
|
name: "1" |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: "快递跑腿订单", |
|
|
|
name: "2" |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: "团购订单", |
|
|
|
name: "3" |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: "二手订单", |
|
|
|
name: "4" |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: "待退款/售后", |
|
|
|
name: "refund", |
|
|
|
badge: true |
|
|
|
} |
|
|
|
], |
|
|
|
statusTabs: [{ |
|
|
|
label: "待支付", |
|
|
|
name: "0" |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: "待成团", |
|
|
|
name: "1" |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: "待消费", |
|
|
|
name: "2" |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: "待出餐", |
|
|
|
name: "13" |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: "全部", |
|
|
|
name: "10" |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: "待接单", |
|
|
|
name: "3" |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: "待取货", |
|
|
|
name: "4" |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: "待送达", |
|
|
|
name: "5" |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: "已完成", |
|
|
|
name: "6" |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: "已退款", |
|
|
|
name: "8" |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: "已取消", |
|
|
|
name: "9" |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: "售后中", |
|
|
|
name: "11" |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: "已售后", |
|
|
|
name: "12" |
|
|
|
} |
|
|
|
], |
|
|
|
groupStatusTabs: [{ |
|
|
|
label: "待支付", |
|
|
|
name: "0" |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: "待成团", |
|
|
|
name: "1" |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: "待消费", |
|
|
|
name: "2" |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: "待出餐", |
|
|
|
name: "13" |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: "全部", |
|
|
|
name: "10" |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: "已完成", |
|
|
|
name: "6" |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: "已退款", |
|
|
|
name: "8" |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: "已取消", |
|
|
|
name: "9" |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: "售后中", |
|
|
|
name: "11" |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: "已售后", |
|
|
|
name: "12" |
|
|
|
} |
|
|
|
], |
|
|
|
deliveryStatusTabs: [{ |
|
|
|
label: "待接单", |
|
|
|
name: "3" |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: "待取货", |
|
|
|
name: "4" |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: "待送达", |
|
|
|
name: "5" |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: "已完成", |
|
|
|
name: "6" |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: "已退款", |
|
|
|
name: "8" |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: "已取消", |
|
|
|
name: "9" |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: "售后中", |
|
|
|
name: "11" |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: "已售后", |
|
|
|
name: "12" |
|
|
|
} |
|
|
|
], |
|
|
|
returnForm:{ |
|
|
|
regionId: JSON.parse(this.getStore("user")).departmentId, |
|
|
|
pageNum: 1, |
|
|
|
pageSize: 10, |
|
|
|
statusList: [0, 3], |
|
|
|
}, |
|
|
|
refundCountForm:{ |
|
|
|
regionId: JSON.parse(this.getStore("user")).departmentId, |
|
|
|
pageNum: 1, |
|
|
|
pageSize: 100, |
|
|
|
statusList: [0, 3], |
|
|
|
}, |
|
|
|
searchForm: { |
|
|
|
pageNum: 1, |
|
|
|
pageSize: 10, |
|
|
|
regionId: JSON.parse(this.getStore("user")).departmentId, |
|
|
|
searchType: 1, |
|
|
|
searchType: "1", |
|
|
|
searchStatus:10, |
|
|
|
shopName: "", |
|
|
|
mobile:'', |
|
|
|
@ -178,6 +443,7 @@ |
|
|
|
{ |
|
|
|
title: "完成支付时间", |
|
|
|
key: "createTime", |
|
|
|
width: 180, |
|
|
|
align: "center", |
|
|
|
render: (h, params) => { |
|
|
|
return h( |
|
|
|
@ -196,27 +462,27 @@ |
|
|
|
if (params.row.status == 0) { |
|
|
|
re = "待支付"; |
|
|
|
} else if (params.row.status == 2) { |
|
|
|
re = "等待配送员接单"; |
|
|
|
re = "待接单"; |
|
|
|
} else if (params.row.status == 3 && params.row.deliveryType == 1) { |
|
|
|
re = "配送员已接单"; |
|
|
|
re = "待取货"; |
|
|
|
} else if (params.row.status == 3 && params.row.deliveryType == 2) { |
|
|
|
re = "待消费"; |
|
|
|
} else if (params.row.status == 4 && params.row.deliveryType == 1) { |
|
|
|
re = "配送员已取货"; |
|
|
|
} else if (params.row.status == 4) { |
|
|
|
re = "待送达"; |
|
|
|
} else if (params.row.status == 5) { |
|
|
|
re = "订单已完成"; |
|
|
|
re = "已完成"; |
|
|
|
} else if (params.row.status == 6) { |
|
|
|
re = "订单已取消"; |
|
|
|
re = "已取消"; |
|
|
|
} else if (params.row.status == 7) { |
|
|
|
re = "等待同意退款"; |
|
|
|
re = "待退款"; |
|
|
|
} else if (params.row.status == 8) { |
|
|
|
re = "订单已退款"; |
|
|
|
re = "已退款"; |
|
|
|
} else if (params.row.status == 10) { |
|
|
|
re = "待成团"; |
|
|
|
} else if (params.row.status == 11) { |
|
|
|
re = "售后中"; |
|
|
|
} else if (params.row.status == 12) { |
|
|
|
re = "订单已售后"; |
|
|
|
re = "已售后"; |
|
|
|
} |
|
|
|
return h( |
|
|
|
"div", |
|
|
|
@ -246,6 +512,184 @@ |
|
|
|
}, |
|
|
|
}, |
|
|
|
], |
|
|
|
refundColumns: [{ |
|
|
|
type: "index", |
|
|
|
width: 60, |
|
|
|
align: "center", |
|
|
|
fixed: "left", |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: "订单编号", |
|
|
|
key: "orderId", |
|
|
|
width: 190, |
|
|
|
align: "center", |
|
|
|
render: (h, params) => { |
|
|
|
const order = params.row.mallOrder || {}; |
|
|
|
return h("span", order.numberCode || params.row.orderId || ""); |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: "用户账号", |
|
|
|
width: 130, |
|
|
|
align: "center", |
|
|
|
render: (h, params) => { |
|
|
|
const order = params.row.mallOrder || {}; |
|
|
|
return h("span", order.receiverPhone || ""); |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: "店铺名称", |
|
|
|
width: 180, |
|
|
|
align: "center", |
|
|
|
render: (h, params) => { |
|
|
|
const order = params.row.mallOrder || {}; |
|
|
|
return h("span", order.shopName || ""); |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: "申请时间", |
|
|
|
key: "createTime", |
|
|
|
width: 180, |
|
|
|
align: "center", |
|
|
|
render: (h, params) => { |
|
|
|
return h("span", this.formatDateTime(params.row.createTime)); |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: "状态", |
|
|
|
key: "status", |
|
|
|
width: 110, |
|
|
|
align: "center", |
|
|
|
render: (h, params) => { |
|
|
|
return h("span", this.getRefundStatusText(params.row.status)); |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: "退款原因", |
|
|
|
key: "refundTypeStatus", |
|
|
|
width: 210, |
|
|
|
align: "center", |
|
|
|
render: (h, params) => { |
|
|
|
return h("span", this.getRefundTypeStatusText(params.row.refundTypeStatus)); |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: "退款类型", |
|
|
|
key: "refundType", |
|
|
|
width: 120, |
|
|
|
align: "center", |
|
|
|
render: (h, params) => { |
|
|
|
return h("span", this.getRefundTypeText(params.row.refundType)); |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: "退款/售后原因", |
|
|
|
key: "reason", |
|
|
|
minWidth: 220, |
|
|
|
align: "center", |
|
|
|
render: (h, params) => { |
|
|
|
return h("Tooltip", { |
|
|
|
props: { |
|
|
|
content: params.row.reason || "无", |
|
|
|
transfer: true, |
|
|
|
} |
|
|
|
}, [h("span", params.row.reason || "无")]); |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: "原因图片", |
|
|
|
key: "pictures", |
|
|
|
width: 90, |
|
|
|
align: "center", |
|
|
|
render: (h, params) => { |
|
|
|
if (this.getPictureList(params.row.pictures).length == 0) { |
|
|
|
return h("span", "无"); |
|
|
|
} |
|
|
|
return h("a", { |
|
|
|
on: { |
|
|
|
click: () => { |
|
|
|
this.previewRefundImage(params.row.pictures); |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, "查看"); |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: "退款金额", |
|
|
|
key: "refundAmount", |
|
|
|
width: 120, |
|
|
|
align: "center", |
|
|
|
render: (h, params) => { |
|
|
|
return h("span", `¥${params.row.refundAmount || 0}`); |
|
|
|
} |
|
|
|
}, |
|
|
|
{ |
|
|
|
title: "操作", |
|
|
|
key: "action", |
|
|
|
width: 390, |
|
|
|
align: "center", |
|
|
|
fixed: "right", |
|
|
|
render: (h, params) => { |
|
|
|
const order = params.row.mallOrder || {}; |
|
|
|
const actionList = [ |
|
|
|
h("a", { |
|
|
|
style: { |
|
|
|
marginRight: "8px" |
|
|
|
}, |
|
|
|
on: { |
|
|
|
click: () => { |
|
|
|
this.showRefundGoods(params.row); |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, order.otherOrder == 1 ? "快递/跑腿单" : "查看商品"), |
|
|
|
]; |
|
|
|
if (order && order.orderType != 1) { |
|
|
|
actionList.push( |
|
|
|
h("a", { |
|
|
|
style: { |
|
|
|
marginRight: "8px" |
|
|
|
}, |
|
|
|
on: { |
|
|
|
click: () => { |
|
|
|
this.getGroupOrders(order.id || params.row.orderId); |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, "拼团详情") |
|
|
|
); |
|
|
|
} |
|
|
|
actionList.push( |
|
|
|
h("a", { |
|
|
|
style: { |
|
|
|
marginRight: "8px" |
|
|
|
}, |
|
|
|
on: { |
|
|
|
click: () => { |
|
|
|
this.showOrderDetail(params.row); |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, "查看详情"), |
|
|
|
h("a", { |
|
|
|
style: { |
|
|
|
marginRight: "8px" |
|
|
|
}, |
|
|
|
on: { |
|
|
|
click: () => { |
|
|
|
this.returnAmountAllow(params.row, 0); |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, this.isSubmittingRefund(params.row) ? "处理中" : "不同意"), |
|
|
|
h("a", { |
|
|
|
on: { |
|
|
|
click: () => { |
|
|
|
this.returnAmountAllow(params.row, 1); |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, this.isSubmittingRefund(params.row) ? "处理中" : "同意"), |
|
|
|
); |
|
|
|
return h("div", actionList); |
|
|
|
}, |
|
|
|
}, |
|
|
|
], |
|
|
|
data: [], |
|
|
|
total: 0, |
|
|
|
}; |
|
|
|
@ -255,6 +699,23 @@ |
|
|
|
return this.columns.filter(function(e) { |
|
|
|
return !e.hidden; |
|
|
|
}) |
|
|
|
}, |
|
|
|
currentStatusTabs() { |
|
|
|
if (this.searchForm.searchType == "2") return this.deliveryStatusTabs; |
|
|
|
if (this.searchForm.searchType == "3" || this.searchForm.searchType == "4") return this.groupStatusTabs; |
|
|
|
return this.statusTabs; |
|
|
|
}, |
|
|
|
currentColumns() { |
|
|
|
return this.isRefundTab ? this.refundColumns : this.columns; |
|
|
|
}, |
|
|
|
isRefundTab() { |
|
|
|
return this.tabName == "refund"; |
|
|
|
}, |
|
|
|
currentPageNum() { |
|
|
|
return this.isRefundTab ? this.returnForm.pageNum : this.searchForm.pageNum; |
|
|
|
}, |
|
|
|
currentPageSize() { |
|
|
|
return this.isRefundTab ? this.returnForm.pageSize : this.searchForm.pageSize; |
|
|
|
} |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
@ -262,6 +723,7 @@ |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
init() { |
|
|
|
this.getRefundTodoCount(); |
|
|
|
this.getLogisticsInfo() |
|
|
|
}, |
|
|
|
closePage(){ |
|
|
|
@ -279,6 +741,40 @@ |
|
|
|
const seconds = String(date.getSeconds()).padStart(2, '0') |
|
|
|
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}` |
|
|
|
}, |
|
|
|
getOrderTypeTabLabel(item) { |
|
|
|
if (item.name == "refund") { |
|
|
|
return this.renderRefundTabLabel; |
|
|
|
} |
|
|
|
return item.label; |
|
|
|
}, |
|
|
|
renderRefundTabLabel(h) { |
|
|
|
return h("Badge", { |
|
|
|
props: { |
|
|
|
count: this.refundTodoCount, |
|
|
|
overflowCount: 99 |
|
|
|
} |
|
|
|
}, [ |
|
|
|
h("span", { |
|
|
|
class: "order-tab-label" |
|
|
|
}, "待退款/售后") |
|
|
|
]); |
|
|
|
}, |
|
|
|
getOrderStatusText(item) { |
|
|
|
if (!item) return ""; |
|
|
|
if (item.status == 0) return "待支付"; |
|
|
|
if (item.status == 2) return "待配送员接单"; |
|
|
|
if (item.status == 3 && item.deliveryType == 1 && item.shopMakeTime == null) return "待出餐"; |
|
|
|
if (item.status == 3 && item.deliveryType == 1 && item.shopMakeTime != null) return "待取货"; |
|
|
|
if (item.status == 3 && item.deliveryType == 2) return "待消费"; |
|
|
|
if (item.status == 4) return "待送达"; |
|
|
|
if (item.status == 5) return "已完成"; |
|
|
|
if (item.status == 7) return "待同意退款"; |
|
|
|
if (item.status == 8) return "已退款"; |
|
|
|
if (item.status == 6) return "已取消"; |
|
|
|
if (item.status == 11) return "售后中"; |
|
|
|
if (item.status == 12) return "已售后"; |
|
|
|
return ""; |
|
|
|
}, |
|
|
|
getMonth() { |
|
|
|
let date = new Date() |
|
|
|
let year = date.getFullYear().toString() //'年' |
|
|
|
@ -292,29 +788,41 @@ |
|
|
|
changeTab(v) { |
|
|
|
this.searchForm.pageNum = 1; |
|
|
|
this.searchForm.searchStatus = v; |
|
|
|
if(v == 11){ |
|
|
|
this.getReturnOrder() |
|
|
|
this.Visiable = false; |
|
|
|
}else{ |
|
|
|
this.getLogisticsInfo(); |
|
|
|
} |
|
|
|
this.getLogisticsInfo(); |
|
|
|
}, |
|
|
|
//订单状态切换1 |
|
|
|
changeOrderTab(v){ |
|
|
|
this.searchForm.pageNum = 1; |
|
|
|
this.returnForm.pageNum = 1; |
|
|
|
if (v == "refund") { |
|
|
|
this.getReturnOrder(); |
|
|
|
return; |
|
|
|
} |
|
|
|
this.searchForm.searchType = v |
|
|
|
if (!this.currentStatusTabs.some((item) => item.name == this.tabName1)) { |
|
|
|
this.tabName1 = this.currentStatusTabs[0].name; |
|
|
|
this.searchForm.searchStatus = this.tabName1; |
|
|
|
} |
|
|
|
this.getLogisticsInfo() |
|
|
|
}, |
|
|
|
checkStatus(v) { |
|
|
|
this.searchForm.orderStatus = v |
|
|
|
}, |
|
|
|
changePage(v) { |
|
|
|
this.searchForm.pageNum = v; |
|
|
|
if (this.isRefundTab) { |
|
|
|
this.returnForm.pageNum = v; |
|
|
|
} else { |
|
|
|
this.searchForm.pageNum = v; |
|
|
|
} |
|
|
|
this.getLogisticsInfo(); |
|
|
|
this.clearSelectAll(); |
|
|
|
}, |
|
|
|
changePageSize(v) { |
|
|
|
this.searchForm.pageSize = v; |
|
|
|
if (this.isRefundTab) { |
|
|
|
this.returnForm.pageSize = v; |
|
|
|
} else { |
|
|
|
this.searchForm.pageSize = v; |
|
|
|
} |
|
|
|
this.getLogisticsInfo(); |
|
|
|
}, |
|
|
|
changeTableSize(v) { |
|
|
|
@ -326,42 +834,55 @@ |
|
|
|
getReturnOrderList(this.returnForm).then((res) => { |
|
|
|
this.loading = false; |
|
|
|
if (res.success) { |
|
|
|
this.data = res.result.records |
|
|
|
for(let i=0;i<this.data.length;i++){ |
|
|
|
if(this.data[i].status == 0){ |
|
|
|
this.data[i].status = 7 |
|
|
|
}else if(this.data[i].status == 3){ |
|
|
|
this.data[i].status = 11 |
|
|
|
} |
|
|
|
this.data[i].receiverPhone = this.data[i].mallOrder.receiverPhone |
|
|
|
this.data[i].shopName = this.data[i].mallOrder.shopName |
|
|
|
this.data[i].totalAmount = this.data[i].mallOrder.totalAmount |
|
|
|
} |
|
|
|
|
|
|
|
this.data = res.result.records || []; |
|
|
|
this.total = res.result.total; |
|
|
|
this.refundTodoCount = res.result.total; |
|
|
|
} |
|
|
|
}).catch(() => { |
|
|
|
this.loading = false; |
|
|
|
}); |
|
|
|
}, |
|
|
|
getRefundTodoCount() { |
|
|
|
getReturnOrderList(this.refundCountForm).then((res) => { |
|
|
|
if (res.success && res.result) { |
|
|
|
this.refundTodoCount = res.result.total || (res.result.records || []).length; |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
//查询订单 |
|
|
|
getLogisticsInfo() { |
|
|
|
if (this.isRefundTab) { |
|
|
|
this.getReturnOrder(); |
|
|
|
return; |
|
|
|
} |
|
|
|
this.loading = true; |
|
|
|
getOrderList(this.searchForm).then((res) => { |
|
|
|
this.loading = false; |
|
|
|
if (res.success) { |
|
|
|
this.data = res.result.records |
|
|
|
this.total = res.result.total; |
|
|
|
} |
|
|
|
}).catch(() => { |
|
|
|
this.loading = false; |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
handleSearch() { |
|
|
|
this.searchForm.pageNum = 1; |
|
|
|
this.searchForm.pageSize = 10; |
|
|
|
if (this.isRefundTab) { |
|
|
|
this.returnForm.pageNum = 1; |
|
|
|
this.returnForm.pageSize = 10; |
|
|
|
} else { |
|
|
|
this.searchForm.pageNum = 1; |
|
|
|
this.searchForm.pageSize = 10; |
|
|
|
} |
|
|
|
this.getLogisticsInfo(); |
|
|
|
}, |
|
|
|
handleReset() { |
|
|
|
this.$refs.searchForm.resetFields(); |
|
|
|
this.searchForm.pageNum = 1; |
|
|
|
this.searchForm.pageSize = 10; |
|
|
|
this.returnForm.pageNum = 1; |
|
|
|
this.returnForm.pageSize = 10; |
|
|
|
// 重新加载数据 |
|
|
|
this.getLogisticsInfo(); |
|
|
|
}, |
|
|
|
@ -375,7 +896,6 @@ |
|
|
|
}, |
|
|
|
|
|
|
|
showDetail(v) { |
|
|
|
console.log('急啊急啊急啊就',v) |
|
|
|
// 转换null为"" |
|
|
|
for (let attr in v) { |
|
|
|
if (v[attr] == null) { |
|
|
|
@ -389,6 +909,132 @@ |
|
|
|
this.$refs.dialog.initRecharge(data); |
|
|
|
}); |
|
|
|
}, |
|
|
|
showOrderDetail(row) { |
|
|
|
const order = row.mallOrder || {}; |
|
|
|
this.showDetail({ |
|
|
|
id: row.orderId, |
|
|
|
shopId: order.shopId || row.shopId || "", |
|
|
|
status: "", |
|
|
|
}); |
|
|
|
}, |
|
|
|
getRefundStatusText(status) { |
|
|
|
return status == 0 ? "待退款" : status == 3 ? "待售后" : ""; |
|
|
|
}, |
|
|
|
getRefundTypeStatusText(status) { |
|
|
|
if (status == 1) return "商家原因"; |
|
|
|
if (status == 2) return "配送原因"; |
|
|
|
if (status == 3) return "商家/配送都有原因(需要退配送费)"; |
|
|
|
if (status == 4) return "平台退款"; |
|
|
|
return ""; |
|
|
|
}, |
|
|
|
getRefundTypeText(type) { |
|
|
|
if (type == 1) return "退商品"; |
|
|
|
if (type == 2) return "退配送费"; |
|
|
|
if (type == 3) return "全额退款"; |
|
|
|
return ""; |
|
|
|
}, |
|
|
|
getPictureList(pictures) { |
|
|
|
if (pictures == null || pictures === "") return []; |
|
|
|
if (Array.isArray(pictures)) { |
|
|
|
return pictures.filter((item) => item != null && item !== ""); |
|
|
|
} |
|
|
|
return String(pictures).split(",").map((item) => item.trim()).filter((item) => item !== ""); |
|
|
|
}, |
|
|
|
previewRefundImage(pictures) { |
|
|
|
const list = this.getPictureList(pictures); |
|
|
|
if (list.length == 0) return; |
|
|
|
window.open(list[0], "_blank"); |
|
|
|
}, |
|
|
|
showRefundGoods(row) { |
|
|
|
this.refundGoodsList = row.items || []; |
|
|
|
this.refundGoodsVisible = true; |
|
|
|
}, |
|
|
|
getGroupOrders(id) { |
|
|
|
if (!id) return; |
|
|
|
getGroupOrdersByOrderId(id).then((res) => { |
|
|
|
if (res.success) { |
|
|
|
this.groupOrderList = res.result || []; |
|
|
|
this.groupOrderVisible = true; |
|
|
|
} else { |
|
|
|
this.$Message.error(res.message || "查询拼团详情失败"); |
|
|
|
} |
|
|
|
}); |
|
|
|
}, |
|
|
|
returnAmountAllow(item, status) { |
|
|
|
if (this.submitLoading) return; |
|
|
|
if (status == 0) { |
|
|
|
this.rejectItem = item; |
|
|
|
this.rejectReason = ""; |
|
|
|
this.rejectModalVisible = true; |
|
|
|
return; |
|
|
|
} |
|
|
|
this.submitReturnAmountAllow(item, status); |
|
|
|
}, |
|
|
|
closeRejectModal() { |
|
|
|
this.rejectModalVisible = false; |
|
|
|
this.rejectReason = ""; |
|
|
|
this.rejectItem = null; |
|
|
|
}, |
|
|
|
confirmReject() { |
|
|
|
const reason = (this.rejectReason || "").trim(); |
|
|
|
if (reason == "") { |
|
|
|
this.$Message.warning("请输入拒绝原因"); |
|
|
|
return; |
|
|
|
} |
|
|
|
this.rejectModalVisible = false; |
|
|
|
this.submitReturnAmountAllow(this.rejectItem, 0, reason); |
|
|
|
}, |
|
|
|
submitReturnAmountAllow(item, status, rejectReason) { |
|
|
|
let titleText = status == 1 ? "确定同意该申请吗?" : "确定拒绝该申请吗?"; |
|
|
|
this.$Modal.confirm({ |
|
|
|
title: "提示", |
|
|
|
content: titleText, |
|
|
|
onOk: () => { |
|
|
|
this.processReturn(item, status, rejectReason); |
|
|
|
}, |
|
|
|
}); |
|
|
|
}, |
|
|
|
processReturn(item, status, rejectReason) { |
|
|
|
if (!item) return; |
|
|
|
const order = item.mallOrder || {}; |
|
|
|
const returnFormData = { |
|
|
|
id: item.id, |
|
|
|
orderId: item.orderId, |
|
|
|
deliveryType: order.deliveryType, |
|
|
|
orderType: order.orderType, |
|
|
|
refundAmount: item.refundAmount, |
|
|
|
refundType: item.refundType, |
|
|
|
refundTypeStatus: item.refundTypeStatus, |
|
|
|
}; |
|
|
|
if (item.status == 0) { |
|
|
|
returnFormData.status = status == 0 ? 2 : 1; |
|
|
|
} else if (item.status == 3) { |
|
|
|
returnFormData.status = status == 0 ? 5 : 4; |
|
|
|
} |
|
|
|
if (status == 0) { |
|
|
|
returnFormData.rejectReason = rejectReason; |
|
|
|
} |
|
|
|
this.submitLoading = true; |
|
|
|
this.submitRefundId = item.id; |
|
|
|
returnOrNoOrder(returnFormData).then((res) => { |
|
|
|
this.submitLoading = false; |
|
|
|
this.submitRefundId = ""; |
|
|
|
if (res.success) { |
|
|
|
this.$Message.success(res.message || "处理成功"); |
|
|
|
this.getReturnOrder(); |
|
|
|
this.getRefundTodoCount(); |
|
|
|
} else { |
|
|
|
this.$Message.error(res.message || "处理失败"); |
|
|
|
} |
|
|
|
}).catch((err) => { |
|
|
|
this.submitLoading = false; |
|
|
|
this.submitRefundId = ""; |
|
|
|
this.$Message.error((err && err.message) || "处理失败"); |
|
|
|
}); |
|
|
|
}, |
|
|
|
isSubmittingRefund(item) { |
|
|
|
return this.submitLoading && item && this.submitRefundId == item.id; |
|
|
|
}, |
|
|
|
dropDown() { |
|
|
|
if (this.drop) { |
|
|
|
this.dropDownContent = "展开"; |
|
|
|
|