|
|
|
@ -949,7 +949,9 @@ export default {
|
|
|
|
if (!auths || auths.length === 0) {
|
|
|
|
if (!auths || auths.length === 0) {
|
|
|
|
this.selectionError = "该预算来源未配置部门授权";
|
|
|
|
this.selectionError = "该预算来源未配置部门授权";
|
|
|
|
this.$message.warning(this.selectionError);
|
|
|
|
this.$message.warning(this.selectionError);
|
|
|
|
|
|
|
|
this.selectedBudgetIds = [...this.lastValidBudgetIds];
|
|
|
|
this.setCheckedIds(this.lastValidBudgetIds);
|
|
|
|
this.setCheckedIds(this.lastValidBudgetIds);
|
|
|
|
|
|
|
|
this.selectionError = "";
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -983,23 +985,15 @@ export default {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 多条预算来源:同一直接父级 + 每条唯一授权部门
|
|
|
|
|
|
|
|
const parentId = selectedNodes[0].parent_id ?? null;
|
|
|
|
|
|
|
|
const parentMismatch = selectedNodes.some((n) => (n.parent_id ?? null) !== parentId);
|
|
|
|
|
|
|
|
if (parentMismatch) {
|
|
|
|
|
|
|
|
this.selectionError = "多条预算来源必须同属一个直接父级";
|
|
|
|
|
|
|
|
this.$message.warning(this.selectionError);
|
|
|
|
|
|
|
|
this.setCheckedIds(this.lastValidBudgetIds);
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const rows = [];
|
|
|
|
const rows = [];
|
|
|
|
for (const node of selectedNodes) {
|
|
|
|
for (const node of selectedNodes) {
|
|
|
|
const auths = await this.getDepartmentAuthorizations(node.id);
|
|
|
|
const auths = await this.getDepartmentAuthorizations(node.id);
|
|
|
|
if (!auths || auths.length !== 1) {
|
|
|
|
if (!auths || auths.length !== 1) {
|
|
|
|
this.selectionError = "多条预算来源时,每条预算必须且仅能授权给一个部门";
|
|
|
|
this.selectionError = "多条预算来源时,每条预算必须且仅能授权给一个部门";
|
|
|
|
this.$message.warning(this.selectionError);
|
|
|
|
this.$message.warning(this.selectionError);
|
|
|
|
|
|
|
|
this.selectedBudgetIds = [...this.lastValidBudgetIds];
|
|
|
|
this.setCheckedIds(this.lastValidBudgetIds);
|
|
|
|
this.setCheckedIds(this.lastValidBudgetIds);
|
|
|
|
|
|
|
|
this.selectionError = "";
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const a = auths[0];
|
|
|
|
const a = auths[0];
|
|
|
|
@ -1009,7 +1003,6 @@ export default {
|
|
|
|
budget_name: node.name || "",
|
|
|
|
budget_name: node.name || "",
|
|
|
|
department_id: a.department_id,
|
|
|
|
department_id: a.department_id,
|
|
|
|
department_name: a.department?.name || "",
|
|
|
|
department_name: a.department?.name || "",
|
|
|
|
// 情形(3) 默认全为 0(由用户手动填充)
|
|
|
|
|
|
|
|
allocated_amount: existingMap[key] ?? 0,
|
|
|
|
allocated_amount: existingMap[key] ?? 0,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -1367,5 +1360,3 @@ export default {
|
|
|
|
font-weight: 500;
|
|
|
|
font-weight: 500;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
</style>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|