mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-ui.git
synced 2026-11-06 17:09:08 +08:00
feat(manager): 新增运营模块小程序订单管理
固定小程序来源及微信支付筛选,复用订单列表和详情,新增微信订单自动上报开关并更新升级计划。
This commit is contained in:
@@ -174,6 +174,7 @@ lilishop-ui
|
||||
| ✅ 卡密商品 | ✅ 二级分销 |
|
||||
| ✅ 定时任务管理(数据库配置驱动) | ✅ 预约服务商品 |
|
||||
| ✅ 主题色管理 | ✅ 立减优惠券 |
|
||||
| ✅ 小程序订单管理(简单版) | ✅ 微信订单自动上报开关 |
|
||||
|
||||
### 🔜 近期规划中
|
||||
- 🔜 微信小店对接
|
||||
|
||||
@@ -169,6 +169,12 @@ export const otherRouter = {
|
||||
name: "order-detail",
|
||||
component: () => import("@/views/order/order/orderDetail.vue")
|
||||
},
|
||||
{
|
||||
path: "wechat-order-list",
|
||||
title: "小程序订单",
|
||||
name: "wechat-order-list",
|
||||
component: () => import("@/views/order/wechat/orderList.vue")
|
||||
},
|
||||
{
|
||||
path: "appointment/work-orders",
|
||||
title: "预约工单",
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="支付方式" prop="paymentMethod">
|
||||
<el-select v-model="searchForm.paymentMethod" placeholder="请选择支付方式" clearable>
|
||||
<el-select v-model="searchForm.paymentMethod" placeholder="请选择支付方式" :disabled="!!fixedPaymentMethod" :clearable="!fixedPaymentMethod">
|
||||
<el-option v-for="item in paymentOptions" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@@ -70,7 +70,7 @@
|
||||
/>
|
||||
</el-tabs>
|
||||
</div>
|
||||
<div>
|
||||
<div v-if="allowExport">
|
||||
<el-button type="warning" class="export" :loading="exporting" @click="exportOrder">导出订单</el-button>
|
||||
</div>
|
||||
|
||||
@@ -157,6 +157,13 @@ import { ElMessage, ElMessageBox } from "element-plus";
|
||||
import { unitPrice, customRouterPush } from "@/utils/filters";
|
||||
const PAGE_SIZES = [20, 50, 100];
|
||||
|
||||
// 独立渠道页面复用列表,来源限制不从地址栏或可重置表单中读取。
|
||||
const props = defineProps({
|
||||
fixedClientType: { type: String, default: "" },
|
||||
fixedPaymentMethod: { type: String, default: "" },
|
||||
allowExport: { type: Boolean, default: true },
|
||||
});
|
||||
|
||||
const PROMOTION_OPTIONS = [
|
||||
{ label: "普通订单", value: "NORMAL" },
|
||||
{ label: "拼团订单", value: "PINTUAN" },
|
||||
@@ -195,7 +202,7 @@ function emptySearchForm(pageSize = 20) {
|
||||
consigneeMobile: "",
|
||||
storeName: "",
|
||||
orderStatus: "",
|
||||
paymentMethod: "",
|
||||
paymentMethod: props.fixedPaymentMethod,
|
||||
orderPromotionType: "",
|
||||
};
|
||||
}
|
||||
@@ -367,7 +374,7 @@ function selectDateRange(v) {
|
||||
}
|
||||
}
|
||||
function countParams() {
|
||||
const params = { ...searchForm.value };
|
||||
const params = listParams();
|
||||
delete params.orderStatus;
|
||||
delete params.pageNumber;
|
||||
delete params.pageSize;
|
||||
@@ -375,9 +382,15 @@ function countParams() {
|
||||
delete params.order;
|
||||
return params;
|
||||
}
|
||||
function listParams() {
|
||||
const params = { ...searchForm.value };
|
||||
if (props.fixedClientType) params.clientType = props.fixedClientType;
|
||||
if (props.fixedPaymentMethod) params.paymentMethod = props.fixedPaymentMethod;
|
||||
return params;
|
||||
}
|
||||
function getDataList() {
|
||||
loading.value = true;
|
||||
API_Order.getOrderList(searchForm.value)
|
||||
API_Order.getOrderList(listParams())
|
||||
.then((res) => {
|
||||
if (res.success) {
|
||||
data.value = res.result.records;
|
||||
@@ -395,6 +408,7 @@ function detail(v) {
|
||||
});
|
||||
}
|
||||
async function exportOrder() {
|
||||
if (!props.allowExport) return;
|
||||
if (!searchForm.value.startDate || !searchForm.value.endDate) {
|
||||
try {
|
||||
await ElMessageBox.confirm(
|
||||
@@ -407,7 +421,7 @@ async function exportOrder() {
|
||||
}
|
||||
}
|
||||
exporting.value = true;
|
||||
API_Order.exportOrder(searchForm.value)
|
||||
API_Order.exportOrder(listParams())
|
||||
.then((res) => {
|
||||
const blob = new Blob([res], {
|
||||
type: "application/vnd.ms-excel;charset=utf-8",
|
||||
|
||||
25
manager/src/views/order/wechat/orderList.vue
Normal file
25
manager/src/views/order/wechat/orderList.vue
Normal file
@@ -0,0 +1,25 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-alert
|
||||
title="小程序订单"
|
||||
type="info"
|
||||
:closable="false"
|
||||
show-icon
|
||||
class="wechat-order-notice"
|
||||
description="仅展示微信小程序下单且使用微信支付的订单。自动上报开关开启且微信侧已开通发货管理时,按现有履约流程上报。"
|
||||
/>
|
||||
<OrderList fixed-client-type="WECHAT_MP" fixed-payment-method="WECHAT" :allow-export="false" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import OrderList from "../order/orderList.vue";
|
||||
|
||||
defineOptions({ name: "wechatOrderList" });
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.wechat-order-notice {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
</style>
|
||||
@@ -1,6 +1,11 @@
|
||||
<template>
|
||||
<div class="layout">
|
||||
<el-form ref="formValidateRef" label-width="150px" label-position="right" :model="formValidate" :rules="ruleValidate">
|
||||
<el-form-item label="微信订单自动上报" prop="wechatOrderAutoUploadEnabled">
|
||||
<el-switch v-model="formValidate.wechatOrderAutoUploadEnabled" inline-prompt active-text="开启" inactive-text="关闭" />
|
||||
<span class="desc wechat-order-desc">{{ formValidate.wechatOrderAutoUploadEnabled ? "已开启:符合条件的小程序订单自动上报发货信息并发送收货通知。" : "已关闭:停止微信发货上报和收货通知,商城正常发货不受影响。" }}</span>
|
||||
<span class="desc wechat-order-desc">关闭此开关不会关闭微信平台侧的订单管理要求;如需上报,请通过微信后台处理。修改后点击保存生效。</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="订单自动取消" prop="autoCancel">
|
||||
<el-input type="number" v-model="formValidate.autoCancel">
|
||||
<template #append>分</template>
|
||||
@@ -58,6 +63,7 @@ const formValidate = ref({
|
||||
autoReceive: "",
|
||||
closeAfterSale: "",
|
||||
closeComplaint: "",
|
||||
wechatOrderAutoUploadEnabled: true,
|
||||
});
|
||||
const result = ref("");
|
||||
|
||||
@@ -83,10 +89,16 @@ function setupSetting() {
|
||||
function init() {
|
||||
result.value = JSON.parse(props.res);
|
||||
Object.keys(result.value).map((item) => {
|
||||
if (item === "wechatOrderAutoUploadEnabled") return;
|
||||
result.value[item] += "";
|
||||
});
|
||||
formValidate.value = { ...result.value };
|
||||
formValidate.value = {
|
||||
...formValidate.value,
|
||||
...result.value,
|
||||
wechatOrderAutoUploadEnabled: result.value.wechatOrderAutoUploadEnabled !== false && result.value.wechatOrderAutoUploadEnabled !== "false",
|
||||
};
|
||||
Object.keys(formValidate.value).forEach((item) => {
|
||||
if (item === "wechatOrderAutoUploadEnabled") return;
|
||||
ruleValidate[item] = [
|
||||
{
|
||||
required: true,
|
||||
@@ -130,4 +142,10 @@ init();
|
||||
font-size: 12px;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.wechat-order-desc {
|
||||
display: block;
|
||||
width: 100%;
|
||||
line-height: 20px;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user