@@ -173,6 +173,11 @@ const routes = [
|
||||
component: () => import('@/views/admin/ClubConfig.vue'),
|
||||
meta: { title: '俱乐部密钥配置' }
|
||||
},
|
||||
{
|
||||
path: 'admin/order-grab-share',
|
||||
component: () => import('@/views/admin/OrderGrabShare.vue'),
|
||||
meta: { title: '订单互通抢单' }
|
||||
},
|
||||
{
|
||||
path: 'admin/data-scope',
|
||||
component: () => import('@/views/admin/DataScope.vue'),
|
||||
@@ -298,6 +303,11 @@ const routes = [
|
||||
component: () => import('@/views/miniapp/RankReward.vue'),
|
||||
meta: { title: '排行榜奖励' }
|
||||
},
|
||||
{
|
||||
path: 'miniapp/recharge-copy',
|
||||
component: () => import('@/views/club/RechargePageCopy.vue'),
|
||||
meta: { title: '充值页文案' }
|
||||
},
|
||||
// ========== 店铺管理(原有) ==========
|
||||
{
|
||||
path: 'shop/list',
|
||||
|
||||
@@ -3,7 +3,7 @@ const CLUB_SCOPE_KEY = 'admin_club_scope';
|
||||
const CLUB_CONTEXT_KEY = 'admin_club_context';
|
||||
const MENU_ACCESS_KEY = 'kefu_menu_access';
|
||||
const MENU_SESSION_KEY = 'kefu_menu_session_v';
|
||||
const MENU_SESSION_VERSION = '26';
|
||||
const MENU_SESSION_VERSION = '27';
|
||||
const DEFAULT_CLUB_ID = 'xq';
|
||||
|
||||
let menuAccessInflight = null;
|
||||
@@ -171,7 +171,7 @@ const KEFU_MENU_ROWS = [
|
||||
];
|
||||
|
||||
const KEFU_MENU_PARENT_IDS = {
|
||||
admin: ['admin.role', 'admin.data-scope', 'admin.club-config', 'admin.user', 'admin.operation-log'],
|
||||
admin: ['admin.role', 'admin.data-scope', 'admin.club-config', 'admin.order-grab-share', 'admin.user', 'admin.operation-log'],
|
||||
finance: ['finance.bankuai', 'finance.data'],
|
||||
assessment: ['assessment.examiner', 'assessment.config', 'assessment.record'],
|
||||
order: ['order.platform', 'order.merchant'],
|
||||
@@ -249,6 +249,10 @@ export function canShowMenuPage(pageId) {
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
// 集团权限:订单互通配置(菜单 seed 未跑时本地兜底)
|
||||
if (pageId === 'admin.order-grab-share' && access.is_group_admin) {
|
||||
return true;
|
||||
}
|
||||
|
||||
const ids = access?.visible_page_ids;
|
||||
if (Array.isArray(ids) && ids.length > 0) {
|
||||
@@ -418,6 +422,7 @@ export const JITUAN_API = {
|
||||
kefuCfgl: '/jituan/houtai/kefu-cfgl',
|
||||
adminAssignments: '/jituan/houtai/admin-assignments',
|
||||
clubManage: '/jituan/houtai/club-manage',
|
||||
orderGrabLink: '/jituan/houtai/order-grab-link',
|
||||
paymentChannelManage: '/jituan/houtai/payment-channel-manage',
|
||||
clubCertUpload: '/jituan/houtai/club-cert-upload',
|
||||
memberList: '/jituan/houtai/hthqhylb',
|
||||
|
||||
@@ -101,6 +101,7 @@
|
||||
<el-menu-item v-if="canShow('admin.role')" index="/admin/role">角色管理</el-menu-item>
|
||||
<el-menu-item v-if="canShow('admin.data-scope') && isGroupAdmin" index="/admin/data-scope">数据范围配置</el-menu-item>
|
||||
<el-menu-item v-if="canShow('admin.club-config') && isGroupAdmin" index="/admin/club-config">俱乐部密钥配置</el-menu-item>
|
||||
<el-menu-item v-if="canShow('admin.order-grab-share') && isGroupAdmin" index="/admin/order-grab-share">订单互通抢单</el-menu-item>
|
||||
<el-menu-item v-if="canShow('admin.user')" index="/admin/user">后台用户</el-menu-item>
|
||||
<el-menu-item v-if="canShow('admin.operation-log')" index="/admin/operation-log">操作日志</el-menu-item>
|
||||
</el-sub-menu>
|
||||
@@ -151,6 +152,7 @@
|
||||
<el-menu-item v-if="canShow('miniapp.kaohe-tags')" index="/miniapp/kaohe-tags">抢单考核标签</el-menu-item>
|
||||
<el-menu-item v-if="canShow('miniapp.dashou-exam')" index="/miniapp/dashou-exam">打手接单考试</el-menu-item>
|
||||
<el-menu-item v-if="canShow('miniapp.rank-reward')" index="/miniapp/rank-reward">排行榜奖励</el-menu-item>
|
||||
<el-menu-item v-if="canShow('miniapp.recharge-copy')" index="/miniapp/recharge-copy">充值页文案</el-menu-item>
|
||||
<el-menu-item v-if="canShow('miniapp.withdraw-settings')" index="/withdraw/settings">提现与收款设置</el-menu-item>
|
||||
</el-sub-menu>
|
||||
|
||||
|
||||
181
src/views/admin/OrderGrabShare.vue
Normal file
181
src/views/admin/OrderGrabShare.vue
Normal file
@@ -0,0 +1,181 @@
|
||||
<template>
|
||||
<div class="order-grab-share" v-loading="loading">
|
||||
<el-alert
|
||||
type="info"
|
||||
:closable="false"
|
||||
show-icon
|
||||
title="单向互通:配置「抢单方」可抢「订单方」的待接单。反向需另加一条。关停请删除规则。"
|
||||
style="margin-bottom: 16px"
|
||||
/>
|
||||
|
||||
<div class="toolbar">
|
||||
<el-select v-model="form.grabber_club_id" placeholder="抢单方俱乐部" filterable style="width: 200px">
|
||||
<el-option
|
||||
v-for="c in clubOptions"
|
||||
:key="c.club_id"
|
||||
:label="`${c.name} (${c.club_id})`"
|
||||
:value="c.club_id"
|
||||
/>
|
||||
</el-select>
|
||||
<span class="arrow">可抢 →</span>
|
||||
<el-select v-model="form.order_club_id" placeholder="订单所属俱乐部" filterable style="width: 200px">
|
||||
<el-option
|
||||
v-for="c in clubOptions"
|
||||
:key="`o-${c.club_id}`"
|
||||
:label="`${c.name} (${c.club_id})`"
|
||||
:value="c.club_id"
|
||||
/>
|
||||
</el-select>
|
||||
<el-button type="primary" :loading="adding" @click="addLink">添加规则</el-button>
|
||||
<el-button @click="fetchList">刷新</el-button>
|
||||
</div>
|
||||
|
||||
<el-table :data="list" border style="margin-top: 16px">
|
||||
<el-table-column prop="grabber_club_id" label="抢单方" min-width="160">
|
||||
<template #default="{ row }">
|
||||
{{ row.grabber_club_name }} ({{ row.grabber_club_id }})
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="order_club_id" label="可抢订单所属" min-width="160">
|
||||
<template #default="{ row }">
|
||||
{{ row.order_club_name }} ({{ row.order_club_id }})
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="create_time" label="创建时间" width="180" />
|
||||
<el-table-column label="操作" width="100" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button type="danger" link @click="removeLink(row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive, onMounted } from 'vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import request from '@/utils/request'
|
||||
import { JITUAN_API } from '@/utils/club-context'
|
||||
|
||||
const username = localStorage.getItem('username') || ''
|
||||
const loading = ref(false)
|
||||
const adding = ref(false)
|
||||
const list = ref([])
|
||||
const clubOptions = ref([])
|
||||
const form = reactive({
|
||||
grabber_club_id: '',
|
||||
order_club_id: '',
|
||||
})
|
||||
|
||||
async function loadClubs() {
|
||||
try {
|
||||
const res = await request.get(JITUAN_API.clubList, { skipErrorToast: true })
|
||||
if (res.code === 0 && Array.isArray(res.data)) {
|
||||
clubOptions.value = res.data.map((c) => ({
|
||||
club_id: c.club_id,
|
||||
name: c.name || c.club_id,
|
||||
}))
|
||||
}
|
||||
} catch {
|
||||
clubOptions.value = []
|
||||
}
|
||||
}
|
||||
|
||||
async function fetchList() {
|
||||
loading.value = true
|
||||
try {
|
||||
const res = await request.post(JITUAN_API.orderGrabLink, {
|
||||
username,
|
||||
action: 'list',
|
||||
})
|
||||
if (res.code === 0) {
|
||||
list.value = res.data?.list || []
|
||||
} else {
|
||||
ElMessage.error(res.msg || '加载失败')
|
||||
}
|
||||
} catch {
|
||||
ElMessage.error('网络错误')
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
async function addLink() {
|
||||
if (!form.grabber_club_id || !form.order_club_id) {
|
||||
ElMessage.warning('请选择抢单方与订单方俱乐部')
|
||||
return
|
||||
}
|
||||
if (form.grabber_club_id === form.order_club_id) {
|
||||
ElMessage.warning('不能配置本店抢本店')
|
||||
return
|
||||
}
|
||||
adding.value = true
|
||||
try {
|
||||
const res = await request.post(JITUAN_API.orderGrabLink, {
|
||||
username,
|
||||
action: 'add',
|
||||
grabber_club_id: form.grabber_club_id,
|
||||
order_club_id: form.order_club_id,
|
||||
})
|
||||
if (res.code === 0) {
|
||||
ElMessage.success('已添加')
|
||||
form.order_club_id = ''
|
||||
await fetchList()
|
||||
} else {
|
||||
ElMessage.error(res.msg || '添加失败')
|
||||
}
|
||||
} catch {
|
||||
ElMessage.error('网络错误')
|
||||
} finally {
|
||||
adding.value = false
|
||||
}
|
||||
}
|
||||
|
||||
async function removeLink(row) {
|
||||
try {
|
||||
await ElMessageBox.confirm(
|
||||
`删除规则:${row.grabber_club_name} 可抢 ${row.order_club_name}?`,
|
||||
'确认',
|
||||
{ type: 'warning' },
|
||||
)
|
||||
} catch {
|
||||
return
|
||||
}
|
||||
try {
|
||||
const res = await request.post(JITUAN_API.orderGrabLink, {
|
||||
username,
|
||||
action: 'delete',
|
||||
id: row.id,
|
||||
})
|
||||
if (res.code === 0) {
|
||||
ElMessage.success('已删除')
|
||||
await fetchList()
|
||||
} else {
|
||||
ElMessage.error(res.msg || '删除失败')
|
||||
}
|
||||
} catch {
|
||||
ElMessage.error('网络错误')
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
await loadClubs()
|
||||
await fetchList()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.order-grab-share {
|
||||
padding: 16px 20px;
|
||||
}
|
||||
.toolbar {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
.arrow {
|
||||
color: #666;
|
||||
font-size: 13px;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user