添加增删改查
This commit is contained in:
63
plus-ui/src/api/machinery/machinery/index.ts
Normal file
63
plus-ui/src/api/machinery/machinery/index.ts
Normal file
@ -0,0 +1,63 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { MachineryVO, MachineryForm, MachineryQuery } from '@/api/machinery/machinery/types';
|
||||
|
||||
/**
|
||||
* 查询机械列表
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
|
||||
export const listMachinery = (query?: MachineryQuery): AxiosPromise<MachineryVO[]> => {
|
||||
return request({
|
||||
url: '/machinery/machinery/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询机械详细
|
||||
* @param id
|
||||
*/
|
||||
export const getMachinery = (id: string | number): AxiosPromise<MachineryVO> => {
|
||||
return request({
|
||||
url: '/machinery/machinery/' + id,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 新增机械
|
||||
* @param data
|
||||
*/
|
||||
export const addMachinery = (data: MachineryForm) => {
|
||||
return request({
|
||||
url: '/machinery/machinery',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 修改机械
|
||||
* @param data
|
||||
*/
|
||||
export const updateMachinery = (data: MachineryForm) => {
|
||||
return request({
|
||||
url: '/machinery/machinery',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 删除机械
|
||||
* @param id
|
||||
*/
|
||||
export const delMachinery = (id: string | number | Array<string | number>) => {
|
||||
return request({
|
||||
url: '/machinery/machinery/' + id,
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
||||
111
plus-ui/src/api/machinery/machinery/types.ts
Normal file
111
plus-ui/src/api/machinery/machinery/types.ts
Normal file
@ -0,0 +1,111 @@
|
||||
export interface MachineryVO {
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 机械名称
|
||||
*/
|
||||
machineryName: string;
|
||||
|
||||
/**
|
||||
* 机械型号
|
||||
*/
|
||||
machineryNumber: string;
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
projectId: string | number;
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
number: number;
|
||||
|
||||
/**
|
||||
* 负责人
|
||||
*/
|
||||
principal: string;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark: string;
|
||||
|
||||
}
|
||||
|
||||
export interface MachineryForm extends BaseEntity {
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
id?: string | number;
|
||||
|
||||
/**
|
||||
* 机械名称
|
||||
*/
|
||||
machineryName?: string;
|
||||
|
||||
/**
|
||||
* 机械型号
|
||||
*/
|
||||
machineryNumber?: string;
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
projectId?: string | number;
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
number?: number;
|
||||
|
||||
/**
|
||||
* 负责人
|
||||
*/
|
||||
principal?: string;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark?: string;
|
||||
|
||||
}
|
||||
|
||||
export interface MachineryQuery extends PageQuery {
|
||||
|
||||
/**
|
||||
* 机械名称
|
||||
*/
|
||||
machineryName?: string;
|
||||
|
||||
/**
|
||||
* 机械型号
|
||||
*/
|
||||
machineryNumber?: string;
|
||||
|
||||
/**
|
||||
* 项目id
|
||||
*/
|
||||
projectId?: string | number;
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
number?: number;
|
||||
|
||||
/**
|
||||
* 负责人
|
||||
*/
|
||||
principal?: string;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
|
||||
|
||||
|
||||
63
plus-ui/src/api/machinery/machineryDetail/index.ts
Normal file
63
plus-ui/src/api/machinery/machineryDetail/index.ts
Normal file
@ -0,0 +1,63 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { MachineryDetailVO, MachineryDetailForm, MachineryDetailQuery } from '@/api/machinery/machineryDetail/types';
|
||||
|
||||
/**
|
||||
* 查询机械详情列表
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
|
||||
export const listMachineryDetail = (query?: MachineryDetailQuery): AxiosPromise<MachineryDetailVO[]> => {
|
||||
return request({
|
||||
url: '/machinery/machineryDetail/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询机械详情详细
|
||||
* @param id
|
||||
*/
|
||||
export const getMachineryDetail = (id: string | number): AxiosPromise<MachineryDetailVO> => {
|
||||
return request({
|
||||
url: '/machinery/machineryDetail/' + id,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 新增机械详情
|
||||
* @param data
|
||||
*/
|
||||
export const addMachineryDetail = (data: MachineryDetailForm) => {
|
||||
return request({
|
||||
url: '/machinery/machineryDetail',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 修改机械详情
|
||||
* @param data
|
||||
*/
|
||||
export const updateMachineryDetail = (data: MachineryDetailForm) => {
|
||||
return request({
|
||||
url: '/machinery/machineryDetail',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 删除机械详情
|
||||
* @param id
|
||||
*/
|
||||
export const delMachineryDetail = (id: string | number | Array<string | number>) => {
|
||||
return request({
|
||||
url: '/machinery/machineryDetail/' + id,
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
||||
156
plus-ui/src/api/machinery/machineryDetail/types.ts
Normal file
156
plus-ui/src/api/machinery/machineryDetail/types.ts
Normal file
@ -0,0 +1,156 @@
|
||||
export interface MachineryDetailVO {
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 检验证编号
|
||||
*/
|
||||
checkoutNumber: string;
|
||||
|
||||
/**
|
||||
* 检验单位
|
||||
*/
|
||||
checkoutUnit: string;
|
||||
|
||||
/**
|
||||
* 检定日期/有效期
|
||||
*/
|
||||
checkoutDate: string;
|
||||
|
||||
/**
|
||||
* 施工类型状态(0正常 1停用)
|
||||
*/
|
||||
status: number;
|
||||
|
||||
/**
|
||||
* 0入场 1出场
|
||||
*/
|
||||
type: number;
|
||||
|
||||
/**
|
||||
* 入场时间
|
||||
*/
|
||||
entryTime: string;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark: string;
|
||||
|
||||
/**
|
||||
* 图片(英文逗号分隔)
|
||||
*/
|
||||
picture: string;
|
||||
|
||||
/**
|
||||
* 机械主键id
|
||||
*/
|
||||
machineryId: string | number;
|
||||
|
||||
}
|
||||
|
||||
export interface MachineryDetailForm extends BaseEntity {
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
id?: string | number;
|
||||
|
||||
/**
|
||||
* 检验证编号
|
||||
*/
|
||||
checkoutNumber?: string;
|
||||
|
||||
/**
|
||||
* 检验单位
|
||||
*/
|
||||
checkoutUnit?: string;
|
||||
|
||||
/**
|
||||
* 检定日期/有效期
|
||||
*/
|
||||
checkoutDate?: string;
|
||||
|
||||
/**
|
||||
* 施工类型状态(0正常 1停用)
|
||||
*/
|
||||
status?: number;
|
||||
|
||||
/**
|
||||
* 0入场 1出场
|
||||
*/
|
||||
type?: number;
|
||||
|
||||
/**
|
||||
* 入场时间
|
||||
*/
|
||||
entryTime?: string;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
remark?: string;
|
||||
|
||||
/**
|
||||
* 图片(英文逗号分隔)
|
||||
*/
|
||||
picture?: string;
|
||||
|
||||
/**
|
||||
* 机械主键id
|
||||
*/
|
||||
machineryId?: string | number;
|
||||
|
||||
}
|
||||
|
||||
export interface MachineryDetailQuery extends PageQuery {
|
||||
|
||||
/**
|
||||
* 检验证编号
|
||||
*/
|
||||
checkoutNumber?: string;
|
||||
|
||||
/**
|
||||
* 检验单位
|
||||
*/
|
||||
checkoutUnit?: string;
|
||||
|
||||
/**
|
||||
* 检定日期/有效期
|
||||
*/
|
||||
checkoutDate?: string;
|
||||
|
||||
/**
|
||||
* 施工类型状态(0正常 1停用)
|
||||
*/
|
||||
status?: number;
|
||||
|
||||
/**
|
||||
* 0入场 1出场
|
||||
*/
|
||||
type?: number;
|
||||
|
||||
/**
|
||||
* 入场时间
|
||||
*/
|
||||
entryTime?: string;
|
||||
|
||||
/**
|
||||
* 图片(英文逗号分隔)
|
||||
*/
|
||||
picture?: string;
|
||||
|
||||
/**
|
||||
* 机械主键id
|
||||
*/
|
||||
machineryId?: string | number;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user