feat(库存入库): 小程序品名改商品选择器 + 建品查重
CI / server typecheck + tests (push) Canceled after 0s
CI / web typecheck + tests + miniprogram syntax (push) Canceled after 0s
CI / eslint (观察项,C7 骨架) (push) Canceled after 0s
CI / npm audit (critical 硬拦) (push) Canceled after 0s

- 小程序「品名」格改为商品选择器(搜索已有 / 选中带出上次设置 / 输入新名待新建),
  与 Web 口径一致;生产日期与数量不带出
- 后端 createCatalogSkuForInbound 加查重:同名(+规格)已有启用商品即复用,
  避免重复新建(Web / 小程序 / 批量入库 / 自助采购 四个入口一并生效)
- 新增 GET /mobile/inventory/sku-options;补查重单测与设计文档
This commit is contained in:
雨天
2026-10-11 21:24:26 +08:00
parent af074f9f02
commit ae3df494c0
7 changed files with 432 additions and 9 deletions
+9
View File
@@ -603,6 +603,14 @@ function fetchStockInboundSkuSimilar(params = {}) {
return request(`/mobile/inventory/sku-similar${qs}`);
}
function fetchStockInboundSkuOptions(params = {}) {
const parts = [];
if (params.search) parts.push(`search=${encodeURIComponent(params.search)}`);
if (params.limit) parts.push(`limit=${encodeURIComponent(params.limit)}`);
const qs = parts.length ? `?${parts.join('&')}` : '';
return request(`/mobile/inventory/sku-options${qs}`);
}
function createStockInboundProduct(payload) {
return request('/mobile/catalog/products', {
method: 'POST',
@@ -1310,6 +1318,7 @@ module.exports = {
createStockInboundCategory,
recognizeStockInboundCatalog,
fetchStockInboundSkuSimilar,
fetchStockInboundSkuOptions,
createStockInboundProduct,
submitStockInbound,
recognizeStockInboundLines,