Files
FE_CPONE/test/vuex/one-md-specimen-local/api/specimenlocal.js
2026-04-27 10:13:31 +07:00

78 lines
1.9 KiB
JavaScript

const URL = "/one-api/mockup/masterdata/";
export async function save(prm) {
try {
var resp = await axios.post(URL + 'specimenlocal/addnewspecimenlocal', 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 xdelete(token,id) {
try {
var resp = await axios.post(URL + 'specimenlocal/deletespecimenlocal', { id: id ,token:token});
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 lookup(token,id) {
try {
var resp = await axios.post(URL + 'specimenlocal/lookupspecimenlocal', { id: id, token:token });
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 searchsampletype(token,prm) {
try {
var resp = await axios.post(URL + 'specimenlocal/searchsampletype',{token:token,search: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
};
}
}