feat(ops): v4.0.4 开发任务多行与版本状态同步、合伙人/门店删除、账单合伙人列
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -12,6 +12,7 @@ import {
|
||||
Input,
|
||||
InputNumber,
|
||||
Modal,
|
||||
Popconfirm,
|
||||
Select,
|
||||
Space,
|
||||
Steps,
|
||||
@@ -302,6 +303,7 @@ export default function StoresPage() {
|
||||
const [categoryTree, setCategoryTree] = useState<CategoryNode[]>([]);
|
||||
const [optionsLoading, setOptionsLoading] = useState(false);
|
||||
const [saving, setSaving] = useState(false);
|
||||
const [deleting, setDeleting] = useState(false);
|
||||
const [phoneMismatch, setPhoneMismatch] = useState<string | null>(null);
|
||||
const deepLinkStoreOpenedRef = useRef(false);
|
||||
|
||||
@@ -372,6 +374,23 @@ export default function StoresPage() {
|
||||
.map((n) => ({ value: n.id, label: n.name }));
|
||||
}, [categoryTree, editCategoryParentId]);
|
||||
|
||||
async function deleteStore(id: string) {
|
||||
setDeleting(true);
|
||||
try {
|
||||
await request(`/admin/stores/${id}`, { method: 'DELETE' });
|
||||
message.success('门店及门店账号已删除');
|
||||
if (detail && String(detail.id) === id) {
|
||||
setDrawerOpen(false);
|
||||
setDetail(null);
|
||||
}
|
||||
void reload();
|
||||
} catch (e) {
|
||||
message.error(e instanceof Error ? e.message : '删除失败');
|
||||
} finally {
|
||||
setDeleting(false);
|
||||
}
|
||||
}
|
||||
|
||||
async function openStoreDetail(row: StoreRow, opts?: { tab?: string }) {
|
||||
const [d, cats] = await Promise.all([
|
||||
request<Record<string, unknown>>(`/admin/stores/${row.id}`),
|
||||
@@ -821,7 +840,7 @@ export default function StoresPage() {
|
||||
{
|
||||
key: 'actions',
|
||||
title: '操作',
|
||||
width: 280,
|
||||
width: 320,
|
||||
fixed: 'right',
|
||||
render: (_, row) => (
|
||||
<Space size={0} wrap>
|
||||
@@ -861,6 +880,17 @@ export default function StoresPage() {
|
||||
>
|
||||
提现
|
||||
</Button>
|
||||
<Popconfirm
|
||||
title="确认删除该门店?"
|
||||
description="将同时删除门店账号;若有关联订单或核销单将禁止删除。"
|
||||
okText="删除"
|
||||
okButtonProps={{ danger: true }}
|
||||
onConfirm={() => void deleteStore(row.id)}
|
||||
>
|
||||
<Button type="link" size="small" danger>
|
||||
删除
|
||||
</Button>
|
||||
</Popconfirm>
|
||||
</Space>
|
||||
),
|
||||
},
|
||||
@@ -1034,6 +1064,17 @@ export default function StoresPage() {
|
||||
void reload();
|
||||
}} />
|
||||
<Button type="primary" loading={saving} onClick={() => void saveStoreDetail()}>保存修改</Button>
|
||||
{detail?.id ? (
|
||||
<Popconfirm
|
||||
title="确认删除该门店?"
|
||||
description="将同时删除门店账号;若有关联订单或核销单将禁止删除。"
|
||||
okText="删除"
|
||||
okButtonProps={{ danger: true }}
|
||||
onConfirm={() => void deleteStore(String(detail.id))}
|
||||
>
|
||||
<Button danger loading={deleting}>删除门店</Button>
|
||||
</Popconfirm>
|
||||
) : null}
|
||||
</Space>
|
||||
)}>
|
||||
{detail && (
|
||||
|
||||
Reference in New Issue
Block a user