This commit is contained in:
Your Name
2026-05-05 14:51:35 +08:00
parent 40eec808ef
commit 3ef10846b4
10 changed files with 492 additions and 57 deletions
+28 -19
View File
@@ -60,25 +60,26 @@
<el-divider content-position="left">组织信息</el-divider>
<!-- 归属部门 -->
<!-- 归属部门数据权限内仅末级可选父级仅用于展开 -->
<el-form-item label="归属部门" prop="dept_id">
<el-tree-select
class="flex-1"
v-model="formData.dept_id"
:data="optionsData.dept"
clearable
multiple
node-key="id"
:props="{
label: 'name',
disabled(data: any) {
return data.status !== 1
}
}"
check-strictly
:default-expand-all="true"
placeholder="请选择归属部门"
/>
<div class="w-full">
<el-tree-select
class="flex-1 w-full"
v-model="formData.dept_id"
:data="optionsData.dept"
clearable
multiple
node-key="id"
:props="{
label: 'name',
disabled: deptTreeNodeDisabled
}"
check-strictly
:default-expand-all="true"
placeholder="请选择末级归属部门"
/>
<div class="form-tips">仅可选末级部门含下级的父部门不可选与数据权限范围一致</div>
</div>
</el-form-item>
<!-- 岗位 -->
@@ -215,6 +216,13 @@ import { getDictData } from '@/api/app'
import { useDictOptions } from '@/hooks/useDictOptions'
import feedback from '@/utils/feedback'
/** 归属部门:禁止选父级,仅末级可选(status=1 且无子节点) */
function deptTreeNodeDisabled(data: { status?: number; children?: unknown[] }) {
if (data.status !== 1) return true
const ch = data.children
return Array.isArray(ch) && ch.length > 0
}
const emit = defineEmits(['success', 'close'])
const formRef = shallowRef<FormInstance>()
const visible = ref(false)
@@ -264,7 +272,8 @@ const { optionsData } = useDictOptions<{
api: jobsAll
},
dept: {
api: deptAll
api: deptAll,
params: { apply_data_scope: 1 }
}
})
+28 -19
View File
@@ -54,25 +54,26 @@
<el-divider content-position="left">组织信息</el-divider>
<!-- 归属部门 -->
<!-- 归属部门数据权限内仅末级可选父级仅用于展开 -->
<el-form-item label="归属部门" prop="dept_id">
<el-tree-select
class="flex-1"
v-model="formData.dept_id"
:data="optionsData.dept"
clearable
multiple
node-key="id"
:props="{
label: 'name',
disabled(data: any) {
return data.status !== 1
}
}"
check-strictly
:default-expand-all="true"
placeholder="请选择归属部门"
/>
<div class="w-full">
<el-tree-select
class="flex-1 w-full"
v-model="formData.dept_id"
:data="optionsData.dept"
clearable
multiple
node-key="id"
:props="{
label: 'name',
disabled: deptTreeNodeDisabled
}"
check-strictly
:default-expand-all="true"
placeholder="请选择末级归属部门"
/>
<div class="form-tips">仅可选末级部门含下级的父部门不可选与数据权限范围一致</div>
</div>
</el-form-item>
<!-- 岗位 -->
@@ -254,6 +255,13 @@ import { getDictData } from '@/api/app'
import { useDictOptions } from '@/hooks/useDictOptions'
import feedback from '@/utils/feedback'
/** 归属部门:禁止选父级,仅末级可选(status=1 且无子节点) */
function deptTreeNodeDisabled(data: { status?: number; children?: unknown[] }) {
if (data.status !== 1) return true
const ch = data.children
return Array.isArray(ch) && ch.length > 0
}
const emit = defineEmits(['success', 'close'])
const formRef = shallowRef<FormInstance>()
const visible = ref(false)
@@ -307,7 +315,8 @@ const { optionsData } = useDictOptions<{
api: jobsAll
},
dept: {
api: deptAll
api: deptAll,
params: { apply_data_scope: 1 }
}
})
+3 -2
View File
@@ -99,11 +99,12 @@ import EditPopup from './edit.vue'
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
// 表单数据 - 固定role_id=1查询医生
// 表单数据 - 固定 role_id=1 查询医生;数据范围与医助列表一致,仅看自己权限内成员
const formData = reactive({
account: '',
name: '',
role_id: 1 // 固定为医生角色
role_id: 1,
apply_data_scope: 1
})
const showEdit = ref(false)