+28
-10
@@ -492,17 +492,35 @@ export const treeOption = {
|
||||
nodeKey: 'id',
|
||||
lazy: true,
|
||||
treeLoad: function (node, resolve) {
|
||||
const parentId = node.level === 0 ? 0 : node.data.id;
|
||||
getDeptLazyTree(parentId).then(res => {
|
||||
resolve(
|
||||
res.data.data.map(item => {
|
||||
return {
|
||||
...item,
|
||||
leaf: !item.hasChildren,
|
||||
};
|
||||
})
|
||||
);
|
||||
const toTreeNode = item => ({
|
||||
...item,
|
||||
leaf: !item.hasChildren,
|
||||
});
|
||||
// 用户管理组织树从第二级开始展示:根层隐藏一级组织,直接展示其子节点
|
||||
if (node.level === 0) {
|
||||
getDeptLazyTree(0)
|
||||
.then(res => {
|
||||
const roots = res.data.data || [];
|
||||
if (!roots.length) {
|
||||
resolve([]);
|
||||
return;
|
||||
}
|
||||
return Promise.all(roots.map(root => getDeptLazyTree(root.id))).then(childResults => {
|
||||
const secondLevel = [];
|
||||
childResults.forEach(childRes => {
|
||||
(childRes.data.data || []).forEach(item => secondLevel.push(toTreeNode(item)));
|
||||
});
|
||||
resolve(secondLevel);
|
||||
});
|
||||
})
|
||||
.catch(() => resolve([]));
|
||||
return;
|
||||
}
|
||||
getDeptLazyTree(node.data.id)
|
||||
.then(res => {
|
||||
resolve((res.data.data || []).map(toTreeNode));
|
||||
})
|
||||
.catch(() => resolve([]));
|
||||
},
|
||||
addBtn: false,
|
||||
menu: false,
|
||||
|
||||
@@ -102,7 +102,7 @@
|
||||
style="margin-bottom: 12px; background: #f5f7fa; padding: 6px 10px; border-radius: 4px"
|
||||
>
|
||||
<span style="color: #606266; font-size: 13px"
|
||||
>勾选多个菜单后点击「设置」,可批量配置数据权限;设置后菜单旁展示当前范围</span
|
||||
>仅展示菜单权限已勾选的菜单,已配置的数据权限会保留。勾选多个菜单后点击「设置」可批量配置</span
|
||||
>
|
||||
<el-button type="primary" size="small" @click="openDataScopeSetting">设置</el-button>
|
||||
</el-row>
|
||||
|
||||
@@ -713,6 +713,12 @@ export default {
|
||||
}
|
||||
this.selectDeptOnTree(deptId);
|
||||
},
|
||||
startDeptTreeFromSecondLevel(tree) {
|
||||
if (!Array.isArray(tree) || !tree.length) {
|
||||
return [];
|
||||
}
|
||||
return tree.flatMap(node => (Array.isArray(node.children) ? node.children : []));
|
||||
},
|
||||
findDeptIdByName(name, tree = this.permissionDeptTree) {
|
||||
if (!name) return null;
|
||||
for (const node of tree || []) {
|
||||
@@ -733,7 +739,7 @@ export default {
|
||||
const tenantId = this.userInfo.tenantId || this.website.tenantId;
|
||||
try {
|
||||
const res = await getDeptTree(tenantId);
|
||||
this.permissionDeptTree = res.data.data || [];
|
||||
this.permissionDeptTree = this.startDeptTreeFromSecondLevel(res.data.data || []);
|
||||
} catch (error) {
|
||||
this.$message.error('组织树加载失败');
|
||||
return;
|
||||
@@ -963,9 +969,11 @@ export default {
|
||||
column.dicData = res.data.data;
|
||||
});
|
||||
getDeptTree(tenantId).then(res => {
|
||||
this.permissionDeptTree = res.data.data;
|
||||
// 用户管理组织从第二级开始展示:去掉一级根节点,保留其子节点
|
||||
const deptTree = this.startDeptTreeFromSecondLevel(res.data.data || []);
|
||||
this.permissionDeptTree = deptTree;
|
||||
const column = this.findColumn(this.userOption.group, 'deptId');
|
||||
column.dicData = res.data.data;
|
||||
column.dicData = deptTree;
|
||||
});
|
||||
getPostList(tenantId).then(res => {
|
||||
this.postList = res.data.data;
|
||||
|
||||
@@ -310,6 +310,7 @@
|
||||
v-model="archiveForm.customerCode"
|
||||
maxlength="20"
|
||||
show-word-limit
|
||||
:disabled="Boolean(archiveForm.id)"
|
||||
placeholder="请输入,留空则自动生成"
|
||||
/>
|
||||
</el-form-item>
|
||||
@@ -378,7 +379,7 @@
|
||||
placeholder="请输入"
|
||||
maxlength="18"
|
||||
show-word-limit
|
||||
:disabled="kingdeeLocked && Boolean(archiveForm.id)"
|
||||
:disabled="Boolean(archiveForm.id)"
|
||||
@input="
|
||||
archiveForm.unifiedCreditCode = String(
|
||||
archiveForm.unifiedCreditCode || ''
|
||||
@@ -394,7 +395,7 @@
|
||||
placeholder="请输入"
|
||||
maxlength="100"
|
||||
show-word-limit
|
||||
:disabled="kingdeeLocked"
|
||||
:disabled="kingdeeLocked && !archiveForm.id"
|
||||
@blur="checkArchiveNameRisk"
|
||||
/>
|
||||
<el-tooltip
|
||||
@@ -434,7 +435,7 @@
|
||||
v-model="archiveForm.legalPerson"
|
||||
maxlength="10"
|
||||
show-word-limit
|
||||
:disabled="kingdeeLocked"
|
||||
:disabled="kingdeeLocked && !archiveForm.id"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -535,7 +536,7 @@
|
||||
<el-input
|
||||
v-model="archiveForm.registeredCapital"
|
||||
maxlength="18"
|
||||
:disabled="kingdeeLocked"
|
||||
:disabled="kingdeeLocked && !archiveForm.id"
|
||||
@input="value => handleDecimalInput('registeredCapital', value)"
|
||||
/>
|
||||
</el-form-item>
|
||||
@@ -545,7 +546,7 @@
|
||||
<el-input
|
||||
v-model="archiveForm.paidInCapital"
|
||||
maxlength="18"
|
||||
:disabled="kingdeeLocked"
|
||||
:disabled="kingdeeLocked && !archiveForm.id"
|
||||
@input="value => handleDecimalInput('paidInCapital', value)"
|
||||
/>
|
||||
</el-form-item>
|
||||
@@ -4245,7 +4246,9 @@ export default {
|
||||
'核准日期',
|
||||
]);
|
||||
const scope = this.getBusinessLicenseOcrValue(fields, ['经营范围']);
|
||||
if (code) this.archiveForm.unifiedCreditCode = code.replace(/\s/g, '').toUpperCase();
|
||||
if (code && !this.archiveForm.id) {
|
||||
this.archiveForm.unifiedCreditCode = code.replace(/\s/g, '').toUpperCase();
|
||||
}
|
||||
if (name) this.archiveForm.fullName = name;
|
||||
if (name) this.checkArchiveNameRisk();
|
||||
if (legalPerson) this.archiveForm.legalPerson = legalPerson;
|
||||
|
||||
Reference in New Issue
Block a user