✨ 完善组织人员增量同步与用户管理交互

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-10-10 13:56:29 +08:00
parent eaece0209d
commit ea797356ce
9 changed files with 322 additions and 178 deletions
+35 -22
View File
@@ -339,7 +339,7 @@
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="经营范围" prop="businessScope" required>
<el-form-item label="经营范围" prop="businessScope">
<el-select v-model="archiveForm.businessScope" multiple filterable clearable>
<el-option
v-for="item in businessScopeOptions"
@@ -460,9 +460,8 @@
v-model="deptCascaderValue"
:options="deptTree"
:props="deptCascaderProps"
clearable
filterable
placeholder="请选择 所属组织"
disabled
placeholder="桂物物流集团"
/>
</el-form-item>
</el-col>
@@ -1552,6 +1551,8 @@ import ChangeRecordDetailDialog from '@/components/change-record-detail-dialog/m
const customerArchiveListRoute = '/vehicle/customer-archive';
const customerArchiveFormRoute = '/vehicle/customer-archive/form';
const customerArchiveListRefreshKey = 'customer-archive-list-refresh';
/** 客商所属组织固定为顶层组织 */
const FIXED_OWNER_DEPT_NAME = '桂物物流集团';
const createTimeRangeMap = {
createTimeRange: ['createTimeStart', 'createTimeEnd'],
@@ -1788,15 +1789,6 @@ export default {
{ required: true, message: '请输入详细地址', trigger: 'blur' },
{ max: 255, message: '详细地址最多255个字符', trigger: 'blur' },
],
businessScope: [
{
required: true,
type: 'array',
min: 1,
message: '请选择经营范围',
trigger: 'change',
},
],
remark: [{ max: 500, message: '备注最多500个字符', trigger: 'blur' }],
},
contactRules: {
@@ -3043,17 +3035,34 @@ export default {
});
return result;
},
setDefaultTopLevelDept() {
const deptIds = Array.isArray(this.archiveForm.deptId)
? this.archiveForm.deptId
: this.archiveForm.deptId
? [this.archiveForm.deptId]
: [];
const firstTopLevelDept = this.deptTree[0];
if (!this.isArchivePage || this.$route.query.id || deptIds.length || !firstTopLevelDept) {
findTopLevelDeptByName(name) {
const targetName = String(name || '').trim();
if (!targetName) {
return null;
}
return (
(this.deptTree || []).find(item => {
const label = String(item.label || item.title || item.deptName || item.name || '').trim();
return label === targetName;
}) || null
);
},
/**
* 客商所属组织固定为顶层「桂物物流集团」,表单不可编辑。
*/
applyFixedOwnerDept() {
if (!this.isArchivePage || this.readonly) {
return;
}
this.onDeptChange([firstTopLevelDept.value]);
const fixedDept =
this.findTopLevelDeptByName(FIXED_OWNER_DEPT_NAME) || (this.deptTree || [])[0] || null;
if (!fixedDept) {
return;
}
this.onDeptChange([fixedDept.value]);
},
setDefaultTopLevelDept() {
this.applyFixedOwnerDept();
},
onDeptChange(value) {
// 级联单选:value 为根到选中节点的 ID 路径,取末级作为客商所属组织
@@ -4104,6 +4113,7 @@ export default {
this.ocrQualificationUploadFiles = [];
this.selectedQualificationFiles = [];
if (this.isPublicViewPage) this.ensurePublicViewOptions(this.archiveForm);
this.applyFixedOwnerDept();
this.archiveBox = true;
this.loadChangeRecords();
if (this.reviewMode) this.openReviewScore();
@@ -4120,6 +4130,7 @@ export default {
this.qualificationUploadFiles = [];
this.ocrQualificationUploadFiles = [];
this.selectedQualificationFiles = [];
this.applyFixedOwnerDept();
this.archiveBox = true;
},
resetArchive() {
@@ -4162,6 +4173,8 @@ export default {
return true;
},
normalizeArchive() {
// 提交前再次固定所属组织,防止被绕过
this.applyFixedOwnerDept();
const archive = JSON.parse(JSON.stringify(this.archiveForm));
if (archive.businessTermType === '长期') {
archive.businessEndDate = null;