From 37ac683fb41ef39d05f0777cc78cd7665fbc247e Mon Sep 17 00:00:00 2001
From: weicw <594098497@qq.com>
Date: Sun, 25 Oct 2026 19:44:06 +0800
Subject: [PATCH 1/4] =?UTF-8?q?:bug:=20=E5=89=8D=E7=AB=AF=E5=8F=96?=
=?UTF-8?q?=E6=B6=88=E6=89=80=E5=B1=9E=E7=BB=84=E7=BB=87=E5=BF=85=E5=A1=AB?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/option/system/mpUser.js | 2 +-
src/views/system/mp-user.vue | 10 ----------
src/views/transportCapacity/driver.vue | 2 +-
src/views/transportCapacity/vehicle.vue | 2 +-
4 files changed, 3 insertions(+), 13 deletions(-)
diff --git a/src/option/system/mpUser.js b/src/option/system/mpUser.js
index bc06d41..3c01e4c 100644
--- a/src/option/system/mpUser.js
+++ b/src/option/system/mpUser.js
@@ -133,7 +133,7 @@ export default {
hide: true,
span: 24,
order: 55,
- rules: [{ required: true, message: '请选择所属组织', trigger: 'change' }],
+ // 后端已允许所属组织为空,这里不做必填校验
},
{
label: '所属组织',
diff --git a/src/views/system/mp-user.vue b/src/views/system/mp-user.vue
index 072f3d8..bd3505f 100644
--- a/src/views/system/mp-user.vue
+++ b/src/views/system/mp-user.vue
@@ -315,11 +315,6 @@ export default {
},
rowSave(row, done, loading) {
const payload = this.normalizeSubmitRow(row, false);
- if (!payload.deptId) {
- this.$message.warning('请选择所属组织');
- loading();
- return;
- }
if (payload.dataScopeRange === 3 && (!payload.dataScopeDeptIds || !payload.dataScopeDeptIds.length)) {
this.$message.warning('请选择自定义数据权限组织');
loading();
@@ -336,11 +331,6 @@ export default {
},
rowUpdate(row, index, done, loading) {
const payload = this.normalizeSubmitRow(row, true);
- if (!payload.deptId) {
- this.$message.warning('请选择所属组织');
- loading();
- return;
- }
if (payload.dataScopeRange === 3 && (!payload.dataScopeDeptIds || !payload.dataScopeDeptIds.length)) {
this.$message.warning('请选择自定义数据权限组织');
loading();
diff --git a/src/views/transportCapacity/driver.vue b/src/views/transportCapacity/driver.vue
index c4e771b..9b60021 100644
--- a/src/views/transportCapacity/driver.vue
+++ b/src/views/transportCapacity/driver.vue
@@ -861,7 +861,7 @@ export default {
emergencyContactMobile: [
{ required: true, message: '请输入紧急联系人手机号', trigger: 'blur' },
],
- organizationName: [{ required: true, message: '请选择所属组织', trigger: 'change' }],
+ // 后端已允许所属组织为空,这里不做必填校验
idCardFront: [{ required: true, message: '请上传身份证正面照', trigger: 'change' }],
idCardBack: [{ required: true, message: '请上传身份证反面照', trigger: 'change' }],
drivingLicenseFront: [{ required: true, message: '请上传驾驶证主页', trigger: 'change' }],
diff --git a/src/views/transportCapacity/vehicle.vue b/src/views/transportCapacity/vehicle.vue
index 871d3a5..42f4939 100644
--- a/src/views/transportCapacity/vehicle.vue
+++ b/src/views/transportCapacity/vehicle.vue
@@ -663,7 +663,7 @@ export default {
businessRelationOptions: ['自有', '管理挂靠', '业务合作'],
energyTypeOptions: ['柴油', '汽油', '新能源', '天然气'],
baseRules: {
- organizationName: [{ required: true, message: '请选择所属组织', trigger: 'change' }],
+ // 后端已允许所属组织为空,这里不做必填校验
useDepartment: [{ required: true, message: '请选择使用部门', trigger: 'change' }],
plateNo: [
{ required: true, message: '请输入车牌号', trigger: 'change' },
From 324daf9d4d179dbc5f6a45e23643333a3f9068d4 Mon Sep 17 00:00:00 2001
From: weicw <594098497@qq.com>
Date: Sun, 25 Oct 2026 19:45:41 +0800
Subject: [PATCH 2/4] =?UTF-8?q?:sparkles:=20=E5=8F=B8=E6=9C=BA=E4=B8=8E?=
=?UTF-8?q?=E8=BD=A6=E8=BE=86=E5=88=97=E8=A1=A8=E6=94=AF=E6=8C=81=E6=8C=89?=
=?UTF-8?q?=E6=9C=AA=E5=88=86=E9=85=8D=E7=BB=84=E7=BB=87=E7=AD=9B=E9=80=89?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/mixins/organization-search.js | 26 +++++++++++++++++++++++--
src/views/transportCapacity/driver.vue | 19 ++++++++++++++++--
src/views/transportCapacity/vehicle.vue | 13 ++++++++++++-
3 files changed, 53 insertions(+), 5 deletions(-)
diff --git a/src/mixins/organization-search.js b/src/mixins/organization-search.js
index 5842986..72ea330 100644
--- a/src/mixins/organization-search.js
+++ b/src/mixins/organization-search.js
@@ -26,6 +26,11 @@ import { h } from 'vue';
*/
const ORG_PROPS = ['organizationName', 'deptName'];
+// 「未分配组织」筛选项的哨兵值:不是真实组织名,选中后提交给后端的就是这串字面量。
+// 后端 DriverMapper.xml:172-184 与 TransportVehicleMapper.xml:119-131 按此字面量改判为
+// organization_name 为空(改成空串会让后端整段组织条件不生效,筛选静默失效)。
+export const UNASSIGNED_ORG_FILTER = '__UNASSIGNED_ORG__';
+
export default {
data() {
return {
@@ -34,9 +39,18 @@ export default {
organizationTreeOptions: [],
organizationTreeFlatOptions: [],
organizationLoading: false,
+ // 组织筛选是否追加「未分配组织」一项;页面在 data 里覆盖为 true 才生效
+ enableUnassignedOrgFilter: false,
};
},
computed: {
+ // 搜索栏级联的选项:开关打开时在真实组织最前面追加「未分配组织」。
+ // 不能直接改 organizationTreeOptions——司机/车辆页的编辑表单也用这棵树选组织。
+ organizationSearchTreeOptions() {
+ return this.enableUnassignedOrgFilter
+ ? [this.unassignedOrgOption(), ...this.organizationTreeOptions]
+ : this.organizationTreeOptions;
+ },
// 所属组织级联配置:checkStrictly 允许选中任意层级,不必选到末级
organizationCascaderProps() {
return {
@@ -61,7 +75,7 @@ export default {
? this.excludeExternalOrganization(source)
: source;
this.organizationTreeOptions = this.normalizeOrgTree(tree);
- this.organizationTreeFlatOptions = this.flattenOrgTree(this.organizationTreeOptions);
+ this.organizationTreeFlatOptions = this.flattenOrgTree(this.organizationSearchTreeOptions);
const option = this.tableOption || this.option;
if (!option) return;
ORG_PROPS.forEach(prop => {
@@ -100,12 +114,20 @@ export default {
};
});
},
+ // 哨兵节点的 id 与 rawLabel 都取哨兵值,resolveOrgName 取到的仍是哨兵而不是某个真实组织名
+ unassignedOrgOption() {
+ return { id: UNASSIGNED_ORG_FILTER, label: '未分配组织', rawLabel: UNASSIGNED_ORG_FILTER };
+ },
flattenOrgTree(tree = []) {
return (tree || []).flatMap(item => [
{ id: String(item.id), label: item.label, rawLabel: item.rawLabel },
...this.flattenOrgTree(item.children || []),
]);
},
+ // 组织列渲染用:空串或纯空白即「未分配组织」(存量口径是空串,NULL 只是历史脏数据)
+ isBlankOrganizationName(value) {
+ return String(value ?? '').trim() === '';
+ },
// 兼容两种入参:级联路径数组(取末级)或单个部门 id
findOrgById(id) {
const value = Array.isArray(id) ? id.at(-1) : id;
@@ -155,7 +177,7 @@ export default {
// 级联单选:modelValue 必须是 id 路径数组,否则控件内部状态会错乱导致无法再次选中
if (scope.row) scope.row[prop] = Array.isArray(value) ? value : [];
},
- options: this.organizationTreeOptions,
+ options: this.organizationSearchTreeOptions,
props: {
label: 'label',
value: 'id',
diff --git a/src/views/transportCapacity/driver.vue b/src/views/transportCapacity/driver.vue
index c4e771b..2c5f35e 100644
--- a/src/views/transportCapacity/driver.vue
+++ b/src/views/transportCapacity/driver.vue
@@ -60,7 +60,11 @@
{{ row.idCardNo || '-' }}
- {{ String(row.organizationName || '').replace(/^[\s\u3000]+/, '') }}
+ 未分配组织
+ {{ String(row.organizationName || '').replace(/^[\s\u3000]+/, '') }}
@@ -596,7 +600,11 @@
{{ row.plateNo || '-' }}
- {{ String(row.organizationName || '').replace(/^[\s\u3000]+/, '') }}
+ 未分配组织
+ {{ String(row.organizationName || '').replace(/^[\s\u3000]+/, '') }}
{{ row.boundDriver || '-' }}
@@ -747,6 +755,8 @@ export default {
expired: 0,
},
driverBox: false,
+ // 搜索栏组织级联追加「未分配组织」一项(哨兵值见 organization-search mixin)
+ enableUnassignedOrgFilter: true,
vehicleSelectorVisible: false,
vehicleSelectorLoading: false,
vehicleSelectorOption,
@@ -1958,6 +1968,11 @@ export default {
}
}
+// 空组织记录在列表里的占位文案
+.organization-name--empty {
+ color: #909399;
+}
+
.driver-page__date-expiring {
color: #d40000;
font-weight: 600;
diff --git a/src/views/transportCapacity/vehicle.vue b/src/views/transportCapacity/vehicle.vue
index 871d3a5..9e79327 100644
--- a/src/views/transportCapacity/vehicle.vue
+++ b/src/views/transportCapacity/vehicle.vue
@@ -59,7 +59,11 @@
- {{ String(row.organizationName || '').replace(/^[\s\u3000]+/, '') }}
+ 未分配组织
+ {{ String(row.organizationName || '').replace(/^[\s\u3000]+/, '') }}
@@ -652,6 +656,8 @@ export default {
vehicleCertificateUploads: {},
uploadHeaders: getUploadHeaders(),
organizationOptions: [],
+ // 搜索栏组织级联追加「未分配组织」一项(哨兵值见 organization-search mixin)
+ enableUnassignedOrgFilter: true,
vehicleTypeOptions: [
{ label: '高栏车', value: '高栏' },
{ label: '低栏车', value: '低栏' },
@@ -1497,6 +1503,11 @@ export default {
}
}
+// 空组织记录在列表里的占位文案
+.organization-name--empty {
+ color: #909399;
+}
+
// 编辑弹窗:灰底 + section-card 白卡分组
.vehicle-form {
:deep(.el-form-item__label) {
From 7b478bdbf2e4be523b7e39de05e043a0bd05bd0c Mon Sep 17 00:00:00 2001
From: weicw <594098497@qq.com>
Date: Sun, 25 Oct 2026 20:21:16 +0800
Subject: [PATCH 3/4] =?UTF-8?q?:memo:=20=E4=BF=AE=E6=AD=A3=E6=9C=AA?=
=?UTF-8?q?=E5=88=86=E9=85=8D=E7=BB=84=E7=BB=87=E7=AD=9B=E9=80=89=E7=9A=84?=
=?UTF-8?q?=E6=B3=A8=E9=87=8A=E4=B8=8E=E6=8E=A5=E5=85=A5=E6=AD=A5=E9=AA=A4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/mixins/organization-search.js | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/src/mixins/organization-search.js b/src/mixins/organization-search.js
index 72ea330..fd06b59 100644
--- a/src/mixins/organization-search.js
+++ b/src/mixins/organization-search.js
@@ -12,6 +12,8 @@ import { h } from 'vue';
* 1. 混入本 mixin:mixins: [organizationSearch]
* 2. option 中「所属组织」列加上 searchslot: true(prop 为 organizationName 或 deptName 均可)
* 3. 在 created / 初始化时调用 this.loadOrganizationOptions()
+ * 4. 需要「未分配组织」筛选项的页面在 data 里置 enableUnassignedOrgFilter: true;
+ * 该项只追加进搜索树 organizationSearchTreeOptions,表单级联 organizationTreeOptions 不含哨兵
*
* 说明:
* - 自动识别 organizationName / deptName 两种 prop,并挂载 column.renderSearch
@@ -27,9 +29,10 @@ import { h } from 'vue';
const ORG_PROPS = ['organizationName', 'deptName'];
// 「未分配组织」筛选项的哨兵值:不是真实组织名,选中后提交给后端的就是这串字面量。
-// 后端 DriverMapper.xml:172-184 与 TransportVehicleMapper.xml:119-131 按此字面量改判为
-// organization_name 为空(改成空串会让后端整段组织条件不生效,筛选静默失效)。
-export const UNASSIGNED_ORG_FILTER = '__UNASSIGNED_ORG__';
+// 后端 TransportBusiConstant.UNASSIGNED_ORG_FILTER、DriverMapper.xml / TransportVehicleMapper.xml
+// 的 organizationName 分支以及司机、车辆导出查询都按它改判为 organization_name = '';
+// 后端换成空串会让整段组织条件不生效,筛选静默失效。前端与后端这几处必须同步修改。
+const UNASSIGNED_ORG_FILTER = '__UNASSIGNED_ORG__';
export default {
data() {
@@ -124,7 +127,7 @@ export default {
...this.flattenOrgTree(item.children || []),
]);
},
- // 组织列渲染用:空串或纯空白即「未分配组织」(存量口径是空串,NULL 只是历史脏数据)
+ // 组织列渲染用:空串或纯空白即「未分配组织」(组织列 NOT NULL,无组织存空串)
isBlankOrganizationName(value) {
return String(value ?? '').trim() === '';
},
From 9c0f7cb3f42effcfc321bb922f19afb0a3db3b36 Mon Sep 17 00:00:00 2001
From: weicw <594098497@qq.com>
Date: Sun, 25 Oct 2026 20:21:16 +0800
Subject: [PATCH 4/4] =?UTF-8?q?:memo:=20=E6=89=80=E5=B1=9E=E7=BB=84?=
=?UTF-8?q?=E7=BB=87=E5=8F=AF=E4=B8=BA=E7=A9=BA=E7=9A=84=E6=B3=A8=E9=87=8A?=
=?UTF-8?q?=E6=94=B9=E4=B8=BA=E4=BA=8B=E5=AE=9E=E5=8F=A5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/option/system/mpUser.js | 2 +-
src/views/transportCapacity/vehicle.vue | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/option/system/mpUser.js b/src/option/system/mpUser.js
index 3c01e4c..7236a26 100644
--- a/src/option/system/mpUser.js
+++ b/src/option/system/mpUser.js
@@ -133,7 +133,7 @@ export default {
hide: true,
span: 24,
order: 55,
- // 后端已允许所属组织为空,这里不做必填校验
+ // 所属组织可为空:为空表示未分配组织,账号的数据权限为空集
},
{
label: '所属组织',
diff --git a/src/views/transportCapacity/vehicle.vue b/src/views/transportCapacity/vehicle.vue
index b053d36..aba1fb1 100644
--- a/src/views/transportCapacity/vehicle.vue
+++ b/src/views/transportCapacity/vehicle.vue
@@ -669,7 +669,7 @@ export default {
businessRelationOptions: ['自有', '管理挂靠', '业务合作'],
energyTypeOptions: ['柴油', '汽油', '新能源', '天然气'],
baseRules: {
- // 后端已允许所属组织为空,这里不做必填校验
+ // 所属组织可为空:为空表示未分配组织,数据权限为空集
useDepartment: [{ required: true, message: '请选择使用部门', trigger: 'change' }],
plateNo: [
{ required: true, message: '请输入车牌号', trigger: 'change' },