From 70a956febe46db2bcba4de8b70f765fd75a9d722 Mon Sep 17 00:00:00 2001 From: WUSIJIAN <13825895+wsj0228@user.noreply.gitee.com> Date: Wed, 14 Jan 2026 13:58:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=A8=E8=B5=84=E4=BA=A7=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E4=B8=AD=E6=96=B0=E5=A2=9E=E5=BA=93=E5=AD=98=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E5=AD=97=E6=AE=B5,=E6=94=AF=E6=8C=81=E6=9C=89=E9=99=90?= =?UTF-8?q?=E5=BA=93=E5=AD=98=E5=92=8C=E6=97=A0=E9=99=90=E5=BA=93=E5=AD=98?= =?UTF-8?q?=E4=B8=A4=E7=A7=8D=E6=A8=A1=E5=BC=8F,=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E6=97=B6=E7=A6=81=E6=AD=A2=E4=BF=AE=E6=94=B9=E5=BA=93=E5=AD=98?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B,=E5=90=8C=E6=97=B6=E5=9C=A8SKU=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E4=B8=AD=E4=B8=BA=E6=97=A0=E9=99=90=E5=BA=93=E5=AD=98?= =?UTF-8?q?=E8=B5=84=E4=BA=A7=E6=96=B0=E5=A2=9E=E7=94=9F=E6=88=90=E5=BA=93?= =?UTF-8?q?=E5=AD=98=E6=8C=89=E9=92=AE=E5=B9=B6=E7=A7=BB=E9=99=A4=E5=BA=93?= =?UTF-8?q?=E5=AD=98=E6=95=B0=E9=87=8F=E7=BC=96=E8=BE=91=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/assets/asset/component/editAsset.vue | 14 ++++++++++++++ src/views/assets/asset/component/skuDialog.vue | 17 +++++++++++------ src/views/assets/asset/index.vue | 8 +++++++- 3 files changed, 32 insertions(+), 7 deletions(-) diff --git a/src/views/assets/asset/component/editAsset.vue b/src/views/assets/asset/component/editAsset.vue index 43d548e..55d27f0 100644 --- a/src/views/assets/asset/component/editAsset.vue +++ b/src/views/assets/asset/component/editAsset.vue @@ -62,6 +62,14 @@ /> + + + + 有限库存 + 无限库存 + + + @@ -486,6 +494,7 @@ interface RuleForm { description: string; onlineTime: string; offlineTime: string; + unlimitedStock: boolean; physicalAssetConfig: { shipping: { deliveryMethod: string; @@ -588,6 +597,7 @@ const getInitialForm = (): RuleForm => ({ description: '', onlineTime: '', offlineTime: '', + unlimitedStock: false, physicalAssetConfig: { shipping: { deliveryMethod: 'express', @@ -892,6 +902,7 @@ const openDialog = (row?: any, edit?: boolean) => { ruleForm.description = data.description || ''; ruleForm.onlineTime = data.onlineTime || ''; ruleForm.offlineTime = data.offlineTime || ''; + ruleForm.unlimitedStock = data.unlimitedStock || false; // 主图预览 (支持 imageUrl 和 fileURL) const mainImg = data.imageUrl || data.fileURL; @@ -1096,6 +1107,9 @@ const buildRequestBody = async (): Promise => { body.offlineTime = ruleForm.offlineTime; } + // 库存类型 + body.unlimitedStock = ruleForm.unlimitedStock; + // 主图 (已在上传时直接赋值给 ruleForm.mainImage) if (ruleForm.mainImage) { body.imageURL = ruleForm.mainImage; diff --git a/src/views/assets/asset/component/skuDialog.vue b/src/views/assets/asset/component/skuDialog.vue index 90929a1..c812a6b 100644 --- a/src/views/assets/asset/component/skuDialog.vue +++ b/src/views/assets/asset/component/skuDialog.vue @@ -78,9 +78,10 @@ - + @@ -131,10 +132,6 @@ - - - 无限库存 - 激活 @@ -199,6 +196,7 @@ const editSkuId = ref(''); const assetId = ref(''); const assetName = ref(''); const assetType = ref(''); +const unlimitedStock = ref(false); // 资产是否无限库存 const assetSpecAttrs = ref([]); const fileAddressPrefix = ref(''); const skuImagePreview = ref(''); @@ -264,10 +262,11 @@ const skuRules: FormRules = { }; // 打开弹窗 -const openDialog = (row: { id: string; name: string; type?: string }) => { +const openDialog = (row: { id: string; name: string; type?: string; unlimitedStock?: boolean }) => { assetId.value = row.id; assetName.value = row.name; assetType.value = row.type || ''; + unlimitedStock.value = row.unlimitedStock || false; dialogVisible.value = true; resetQuery(); getSkuList(); @@ -479,6 +478,12 @@ const onDeleteSku = (row: any) => { .catch(() => {}); }; +// 生成库存 +const onGenerateStock = (row: any) => { + // TODO: 实现生成库存功能 + ElMessage.info(`生成库存功能待实现,SKU: ${row.skuName}`); +}; + // 重置 SKU 表单 const resetSkuForm = () => { skuForm.skuName = ''; diff --git a/src/views/assets/asset/index.vue b/src/views/assets/asset/index.vue index fca335c..3eaae6c 100644 --- a/src/views/assets/asset/index.vue +++ b/src/views/assets/asset/index.vue @@ -112,6 +112,7 @@ interface AssetRow { onlineTime: string; offlineTime: string; status: number; + unlimitedStock: boolean; createdAt: string; updatedAt: string; } @@ -222,7 +223,12 @@ const onEdit = (row: AssetRow) => { // 管理SKU const onAddSku = (row: AssetRow) => { - skuDialogRef.value.openDialog(row); + skuDialogRef.value.openDialog({ + id: row.id, + name: row.name, + type: row.type, + unlimitedStock: row.unlimitedStock, + }); }; // 分页大小改变