完成合同管理模块和公共参数模块
This commit is contained in:
@@ -1,8 +1,22 @@
|
||||
import type { PageParam } from '@/api';
|
||||
import { ProjectOrder } from "@/api/tower/project/order/model";
|
||||
import { ProjectPlace } from "@/api/tower/project/place/model";
|
||||
|
||||
interface FileItem {
|
||||
uid: number;
|
||||
name?: string;
|
||||
status?: string;
|
||||
response?: Response;
|
||||
thumbUrl?: string;
|
||||
downloadUrl?: string;
|
||||
url: string;
|
||||
}
|
||||
|
||||
export interface Project {
|
||||
projectId?: number;
|
||||
projectName?: string;
|
||||
projectImage?: string;
|
||||
files?: FileItem[];
|
||||
companyName?: string;
|
||||
customerName?: string;
|
||||
projectRegion?: string;
|
||||
@@ -24,6 +38,8 @@ export interface Project {
|
||||
userId?: number;
|
||||
comments?: string;
|
||||
sortNumber?: number;
|
||||
orders?: ProjectOrder[];
|
||||
places?: ProjectPlace[];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,128 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type {
|
||||
ProjectOrder,
|
||||
ProjectOrderParam
|
||||
} from '@/api/tower/project/order/model/index';
|
||||
|
||||
/**
|
||||
* 分页查询合同预定设备清单
|
||||
*/
|
||||
export async function pageProjectOrder(params: ProjectOrderParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ProjectOrder>>>(
|
||||
'/tower/tower-project-order/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询合同预定设备清单列表
|
||||
*/
|
||||
export async function listProjectOrder(params?: ProjectOrderParam) {
|
||||
const res = await request.get<ApiResult<ProjectOrder[]>>(
|
||||
'/tower/tower-project-order',
|
||||
{
|
||||
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 getProjectOrder(id: number) {
|
||||
const res = await request.get<ApiResult<ProjectOrder>>(
|
||||
'/tower/tower-project-order/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加合同预定设备清单
|
||||
*/
|
||||
export async function addProjectOrder(data: ProjectOrder) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/tower/tower-project-order',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改合同预定设备清单
|
||||
*/
|
||||
export async function updateProjectOrder(data: ProjectOrder) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/tower/tower-project-order',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除合同预定设备清单
|
||||
*/
|
||||
export async function removeProjectOrder(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/tower/tower-project-order/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除合同预定设备清单
|
||||
*/
|
||||
export async function removeBatchProjectOrder(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/tower/tower-project-order/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查IP是否存在
|
||||
*/
|
||||
export async function checkExistence(
|
||||
field: string,
|
||||
value: string,
|
||||
id?: number
|
||||
) {
|
||||
const res = await request.get<ApiResult<unknown>>(
|
||||
'/tower/tower-project-order/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 合同预定设备清单
|
||||
*/
|
||||
export interface ProjectOrder {
|
||||
// 合同预定设备清单id
|
||||
projectOrderId?: number;
|
||||
equipmentName?: string;
|
||||
equipmentModel?: string;
|
||||
equipmentNum?: number;
|
||||
key?: string;
|
||||
unit?: string;
|
||||
startTime?: string;
|
||||
endTime?: string;
|
||||
year?: string;
|
||||
documenter?: string;
|
||||
userId?: number;
|
||||
username?: string;
|
||||
nickname?: string;
|
||||
avatar?: string;
|
||||
email?: string;
|
||||
phone?: string;
|
||||
projectId?: number;
|
||||
comments?: string;
|
||||
status?: string;
|
||||
createTime?: string;
|
||||
isEdit?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* 合同预定设备清单搜索条件
|
||||
*/
|
||||
export interface ProjectOrderParam extends PageParam {
|
||||
projectOrderId?: number;
|
||||
userId?: number;
|
||||
projectId?: number;
|
||||
}
|
||||
|
||||
export interface UserItem {
|
||||
key: string;
|
||||
isEdit?: boolean;
|
||||
number?: string;
|
||||
name?: string;
|
||||
department?: string;
|
||||
}
|
||||
@@ -0,0 +1,128 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type {
|
||||
ProjectPlace,
|
||||
ProjectPlaceParam
|
||||
} from '@/api/tower/project/place/model/index';
|
||||
|
||||
/**
|
||||
* 分页查询检查/保养部位配置
|
||||
*/
|
||||
export async function pageProjectPlace(params: ProjectPlaceParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ProjectPlace>>>(
|
||||
'/tower/tower-project-place/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询检查/保养部位配置列表
|
||||
*/
|
||||
export async function listProjectPlace(params?: ProjectPlaceParam) {
|
||||
const res = await request.get<ApiResult<ProjectPlace[]>>(
|
||||
'/tower/tower-project-place',
|
||||
{
|
||||
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 getProjectPlace(id: number) {
|
||||
const res = await request.get<ApiResult<ProjectPlace>>(
|
||||
'/tower/tower-project-place/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加检查/保养部位配置
|
||||
*/
|
||||
export async function addProjectPlace(data: ProjectPlace) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/tower/tower-project-place',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改检查/保养部位配置
|
||||
*/
|
||||
export async function updateProjectPlace(data: ProjectPlace) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/tower/tower-project-place',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除检查/保养部位配置
|
||||
*/
|
||||
export async function removeProjectPlace(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/tower/tower-project-place/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除检查/保养部位配置
|
||||
*/
|
||||
export async function removeBatchProjectPlace(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/tower/tower-project-place/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查IP是否存在
|
||||
*/
|
||||
export async function checkExistence(
|
||||
field: string,
|
||||
value: string,
|
||||
id?: number
|
||||
) {
|
||||
const res = await request.get<ApiResult<unknown>>(
|
||||
'/tower/tower-project-place/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 检查/保养部位配置
|
||||
*/
|
||||
export interface ProjectPlace {
|
||||
id?: number;
|
||||
projectId?: number;
|
||||
placeId?: number;
|
||||
comments?: string;
|
||||
status?: string;
|
||||
createTime?: string;
|
||||
isEdit?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索条件
|
||||
*/
|
||||
export interface ProjectPlaceParam extends PageParam {
|
||||
id?: number;
|
||||
placeId?: number;
|
||||
projectId?: number;
|
||||
}
|
||||
@@ -0,0 +1,128 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type {
|
||||
ProjectUser,
|
||||
ProjectUserParam
|
||||
} from '@/api/tower/project/user/model/index';
|
||||
|
||||
/**
|
||||
* 分页查询项目成员
|
||||
*/
|
||||
export async function pageProjectUser(params: ProjectUserParam) {
|
||||
const res = await request.get<ApiResult<PageResult<ProjectUser>>>(
|
||||
'/tower/tower-project-user/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询项目成员列表
|
||||
*/
|
||||
export async function listProjectUser(params?: ProjectUserParam) {
|
||||
const res = await request.get<ApiResult<ProjectUser[]>>(
|
||||
'/tower/tower-project-user',
|
||||
{
|
||||
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 getProjectUser(id: number) {
|
||||
const res = await request.get<ApiResult<ProjectUser>>(
|
||||
'/tower/tower-project-user/' + id
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加项目成员
|
||||
*/
|
||||
export async function addProjectUser(data: ProjectUser) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/tower/tower-project-user',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改项目成员
|
||||
*/
|
||||
export async function updateProjectUser(data: ProjectUser) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/tower/tower-project-user',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除项目成员
|
||||
*/
|
||||
export async function removeProjectUser(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/tower/tower-project-user/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除项目成员
|
||||
*/
|
||||
export async function removeBatchProjectUser(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/tower/tower-project-user/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查IP是否存在
|
||||
*/
|
||||
export async function checkExistence(
|
||||
field: string,
|
||||
value: string,
|
||||
id?: number
|
||||
) {
|
||||
const res = await request.get<ApiResult<unknown>>(
|
||||
'/tower/tower-project-user/existence',
|
||||
{
|
||||
params: { field, value, id }
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
/**
|
||||
* 项目成员
|
||||
*/
|
||||
export interface ProjectUser {
|
||||
// 项目成员id
|
||||
id?: number;
|
||||
role?: number;
|
||||
userId?: number;
|
||||
username?: string;
|
||||
nickname?: string;
|
||||
avatar?: string;
|
||||
email?: string;
|
||||
phone?: string;
|
||||
projectId?: number;
|
||||
status?: string;
|
||||
createTime?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 项目成员搜索条件
|
||||
*/
|
||||
export interface ProjectUserParam extends PageParam {
|
||||
userId?: number;
|
||||
projectId?: number;
|
||||
}
|
||||
|
||||
export interface UserItem {
|
||||
key: string;
|
||||
isEdit?: boolean;
|
||||
number?: string;
|
||||
name?: string;
|
||||
department?: string;
|
||||
}
|
||||
Reference in New Issue
Block a user