|
|
|
|
@ -1583,6 +1583,7 @@ const rebuildConfirmAllocationsFromSelection = async (existingMap) => {
|
|
|
|
|
const auths = await getDepartmentAuthorizations(node.id)
|
|
|
|
|
if (!auths || auths.length === 0) {
|
|
|
|
|
confirmSelectionError.value = '该预算来源未配置部门授权'
|
|
|
|
|
confirmSelectedBudgetIds.value = [...confirmLastValidBudgetIds.value]
|
|
|
|
|
setConfirmCheckedIds(confirmLastValidBudgetIds.value)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
@ -1615,19 +1616,12 @@ const rebuildConfirmAllocationsFromSelection = async (existingMap) => {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 多预算:同父、唯一授权部门
|
|
|
|
|
const parentId = selectedNodes[0].parent_id ?? null
|
|
|
|
|
const parentMismatch = selectedNodes.some((n) => (n.parent_id ?? null) !== parentId)
|
|
|
|
|
if (parentMismatch) {
|
|
|
|
|
confirmSelectionError.value = '多条预算来源必须同属一个直接父级'
|
|
|
|
|
setConfirmCheckedIds(confirmLastValidBudgetIds.value)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
const rows = []
|
|
|
|
|
for (const node of selectedNodes) {
|
|
|
|
|
const auths = await getDepartmentAuthorizations(node.id)
|
|
|
|
|
if (!auths || auths.length !== 1) {
|
|
|
|
|
confirmSelectionError.value = '多条预算来源时,每条预算必须且仅能授权给一个部门'
|
|
|
|
|
confirmSelectionError.value = '多预算时,每条预算必须且仅能授权给一个部门'
|
|
|
|
|
confirmSelectedBudgetIds.value = [...confirmLastValidBudgetIds.value]
|
|
|
|
|
setConfirmCheckedIds(confirmLastValidBudgetIds.value)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
@ -1825,6 +1819,7 @@ const onConfirmTreeCheckChange = async () => {
|
|
|
|
|
if (mySeq !== rebuildSeq.value) return
|
|
|
|
|
if (confirmSelectionError.value) {
|
|
|
|
|
ElMessage.warning(confirmSelectionError.value)
|
|
|
|
|
confirmSelectedBudgetIds.value = [...beforeIds]
|
|
|
|
|
setConfirmCheckedIds(beforeIds)
|
|
|
|
|
// 回滚后不改右侧、不改 lastValid
|
|
|
|
|
confirmSelectionError.value = ''
|
|
|
|
|
@ -2131,5 +2126,3 @@ onMounted(async () => {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|