315 lines
7.9 KiB
JavaScript
315 lines
7.9 KiB
JavaScript
const URL = "/one-api/mockup/process/refreceivesample-v3/";
|
|
|
|
export async function lookup(prm) {
|
|
try {
|
|
var resp = await axios.post(URL + 'refreceivesample/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 lookupbybarcode(prm) {
|
|
try {
|
|
var resp = await axios.post(URL + 'refreceivesample/lookupbybarcode', 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 lookupbydeliveryorderdetail(prm) {
|
|
try {
|
|
var resp = await axios.post(URL + 'refreceivesample/lookupdeliveryorderbydeliveryorderdetail', 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 + 'refreceivesample/lookupdeliveryorderbydistrict', 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 + 'refreceivesample/lookupdeliveryorderbykelurahan', 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 + 'refreceivesample/lookupdeliveryorderbyname', 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 + 'refreceivesample/addnewdeliveryorder', 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 + 'refreceivesample/editdeliveryorder', 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 + 'refreceivesample/deletedeliveryorder', { 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 searchdeliveryorderdetail(token,prm) {
|
|
try {
|
|
var resp = await axios.post(URL + 'refreceivesample/searchdeliveryorderdetail',{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 searchbranch(token,prm) {
|
|
try {
|
|
var resp = await axios.post(URL + 'refreceivesample/searchbranch',{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 searchdestination(prm) {
|
|
try {
|
|
var resp = await axios.post(URL + 'refreceivesample/searchdestination',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 searchsample(token,prm) {
|
|
try {
|
|
var resp = await axios.post(URL + 'refreceivesample/searchsample',{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 searchcourier(token,prm) {
|
|
try {
|
|
var resp = await axios.post(URL + 'refreceivesample/searchcourier',{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 searchcity(prm) {
|
|
try {
|
|
var resp = await axios.post(URL + 'refreceivesample/searchcity',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 searchdistrict(prm) {
|
|
try {
|
|
var resp = await axios.post(URL + 'refreceivesample/searchdistrict',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 searchkelurahan(prm) {
|
|
try {
|
|
var resp = await axios.post(URL + 'refreceivesample/searchkelurahan',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
|
|
};
|
|
}
|
|
}
|