完成:保养记录和厂内维修模块

This commit is contained in:
gxwebsoft
2024-02-25 19:33:03 +08:00
parent 08f83ed015
commit aa56030cbd
16 changed files with 1442 additions and 400 deletions

View File

@@ -1,43 +1,43 @@
import type { PageParam } from "@/api";
import { Dayjs } from "dayjs";
import type { PageParam } from '@/api';
import { Dayjs } from 'dayjs';
export interface Accessory {
accessoryId?: undefined;
accessoryName?: string;
accessoryNo?: string;
accessoryCategory?: object;
accessoryModel?: string;
accessoryModelMultiple?: string[];
accessorySpecs?: string;
accessoryPrice?: number;
accessoryNum?: number;
accessoryUnit?: string;
accessoryStock?: string;
companyNo?: string;
companyName?: string;
manufactor?: string;
manufactorNo?: string;
accessoryWeight?: string;
lifeYear?: number;
factoryDate?: string;
scrapDate?: string;
status?: number;
comments?: string;
sortNumber?: number;
userId?: number;
deleted?: number;
tenantId?: number;
createTime?: string;
updateTime?: string;
buyDate?: string | Dayjs;
accessoryId?: undefined;
accessoryName?: string;
accessoryNo?: string;
accessoryCategory?: object;
accessoryModel?: string;
accessoryModelMultiple?: string[];
accessorySpecs?: string;
accessoryPrice?: number;
accessoryNum?: number;
accessoryUnit?: string;
accessoryStock?: string;
companyNo?: string;
companyName?: string;
manufactor?: string;
manufactorNo?: string;
accessoryWeight?: string;
lifeYear?: number;
factoryDate?: string;
scrapDate?: string;
status?: number;
comments?: string;
sortNumber?: number;
userId?: number;
deleted?: number;
tenantId?: number;
createTime?: string;
updateTime?: string;
buyDate?: string | Dayjs;
}
/**
* 搜索条件
*/
export interface AccessoryParam extends PageParam {
accessoryId?: number;
accessoryName?: string;
status?: number;
keywords?: string;
accessoryId?: number;
accessoryName?: string;
status?: number;
keywords?: string;
}

View File

@@ -0,0 +1,109 @@
import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api';
import type {
SecurityPlant,
SecurityPlantParam
} from '@/api/tower/security-plant/model';
/**
* 分页查询仓库
*/
export async function pageSecurityPlant(params: SecurityPlantParam) {
const res = await request.get<ApiResult<PageResult<SecurityPlant>>>(
'/tower/tower-security-plant/page',
{
params
}
);
if (res.data.code === 0) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 查询仓库列表
*/
export async function listSecurityPlant(params?: SecurityPlantParam) {
const res = await request.get<ApiResult<SecurityPlant[]>>(
'/tower/tower-security-plant',
{
params
}
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 添加仓库
*/
export async function addSecurityPlant(data: SecurityPlant) {
const res = await request.post<ApiResult<unknown>>(
'/tower/tower-security-plant',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 修改仓库
*/
export async function updateSecurityPlant(data: SecurityPlant) {
const res = await request.put<ApiResult<unknown>>(
'/tower/tower-security-plant',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 绑定仓库
*/
export async function bindSecurityPlant(data: SecurityPlant) {
const res = await request.put<ApiResult<unknown>>(
'/tower/tower-security-plant/bind',
data
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 删除仓库
*/
export async function removeSecurityPlant(id?: number) {
const res = await request.delete<ApiResult<unknown>>(
'/tower/tower-security-plant/' + id
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}
/**
* 批量删除仓库
*/
export async function removeBatchSecurityPlant(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>(
'/tower/tower-security-plant/batch',
{
data
}
);
if (res.data.code === 0) {
return res.data.message;
}
return Promise.reject(new Error(res.data.message));
}

View File

@@ -0,0 +1,39 @@
import type { PageParam } from '@/api';
export interface SecurityPlant {
securityPlantId?: number;
securityId?: number;
projectName?: string;
projectId?: number;
securityCode?: string;
regionName?: string;
longitude?: string;
latitude?: string;
country?: string;
province?: string;
city?: string;
region?: string;
address?: string;
status?: number;
confirmStatus?: number;
userId?: number;
confirmId?: number;
comments?: string;
sortNumber?: number;
accessoryName?: string;
accessoryCategory?: object;
accessoryNo?: string;
accessorySpecs?: string;
accessoryModel?: string;
}
/**
* 搜索条件
*/
export interface SecurityPlantParam extends PageParam {
securityId?: number;
projectId?: number;
projectName?: string;
status?: number;
keywords?: string;
}

View File

@@ -2,6 +2,7 @@ import type { PageParam } from '@/api';
export interface SecurityRecord {
securityRecordId?: number;
securityId?: number;
projectName?: string;
projectId?: number;
securityCode?: string;
@@ -17,6 +18,11 @@ export interface SecurityRecord {
userId?: number;
comments?: string;
sortNumber?: number;
accessoryName?: string;
accessoryCategory?: object;
accessoryNo?: string;
accessorySpecs?: string;
accessoryModel?: string;
}
/**

View File

@@ -1,7 +1,7 @@
import type { PageParam } from '@/api';
export interface Security {
type: number;
type?: number;
securityId?: number;
projectName?: string;
projectId?: number;
@@ -22,6 +22,10 @@ export interface Security {
userId?: number;
comments?: string;
sortNumber?: number;
accessoryNo?: string;
accessoryCategory?: object;
accessoryModel?: string;
accessorySpecs?: string;
}
/**