mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-25 21:09:19 +08:00
Compare commits
2
Commits
641520eaa8
...
26f438eb6a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
26f438eb6a | ||
|
|
f2556c58cc |
@@ -14,6 +14,11 @@ API文档/商品API/pdd.goods.add
|
|||||||
|
|
||||||
单个商品发布,需要配合pdd.goods.img.upload上传主图及商品详情图片。
|
单个商品发布,需要配合pdd.goods.img.upload上传主图及商品详情图片。
|
||||||
|
|
||||||
|
> **与本系统 `PddGoodsPublishDTO` 对照**(勿与轮播混淆)
|
||||||
|
> - `carousel_gallery` → `carouselImages`(商品轮播图,1:1,必填)
|
||||||
|
> - `detail_gallery` → `detailImages`(商品详情图,必填)
|
||||||
|
> - `image_url` → `imageUrl`(**商品主图**,首页大图 750×352,非必填;部分活动必填)
|
||||||
|
|
||||||
### 公共参数
|
### 公共参数
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+12
-3
@@ -63,15 +63,24 @@ public class PddGoodsPublishDTO {
|
|||||||
@Max(value = 100, message = "满两件折扣范围为0-100")
|
@Max(value = 100, message = "满两件折扣范围为0-100")
|
||||||
private Integer twoPiecesDiscount = 95;
|
private Integer twoPiecesDiscount = 95;
|
||||||
|
|
||||||
/** 轮播图:本系统 fileId,或已是拼多多 CDN 的 URL */
|
/**
|
||||||
|
* 商品轮播图,对应开放平台 {@code carousel_gallery}(必填)。
|
||||||
|
* 入参为本系统 fileId 或已转传的拼多多 CDN URL;规格见 pdd.goods.add 文档。
|
||||||
|
*/
|
||||||
@NotEmpty(message = "轮播图不能为空")
|
@NotEmpty(message = "轮播图不能为空")
|
||||||
private List<String> carouselImages;
|
private List<String> carouselImages;
|
||||||
|
|
||||||
/** 详情图 */
|
/**
|
||||||
|
* 商品详情图,对应开放平台 {@code detail_gallery}(必填)。
|
||||||
|
* 入参为本系统 fileId 或已转传的 URL;规格见 pdd.goods.add 文档。
|
||||||
|
*/
|
||||||
@NotEmpty(message = "详情图不能为空")
|
@NotEmpty(message = "详情图不能为空")
|
||||||
private List<String> detailImages;
|
private List<String> detailImages;
|
||||||
|
|
||||||
/** 活动主图(可选):fileId 或 URL */
|
/**
|
||||||
|
* 商品主图,对应开放平台 {@code image_url}(非必填;参加部分活动则必填)。
|
||||||
|
* 与轮播图不同:首页大图 750×352 等约束见 pdd.goods.add 文档。入参为 fileId 或 URL。
|
||||||
|
*/
|
||||||
private String imageUrl;
|
private String imageUrl;
|
||||||
|
|
||||||
/** 商品属性(类目模板非销售属性) */
|
/** 商品属性(类目模板非销售属性) */
|
||||||
|
|||||||
+1
-1
@@ -37,7 +37,7 @@ public class PddGoodsPublishSkuDTO {
|
|||||||
@NotNull(message = "重量不能为空")
|
@NotNull(message = "重量不能为空")
|
||||||
private Long weight;
|
private Long weight;
|
||||||
|
|
||||||
/** 缩略图:fileId 或 URL */
|
/** SKU 缩略图,对应 sku_list.thumb_url(必填);fileId 或已转传 URL */
|
||||||
@NotBlank(message = "SKU缩略图不能为空")
|
@NotBlank(message = "SKU缩略图不能为空")
|
||||||
private String thumbImage;
|
private String thumbImage;
|
||||||
|
|
||||||
|
|||||||
+1
@@ -344,6 +344,7 @@ public class PddGoodsPublishServiceImpl implements PddGoodsPublishService {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 组装 POP 商品命令。strict=true 走发布强校验;false 仅要求能组包,缺图/SKU 交给平台报错。
|
* 组装 POP 商品命令。strict=true 走发布强校验;false 仅要求能组包,缺图/SKU 交给平台报错。
|
||||||
|
* 图片:carouselImages/detailImages/imageUrl 分别映射 carousel_gallery、detail_gallery、image_url(商品主图)。
|
||||||
*/
|
*/
|
||||||
private PddGoodsPublishPopApiClient.GoodsAddCommand assembleAddCommand(
|
private PddGoodsPublishPopApiClient.GoodsAddCommand assembleAddCommand(
|
||||||
PddGoodsPublishDTO dto, Long companyId, ShopAuth ctx, boolean strict) throws Exception {
|
PddGoodsPublishDTO dto, Long companyId, ShopAuth ctx, boolean strict) throws Exception {
|
||||||
|
|||||||
+5
@@ -726,6 +726,11 @@ public class PddGoodsPublishPopApiClient {
|
|||||||
String specIdList, List<SkuPropertyItem> skuProperties) {
|
String specIdList, List<SkuPropertyItem> skuProperties) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* pdd.goods.add / 草稿提交共用上行;字段名与开放平台一致。
|
||||||
|
* 与 {@link top.xyquan.ecomdmbbackend.modules.channel.pdd.goods.model.dto.publish.PddGoodsPublishDTO}
|
||||||
|
* 映射:carouselImages→carouselGallery,detailImages→detailGallery,imageUrl→imageUrl(商品主图)。
|
||||||
|
*/
|
||||||
public record GoodsAddCommand(
|
public record GoodsAddCommand(
|
||||||
String goodsName,
|
String goodsName,
|
||||||
String goodsDesc,
|
String goodsDesc,
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
export namespace PddGoodsPublishDTO {
|
export namespace PddGoodsPublishDTO {
|
||||||
export interface Publish {
|
export interface Publish {
|
||||||
pddShopId: number;
|
pddShopId: number;
|
||||||
/** 关联系统草稿:发布成功后回写 goods_commit_id */
|
/** 关联系统草稿 ID;正式发布成功后更新草稿状态并累加店铺发布次数 */
|
||||||
systemDraftId?: number;
|
systemDraftId?: number;
|
||||||
goodsName: string;
|
goodsName: string;
|
||||||
goodsDesc?: string;
|
goodsDesc?: string;
|
||||||
@@ -16,9 +16,11 @@ export namespace PddGoodsPublishDTO {
|
|||||||
secondHand: boolean;
|
secondHand: boolean;
|
||||||
/** 满2件折扣 0-100,默认 95 */
|
/** 满2件折扣 0-100,默认 95 */
|
||||||
twoPiecesDiscount: number;
|
twoPiecesDiscount: number;
|
||||||
/** fileId 字符串或已转传的 URL */
|
/** 轮播图 carousel_gallery(必填);fileId 或已转传 URL,规格见 pdd.goods.add */
|
||||||
carouselImages: string[];
|
carouselImages: string[];
|
||||||
|
/** 详情图 detail_gallery(必填);fileId 或已转传 URL */
|
||||||
detailImages: string[];
|
detailImages: string[];
|
||||||
|
/** 商品主图 image_url(可选,部分活动必填);与轮播图不同,750×352 等见 pdd.goods.add */
|
||||||
imageUrl?: string;
|
imageUrl?: string;
|
||||||
goodsProperties?: GoodsProperty[];
|
goodsProperties?: GoodsProperty[];
|
||||||
skus: PublishSku[];
|
skus: PublishSku[];
|
||||||
@@ -46,6 +48,7 @@ export namespace PddGoodsPublishDTO {
|
|||||||
multiPriceFen: number;
|
multiPriceFen: number;
|
||||||
quantity: number;
|
quantity: number;
|
||||||
weight: number;
|
weight: number;
|
||||||
|
/** SKU 缩略图 thumb_url(必填);fileId 或已转传 URL */
|
||||||
thumbImage: string;
|
thumbImage: string;
|
||||||
specIdList: string;
|
specIdList: string;
|
||||||
isOnsale?: number;
|
isOnsale?: number;
|
||||||
|
|||||||
+316
-278
@@ -450,292 +450,303 @@ function onSkuTableWrapRef(el: HTMLElement | null) {
|
|||||||
</Teleport>
|
</Teleport>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
class="min-h-0 flex-1 space-y-4 overflow-y-auto overscroll-y-contain px-4 py-3"
|
class="publish-editor-sections min-h-0 flex-1 overflow-y-auto overscroll-y-contain px-4 py-4"
|
||||||
>
|
>
|
||||||
<div
|
<Card size="small" class="publish-editor-section" title="基础信息">
|
||||||
data-agent-field="goodsName"
|
<div
|
||||||
:class="{ 'agent-typing-field': agentTypingField === 'goodsName' }"
|
data-agent-field="goodsName"
|
||||||
>
|
:class="{ 'agent-typing-field': agentTypingField === 'goodsName' }"
|
||||||
<Form.Item label="商品标题" required>
|
>
|
||||||
<Input v-model:value="form.goodsName" :maxlength="60" show-count />
|
<Form.Item label="商品标题" required>
|
||||||
</Form.Item>
|
<Input v-model:value="form.goodsName" :maxlength="60" show-count />
|
||||||
</div>
|
</Form.Item>
|
||||||
<div
|
</div>
|
||||||
data-agent-field="goodsDesc"
|
<div
|
||||||
:class="{ 'agent-typing-field': agentTypingField === 'goodsDesc' }"
|
data-agent-field="goodsDesc"
|
||||||
>
|
:class="{ 'agent-typing-field': agentTypingField === 'goodsDesc' }"
|
||||||
<Form.Item label="商品描述">
|
>
|
||||||
<Input.TextArea
|
<Form.Item label="商品描述">
|
||||||
v-model:value="form.goodsDesc"
|
<Input.TextArea
|
||||||
:rows="2"
|
v-model:value="form.goodsDesc"
|
||||||
placeholder="可选,20-500 字"
|
:rows="2"
|
||||||
/>
|
placeholder="可选,20-500 字"
|
||||||
</Form.Item>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<Form.Item label="运费模板" required>
|
|
||||||
<Select
|
|
||||||
v-model:value="form.costTemplateId"
|
|
||||||
class="w-full"
|
|
||||||
:options="logisticsOptions"
|
|
||||||
placeholder="选择运费模板"
|
|
||||||
show-search
|
|
||||||
option-filter-prop="label"
|
|
||||||
:disabled="!form.pddShopId"
|
|
||||||
allow-clear
|
|
||||||
@change="(v: any) => loadCostTemplateDetail(v)"
|
|
||||||
/>
|
|
||||||
</Form.Item>
|
|
||||||
|
|
||||||
<Card
|
|
||||||
v-if="form.costTemplateId || costTemplateDetailLoading"
|
|
||||||
size="small"
|
|
||||||
class="mb-3"
|
|
||||||
title="运费模板详情"
|
|
||||||
>
|
|
||||||
<Spin :spinning="costTemplateDetailLoading">
|
|
||||||
<template v-if="costTemplateDetail">
|
|
||||||
<Descriptions bordered size="small" :column="2" class="mb-3">
|
|
||||||
<Descriptions.Item label="模板名称">
|
|
||||||
{{ costTemplateDetail.templateName || '-' }}
|
|
||||||
</Descriptions.Item>
|
|
||||||
<Descriptions.Item label="计费方式">
|
|
||||||
{{ costTemplateDetail.costTypeLabel || '-' }}
|
|
||||||
</Descriptions.Item>
|
|
||||||
<Descriptions.Item label="增值服务">
|
|
||||||
{{ costTemplateDetail.additionalServiceLabel || '-' }}
|
|
||||||
</Descriptions.Item>
|
|
||||||
<Descriptions.Item label="其它">
|
|
||||||
<Space :size="4" wrap>
|
|
||||||
<Tag v-if="costTemplateDetail.sfFree" color="success">
|
|
||||||
顺丰包邮
|
|
||||||
</Tag>
|
|
||||||
<Tag
|
|
||||||
v-if="costTemplateDetail.freeDeliverHouse"
|
|
||||||
color="processing"
|
|
||||||
>
|
|
||||||
包邮区送货上门
|
|
||||||
</Tag>
|
|
||||||
<span
|
|
||||||
v-if="
|
|
||||||
!costTemplateDetail.sfFree &&
|
|
||||||
!costTemplateDetail.freeDeliverHouse
|
|
||||||
"
|
|
||||||
>
|
|
||||||
-
|
|
||||||
</span>
|
|
||||||
</Space>
|
|
||||||
</Descriptions.Item>
|
|
||||||
<Descriptions.Item label="包邮省份" :span="2">
|
|
||||||
<div
|
|
||||||
v-if="costTemplateDetail.freeProvinces?.length"
|
|
||||||
class="free-province-tags"
|
|
||||||
>
|
|
||||||
<Tag
|
|
||||||
v-for="(p, idx) in costTemplateDetail.freeProvinces"
|
|
||||||
:key="`${p.provinceId}-${idx}`"
|
|
||||||
>
|
|
||||||
{{ p.province || p.provinceId }}
|
|
||||||
</Tag>
|
|
||||||
</div>
|
|
||||||
<span v-else>暂无</span>
|
|
||||||
</Descriptions.Item>
|
|
||||||
<Descriptions.Item
|
|
||||||
v-if="costTemplateDetail.freeDeliverHouseAreas?.length"
|
|
||||||
label="送货上门地区"
|
|
||||||
:span="2"
|
|
||||||
>
|
|
||||||
{{
|
|
||||||
costTemplateDetail.freeDeliverHouseAreas
|
|
||||||
.map((a) => a.areaText)
|
|
||||||
.filter(Boolean)
|
|
||||||
.join('、') || '-'
|
|
||||||
}}
|
|
||||||
</Descriptions.Item>
|
|
||||||
</Descriptions>
|
|
||||||
|
|
||||||
<Table
|
|
||||||
v-if="costTemplateDetail.paidRegions?.length"
|
|
||||||
size="small"
|
|
||||||
:pagination="false"
|
|
||||||
:data-source="costTemplateDetail.paidRegions"
|
|
||||||
:row-key="(_: any, i?: number) => `paid-${i ?? 0}`"
|
|
||||||
:columns="[
|
|
||||||
{ title: '买家付邮地区', dataIndex: 'provincesText' },
|
|
||||||
{ title: '首费规则', key: 'first', width: 160 },
|
|
||||||
{ title: '续费规则', key: 'add', width: 160 },
|
|
||||||
{ title: '条件包邮', dataIndex: 'freeRuleText', width: 160 },
|
|
||||||
]"
|
|
||||||
>
|
|
||||||
<template #bodyCell="{ column, record }">
|
|
||||||
<template v-if="column.key === 'first'">
|
|
||||||
首{{ record.firstStandard ?? '-'
|
|
||||||
}}{{ costTemplateDetail?.costType === 1 ? 'kg' : '件' }}
|
|
||||||
/ {{ record.firstCostYuan ?? '-' }}元
|
|
||||||
</template>
|
|
||||||
<template v-else-if="column.key === 'add'">
|
|
||||||
续{{ record.addStandard ?? '-'
|
|
||||||
}}{{ costTemplateDetail?.costType === 1 ? 'kg' : '件' }}
|
|
||||||
/ {{ record.addCostYuan ?? '-' }}元
|
|
||||||
</template>
|
|
||||||
</template>
|
|
||||||
</Table>
|
|
||||||
</template>
|
|
||||||
<Empty
|
|
||||||
v-else-if="!costTemplateDetailLoading"
|
|
||||||
description="暂无模板详情"
|
|
||||||
:image="Empty.PRESENTED_IMAGE_SIMPLE"
|
|
||||||
/>
|
|
||||||
</Spin>
|
|
||||||
</Card>
|
|
||||||
|
|
||||||
<div class="grid grid-cols-2 gap-3">
|
|
||||||
<Form.Item label="参考价(元)" required>
|
|
||||||
<InputNumber
|
|
||||||
v-model:value="form.marketPriceYuan"
|
|
||||||
class="w-full"
|
|
||||||
:min="0.01"
|
|
||||||
:precision="2"
|
|
||||||
/>
|
|
||||||
</Form.Item>
|
|
||||||
<Form.Item label="发货时限" required>
|
|
||||||
<Select
|
|
||||||
v-model:value="form.shipmentLimitSecond"
|
|
||||||
class="w-full"
|
|
||||||
:options="[
|
|
||||||
{ label: '24小时', value: 86400 },
|
|
||||||
{ label: '48小时', value: 172800 },
|
|
||||||
]"
|
|
||||||
/>
|
|
||||||
</Form.Item>
|
|
||||||
<Form.Item label="满两件折扣" required>
|
|
||||||
<InputNumber
|
|
||||||
v-model:value="form.twoPiecesDiscount"
|
|
||||||
class="w-full"
|
|
||||||
:min="0"
|
|
||||||
:max="10"
|
|
||||||
:precision="1"
|
|
||||||
:step="0.1"
|
|
||||||
placeholder="9.5 表示 9.5 折,0 取消"
|
|
||||||
/>
|
|
||||||
</Form.Item>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-wrap gap-6">
|
|
||||||
<Form.Item label="假一赔十" required>
|
|
||||||
<Switch v-model:checked="form.isFolt" />
|
|
||||||
</Form.Item>
|
|
||||||
<Form.Item label="7天无理由" required>
|
|
||||||
<Switch v-model:checked="form.isRefundable" />
|
|
||||||
</Form.Item>
|
|
||||||
<Form.Item label="预售" required>
|
|
||||||
<Switch v-model:checked="form.isPreSale" />
|
|
||||||
</Form.Item>
|
|
||||||
<Form.Item label="二手" required>
|
|
||||||
<Switch v-model:checked="form.secondHand" />
|
|
||||||
</Form.Item>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<template v-if="nonSaleProps.length">
|
|
||||||
<div class="mb-1 text-sm font-medium">类目属性</div>
|
|
||||||
<div class="grid grid-cols-2 gap-3">
|
|
||||||
<Form.Item
|
|
||||||
v-for="p in nonSaleProps"
|
|
||||||
:key="String(p.refPid)"
|
|
||||||
:label="p.name"
|
|
||||||
:required="!!p.required"
|
|
||||||
>
|
|
||||||
<CatPropertyField
|
|
||||||
v-model:value="form.goodsPropValues[String(p.refPid)]"
|
|
||||||
v-model:unit="form.goodsPropUnits[String(p.refPid)]"
|
|
||||||
:property="p"
|
|
||||||
/>
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
|
||||||
|
|
||||||
<div class="grid grid-cols-2 gap-4">
|
<template v-if="nonSaleProps.length">
|
||||||
<Form.Item label="轮播图" required>
|
<div class="mb-1 text-sm font-medium">类目属性</div>
|
||||||
<Upload
|
<div class="grid grid-cols-2 gap-3">
|
||||||
v-model:file-list="carouselFileList"
|
<Form.Item
|
||||||
list-type="picture-card"
|
v-for="p in nonSaleProps"
|
||||||
accept="image/jpeg,image/png,image/jpg"
|
:key="String(p.refPid)"
|
||||||
:before-upload="beforeUploadCarousel"
|
:label="p.name"
|
||||||
:on-preview="onPreviewUploadFile"
|
:required="!!p.required"
|
||||||
:on-remove="onRemoveCarousel"
|
>
|
||||||
>
|
<CatPropertyField
|
||||||
<div>
|
v-model:value="form.goodsPropValues[String(p.refPid)]"
|
||||||
<PlusOutlined />
|
v-model:unit="form.goodsPropUnits[String(p.refPid)]"
|
||||||
<div class="mt-1 text-xs">选择</div>
|
:property="p"
|
||||||
</div>
|
/>
|
||||||
</Upload>
|
</Form.Item>
|
||||||
</Form.Item>
|
</div>
|
||||||
<Form.Item label="详情图" required>
|
</template>
|
||||||
<Upload
|
|
||||||
v-model:file-list="detailFileList"
|
|
||||||
list-type="picture-card"
|
|
||||||
accept="image/jpeg,image/png,image/jpg"
|
|
||||||
:before-upload="beforeUploadDetail"
|
|
||||||
:on-preview="onPreviewUploadFile"
|
|
||||||
:on-remove="onRemoveDetail"
|
|
||||||
>
|
|
||||||
<div>
|
|
||||||
<PlusOutlined />
|
|
||||||
<div class="mt-1 text-xs">选择</div>
|
|
||||||
</div>
|
|
||||||
</Upload>
|
|
||||||
</Form.Item>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div
|
<div class="grid grid-cols-2 gap-4">
|
||||||
v-if="form.catId"
|
<Form.Item label="轮播图" required>
|
||||||
data-agent-field="spec"
|
<Upload
|
||||||
class="space-y-4"
|
v-model:file-list="carouselFileList"
|
||||||
:class="{ 'agent-typing-field': agentTypingField === 'spec' }"
|
list-type="picture-card"
|
||||||
>
|
accept="image/jpeg,image/png,image/jpg"
|
||||||
<SpecAxesCard
|
:before-upload="beforeUploadCarousel"
|
||||||
:spec-catalog="specCatalog"
|
:on-preview="onPreviewUploadFile"
|
||||||
:spec-axes="specAxes"
|
:on-remove="onRemoveCarousel"
|
||||||
:can-add-spec-axis="canAddSpecAxis"
|
>
|
||||||
:catalog-options-for-axis="catalogOptionsForAxis"
|
<div>
|
||||||
:spec-value-display="specValueDisplay"
|
<PlusOutlined />
|
||||||
:spec-value-auto-options="specValueAutoOptions"
|
<div class="mt-1 text-xs">选择</div>
|
||||||
@set-list-ref="onSpecAxesListRef"
|
</div>
|
||||||
@axis-catalog-change="onAxisCatalogChange"
|
</Upload>
|
||||||
@spec-value-input="onSpecValueInput"
|
</Form.Item>
|
||||||
@spec-value-commit="onSpecValueCommit"
|
<Form.Item label="详情图" required>
|
||||||
@spec-value-enter="onSpecValueEnter"
|
<Upload
|
||||||
@add-spec-value="addSpecValueSlot"
|
v-model:file-list="detailFileList"
|
||||||
@remove-spec-value="removeSpecValue"
|
list-type="picture-card"
|
||||||
@remove-spec-axis="removeSpecAxis"
|
accept="image/jpeg,image/png,image/jpg"
|
||||||
@add-spec-axis="addSpecAxis"
|
:before-upload="beforeUploadDetail"
|
||||||
|
:on-preview="onPreviewUploadFile"
|
||||||
|
:on-remove="onRemoveDetail"
|
||||||
|
>
|
||||||
|
<div>
|
||||||
|
<PlusOutlined />
|
||||||
|
<div class="mt-1 text-xs">选择</div>
|
||||||
|
</div>
|
||||||
|
</Upload>
|
||||||
|
</Form.Item>
|
||||||
|
</div>
|
||||||
|
</Card>
|
||||||
|
|
||||||
|
<Card size="small" class="publish-editor-section" title="规格与库存">
|
||||||
|
<div
|
||||||
|
v-if="form.catId"
|
||||||
|
data-agent-field="spec"
|
||||||
|
class="publish-editor-spec-stack"
|
||||||
|
:class="{ 'agent-typing-field': agentTypingField === 'spec' }"
|
||||||
|
>
|
||||||
|
<SpecAxesCard
|
||||||
|
:spec-catalog="specCatalog"
|
||||||
|
:spec-axes="specAxes"
|
||||||
|
:can-add-spec-axis="canAddSpecAxis"
|
||||||
|
:catalog-options-for-axis="catalogOptionsForAxis"
|
||||||
|
:spec-value-display="specValueDisplay"
|
||||||
|
:spec-value-auto-options="specValueAutoOptions"
|
||||||
|
@set-list-ref="onSpecAxesListRef"
|
||||||
|
@axis-catalog-change="onAxisCatalogChange"
|
||||||
|
@spec-value-input="onSpecValueInput"
|
||||||
|
@spec-value-commit="onSpecValueCommit"
|
||||||
|
@spec-value-enter="onSpecValueEnter"
|
||||||
|
@add-spec-value="addSpecValueSlot"
|
||||||
|
@remove-spec-value="removeSpecValue"
|
||||||
|
@remove-spec-axis="removeSpecAxis"
|
||||||
|
@add-spec-axis="addSpecAxis"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<SkuTableCard
|
||||||
|
v-model:bind-pick-sku-ids="bindPickSkuIds"
|
||||||
|
:sku-select-options="skuSelectOptions"
|
||||||
|
:sku-rows="skuRows"
|
||||||
|
:spec-axes-length="specAxes.length"
|
||||||
|
:sku-table-columns="skuTableColumns"
|
||||||
|
:sku-table-scroll-x="skuTableScrollX"
|
||||||
|
:sku-spec-cell-display="skuSpecCellDisplay"
|
||||||
|
:sku-spec-cell-auto-options="skuSpecCellAutoOptions"
|
||||||
|
:before-upload-sku="beforeUploadSku"
|
||||||
|
:on-preview-upload-file="onPreviewUploadFile"
|
||||||
|
@search="debouncedLoadSkuCandidates"
|
||||||
|
@dropdown-visible-change="onSkuSelectDropdownOpen"
|
||||||
|
@apply-internal-skus="applyInternalSkusInOrder"
|
||||||
|
@clear-internal-skus="clearInternalSkuBindings"
|
||||||
|
@set-table-wrap-ref="onSkuTableWrapRef"
|
||||||
|
@sku-spec-input="onSkuSpecCellInput"
|
||||||
|
@sku-spec-commit="onSkuSpecCellCommit"
|
||||||
|
@out-sku-sn-change="onOutSkuSnChange"
|
||||||
|
@out-sku-sn-blur="onOutSkuSnBlur"
|
||||||
|
@bind-internal-sku="bindInternalSku"
|
||||||
|
@sku-thumb-file-list-change="onSkuThumbFileListChange"
|
||||||
|
@apply-batch="applySkuBatchFields"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<Empty
|
||||||
|
v-else
|
||||||
|
description="请先选择叶子类目"
|
||||||
|
:image="Empty.PRESENTED_IMAGE_SIMPLE"
|
||||||
/>
|
/>
|
||||||
|
</Card>
|
||||||
|
|
||||||
<SkuTableCard
|
<Card size="small" class="publish-editor-section" title="服务与承诺">
|
||||||
v-model:bind-pick-sku-ids="bindPickSkuIds"
|
<Form.Item label="运费模板" required>
|
||||||
:sku-select-options="skuSelectOptions"
|
<Select
|
||||||
:sku-rows="skuRows"
|
v-model:value="form.costTemplateId"
|
||||||
:spec-axes-length="specAxes.length"
|
class="w-full"
|
||||||
:sku-table-columns="skuTableColumns"
|
:options="logisticsOptions"
|
||||||
:sku-table-scroll-x="skuTableScrollX"
|
placeholder="选择运费模板"
|
||||||
:sku-spec-cell-display="skuSpecCellDisplay"
|
show-search
|
||||||
:sku-spec-cell-auto-options="skuSpecCellAutoOptions"
|
option-filter-prop="label"
|
||||||
:before-upload-sku="beforeUploadSku"
|
:disabled="!form.pddShopId"
|
||||||
:on-preview-upload-file="onPreviewUploadFile"
|
allow-clear
|
||||||
@search="debouncedLoadSkuCandidates"
|
@change="(v: any) => loadCostTemplateDetail(v)"
|
||||||
@dropdown-visible-change="onSkuSelectDropdownOpen"
|
/>
|
||||||
@apply-internal-skus="applyInternalSkusInOrder"
|
</Form.Item>
|
||||||
@clear-internal-skus="clearInternalSkuBindings"
|
|
||||||
@set-table-wrap-ref="onSkuTableWrapRef"
|
<Card
|
||||||
@sku-spec-input="onSkuSpecCellInput"
|
v-if="form.costTemplateId || costTemplateDetailLoading"
|
||||||
@sku-spec-commit="onSkuSpecCellCommit"
|
size="small"
|
||||||
@out-sku-sn-change="onOutSkuSnChange"
|
class="cost-template-detail-card"
|
||||||
@out-sku-sn-blur="onOutSkuSnBlur"
|
title="运费模板详情"
|
||||||
@bind-internal-sku="bindInternalSku"
|
>
|
||||||
@sku-thumb-file-list-change="onSkuThumbFileListChange"
|
<Spin :spinning="costTemplateDetailLoading">
|
||||||
@apply-batch="applySkuBatchFields"
|
<template v-if="costTemplateDetail">
|
||||||
/>
|
<Descriptions bordered size="small" :column="2" class="mb-3">
|
||||||
</div>
|
<Descriptions.Item label="模板名称">
|
||||||
|
{{ costTemplateDetail.templateName || '-' }}
|
||||||
|
</Descriptions.Item>
|
||||||
|
<Descriptions.Item label="计费方式">
|
||||||
|
{{ costTemplateDetail.costTypeLabel || '-' }}
|
||||||
|
</Descriptions.Item>
|
||||||
|
<Descriptions.Item label="增值服务">
|
||||||
|
{{ costTemplateDetail.additionalServiceLabel || '-' }}
|
||||||
|
</Descriptions.Item>
|
||||||
|
<Descriptions.Item label="其它">
|
||||||
|
<Space :size="4" wrap>
|
||||||
|
<Tag v-if="costTemplateDetail.sfFree" color="success">
|
||||||
|
顺丰包邮
|
||||||
|
</Tag>
|
||||||
|
<Tag
|
||||||
|
v-if="costTemplateDetail.freeDeliverHouse"
|
||||||
|
color="processing"
|
||||||
|
>
|
||||||
|
包邮区送货上门
|
||||||
|
</Tag>
|
||||||
|
<span
|
||||||
|
v-if="
|
||||||
|
!costTemplateDetail.sfFree &&
|
||||||
|
!costTemplateDetail.freeDeliverHouse
|
||||||
|
"
|
||||||
|
>
|
||||||
|
-
|
||||||
|
</span>
|
||||||
|
</Space>
|
||||||
|
</Descriptions.Item>
|
||||||
|
<Descriptions.Item label="包邮省份" :span="2">
|
||||||
|
<div
|
||||||
|
v-if="costTemplateDetail.freeProvinces?.length"
|
||||||
|
class="free-province-tags"
|
||||||
|
>
|
||||||
|
<Tag
|
||||||
|
v-for="(p, idx) in costTemplateDetail.freeProvinces"
|
||||||
|
:key="`${p.provinceId}-${idx}`"
|
||||||
|
>
|
||||||
|
{{ p.province || p.provinceId }}
|
||||||
|
</Tag>
|
||||||
|
</div>
|
||||||
|
<span v-else>暂无</span>
|
||||||
|
</Descriptions.Item>
|
||||||
|
<Descriptions.Item
|
||||||
|
v-if="costTemplateDetail.freeDeliverHouseAreas?.length"
|
||||||
|
label="送货上门地区"
|
||||||
|
:span="2"
|
||||||
|
>
|
||||||
|
{{
|
||||||
|
costTemplateDetail.freeDeliverHouseAreas
|
||||||
|
.map((a) => a.areaText)
|
||||||
|
.filter(Boolean)
|
||||||
|
.join('、') || '-'
|
||||||
|
}}
|
||||||
|
</Descriptions.Item>
|
||||||
|
</Descriptions>
|
||||||
|
|
||||||
|
<Table
|
||||||
|
v-if="costTemplateDetail.paidRegions?.length"
|
||||||
|
size="small"
|
||||||
|
:pagination="false"
|
||||||
|
:data-source="costTemplateDetail.paidRegions"
|
||||||
|
:row-key="(_: any, i?: number) => `paid-${i ?? 0}`"
|
||||||
|
:columns="[
|
||||||
|
{ title: '买家付邮地区', dataIndex: 'provincesText' },
|
||||||
|
{ title: '首费规则', key: 'first', width: 160 },
|
||||||
|
{ title: '续费规则', key: 'add', width: 160 },
|
||||||
|
{ title: '条件包邮', dataIndex: 'freeRuleText', width: 160 },
|
||||||
|
]"
|
||||||
|
>
|
||||||
|
<template #bodyCell="{ column, record }">
|
||||||
|
<template v-if="column.key === 'first'">
|
||||||
|
首{{ record.firstStandard ?? '-'
|
||||||
|
}}{{ costTemplateDetail?.costType === 1 ? 'kg' : '件' }}
|
||||||
|
/ {{ record.firstCostYuan ?? '-' }}元
|
||||||
|
</template>
|
||||||
|
<template v-else-if="column.key === 'add'">
|
||||||
|
续{{ record.addStandard ?? '-'
|
||||||
|
}}{{ costTemplateDetail?.costType === 1 ? 'kg' : '件' }}
|
||||||
|
/ {{ record.addCostYuan ?? '-' }}元
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
</Table>
|
||||||
|
</template>
|
||||||
|
<Empty
|
||||||
|
v-else-if="!costTemplateDetailLoading"
|
||||||
|
description="暂无模板详情"
|
||||||
|
:image="Empty.PRESENTED_IMAGE_SIMPLE"
|
||||||
|
/>
|
||||||
|
</Spin>
|
||||||
|
</Card>
|
||||||
|
|
||||||
|
<div class="grid grid-cols-2 gap-3">
|
||||||
|
<Form.Item label="参考价(元)" required>
|
||||||
|
<InputNumber
|
||||||
|
v-model:value="form.marketPriceYuan"
|
||||||
|
class="w-full"
|
||||||
|
:min="0.01"
|
||||||
|
:precision="2"
|
||||||
|
/>
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item label="发货时限" required>
|
||||||
|
<Select
|
||||||
|
v-model:value="form.shipmentLimitSecond"
|
||||||
|
class="w-full"
|
||||||
|
:options="[
|
||||||
|
{ label: '24小时', value: 86400 },
|
||||||
|
{ label: '48小时', value: 172800 },
|
||||||
|
]"
|
||||||
|
/>
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item label="满两件折扣" required>
|
||||||
|
<InputNumber
|
||||||
|
v-model:value="form.twoPiecesDiscount"
|
||||||
|
class="w-full"
|
||||||
|
:min="0"
|
||||||
|
:max="10"
|
||||||
|
:precision="1"
|
||||||
|
:step="0.1"
|
||||||
|
placeholder="9.5 表示 9.5 折,0 取消"
|
||||||
|
/>
|
||||||
|
</Form.Item>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex flex-wrap gap-6">
|
||||||
|
<Form.Item label="假一赔十" required>
|
||||||
|
<Switch v-model:checked="form.isFolt" />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item label="7天无理由" required>
|
||||||
|
<Switch v-model:checked="form.isRefundable" />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item label="预售" required>
|
||||||
|
<Switch v-model:checked="form.isPreSale" />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item label="二手" required>
|
||||||
|
<Switch v-model:checked="form.secondHand" />
|
||||||
|
</Form.Item>
|
||||||
|
</div>
|
||||||
|
</Card>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
@@ -785,6 +796,33 @@ function onSkuTableWrapRef(el: HTMLElement | null) {
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
/* 分区 Card 纵向间距(gap 比 space-y 对 ant-card 更稳定) */
|
||||||
|
.publish-editor-sections {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 1.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.publish-editor-sections :deep(.publish-editor-section.ant-card) {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 规格与库存:销售规格 / SKU 子卡片间距 */
|
||||||
|
.publish-editor-spec-stack {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 1.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.publish-editor-spec-stack :deep(.ant-card) {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 服务与承诺:运费模板详情与下方参考价等字段 */
|
||||||
|
.cost-template-detail-card {
|
||||||
|
margin-bottom: 1.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
/* 智能体逐字改写时的轻量高亮,便于视线跟上 */
|
/* 智能体逐字改写时的轻量高亮,便于视线跟上 */
|
||||||
.agent-typing-field {
|
.agent-typing-field {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|||||||
+12
@@ -192,6 +192,7 @@ function onColumnBatchEnter(
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
<div class="sku-table-card-stack">
|
||||||
<Card size="small" title="内部 SKU 拉入">
|
<Card size="small" title="内部 SKU 拉入">
|
||||||
<div class="flex flex-wrap items-center gap-2">
|
<div class="flex flex-wrap items-center gap-2">
|
||||||
<Select
|
<Select
|
||||||
@@ -491,9 +492,20 @@ function onColumnBatchEnter(
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</Teleport>
|
</Teleport>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
.sku-table-card-stack {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 1.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sku-table-card-stack :deep(.ant-card) {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
.sku-batch-header {
|
.sku-batch-header {
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|||||||
Reference in New Issue
Block a user