From 0068553e356bc576cfe92f7e749d94e88ad40703 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E5=BF=A0=E6=9E=97?= <170083662@qq.com> Date: Tue, 10 Sep 2024 12:19:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=EF=BC=9A=E5=95=86=E6=88=B7?= =?UTF-8?q?=E5=85=A5=E9=A9=BB=E7=94=B3=E8=AF=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 4 +- src/api/shop/merchantApply/model/index.ts | 1 + src/layout/index.vue | 2 +- src/store/modules/tenant.ts | 2 +- src/views/shop/dealerApply/index.vue | 39 ++++++++++++------- .../components/merchantApplyEdit.vue | 17 +++++++- 6 files changed, 46 insertions(+), 19 deletions(-) diff --git a/.env.development b/.env.development index aa39b41..013ec41 100644 --- a/.env.development +++ b/.env.development @@ -1,11 +1,11 @@ VITE_APP_NAME=后台管理系统 VITE_SOCKET_URL=wss://server.gxwebsoft.com -VITE_SERVER_URL=https://server.gxwebsoft.com/api +#VITE_SERVER_URL=https://server.gxwebsoft.com/api VITE_THINK_URL=https://gxtyzx-api.websoft.top/api #VITE_API_URL=https://modules.gxwebsoft.com/api -#VITE_SERVER_URL=http://127.0.0.1:9090/api +VITE_SERVER_URL=http://127.0.0.1:9090/api VITE_API_URL=http://127.0.0.1:9001/api #VITE_THINK_URL=http://127.0.0.1:9099/api #/booking/bookingItem diff --git a/src/api/shop/merchantApply/model/index.ts b/src/api/shop/merchantApply/model/index.ts index 1101d3c..4e7e85a 100644 --- a/src/api/shop/merchantApply/model/index.ts +++ b/src/api/shop/merchantApply/model/index.ts @@ -34,6 +34,7 @@ export interface MerchantApply { goodsReview?: number; // 备注 comments?: string; + userId?: number; reason?: string; // 状态 status?: number; diff --git a/src/layout/index.vue b/src/layout/index.vue index 2a7f424..ba61ce8 100644 --- a/src/layout/index.vue +++ b/src/layout/index.vue @@ -55,7 +55,7 @@ :preview="false" :size="28" :src="logoPath" - @click="push(`/system/profile`)" + @click.stop="push(`/system/profile`)" alt="logo" /> diff --git a/src/store/modules/tenant.ts b/src/store/modules/tenant.ts index 2eca924..d26c736 100644 --- a/src/store/modules/tenant.ts +++ b/src/store/modules/tenant.ts @@ -41,7 +41,7 @@ export const useTenantStore = defineStore({ // 企业信息 if (company) { this.company = company; - localStorage.setItem('TenantId', String(company.tenantId)); + // localStorage.setItem('TenantId', String(company.tenantId)); localStorage.setItem('TenantName', String(company.shortName)); localStorage.setItem('CompanyId', String(company.companyId)); } diff --git a/src/views/shop/dealerApply/index.vue b/src/views/shop/dealerApply/index.vue index 78d166b..fe86c6f 100644 --- a/src/views/shop/dealerApply/index.vue +++ b/src/views/shop/dealerApply/index.vue @@ -45,7 +45,11 @@ - + @@ -62,8 +66,15 @@ } from 'ele-admin-pro/es/ele-pro-table/types'; import Search from './components/search.vue'; import DealerApplyEdit from './components/dealerApplyEdit.vue'; - import { pageDealerApply, removeDealerApply, removeBatchDealerApply } from '@/api/shop/dealerApply'; - import type { DealerApply, DealerApplyParam } from '@/api/shop/dealerApply/model'; + import { + pageDealerApply, + removeDealerApply, + removeBatchDealerApply + } from '@/api/shop/dealerApply'; + import type { + DealerApply, + DealerApplyParam + } from '@/api/shop/dealerApply/model'; // 表格实例 const tableRef = ref | null>(null); @@ -105,61 +116,61 @@ dataIndex: 'applyId', key: 'applyId', align: 'center', - width: 90, + width: 90 }, { title: '用户ID', dataIndex: 'userId', key: 'userId', - align: 'center', + align: 'center' }, { title: '姓名', dataIndex: 'realName', key: 'realName', - align: 'center', + align: 'center' }, { title: '手机号', dataIndex: 'mobile', key: 'mobile', - align: 'center', + align: 'center' }, { title: '推荐人用户ID', dataIndex: 'refereeId', key: 'refereeId', - align: 'center', + align: 'center' }, { title: '申请方式(10需后台审核 20无需审核)', dataIndex: 'applyType', key: 'applyType', - align: 'center', + align: 'center' }, { title: '申请时间', dataIndex: 'applyTime', key: 'applyTime', - align: 'center', + align: 'center' }, { title: '审核状态 (10待审核 20审核通过 30驳回)', dataIndex: 'applyStatus', key: 'applyStatus', - align: 'center', + align: 'center' }, { title: '审核时间', dataIndex: 'auditTime', key: 'auditTime', - align: 'center', + align: 'center' }, { title: '驳回原因', dataIndex: 'rejectReason', key: 'rejectReason', - align: 'center', + align: 'center' }, { title: '创建时间', @@ -174,7 +185,7 @@ title: '修改时间', dataIndex: 'updateTime', key: 'updateTime', - align: 'center', + align: 'center' }, { title: '操作', diff --git a/src/views/shop/merchantApply/components/merchantApplyEdit.vue b/src/views/shop/merchantApply/components/merchantApplyEdit.vue index e367147..fe45984 100644 --- a/src/views/shop/merchantApply/components/merchantApplyEdit.vue +++ b/src/views/shop/merchantApply/components/merchantApplyEdit.vue @@ -39,6 +39,7 @@ @@ -122,6 +123,7 @@ import { FormInstance } from 'ant-design-vue/es/form'; import { FileRecord } from '@/api/system/file/model'; import { MerchantType } from '@/api/shop/merchantType/model'; + import { updateUser } from '@/api/system/user'; // 是否是修改 const isUpdate = ref(false); @@ -167,6 +169,7 @@ ownStore: undefined, recommend: undefined, goodsReview: undefined, + userId: undefined, comments: undefined, reason: undefined, status: undefined, @@ -229,7 +232,7 @@ const { resetFields } = useForm(form, rules); /* 保存编辑 */ - const save = () => { + const save = async () => { if (!formRef.value) { return; } @@ -240,6 +243,18 @@ const formData = { ...form }; + // 升级为管理员并添加角色 + if (form.status == 1) { + updateUser({ + userId: form.userId, + isAdmin: true, + roles: [ + { + roleId: 751 + } + ] + }); + } const saveOrUpdate = isUpdate.value ? updateMerchantApply : addMerchantApply;