From 92b5ba4d827c8b73640eb0b10e509b5f4b1861ad Mon Sep 17 00:00:00 2001 From: liuxiaoxu <1793812695@qq.com> Date: Tue, 29 Oct 2024 17:56:55 +0800 Subject: [PATCH] =?UTF-8?q?[fix]=E5=B7=A5=E7=A8=8B=E7=AE=A1=E7=90=86=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9bom=E6=96=B0=E5=A2=9E=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E5=A4=87=E6=B3=A8=E5=AD=97=E6=AE=B5=EF=BC=8C?= =?UTF-8?q?=E5=A6=82=E6=9E=9C=E6=B2=A1=E6=9C=89=E5=80=BC=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E4=B8=BA=E2=80=9Cempty=E2=80=9D=20bom=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=8A=A0=E4=B8=8A=E5=9E=8B=E5=8F=B7=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=EF=BC=8C=E8=AE=BE=E7=BD=AE=E5=A4=87=E6=B3=A8=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E5=A6=82=E6=9E=9C=E6=B2=A1=E6=9C=89=E5=80=BC=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E4=B8=BA=E2=80=9Cempty=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/templates/erp/bom/add.html | 18 +++++++++++ .../resources/templates/erp/bom/edit.html | 30 +++++++++++++++++++ 2 files changed, 48 insertions(+) diff --git a/ruoyi-admin/src/main/resources/templates/erp/bom/add.html b/ruoyi-admin/src/main/resources/templates/erp/bom/add.html index 2f0726a0..1f7b53c6 100644 --- a/ruoyi-admin/src/main/resources/templates/erp/bom/add.html +++ b/ruoyi-admin/src/main/resources/templates/erp/bom/add.html @@ -402,6 +402,24 @@ return '备注不能为空'; } } + }, + formatter: function (value, row) { + // 检查 row 是否存在 + if (!row) { + return ""; + } + + // 检查 storageLocation 是否存在 + if (row.storageLocation === undefined || row.storageLocation === null) { + return ""; + } + + // 根据 storageLocation 的值决定返回值 + if (row.storageLocation) { + return row.storageLocation; + } else { + return value; + } } }] }; diff --git a/ruoyi-admin/src/main/resources/templates/erp/bom/edit.html b/ruoyi-admin/src/main/resources/templates/erp/bom/edit.html index f9572aaf..84d1c0e5 100644 --- a/ruoyi-admin/src/main/resources/templates/erp/bom/edit.html +++ b/ruoyi-admin/src/main/resources/templates/erp/bom/edit.html @@ -54,6 +54,12 @@ +
+ +
+ +
+
@@ -203,6 +209,11 @@ align: 'center', title: '描述' }, + { + field: 'materialModel', + align: 'center', + title: '型号' + }, { field: 'brand', align: 'center', @@ -313,6 +324,24 @@ return '备注'; } } + }, + formatter: function (value, row) { + // 检查 row 是否存在 + if (!row) { + return ""; + } + + // 检查 storageLocation 是否存在 + if (row.storageLocation === undefined || row.storageLocation === null) { + return ""; + } + + // 根据 storageLocation 的值决定返回值 + if (row.storageLocation) { + return row.storageLocation; + } else { + return value; + } } } ] @@ -369,6 +398,7 @@ materialName: rowData.materialName, materialType: rowData.materialType, describe: rowData.describe, + materialModel:rowData.materialModel, brand: rowData.brand, unit: rowData.unit, processMethod: rowData.processMethod,