|
|
@ -118,6 +118,7 @@ const isShowButton = ref(true) |
|
|
|
const updataTableColumns = (val) => { |
|
|
|
tableColumns.value = val |
|
|
|
} |
|
|
|
const manageModeOptions = ref(JSON.parse(JSON.stringify(Itemarea.allSchemas.formSchema.find(item=>item.field == 'manageMode').componentProps.options))) |
|
|
|
|
|
|
|
// 查询页面返回 |
|
|
|
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => { |
|
|
@ -147,6 +148,21 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => |
|
|
|
setV['areaCode'] = val[0]['code'] |
|
|
|
setV['areaType'] = val[0]['type'] |
|
|
|
setV['manageMode'] = val[0]['manageMode'] |
|
|
|
if (val[0]['type'] == 'WIP') { |
|
|
|
Itemarea.allSchemas.formSchema.forEach((item) => { |
|
|
|
if (item.field == 'manageMode') { |
|
|
|
item.componentProps.options = manageModeOptions.value |
|
|
|
setV['manageMode'] = item.componentProps.options[0].value |
|
|
|
} |
|
|
|
}) |
|
|
|
} else { |
|
|
|
Itemarea.allSchemas.formSchema.forEach((item) => { |
|
|
|
if (item.field == 'manageMode') { |
|
|
|
item.componentProps.options = manageModeOptions.value?.filter(item=>item.value!='BY_QUANTITY') |
|
|
|
setV['manageMode'] = item.componentProps.options[0].value |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
}else if(formField == 'inPackUnit') { |
|
|
|
setV['inPackUnit'] = val[0]['packUnit'] |
|
|
@ -305,28 +321,38 @@ const handleDisable = async (id: number) => { |
|
|
|
/** 添加/修改操作 */ |
|
|
|
const formRef = ref() |
|
|
|
const openForm =async (type: string, row?: number) => { |
|
|
|
formRef.value.open(type, row) |
|
|
|
nextTick(() => { |
|
|
|
if(type == "update"){ |
|
|
|
Itemarea.allSchemas.formSchema.forEach((item) => { |
|
|
|
if (item.field == 'areaCode') { |
|
|
|
item.componentProps.isSearchList = false, |
|
|
|
item.componentProps.disabled = true |
|
|
|
} |
|
|
|
if (item.field == 'itemCode') { |
|
|
|
}else if (item.field == 'itemCode') { |
|
|
|
item.componentProps.isSearchList = false, |
|
|
|
item.componentProps.disabled = true |
|
|
|
}}) |
|
|
|
} else if (item.field == 'manageMode') { |
|
|
|
if (row.areaType == 'WIP') { |
|
|
|
item.componentProps.options = manageModeOptions.value |
|
|
|
} else { |
|
|
|
item.componentProps.options =manageModeOptions.value?.filter(item=>item.value!='BY_QUANTITY') |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}else { |
|
|
|
Itemarea.allSchemas.formSchema.forEach((item) => { |
|
|
|
if (item.field == 'areaCode') { |
|
|
|
item.componentProps.isSearchList = true |
|
|
|
} |
|
|
|
if (item.field == 'itemCode') { |
|
|
|
}else if (item.field == 'itemCode') { |
|
|
|
item.componentProps.isSearchList = true |
|
|
|
}else if (item.field == 'manageMode') { |
|
|
|
item.componentProps.options = manageModeOptions.value?.filter(item=>item.value!='BY_QUANTITY') |
|
|
|
formRef.value.formRef.formModel.manageMode = item.componentProps.options[0].value |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
tableData.value = [] // 重置明细数据 |
|
|
|
formRef.value.open(type, row) |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|