320 lines
6.5 KiB
JavaScript
320 lines
6.5 KiB
JavaScript
const URL = "/one-api/mockup/masterdata/one-md-pola-kelainan-summary/";
|
|
|
|
export async function lookup(prm) {
|
|
try {
|
|
var resp = await axios.post(URL + "polakelainansummary/lookup", 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 lookupbykelainandetail(prm) {
|
|
try {
|
|
var resp = await axios.post(
|
|
URL + "polakelainansummary/lookupkelainangroupbykelainandetail",
|
|
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 lookupbydistrict(prm) {
|
|
try {
|
|
var resp = await axios.post(
|
|
URL + "polakelainansummary/lookupkelainangroupbydistrict",
|
|
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 lookupbykelurahan(prm) {
|
|
try {
|
|
var resp = await axios.post(
|
|
URL + "polakelainansummary/lookupkelainangroupbykelurahan",
|
|
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 lookupbyname(prm) {
|
|
try {
|
|
var resp = await axios.post(
|
|
URL + "polakelainansummary/lookupkelainangroupbyname",
|
|
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 save(prm) {
|
|
try {
|
|
var resp = await axios.post(
|
|
URL + "polakelainansummary/addnewkelainangroup",
|
|
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 update(prm) {
|
|
try {
|
|
var resp = await axios.post(
|
|
URL + "polakelainansummary/editkelainangroup",
|
|
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 + "polakelainansummary/deletekelainangroup",
|
|
{ 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 selectnonlab(token) {
|
|
try {
|
|
var resp = await axios.post(URL + "polakelainansummary/selectnonlab", {
|
|
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 searchkelainandetail(token, prm) {
|
|
try {
|
|
var resp = await axios.post(
|
|
URL + "polakelainansummary/searchkelainandetail",
|
|
{ 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,
|
|
};
|
|
}
|
|
}
|
|
|
|
export async function searchdoctor(token, prm) {
|
|
try {
|
|
var resp = await axios.post(URL + "polakelainansummary/searchdoctor", {
|
|
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,
|
|
};
|
|
}
|
|
}
|
|
export async function searchinstrument(token, tes) {
|
|
try {
|
|
var resp = await axios.post(URL + "polakelainansummary/searchinstrument", {
|
|
token: token,
|
|
search: tes,
|
|
});
|
|
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 searchtemplate(token, tes) {
|
|
try {
|
|
var resp = await axios.post(URL + "polakelainansummary/searchtemplate", {
|
|
token: token,
|
|
search: tes,
|
|
});
|
|
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 getdistrict(token, prm) {
|
|
try {
|
|
var resp = await axios.post(URL + "polakelainansummary/getdistrict", {
|
|
id: prm.M_BranchID,
|
|
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 getkelurahan(token, prm) {
|
|
try {
|
|
var resp = await axios.post(URL + "polakelainansummary/getkelurahan", {
|
|
token: token,
|
|
id: prm.M_DistrictID,
|
|
});
|
|
if (resp.status != 200) {
|
|
return {
|
|
status: "ERR",
|
|
message: resp.statusText,
|
|
};
|
|
}
|
|
let data = resp.data;
|
|
return data;
|
|
} catch (e) {
|
|
return {
|
|
status: "ERR",
|
|
message: e.message,
|
|
};
|
|
}
|
|
}
|