89 lines
2.1 KiB
JavaScript
89 lines
2.1 KiB
JavaScript
const URL = "/one-api/mockup/refout/status/";
|
|
|
|
export async function search(search, is_internal, status) {
|
|
try {
|
|
var resp = await axios.post(URL + 'status/search', {
|
|
search: search,
|
|
is_internal: is_internal,
|
|
status: status
|
|
});
|
|
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 search_sample(header_id) {
|
|
try {
|
|
var resp = await axios.post(URL + 'status/search_sample', {
|
|
header_id: header_id
|
|
});
|
|
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 search_courier() {
|
|
try {
|
|
var resp = await axios.post(URL + 'status/search_courier', {});
|
|
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 send(token, header_id, ids, courier_id) {
|
|
try {
|
|
var resp = await axios.post(URL + 'status/send', {
|
|
token: token,
|
|
header_id: header_id,
|
|
courier_id: courier_id,
|
|
ids: ids
|
|
});
|
|
if (resp.status != 200) {
|
|
return {
|
|
status: "ERR",
|
|
message: resp.statusText
|
|
};
|
|
}
|
|
let data = resp.data;
|
|
return data;
|
|
} catch (e) {
|
|
return {
|
|
status: "ERR",
|
|
message: e.message
|
|
};
|
|
}
|
|
}
|