🐛 修复评分-1空值、结算单号跳转与小程序用户数据权限组织选择

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-11-06 09:32:36 +08:00
parent 7ff2b3fe28
commit baf54efb7b
3 changed files with 168 additions and 39 deletions
+39 -19
View File
@@ -66,17 +66,21 @@
/>
</template>
<template #dataScopeDeptIds-form>
<el-tree
<!-- 与用户管理「数据管理权限」一致:组织多选级联,数据源同左侧组织树 -->
<el-cascader
v-if="Number(form.dataScopeRange) === 3"
ref="dataScopeTree"
:data="permissionDeptTree"
show-checkbox
node-key="id"
:default-checked-keys="form.dataScopeDeptIds || []"
:props="{ label: 'title', children: 'children' }"
@check="handleDataScopeCheck"
v-model="dataScopeCascaderValue"
:options="permissionDeptTree"
:props="deptCascaderProps"
:disabled="isViewMode"
clearable
filterable
collapse-tags
collapse-tags-tooltip
placeholder="请选择数据权限组织(可多选)"
style="width: 100%"
/>
<span v-else class="form-tip">选择「自定义」后可勾选数据权限组织</span>
<span v-else class="form-tip">选择「自定义」后可选择数据权限组织</span>
</template>
<template #menu="{ row, index }">
<el-link
@@ -193,6 +197,26 @@ export default {
: [];
},
},
// 自定义数据权限组织:与用户管理数据管理权限相同的多选级联
dataScopeCascaderValue: {
get() {
const ids = Array.isArray(this.form.dataScopeDeptIds)
? this.form.dataScopeDeptIds
: this.form.dataScopeDeptIds
? String(this.form.dataScopeDeptIds).split(',').filter(Boolean)
: [];
return ids
.filter(item => item !== undefined && item !== null && item !== '')
.map(item => (typeof item === 'number' ? item : String(item)));
},
set(value) {
this.form.dataScopeDeptIds = Array.isArray(value)
? value.filter(item => item !== undefined && item !== null && item !== '')
: value
? [value]
: [];
},
},
},
created() {
this.sensitiveManager = sensitive.create({
@@ -228,12 +252,6 @@ export default {
this.permissionDeptTree = res.data.data || [];
});
},
handleDataScopeCheck(_, checked) {
if (this.isViewMode) {
return;
}
this.form.dataScopeDeptIds = checked.checkedKeys || [];
},
normalizeSubmitRow(row = {}, isUpdate = false) {
let payload = { ...row };
// 编辑时剔除未改动的脱敏字段,避免把 138****8000 写回库
@@ -278,17 +296,19 @@ export default {
detail.identities = detail.identities.split(',').filter(Boolean);
}
const deptIds = func.split(detail.deptId || '');
const dataScopeDeptIds = Array.isArray(detail.dataScopeDeptIds)
? detail.dataScopeDeptIds.map(item => String(item))
: detail.dataScopeDeptIds
? String(detail.dataScopeDeptIds).split(',').filter(Boolean)
: [];
this.form = {
...detail,
deptId: Array.isArray(deptIds) ? deptIds : [],
dataScopeRange: detail.dataScopeRange || 1,
dataLevelRange: detail.dataLevelRange || 1,
dataScopeDeptIds: detail.dataScopeDeptIds || [],
dataScopeDeptIds,
};
this.sensitiveManager?.saveInitialData(this.form);
this.$nextTick(() => {
this.$refs.dataScopeTree?.setCheckedKeys?.(this.form.dataScopeDeptIds || []);
});
done();
});
return;