fix bug
This commit is contained in:
@@ -225,14 +225,16 @@
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属组织" prop="organizationName">
|
||||
<el-cascader
|
||||
<el-tree-select
|
||||
v-model="selectedOrganizationId"
|
||||
:options="organizationOptions"
|
||||
:props="organizationCascaderProps"
|
||||
:data="organizationOptions"
|
||||
:props="organizationTreeSelectProps"
|
||||
node-key="id"
|
||||
placeholder="请选择"
|
||||
check-strictly
|
||||
clearable
|
||||
filterable
|
||||
:show-all-levels="false"
|
||||
:render-after-expand="false"
|
||||
@visible-change="visible => visible && loadOrganizationOptions()"
|
||||
@change="handleOrganizationChange"
|
||||
/>
|
||||
@@ -1234,13 +1236,11 @@ export default {
|
||||
contractFormatOptions() {
|
||||
return this.columnOptions('contractFormat');
|
||||
},
|
||||
organizationCascaderProps() {
|
||||
organizationTreeSelectProps() {
|
||||
return {
|
||||
label: 'label',
|
||||
value: 'id',
|
||||
children: 'children',
|
||||
checkStrictly: true,
|
||||
emitPath: false,
|
||||
};
|
||||
},
|
||||
settlementRuleEnabled() {
|
||||
@@ -1688,7 +1688,8 @@ export default {
|
||||
this.organizationLoading = true;
|
||||
getDeptTree(this.userInfo?.tenantId)
|
||||
.then(res => {
|
||||
this.organizationOptions = this.normalizeOrganizationTree(res.data?.data || []);
|
||||
const organizationTree = this.excludeExternalOrganization(res.data?.data || []);
|
||||
this.organizationOptions = this.normalizeOrganizationTree(organizationTree);
|
||||
this.organizationFlatOptions = this.flattenOrganizationTree(this.organizationOptions);
|
||||
const column = this.findColumn(this.tableOption.column, 'organizationName');
|
||||
if (column) column.dicData = this.organizationOptions;
|
||||
@@ -1698,6 +1699,17 @@ export default {
|
||||
this.organizationLoading = false;
|
||||
});
|
||||
},
|
||||
excludeExternalOrganization(tree = []) {
|
||||
return tree.reduce((result, item) => {
|
||||
const organizationName = item.title || item.deptName || item.name || item.label || '';
|
||||
if (String(organizationName).trim() === '外部组织') return result;
|
||||
result.push({
|
||||
...item,
|
||||
children: this.excludeExternalOrganization(item.children || []),
|
||||
});
|
||||
return result;
|
||||
}, []);
|
||||
},
|
||||
normalizeOrganizationTree(tree) {
|
||||
return (tree || []).map(item => {
|
||||
const label = item.title || item.deptName || item.name || item.label || '';
|
||||
@@ -2279,6 +2291,7 @@ export default {
|
||||
:deep(.el-input),
|
||||
:deep(.el-select),
|
||||
:deep(.el-cascader),
|
||||
:deep(.el-tree-select),
|
||||
:deep(.el-input-number),
|
||||
:deep(.el-date-editor) {
|
||||
width: 360px;
|
||||
|
||||
Reference in New Issue
Block a user