factory_web/src/api/model/mtm.js

440 lines
8.2 KiB
JavaScript

import config from "@/config"
import http from "@/utils/request"
/*EM接口*/
export default {
// 目标
goal: {
list: {
name: "目标列表",
req: async function(data){
return await http.get(
`${config.API_URL}/mtm/goal/`,
data
);
}
},
item: {
name: "获取目标详情",
req: async function(id){
return await http.get(
`${config.API_URL}/mtm/goal/${id}/`
);
}
},
create: {
name: "创建",
req: async function(data){
return await http.post(
`${config.API_URL}/mtm/goal/`,
data);
}
},
update: {
name: "更新",
req: async function(id, data){
return await http.put(
`${config.API_URL}/mtm/goal/${id}/`,
data);
}
},
delete: {
name: "删除",
req: async function(id){
return await http.delete(
`${config.API_URL}/mtm/goal/${id}/`);
}
},
deletes: {
name: "批量删除",
req: async function(data){
return await http.post(
`${config.API_URL}/mtm/goal/deletes/`,
data);
}
},
cquery: {
name: "复杂查询",
req: async function(data){
return await http.post(
`${config.API_URL}/mtm/goal/cquery/`,
data);
}
},
deleteHard: {
name: "批量物理删除",
req: async function(data){
return await http.post(
`${config.API_URL}/mtm/goal/deletes_hard/`,
data);
}
},
},
// 产品
material: {
list: {
name: "产品列表",
req: async function(data){
return await http.get(
`${config.API_URL}/mtm/material/`,
data
);
}
},
item: {
name: "获取产品详情",
req: async function(id){
return await http.get(
`${config.API_URL}/mtm/material/${id}/`
);
}
},
create: {
name: "创建",
req: async function(data){
return await http.post(
`${config.API_URL}/mtm/material/`,
data);
}
},
update: {
name: "更新",
req: async function(id, data){
return await http.put(
`${config.API_URL}/mtm/material/${id}/`,
data);
}
},
delete: {
name: "删除",
req: async function(id){
return await http.delete(
`${config.API_URL}/mtm/material/${id}/`);
}
},
deletes: {
name: "批量删除",
req: async function(data){
return await http.post(
`${config.API_URL}/mtm/material/deletes/`,
data);
}
},
cquery: {
name: "复杂查询",
req: async function(data){
return await http.post(
`${config.API_URL}/mtm/material/cquery/`,
data);
}
},
deleteHard: {
name: "批量物理删除",
req: async function(data){
return await http.post(
`${config.API_URL}/mtm/material/deletes_hard/`,
data);
}
},
daoru: {
name: "导入",
req: async function(data){
return await http.post(
`${config.API_URL}/mtm/material/daoru/`,
data);
}
},
},
// 测点集
mgroup: {
list: {
name: "测点集列表",
req: async function(data){
return await http.get(
`${config.API_URL}/mtm/mgroup/`,
data
);
}
},
item: {
name: "获取测点集详情",
req: async function(id){
return await http.get(
`${config.API_URL}/mtm/mgroup/${id}/`
);
}
},
create: {
name: "创建",
req: async function(data){
return await http.post(
`${config.API_URL}/mtm/mgroup/`,
data);
}
},
update: {
name: "更新",
req: async function(id, data){
return await http.put(
`${config.API_URL}/mtm/mgroup/${id}/`,
data);
}
},
delete: {
name: "删除",
req: async function(id){
return await http.delete(
`${config.API_URL}/mtm/mgroup/${id}/`);
}
},
deletes: {
name: "批量删除",
req: async function(data){
return await http.post(
`${config.API_URL}/mtm/mgroup/deletes/`,
data);
}
},
cquery: {
name: "复杂查询",
req: async function(data){
return await http.post(
`${config.API_URL}/mtm/mgroup/cquery/`,
data);
}
},
deleteHard: {
name: "批量物理删除",
req: async function(data){
return await http.post(
`${config.API_URL}/mtm/mgroup/deletes_hard/`,
data);
}
},
},
//班次
shift: {
list: {
name: "班次列表",
req: async function(data){
return await http.get(
`${config.API_URL}/mtm/shift/`,
data
);
}
}
},
//班组
team: {
list: {
name: "班组列表",
req: async function(data){
return await http.get(
`${config.API_URL}/mtm/team/`,
data
);
}
},
item: {
name: "获取详情",
req: async function(id){
return await http.get(
`${config.API_URL}/mtm/team/${id}/`
);
}
},
create: {
name: "创建",
req: async function(data){
return await http.post(
`${config.API_URL}/mtm/team/`,
data);
}
},
update: {
name: "更新",
req: async function(id, data){
return await http.put(
`${config.API_URL}/mtm/team/${id}/`,
data);
}
},
delete: {
name: "删除",
req: async function(id){
return await http.delete(
`${config.API_URL}/mtm/team/${id}/`);
}
},
deletes: {
name: "批量删除",
req: async function(data){
return await http.post(
`${config.API_URL}/mtm/team/deletes/`,
data);
}
},
cquery: {
name: "复杂查询",
req: async function(data){
return await http.post(
`${config.API_URL}/mtm/team/cquery/`,
data);
}
},
deleteHard: {
name: "批量物理删除",
req: async function(data){
return await http.post(
`${config.API_URL}/mtm/team/deletes_hard/`,
data);
}
},
},
// 工序
process: {
list: {
name: "工序列表",
req: async function(data){
return await http.get(
`${config.API_URL}/mtm/process/`,
data
);
}
},
item: {
name: "获取工序详情",
req: async function(id){
return await http.get(
`${config.API_URL}/mtm/process/${id}/`
);
}
},
create: {
name: "创建",
req: async function(data){
return await http.post(
`${config.API_URL}/mtm/process/`,
data);
}
},
update: {
name: "更新",
req: async function(id, data){
return await http.put(
`${config.API_URL}/mtm/process/${id}/`,
data);
}
},
delete: {
name: "删除",
req: async function(id){
return await http.delete(
`${config.API_URL}/mtm/process/${id}/`);
}
},
deletes: {
name: "批量删除",
req: async function(data){
return await http.post(
`${config.API_URL}/mtm/process/deletes/`,
data);
}
},
cquery: {
name: "复杂查询",
req: async function(data){
return await http.post(
`${config.API_URL}/mtm/process/cquery/`,
data);
}
},
},
//
route: {
list: {
name: "列表",
req: async function(data){
return await http.get(
`${config.API_URL}/mtm/route/`,
data
);
}
},
item: {
name: "获取详情",
req: async function(id){
return await http.get(
`${config.API_URL}/mtm/route/${id}/`
);
}
},
create: {
name: "创建",
req: async function(data){
return await http.post(
`${config.API_URL}/mtm/route/`,
data);
}
},
update: {
name: "更新",
req: async function(id, data){
return await http.put(
`${config.API_URL}/mtm/route/${id}/`,
data);
}
},
delete: {
name: "删除",
req: async function(id){
return await http.delete(
`${config.API_URL}/mtm/route/${id}/`);
}
},
deletes: {
name: "批量删除",
req: async function(data){
return await http.post(
`${config.API_URL}/mtm/route/deletes/`,
data);
}
},
cquery: {
name: "复杂查询",
req: async function(data){
return await http.post(
`${config.API_URL}/mtm/route/cquery/`,
data);
}
},
},
teammember:{
list: {
name: "班组列表",
req: async function(data){
return await http.get(
`${config.API_URL}/mtm/teammember/`,
data
);
}
},
create: {
name: "创建",
req: async function(data){
return await http.post(
`${config.API_URL}/mtm/teammember/`,
data);
}
},
delete: {
name: "删除",
req: async function(id){
return await http.delete(
`${config.API_URL}/mtm/teammember/${id}/`);
}
},
}
}