refactor(prefetch): 合并库存相关字段为统一阈值字段
- 将面额的最小库存和目标库存字段合并为单一的库存阈值字段 capacity - 修改接口定义和文档,更新对应的库存阈值说明 - 调整前端表单及表格展示,统一使用库存阈值字段 - 更新表单校验逻辑,确保库存阈值有效且大于0 - 优化提示文案,明确系统根据库存阈值管理预拉取订单库存
This commit is contained in:
@@ -2,11 +2,10 @@
|
|||||||
|
|
||||||
## Properties
|
## Properties
|
||||||
|
|
||||||
| Name | Type | Description | Notes |
|
| Name | Type | Description | Notes |
|
||||||
| ------------------ | ---------- | -------------------------------------------------------- | --------------------------------- |
|
| ---------------- | ---------- | ---------------------------------------- | --------------------------------- |
|
||||||
| **denomination** | **number** | 面额值,如100、200、500等 | [optional] [default to undefined] |
|
| **denomination** | **number** | 面额值,如100、200、500等 | [optional] [default to undefined] |
|
||||||
| **minCapacity** | **number** | 该面额预拉取订单最小库存阈值(当库存低于此值时触发补充) | [optional] [default to undefined] |
|
| **capacity** | **number** | 该面额预拉取订单库存值(统一的库存阈值) | [optional] [default to undefined] |
|
||||||
| **targetCapacity** | **number** | 该面额预拉取订单目标库存(补充时的目标数量) | [optional] [default to undefined] |
|
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
@@ -15,8 +14,7 @@ import { KamiApiCamelOilV1DenominationSetting } from './api';
|
|||||||
|
|
||||||
const instance: KamiApiCamelOilV1DenominationSetting = {
|
const instance: KamiApiCamelOilV1DenominationSetting = {
|
||||||
denomination,
|
denomination,
|
||||||
minCapacity,
|
capacity
|
||||||
targetCapacity
|
|
||||||
};
|
};
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -18,11 +18,7 @@ export interface KamiApiCamelOilV1DenominationSetting {
|
|||||||
*/
|
*/
|
||||||
denomination?: number;
|
denomination?: number;
|
||||||
/**
|
/**
|
||||||
* 该面额预拉取订单最小库存阈值(当库存低于此值时触发补充)
|
* 该面额预拉取订单库存值(统一的库存阈值)
|
||||||
*/
|
*/
|
||||||
minCapacity?: number;
|
capacity?: number;
|
||||||
/**
|
|
||||||
* 该面额预拉取订单目标库存(补充时的目标数量)
|
|
||||||
*/
|
|
||||||
targetCapacity?: number;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -159,7 +159,7 @@
|
|||||||
<a-space>
|
<a-space>
|
||||||
<icon-currency-dollar />
|
<icon-currency-dollar />
|
||||||
<span style="color: var(--color-text-3); font-size: 13px">
|
<span style="color: var(--color-text-3); font-size: 13px">
|
||||||
配置不同面额卡券的最小库存和目标库存,当库存低于最小值时自动补充到目标值
|
配置不同面额卡券的库存阈值,系统将根据此阈值管理预拉取订单库存
|
||||||
</span>
|
</span>
|
||||||
</a-space>
|
</a-space>
|
||||||
</template>
|
</template>
|
||||||
@@ -194,19 +194,11 @@
|
|||||||
@change="validateDenomination(rowIndex)"
|
@change="validateDenomination(rowIndex)"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<template #minCapacity="{ rowIndex }">
|
<template #capacity="{ rowIndex }">
|
||||||
<a-input-number
|
<a-input-number
|
||||||
v-model="formModel.targetDenominations[rowIndex].minCapacity"
|
v-model="formModel.targetDenominations[rowIndex].capacity"
|
||||||
:min="0"
|
|
||||||
placeholder="库存低于此值时触发补充(可为0)"
|
|
||||||
style="width: 100%"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
<template #targetCapacity="{ rowIndex }">
|
|
||||||
<a-input-number
|
|
||||||
v-model="formModel.targetDenominations[rowIndex].targetCapacity"
|
|
||||||
:min="1"
|
:min="1"
|
||||||
placeholder="补充时的目标数量"
|
placeholder="请输入库存阈值"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
@@ -273,16 +265,10 @@ const columns: TableColumnData[] = [
|
|||||||
slotName: 'denomination'
|
slotName: 'denomination'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '最小库存',
|
title: '库存阈值',
|
||||||
dataIndex: 'minCapacity',
|
dataIndex: 'capacity',
|
||||||
width: 150,
|
width: 150,
|
||||||
slotName: 'minCapacity'
|
slotName: 'capacity'
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '目标库存',
|
|
||||||
dataIndex: 'targetCapacity',
|
|
||||||
width: 150,
|
|
||||||
slotName: 'targetCapacity'
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '操作',
|
title: '操作',
|
||||||
@@ -295,8 +281,7 @@ const columns: TableColumnData[] = [
|
|||||||
const addDenomination = () => {
|
const addDenomination = () => {
|
||||||
formModel.targetDenominations.push({
|
formModel.targetDenominations.push({
|
||||||
denomination: null,
|
denomination: null,
|
||||||
minCapacity: null,
|
capacity: null
|
||||||
targetCapacity: null
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -338,16 +323,12 @@ const handleSubmit = async () => {
|
|||||||
) {
|
) {
|
||||||
for (let i = 0; i < formModel.targetDenominations.length; i++) {
|
for (let i = 0; i < formModel.targetDenominations.length; i++) {
|
||||||
const item = formModel.targetDenominations[i];
|
const item = formModel.targetDenominations[i];
|
||||||
if (
|
if (!item.denomination || !item.capacity) {
|
||||||
!item.denomination ||
|
|
||||||
item.minCapacity === null ||
|
|
||||||
!item.targetCapacity
|
|
||||||
) {
|
|
||||||
Message.warning(`请完善第${i + 1}个面额设置的必填项`);
|
Message.warning(`请完善第${i + 1}个面额设置的必填项`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (item.minCapacity >= item.targetCapacity) {
|
if (item.capacity < 1) {
|
||||||
Message.warning(`第${i + 1}个面额设置的最小库存必须小于目标库存`);
|
Message.warning(`第${i + 1}个面额设置的库存阈值必须大于0`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user