208 lines
4.2 KiB
JavaScript
208 lines
4.2 KiB
JavaScript
// API :
|
|
// search bank
|
|
// paramater : query , page , rowPerPage
|
|
const URL =
|
|
"/one-api/mockup/fo/cpone_registration_v13/";
|
|
|
|
|
|
export async function search(mouCompanyID,search,token) {
|
|
try {
|
|
var resp = await axios.post(URL + 'px/search_v2', {
|
|
search:search,
|
|
mouCompanyID:mouCompanyID
|
|
},{
|
|
cancelToken: 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 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 packet_reqs(prm) {
|
|
try {
|
|
var resp = await axios.post(URL + 'px/packet_reqs',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 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_v2', {
|
|
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
|
|
};
|
|
}
|
|
}
|
|
|
|
export async function search_pxs_clinic(mouCompanyID, id) {
|
|
try {
|
|
var resp = await axios.post(URL + 'px/search', {
|
|
clinic_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
|
|
};
|
|
}
|
|
}
|