|
|
@ -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')) |
|
|
|
} |
|
|
|