feat: 接入拼多多商品审核驳回消息并回写系统草稿 commitId

This commit is contained in:
2026-09-18 13:41:38 +08:00
parent 2ff2407e05
commit 17397f5347
37 changed files with 4055 additions and 17 deletions
@@ -52,6 +52,8 @@ export namespace PddPublishDeskVO {
pddGoodsCommitId?: number;
pddGoodsId?: number;
pddDraftPushedAt?: string;
rejectComment?: string;
rejectTime?: string;
createdBy?: number;
createTime?: string;
updateTime?: string;
@@ -2,6 +2,8 @@
export namespace PddGoodsPublishDTO {
export interface Publish {
pddShopId: number;
/** 关联系统草稿:发布成功后回写 goods_commit_id */
systemDraftId?: number;
primaryProductId: number;
goodsName: string;
goodsDesc?: string;
@@ -2905,6 +2905,15 @@ async function handleSubmit() {
detailFileIds,
thumbFileIdBySkuKey,
);
// 确保有系统草稿并回传 ID,发布结果才能写入 goods_commit_id
if (boundDraftId.value) {
payload.systemDraftId = boundDraftId.value;
} else if (form.pddShopId) {
const saved = await saveDeskDraft(true, { silentSuccess: true });
if (saved?.id) {
payload.systemDraftId = saved.id;
}
}
const res = await publishPddGoodsApi(payload);
message.success(`发布成功,goodsId=${res.goodsId}`);
emit('success');
@@ -70,6 +70,7 @@ const statusLabel: Record<string, { text: string; color: string }> = {
PUBLISHING: { text: '发布中', color: 'processing' },
FAILED: { text: '失败', color: 'error' },
PUBLISHED: { text: '已发布', color: 'success' },
REJECTED: { text: '审核驳回', color: 'error' },
};
const countByShopId = computed(() => {
@@ -102,7 +103,7 @@ const columns = [
{ title: '标题', dataIndex: 'title', key: 'title', ellipsis: true },
{ title: '店铺', dataIndex: 'shopName', key: 'shopName', width: 140 },
{ title: 'SKU数', dataIndex: 'skuCount', key: 'skuCount', width: 88 },
{ title: '状态', key: 'status', width: 100 },
{ title: '状态', key: 'status', width: 140 },
{ title: '拼多多草稿', key: 'platformDraft', width: 148 },
{ title: '更新时间', dataIndex: 'updateTime', key: 'updateTime', width: 170 },
{ title: '操作', key: 'actions', width: 280 },
@@ -605,7 +606,14 @@ onUnmounted(() => stopJobPoll());
{{ statusLabel[record.status]?.text || record.status }}
</Tag>
<div
v-if="record.lastError"
v-if="record.status === 'REJECTED' && record.rejectComment"
class="mt-1 max-w-[160px] truncate text-xs text-red-500"
:title="record.rejectComment"
>
{{ record.rejectComment }}
</div>
<div
v-else-if="record.lastError"
class="mt-1 max-w-[160px] truncate text-xs text-red-500"
:title="record.lastError"
>