预算多选不限同一父级

master
weizong song 3 days ago
parent 0d83e74d91
commit 234c3028d6

@ -509,7 +509,7 @@
:on-remove="(file) => handleUploadRemove(file, element.id)"
:before-upload="beforeUpload"
multiple
:limit="10"
:limit="50"
>
<el-button type="primary">
<el-icon><Upload /></el-icon>

@ -279,7 +279,7 @@
:on-remove="(file) => handleFileRemove(field.key, file)"
:before-upload="beforeUpload"
multiple
:limit="10"
:limit="50"
class="file-upload-component"
>
<el-button type="primary">
@ -1054,7 +1054,7 @@
:on-remove="(file) => handlePaymentUploadRemove(file, element.id)"
:before-upload="beforeUpload"
multiple
:limit="10"
:limit="50"
>
<el-button type="primary">
<el-icon><Upload /></el-icon>

@ -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 () => {

Loading…
Cancel
Save