From 4fdfd05ef6f1f157923b4131bb8faae9a16245dd Mon Sep 17 00:00:00 2001 From: chenfang Date: Wed, 17 Jan 2024 15:48:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BE=9B=E5=BA=94=E5=95=86=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E6=97=B6=E8=AE=BE=E7=BD=AE=E5=AD=97=E6=AE=B5=E4=B8=8D=E5=8F=AF?= =?UTF-8?q?=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../supplierManage/supplier/index.vue | 20 +++++++++++++++++++ .../supplierManage/supplier/supplier.data.ts | 3 ++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/views/wms/basicDataManage/supplierManage/supplier/index.vue b/src/views/wms/basicDataManage/supplierManage/supplier/index.vue index 8d03c7b9c..40e74742a 100644 --- a/src/views/wms/basicDataManage/supplierManage/supplier/index.vue +++ b/src/views/wms/basicDataManage/supplierManage/supplier/index.vue @@ -141,6 +141,25 @@ const buttonTableClick = async (val, row) => { /** 添加/修改操作 */ const basicFormRef = ref() const openForm = (type: string, row?: any) => { + if(type == "update"){ + Supplier.allSchemas.formSchema.forEach((item) => { + if (item.field == 'code') { + item.componentProps.disabled = true + } + if (item.field == 'shortName') { + item.componentProps.disabled = true + } + }) + }else { + Supplier.allSchemas.formSchema.forEach((item) => { + if (item.field == 'code') { + item.componentProps.disabled = false + } + if (item.field == 'shortName') { + item.componentProps.disabled = false + } + }) + } basicFormRef.value.open(type, row) } const formsSuccess = async (formType, data) => { @@ -159,6 +178,7 @@ const formsSuccess = async (formType, data) => { await SupplierApi.createSupplier(data) message.success(t('common.createSuccess')) } else { + await SupplierApi.updateSupplier(data) message.success(t('common.updateSuccess')) } diff --git a/src/views/wms/basicDataManage/supplierManage/supplier/supplier.data.ts b/src/views/wms/basicDataManage/supplierManage/supplier/supplier.data.ts index 284ca2a7c..f57a56433 100644 --- a/src/views/wms/basicDataManage/supplierManage/supplier/supplier.data.ts +++ b/src/views/wms/basicDataManage/supplierManage/supplier/supplier.data.ts @@ -150,7 +150,8 @@ export const Supplier = useCrudSchemas(reactive([ value: 'TRUE', componentProps: { inactiveValue: 'FALSE', - activeValue: 'TRUE' + activeValue: 'TRUE', + disabled: true } }, table: {