wangfukang 4 weeks ago
parent
commit
46daba3449
  1. 24
      src/api/index.js
  2. 7
      src/views/app/business/courier/courier.less
  3. 154
      src/views/app/business/courier/courier.vue
  4. 1151
      src/views/app/business/logistics/logistics.vue
  5. 236
      src/views/app/business/recharge/logisticsAddress.vue
  6. 162
      src/views/app/business/recharge/recharge.vue
  7. 165
      src/views/app/shopArea/shopArea.vue
  8. 16
      src/views/my-components/hiver/shopArea-tree-choose.vue
  9. 9
      src/views/sys/order-manage/orderManage.less
  10. 756
      src/views/sys/order-manage/orderManage.vue

24
src/api/index.js

@ -684,13 +684,18 @@ export const getWorkerListData = (params) => {
return postBodyRequest('/worker/getByCondition', params)
}
// 获取匹配配送员
export const getMatchingWorkerListData = (params) => {
return postBodyRequest('/worker/getMatchingWorkerList', params)
}
// 创建订单
export const addWorker = (params) => {
return postRequest('/worker/admin/add', params)
}
// 编辑订单
export const editWorker = (params) => {
return postRequest('/worker/admin/edit', params)
return postBodyRequest('/worker/admin/edit', params)
}
// 删除订单
@ -717,6 +722,11 @@ export const offLineWorker = (params) => {
return postRequest(`/worker/offLine`, params)
}
// 查询配送员接单规则
export const getWorkerRelaPriceByWorkerId = (params) => {
return getRequest('/app/workerRelaPrice/getByWorkerId', params)
}
// 解绑订单操作
export const unbindOrder = (id, params) => {
return postRequest(`/order/unbind/order/${id}`, params)
@ -731,6 +741,10 @@ export const runshOrder = (params) => {
export const getOrderDetail = (id,params) => {
return getRequest(`/mall/order/detail/${id}`, params)
}
// 拼团详情
export const getGroupOrdersByOrderId = (id, params) => {
return getRequest(`/mall/order/selectAllOrderByOrderId/${id}`, params)
}
// 售后订单详情
export const getReturnOrderList = (params) => {
return postBodyRequest('/mall/refund/page', params)
@ -741,6 +755,10 @@ export const getReturnOrderList = (params) => {
export const getOwListData = (params) => {
return postBodyRequest('/mall/delivery/page', params)
}
// 后台抢单大厅查询(直查数据库)
export const getAdminDeliveryHallData = (params) => {
return postBodyRequest('/mall/delivery/admin/page', params)
}
// 获取订单
export const getOrderList = (params) => {
return postBodyRequest('/mall/order/page', params)
@ -749,6 +767,10 @@ export const getOrderList = (params) => {
export const orderScheduling = (params) => {
return postBodyRequest('/mall/delivery/pagebyworker', params)
}
// 后台订单调度查询(直查数据库)
export const orderSchedulingAdmin = (params) => {
return postBodyRequest('/mall/delivery/admin/pagebyworker', params)
}
// 查询区域配送时长
export const getDeliveryTimeSetting = (params) => {
return getRequest('/mall/admin/seckillGroup/deliveryTime/get', params)

7
src/views/app/business/courier/courier.less

@ -0,0 +1,7 @@
.rule-info {
display: flex;
flex-wrap: wrap;
gap: 12px 24px;
margin-bottom: 16px;
line-height: 24px;
}

154
src/views/app/business/courier/courier.vue

@ -7,19 +7,23 @@
<Card>
<Row v-show="openSearch" @keydown.enter.native="handleSearch">
<Form ref="searchForm" :model="searchForm" inline :label-width="100">
<FormItem label="配送员名称" prop="WorkerName">
<FormItem label="配送员名称" prop="workerName">
<Input type="text" v-model="searchForm.workerName" clearable placeholder="请输入配送员名称"
style="width: 200px" />
</FormItem>
<FormItem label="手机号" prop="mobile">
<Input type="text" v-model="searchForm.mobile" clearable placeholder="请输入手机号"
style="width: 200px" />
</FormItem>
<FormItem label="上线状态" prop="isOnLine">
<Select ref="dep" @on-change="checkStatusLine" style="width:200px">
<Select ref="lineStatusSelect" v-model="searchForm.isOnLine" clearable style="width:200px">
<Option v-for="(item, i) in dictDataLine" :key="i" :value="item.value">{{
item.title
}}</Option>
</Select>
</FormItem>
<FormItem label="是否接指派单" prop="getPushOrder">
<Select ref="dep" @on-change="checkStatus" style="width:210px">
<Select ref="pushOrderSelect" v-model="searchForm.getPushOrder" clearable style="width:210px">
<Option v-for="(item, i) in dictData" :key="i" :value="item.value">{{
item.title
}}</Option>
@ -67,12 +71,25 @@
size="small" show-total show-elevator show-sizer></Page>
</Row>
</Card>
<Modal :title="查看评论" v-model="Visiable" :mask-closable="false" :scrollabele="true" :width="1200">
<Modal title="查看评论" v-model="Visiable" :mask-closable="false" :scrollabele="true" :width="1200">
<logistics-address v-if="Visiable" ref="dialog"></logistics-address>
<div slot="footer" v-show=Visiable>
<Button type="text" @click="Visiable = false">关闭</Button>
</div>
</Modal>
<Modal title="接单规则" v-model="ruleVisible" :mask-closable="false" :width="1000">
<div class="rule-info">
<span>配送员{{ ruleInfo.workerName || '-' }}</span>
<span>手机号{{ ruleInfo.mobile || '-' }}</span>
<span>是否接指派{{ formatPushOrder(ruleInfo.getPushOrder) }}</span>
<span>3楼以上额外费用{{ ruleInfo.highFloorFee || 0 }} </span>
<span>送达地点{{ formatDeliveryLocation(ruleInfo.deliveryLocation) }}</span>
</div>
<Table :loading="ruleLoading" border :columns="ruleColumns" :data="ruleData" :size="tableSize"></Table>
<div slot="footer">
<Button type="text" @click="ruleVisible = false">关闭</Button>
</div>
</Modal>
<addEdit :data="form" :type="showType" v-model="showWorker" @on-submit="getDataList" />
</div>
</template>
@ -85,6 +102,7 @@
deleteWorker,
offLineWorker,
onLineWorker,
getWorkerRelaPriceByWorkerId,
} from "@/api/index";
import {
shortcuts
@ -124,6 +142,8 @@
Visiable: false,
importLoading: false,
loadingExport: true,
ruleVisible: false,
ruleLoading: false,
exportModalVisible: false,
importModalVisible: false,
drop: false,
@ -146,11 +166,14 @@
searchForm: {
region:JSON.parse(this.getStore("user")).departmentId,
workerName:'',
mobile:'',
isOnLine:'', //0线1线
getPushOrder:'', //0 1
pageNum: 1,
pageSize: 10
},
ruleInfo: {},
ruleData: [],
selectDate: null,
options: {
shortcuts: shortcuts,
@ -316,36 +339,46 @@
{
title: "操作",
key: "action",
width: 170,
width: 260,
align: "center",
fixed: "right",
render: (h, params) => {
let enableOrDisable = "";
if (params.row.workerStatus == 1) {
if (params.row.workerStatus == 3) {
enableOrDisable = h(
"a", {
on: {
click: () => {
this.disable(params.row);
this.enable(params.row);
},
},
},
"禁用"
"恢复"
);
} else {
enableOrDisable = h(
"a", {
on: {
click: () => {
this.enable(params.row);
this.disable(params.row);
},
},
},
"恢复"
"禁用"
);
}
let onOrOffLine = "";
if (params.row.isOnLine == 1) {
if (params.row.workerStatus == 3) {
onOrOffLine = h(
"span",
{
style: {
color: "#c5c8ce",
},
},
"已禁用"
);
} else if (params.row.isOnLine == 1) {
onOrOffLine = h(
"a", {
on: {
@ -415,7 +448,7 @@
"a", {
on: {
click: () => {
this.remove(params.row);
this.viewWorkerRules(params.row);
},
},
},
@ -426,6 +459,45 @@
},
],
exportColumns: exportColumn,
ruleColumns: [
{
type: "index",
width: 60,
align: "center",
},
{
title: "接单类型",
key: "orderType",
minWidth: 100,
render: (h, params) => h("span", this.formatOrderType(params.row.orderType)),
},
{
title: "取货区域",
key: "getAreaName",
minWidth: 160,
},
{
title: "送货区域",
key: "putAreaName",
minWidth: 160,
},
{
title: "配送佣金(元)",
key: "orderBkge",
minWidth: 130,
},
{
title: "是否接指派",
key: "getPushOrder",
minWidth: 120,
render: (h, params) => h("span", this.formatPushOrder(params.row.getPushOrder)),
},
{
title: "备注",
key: "remark",
minWidth: 180,
},
],
chooseColumns: [],
filename: "配送员数据",
exportTitle: "确认导出",
@ -459,9 +531,6 @@
this.searchForm.pageSize = v;
this.getDataList();
},
checkStatusLine(v){
this.searchForm.isOnLine = v
},
showPic(v) {
let image = new Image();
image.src = v;
@ -472,9 +541,6 @@
});
viewer.show();
},
checkStatus(v){
this.searchForm.getPushOrder = v
},
selectDateRange(v) {
if (v) {
this.searchForm.startDate = v[0];
@ -513,13 +579,12 @@
},
handleReset() {
this.$refs.searchForm.resetFields();
this.searchForm.region = JSON.parse(this.getStore("user")).departmentId;
this.searchForm.pageNum = 1;
this.searchForm.pageSize = 10;
this.selectDate = null;
this.searchForm.startDate = "";
this.searchForm.endDate = "";
this.$refs.dep.clearSelect();
this.searchForm.departmentId = "";
//
this.getDataList();
},
@ -579,19 +644,54 @@
this.showWorker = true;
},
edit(v) {
this.$Message.warning("暂未开放");return
// null""
for (let attr in v) {
if (v[attr] == null) {
v[attr] = "";
}
}
let str = JSON.stringify(v);
let data = JSON.parse(str);
this.form = data;
this.showType = "1";
this.showWorker = true;
},
viewWorkerRules(v) {
this.ruleVisible = true;
this.ruleLoading = true;
this.ruleInfo = {};
this.ruleData = [];
getWorkerRelaPriceByWorkerId({
workerId: v.workerId
}).then((res) => {
this.ruleLoading = false;
if (res.success) {
this.ruleInfo = res.result || {};
this.ruleData = this.ruleInfo.workerRelaPriceList || [];
}
});
},
formatOrderType(v) {
if (v == 0) {
return "外卖";
}
if (v == 1) {
return "快递";
}
return "-";
},
formatPushOrder(v) {
if (v == 1) {
return "接指派";
}
if (v == 0) {
return "不接";
}
return "-";
},
formatDeliveryLocation(v) {
if (v == 0) {
return "送上楼";
}
if (v == 1) {
return "送到宿舍门口";
}
return "-";
},
enable(v) {
this.$Modal.confirm({
title: "确认恢复",

1151
src/views/app/business/logistics/logistics.vue

File diff suppressed because it is too large

236
src/views/app/business/recharge/logisticsAddress.vue

@ -1,49 +1,88 @@
<template>
<div style="max-height:600px;overflow: scroll;scrollbar-width: none;">
<div class="search" v-for="(item,index) in orderData" :key="index">
<div style="font-size: 24px;font-weight: 700;padding: 10px;">订单{{index + 1}}</div>
<div style="display: flex;">
<div class="waiceng">
<div class="title">订单信息</div>
<div>订单编号{{item.numberCode}}</div>
<div>支付订单编号{{'ORDER'+item.id}}</div>
<div>创建时间{{item.createTime | formatDateTime}}</div>
</div>
<div class="waiceng">
<div class="title">用户信息</div>
<div>收货人<span class="blue-color">{{item.receiverName}}</span></div>
<div>收货电话<span class="blue-color">{{item.receiverPhone}}</span></div>
<div>收货地址<span class="blue-color">{{item.receiverAddress}}</span></div>
</div>
<div class="waiceng">
<div class="title">店铺信息</div>
<div>店铺名称<span class="blue-color">{{item.shopName}}</span></div>
<div>店铺电话<span class="blue-color">{{item.shopPhone}}</span></div>
<div>配送方式 <span class="blue-color">{{item.deliveryType == 1?'配送':'不配送'}}</span></div>
<div class="group-detail">
<Spin fix v-if="loading"></Spin>
<div class="group-card" v-if="groupData">
<div class="detail-title">拼团信息</div>
<div class="info-grid">
<div>拼团编号<span class="blue-color">{{groupData.id || '-'}}</span></div>
<div>店铺名称<span class="blue-color">{{groupData.shopName || '-'}}</span></div>
<div>商品名称<span class="blue-color">{{groupData.productName || '-'}}</span></div>
<div>拼团状态<Tag :color="getGroupStatus(groupData.status).color">{{getGroupStatus(groupData.status).title}}</Tag></div>
<div>拼团类型<Tag :color="groupData.isFace == 1 ? 'orange' : 'default'">{{groupData.isFace == 1 ? '面对面拼团' : '普通拼团'}}</Tag></div>
<div>拼团人数<span class="blue-color">{{groupData.targetMembers || 0}} / {{groupData.currentMembers || 0}}</span></div>
<div>团长用户ID<span class="blue-color">{{groupData.headUserId || '-'}}</span></div>
<div>团长订单ID<span class="blue-color">{{groupData.headOrderId || '-'}}</span></div>
<div>拼团价格<span class="money">{{formatAmount(groupData.groupPrice)}}</span></div>
<div>配送员ID<span class="blue-color">{{groupData.workerId || '-'}}</span></div>
<div>配送员佣金<span class="money">{{formatAmount(groupData.workerCommission)}}</span></div>
<div>总配送费<span class="money">{{formatAmount(groupData.totalDeliveryFee)}}</span></div>
<div>创建时间{{formatDateTime(groupData.createTime)}}</div>
<div>过期时间{{formatDateTime(groupData.expireTime)}}</div>
<div>成团时间{{formatDateTime(groupData.successTime)}}</div>
</div>
</div>
<div style="display: flex;">
<div class="waiceng" style="width: 100%;">
<div class="title">商品信息</div>
<div class="box" v-for="(item1,index) in item.goodsList" :key="index">
<div style="flex:1;">{{item1.productName}}</div>
<div class="price"> X{{item1.quantity}}</div>
<div class="price">¥{{item1.price}}</div>
<Alert v-if="!loading && orderData.length === 0" type="warning" show-icon>暂无订单明细</Alert>
<div class="order-card" v-for="(item,index) in orderData" :key="item.id || index">
<div class="order-title">
<span>订单{{index + 1}}</span>
<Tag :color="getOrderStatus(item.status).color">{{getOrderStatus(item.status).title}}</Tag>
<Tag v-if="groupData && item.id === groupData.headOrderId" color="blue">团长订单</Tag>
</div>
<div class="section-row">
<div class="waiceng">
<div class="title">订单信息</div>
<div>订单编号{{item.numberCode || '-'}}</div>
<div>支付订单编号{{item.id ? 'ORDER_' + item.id : '-'}}</div>
<div>订单类型{{getOrderType(item.orderType)}}</div>
<div>配送方式<span class="blue-color">{{item.deliveryType == 1 ? '外卖配送' : '到店自取'}}</span></div>
<div>创建时间{{formatDateTime(item.createTime)}}</div>
<div>支付时间{{formatDateTime(item.payTime)}}</div>
<div>备注{{item.remark || '-'}}</div>
</div>
<div class="box">
<div style="flex:1;">餐盒费</div>
<div class="price">¥{{item.packageFee}}</div>
<div class="waiceng">
<div class="title">用户信息</div>
<div>用户ID<span class="blue-color">{{item.userId || '-'}}</span></div>
<div>收货人<span class="blue-color">{{item.receiverName || '-'}}</span></div>
<div>收货电话<span class="blue-color">{{item.receiverPhone || '-'}}</span></div>
<div>收货地址<span class="blue-color">{{item.receiverAddress || '-'}}</span></div>
</div>
<div class="box">
<div style="flex:1;">配送费</div>
<div class="price">¥{{item.deliveryFee}}</div>
<div class="waiceng">
<div class="title">店铺信息</div>
<div>店铺名称<span class="blue-color">{{item.shopName || '-'}}</span></div>
<div>店铺电话<span class="blue-color">{{item.shopPhone || '-'}}</span></div>
<div>店铺地址<span class="blue-color">{{item.shopAddress || '-'}}</span></div>
<div>学校ID<span class="blue-color">{{item.regionId || '-'}}</span></div>
</div>
</div>
<div class="section-row">
<div class="waiceng" style="width: 100%;">
<div class="title">商品信息</div>
<div class="box header">
<div style="flex:2;">商品</div>
<div class="price">规格</div>
<div class="price">数量</div>
<div class="price">单价</div>
<div class="price">餐盒费</div>
</div>
<div class="box" v-for="(item1, goodsIndex) in item.goodsList" :key="item1.id || goodsIndex">
<div style="flex:2;">{{item1.productName || '-'}}</div>
<div class="price">{{item1.specs || '-'}}</div>
<div class="price">X{{item1.quantity || 0}}</div>
<div class="price">{{formatAmount(item1.price)}}</div>
<div class="price">{{formatAmount(item1.packageFee)}}</div>
</div>
<div class="amount-row">
商品金额<span class="money">{{formatAmount(item.goodsAmount)}}</span>
餐盒费<span class="money">{{formatAmount(item.packageFee)}}</span>
配送费<span class="money">{{formatAmount(item.deliveryFee)}}</span>
优惠抵扣<span class="money">{{formatAmount(item.couponDiscountFee)}}</span>
免单金额<span class="money">{{formatAmount(item.freeAmount)}}</span>
合计<span class="total-money">{{formatAmount(item.totalAmount)}}</span>
</div>
</div>
<div class="zong">活动优惠<span style="color:red;">¥0</span> 下单返佣<span style="color:red;">¥0</span>
合计<span style="color:#11cd6e;">¥{{item.totalAmount}}</span></div>
</div>
</div>
</div>
</div>
</template>
<script>
@ -54,10 +93,12 @@
name: "logisticsAddress",
data() {
return {
loading: false,
groupData: null,
orderData: []
};
},
filters: {
methods: {
formatDateTime(isoString) {
if (!isoString) return ''
const date = new Date(isoString)
@ -68,26 +109,107 @@
const minutes = String(date.getMinutes()).padStart(2, '0')
const seconds = String(date.getSeconds()).padStart(2, '0')
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`
}
},
methods: {
},
initRecharge(data) {
this.getPTOrder(data)
},
getPTOrder(id){
this.loading = true;
this.groupData = null;
this.orderData = [];
getPTOrder(id).then((res) => {
this.loading = false;
if (res.success) {
this.orderData = res.result.childOrders;
this.$forceUpdate()
this.groupData = res.result.group || null;
this.orderData = res.result.childOrders || [];
}
}).catch(() => {
this.loading = false;
});
}
},
getGroupStatus(status) {
const statusMap = {
"-1": { title: "团长未支付", color: "red" },
"0": { title: "待成团", color: "yellow" },
"1": { title: "成功", color: "green" },
"2": { title: "失败", color: "red" },
"3": { title: "面对面", color: "orange" },
};
return statusMap[String(status)] || { title: "未知", color: "default" };
},
getOrderStatus(status) {
const statusMap = {
"0": { title: "待支付", color: "red" },
"1": { title: "待商家接单", color: "blue" },
"2": { title: "待配送员接单", color: "blue" },
"3": { title: "待取货/待消费", color: "gold" },
"4": { title: "配送中", color: "orange" },
"5": { title: "已完成", color: "green" },
"6": { title: "已取消", color: "default" },
"7": { title: "待商家同意退款", color: "red" },
"8": { title: "已退款", color: "default" },
"10": { title: "待成团", color: "yellow" },
"11": { title: "售后中", color: "red" },
"12": { title: "已售后", color: "default" },
};
return statusMap[String(status)] || { title: "未知", color: "default" };
},
getOrderType(type) {
const typeMap = {
"1": "直接购买",
"2": "拼团购买",
"3": "面对面团",
};
return typeMap[String(type)] || "-";
},
formatAmount(value) {
if (value === null || value === undefined || value === "") return "-";
return `¥${Number(value).toFixed(2)}`;
},
}
};
</script>
<style lang="less">
.search {
.group-detail {
position: relative;
max-height: 600px;
overflow: auto;
scrollbar-width: none;
background: #eee;
}
.group-card,
.order-card {
background: #eee;
margin-bottom: 10px;
}
.detail-title,
.order-title {
font-size: 20px;
font-weight: 700;
padding: 10px;
background: #fff;
}
.order-title {
display: flex;
align-items: center;
gap: 8px;
}
.info-grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 8px 12px;
background: #fff;
border-radius: 10px;
margin: 5px;
padding: 10px;
}
.section-row {
display: flex;
}
.title {
@ -101,6 +223,7 @@
margin: 5px;
padding: 10px;
flex: 1;
line-height: 26px;
}
.btn {
@ -125,7 +248,12 @@
display: flex;
border-bottom: 1px solid #eee;
line-height: 30px;
height: 30px px;
min-height: 30px;
}
.header {
font-weight: 700;
background: #f8f8f8;
}
.text {
@ -141,4 +269,20 @@
.blue-color {
color: #056dae;
}
.money {
color: #ed4014;
margin-right: 12px;
}
.total-money {
color: #11cd6e;
font-weight: 700;
}
.amount-row {
text-align: right;
min-height: 40px;
line-height: 40px;
}
</style>

162
src/views/app/business/recharge/recharge.vue

@ -7,8 +7,12 @@
<Input type="text" v-model="searchForm.productName" placeholder="请输入商品名" clearable
style="width: 200px" />
</FormItem>
<FormItem label="商家名称" prop="shopName">
<Input type="text" v-model="searchForm.shopName" placeholder="请输入商家名称" clearable
style="width: 200px" />
</FormItem>
<FormItem label="状态" prop="status">
<Select ref="dep" @on-change="checkStatus" style="width:200px">
<Select v-model="searchForm.status" clearable style="width:200px">
<Option v-for="(item, i) in dictData" :key="i" :value="item.value">{{
item.title
}}</Option>
@ -52,7 +56,7 @@
</Row>
</Card>
<!-- 订单详情 -->
<Modal :title="订单详情" v-model="Visiable" :mask-closable="false" :scrollabele="true" :width="850">
<Modal title="订单详情" v-model="Visiable" :mask-closable="false" :scrollabele="true" :width="1000">
<logistics-address v-if="Visiable" ref="dialog"></logistics-address>
<div slot="footer" v-show="Visiable">
<Button type="text" @click="Visiable = false">关闭</Button>
@ -81,14 +85,18 @@
searchForm: {
shopId:'',
headUserId:'',
status:'',
status:null,
productName:'',
isFace:'',
shopName:'',
isFace:null,
pageNumber: 1,
pageSize: 10,
regionId:JSON.parse(this.getStore("user")).departmentId
},
dictData: [{
title: "团长未支付",
value: -1
}, {
title: "待成团",
value: 0
}, {
@ -100,9 +108,6 @@
}, {
title: "面对面",
value: 3
}, {
title: "团长未支付",
value: "-1"
}],
columns: [{
type: "index",
@ -112,71 +117,123 @@
{
title: "拼团编号",
key: "id",
minWidth: 180,
align: "center",
},
{
title: "店铺名称",
key: "shopName",
minWidth: 140,
align: "center",
render: (h, params) => {
return h("span", params.row.shopName || (params.row.shopItem && params.row.shopItem.shopName) || "-");
}
},
{
title: "商品名",
key: "productName",
minWidth: 160,
align: "center",
},
{
title: "成团时间",
key: "successTime",
title: "拼团价",
key: "groupPrice",
width: 100,
align: "center",
render: (h, params) => {
return h(
"div",
this.formatDateTime(params.row.successTime)
);
return h("span", this.formatAmount(params.row.groupPrice));
}
},
{
title: "几人团/已拼成",
key: "targetMembers",
width: 130,
align: "center",
render: (h, params) => {
let re = params.row.targetMembers + '/' + params.row.currentMembers
let re = (params.row.targetMembers || 0) + '/' + (params.row.currentMembers || 0)
return h(
"div",
re
);
}
},
{
title: "面对面",
key: "isFace",
width: 90,
align: "center",
render: (h, params) => {
return h("Tag", {
props: {
color: params.row.isFace == 1 ? "orange" : "default"
}
}, params.row.isFace == 1 ? "是" : "否");
}
},
{
title: "状态",
key: "status", //0 1 2 3
width: 140,
align: "center",
render: (h, params) => {
let re = "",
color = "";
if (params.row.status == "3") {
re = "面对面";
color = "yellow";
} else if (params.row.status == "0") {
re = "待成团";
color = "yellow";
} else if (params.row.status == "1") {
re = "成功";
color = "green";
} else if (params.row.status == "2") {
re = "失败";
color = "red";
} else if (params.row.status == "-1"){
re = '团长发起拼团但未支付';
color = "red";
}
let status = this.getGroupStatus(params.row.status);
return h("div", [
h(
"Tag", {
props: {
color: color,
color: status.color,
},
},
re
status.title
),
]);
},
},
{
title: "配送员佣金",
key: "workerCommission",
width: 110,
align: "center",
render: (h, params) => {
return h("span", this.formatAmount(params.row.workerCommission));
}
},
{
title: "总配送费",
key: "totalDeliveryFee",
width: 110,
align: "center",
render: (h, params) => {
return h("span", this.formatAmount(params.row.totalDeliveryFee));
}
},
{
title: "创建时间",
key: "createTime",
minWidth: 160,
align: "center",
render: (h, params) => {
return h("span", this.formatDateTime(params.row.createTime));
}
},
{
title: "过期时间",
key: "expireTime",
minWidth: 160,
align: "center",
render: (h, params) => {
return h("span", this.formatDateTime(params.row.expireTime));
}
},
{
title: "成团时间",
key: "successTime",
minWidth: 160,
align: "center",
render: (h, params) => {
return h("span", this.formatDateTime(params.row.successTime));
}
},
{
title: "操作",
key: "action",
@ -194,7 +251,7 @@
},
},
},
"查看订单"
"查看详情"
)
]);
},
@ -227,9 +284,6 @@
this.searchForm.pageSize = v;
this.getDataList();
},
checkStatus(v){
this.searchForm.status = v
},
handleSearch() {
this.searchForm.pageNumber = 1;
this.searchForm.pageSize = 10;
@ -237,6 +291,10 @@
},
handleReset() {
this.$refs.searchForm.resetFields();
this.searchForm.status = null;
this.searchForm.isFace = null;
this.searchForm.productName = "";
this.searchForm.shopName = "";
this.searchForm.pageNumber = 1;
this.searchForm.pageSize = 10;
//
@ -252,10 +310,34 @@
changeTableSize(v) {
this.tableSize = v;
},
getGroupStatus(status) {
const statusMap = {
"-1": { title: "团长未支付", color: "red" },
"0": { title: "待成团", color: "yellow" },
"1": { title: "成功", color: "green" },
"2": { title: "失败", color: "red" },
"3": { title: "面对面", color: "orange" },
};
return statusMap[String(status)] || { title: "未知", color: "default" };
},
formatAmount(value) {
if (value === null || value === undefined || value === "") return "-";
return `¥${Number(value).toFixed(2)}`;
},
buildSearchParams() {
const params = Object.assign({}, this.searchForm);
if (params.status === "" || params.status === undefined) {
params.status = null;
}
if (params.isFace === "" || params.isFace === undefined) {
params.isFace = null;
}
return params;
},
getDataList() {
this.loading = true;
//
getGroupList(this.searchForm).then((res) => {
getGroupList(this.buildSearchParams()).then((res) => {
this.loading = false;
if (res.success) {
this.data = res.result.records;
@ -265,6 +347,8 @@
this.getDataList();
}
}
}).catch(() => {
this.loading = false;
});
},
},

165
src/views/app/shopArea/shopArea.vue

@ -1,6 +1,12 @@
<style lang="less">
@import "@/styles/tree-common.less";
@import "./shopArea.less";
.canteen-tip {
max-width: 220px;
white-space: normal;
line-height: 1.5;
}
</style>
<template>
<div class="search">
@ -14,7 +20,9 @@
v-show="showType == 'tree'"
>添加子圈层</Button
>
<Button @click="addRoot" icon="md-add">添加一级圈层</Button>
<Button @click="addRoot" icon="md-add" v-show="!isDepartmentAgent"
>添加一级圈层</Button
>
<Button @click="delAll" icon="md-trash">批量删除</Button>
<Button @click="getParentList" icon="md-refresh">刷新</Button>
<Input
@ -132,19 +140,22 @@
></InputNumber>
</Tooltip>
</FormItem>
<FormItem label="填1为食堂" prop="isCanteen">
<Tooltip
trigger="hover"
placement="right"
content="1 是食堂 0不是"
>
<InputNumber
:max="1000"
:min="0"
v-model="form.isCanteen"
></InputNumber>
</Tooltip>
</FormItem>
<FormItem label="地址类型" prop="isCanteen">
<Tooltip
trigger="hover"
placement="right"
transfer
>
<InputNumber
:max="2"
:min="0"
v-model="form.isCanteen"
></InputNumber>
<div slot="content" class="canteen-tip">
1 食堂送餐中转点也设置为食堂2 快递驿站0 其他地址
</div>
</Tooltip>
</FormItem>
<FormItem label="是否启用" prop="status">
<i-switch
size="large"
@ -201,7 +212,7 @@
:rules="formValidate"
>
<div v-if="showParent">
<FormItem label="上级圈层:">{{ form.title }}</FormItem>
<FormItem label="上级圈层:">{{ addParentTitle }}</FormItem>
</div>
<FormItem label="圈层名称" prop="title">
<Input v-model="formAdd.title" />
@ -219,19 +230,22 @@
></InputNumber>
</Tooltip>
</FormItem>
<FormItem label="填1为食堂" prop="isCanteen">
<Tooltip
trigger="hover"
placement="right"
content="0 不是 1 是"
>
<InputNumber
:max="1000"
:min="0"
v-model="formAdd.isCanteen"
></InputNumber>
</Tooltip>
</FormItem>
<FormItem label="地址类型" prop="isCanteen">
<Tooltip
trigger="hover"
placement="right"
transfer
>
<InputNumber
:max="2"
:min="0"
v-model="formAdd.isCanteen"
></InputNumber>
<div slot="content" class="canteen-tip">
1 食堂送餐中转点也设置为食堂2 快递驿站0 其他地址
</div>
</Tooltip>
</FormItem>
<FormItem label="是否启用" prop="status">
<i-switch
size="large"
@ -279,6 +293,7 @@ export default {
modalVisible: false,
selectList: [],
showParent: false,
addParentTitle: "",
modalTitle: "",
editTitle: "",
searchKey: "",
@ -288,7 +303,7 @@ export default {
parentId: "",
parentTitle: "",
sortOrder: 0,
isCanteen:0,
isCanteen: 0,
status: 0,
},
formAdd: {},
@ -302,6 +317,14 @@ export default {
trigger: "blur",
},
],
isCanteen: [
{
required: true,
type: "number",
message: "请选择地址类型",
trigger: "change",
},
],
},
submitLoading: false,
data: [],
@ -378,6 +401,25 @@ export default {
],
};
},
computed: {
currentUser() {
try {
return JSON.parse(this.getStore("user") || "{}");
} catch (e) {
return {};
}
},
userDepartmentId() {
const departmentId = this.currentUser.departmentId;
return departmentId && departmentId !== "0" ? departmentId : "";
},
userDepartmentTitle() {
return this.currentUser.departmentTitle || "当前校区";
},
isDepartmentAgent() {
return !!this.userDepartmentId;
},
},
methods: {
init() {
this.getParentList();
@ -385,7 +427,10 @@ export default {
},
getParentList() {
this.loading = true;
initShopArea().then((res) => {
const request = this.isDepartmentAgent
? loadShopArea(this.userDepartmentId)
: initShopArea();
request.then((res) => {
this.loading = false;
if (res.success) {
res.result.forEach(function (e) {
@ -401,7 +446,10 @@ export default {
},
getParentListEdit() {
this.loadingEdit = true;
initShopArea().then((res) => {
const request = this.isDepartmentAgent
? loadShopArea(this.userDepartmentId)
: initShopArea();
request.then((res) => {
this.loadingEdit = false;
if (res.success) {
res.result.forEach(function (e) {
@ -410,13 +458,24 @@ export default {
e.children = [];
}
});
//
let first = {
id: "0",
title: "一级圈层",
};
res.result.unshift(first);
this.dataEdit = res.result;
if (this.isDepartmentAgent) {
this.dataEdit = [
{
id: this.userDepartmentId,
title: this.userDepartmentTitle,
expand: true,
children: res.result,
},
];
} else {
//
let first = {
id: "0",
title: "一级圈层",
};
res.result.unshift(first);
this.dataEdit = res.result;
}
}
});
},
@ -437,7 +496,14 @@ export default {
search() {
if (this.searchKey) {
this.loading = true;
searchShopArea({ title: this.searchKey }).then((res) => {
const params = {
title: this.searchKey,
};
if (this.isDepartmentAgent) {
params.parentId = this.userDepartmentId;
params.departmentId = this.userDepartmentId;
}
searchShopArea(params).then((res) => {
this.loading = false;
if (res.success) {
res.result.forEach(function (e) {
@ -506,6 +572,7 @@ export default {
},
cancelAdd() {
this.modalVisible = false;
this.addParentTitle = "";
},
handleReset() {
this.$refs.form.resetFields();
@ -550,27 +617,47 @@ export default {
},
add() {
if (this.form.id == "" || this.form.id == null) {
if (this.isDepartmentAgent) {
this.modalTitle = "添加子圈层";
this.showParent = true;
this.addParentTitle = this.userDepartmentTitle;
this.formAdd = {
parentId: this.userDepartmentId,
sortOrder: this.data.length + 1,
isCanteen: null,
status: 0,
};
this.modalVisible = true;
return;
}
this.$Message.warning("请先点击选择一个圈层");
return;
}
this.modalTitle = "添加子圈层";
this.showParent = true;
this.addParentTitle = this.form.title;
if (!this.form.children) {
this.form.children = [];
}
this.formAdd = {
parentId: this.form.id,
sortOrder: this.form.children.length + 1,
isCanteen: null,
status: 0,
};
this.modalVisible = true;
},
addRoot() {
if (this.isDepartmentAgent) {
return;
}
this.modalTitle = "添加一级圈层";
this.showParent = false;
this.addParentTitle = "";
this.formAdd = {
parentId: 0,
sortOrder: this.data.length + 1,
isCanteen: null,
status: 0,
};
this.modalVisible = true;

16
src/views/my-components/hiver/shopArea-tree-choose.vue

@ -74,6 +74,10 @@
type: String,
default: "500px",
},
rootId: {
type: [String, Number],
default: "",
},
},
data() {
return {
@ -87,7 +91,8 @@
},
methods: {
initShopAreaData() {
initShopArea().then((res) => {
const request = this.rootId ? loadShopArea(this.rootId) : initShopArea();
request.then((res) => {
if (res.success) {
res.result.forEach(function(e) {
if (e.isParent) {
@ -124,9 +129,14 @@
//
if (this.searchKey) {
this.depLoading = true;
searchShopArea({
const params = {
title: this.searchKey
}).then((res) => {
};
if (this.rootId) {
params.parentId = this.rootId;
params.departmentId = this.rootId;
}
searchShopArea(params).then((res) => {
this.depLoading = false;
if (res.success) {
res.result.forEach(function(e) {

9
src/views/sys/order-manage/orderManage.less

@ -0,0 +1,9 @@
.order-manage-table {
.ivu-table-cell {
white-space: nowrap;
}
.ivu-table-cell-tooltip-content {
white-space: nowrap;
}
}

756
src/views/sys/order-manage/orderManage.vue

@ -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 = "展开";

Loading…
Cancel
Save