From fda152b544ed0b3ceb8309df5b7eca2de888f3f1 Mon Sep 17 00:00:00 2001 From: chenrui <1187576398@qq.com> Date: 星期二, 10 六月 2025 11:39:55 +0800 Subject: [PATCH] 开票登记编辑功能开发 --- src/views/system/role/authUser.vue | 95 +++++++++++++++++++++++++---------------------- 1 files changed, 51 insertions(+), 44 deletions(-) diff --git a/src/views/system/role/authUser.vue b/src/views/system/role/authUser.vue index de3efd8..20be11c 100644 --- a/src/views/system/role/authUser.vue +++ b/src/views/system/role/authUser.vue @@ -92,19 +92,19 @@ </template> <script setup name="AuthUser"> -import selectUser from "./selectUser"; -import { allocatedUserList, authUserCancel, authUserCancelAll } from "@/api/system/role"; +import selectUser from "./selectUser" +import { allocatedUserList, authUserCancel, authUserCancelAll } from "@/api/system/role" -const route = useRoute(); -const { proxy } = getCurrentInstance(); -const { sys_normal_disable } = proxy.useDict("sys_normal_disable"); +const route = useRoute() +const { proxy } = getCurrentInstance() +const { sys_normal_disable } = proxy.useDict("sys_normal_disable") -const userList = ref([]); -const loading = ref(true); -const showSearch = ref(true); -const multiple = ref(true); -const total = ref(0); -const userIds = ref([]); +const userList = ref([]) +const loading = ref(true) +const showSearch = ref(true) +const multiple = ref(true) +const total = ref(0) +const userIds = ref([]) const queryParams = reactive({ pageNum: 1, @@ -112,61 +112,68 @@ roleId: route.params.roleId, userName: undefined, phonenumber: undefined, -}); +}) /** 鏌ヨ鎺堟潈鐢ㄦ埛鍒楄〃 */ function getList() { - loading.value = true; + loading.value = true allocatedUserList(queryParams).then(response => { - userList.value = response.rows; - total.value = response.total; - loading.value = false; - }); + userList.value = response.rows + total.value = response.total + loading.value = false + }) } -// 杩斿洖鎸夐挳 + +/** 杩斿洖鎸夐挳 */ function handleClose() { - const obj = { path: "/system/role" }; - proxy.$tab.closeOpenPage(obj); + const obj = { path: "/system/role" } + proxy.$tab.closeOpenPage(obj) } + /** 鎼滅储鎸夐挳鎿嶄綔 */ function handleQuery() { - queryParams.pageNum = 1; - getList(); + queryParams.pageNum = 1 + getList() } + /** 閲嶇疆鎸夐挳鎿嶄綔 */ function resetQuery() { - proxy.resetForm("queryRef"); - handleQuery(); + proxy.resetForm("queryRef") + handleQuery() } -// 澶氶�夋閫変腑鏁版嵁 + +/** 澶氶�夋閫変腑鏁版嵁 */ function handleSelectionChange(selection) { - userIds.value = selection.map(item => item.userId); - multiple.value = !selection.length; + userIds.value = selection.map(item => item.userId) + multiple.value = !selection.length } + /** 鎵撳紑鎺堟潈鐢ㄦ埛琛ㄥ脊绐� */ function openSelectUser() { - proxy.$refs["selectRef"].show(); + proxy.$refs["selectRef"].show() } + /** 鍙栨秷鎺堟潈鎸夐挳鎿嶄綔 */ function cancelAuthUser(row) { proxy.$modal.confirm('纭瑕佸彇娑堣鐢ㄦ埛"' + row.userName + '"瑙掕壊鍚楋紵').then(function () { - return authUserCancel({ userId: row.userId, roleId: queryParams.roleId }); + return authUserCancel({ userId: row.userId, roleId: queryParams.roleId }) }).then(() => { - getList(); - proxy.$modal.msgSuccess("鍙栨秷鎺堟潈鎴愬姛"); - }).catch(() => {}); -} -/** 鎵归噺鍙栨秷鎺堟潈鎸夐挳鎿嶄綔 */ -function cancelAuthUserAll(row) { - const roleId = queryParams.roleId; - const uIds = userIds.value.join(","); - proxy.$modal.confirm("鏄惁鍙栨秷閫変腑鐢ㄦ埛鎺堟潈鏁版嵁椤�?").then(function () { - return authUserCancelAll({ roleId: roleId, userIds: uIds }); - }).then(() => { - getList(); - proxy.$modal.msgSuccess("鍙栨秷鎺堟潈鎴愬姛"); - }).catch(() => {}); + getList() + proxy.$modal.msgSuccess("鍙栨秷鎺堟潈鎴愬姛") + }).catch(() => {}) } -getList(); +/** 鎵归噺鍙栨秷鎺堟潈鎸夐挳鎿嶄綔 */ +function cancelAuthUserAll(row) { + const roleId = queryParams.roleId + const uIds = userIds.value.join(",") + proxy.$modal.confirm("鏄惁鍙栨秷閫変腑鐢ㄦ埛鎺堟潈鏁版嵁椤�?").then(function () { + return authUserCancelAll({ roleId: roleId, userIds: uIds }) + }).then(() => { + getList() + proxy.$modal.msgSuccess("鍙栨秷鎺堟潈鎴愬姛") + }).catch(() => {}) +} + +getList() </script> -- Gitblit v1.9.3