ソースを参照

Merge branch 'development' of http://8.152.195.41:3000/alien/group_web_merchant into development
with '#' will be ignored, and an empty message aborts

zhaoyang 1 ヶ月 前
コミット
00932c9412

+ 2 - 1
src/api/modules/accountRoleManagement.ts

@@ -68,6 +68,7 @@ export interface UpdateAccountDto {
   roleId: number;
   storeId: number;
   userId: number;
+  id: number;
 }
 
 // 通用响应接口
@@ -238,5 +239,5 @@ export const operationLog = (params: {
 };
 // 编辑子账号
 export const updateSubAccount = (updateAccountDto: UpdateAccountDto): Promise<ResultData<ApiResponse>> => {
-  return http.post<ApiResponse>(PORT_NONE + `/platform/user-role/updateSubAccount`, updateAccountDto, { loading: false });
+  return http.post<ApiResponse>(PORT_NONE + `/platform/user-role/updateSubAccountNew`, updateAccountDto, { loading: false });
 };

+ 4 - 5
src/views/accountRoleManagement/subAccountManagement/create.vue

@@ -260,10 +260,9 @@ onMounted(() => {
 // (编辑或查看时调用详情接口获取子账号数据)
 const loadSubAccountData = async () => {
   if (!accountId.value) return;
-
   try {
     const storeId = localGet("createdId") || localGet("geeker-user")?.userInfo?.storeId || "";
-    const userId = Number(accountId.value);
+    const userId = route.query.userId;
     const roleIdNew = Number(route.query.roleId);
     const res = await getSubAccountDetail(Number(storeId), userId, roleIdNew);
     const code = typeof res.code === "string" ? parseInt(res.code) : res.code;
@@ -320,13 +319,13 @@ const handleSave = async () => {
           ElMessage.error("缺少用户ID,无法更新");
           return;
         }
-
         const updateAccountDto = {
           accountName: subAccountForm.accountName,
           phone: subAccountForm.phone,
-          roleId: subAccountForm.roleId || 0,
+          roleId: route.query.roleId || 0,
           storeId: storeId,
-          userId: subAccountForm.userId
+          userId: route.query.userId,
+          id: accountId.value
         };
         const res = await updateSubAccount(updateAccountDto);
         const code = typeof res.code === "string" ? parseInt(res.code) : res.code;

+ 2 - 1
src/views/accountRoleManagement/subAccountManagement/index.vue

@@ -229,8 +229,9 @@ const handleEdit = (row: SubAccountItem) => {
   router.push({
     path: "/accountRoleManagement/subAccountManagement/create",
     query: {
-      id: row.userId.toString(),
+      id: row.id,
       roleId: row.roleId,
+      userId: row.userId,
       accountName: row.accountName,
       type: "edit"
     }