feat(user): 新增收货地址管理及售后申请页面
- 新增地址类型定义,增强前端地址数据结构 - 新增地址编辑页面,支持地址智能识别和定位选点功能 - 地址编辑支持省市区选择及默认地址设置 - 新增地址列表页面,支持地址展示、删除、编辑和选择功能 - 实现售后申请页面,支持选择售后类型和退款原因 - 售后申请支持商品选择、退款金额计算和凭证上传 - 新增售后详情页面,支持售后状态展示及申请取消 - 优化页面加载和用户交互体验,增加错误提示和权限处理
This commit is contained in:
161
src_bak/api/system/company/index.ts
Normal file
161
src_bak/api/system/company/index.ts
Normal file
@@ -0,0 +1,161 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult } from '@/api/index';
|
||||
import type { Company, CompanyParam } from './model';
|
||||
import { PageResult } from '@/api/index';
|
||||
import {SERVER_API_URL} from "@/utils/server";
|
||||
|
||||
/**
|
||||
* 查询企业资料
|
||||
*/
|
||||
export async function getCompany(params?: CompanyParam) {
|
||||
const res = await request.get<ApiResult<Company>>(
|
||||
SERVER_API_URL + '/system/company/profile',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询企业资料不限租户
|
||||
*/
|
||||
export async function getCompanyAll(companyId: number) {
|
||||
const res = await request.get<ApiResult<Company>>(
|
||||
SERVER_API_URL + '/system/company/profileAll/' + companyId
|
||||
);
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询Company列表
|
||||
*/
|
||||
export async function pageCompany(params: CompanyParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Company>>>(
|
||||
SERVER_API_URL + '/system/company/page',
|
||||
params
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询Company列表不限租户
|
||||
*/
|
||||
export async function pageCompanyAll(params: CompanyParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Company>>>(
|
||||
SERVER_API_URL + '/system/company/pageAll',
|
||||
params
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加Company
|
||||
*/
|
||||
export async function addCompany(data: Company) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/company',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改Company
|
||||
*/
|
||||
export async function updateCompany(data: Company) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/company',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改CompanyAll
|
||||
*/
|
||||
export async function updateCompanyAll(data: Company) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/company/updateCompanyAll',
|
||||
data
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除Company
|
||||
*/
|
||||
export async function removeCompany(id?: number) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/company/' + id
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
// 销毁租户
|
||||
export async function destructionTenant(id?: number) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/company/destruction/' + id
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除Company
|
||||
*/
|
||||
export async function removeBatchCompany(data: (number | undefined)[]) {
|
||||
const res = await request.del<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/company/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
|
||||
export async function checkExistence(
|
||||
field: string,
|
||||
value: string,
|
||||
id?: number
|
||||
) {
|
||||
const res = await request.get<ApiResult<unknown>>(
|
||||
SERVER_API_URL + '/system/company/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.code === 0) {
|
||||
return res.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
}
|
||||
120
src_bak/api/system/company/model/index.ts
Normal file
120
src_bak/api/system/company/model/index.ts
Normal file
@@ -0,0 +1,120 @@
|
||||
import type { PageParam } from '@/api';
|
||||
import type {CompanyParameter} from "~/api/system/companyParameter/model";
|
||||
import type {CompanyUrl} from "~/api/system/companyUrl/model";
|
||||
import type {CompanyGit} from "~/api/system/companyGit/model";
|
||||
|
||||
/**
|
||||
* 企业信息
|
||||
*/
|
||||
export interface Company {
|
||||
companyId?: number;
|
||||
type?: number;
|
||||
menuId?: number;
|
||||
shortName?: string;
|
||||
companyName?: string;
|
||||
companyType?: number;
|
||||
companyTypeMultiple?: string;
|
||||
appType?: string;
|
||||
companyLogo?: string;
|
||||
image?: string;
|
||||
content?: string;
|
||||
files?: any;
|
||||
companyCode?: string;
|
||||
domain?: string;
|
||||
phone?: string;
|
||||
tel?: string;
|
||||
email?: string;
|
||||
InvoiceHeader?: string;
|
||||
startTime?: string;
|
||||
expirationTime?: string;
|
||||
version?: number;
|
||||
versionName?: string;
|
||||
versionCode?: string;
|
||||
members?: number;
|
||||
storage?: string;
|
||||
storageMax?: string;
|
||||
buys?: number;
|
||||
clicks?: number;
|
||||
users?: number;
|
||||
departments?: number;
|
||||
industryParent?: string;
|
||||
industryChild?: string;
|
||||
country?: string;
|
||||
province?: string;
|
||||
city?: string;
|
||||
region?: string;
|
||||
address?: string;
|
||||
latitude?: string;
|
||||
longitude?: string;
|
||||
businessEntity?: string;
|
||||
comments?: any;
|
||||
authentication?: number;
|
||||
industryId?: number;
|
||||
industryName?: string;
|
||||
status?: number;
|
||||
userId?: number;
|
||||
official?: boolean;
|
||||
price?: number;
|
||||
chargingMethod?: number;
|
||||
planId?: number;
|
||||
sortNumber?: number;
|
||||
authoritative?: boolean;
|
||||
merchantId?: number;
|
||||
tenantId?: number;
|
||||
tenantName?: string;
|
||||
tenantCode?: string;
|
||||
modules?: string;
|
||||
requestUrl?: string;
|
||||
socketUrl?: string;
|
||||
serverUrl?: string;
|
||||
modulesUrl?: string;
|
||||
merchantUrl?: string;
|
||||
websiteUrl?: string;
|
||||
mpWeixinCode?: string;
|
||||
mpAlipayCode?: string;
|
||||
h5Code?: string;
|
||||
androidUrl?: string;
|
||||
iosUrl?: string;
|
||||
avatar?: string;
|
||||
nickname?: string;
|
||||
code?: number;
|
||||
createTime?: string;
|
||||
updateTime?: string;
|
||||
password?: string;
|
||||
password2?: string;
|
||||
collection?: boolean;
|
||||
recommend?: boolean;
|
||||
title?: string;
|
||||
parentName?: string;
|
||||
categoryName?: string;
|
||||
rate?: number;
|
||||
isBuy?: boolean;
|
||||
installed?: boolean;
|
||||
parameters?: CompanyParameter[];
|
||||
links?: CompanyUrl[];
|
||||
accounts?: CompanyUrl[];
|
||||
gits?: CompanyGit[];
|
||||
}
|
||||
|
||||
/**
|
||||
* 企业信息搜索条件
|
||||
*/
|
||||
export interface CompanyParam extends PageParam {
|
||||
companyId?: number;
|
||||
type?: number;
|
||||
official?: boolean;
|
||||
shortName?: string;
|
||||
companyName?: string;
|
||||
domain?: string;
|
||||
authoritative?: number;
|
||||
authentication?: number;
|
||||
industryParent?: string;
|
||||
industryChild?: string;
|
||||
province?: string;
|
||||
city?: string;
|
||||
region?: string;
|
||||
version?: number;
|
||||
status?: number;
|
||||
recommend?: boolean;
|
||||
collection?: boolean;
|
||||
}
|
||||
Reference in New Issue
Block a user