diff --git a/.env.development b/.env.development index 213846b..ecb9bfb 100644 --- a/.env.development +++ b/.env.development @@ -1,5 +1,5 @@ VITE_APP_NAME=后台管理(开发环境) -#VITE_API_URL=http://127.0.0.1:9200/api +VITE_API_URL=http://127.0.0.1:9200/api #VITE_SERVER_API_URL=http://127.0.0.1:8000/api diff --git a/src/api/credit/creditMpCustomer/index.ts b/src/api/credit/creditMpCustomer/index.ts new file mode 100644 index 0000000..7d4be9b --- /dev/null +++ b/src/api/credit/creditMpCustomer/index.ts @@ -0,0 +1,105 @@ +import request from '@/utils/request'; +import type { ApiResult, PageResult } from '@/api'; +import type { CreditMpCustomer, CreditMpCustomerParam } from './model'; + +/** + * 分页查询小程序端客户 + */ +export async function pageCreditMpCustomer(params: CreditMpCustomerParam) { + const res = await request.get>>( + '/credit/credit-mp-customer/page', + { + params + } + ); + if (res.data.code === 0) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 查询小程序端客户列表 + */ +export async function listCreditMpCustomer(params?: CreditMpCustomerParam) { + const res = await request.get>( + '/credit/credit-mp-customer', + { + params + } + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 添加小程序端客户 + */ +export async function addCreditMpCustomer(data: CreditMpCustomer) { + const res = await request.post>( + '/credit/credit-mp-customer', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 修改小程序端客户 + */ +export async function updateCreditMpCustomer(data: CreditMpCustomer) { + const res = await request.put>( + '/credit/credit-mp-customer', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 删除小程序端客户 + */ +export async function removeCreditMpCustomer(id?: number) { + const res = await request.delete>( + '/credit/credit-mp-customer/' + id + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 批量删除小程序端客户 + */ +export async function removeBatchCreditMpCustomer(data: (number | undefined)[]) { + const res = await request.delete>( + '/credit/credit-mp-customer/batch', + { + data + } + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 根据id查询小程序端客户 + */ +export async function getCreditMpCustomer(id: number) { + const res = await request.get>( + '/credit/credit-mp-customer/' + id + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} diff --git a/src/api/credit/creditMpCustomer/model/index.ts b/src/api/credit/creditMpCustomer/model/index.ts new file mode 100644 index 0000000..7bedbc8 --- /dev/null +++ b/src/api/credit/creditMpCustomer/model/index.ts @@ -0,0 +1,57 @@ +import type { PageParam } from '@/api'; + +/** + * 小程序端客户 + */ +export interface CreditMpCustomer { + // ID + id?: number; + // 拖欠方 + toUser?: string; + // 拖欠金额 + price?: string; + // 拖欠年数 + years?: string; + // 链接 + url?: string; + // 状态 + statusTxt?: string; + // 企业ID + companyId?: number; + // 所在省份 + province?: string; + // 所在城市 + city?: string; + // 所在辖区 + region?: string; + // 文件路径 + files?: string; + // 是否有数据 + hasData?: string; + // 备注 + comments?: string; + // 是否推荐 + recommend?: number; + // 排序(数字越小越靠前) + sortNumber?: number; + // 状态, 0正常, 1冻结 + status?: number; + // 是否删除, 0否, 1是 + deleted?: number; + // 用户ID + userId?: number; + // 租户id + tenantId?: number; + // 创建时间 + createTime?: string; + // 修改时间 + updateTime?: string; +} + +/** + * 小程序端客户搜索条件 + */ +export interface CreditMpCustomerParam extends PageParam { + id?: number; + keywords?: string; +} diff --git a/src/views/credit/creditMpCustomer/components/creditMpCustomerEdit.vue b/src/views/credit/creditMpCustomer/components/creditMpCustomerEdit.vue new file mode 100644 index 0000000..2e01348 --- /dev/null +++ b/src/views/credit/creditMpCustomer/components/creditMpCustomerEdit.vue @@ -0,0 +1,308 @@ + + + + diff --git a/src/views/credit/creditMpCustomer/components/search.vue b/src/views/credit/creditMpCustomer/components/search.vue new file mode 100644 index 0000000..82fea9d --- /dev/null +++ b/src/views/credit/creditMpCustomer/components/search.vue @@ -0,0 +1,42 @@ + + + + diff --git a/src/views/credit/creditMpCustomer/index.vue b/src/views/credit/creditMpCustomer/index.vue new file mode 100644 index 0000000..987a11d --- /dev/null +++ b/src/views/credit/creditMpCustomer/index.vue @@ -0,0 +1,341 @@ + + + + + + +