From cdd30b82119eac7025b811764419bbe6a1025c80 Mon Sep 17 00:00:00 2001 From: b2894lxlx <517289602@qq.com> Date: Wed, 14 Oct 2026 10:44:40 +0800 Subject: [PATCH] =?UTF-8?q?:sparkles:=20=E6=9C=BA=E6=9E=84=E5=90=8C?= =?UTF-8?q?=E6=AD=A5=E7=BC=96=E7=A0=81=E6=A0=A1=E9=AA=8C=E5=AF=B9=E9=BD=90?= =?UTF-8?q?GWWL=E4=B8=89=E4=BD=8D=E6=95=B0=E5=AD=97=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 组织编码校验改为上级直拼三位数字;全量同步清除提示同步保留外部组织与集团锚点。 Co-authored-by: Cursor --- src/views/system/dept.vue | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/views/system/dept.vue b/src/views/system/dept.vue index e7f2cba..4f67a20 100644 --- a/src/views/system/dept.vue +++ b/src/views/system/dept.vue @@ -333,9 +333,17 @@ export default { callback(new Error('上级组织未配置组织编码,请先完善上级组织编码')); return; } - const pattern = new RegExp(`^${escapeRegExp(this.parentDeptCode)}-\\d+$`); + // 公司:GWWL+三位数字;部门:所属公司编码+三位数字;其他:上级编码+三位数字(中间不加-) + let expectedPrefix = this.parentDeptCode; + const category = Number(this.form?.deptCategory); + if (category === 2) { + expectedPrefix = 'GWWL'; + } else if (category === 3 && this.form?.belongCompanyCode) { + expectedPrefix = String(this.form.belongCompanyCode).trim(); + } + const pattern = new RegExp(`^${escapeRegExp(expectedPrefix)}\\d{3}$`); if (!pattern.test(deptCode)) { - callback(new Error(`组织编码格式应为:${this.parentDeptCode}-分段数字`)); + callback(new Error(`组织编码格式应为:${expectedPrefix}三位数字(不足补零,中间不加-)`)); return; } callback(); @@ -650,7 +658,7 @@ export default { methods: { handleOaOrgFullSync() { this.$confirm( - '全量同步将拉取 OA 全部公司/部门;已存在且 OA 更新时间一致的记录会跳过。是否清除非顶级组织?选择“是”将先删除顶级以外的组织后再同步;选择“否”则直接全量同步。', + '全量同步将拉取 OA 全部公司/部门;已存在且 OA 更新时间一致的记录会跳过。是否清除后同步?选择“是”将保留顶级「外部组织」与集团锚点(id=135/GWWL),删除其余组织后再同步;选择“否”则直接全量同步。', '全量同步', { confirmButtonText: '是',