From e21a19cc8573285d62a54a29fc786f35b5ea4f77 Mon Sep 17 00:00:00 2001 From: liufumingren Date: Wed, 30 Sep 2026 02:22:54 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E5=95=86=E5=93=81=E7=AE=A1=E7=90=86):=20?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E4=BD=9C=E4=B8=9A=E8=A6=81=E6=B1=82=EF=BC=88?= =?UTF-8?q?=E6=8B=A3=E8=B4=A7/=E5=A4=8D=E6=A0=B8/=E6=89=93=E5=8C=85/?= =?UTF-8?q?=E5=90=88=E5=B9=B6=EF=BC=89=E4=B8=8E=E5=88=97=E8=A1=A8=E7=AD=9B?= =?UTF-8?q?=E9=80=89=EF=BC=88=E6=98=AF=E5=90=A6=E6=9C=89=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E8=A6=81=E6=B1=82=E3=80=81=E6=AF=9B=E9=87=8D=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/stock/stock/component/add.vue | 54 ++++++++++++++-- src/views/stock/stock/component/info.vue | 81 ++++++++++++++++++++++-- src/views/stock/stock/stock-config.ts | 26 ++++++++ 3 files changed, 149 insertions(+), 12 deletions(-) diff --git a/src/views/stock/stock/component/add.vue b/src/views/stock/stock/component/add.vue index dfaaf238..cdaa87e6 100644 --- a/src/views/stock/stock/component/add.vue +++ b/src/views/stock/stock/component/add.vue @@ -213,20 +213,57 @@ - +
-

打包要求

- +

作业要求

+
- - + + + + + 是 + 否 + + + + + + + + +
@@ -512,6 +549,13 @@ const handleBoxSpecToggle = (value: any) => { const prepareSaveData = () => { const data = { ...formData } + + // 要求合并开启:值提交到打包要求,拣货/复核要求传空字符串;未合并则三项各传各的 + if (String(data.merge_requirements ?? '').trim().toUpperCase() === 'Y') { + data.pick_requirements = '' + data.recheck_requirements = '' + } + if (!data.enable_box_spec) { data.box_unit = '' data.quantity_per_box = 0 diff --git a/src/views/stock/stock/component/info.vue b/src/views/stock/stock/component/info.vue index a0113aa6..eae1e921 100644 --- a/src/views/stock/stock/component/info.vue +++ b/src/views/stock/stock/component/info.vue @@ -362,26 +362,81 @@ - + - + + + + + 是 + 否 + + + + + + + + @@ -749,6 +804,12 @@ function toFiniteNumber(v: unknown, fallback = 0): number { } function normalizeStockInfoFormNumbers() { + // 作业要求:文本字段兜底为空串,合并要求只接受 Y/N(缺省 Y) + formData.pick_requirements = formData.pick_requirements ?? '' + formData.recheck_requirements = formData.recheck_requirements ?? '' + formData.packing_requirements = formData.packing_requirements ?? '' + const mergeRaw = String(formData.merge_requirements ?? '').trim().toUpperCase() + formData.merge_requirements = mergeRaw === 'N' ? 'N' : 'Y' formData.tag_price = toFiniteNumber(formData.tag_price, 0) formData.retail_price = toFiniteNumber(formData.retail_price, 0) formData.gross_weight = toFiniteNumber(formData.gross_weight, 0) @@ -872,7 +933,13 @@ async function fetchStockInfo(stockId: number) { function prepareSaveData() { const data = { ...formData } - + + // 要求合并开启:值提交到打包要求,拣货/复核要求传空字符串;未合并则三项各传各的 + if (String(data.merge_requirements ?? '').trim().toUpperCase() === 'Y') { + data.pick_requirements = '' + data.recheck_requirements = '' + } + if (!data.enable_box_spec) { data.box_unit = '' data.quantity_per_box = 0 diff --git a/src/views/stock/stock/stock-config.ts b/src/views/stock/stock/stock-config.ts index efe4e079..cdf55e49 100644 --- a/src/views/stock/stock/stock-config.ts +++ b/src/views/stock/stock/stock-config.ts @@ -346,6 +346,20 @@ export const availableFields = [ type: 'boolean', placeholder: '请选择是否已绑定外部商品' }), + stockScanField('attribute', { + value: 'has_requirements', + label: '是否有作业要求', + type: 'select', + placeholder: '请选择作业要求', + options: [ + { value: 'Y', label: '有作业要求' }, + { value: 'N', label: '无作业要求' }, + { value: 'pick', label: '拣货要求不为空' }, + { value: 'recheck', label: '复核要求不为空' }, + { value: 'packing', label: '打包要求不为空' } + ], + required: false + }), stockScanField('attribute', { value: 'level', label: 'ABC分类', @@ -383,6 +397,14 @@ export const availableFields = [ operators: ['eq', 'ne', 'gt', 'lt', 'ge', 'le'], defaultOperator: 'gt' }), + stockScanField('price', { + value: 'gross_weight', + label: '毛重', + type: 'number', + placeholder: '请输入毛重(g)', + operators: ['eq', 'ne', 'gt', 'lt', 'ge', 'le', 'between'], + defaultOperator: 'ge' + }), // ===== 库存信息(合并为一组,对齐波次列表 ScanBox) ===== { ...scanWorkflowField({ @@ -493,7 +515,11 @@ export const stockDefaultFormData = { item_name: '', sku_property: '', stock_unit: '', + // 作业要求:合并要求为 Y/N(Y=表单只填一个「要求」并提交到 packing_requirements,拣货/复核要求传空字符串;N=三项各传各的) + pick_requirements: '', + recheck_requirements: '', packing_requirements: '', + merge_requirements: 'Y', length: 0.00, width: 0.00, height: 0.00,