|
|
@ -483,14 +483,69 @@ const handleHandle = async (id: number) => { |
|
|
|
|
|
|
|
/** 添加/修改操作 */ |
|
|
|
const formRef = ref() |
|
|
|
const openForm = async (type: string, row?: number) => { |
|
|
|
ScrapRequestMain.allSchemas.formSchema.forEach((item) => { |
|
|
|
if (item.field == 'q1Number' || item.field == 'q2Number' || item.field == 'q3Number') { |
|
|
|
item.componentProps.enterSearch = true |
|
|
|
item.componentProps.isSearchList = true |
|
|
|
item.componentProps.disabled = false |
|
|
|
const openForm = async (type: string, row?: any) => { |
|
|
|
if (type == 'create') { |
|
|
|
ScrapRequestMain.allSchemas.formSchema.forEach((item) => { |
|
|
|
if (item.field == 'q1Number' || item.field == 'q2Number' || item.field == 'q3Number') { |
|
|
|
item.componentProps.enterSearch = true |
|
|
|
item.componentProps.isSearchList = true |
|
|
|
item.componentProps.disabled = false |
|
|
|
} |
|
|
|
}) |
|
|
|
} else { |
|
|
|
if (row.q1Number) { |
|
|
|
ScrapRequestMain.allSchemas.formSchema.forEach((item) => { |
|
|
|
if (item.field == 'q1Number') { |
|
|
|
item.componentProps.enterSearch = true |
|
|
|
item.componentProps.isSearchList = true |
|
|
|
item.componentProps.disabled = false |
|
|
|
} |
|
|
|
if (item.field == 'q2Number' || item.field == 'q3Number') { |
|
|
|
item.componentProps.enterSearch = false |
|
|
|
item.componentProps.isSearchList = false |
|
|
|
item.componentProps.disabled = true |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
if (row.q2Number) { |
|
|
|
ScrapRequestMain.allSchemas.formSchema.forEach((item) => { |
|
|
|
if (item.field == 'q2Number') { |
|
|
|
item.componentProps.enterSearch = true |
|
|
|
item.componentProps.isSearchList = true |
|
|
|
item.componentProps.disabled = false |
|
|
|
} |
|
|
|
if (item.field == 'q1Number' || item.field == 'q3Number') { |
|
|
|
item.componentProps.enterSearch = false |
|
|
|
item.componentProps.isSearchList = false |
|
|
|
item.componentProps.disabled = true |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
if (row.q3Number) { |
|
|
|
ScrapRequestMain.allSchemas.formSchema.forEach((item) => { |
|
|
|
if (item.field == 'q3Number') { |
|
|
|
item.componentProps.enterSearch = true |
|
|
|
item.componentProps.isSearchList = true |
|
|
|
item.componentProps.disabled = false |
|
|
|
} |
|
|
|
if (item.field == 'q1Number' || item.field == 'q2Number') { |
|
|
|
item.componentProps.enterSearch = false |
|
|
|
item.componentProps.isSearchList = false |
|
|
|
item.componentProps.disabled = true |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
if (!row.q3Number && !row.q2Number && !row.q1Number) { |
|
|
|
ScrapRequestMain.allSchemas.formSchema.forEach((item) => { |
|
|
|
if (item.field == 'q1Number' || item.field == 'q2Number' || item.field == 'q3Number') { |
|
|
|
item.componentProps.enterSearch = true |
|
|
|
item.componentProps.isSearchList = true |
|
|
|
item.componentProps.disabled = false |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
tableData.value = [] // 重置明细数据 |
|
|
|
formRef.value.open(type, row) |
|
|
|
} |
|
|
|