refactor: 把内部店和渠道店的绑定关联放到渠道侧去

This commit is contained in:
2026-08-21 11:50:50 +08:00
parent 7e4b0d3e55
commit e030ca6e0a
23 changed files with 344 additions and 148 deletions
@@ -71,8 +71,6 @@ export namespace ShopVO {
platformCode?: string;
/** 平台名称(后端回填) */
platformName?: string;
/** 外部/平台店铺表主键 ID(如 channel_pdd_shop.id) */
externalShopId?: null | number;
/** 关联的拼多多外部店铺(已授权绑定时返回) */
pddShop?: null | PddShopInfo;
/** 创建时间 */
@@ -48,7 +48,7 @@ async function loadDetail() {
}
function openPddShopDetail() {
const pddShopId = shop.value?.pddShop?.id ?? shop.value?.externalShopId;
const pddShopId = shop.value?.pddShop?.id;
if (!pddShopId) {
message.warning('暂无平台店铺信息');
return;
@@ -91,8 +91,8 @@ watch(shopId, loadDetail);
<Descriptions :column="2" bordered size="small" title="基础信息">
<Descriptions.Item label="店铺ID">{{ shop.id }}</Descriptions.Item>
<Descriptions.Item label="平台店铺主键">
{{ shop.externalShopId ?? '-' }}
<Descriptions.Item label="渠道店铺ID">
{{ shop.pddShop?.id ?? '-' }}
</Descriptions.Item>
<Descriptions.Item label="创建时间">
{{ shop.createTime || '-' }}
@@ -335,7 +335,7 @@ function isPddShop(row: ShopVO.Info) {
}
function hasExternalShop(row: ShopVO.Info) {
return Boolean(row.pddShop || row.externalShopId);
return Boolean(row.pddShop);
}
function handleAdd() {
@@ -362,7 +362,7 @@ function handleModalSuccess() {
}
function handleViewExternalShop(record: ShopVO.Info) {
const pddShopId = record.pddShop?.id ?? record.externalShopId;
const pddShopId = record.pddShop?.id;
if (!pddShopId) {
message.warning('暂无外部店铺详情,请先完成授权同步');
return;
@@ -475,10 +475,10 @@ onUnmounted(() => {
{{ row.pddShop.mallName }}
</span>
<span
v-else-if="row.externalShopId"
v-else-if="row.pddShop?.id"
class="text-center text-xs text-slate-500"
>
平台店#{{ row.externalShopId }}
渠道店#{{ row.pddShop.id }}
</span>
</div>
<span v-else class="text-slate-400">-</span>