diff --git a/apps/web/apps/web-antd/src/views/channel/pdd/goods/publish/editor/PddPublishEditor.vue b/apps/web/apps/web-antd/src/views/channel/pdd/goods/publish/editor/PddPublishEditor.vue
index b0741f87..a887cb8f 100644
--- a/apps/web/apps/web-antd/src/views/channel/pdd/goods/publish/editor/PddPublishEditor.vue
+++ b/apps/web/apps/web-antd/src/views/channel/pdd/goods/publish/editor/PddPublishEditor.vue
@@ -759,32 +759,46 @@ function onSkuTableWrapRef(el: HTMLElement | null) {
>
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/apps/web/apps/web-antd/src/views/channel/pdd/goods/publish/index.vue b/apps/web/apps/web-antd/src/views/channel/pdd/goods/publish/index.vue
index 57280737..32350711 100644
--- a/apps/web/apps/web-antd/src/views/channel/pdd/goods/publish/index.vue
+++ b/apps/web/apps/web-antd/src/views/channel/pdd/goods/publish/index.vue
@@ -62,6 +62,7 @@ const jobOpen = ref(false);
const jobLoading = ref(false);
const currentJob = ref(null);
const pushingDraftId = ref(null);
+const publishingDraftId = ref(null);
let jobPollTimer: ReturnType | undefined;
const detailOpen = ref(false);
@@ -109,7 +110,7 @@ const columns = [
{ title: '状态', key: 'status', width: 140 },
{ title: '投递统计', key: 'deliveryStat', width: 160 },
{ title: '更新时间', dataIndex: 'updateTime', key: 'updateTime', width: 170 },
- { title: '操作', key: 'actions', width: 280 },
+ { title: '操作', key: 'actions', width: 320 },
];
/** 列表悬停:从草稿 payloadJson.editorState.skuRows 解析 */
@@ -234,6 +235,18 @@ function pushDisabledReason(draft: {
return '';
}
+function publishDisabledReason(draft: {
+ pddShopId?: number;
+ payloadJson?: string;
+ status?: string;
+}): string {
+ const base = pushDisabledReason(draft);
+ if (base) return base;
+ if (draft.status === 'NEED_CHECK') return '待校验,请先核对类目和运费';
+ if (draft.status === 'PUBLISHING') return '正在发布中';
+ return '';
+}
+
async function pushPlatform(draft: {
id?: number;
pddShopId?: number;
@@ -399,6 +412,32 @@ async function submitClone() {
}
}
+async function publishOne(draft: {
+ id?: number;
+ pddShopId?: number;
+ payloadJson?: string;
+ status?: string;
+}) {
+ if (draft.id == null) return;
+ const reason = publishDisabledReason(draft);
+ if (reason) {
+ message.warning(reason);
+ return;
+ }
+ publishingDraftId.value = draft.id;
+ try {
+ const job = await createPddPublishDeskJobApi({ draftIds: [draft.id] });
+ currentJob.value = job;
+ jobOpen.value = true;
+ startJobPoll(job.id);
+ await loadDrafts();
+ } catch (e: any) {
+ message.error(e?.message || '创建发布任务失败');
+ } finally {
+ publishingDraftId.value = null;
+ }
+}
+
async function batchPublish() {
if (selectedRowKeys.value.length === 0) {
message.warning('请先勾选草稿');
@@ -640,7 +679,20 @@ onUnmounted(() => stopJobPoll());
:loading="pushingDraftId === record.id"
@click="pushPlatform(record)"
>
- 推送平台
+ 推送
+
+
+
+
+
+