163 lines
3.3 KiB
JavaScript
163 lines
3.3 KiB
JavaScript
// API :
|
|
// search bank
|
|
// paramater : query , page , rowPerPage
|
|
const URL =
|
|
"/one-api/mockup/fo/registration/";
|
|
|
|
export async function search(mouCompanyID,search) {
|
|
try {
|
|
var resp = await axios.post(URL + 'px/search', {
|
|
search:search,
|
|
mouCompanyID:mouCompanyID
|
|
});
|
|
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 panel(mouCompanyID,search) {
|
|
try {
|
|
var resp = await axios.post(URL + 'px/panel', {
|
|
search:search,
|
|
mouCompanyID:mouCompanyID
|
|
});
|
|
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 profile(mou_id, search) {
|
|
try {
|
|
var resp = await axios.post(URL + 'px/profile', {
|
|
search: search,
|
|
mou_id: mou_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 get_price(test_id, mou_id, cito) {
|
|
try {
|
|
var resp = await axios.post(URL + 'px/get_price', {
|
|
test_id:test_id,
|
|
mou_id:mou_id,
|
|
cito:cito
|
|
});
|
|
|
|
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 appx_schedule(test_ids, panel_ids) {
|
|
try {
|
|
var resp = await axios.post(URL + 'px/get_appx_schedule', {
|
|
test_ids:test_ids,
|
|
panel_ids:panel_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
|
|
};
|
|
}
|
|
}
|
|
|
|
export async function search_cito(token) {
|
|
try {
|
|
var resp = await axios.post(URL + 'px/search_cito', {
|
|
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 search_pxs(mouCompanyID, id) {
|
|
try {
|
|
var resp = await axios.post(URL + 'px/search', {
|
|
order_id:id,
|
|
mouCompanyID:mouCompanyID
|
|
});
|
|
if (resp.status != 200) {
|
|
return {
|
|
status: "ERR",
|
|
message: resp.statusText
|
|
};
|
|
}
|
|
let data = resp.data;
|
|
return data;
|
|
} catch(e) {
|
|
return {
|
|
status: "ERR",
|
|
message: e.message
|
|
};
|
|
}
|
|
} |