|
@ -141,6 +141,25 @@ const buttonTableClick = async (val, row) => { |
|
|
/** 添加/修改操作 */ |
|
|
/** 添加/修改操作 */ |
|
|
const basicFormRef = ref() |
|
|
const basicFormRef = ref() |
|
|
const openForm = (type: string, row?: any) => { |
|
|
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) |
|
|
basicFormRef.value.open(type, row) |
|
|
} |
|
|
} |
|
|
const formsSuccess = async (formType, data) => { |
|
|
const formsSuccess = async (formType, data) => { |
|
@ -159,6 +178,7 @@ const formsSuccess = async (formType, data) => { |
|
|
await SupplierApi.createSupplier(data) |
|
|
await SupplierApi.createSupplier(data) |
|
|
message.success(t('common.createSuccess')) |
|
|
message.success(t('common.createSuccess')) |
|
|
} else { |
|
|
} else { |
|
|
|
|
|
|
|
|
await SupplierApi.updateSupplier(data) |
|
|
await SupplierApi.updateSupplier(data) |
|
|
message.success(t('common.updateSuccess')) |
|
|
message.success(t('common.updateSuccess')) |
|
|
} |
|
|
} |
|
|