Files
FE_CPONE/test/vuex/one-list-consumable/api/consumable.js
2026-04-27 10:13:31 +07:00

134 lines
3.1 KiB
JavaScript

const URL = "/one-api/one_consumable/patient/";
export async function gettest(prm) {
try {
var resp = await axios.post(URL + 'gettest', 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 searchconsumable(prm) {
try {
var resp = await axios.post(URL + 'searchconsumable',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 get_satuan(prm) {
try {
var resp = await axios.post(URL + 'get_satuan',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 get_item(prm) {
try {
var resp = await axios.post(URL + 'get_item',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 addconsumable(prm) {
try {
var resp = await axios.post(URL + 'addconsumable',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 reset(prm) {
try {
var resp = await axios.post(URL + 'reset',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 saveAllConsumable(prm) {
try {
var resp = await axios.post(URL + 'saveAllConsumable',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
};
}
}