Files
FE_CPONE/test/vuex/cpone-md-nonlab-template/api/detail.js
2026-04-27 10:13:31 +07:00

77 lines
1.9 KiB
JavaScript

const URL = "/one-api/cpone/masterdata/";
export async function searchdetail(prm) {
try {
var resp = await axios.post(URL + 'nonlabtemplate/searchdetail', prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function adddetail(prm) {
try {
var resp = await axios.post(URL + 'nonlabtemplate/adddetail', prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function deletedetail(prm) {
try {
var resp = await axios.post(URL + 'nonlabtemplate/deletedetail', prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function saveeditflag(prm) {
try {
var resp = await axios.post(URL + 'nonlabtemplate/saveeditflag', prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}