feat: 退款状态调整

This commit is contained in:
lzhizhao 2025-11-04 01:34:39 +08:00
parent 02ba78a6a9
commit bb694d86c5
9 changed files with 452 additions and 496 deletions

View File

@ -15,8 +15,8 @@
*/ */
export function paidFilter(status) { export function paidFilter(status) {
const statusMap = { const statusMap = {
true: '已支付', true: "已支付",
false: '未支付', false: "未支付"
}; };
return statusMap[status]; return statusMap[status];
} }
@ -27,46 +27,38 @@ export function paidFilter(status) {
*/ */
export function orderStatusFilter(status) { export function orderStatusFilter(status) {
const statusMap = { const statusMap = {
0: '待付款', 0: "待付款",
1: '待发货', 1: "待发货",
2: '部分发货', 2: "部分发货",
3: '待核销', 3: "待核销",
4: '待收货', 4: "待收货",
5: '已收货', 5: "已收货",
6: '已完成', 6: "已完成",
9: '已取消', 9: "已取消"
}; };
return statusMap[status]; return statusMap[status];
} }
/** /**
* @description 订单中的退款状态 * @description 订单业务状态
*/ */
export function orderRefundStatusFilter(status) { export function orderBusinessStatusFilter(status) {
const statusMap = { const statusMap = {
0: '未退款', 0: "待支付",
1: '申请退款中', 1: "待接单",
2: '部分退款', 2: "待备货",
3: '已退款', 3: "待取货",
4: "已取货(待配送)",
5: "配送中(待送达)",
6: "已配送(待收货或已送达自提点)",
8: "完成(待评价或自动完成)",
"-1": "未支付订单取消",
"-2": "申请退款",
"-3": "同意退款",
"-4": "整单退款完成",
"-5": "部分退款完成"
}; };
return statusMap[status]; return statusMap[status] || statusMap[String(status)] || "未知状态";
}
/**
* @description 退款单退款状态
*
*/
export function refundStatusFilter(status) {
const statusMap = {
0: '待审核',
1: '商家拒绝',
2: '退款中',
3: '退款成功',
4: '用户退货',
5: '商家待收货',
6: '已撤销',
};
return statusMap[status];
} }
/** /**
@ -74,9 +66,9 @@ export function refundStatusFilter(status) {
*/ */
export function payTypeFilter(status) { export function payTypeFilter(status) {
const statusMap = { const statusMap = {
weixin: '微信', weixin: "微信",
alipay: '支付宝', alipay: "支付宝",
yue: '余额', yue: "余额"
}; };
return statusMap[status]; return statusMap[status];
} }
@ -86,11 +78,11 @@ export function payTypeFilter(status) {
*/ */
export function orderTypeFilter(status) { export function orderTypeFilter(status) {
const statusMap = { const statusMap = {
0: '普通订单', 0: "普通订单",
1: '视频号订单', 1: "视频号订单",
2: '秒杀订单', 2: "秒杀订单",
5: '云盘订单', 5: "云盘订单",
6: '卡密订单', 6: "卡密订单"
}; };
return statusMap[status]; return statusMap[status];
} }

View File

@ -20,10 +20,10 @@
<span> <span>
{{ {{
ruleForm.preSaleStage === 1 ruleForm.preSaleStage === 1
? '已付定金' ? "已付定金"
: ruleForm.preSaleStage === 2 : ruleForm.preSaleStage === 2
? '已付尾款' ? "已付尾款"
: '待付定金' : "待付定金"
}} }}
</span> </span>
</el-form-item></el-col </el-form-item></el-col
@ -220,7 +220,7 @@
</div> </div>
</template> </template>
<script> <script>
import { debounce, cloneDeep } from 'lodash' import { debounce, cloneDeep } from "lodash";
export default { export default {
components: {}, components: {},
props: {}, props: {},
@ -229,15 +229,15 @@ export default {
isAdd: true, isAdd: true,
// //
modalConfig: { modalConfig: {
title: '订单详情', title: "订单详情",
show: false, show: false,
width: '1200px', width: "1200px",
fullscreen: true fullscreen: true
}, },
modalData: {}, modalData: {},
ruleForm: {}, ruleForm: {},
tableData: [] tableData: []
} };
}, },
watch: { watch: {
// "modalConfig.show"(newVal) { // "modalConfig.show"(newVal) {
@ -253,56 +253,39 @@ export default {
queryTableData(pageNo, pageSize) {}, queryTableData(pageNo, pageSize) {},
toggle(e) { toggle(e) {
if (this.modalConfig.show == false) { if (this.modalConfig.show == false) {
this.modalConfig.show = true this.modalConfig.show = true;
} else { } else {
this.modalConfig.show = false this.modalConfig.show = false;
} }
if (e) { if (e) {
this.init(cloneDeep(e)) this.init(cloneDeep(e));
} }
return { return {
add: () => { add: () => {
this.modalConfig.title = '订单详情' this.modalConfig.title = "订单详情";
this.isAdd = true this.isAdd = true;
}, },
update: () => { update: () => {
this.modalConfig.title = '订单详情' this.modalConfig.title = "订单详情";
this.isAdd = false this.isAdd = false;
}
} }
};
}, },
init(row) { init(row) {
console.log(row) console.log(row);
this.ruleForm = row this.ruleForm = row;
}, },
handleSelectionChange(e) { handleSelectionChange(e) {
console.log(e) console.log(e);
},
getRefundStatus(val) {
if (val == 0) {
return '正常'
} else if (val == 1) {
return '退款中'
} else if (val == 2) {
return '完全退款'
} else if (val == 3) {
return '部分退款'
} else if (val == 4) {
return '拒绝用户退款'
} else if (val == -1) {
return '退款失败'
} else if (val == -2) {
return '用户申请退款中'
}
} }
}, },
computed: { computed: {
modalHandles() { modalHandles() {
return [ return [
{ {
label: '关闭', label: "关闭",
handle: () => { handle: () => {
this.toggle() this.toggle();
} }
} }
// { // {
@ -312,10 +295,10 @@ export default {
// handle: () => { // handle: () => {
// }, // },
// }, // },
] ];
} }
}, },
asyncComputed: {} asyncComputed: {}
} };
</script> </script>
<style lang="scss" scoped></style> <style lang="scss" scoped></style>

View File

@ -109,11 +109,11 @@ export default {
title: "订单详情", title: "订单详情",
show: false, show: false,
width: "1200px", width: "1200px",
fullscreen: true, fullscreen: true
}, },
modalData: {}, modalData: {},
ruleForm: {}, ruleForm: {},
tableData: [], tableData: []
}; };
}, },
watch: { watch: {
@ -145,7 +145,7 @@ export default {
update: () => { update: () => {
this.modalConfig.title = "店铺详情"; this.modalConfig.title = "店铺详情";
this.isAdd = false; this.isAdd = false;
}, }
}; };
}, },
init(row) { init(row) {
@ -154,25 +154,8 @@ export default {
}, },
handleSelectionChange(e) { handleSelectionChange(e) {
console.log(e); console.log(e);
},
getRefundStatus(val) {
if (val == 0) {
return "正常";
} else if (val == 1) {
return "退款中";
} else if (val == 2) {
return "完全退款";
} else if (val == 3) {
return "部分退款";
} else if (val == 4) {
return "拒绝用户退款";
} else if (val == -1) {
return "退款失败";
} else if (val == -2) {
return "用户申请退款中";
} }
}, },
},
computed: { computed: {
modalHandles() { modalHandles() {
return [ return [
@ -180,8 +163,8 @@ export default {
label: "关闭", label: "关闭",
handle: () => { handle: () => {
this.toggle(); this.toggle();
}, }
}, }
// { // {
// label: "", // label: "",
// type: "primary", // type: "primary",
@ -190,10 +173,9 @@ export default {
// }, // },
// }, // },
]; ];
}
}, },
}, asyncComputed: {}
asyncComputed: {},
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped></style>
</style>

View File

@ -100,10 +100,10 @@
<el-tab-pane label="已配送" name="已配送"></el-tab-pane> <el-tab-pane label="已配送" name="已配送"></el-tab-pane>
<el-tab-pane label="完成" name="完成"></el-tab-pane> <el-tab-pane label="完成" name="完成"></el-tab-pane>
<el-tab-pane label="未支付订单取消" name="未支付订单取消"></el-tab-pane> <el-tab-pane label="未支付订单取消" name="未支付订单取消"></el-tab-pane>
<el-tab-pane label="用户申请退款" name="用户申请退款"></el-tab-pane> <el-tab-pane label="申请退款" name="申请退款"></el-tab-pane>
<el-tab-pane label="用户申请已退款" name="用户申请已退款"></el-tab-pane> <el-tab-pane label="同意退款" name="同意退款"></el-tab-pane>
<el-tab-pane label="商家取消订单" name="商家取消订单"></el-tab-pane> <el-tab-pane label="整单退款完成" name="整单退款完成"></el-tab-pane>
<el-tab-pane label="平台取消订单" name="平台取消订单"></el-tab-pane> <el-tab-pane label="部分退款完成" name="部分退款完成"></el-tab-pane>
</el-tabs> </el-tabs>
<el-table :data="tableData" height="70%" border style="width: 100%"> <el-table :data="tableData" height="70%" border style="width: 100%">
<el-table-column type="expand"> <el-table-column type="expand">
@ -179,9 +179,9 @@
{{ filterUnitStatus(scope.row.status) }} {{ filterUnitStatus(scope.row.status) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="订单退款状态" prop="refundStatus"> <el-table-column label="原始业务状态" prop="unitOrderOriginStatus">
<template slot-scope="scope"> <template slot-scope="scope">
{{ filterUnitRefundStatus(scope.row.refundStatus) }} {{ filterUnitStatus(scope.row.unitOrderOriginStatus) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="订单结算状态" prop="settleStatus"> <el-table-column label="订单结算状态" prop="settleStatus">
@ -218,20 +218,20 @@ export default {
pageNumber: 1, pageNumber: 1,
pageSize: 10, pageSize: 10,
brandId: "", brandId: "",
agentId: "", agentId: ""
}, },
form: { form: {
name: "", name: "",
orderNo: "", orderNo: "",
startTime: "", startTime: "",
endTime: "", endTime: ""
}, },
total: 0, total: 0,
state: "", state: "",
tableData: [], tableData: [],
time: "", time: "",
overviewList: {}, overviewList: {},
isBrand: false, isBrand: false
}; };
}, },
created() { created() {
@ -257,9 +257,9 @@ export default {
.distributorOrBrandOrderPage({ .distributorOrBrandOrderPage({
...this.formInline, ...this.formInline,
state: this.state, state: this.state,
...this.form, ...this.form
}) })
.then((res) => { .then(res => {
console.log(res); console.log(res);
this.tableData = res.data.data.data; this.tableData = res.data.data.data;
this.total = Number(res.data.data.total); this.total = Number(res.data.data.total);
@ -267,7 +267,7 @@ export default {
this.$api.mer_admin this.$api.mer_admin
.orderOverview({ ...this.formInline, ...this.form }) .orderOverview({ ...this.formInline, ...this.form })
.then() .then()
.then((res) => { .then(res => {
this.overviewList = res.data.data; this.overviewList = res.data.data;
console.log(res); console.log(res);
}); });
@ -277,7 +277,7 @@ export default {
name: "", name: "",
orderNo: "", orderNo: "",
startTime: "", startTime: "",
endTime: "", endTime: ""
}; };
this.getList(); this.getList();
}, },
@ -313,16 +313,16 @@ export default {
case "未支付订单取消": case "未支付订单取消":
this.state = -1; this.state = -1;
break; break;
case "用户申请退款": case "申请退款":
this.state = -2; this.state = -2;
break; break;
case "用户申请已退款": case "同意退款":
this.state = -3; this.state = -3;
break; break;
case "商家取消订单": case "整单退款完成":
this.state = -4; this.state = -4;
break; break;
case "平台取消订单": case "部分退款完成":
this.state = -5; this.state = -5;
break; break;
} }
@ -370,30 +370,13 @@ export default {
} else if (val == -1) { } else if (val == -1) {
return "未支付订单取消"; return "未支付订单取消";
} else if (val == -2) { } else if (val == -2) {
return "用户申请退款"; return "申请退款";
} else if (val == -3) { } else if (val == -3) {
return "用户申请已退款"; return "同意退款";
} else if (val == -4) { } else if (val == -4) {
return "商家取消订单"; return "整单退款完成";
} else if (val == -5) { } else if (val == -5) {
return "平台取消订单"; return "部分退款完成";
}
},
filterUnitRefundStatus(val) {
if (val === 0) {
return "正常";
} else if (val == 1) {
return "退款中";
} else if (val == 2) {
return "完全退款";
} else if (val == 3) {
return "部分退款";
} else if (val == 4) {
return "拒绝用户退款";
} else if (val == -1) {
return "退款失败";
} else if (val == -2) {
return "用户申请退款中";
} }
}, },
changeTime(e) { changeTime(e) {
@ -404,8 +387,8 @@ export default {
this.form.startTime = ""; this.form.startTime = "";
this.form.endTime = ""; this.form.endTime = "";
} }
}, }
}, }
}; };
</script> </script>

View File

@ -153,11 +153,11 @@ export default {
title: "订单详情", title: "订单详情",
show: false, show: false,
width: "1200px", width: "1200px",
fullscreen: true, fullscreen: true
}, },
modalData: {}, modalData: {},
ruleForm: {}, ruleForm: {},
tableData: [], tableData: []
}; };
}, },
watch: { watch: {
@ -189,7 +189,7 @@ export default {
update: () => { update: () => {
this.modalConfig.title = "店铺详情"; this.modalConfig.title = "店铺详情";
this.isAdd = false; this.isAdd = false;
}, }
}; };
}, },
init(row) { init(row) {
@ -198,25 +198,8 @@ export default {
}, },
handleSelectionChange(e) { handleSelectionChange(e) {
console.log(e); console.log(e);
},
getRefundStatus(val) {
if (val == 0) {
return "正常";
} else if (val == 1) {
return "退款中";
} else if (val == 2) {
return "完全退款";
} else if (val == 3) {
return "部分退款";
} else if (val == 4) {
return "拒绝用户退款";
} else if (val == -1) {
return "退款失败";
} else if (val == -2) {
return "用户申请退款中";
} }
}, },
},
computed: { computed: {
modalHandles() { modalHandles() {
return [ return [
@ -224,8 +207,8 @@ export default {
label: "关闭", label: "关闭",
handle: () => { handle: () => {
this.toggle(); this.toggle();
}, }
}, }
// { // {
// label: "", // label: "",
// type: "primary", // type: "primary",
@ -234,10 +217,9 @@ export default {
// }, // },
// }, // },
]; ];
}
}, },
}, asyncComputed: {}
asyncComputed: {},
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped></style>
</style>

View File

@ -64,8 +64,19 @@
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="24" class="search-buttons"> <el-col :span="24" class="search-buttons">
<el-button type="primary" @click="handleSearch" icon="el-icon-search" size="small">搜索</el-button> <el-button
<el-button @click="handleReset" icon="el-icon-refresh" size="small">重置</el-button> type="primary"
@click="handleSearch"
icon="el-icon-search"
size="small"
>搜索</el-button
>
<el-button
@click="handleReset"
icon="el-icon-refresh"
size="small"
>重置</el-button
>
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
@ -110,8 +121,8 @@
size="small" size="small"
:expand-row-keys="expandedRows" :expand-row-keys="expandedRows"
@expand-change="handleExpandChange" @expand-change="handleExpandChange"
:default-expand-all="false"> :default-expand-all="false"
>
<el-table-column type="expand" width="50"> <el-table-column type="expand" width="50">
<template slot-scope="props"> <template slot-scope="props">
<div class="expand-content"> <div class="expand-content">
@ -122,8 +133,11 @@
style="width: 100%;" style="width: 100%;"
row-key="shopOrderNo" row-key="shopOrderNo"
:expand-row-keys="expandedShopRows[props.row.unitOrderNo] || []" :expand-row-keys="expandedShopRows[props.row.unitOrderNo] || []"
@expand-change="(row, expanded) => handleShopExpandChange(props.row, expanded)" @expand-change="
:show-header="true"> (row, expanded) => handleShopExpandChange(props.row, expanded)
"
:show-header="true"
>
<el-table-column type="expand"> <el-table-column type="expand">
<template slot-scope="shopScope"> <template slot-scope="shopScope">
<!-- 三级子列表: 商品信息 --> <!-- 三级子列表: 商品信息 -->
@ -131,35 +145,55 @@
:data="shopScope.row.productOrderList" :data="shopScope.row.productOrderList"
size="small" size="small"
style="width: 100%" style="width: 100%"
:show-header="true"> :show-header="true"
>
<el-table-column prop="productName" label="商品名称"> <el-table-column prop="productName" label="商品名称">
<template slot-scope="productScope">{{ productScope.row.productName || '-' }}</template> <template slot-scope="productScope">{{
productScope.row.productName || "-"
}}</template>
</el-table-column> </el-table-column>
<el-table-column prop="productCount" label="商品数量"> <el-table-column prop="productCount" label="商品数量">
<template slot-scope="productScope">{{ productScope.row.productCount || '-' }}</template> <template slot-scope="productScope">{{
productScope.row.productCount || "-"
}}</template>
</el-table-column> </el-table-column>
<el-table-column label="商品原价"> <el-table-column label="商品原价">
<template slot-scope="productScope"> <template slot-scope="productScope">
¥ {{ (productScope.row.originPrice / 100).toFixed(2) || '0.00' }} ¥
{{
(productScope.row.originPrice / 100).toFixed(2) ||
"0.00"
}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="商品终价"> <el-table-column label="商品终价">
<template slot-scope="productScope"> <template slot-scope="productScope">
¥ {{ (productScope.row.finalPrice / 100).toFixed(2) || '0.00' }} ¥
{{
(productScope.row.finalPrice / 100).toFixed(2) ||
"0.00"
}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="商品订单金额"> <el-table-column label="商品订单金额">
<template slot-scope="productScope"> <template slot-scope="productScope">
¥ {{ (productScope.row.productOrderMoney / 100).toFixed(2) || '0.00' }} ¥
{{
(productScope.row.productOrderMoney / 100).toFixed(
2
) || "0.00"
}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="productImg" label="商品图片"> <el-table-column prop="productImg" label="商品图片">
<template slot-scope="productScope"> <template slot-scope="productScope">
<el-image v-if="productScope.row.productImg" <el-image
v-if="productScope.row.productImg"
:src="productScope.row.productImg" :src="productScope.row.productImg"
style="width: 40px; height: 40px;" style="width: 40px; height: 40px;"
fit="cover" fit="cover"
:preview-src-list="[productScope.row.productImg]"></el-image> :preview-src-list="[productScope.row.productImg]"
></el-image>
<span v-else>-</span> <span v-else>-</span>
</template> </template>
</el-table-column> </el-table-column>
@ -172,7 +206,9 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="shopOrderNo" label="店铺订单号"> <el-table-column prop="shopOrderNo" label="店铺订单号">
<template slot-scope="shopScope">{{ shopScope.row.shopOrderNo || '-' }}</template> <template slot-scope="shopScope">{{
shopScope.row.shopOrderNo || "-"
}}</template>
</el-table-column> </el-table-column>
<el-table-column prop="shopName" label="店铺名称"> <el-table-column prop="shopName" label="店铺名称">
<template slot-scope="shopScope"> <template slot-scope="shopScope">
@ -181,8 +217,11 @@
</el-table-column> </el-table-column>
<el-table-column prop="status" label="订单状态"> <el-table-column prop="status" label="订单状态">
<template slot-scope="shopScope"> <template slot-scope="shopScope">
<el-tag :type="getShopStatusType(shopScope.row.status)" size="small"> <el-tag
{{ getShopStatusText(shopScope.row.status) || '-' }} :type="getShopStatusType(shopScope.row.status)"
size="small"
>
{{ getShopStatusText(shopScope.row.status) || "-" }}
</el-tag> </el-tag>
</template> </template>
</el-table-column> </el-table-column>
@ -194,23 +233,33 @@
<!-- 一级列表字段 --> <!-- 一级列表字段 -->
<el-table-column label="序号" width="50"> <el-table-column label="序号" width="50">
<template slot-scope="scope"> <template slot-scope="scope">
{{ (pagination.pageNumber - 1) * pagination.pageSize + scope.$index + 1 }} {{
(pagination.pageNumber - 1) * pagination.pageSize + scope.$index + 1
}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="unitOrderNo" label="结算订单号" min-width="120"> <el-table-column prop="unitOrderNo" label="结算订单号" min-width="120">
<template slot-scope="scope">{{ scope.row.unitOrderNo || '-' }}</template> <template slot-scope="scope">{{
scope.row.unitOrderNo || "-"
}}</template>
</el-table-column> </el-table-column>
<el-table-column prop="createTime" label="下单时间" width="90"> <el-table-column prop="createTime" label="下单时间" width="90">
<template slot-scope="scope">{{ scope.row.createTime || '-' }}</template> <template slot-scope="scope">{{
scope.row.createTime || "-"
}}</template>
</el-table-column> </el-table-column>
<el-table-column prop="receiverName" label="收货人姓名" width="80"> <el-table-column prop="receiverName" label="收货人姓名" width="80">
<template slot-scope="scope">{{ scope.row.receiverName || '-' }}</template> <template slot-scope="scope">{{
scope.row.receiverName || "-"
}}</template>
</el-table-column> </el-table-column>
<el-table-column prop="receiverPhone" label="收货人电话" width="100"> <el-table-column prop="receiverPhone" label="收货人电话" width="100">
<template slot-scope="scope">{{ scope.row.receiverPhone || '-' }}</template> <template slot-scope="scope">{{
scope.row.receiverPhone || "-"
}}</template>
</el-table-column> </el-table-column>
<el-table-column prop="poi" label="收货人地址" min-width="150"> <el-table-column prop="poi" label="收货人地址" min-width="150">
<template slot-scope="scope">{{ scope.row.poi || '-' }}</template> <template slot-scope="scope">{{ scope.row.poi || "-" }}</template>
</el-table-column> </el-table-column>
<el-table-column label="市场订单金额" min-width="100"> <el-table-column label="市场订单金额" min-width="100">
<template slot-scope="scope"> <template slot-scope="scope">
@ -240,18 +289,22 @@
<el-table-column prop="status" label="订单状态" width="100"> <el-table-column prop="status" label="订单状态" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag :type="getStatusTagType(scope.row.status)" size="small"> <el-tag :type="getStatusTagType(scope.row.status)" size="small">
{{ getStatusText(scope.row.status) || '-' }} {{ getStatusText(scope.row.status) || "-" }}
</el-tag> </el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="marketId" label="市场编号" width="90"> <el-table-column prop="marketId" label="市场编号" width="90">
<template slot-scope="scope">{{ scope.row.marketId || '-' }}</template> <template slot-scope="scope">{{ scope.row.marketId || "-" }}</template>
</el-table-column> </el-table-column>
<el-table-column prop="marketName" label="市场名称" min-width="100"> <el-table-column prop="marketName" label="市场名称" min-width="100">
<template slot-scope="scope">{{ scope.row.marketName || '-' }}</template> <template slot-scope="scope">{{
scope.row.marketName || "-"
}}</template>
</el-table-column> </el-table-column>
<el-table-column prop="refundReason" label="申请退款原因" min-width="80"> <el-table-column prop="refundReason" label="申请退款原因" min-width="80">
<template slot-scope="scope">{{ scope.row.refundReason || '-' }}</template> <template slot-scope="scope">{{
scope.row.refundReason || "-"
}}</template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -280,13 +333,13 @@ export default {
receiverName: "", receiverName: "",
unitOrderNo: "", unitOrderNo: "",
statusList: [], statusList: [],
dateRange: [], dateRange: []
}, },
stats: { stats: {
totalCount: 0, totalCount: 0,
totalMoney: 0, totalMoney: 0,
completeRate: 0, completeRate: 0,
agentCommission: 0, agentCommission: 0
}, },
orderStatusOptions: [ orderStatusOptions: [
{ label: "待支付", value: 0 }, { label: "待支付", value: 0 },
@ -298,20 +351,20 @@ export default {
{ label: "已配送(待收货)", value: 6 }, { label: "已配送(待收货)", value: 6 },
{ label: "完成", value: 8 }, { label: "完成", value: 8 },
{ label: "未支付订单取消", value: -1 }, { label: "未支付订单取消", value: -1 },
{ label: "用户申请退款", value: -2 }, { label: "申请退款", value: -2 },
{ label: "用户申请已退款", value: -3 }, { label: "同意退款", value: -3 },
{ label: "商家取消订单", value: -4 }, { label: "整单退款完成", value: -4 },
{ label: "平台取消订单", value: -5 }, { label: "部分退款完成", value: -5 }
], ],
tableData: [], tableData: [],
pagination: { pagination: {
pageNumber: 1, pageNumber: 1,
pageSize: 10, pageSize: 10,
total: 0, total: 0
}, },
loading: false, loading: false,
expandedRows: [], expandedRows: [],
expandedShopRows: {}, expandedShopRows: {}
}; };
}, },
watch: { watch: {
@ -319,8 +372,8 @@ export default {
handler(query) { handler(query) {
this.applyQueryParamsAndSearch(query); this.applyQueryParamsAndSearch(query);
}, },
immediate: true, immediate: true
}, }
}, },
methods: { methods: {
applyQueryParamsAndSearch(query) { applyQueryParamsAndSearch(query) {
@ -342,9 +395,11 @@ export default {
const params = { const params = {
receiverName: this.searchForm.receiverName || null, receiverName: this.searchForm.receiverName || null,
unitOrderNo: this.searchForm.unitOrderNo || null, unitOrderNo: this.searchForm.unitOrderNo || null,
statusList: this.searchForm.statusList.length ? this.searchForm.statusList.join(',') : null, statusList: this.searchForm.statusList.length
? this.searchForm.statusList.join(",")
: null,
startTime: null, startTime: null,
endTime: null, endTime: null
}; };
if (this.searchForm.dateRange && this.searchForm.dateRange.length === 2) { if (this.searchForm.dateRange && this.searchForm.dateRange.length === 2) {
params.startTime = this.searchForm.dateRange[0]; params.startTime = this.searchForm.dateRange[0];
@ -357,10 +412,12 @@ export default {
const params = { const params = {
...this.getCommonParams(), ...this.getCommonParams(),
pageNumber: this.pagination.pageNumber, pageNumber: this.pagination.pageNumber,
pageSize: this.pagination.pageSize, pageSize: this.pagination.pageSize
}; };
mer_admin.orderV2Page(params).then(res => { mer_admin
.orderV2Page(params)
.then(res => {
if (res.data && res.data.data) { if (res.data && res.data.data) {
this.tableData = res.data.data.data; this.tableData = res.data.data.data;
this.pagination.total = parseInt(res.data.data.total) || 0; this.pagination.total = parseInt(res.data.data.total) || 0;
@ -368,17 +425,21 @@ export default {
this.tableData = []; this.tableData = [];
this.pagination.total = 0; this.pagination.total = 0;
} }
}).catch(err => { })
.catch(err => {
console.error("Error fetching order data:", err); console.error("Error fetching order data:", err);
this.tableData = []; this.tableData = [];
this.pagination.total = 0; this.pagination.total = 0;
}).finally(() => { })
.finally(() => {
this.loading = false; this.loading = false;
}); });
}, },
fetchOverview() { fetchOverview() {
const params = this.getCommonParams(); const params = this.getCommonParams();
mer_admin.orderV2Overview(params).then(res => { mer_admin
.orderV2Overview(params)
.then(res => {
if (res.data && res.data.data) { if (res.data && res.data.data) {
this.stats = res.data.data; this.stats = res.data.data;
} else { } else {
@ -386,10 +447,11 @@ export default {
totalCount: 0, totalCount: 0,
totalMoney: 0, totalMoney: 0,
completeRate: 0, completeRate: 0,
agentCommission: 0, agentCommission: 0
}; };
} }
}).catch(err => { })
.catch(err => {
console.error("Error fetching overview data:", err); console.error("Error fetching overview data:", err);
}); });
}, },
@ -415,27 +477,32 @@ export default {
if (status === undefined || status === null) { if (status === undefined || status === null) {
return "未知状态"; return "未知状态";
} }
const statusOption = this.orderStatusOptions.find(opt => opt.value === status); const statusOption = this.orderStatusOptions.find(
opt => opt.value === status
);
return statusOption ? statusOption.label : "未知状态"; return statusOption ? statusOption.label : "未知状态";
}, },
getStatusTagType(status) { getStatusTagType(status) {
switch (status) { switch (status) {
case 0: return 'warning'; // case 0:
return "warning"; //
case 1: case 1:
case 2: case 2:
case 3: case 3:
case 4: case 4:
case 5: case 5:
case 6: case 6:
return 'info'; // return "info"; //
case 8: return 'success'; // case 8:
return "success"; //
case -1: case -1:
case -2: case -2:
case -3: case -3:
case -4: case -4:
case -5: case -5:
return 'danger'; // 退 return "danger"; // 退
default: return 'primary'; default:
return "primary";
} }
}, },
viewDetails(row) { viewDetails(row) {
@ -448,34 +515,34 @@ export default {
}, },
getShopStatusText(status) { getShopStatusText(status) {
const shopStatusMap = { const shopStatusMap = {
0: '待备货', 0: "待备货",
1: '备货完成 待取货', 1: "备货完成 待取货",
2: '已取货(待配送)', 2: "已取货(待配送)",
3: '配送中', 3: "配送中",
4: '配送完成(待收货)', 4: "配送完成(待收货)",
5: '待评价', 5: "待评价",
6: '已完成' 6: "已完成"
}; };
return shopStatusMap[status] || '未知状态'; return shopStatusMap[status] || "未知状态";
}, },
getShopStatusType(status) { getShopStatusType(status) {
switch (status) { switch (status) {
case 0: // case 0: //
case 1: // case 1: //
return 'warning'; return "warning";
case 2: // case 2: //
case 3: // case 3: //
case 4: // () case 4: // ()
return 'info'; return "info";
case 5: // case 5: //
return 'primary'; return "primary";
case 6: // case 6: //
return 'success'; return "success";
default: default:
return 'danger'; return "danger";
}
} }
} }
},
}; };
</script> </script>
@ -502,7 +569,7 @@ export default {
.stat-value { .stat-value {
font-size: 20px; font-size: 20px;
font-weight: bold; font-weight: bold;
color: #409EFF; color: #409eff;
} }
.search-form .el-form-item { .search-form .el-form-item {
margin-bottom: 10px; margin-bottom: 10px;

View File

@ -219,11 +219,11 @@ export default {
title: "订单详情", title: "订单详情",
show: false, show: false,
width: "1200px", width: "1200px",
fullscreen: true, fullscreen: true
}, },
modalData: {}, modalData: {},
ruleForm: {}, ruleForm: {},
tableData: [], tableData: []
}; };
}, },
watch: { watch: {
@ -255,7 +255,7 @@ export default {
update: () => { update: () => {
this.modalConfig.title = "订单详情"; this.modalConfig.title = "订单详情";
this.isAdd = false; this.isAdd = false;
}, }
}; };
}, },
init(row) { init(row) {
@ -264,25 +264,8 @@ export default {
}, },
handleSelectionChange(e) { handleSelectionChange(e) {
console.log(e); console.log(e);
},
getRefundStatus(val) {
if (val == 0) {
return "正常";
} else if (val == 1) {
return "退款中";
} else if (val == 2) {
return "完全退款";
} else if (val == 3) {
return "部分退款";
} else if (val == 4) {
return "拒绝用户退款";
} else if (val == -1) {
return "退款失败";
} else if (val == -2) {
return "用户申请退款中";
} }
}, },
},
computed: { computed: {
modalHandles() { modalHandles() {
return [ return [
@ -290,8 +273,8 @@ export default {
label: "关闭", label: "关闭",
handle: () => { handle: () => {
this.toggle(); this.toggle();
}, }
}, }
// { // {
// label: "", // label: "",
// type: "primary", // type: "primary",
@ -300,10 +283,9 @@ export default {
// }, // },
// }, // },
]; ];
}
}, },
}, asyncComputed: {}
asyncComputed: {},
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped></style>
</style>

View File

@ -111,8 +111,10 @@
</el-form-item></el-col </el-form-item></el-col
> >
<el-col :span="8"> <el-col :span="8">
<el-form-item label="订单退款状态:"> <el-form-item label="原始业务状态:">
<span>{{ getRefundStatus(ruleForm.refundStatus) }}</span> <span>{{
getBusinessStatus(ruleForm.unitOrderOriginStatus)
}}</span>
</el-form-item></el-col </el-form-item></el-col
> >
</el-row> </el-row>
@ -219,11 +221,11 @@ export default {
title: "订单详情", title: "订单详情",
show: false, show: false,
width: "1200px", width: "1200px",
fullscreen: true, fullscreen: true
}, },
modalData: {}, modalData: {},
ruleForm: {}, ruleForm: {},
tableData: [], tableData: []
}; };
}, },
watch: { watch: {
@ -255,7 +257,7 @@ export default {
update: () => { update: () => {
this.modalConfig.title = "订单详情"; this.modalConfig.title = "订单详情";
this.isAdd = false; this.isAdd = false;
}, }
}; };
}, },
init(row) { init(row) {
@ -265,24 +267,25 @@ export default {
handleSelectionChange(e) { handleSelectionChange(e) {
console.log(e); console.log(e);
}, },
getRefundStatus(val) { getBusinessStatus(val) {
if (val == 0) { const statusMap = {
return "正常"; 0: "待支付",
} else if (val == 1) { 1: "待接单",
return "退款中"; 2: "待备货",
} else if (val == 2) { 3: "待取货",
return "完全退款"; 4: "已取货(待配送)",
} else if (val == 3) { 5: "配送中(待送达)",
return "部分退款"; 6: "已配送(待收货或已送达自提点)",
} else if (val == 4) { 8: "完成(待评价或自动完成)",
return "拒绝用户退款"; "-1": "未支付订单取消",
} else if (val == -1) { "-2": "申请退款",
return "退款失败"; "-3": "同意退款",
} else if (val == -2) { "-4": "整单退款完成",
return "用户申请退款中"; "-5": "部分退款完成"
};
return statusMap[val] || statusMap[String(val)] || "未知状态";
} }
}, },
},
computed: { computed: {
modalHandles() { modalHandles() {
return [ return [
@ -290,8 +293,8 @@ export default {
label: "关闭", label: "关闭",
handle: () => { handle: () => {
this.toggle(); this.toggle();
}, }
}, }
// { // {
// label: "", // label: "",
// type: "primary", // type: "primary",
@ -300,10 +303,9 @@ export default {
// }, // },
// }, // },
]; ];
}
}, },
}, asyncComputed: {}
asyncComputed: {},
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped></style>
</style>

View File

@ -20,10 +20,10 @@
<span> <span>
{{ {{
ruleForm.preSaleStage === 1 ruleForm.preSaleStage === 1
? '已付定金' ? "已付定金"
: ruleForm.preSaleStage === 2 : ruleForm.preSaleStage === 2
? '已付尾款' ? "已付尾款"
: '待付定金' : "待付定金"
}} }}
</span> </span>
</el-form-item></el-col </el-form-item></el-col
@ -220,7 +220,7 @@
</div> </div>
</template> </template>
<script> <script>
import { debounce, cloneDeep } from 'lodash' import { debounce, cloneDeep } from "lodash";
export default { export default {
components: {}, components: {},
props: {}, props: {},
@ -229,15 +229,15 @@ export default {
isAdd: true, isAdd: true,
// //
modalConfig: { modalConfig: {
title: '订单详情', title: "订单详情",
show: false, show: false,
width: '1200px', width: "1200px",
fullscreen: true fullscreen: true
}, },
modalData: {}, modalData: {},
ruleForm: {}, ruleForm: {},
tableData: [] tableData: []
} };
}, },
watch: { watch: {
// "modalConfig.show"(newVal) { // "modalConfig.show"(newVal) {
@ -253,56 +253,39 @@ export default {
queryTableData(pageNo, pageSize) {}, queryTableData(pageNo, pageSize) {},
toggle(e) { toggle(e) {
if (this.modalConfig.show == false) { if (this.modalConfig.show == false) {
this.modalConfig.show = true this.modalConfig.show = true;
} else { } else {
this.modalConfig.show = false this.modalConfig.show = false;
} }
if (e) { if (e) {
this.init(cloneDeep(e)) this.init(cloneDeep(e));
} }
return { return {
add: () => { add: () => {
this.modalConfig.title = '订单详情' this.modalConfig.title = "订单详情";
this.isAdd = true this.isAdd = true;
}, },
update: () => { update: () => {
this.modalConfig.title = '订单详情' this.modalConfig.title = "订单详情";
this.isAdd = false this.isAdd = false;
}
} }
};
}, },
init(row) { init(row) {
console.log(row) console.log(row);
this.ruleForm = row this.ruleForm = row;
}, },
handleSelectionChange(e) { handleSelectionChange(e) {
console.log(e) console.log(e);
},
getRefundStatus(val) {
if (val == 0) {
return '正常'
} else if (val == 1) {
return '退款中'
} else if (val == 2) {
return '完全退款'
} else if (val == 3) {
return '部分退款'
} else if (val == 4) {
return '拒绝用户退款'
} else if (val == -1) {
return '退款失败'
} else if (val == -2) {
return '用户申请退款中'
}
} }
}, },
computed: { computed: {
modalHandles() { modalHandles() {
return [ return [
{ {
label: '关闭', label: "关闭",
handle: () => { handle: () => {
this.toggle() this.toggle();
} }
} }
// { // {
@ -312,10 +295,10 @@ export default {
// handle: () => { // handle: () => {
// }, // },
// }, // },
] ];
} }
}, },
asyncComputed: {} asyncComputed: {}
} };
</script> </script>
<style lang="scss" scoped></style> <style lang="scss" scoped></style>