diff --git a/src/api/system/post/index.ts b/src/api/system/post/index.ts index 9f028ab..b7cc8e8 100644 --- a/src/api/system/post/index.ts +++ b/src/api/system/post/index.ts @@ -71,7 +71,7 @@ export function getRoleList(deptId?: number | string): AxiosPromise { url: '/system/role/listNoPage', method: 'get', params: { - deptId + deptId, } }); } diff --git a/src/views/design/billofQuantities/indexEdit0.vue b/src/views/design/billofQuantities/indexEdit0.vue index c09bda7..ada25f3 100644 --- a/src/views/design/billofQuantities/indexEdit0.vue +++ b/src/views/design/billofQuantities/indexEdit0.vue @@ -16,7 +16,7 @@
-

投标工程清单

+

招标工程清单

-
+
@@ -105,7 +105,7 @@ const initFormData = { sex: undefined, projectRoles: [ { - projectId: [], + projectId: '', roleIds: [] } ], @@ -178,6 +178,7 @@ const filterDisabledDept = (deptList) => { }); }; async function handleDeptChange(value: number | string) { + proxy?.$emit('setDeptId', value); const response = await optionselect(value); const roleList = await getRoleList(value); roleOptions.value = roleList.data; @@ -185,7 +186,7 @@ async function handleDeptChange(value: number | string) { form.value.postIds = []; form.value.projectRoles = [ { - projectId: [], + projectId: '', roleIds: [] } ]; @@ -209,7 +210,7 @@ const reset = () => { form.value = { ...initFormData }; form.value.projectRoles = [ { - projectId: [], + projectId: '', roleIds: [] } ]; @@ -236,10 +237,13 @@ const open = async (row?: any) => { postOptions.value = data.posts; } }; +const getInfoForm = () => { + return form.value; +}; onMounted(() => { getDeptTree(); }); -defineExpose({ open }); +defineExpose({ open, getInfoForm }); diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue index c3e11ee..f2fc195 100644 --- a/src/views/system/user/index.vue +++ b/src/views/system/user/index.vue @@ -154,16 +154,18 @@ - +
基本资料 角色信息
-
- +
+ +
+
+
-
@@ -229,6 +231,7 @@ import { getProjectByDeptId, getRoleList, optionselect } from '@/api/system/post import ShuttleFrame from '../../project/projectRelevancy/component/ShuttleFrame.vue'; import { listProject } from '@/api/project/project'; import editInfo from './comm/editInfo.vue'; +import roleInfo from './comm/roleInfo.vue'; const router = useRouter(); const { proxy } = getCurrentInstance() as ComponentInternalInstance; const { sys_normal_disable, sys_user_sex } = toRefs(proxy?.useDict('sys_normal_disable', 'sys_user_sex')); @@ -248,6 +251,7 @@ const postOptions = ref([]); const roleOptions = ref([]); const projectOptions = ref([]); const editInfoRef = ref | null>(null); +const roleInfoRef = ref | null>(null); /*** 用户导入参数 */ const upload = reactive({ // 是否显示弹出层(用户导入) @@ -279,6 +283,7 @@ const queryFormRef = ref(); const userFormRef = ref(); const uploadRef = ref(); const formDialogRef = ref(); +const deptIdRole = ref(); const type = ref(1); const dialog = reactive({ visible: false, @@ -373,7 +378,9 @@ watchEffect( flush: 'post' // watchEffect会在DOM挂载或者更新之前就会触发,此属性控制在DOM元素更新后运行 } ); - +const setDeptId = (deptId: number) => { + deptIdRole.value = deptId; +}; /** 查询用户列表 */ const getList = async () => { loading.value = true; @@ -558,6 +565,7 @@ const cancel = () => { const handleAdd = async () => { reset(); const { data } = await api.getUser(); + type.value = 1; dialog.visible = true; dialog.title = '新增用户'; nextTick(() => { @@ -570,22 +578,13 @@ const handleAdd = async () => { /** 修改按钮操作 */ const handleUpdate = async (row?: UserForm) => { reset(); - const userId = row?.userId || ids.value[0]; - const { data } = await api.getUser(userId); dialog.visible = true; dialog.title = '修改用户'; + type.value = 1; + form.value = row; nextTick(() => { editInfoRef.value?.open(row); }); - Object.assign(form.value, data.user); - postOptions.value = data.posts; - roleOptions.value = data.roles; - form.value.postIds = data.postIds; - form.value.projectRoles = data.projectRoles; - form.value.password = ''; - const roleList = await getRoleList(form.value.deptId); - - roleOptions.value = roleList.data; }; const validate = () => { @@ -693,6 +692,13 @@ const uploadCert = async () => { }; const onTab = (val) => { type.value = val; + if (val == 2) { + let obj = editInfoRef.value?.getInfoForm(); + form.value = obj; + nextTick(() => { + roleInfoRef.value?.open(form.value, deptIdRole.value); + }); + } }; @@ -701,7 +707,7 @@ const onTab = (val) => { display: flex; justify-content: space-between; align-items: center; - height: 600px; + height: 680px; .tab_info { height: 100%; width: 200px;