Browse Source

供应商编辑时设置字段不可变更

master
chenfang 11 months ago
parent
commit
4fdfd05ef6
  1. 20
      src/views/wms/basicDataManage/supplierManage/supplier/index.vue
  2. 3
      src/views/wms/basicDataManage/supplierManage/supplier/supplier.data.ts

20
src/views/wms/basicDataManage/supplierManage/supplier/index.vue

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

3
src/views/wms/basicDataManage/supplierManage/supplier/supplier.data.ts

@ -150,7 +150,8 @@ export const Supplier = useCrudSchemas(reactive<CrudSchema[]>([
value: 'TRUE', value: 'TRUE',
componentProps: { componentProps: {
inactiveValue: 'FALSE', inactiveValue: 'FALSE',
activeValue: 'TRUE' activeValue: 'TRUE',
disabled: true
} }
}, },
table: { table: {

Loading…
Cancel
Save