78 lines
1.8 KiB
JavaScript
78 lines
1.8 KiB
JavaScript
const URL = "/one-api/v1/preorder/home-service/";
|
|
|
|
export async function search(fdate,fstatus,ftype,token) {
|
|
try {
|
|
var resp = await axios.post(URL + 'order/search_ready',{fdate:fdate,fstatus:fstatus,ftype:ftype,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_staff(fdate,fstatus,token) {
|
|
try {
|
|
var resp = await axios.post(URL + 'order/lookup_staff',{fdate:fdate,fstatus:fstatus,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 doconfirm(prm) {
|
|
try {
|
|
var resp = await axios.post(URL + 'order/do_confirm',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 dodownload(prm) {
|
|
try {
|
|
var resp = await axios.post(URL + 'order/do_download',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
|
|
};
|
|
}
|
|
}
|