Browse Source

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

master
chenfang 8 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 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'))
}

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

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

Loading…
Cancel
Save