116 lines
2.3 KiB
JavaScript
116 lines
2.3 KiB
JavaScript
const URL = "/one-api/cpone/masterdata/";
|
|
|
|
export async function getunits(prm) {
|
|
try {
|
|
var resp = await axios.post(URL + "nonlabtemplatev3/getunits", 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 searchdetail(prm) {
|
|
try {
|
|
var resp = await axios.post(URL + "nonlabtemplatev3/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 + "nonlabtemplatev3/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 + "nonlabtemplatev3/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 + "nonlabtemplatev3/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,
|
|
};
|
|
}
|
|
}
|
|
|
|
export async function editdetail(prm) {
|
|
try {
|
|
var resp = await axios.post(URL + "nonlabtemplatev3/editdetail", 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,
|
|
};
|
|
}
|
|
}
|