优化接单模板匹配
This commit is contained in:
@@ -49,6 +49,7 @@ type MappingFormValues = {
|
||||
itemTitle?: string
|
||||
relSkuId?: string
|
||||
skuNick?: string
|
||||
skuMatchMode: 'fuzzy' | 'exact'
|
||||
mappingType: 'product_default' | 'sku_exact' | 'sku_series'
|
||||
enabled?: boolean
|
||||
}
|
||||
@@ -109,6 +110,7 @@ export default function ProductMatchPanel() {
|
||||
mappingForm.setFieldsValue({
|
||||
mappingType: 'product_default',
|
||||
productScope: 'selected_products',
|
||||
skuMatchMode: 'fuzzy',
|
||||
enabled: true,
|
||||
})
|
||||
}
|
||||
@@ -130,6 +132,7 @@ export default function ProductMatchPanel() {
|
||||
: mappingType === 'sku_series'
|
||||
? normalizeSkuSeriesName(source.skuNick)
|
||||
: source.skuNick,
|
||||
skuMatchMode: 'fuzzy',
|
||||
mappingType,
|
||||
enabled: true,
|
||||
})
|
||||
@@ -145,6 +148,7 @@ export default function ProductMatchPanel() {
|
||||
itemTitle: mapping.itemTitle,
|
||||
relSkuId: mapping.relSkuId,
|
||||
skuNick: mapping.skuNick,
|
||||
skuMatchMode: mapping.skuMatchMode,
|
||||
mappingType: mapping.mappingType,
|
||||
enabled: mapping.enabled,
|
||||
})
|
||||
@@ -224,6 +228,9 @@ export default function ProductMatchPanel() {
|
||||
{row.mappingType !== 'product_default' ? (
|
||||
<Typography.Text type="secondary" style={{ fontSize: 12 }}>
|
||||
{row.mappingType === 'sku_series' ? 'SKU 系列' : 'SKU'} {row.skuNick || row.relSkuId}
|
||||
{row.mappingType === 'sku_series'
|
||||
? ` · ${row.skuMatchMode === 'exact' ? '精确' : '模糊'}`
|
||||
: ''}
|
||||
</Typography.Text>
|
||||
) : null}
|
||||
</div>
|
||||
@@ -405,6 +412,7 @@ export default function ProductMatchPanel() {
|
||||
initialValues={{
|
||||
mappingType: 'product_default',
|
||||
productScope: 'selected_products',
|
||||
skuMatchMode: 'fuzzy',
|
||||
enabled: true,
|
||||
}}
|
||||
onValuesChange={handleMappingValuesChange}
|
||||
@@ -492,9 +500,19 @@ export default function ProductMatchPanel() {
|
||||
</Form.Item>
|
||||
</>
|
||||
) : mappingType === 'sku_series' ? (
|
||||
<Form.Item label="SKU 系列名称" name="skuNick">
|
||||
<Input placeholder="例如:指挥官密钥;自动覆盖 1个、10个等数量规格" />
|
||||
</Form.Item>
|
||||
<>
|
||||
<Form.Item label="SKU 匹配方式" name="skuMatchMode">
|
||||
<Select
|
||||
options={[
|
||||
{ value: 'fuzzy', label: '模糊匹配(默认)' },
|
||||
{ value: 'exact', label: '精确匹配' },
|
||||
]}
|
||||
/>
|
||||
</Form.Item>
|
||||
<Form.Item label="SKU 系列名称" name="skuNick">
|
||||
<Input placeholder="例如:指挥官密钥;自动覆盖 1个、10个等数量规格" />
|
||||
</Form.Item>
|
||||
</>
|
||||
) : null}
|
||||
</>
|
||||
)
|
||||
|
||||
@@ -86,7 +86,6 @@ export default function ProductRulesPanel() {
|
||||
function editRule(rule: WorkProductRule) {
|
||||
setEditingRule(rule)
|
||||
form.setFieldsValue({
|
||||
ruleKey: rule.ruleKey,
|
||||
provider: rule.provider,
|
||||
platform: rule.platform,
|
||||
shopId: rule.shopId,
|
||||
@@ -122,7 +121,7 @@ export default function ProductRulesPanel() {
|
||||
|
||||
async function saveRule(values: {
|
||||
ruleId?: number
|
||||
ruleKey: string
|
||||
ruleKey?: string
|
||||
provider?: string
|
||||
platform?: string
|
||||
shopId?: string
|
||||
@@ -159,6 +158,7 @@ export default function ProductRulesPanel() {
|
||||
await saveAdminWorkProductRule({
|
||||
...payload,
|
||||
ruleId: editingRule?.ruleId,
|
||||
ruleKey: editingRule?.ruleKey || '',
|
||||
match: editingRule?.match,
|
||||
unitPrice: unitMode ? Number(values.unitPrice || 0) : 0,
|
||||
})
|
||||
@@ -472,14 +472,6 @@ export default function ProductRulesPanel() {
|
||||
onFinish={saveRule}
|
||||
>
|
||||
<div className="rule-form-grid-2col">
|
||||
<Form.Item
|
||||
label="规则标识"
|
||||
name="ruleKey"
|
||||
rules={[{ required: true, message: '请输入规则标识' }]}
|
||||
>
|
||||
<Input placeholder="skin-training" disabled={Boolean(editingRule)} />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item label="来源" name="provider">
|
||||
<Input placeholder="如 91kaquan" />
|
||||
</Form.Item>
|
||||
|
||||
@@ -152,6 +152,7 @@ export function saveAdminWorkProductRuleMapping(payload: {
|
||||
itemTitle?: string
|
||||
relSkuId?: string
|
||||
skuNick?: string
|
||||
skuMatchMode?: 'fuzzy' | 'exact'
|
||||
mappingType: 'product_default' | 'sku_exact' | 'sku_series'
|
||||
enabled?: boolean
|
||||
}) {
|
||||
|
||||
@@ -237,6 +237,7 @@ export type WorkProductRuleMapping = {
|
||||
itemTitle: string
|
||||
relSkuId: string
|
||||
skuNick: string
|
||||
skuMatchMode: 'fuzzy' | 'exact'
|
||||
mappingType: 'product_default' | 'sku_exact' | 'sku_series'
|
||||
enabled: boolean
|
||||
createdAt: string
|
||||
|
||||
Reference in New Issue
Block a user