新增客户管理;
新增合同管理
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type { Customer, CustomerParam } from './model';
|
||||
import type {ApiResult, PageResult} from '@/api';
|
||||
import type {Customer, CustomerParam} from './model';
|
||||
|
||||
/**
|
||||
* 分页查询客户
|
||||
*/
|
||||
export async function pageCustomer(params: CustomerParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Customer>>>(
|
||||
'/oa/customer/page',
|
||||
'/tower/tower-customer/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
@@ -22,9 +22,12 @@ export async function pageCustomer(params: CustomerParam) {
|
||||
* 查询客户列表
|
||||
*/
|
||||
export async function listCustomer(params?: CustomerParam) {
|
||||
const res = await request.get<ApiResult<Customer[]>>('/oa/customer', {
|
||||
params
|
||||
});
|
||||
const res = await request.get<ApiResult<Customer[]>>(
|
||||
'/tower/tower-customer',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
@@ -35,7 +38,9 @@ export async function listCustomer(params?: CustomerParam) {
|
||||
* 根据id查询客户
|
||||
*/
|
||||
export async function getCustomer(id: number) {
|
||||
const res = await request.get<ApiResult<Customer>>('/oa/customer/' + id);
|
||||
const res = await request.get<ApiResult<Customer>>(
|
||||
'/tower/tower-customer/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
@@ -46,7 +51,10 @@ export async function getCustomer(id: number) {
|
||||
* 添加客户
|
||||
*/
|
||||
export async function addCustomer(data: Customer) {
|
||||
const res = await request.post<ApiResult<unknown>>('/oa/customer', data);
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/tower/tower-customer',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
@@ -57,7 +65,10 @@ export async function addCustomer(data: Customer) {
|
||||
* 修改客户
|
||||
*/
|
||||
export async function updateCustomer(data: Customer) {
|
||||
const res = await request.put<ApiResult<unknown>>('/oa/customer', data);
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/tower/tower-customer',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
@@ -68,7 +79,10 @@ export async function updateCustomer(data: Customer) {
|
||||
* 批量修改客户
|
||||
*/
|
||||
export async function updateBatchCustomer(data: Customer[]) {
|
||||
const res = await request.put<ApiResult<unknown>>('/oa/customer/batch', data);
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/tower/tower-customer/batch',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
@@ -79,7 +93,9 @@ export async function updateBatchCustomer(data: Customer[]) {
|
||||
* 删除客户
|
||||
*/
|
||||
export async function removeCustomer(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>('/oa/customer/' + id);
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/tower/tower-customer/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
@@ -90,9 +106,12 @@ export async function removeCustomer(id?: number) {
|
||||
* 批量删除客户
|
||||
*/
|
||||
export async function removeBatchCustomer(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>('/oa/customer/batch', {
|
||||
data
|
||||
});
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/tower/tower-customer/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
@@ -107,9 +126,12 @@ export async function checkExistence(
|
||||
value: string,
|
||||
id?: number
|
||||
) {
|
||||
const res = await request.get<ApiResult<unknown>>('/oa/customer/existence', {
|
||||
params: { field, value, id }
|
||||
});
|
||||
const res = await request.get<ApiResult<unknown>>(
|
||||
'/tower/tower-customer/existence',
|
||||
{
|
||||
params: {field, value, id}
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
|
||||
@@ -6,59 +6,44 @@ import type { PageParam } from '@/api';
|
||||
export interface Customer {
|
||||
// 客户id
|
||||
customerId?: number;
|
||||
// 客户类型
|
||||
customerType?: string;
|
||||
// 客户来源
|
||||
customerSource?: string;
|
||||
// 客户标识
|
||||
customerCode: string;
|
||||
creditCode: string;
|
||||
// 客户名称
|
||||
customerName?: string;
|
||||
name: string;
|
||||
// 客户全称
|
||||
customerFullName?: string;
|
||||
fullName?: string;
|
||||
// 客户头像
|
||||
customerAvatar?: string;
|
||||
avatar?: string;
|
||||
// 座机电话
|
||||
customerPhone?: string;
|
||||
phone?: string;
|
||||
// 手机号码
|
||||
customerMobile?: string;
|
||||
telPhone?: string;
|
||||
// 联系人
|
||||
customerContacts?: string;
|
||||
contact?: string;
|
||||
// 联系地址
|
||||
customerAddress?: string;
|
||||
customerProvince?: string;
|
||||
customerCity?: string;
|
||||
customerRegion?: string;
|
||||
longitude?: string;
|
||||
latitude?: string;
|
||||
// 跟进状态
|
||||
progress?: string;
|
||||
address?: string;
|
||||
// 排序
|
||||
sortNumber?: number;
|
||||
// 备注
|
||||
comments?: string;
|
||||
// 创建时间
|
||||
createTime?: string;
|
||||
// 状态
|
||||
status?: string;
|
||||
// 备注
|
||||
remark?: string;
|
||||
// 用户ID
|
||||
userId?: any;
|
||||
// 发布者昵称
|
||||
nickname?: string;
|
||||
projectName?: any;
|
||||
companyName?: any;
|
||||
customerName?: any;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 客户搜索条件
|
||||
*/
|
||||
export interface CustomerParam extends PageParam {
|
||||
customerName?: string;
|
||||
customerCode?: string;
|
||||
customerType?: string;
|
||||
name?: string;
|
||||
creditCode?: string;
|
||||
createTimeStart?: string;
|
||||
createTimeEnd?: string;
|
||||
customerCategory?: string;
|
||||
progress?: string;
|
||||
customerSource?: string;
|
||||
betweenTime?: any;
|
||||
userId?: number;
|
||||
nickname?: string;
|
||||
|
||||
119
src/api/tower/contract/index.ts
Normal file
119
src/api/tower/contract/index.ts
Normal file
@@ -0,0 +1,119 @@
|
||||
import request from '@/utils/request';
|
||||
import type {ApiResult, PageResult} from '@/api';
|
||||
import type {Contract, ContractParam} from './model';
|
||||
|
||||
/**
|
||||
* 分页查询合同
|
||||
*/
|
||||
export async function pageContract(params: ContractParam) {
|
||||
const res = await request.get<ApiResult<PageResult<Contract>>>(
|
||||
'/tower/tower-contract/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询合同列表
|
||||
*/
|
||||
export async function listContract(params?: ContractParam) {
|
||||
const res = await request.get<ApiResult<Contract[]>>(
|
||||
'/tower/tower-contract',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询合同
|
||||
*/
|
||||
export async function getContract(id: number) {
|
||||
const res = await request.get<ApiResult<Contract>>(
|
||||
'/tower/tower-contract/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加合同
|
||||
*/
|
||||
export async function addContract(data: Contract) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/tower/tower-contract',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改合同
|
||||
*/
|
||||
export async function updateContract(data: Contract) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/tower/tower-contract',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量修改合同
|
||||
*/
|
||||
export async function updateBatchContract(data: Contract[]) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/tower/tower-contract/batch',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除合同
|
||||
*/
|
||||
export async function removeContract(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/tower/tower-contract/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除合同
|
||||
*/
|
||||
export async function removeBatchContract(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/tower/tower-contract/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
46
src/api/tower/contract/model/index.ts
Normal file
46
src/api/tower/contract/model/index.ts
Normal file
@@ -0,0 +1,46 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 合同
|
||||
*/
|
||||
export interface Contract {
|
||||
// 合同id
|
||||
contractId?: any;
|
||||
// 项目id
|
||||
projectId: any;
|
||||
// 承租方
|
||||
companyId: any;
|
||||
// 出租方
|
||||
customerId: any;
|
||||
// 业务负责人
|
||||
customerContact?: string;
|
||||
// 合同编号
|
||||
contactNumber: string;
|
||||
// 签订日期
|
||||
signDate?: string;
|
||||
// 开始日期
|
||||
startDate?: string;
|
||||
// 截止日期
|
||||
endDate?: string;
|
||||
// 合同金额
|
||||
contractAmount?: number;
|
||||
// 合同约定金额
|
||||
contactAgreeAmount?: string;
|
||||
// 合同是否已存档
|
||||
isInStock?: number;
|
||||
// 是否自动结算
|
||||
autoSettle?: number;
|
||||
userId?: any;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 合同搜索条件
|
||||
*/
|
||||
export interface ContractParam extends PageParam {
|
||||
contactNumber?: string;
|
||||
createTimeStart?: string;
|
||||
createTimeEnd?: string;
|
||||
betweenTime?: any;
|
||||
|
||||
}
|
||||
133
src/api/tower/contractEquipment/index.ts
Normal file
133
src/api/tower/contractEquipment/index.ts
Normal file
@@ -0,0 +1,133 @@
|
||||
import request from '@/utils/request';
|
||||
import type {ApiResult, PageResult} from '@/api';
|
||||
import type {ContractEquipment, ContractEquipmentParam} from './model';
|
||||
|
||||
/**
|
||||
* 分页查询合同设备
|
||||
*/
|
||||
export async function pageContract(params: ContractEquipmentParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ContractEquipment>>>(
|
||||
'/tower/tower-contract-equipment/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询合同设备列表
|
||||
*/
|
||||
export async function listContractEquipment(params?: ContractEquipmentParam) {
|
||||
const res = await request.get<ApiResult<ContractEquipment[]>>(
|
||||
'/tower/tower-contract-equipment',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询合同设备
|
||||
*/
|
||||
export async function getContractEquipment(id: number) {
|
||||
const res = await request.get<ApiResult<ContractEquipment>>(
|
||||
'/tower/tower-contract-equipment/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加合同设备
|
||||
*/
|
||||
export async function addContractEquipment(data: ContractEquipment) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/tower/tower-contract-equipment',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改合同设备
|
||||
*/
|
||||
export async function updateContractEquipment(data: ContractEquipment) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/tower/tower-contract-equipment',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量修改合同设备
|
||||
*/
|
||||
export async function updateBatchContractEquipment(data: ContractEquipment[]) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/tower/tower-contract-equipment/batch',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量添加合同设备
|
||||
*/
|
||||
export async function addBatchContractEquipment(data: ContractEquipment[]) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/tower/tower-contract-equipment/batch',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除合同设备
|
||||
*/
|
||||
export async function removeContractEquipment(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/tower/tower-contract-equipment/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除合同设备
|
||||
*/
|
||||
export async function removeBatchContractEquipment(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/tower/tower-contract-equipment/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
39
src/api/tower/contractEquipment/model/index.ts
Normal file
39
src/api/tower/contractEquipment/model/index.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 合同
|
||||
*/
|
||||
export interface ContractEquipment {
|
||||
contractEquipmentId?: any;
|
||||
// 合同id
|
||||
contractId: any;
|
||||
// 设备名
|
||||
equipmentName: string;
|
||||
// 规格
|
||||
equipmentModel: string;
|
||||
// 数量
|
||||
num: any;
|
||||
// 租期
|
||||
planRentMonth: any;
|
||||
// 租金
|
||||
rentAmount: any;
|
||||
// 进退场费
|
||||
inOutAmount: any;
|
||||
// 劳务费
|
||||
workerAmount: any;
|
||||
// 其他费用
|
||||
otherAmount: any;
|
||||
// 预埋费
|
||||
preBuryAmount: any;
|
||||
// 备注
|
||||
remark?: any;
|
||||
userId?: any;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 合同搜索条件
|
||||
*/
|
||||
export interface ContractEquipmentParam extends PageParam {
|
||||
contactId?: string;
|
||||
}
|
||||
133
src/api/tower/contractFile/index.ts
Normal file
133
src/api/tower/contractFile/index.ts
Normal file
@@ -0,0 +1,133 @@
|
||||
import request from "@/utils/request";
|
||||
import type { ApiResult, PageResult } from "@/api";
|
||||
import type { ContractFile, ContractFileParam } from "./model";
|
||||
|
||||
/**
|
||||
* 分页查询合同文件
|
||||
*/
|
||||
export async function pageContract(params: ContractFileParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ContractFile>>>(
|
||||
"/tower/tower-contract/page",
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询合同文件列表
|
||||
*/
|
||||
export async function listContractFile(params?: ContractFileParam) {
|
||||
const res = await request.get<ApiResult<ContractFile[]>>(
|
||||
"/tower/tower-contract-file",
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询合同文件
|
||||
*/
|
||||
export async function getContractFile(id: number) {
|
||||
const res = await request.get<ApiResult<ContractFile>>(
|
||||
"/tower/tower-contract-file/" + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加合同文件
|
||||
*/
|
||||
export async function addContractFile(data: ContractFile) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
"/tower/tower-contract-file",
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改合同文件
|
||||
*/
|
||||
export async function updateContractFile(data: ContractFile) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
"/tower/tower-contract-file",
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量修改合同文件
|
||||
*/
|
||||
export async function updateBatchContractFile(data: ContractFile[]) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
"/tower/tower-contract-file/batch",
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量添加合同文件
|
||||
*/
|
||||
export async function addBatchContractFile(data: ContractFile[]) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
"/tower/tower-contract-file/batch",
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除合同文件
|
||||
*/
|
||||
export async function removeContractFile(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
"/tower/tower-contract-file/" + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除合同文件
|
||||
*/
|
||||
export async function removeBatchContractFile(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
"/tower/tower-contract-file/batch",
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
24
src/api/tower/contractFile/model/index.ts
Normal file
24
src/api/tower/contractFile/model/index.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 合同
|
||||
*/
|
||||
export interface ContractFile {
|
||||
// 文件id
|
||||
contractFileId?: any;
|
||||
// 项目id
|
||||
contractId?: any;
|
||||
// 路径
|
||||
path: string;
|
||||
// 文件类型
|
||||
type?: any;
|
||||
userId?: any;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 合同搜索条件
|
||||
*/
|
||||
export interface ContractFileParam extends PageParam {
|
||||
contactId?: string;
|
||||
}
|
||||
Reference in New Issue
Block a user