From b6f130e8fa4a4cf3925148071c57394e2b22a8d0 Mon Sep 17 00:00:00 2001 From: "sas.fajri" Date: Wed, 24 Jun 2026 13:18:57 +0700 Subject: [PATCH 1/3] 3Z4LPN - clone walk in stemcell --- .../action.js | 0 .../api/area.js | 92 ++ .../api/company.js | 78 ++ .../api/delivery.js | 43 + .../api/doctor.js | 119 ++ .../api/doctor_new.js | 0 .../api/history.js | 47 + .../api/language.js | 24 + .../api/order.js | 205 +++ .../api/other.js | 133 ++ .../api/patient.js | 263 ++++ .../api/patientaddress.js | 26 + .../api/payment.js | 89 ++ .../api/photo.js | 28 + .../api/px.js | 254 ++++ .../api/reference.js | 35 + .../components/foRegisterFinishDialog.vue | 68 + .../components/oneDialogPhoto.vue | 211 ++++ .../components/oneDialogPrint.vue | 69 + .../components/oneFieldVerification.vue | 49 + .../components/oneFoRegisterFinishDialog.vue | 113 ++ .../components/oneFoRegistrationCompany.vue | 347 +++++ .../components/oneFoRegistrationCompany.vue-- | 224 ++++ .../oneFoRegistrationDetailOrder.vue | 341 +++++ .../oneFoRegistrationDoctorNewDialog.vue | 361 ++++++ .../oneFoRegistrationErrorToken.vue | 25 + .../components/oneFoRegistrationHistory.vue | 17 + .../oneFoRegistrationPatientOrder.vue | 443 +++++++ .../components/oneFoRegistrationPayment.vue | 442 +++++++ .../components/oneFoRegistrationPayment2.vue | 525 ++++++++ .../oneFoRegistrationPayment2.vue-- | 525 ++++++++ .../oneFoRegistrationPaymentFinish.vue | 95 ++ .../components/oneFoRegistrationPriceList.vue | 599 +++++++++ .../oneFoRegistrationRequirement.vue | 305 +++++ .../components/oneFoRegistrationTab01.vue | 118 ++ .../components/oneFoRegistrationTab02.vue | 221 ++++ .../components/oneFoRegistrationTab03.vue | 25 + .../components/oneFoRegistrationTest.vue | 53 + .../components/oneFoStart.vue | 117 ++ .../components/oneMouPxLeft.vue | 19 + .../components/oneMouPxMouInfo.vue | 29 + .../components/oneMouPxPanel.vue | 109 ++ .../components/oneMouPxProfile.vue | 220 ++++ .../components/oneMouPxPx.vue | 342 +++++ .../components/oneRegistrationTab.vue | 185 +++ .../components/patientDataNasional.vue | 257 ++++ .../components/patientDelivery copy.vue | 193 +++ .../components/patientDelivery.vue | 250 ++++ .../components/patientDelivery.vue-- | 240 ++++ .../components/patientDetail.vue | 428 +++++++ .../components/patientHistory.vue | 96 ++ .../components/patientHistoryDialog.vue | 211 ++++ .../components/patientLeftSide.vue | 118 ++ .../components/patientNewDialog.vue | 1121 +++++++++++++++++ .../components/patientNotes.vue | 42 + .../components/patientReference.vue | 170 +++ .../components/patientRightSide.vue | 407 ++++++ .../components/patientSearchBox-org.vue | 125 ++ .../components/patientSearchBox.vue | 185 +++ .../components/patientSearchDialog.vue | 74 ++ .../components/patientSearchResult.vue | 295 +++++ .../index.php | 387 ++++++ .../modules/area.js | 229 ++++ .../modules/company.js | 194 +++ .../modules/delivery.js | 134 ++ .../modules/doctor.js | 181 +++ .../modules/doctor_new.js | 285 +++++ .../modules/history.js | 112 ++ .../modules/language.js | 78 ++ .../modules/order.js | 842 +++++++++++++ .../modules/other.js | 209 +++ .../modules/patient.js | 485 +++++++ .../modules/patientaddress.js | 86 ++ .../modules/payment.js | 339 +++++ .../modules/payment.js-- | 304 +++++ .../modules/photo.js | 51 + .../modules/px.js | 794 ++++++++++++ .../modules/reference.js | 101 ++ .../mutation.js | 0 .../store.js | 68 + 80 files changed, 16724 insertions(+) create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/action.js create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/api/area.js create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/api/company.js create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/api/delivery.js create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/api/doctor.js create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/api/doctor_new.js create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/api/history.js create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/api/language.js create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/api/order.js create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/api/other.js create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/api/patient.js create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/api/patientaddress.js create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/api/payment.js create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/api/photo.js create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/api/px.js create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/api/reference.js create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/components/foRegisterFinishDialog.vue create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/components/oneDialogPhoto.vue create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/components/oneDialogPrint.vue create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/components/oneFieldVerification.vue create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/components/oneFoRegisterFinishDialog.vue create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/components/oneFoRegistrationCompany.vue create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/components/oneFoRegistrationCompany.vue-- create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/components/oneFoRegistrationDetailOrder.vue create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/components/oneFoRegistrationDoctorNewDialog.vue create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/components/oneFoRegistrationErrorToken.vue create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/components/oneFoRegistrationHistory.vue create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/components/oneFoRegistrationPatientOrder.vue create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/components/oneFoRegistrationPayment.vue create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/components/oneFoRegistrationPayment2.vue create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/components/oneFoRegistrationPayment2.vue-- create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/components/oneFoRegistrationPaymentFinish.vue create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/components/oneFoRegistrationPriceList.vue create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/components/oneFoRegistrationRequirement.vue create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/components/oneFoRegistrationTab01.vue create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/components/oneFoRegistrationTab02.vue create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/components/oneFoRegistrationTab03.vue create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/components/oneFoRegistrationTest.vue create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/components/oneFoStart.vue create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/components/oneMouPxLeft.vue create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/components/oneMouPxMouInfo.vue create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/components/oneMouPxPanel.vue create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/components/oneMouPxProfile.vue create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/components/oneMouPxPx.vue create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/components/oneRegistrationTab.vue create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/components/patientDataNasional.vue create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/components/patientDelivery copy.vue create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/components/patientDelivery.vue create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/components/patientDelivery.vue-- create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/components/patientDetail.vue create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/components/patientHistory.vue create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/components/patientHistoryDialog.vue create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/components/patientLeftSide.vue create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/components/patientNewDialog.vue create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/components/patientNotes.vue create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/components/patientReference.vue create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/components/patientRightSide.vue create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/components/patientSearchBox-org.vue create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/components/patientSearchBox.vue create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/components/patientSearchDialog.vue create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/components/patientSearchResult.vue create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/index.php create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/modules/area.js create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/modules/company.js create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/modules/delivery.js create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/modules/doctor.js create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/modules/doctor_new.js create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/modules/history.js create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/modules/language.js create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/modules/order.js create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/modules/other.js create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/modules/patient.js create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/modules/patientaddress.js create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/modules/payment.js create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/modules/payment.js-- create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/modules/photo.js create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/modules/px.js create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/modules/reference.js create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/mutation.js create mode 100644 test/vuex/one-fo-registration-walk-in-stemcell/store.js diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/action.js b/test/vuex/one-fo-registration-walk-in-stemcell/action.js new file mode 100644 index 0000000..e69de29 diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/api/area.js b/test/vuex/one-fo-registration-walk-in-stemcell/api/area.js new file mode 100644 index 0000000..8ca45f2 --- /dev/null +++ b/test/vuex/one-fo-registration-walk-in-stemcell/api/area.js @@ -0,0 +1,92 @@ +// API : +// search bank +// paramater : query , page , rowPerPage +const URL = + "/one-api/mockup/clinic/fo/"; + +export async function search_province(search) { + try { + var resp = await axios.post(URL + 'area/search_province', { + search: search + }); + 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_city(province_id, search) { + try { + var resp = await axios.post(URL + 'area/search_city', { + search: search, + province_id: province_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_district(city_id, search) { + try { + var resp = await axios.post(URL + 'area/search_district', { + search: search, + city_id: city_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_kelurahan(district_id, search) { + try { + var resp = await axios.post(URL + 'area/search_kelurahan', { + search: search, + district_id: district_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 + }; + } +} \ No newline at end of file diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/api/company.js b/test/vuex/one-fo-registration-walk-in-stemcell/api/company.js new file mode 100644 index 0000000..878b4d0 --- /dev/null +++ b/test/vuex/one-fo-registration-walk-in-stemcell/api/company.js @@ -0,0 +1,78 @@ +const URL = "/one-api/mockup/fo/walk_in_registration_stemcell/"; + +export async function search(search) { + try { + var resp = await axios.post(URL + 'company/search',{search:search,token:window.one_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_default() { + try { + var resp = await axios.post(URL + 'company/search_default'); + 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_project(prm) { + try { + var resp = await axios.post(URL + 'company/search_project',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 search_fisik_template(prm) { + try { + var resp = await axios.post(URL + 'company/search_fisik_template',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 + }; + } +} diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/api/delivery.js b/test/vuex/one-fo-registration-walk-in-stemcell/api/delivery.js new file mode 100644 index 0000000..fb2011d --- /dev/null +++ b/test/vuex/one-fo-registration-walk-in-stemcell/api/delivery.js @@ -0,0 +1,43 @@ +// API : +// search bank +// paramater : query , page , rowPerPage +const URL = + "/one-api/mockup/fo/walk_in_registration_stemcell/"; + +export async function search(o_id, p_id, d_id, m_id,c_id) { + try { + var resp = await axios.post(URL + 'delivery/search', { order_id: o_id, patient_id: p_id, doctor_id: d_id, mou_id: m_id,c_id:c_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_deliveries(prm) { + try { + var resp = await axios.post(URL + 'delivery/search_deliveries', 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 + }; + } +} diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/api/doctor.js b/test/vuex/one-fo-registration-walk-in-stemcell/api/doctor.js new file mode 100644 index 0000000..6fbea85 --- /dev/null +++ b/test/vuex/one-fo-registration-walk-in-stemcell/api/doctor.js @@ -0,0 +1,119 @@ +// API : +// search bank +// paramater : query , page , rowPerPage +const URL = + "/one-api/mockup/fo/walk_in_registration_stemcell/"; +let doctor_search_token ={}; + + +export async function search(search) { + try { + var resp = await axios.post(URL + 'doctor/search', { search: search, token: window.one_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 searchPj() { + try { + var resp = await axios.post(URL + 'doctor/search_pj', { token: window.one_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_fpptype(search) { + try { + console.log("search indx fpp type") + //console.log("cdssdv ", fpptype_search_token.hasOwnProperty("token")?'ada':'tidak ada') + // Jika ada request sebelumnya, batalkan + + console.log("search now fpp type") + // Buat token baru untuk request ini + //fpptype_search_token = axios.CancelToken.source(); + var resp = await axios.post(URL + 'doctor/search_fpptype', { + search: search, + token: window.one_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_fpptype(search) { + try { + var resp = await axios.post(URL + 'doctor/search_fpptype', { + search: search, + token: window.one_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 save(token, d) { + try { + var resp = await axios.post(URL + 'doctor/save', { + token: token, + data: d + }); + if (resp.status != 200) { + return { + status: "ERR", + message: resp.statusText + }; + } + let data = resp.data; + return data; + } catch(e) { + return { + status: "ERR", + message: e.message + }; + } + } diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/api/doctor_new.js b/test/vuex/one-fo-registration-walk-in-stemcell/api/doctor_new.js new file mode 100644 index 0000000..e69de29 diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/api/history.js b/test/vuex/one-fo-registration-walk-in-stemcell/api/history.js new file mode 100644 index 0000000..cd02991 --- /dev/null +++ b/test/vuex/one-fo-registration-walk-in-stemcell/api/history.js @@ -0,0 +1,47 @@ +// API : +// search bank +// paramater : query , page , rowPerPage +const URL = + "/one-api/mockup/fo/walk_in_registration_stemcell/"; + +export async function search(patient_id) { + try { + var resp = await axios.post(URL + 'history/search', { + patient_id: patient_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_databyorder_id(prm) { + try { + var resp = await axios.post(URL + 'history/get_databyorder_id', 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 + }; + } +} + + diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/api/language.js b/test/vuex/one-fo-registration-walk-in-stemcell/api/language.js new file mode 100644 index 0000000..d2c36b4 --- /dev/null +++ b/test/vuex/one-fo-registration-walk-in-stemcell/api/language.js @@ -0,0 +1,24 @@ +// API : +// search bank +// paramater : query , page , rowPerPage +const URL = + "/one-api/mockup/fo/walk_in_registration_stemcell/"; + +export async function search() { + try { + var resp = await axios.post(URL + 'language/search', { }); + if (resp.status != 200) { + return { + status: "ERR", + message: resp.statusText + }; + } + let data = resp.data; + return data; + } catch(e) { + return { + status: "ERR", + message: e.message + }; + } +} diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/api/order.js b/test/vuex/one-fo-registration-walk-in-stemcell/api/order.js new file mode 100644 index 0000000..b5b4c6e --- /dev/null +++ b/test/vuex/one-fo-registration-walk-in-stemcell/api/order.js @@ -0,0 +1,205 @@ +// API : +// search bank +// paramater : query , page , rowPerPage +const URL = + "/one-api/mockup/fo/walk_in_registration_stemcell/"; + +let isSaving = false; + +export async function save(prm) { + if (isSaving) { + return { + status: "ERR", + message: "Save operation is already in progress" + } + } + + isSaving = true; + try { + var resp = await axios.post(URL + 'order/save', prm); + isSaving = false; + return resp + } catch (e) { + isSaving = false; + return { + status: "ERR", + message: e.message + } + } +} + + +export async function lookupbarcodes(prm) { + try { + var resp = await axios.post(URL + 'order/lookup_barcodes', 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 load_from_clinic(queue) { + try { + var resp = await axios.post(URL + 'order/load_from_clinic', { + queue: queue + }); + + return resp + } catch (e) { + return { + status: "ERR", + message: e.message + } + } +} + + +export async function load_preregister(prm) { + try { + var resp = await axios.post(URL + 'order/load_preregister',prm); + + return resp + } catch (e) { + return { + status: "ERR", + message: e.message + } + } +} + +export async function load(id) { + try { + var resp = await axios.post(URL + 'order/load', { + id: id + }); + + return resp + } catch (e) { + return { + status: "ERR", + message: e.message + } + } +} + +export async function patientSearch(noreg, search) { + try { + var resp = await axios.post(URL + 'patient/search', { + search: search, + noreg: noreg + }); + 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 doctorSearch(search) { + try { + var resp = await axios.post(URL + 'doctor/search', { + search: search + }); + 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 doctorSearchPj() { + try { + var resp = await axios.post(URL + 'doctor/search_pj', { }); + 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 languageSearch() { + try { + var resp = await axios.post(URL + 'language/search', { }); + 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 deliverySearch() { + try { + var resp = await axios.post(URL + 'delivery/search', { }); + 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_time_start(prm) { + try { + var resp = await axios.post(URL + 'order/get_time_start', prm); + + return resp + } catch (e) { + return { + status: "ERR", + message: e.message + } + } +} + + diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/api/other.js b/test/vuex/one-fo-registration-walk-in-stemcell/api/other.js new file mode 100644 index 0000000..e3b6e95 --- /dev/null +++ b/test/vuex/one-fo-registration-walk-in-stemcell/api/other.js @@ -0,0 +1,133 @@ +// API : +// search bank +// paramater : query , page , rowPerPage +const URL = + "/one-api/mockup/clinic/fo/"; + +export async function search_sex(search) { + try { + var resp = await axios.post(URL + 'sex/search', { + search: search + }); + 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_title(search, sex) { + try { + var resp = await axios.post('/one-api/mockup/fo/walk_in_registration/' + 'patient/get_titles', { + search: search, + sex_id: sex + }); + 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_bank(search, card, edc) { + try { + if (card == null) + card = undefined + var resp = await axios.post("/one-api/mockup/fo/registration/" + 'bank/search', { + search: search, + card: card, + edc: edc + }); + 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_accounts(search) { + try { + var resp = await axios.post("/one-api/mockup/fo/registration/" + 'bank/search_account', { + search: search + }); + 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_religion(prm) { + try { + var resp = await axios.post("/one-api/mockup/fo/walk_in_registration/" + 'patient/get_religions', 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 get_titles(prm) { + try { + var resp = await axios.post("/one-api/mockup/fo/walk_in_registration/" + 'patient/get_titles', 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 + }; + } +} \ No newline at end of file diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/api/patient.js b/test/vuex/one-fo-registration-walk-in-stemcell/api/patient.js new file mode 100644 index 0000000..98f127b --- /dev/null +++ b/test/vuex/one-fo-registration-walk-in-stemcell/api/patient.js @@ -0,0 +1,263 @@ +// API : +// search bank +// paramater : query , page , rowPerPage +const URL = + "/one-api/mockup/fo/walk_in_registration_stemcell/"; + +export async function search(noreg, search, current_page) { + try { + var resp = await axios.post(URL + 'patient/search', { + search: search, + noreg: noreg, + current_page:current_page + }); + 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 add_new(datas) { + try { + //sipe add token + datas["token"] = window.one_token(); + var resp = await axios.post(URL + 'patient/add_new', datas); + 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 edit(datas, id) { + try { + //sipe add token + datas["token"] = window.one_token(); + datas["id"] = id + var resp = await axios.post(URL + 'patient/edit', datas); + 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_idtype() { + try { + var resp = await axios.post(URL + 'patient/search_idtype', {token:window.one_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 searchregion(prm) { + try { + var resp = await axios.post(URL + 'patient/searchregion', { + search: prm, + token: window.one_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_countries(prm) { + try { + var resp = await axios.post(URL + 'patient/search_countries', { + search: prm, + token: window.one_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_corporate(prm) { + try { + var resp = await axios.post(URL + 'patient/search_corporate', { + search: prm, + token: window.one_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_blood_type(prm) { + try { + var resp = await axios.post(URL + 'patient/search_blood_type', { + search: prm, + token: window.one_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_blood_rh_type(prm) { + try { + var resp = await axios.post(URL + 'patient/search_blood_rh_type', { + search: prm, + token: window.one_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_education_type(prm) { + try { + var resp = await axios.post(URL + 'patient/search_education_type', { + search: prm, + token: window.one_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_etnic_type(prm) { + try { + var resp = await axios.post(URL + 'patient/search_etnic_type', { + search: prm, + token: window.one_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_icd10(prm) { + try { + var resp = await axios.post(URL + 'patient/search_icd10', 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 + }; + } + } diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/api/patientaddress.js b/test/vuex/one-fo-registration-walk-in-stemcell/api/patientaddress.js new file mode 100644 index 0000000..32edb0d --- /dev/null +++ b/test/vuex/one-fo-registration-walk-in-stemcell/api/patientaddress.js @@ -0,0 +1,26 @@ +// API : +// search bank +// paramater : query , page , rowPerPage +const URL = + "/one-api/mockup/fo/walk_in_registration_stemcell/"; + +export async function getAll(id) { + try { + var resp = await axios.post(URL + 'patientaddress/get_all', { + patient_id: 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 + }; + } +} diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/api/payment.js b/test/vuex/one-fo-registration-walk-in-stemcell/api/payment.js new file mode 100644 index 0000000..30232c8 --- /dev/null +++ b/test/vuex/one-fo-registration-walk-in-stemcell/api/payment.js @@ -0,0 +1,89 @@ +const URL = "/one-api/mockup/fo/walk_in_registration_stemcell/"; + +export async function get_order(id) { + try { + var resp = await axios.post(URL + 'payment/get_order',{id: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(search) { + try { + var resp = await axios.post(URL + 'payment/search', {search:search}); + 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(token, order_id, payments) { + try { + var resp = await axios.post(URL + 'payment/save', { + token: token, + order_id: order_id, + payments: payments + }); + + return resp + } catch (e) { + return { + status: "ERR", + message: e.message + } + } +} + + +export async function endshowtime(prm) { + try { + var resp = await axios.post(URL + 'order/endshowtime',prm); + + return resp + } catch (e) { + return { + status: "ERR", + message: e.message + } + } +} + +export async function get_details_order(prm) { + try { + var resp = await axios.post(URL + 'order/get_details_order', 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 + } + } +} diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/api/photo.js b/test/vuex/one-fo-registration-walk-in-stemcell/api/photo.js new file mode 100644 index 0000000..4a8a2bc --- /dev/null +++ b/test/vuex/one-fo-registration-walk-in-stemcell/api/photo.js @@ -0,0 +1,28 @@ +// API : +// search bank +// paramater : query , page , rowPerPage +const URL = + "/one-api/mockup/fo/walk_in_registration_stemcell/"; + +export async function upload(token, id, datas) { + try { + var resp = await axios.post(URL + 'photo/upload', { + token: token, + id: id, + data: datas + }); + if (resp.status != 200) { + return { + status: "ERR", + message: resp.statusText + }; + } + let data = resp.data; + return data; + } catch(e) { + return { + status: "ERR", + message: e.message + }; + } +} diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/api/px.js b/test/vuex/one-fo-registration-walk-in-stemcell/api/px.js new file mode 100644 index 0000000..cfbd27f --- /dev/null +++ b/test/vuex/one-fo-registration-walk-in-stemcell/api/px.js @@ -0,0 +1,254 @@ +// API : +// search bank +// paramater : query , page , rowPerPage +const URL = + "/one-api/mockup/fo/walk_in_registration_stemcell/"; + + +export async function search(mouCompanyID, search, token, project_id = 0) { + try { + var resp = await axios.post(URL + 'px/search_v2', { + search: search, + mouCompanyID: mouCompanyID, + project_id: project_id, + token: one_token() + },{ + 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, + token:one_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_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, + token: one_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_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 + }; + } + } + + + export async function get_promise_by_pxs(prm) { + try { + var resp = await axios.post(URL + 'px/get_promise_by_pxs', 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 get_requirement(test_id) { + try { + var resp = await axios.post(URL + 'px/get_requirement', { + test_id: test_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 + }; + } +} diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/api/reference.js b/test/vuex/one-fo-registration-walk-in-stemcell/api/reference.js new file mode 100644 index 0000000..8175294 --- /dev/null +++ b/test/vuex/one-fo-registration-walk-in-stemcell/api/reference.js @@ -0,0 +1,35 @@ +const URL = "/one-api/mockup/fo/walk_in_registration_stemcell/"; + +export async function searchreference(search = "") { + try { + const resp = await axios.post(URL + "reference/searchreference", { + token: window.one_token(), + search: search || "" + }); + + if (resp.status !== 200) { + return { status: "ERR", message: resp.statusText }; + } + + return resp.data; + } catch (e) { + return { status: "ERR", message: e.message }; + } +} + +export async function searchordertype(search = "") { + try { + const resp = await axios.post(URL + "reference/searchordertype", { + token: window.one_token(), + search: search || "" + }); + + if (resp.status !== 200) { + return { status: "ERR", message: resp.statusText }; + } + + return resp.data; + } catch (e) { + return { status: "ERR", message: e.message }; + } +} diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/components/foRegisterFinishDialog.vue b/test/vuex/one-fo-registration-walk-in-stemcell/components/foRegisterFinishDialog.vue new file mode 100644 index 0000000..cb79dbd --- /dev/null +++ b/test/vuex/one-fo-registration-walk-in-stemcell/components/foRegisterFinishDialog.vue @@ -0,0 +1,68 @@ + + + + + diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/components/oneDialogPhoto.vue b/test/vuex/one-fo-registration-walk-in-stemcell/components/oneDialogPhoto.vue new file mode 100644 index 0000000..721ea20 --- /dev/null +++ b/test/vuex/one-fo-registration-walk-in-stemcell/components/oneDialogPhoto.vue @@ -0,0 +1,211 @@ + + + + + diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/components/oneDialogPrint.vue b/test/vuex/one-fo-registration-walk-in-stemcell/components/oneDialogPrint.vue new file mode 100644 index 0000000..eb9371a --- /dev/null +++ b/test/vuex/one-fo-registration-walk-in-stemcell/components/oneDialogPrint.vue @@ -0,0 +1,69 @@ + + + + + diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/components/oneFieldVerification.vue b/test/vuex/one-fo-registration-walk-in-stemcell/components/oneFieldVerification.vue new file mode 100644 index 0000000..de36cd3 --- /dev/null +++ b/test/vuex/one-fo-registration-walk-in-stemcell/components/oneFieldVerification.vue @@ -0,0 +1,49 @@ + + + diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/components/oneFoRegisterFinishDialog.vue b/test/vuex/one-fo-registration-walk-in-stemcell/components/oneFoRegisterFinishDialog.vue new file mode 100644 index 0000000..efb3040 --- /dev/null +++ b/test/vuex/one-fo-registration-walk-in-stemcell/components/oneFoRegisterFinishDialog.vue @@ -0,0 +1,113 @@ + + + + + diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/components/oneFoRegistrationCompany.vue b/test/vuex/one-fo-registration-walk-in-stemcell/components/oneFoRegistrationCompany.vue new file mode 100644 index 0000000..b0cd7d3 --- /dev/null +++ b/test/vuex/one-fo-registration-walk-in-stemcell/components/oneFoRegistrationCompany.vue @@ -0,0 +1,347 @@ + + + + diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/components/oneFoRegistrationCompany.vue-- b/test/vuex/one-fo-registration-walk-in-stemcell/components/oneFoRegistrationCompany.vue-- new file mode 100644 index 0000000..b007690 --- /dev/null +++ b/test/vuex/one-fo-registration-walk-in-stemcell/components/oneFoRegistrationCompany.vue-- @@ -0,0 +1,224 @@ + + + + diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/components/oneFoRegistrationDetailOrder.vue b/test/vuex/one-fo-registration-walk-in-stemcell/components/oneFoRegistrationDetailOrder.vue new file mode 100644 index 0000000..8227e83 --- /dev/null +++ b/test/vuex/one-fo-registration-walk-in-stemcell/components/oneFoRegistrationDetailOrder.vue @@ -0,0 +1,341 @@ + + + + diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/components/oneFoRegistrationDoctorNewDialog.vue b/test/vuex/one-fo-registration-walk-in-stemcell/components/oneFoRegistrationDoctorNewDialog.vue new file mode 100644 index 0000000..aa86b58 --- /dev/null +++ b/test/vuex/one-fo-registration-walk-in-stemcell/components/oneFoRegistrationDoctorNewDialog.vue @@ -0,0 +1,361 @@ + + + diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/components/oneFoRegistrationErrorToken.vue b/test/vuex/one-fo-registration-walk-in-stemcell/components/oneFoRegistrationErrorToken.vue new file mode 100644 index 0000000..63dc131 --- /dev/null +++ b/test/vuex/one-fo-registration-walk-in-stemcell/components/oneFoRegistrationErrorToken.vue @@ -0,0 +1,25 @@ + + + \ No newline at end of file diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/components/oneFoRegistrationHistory.vue b/test/vuex/one-fo-registration-walk-in-stemcell/components/oneFoRegistrationHistory.vue new file mode 100644 index 0000000..aa41c76 --- /dev/null +++ b/test/vuex/one-fo-registration-walk-in-stemcell/components/oneFoRegistrationHistory.vue @@ -0,0 +1,17 @@ + \ No newline at end of file diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/components/oneFoRegistrationPatientOrder.vue b/test/vuex/one-fo-registration-walk-in-stemcell/components/oneFoRegistrationPatientOrder.vue new file mode 100644 index 0000000..5e0157f --- /dev/null +++ b/test/vuex/one-fo-registration-walk-in-stemcell/components/oneFoRegistrationPatientOrder.vue @@ -0,0 +1,443 @@ + + + + diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/components/oneFoRegistrationPayment.vue b/test/vuex/one-fo-registration-walk-in-stemcell/components/oneFoRegistrationPayment.vue new file mode 100644 index 0000000..18629c2 --- /dev/null +++ b/test/vuex/one-fo-registration-walk-in-stemcell/components/oneFoRegistrationPayment.vue @@ -0,0 +1,442 @@ + + + + diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/components/oneFoRegistrationPayment2.vue b/test/vuex/one-fo-registration-walk-in-stemcell/components/oneFoRegistrationPayment2.vue new file mode 100644 index 0000000..e4fdc8a --- /dev/null +++ b/test/vuex/one-fo-registration-walk-in-stemcell/components/oneFoRegistrationPayment2.vue @@ -0,0 +1,525 @@ + + + + diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/components/oneFoRegistrationPayment2.vue-- b/test/vuex/one-fo-registration-walk-in-stemcell/components/oneFoRegistrationPayment2.vue-- new file mode 100644 index 0000000..a8270d9 --- /dev/null +++ b/test/vuex/one-fo-registration-walk-in-stemcell/components/oneFoRegistrationPayment2.vue-- @@ -0,0 +1,525 @@ + + + + diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/components/oneFoRegistrationPaymentFinish.vue b/test/vuex/one-fo-registration-walk-in-stemcell/components/oneFoRegistrationPaymentFinish.vue new file mode 100644 index 0000000..20132ef --- /dev/null +++ b/test/vuex/one-fo-registration-walk-in-stemcell/components/oneFoRegistrationPaymentFinish.vue @@ -0,0 +1,95 @@ + + + + + diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/components/oneFoRegistrationPriceList.vue b/test/vuex/one-fo-registration-walk-in-stemcell/components/oneFoRegistrationPriceList.vue new file mode 100644 index 0000000..c5bdc02 --- /dev/null +++ b/test/vuex/one-fo-registration-walk-in-stemcell/components/oneFoRegistrationPriceList.vue @@ -0,0 +1,599 @@ + + + + diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/components/oneFoRegistrationRequirement.vue b/test/vuex/one-fo-registration-walk-in-stemcell/components/oneFoRegistrationRequirement.vue new file mode 100644 index 0000000..0be6ee5 --- /dev/null +++ b/test/vuex/one-fo-registration-walk-in-stemcell/components/oneFoRegistrationRequirement.vue @@ -0,0 +1,305 @@ + + + + diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/components/oneFoRegistrationTab01.vue b/test/vuex/one-fo-registration-walk-in-stemcell/components/oneFoRegistrationTab01.vue new file mode 100644 index 0000000..201a20c --- /dev/null +++ b/test/vuex/one-fo-registration-walk-in-stemcell/components/oneFoRegistrationTab01.vue @@ -0,0 +1,118 @@ + + + + diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/components/oneFoRegistrationTab02.vue b/test/vuex/one-fo-registration-walk-in-stemcell/components/oneFoRegistrationTab02.vue new file mode 100644 index 0000000..782d44f --- /dev/null +++ b/test/vuex/one-fo-registration-walk-in-stemcell/components/oneFoRegistrationTab02.vue @@ -0,0 +1,221 @@ + + + + + diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/components/oneFoRegistrationTab03.vue b/test/vuex/one-fo-registration-walk-in-stemcell/components/oneFoRegistrationTab03.vue new file mode 100644 index 0000000..6267251 --- /dev/null +++ b/test/vuex/one-fo-registration-walk-in-stemcell/components/oneFoRegistrationTab03.vue @@ -0,0 +1,25 @@ + + + + diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/components/oneFoRegistrationTest.vue b/test/vuex/one-fo-registration-walk-in-stemcell/components/oneFoRegistrationTest.vue new file mode 100644 index 0000000..6ef357f --- /dev/null +++ b/test/vuex/one-fo-registration-walk-in-stemcell/components/oneFoRegistrationTest.vue @@ -0,0 +1,53 @@ + + + + diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/components/oneFoStart.vue b/test/vuex/one-fo-registration-walk-in-stemcell/components/oneFoStart.vue new file mode 100644 index 0000000..1ee997a --- /dev/null +++ b/test/vuex/one-fo-registration-walk-in-stemcell/components/oneFoStart.vue @@ -0,0 +1,117 @@ + + + + + diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/components/oneMouPxLeft.vue b/test/vuex/one-fo-registration-walk-in-stemcell/components/oneMouPxLeft.vue new file mode 100644 index 0000000..46e3785 --- /dev/null +++ b/test/vuex/one-fo-registration-walk-in-stemcell/components/oneMouPxLeft.vue @@ -0,0 +1,19 @@ + + + + diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/components/oneMouPxMouInfo.vue b/test/vuex/one-fo-registration-walk-in-stemcell/components/oneMouPxMouInfo.vue new file mode 100644 index 0000000..a6ece32 --- /dev/null +++ b/test/vuex/one-fo-registration-walk-in-stemcell/components/oneMouPxMouInfo.vue @@ -0,0 +1,29 @@ + + diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/components/oneMouPxPanel.vue b/test/vuex/one-fo-registration-walk-in-stemcell/components/oneMouPxPanel.vue new file mode 100644 index 0000000..44d337a --- /dev/null +++ b/test/vuex/one-fo-registration-walk-in-stemcell/components/oneMouPxPanel.vue @@ -0,0 +1,109 @@ + + diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/components/oneMouPxProfile.vue b/test/vuex/one-fo-registration-walk-in-stemcell/components/oneMouPxProfile.vue new file mode 100644 index 0000000..d9496d2 --- /dev/null +++ b/test/vuex/one-fo-registration-walk-in-stemcell/components/oneMouPxProfile.vue @@ -0,0 +1,220 @@ + + + + + diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/components/oneMouPxPx.vue b/test/vuex/one-fo-registration-walk-in-stemcell/components/oneMouPxPx.vue new file mode 100644 index 0000000..8cc6c75 --- /dev/null +++ b/test/vuex/one-fo-registration-walk-in-stemcell/components/oneMouPxPx.vue @@ -0,0 +1,342 @@ + + + + diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/components/oneRegistrationTab.vue b/test/vuex/one-fo-registration-walk-in-stemcell/components/oneRegistrationTab.vue new file mode 100644 index 0000000..214c59f --- /dev/null +++ b/test/vuex/one-fo-registration-walk-in-stemcell/components/oneRegistrationTab.vue @@ -0,0 +1,185 @@ + + + + + \ No newline at end of file diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/components/patientDataNasional.vue b/test/vuex/one-fo-registration-walk-in-stemcell/components/patientDataNasional.vue new file mode 100644 index 0000000..030a10c --- /dev/null +++ b/test/vuex/one-fo-registration-walk-in-stemcell/components/patientDataNasional.vue @@ -0,0 +1,257 @@ + + + + diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/components/patientDelivery copy.vue b/test/vuex/one-fo-registration-walk-in-stemcell/components/patientDelivery copy.vue new file mode 100644 index 0000000..066b439 --- /dev/null +++ b/test/vuex/one-fo-registration-walk-in-stemcell/components/patientDelivery copy.vue @@ -0,0 +1,193 @@ + + + diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/components/patientDelivery.vue b/test/vuex/one-fo-registration-walk-in-stemcell/components/patientDelivery.vue new file mode 100644 index 0000000..670e905 --- /dev/null +++ b/test/vuex/one-fo-registration-walk-in-stemcell/components/patientDelivery.vue @@ -0,0 +1,250 @@ + + + diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/components/patientDelivery.vue-- b/test/vuex/one-fo-registration-walk-in-stemcell/components/patientDelivery.vue-- new file mode 100644 index 0000000..78077b8 --- /dev/null +++ b/test/vuex/one-fo-registration-walk-in-stemcell/components/patientDelivery.vue-- @@ -0,0 +1,240 @@ + + + diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/components/patientDetail.vue b/test/vuex/one-fo-registration-walk-in-stemcell/components/patientDetail.vue new file mode 100644 index 0000000..270cea4 --- /dev/null +++ b/test/vuex/one-fo-registration-walk-in-stemcell/components/patientDetail.vue @@ -0,0 +1,428 @@ + + + + + + \ No newline at end of file diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/components/patientHistory.vue b/test/vuex/one-fo-registration-walk-in-stemcell/components/patientHistory.vue new file mode 100644 index 0000000..5cb7cb8 --- /dev/null +++ b/test/vuex/one-fo-registration-walk-in-stemcell/components/patientHistory.vue @@ -0,0 +1,96 @@ + + + + + diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/components/patientHistoryDialog.vue b/test/vuex/one-fo-registration-walk-in-stemcell/components/patientHistoryDialog.vue new file mode 100644 index 0000000..3469fcd --- /dev/null +++ b/test/vuex/one-fo-registration-walk-in-stemcell/components/patientHistoryDialog.vue @@ -0,0 +1,211 @@ + + + diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/components/patientLeftSide.vue b/test/vuex/one-fo-registration-walk-in-stemcell/components/patientLeftSide.vue new file mode 100644 index 0000000..1ae934f --- /dev/null +++ b/test/vuex/one-fo-registration-walk-in-stemcell/components/patientLeftSide.vue @@ -0,0 +1,118 @@ + + + + + diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/components/patientNewDialog.vue b/test/vuex/one-fo-registration-walk-in-stemcell/components/patientNewDialog.vue new file mode 100644 index 0000000..3760063 --- /dev/null +++ b/test/vuex/one-fo-registration-walk-in-stemcell/components/patientNewDialog.vue @@ -0,0 +1,1121 @@ + + + diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/components/patientNotes.vue b/test/vuex/one-fo-registration-walk-in-stemcell/components/patientNotes.vue new file mode 100644 index 0000000..f7de215 --- /dev/null +++ b/test/vuex/one-fo-registration-walk-in-stemcell/components/patientNotes.vue @@ -0,0 +1,42 @@ + + diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/components/patientReference.vue b/test/vuex/one-fo-registration-walk-in-stemcell/components/patientReference.vue new file mode 100644 index 0000000..c5d831f --- /dev/null +++ b/test/vuex/one-fo-registration-walk-in-stemcell/components/patientReference.vue @@ -0,0 +1,170 @@ + + + \ No newline at end of file diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/components/patientRightSide.vue b/test/vuex/one-fo-registration-walk-in-stemcell/components/patientRightSide.vue new file mode 100644 index 0000000..043bd0b --- /dev/null +++ b/test/vuex/one-fo-registration-walk-in-stemcell/components/patientRightSide.vue @@ -0,0 +1,407 @@ + + diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/components/patientSearchBox-org.vue b/test/vuex/one-fo-registration-walk-in-stemcell/components/patientSearchBox-org.vue new file mode 100644 index 0000000..5924bcb --- /dev/null +++ b/test/vuex/one-fo-registration-walk-in-stemcell/components/patientSearchBox-org.vue @@ -0,0 +1,125 @@ + + + diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/components/patientSearchBox.vue b/test/vuex/one-fo-registration-walk-in-stemcell/components/patientSearchBox.vue new file mode 100644 index 0000000..2c1050b --- /dev/null +++ b/test/vuex/one-fo-registration-walk-in-stemcell/components/patientSearchBox.vue @@ -0,0 +1,185 @@ + + + diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/components/patientSearchDialog.vue b/test/vuex/one-fo-registration-walk-in-stemcell/components/patientSearchDialog.vue new file mode 100644 index 0000000..69ec140 --- /dev/null +++ b/test/vuex/one-fo-registration-walk-in-stemcell/components/patientSearchDialog.vue @@ -0,0 +1,74 @@ + + + + + diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/components/patientSearchResult.vue b/test/vuex/one-fo-registration-walk-in-stemcell/components/patientSearchResult.vue new file mode 100644 index 0000000..4acd610 --- /dev/null +++ b/test/vuex/one-fo-registration-walk-in-stemcell/components/patientSearchResult.vue @@ -0,0 +1,295 @@ + + + + + diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/index.php b/test/vuex/one-fo-registration-walk-in-stemcell/index.php new file mode 100644 index 0000000..56c9a33 --- /dev/null +++ b/test/vuex/one-fo-registration-walk-in-stemcell/index.php @@ -0,0 +1,387 @@ + + + + + + + + One + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + Konfirmasi + + + Yakin akan restart ? + + + + + + + Batal + + + + Yakin + + + + + + + + + + + + + + + + + + + mulai sekarang + + + + + + + + + + + + + +

INFO PENTING :

+
+
+ + + label_important + + +

Penghitungan waktu pelayanan pelanggan dimulai dari klik tombol di atas, sampai petugas melakukan klik tombol restart atau tombol baru pada tab ketiga setelah melakukan simpan order

+
+
+ + + label_important + + +

Jika pelanggan tidak jadi melakukan order atau hanya sekedar bertanya, jangan lupa untuk klik tombol restart

+
+
+ + + label_important + + +

Tombol restart berguna untuk mengulang perhitungan waktu pelayanan pelanggan dari awal

+
+
+ + + label_important + + +

Waktu pelayanan pelanggan digunankan untuk penilaian performa petugas Front Office

+
+
+
+
+ +
+
+
+
+
+
+ + + + access_time {{formattedElapsedTime}}  | restart + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/modules/area.js b/test/vuex/one-fo-registration-walk-in-stemcell/modules/area.js new file mode 100644 index 0000000..4222511 --- /dev/null +++ b/test/vuex/one-fo-registration-walk-in-stemcell/modules/area.js @@ -0,0 +1,229 @@ +// 1 => LOADING +// 2 => DONE +// 3 => ERROR +import * as api from "../api/area.js" +window.api = api + +export default { + namespaced: true, + state: { + search: '', + search_status:0, + search_error_message:'', + search_dialog_is_active: false, + + provinces: [], + cities: [], + districts: [], + villages: [], + + total_provinces: 0, + total_cities: 0, + total_districts: 0, + total_villages: 0, + + total_display: 0, + + selected_province: {}, + selected_city: {}, + selected_district: {}, + selected_village: {} + }, + mutations: { + update_search_dialog_is_active(state,status) { + state.search_dialog_is_active = status + }, + update_search_error_message(state,status) { + state.search_error_message = status + }, + + update_search(state,val) { + state.search=val + }, + + update_search_status(state,status) { + state.search_status = status + }, + + update_area(state, data) { + state[data.type] = data.records + state['total_'+data.type] = data.total + state.total_display = data.total_display + + if (["provinces", "districts", "villages"].indexOf(data.type) > -1) + state['selected_'+ data.type.substring(0, data.type.length-1) ] = null + else if (data.type == "cities") + state['selected_city'] = null + + for (let i in data.records) { + if (data.records[i].is_default == "Y") { + + if (["provinces", "districts", "villages"].indexOf(data.type) > -1) + state['selected_'+ data.type.substring(0, data.type.length-1) ] = data.records[i] + + else if (data.type == "cities") + state['selected_city'] = data.records[i] + } + + } + }, + + update_selected_area(state, val) { + state['selected_'+val.type] = val.val + } + }, + actions: { + async search_province(context) { + context.commit("update_search_status", 1) + context.commit("update_area", {records:[], total:0, total_display:0, type:'city'}) + context.commit("update_area", {records:[], total:0, total_display:0, type:'district'}) + context.commit("update_area", {records:[], total:0, total_display:0, type:'village'}) + context.commit("update_selected_area", {type:'city',val:null}) + context.commit("update_selected_area", {type:'district',val:null}) + context.commit("update_selected_area", {type:'village',val:null}) + try { + let resp = await api.search_province(context.state.search) + if (resp.status != "OK") { + context.commit("update_search_status",3) + context.commit("update_search_error_message",resp.message) + } else { + context.commit("update_search_status",2) + context.commit("update_search_error_message","") + let data = { + records : resp.data.records, + total: resp.data.total, + total_display: resp.data.total_display, + type: 'provinces' + } + + // EDIT DATA + if (context.rootState.patient.edit) { + let pid = context.rootState.patient.selected_patient.M_ProvinceID + for (let i in data.records) + if (data.records[i].M_ProvinceID == pid) data.records[i].is_default = "Y" + else data.records[i].is_default = "N" + } + + context.commit("update_area", data) + context.dispatch("search_city") + } + } catch(e) { + context.commit("update_search_status",3) + context.commit("update_search_error_message",e.message ) + } + }, + + async search_city(context) { + // City + context.commit("update_search_status", 1) + context.commit("update_area", {records:[], total:0, total_display:0, type:'district'}) + context.commit("update_area", {records:[], total:0, total_display:0, type:'village'}) + context.commit("update_selected_area", {type:'district',val:null}) + context.commit("update_selected_area", {type:'village',val:null}) + try { + let resp = await api.search_city(context.state.selected_province.M_ProvinceID, context.state.search) + if (resp.status != "OK") { + context.commit("update_search_status",3) + context.commit("update_search_error_message",resp.message) + } else { + context.commit("update_search_status",2) + context.commit("update_search_error_message","") + let data = { + records : resp.data.records, + total: resp.data.total, + total_display: resp.data.total_display, + type: 'cities' + } + + // EDIT DATA + if (context.rootState.patient.edit) { + let pid = context.rootState.patient.selected_patient.M_CityID + for (let i in data.records) + if (data.records[i].M_CityID == pid) data.records[i].is_default = "Y" + else data.records[i].is_default = "N" + } + + context.commit("update_area", data) + context.commit("update_search_status", 1) + context.dispatch("search_district") + } + } catch(e) { + context.commit("update_search_status",3) + context.commit("update_search_error_message", e.message ) + } + }, + + async search_district(context) { + // City + context.commit("update_search_status", 1) + context.commit("update_area", {records:[], total:0, total_display:0, type:'village'}) + context.commit("update_selected_area", {type:'village',val:null}) + try { + let resp = await api.search_district(context.state.selected_city.M_CityID, context.state.search) + if (resp.status != "OK") { + context.commit("update_search_status",3) + context.commit("update_search_error_message",resp.message) + } else { + context.commit("update_search_status",2) + context.commit("update_search_error_message","") + let data = { + records : resp.data.records, + total: resp.data.total, + total_display: resp.data.total_display, + type: 'districts' + } + + // EDIT DATA + if (context.rootState.patient.edit) { + let pid = context.rootState.patient.selected_patient.M_DistrictID + for (let i in data.records) + if (data.records[i].M_DistrictID == pid) data.records[i].is_default = "Y" + else data.records[i].is_default = "N" + } + + context.commit("update_area", data) + context.commit("update_search_status", 1) + context.dispatch("search_kelurahan") + } + } catch(e) { + context.commit("update_search_status",3) + context.commit("update_search_error_message", e.message ) + } + }, + + async search_kelurahan(context) { + // City + context.commit("update_search_status", 1) + try { + let resp = await api.search_kelurahan(context.state.selected_district.M_DistrictID, context.state.search) + if (resp.status != "OK") { + context.commit("update_search_status",3) + context.commit("update_search_error_message",resp.message) + } else { + context.commit("update_search_status",2) + context.commit("update_search_error_message","") + let data = { + records : resp.data.records, + total: resp.data.total, + total_display: resp.data.total_display, + type: 'villages' + } + + // EDIT DATA + if (context.rootState.patient.edit) { + let pid = context.rootState.patient.selected_patient.M_KelurahanID + for (let i in data.records) + if (data.records[i].M_KelurahanID == pid) data.records[i].is_default = "Y" + else data.records[i].is_default = "N" + } + + context.commit("update_area", data) + context.commit("update_search_status", 1) + } + } catch(e) { + context.commit("update_search_status",3) + context.commit("update_search_error_message", e.message ) + } + } + } +} diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/modules/company.js b/test/vuex/one-fo-registration-walk-in-stemcell/modules/company.js new file mode 100644 index 0000000..bf41fc7 --- /dev/null +++ b/test/vuex/one-fo-registration-walk-in-stemcell/modules/company.js @@ -0,0 +1,194 @@ +// 1 => LOADING +// 2 => DONE +// 3 => ERROR +import * as api from "../api/company.js" + +export default { + namespaced: true, + state: { + search: '', + search_status:0, + search_error_message:'', + companies: [], + total_company: 0, + selected_company: {}, + selected_mou: {}, + selected_px_tab: 'px', + show_alias_doctor:false, + order_companies:[], + projects:[], + selected_project:{}, + is_loading_project:false, + fisik_templates:[], + selected_fisik_template:{}, + is_loading_fisik_template:false + }, + mutations: { + update_is_loading_fisik_template(state,val) { + state.is_loading_fisik_template = val + }, + update_fisik_templates(state,val) { + state.fisik_templates = val + }, + update_selected_fisik_template(state,val) { + if(val === null || val === undefined || (typeof val === 'object' && Object.keys(val).length === 0 && val.constructor === Object)) { + state.selected_fisik_template = {} + } else { + state.selected_fisik_template = val + } + }, + update_is_loading_project(state,val) { + state.is_loading_project = val + }, + update_selected_project(state,val) { + state.selected_project = val + }, + update_projects(state,val) { + state.projects = val + }, + update_order_companies(state,val) { + state.order_companies = val + }, + update_show_alias_doctor(state,tab) { + state.show_alias_doctor = tab + }, + update_selected_px_tab(state,tab) { + state.selected_px_tab = tab + }, + update_search_error_message(state,status) { + state.search_error_message = status + }, + update_selected_mou(state,val) { + state.selected_mou = val + }, + update_search(state,val) { + state.search=val + }, + update_search_status(state,status) { + state.search_status = status + }, + update_companies(state,data) { + state.companies= data.records + state.total_company= data.total + }, + update_selected_company(state,val) { + state.selected_company=val + }, + + reset_company(state) { + state.companies = [] + state.total_company = 0 + state.search = "" + state.selected_company = {} + state.selected_mou = {} + } + }, + actions: { + async search(context, prm) { + context.commit("update_search_status",1) + try { + let resp= await api.search(context.state.search) + if (resp.status != "OK") { + context.commit("update_search_status",3) + context.commit("update_search_error_message",resp.message) + } else { + context.commit("update_search_status",2) + context.commit("update_search_error_message","") + let data = { + records : resp.data.records, + total: resp.data.total + } + context.commit("update_companies",data) + + } + } catch(e) { + context.commit("update_search_status",3) + context.commit("update_search_error_message",e.message ) + } + }, + async search_project(context, prm) { + context.commit("update_is_loading_project",true) + try { + prm.token = window.one_token() + let resp= await api.search_project(prm) + if (resp.status != "OK") { + context.commit("update_is_loading_project",false) + context.commit("update_search_error_message",resp.message) + } else { + context.commit("update_is_loading_project",false) + context.commit("update_search_error_message","") + let data = { + records : resp.data.records, + total: resp.data.total + } + context.commit("update_projects",data.records) + + } + } catch(e) { + context.commit("update_is_loading_project",false) + context.commit("update_search_error_message",e.message ) + } + }, + + async search_fisik_template(context, prm) { + context.commit("update_is_loading_fisik_template",true) + try { + prm.token = window.one_token() + let resp= await api.search_fisik_template(prm) + if (resp.status != "OK") { + context.commit("update_is_loading_fisik_template",false) + context.commit("update_search_error_message",resp.message) + } else { + context.commit("update_is_loading_fisik_template",false) + context.commit("update_search_error_message","") + let data = { + records : resp.data.records, + total: resp.data.total + } + context.commit("update_fisik_templates",data.records) + + } + } catch(e) { + context.commit("update_is_loading_fisik_template",false) + context.commit("update_search_error_message",e.message ) + } + }, + + async search_default(context) { + context.commit("update_search_status",1) + try { + let resp= await api.search_default() + if (resp.status != "OK") { + context.commit("update_search_status",3) + context.commit("update_search_error_message", resp.message) + } else { + context.commit("update_search_status",2) + context.commit("update_search_error_message","") + let data = { + records : resp.data.records, + total: resp.data.total + } + context.commit("update_companies", data) + context.commit("update_selected_company", data.records[0]) + + for(let i in data.records[0].mou) { + let cmou = data.records[0].mou[i] + if (cmou.M_MouIsDefault == "Y") { + context.commit("update_selected_mou", cmou) + context.dispatch("delivery/search_deliveries", {type:'mou',id:cmou.M_MouID}, {root:true}) + } + + } + + // search px + console.log("mulai search") + context.dispatch('px/search', null, {root:true}) + + } + } catch(e) { + context.commit("update_search_status",3) + context.commit("update_search_error_message",e.message ) + } + } + } +} diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/modules/delivery.js b/test/vuex/one-fo-registration-walk-in-stemcell/modules/delivery.js new file mode 100644 index 0000000..4cf6234 --- /dev/null +++ b/test/vuex/one-fo-registration-walk-in-stemcell/modules/delivery.js @@ -0,0 +1,134 @@ +// 1 => LOADING +// 2 => DONE +// 3 => ERROR +import * as api from "../api/delivery.js" + +export default { + namespaced: true, + state: { + search_status:0, + search_error_message:'', + deliveries: [], + patient_id: 0, + doctor_id: 0, + order_id: 0, + mou_id: 0, + data_deliveries:[], + selected_data_delivery:[], + checked_id: [] + }, + mutations: { + update_data_deliveries(state,value){ + state.data_deliveries = value + }, + update_selected_data_delivery(state,value){ + state.selected_data_delivery = value + }, + update_search_error_message(state,status) { + state.search_error_message = status + }, + update_search_status(state,status) { + state.search_status = status + }, + update_deliveries(state,data) { + + for (var i in data) { + if (state.checked_id.indexOf(data[i].idx) > -1) + data[i].selected = true + else + data[i].selected = false + } + + state.deliveries = data + }, + update_deliveries_2(state) { + for (var i in state.deliveries) { + if (state.checked_id.indexOf(state.deliveries[i].idx) > -1) + state.deliveries[i].selected = true + else + state.deliveries[i].selected = false + } + // state.deliveries= data + }, + update_selected_delivery(state,val) { + state.selected_delivery=val + }, + update_params(state, val) { + if (typeof val.p_id !== 'undefined') + state.patient_id = val.p_id; + if (typeof val.o_id !== 'undefined') + state.order_id = val.o_id; + if (typeof val.d_id !== 'undefined') + state.doctor_id = val.d_id; + if (typeof val.m_id !== 'undefined') + state.mou_id = val.m_id; + + + }, + update_checked_id(state, val) { + state.checked_id = val + } + }, + actions: { + async search(context) { + console.log(context.rootState.company.selected_company) + context.commit("update_search_status",1) + try { + let resp= await api.search(context.state.order_id, + context.state.patient_id, + context.state.doctor_id, + context.state.mou_id, + context.rootState.company.selected_company.M_CompanyID) + if (resp.status != "OK") { + context.commit("update_search_status",3) + context.commit("update_search_error_message",resp.message) + } else { + context.commit("update_search_status",2) + context.commit("update_search_error_message","") + let data = { + records : resp.data.records + } + let deliveries = resp.data.records + if(deliveries.length > 0) + context.commit("update_deliveries",deliveries) + } + } catch(e) { + context.commit("update_search_status",3) + context.commit("update_search_error_message",e.message ) + } + }, + async search_deliveries(context,prm) { + console.log(context.rootState.company.selected_company) + context.commit("update_search_status",1) + try { + prm.token = one_token() + let resp= await api.search_deliveries(prm) + if (resp.status != "OK") { + context.commit("update_search_status",3) + context.commit("update_search_error_message",resp.message) + } else { + context.commit("update_search_status",2) + context.commit("update_search_error_message","") + let data = { + records : resp.data.records + } + let deliveries = resp.data.records + + var existing_deliveries = context.state.data_deliveries + var exclude_type = _.filter(existing_deliveries, function(o) { return o.type !== prm.type }) + if(deliveries.length > 0){ + deliveries.forEach(function(delivery) { + exclude_type.push(delivery) + }) + } + context.commit("update_data_deliveries",exclude_type) + + + } + } catch(e) { + context.commit("update_search_status",3) + context.commit("update_search_error_message",e.message ) + } + } + } +} diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/modules/doctor.js b/test/vuex/one-fo-registration-walk-in-stemcell/modules/doctor.js new file mode 100644 index 0000000..6c95657 --- /dev/null +++ b/test/vuex/one-fo-registration-walk-in-stemcell/modules/doctor.js @@ -0,0 +1,181 @@ +// 1 => LOADING +// 2 => DONE +// 3 => ERROR +import * as api from "../api/doctor.js" + +export default { + namespaced: true, + state: { + search : '', + search_status: 0, + search_error_message: "", + doctors: [], + total_doctor: 0, + selected_doctor: {}, + selected_address: {}, + doctor_alias:'', + doctor_alias_address:'', + doctors_pj: [], + selected_doctor_pj : {}, + search_pj_status: 0, + search_pj_error_message: "", + show_doctor_alert:true, + mounted: 0, + searchfpp : '', + search_fpp_status: 0, + search_fpp_error_message: "", + fpptypes: [], + selected_fpptype: {}, + is_loading_doctor: false + }, + mutations: { + update_is_loading_doctor(state,val) { + state.is_loading_doctor = val + }, + update_searchfpp(state,val) { + state.searchfpp=val + }, + update_search_fpp_error_message(state,status) { + state.search_fpp_error_message = status + }, + update_search_fpp_status(state,status) { + state.search_fpp_status = status + }, + update_fpptypes(state,val) { + state.fpptypes=val.records + }, + update_selected_fpptype(state,val) { + state.selected_fpptype=val + }, + update_doctor_alias(state,val) { + state.doctor_alias=val + }, + update_doctor_alias_address(state,val) { + state.doctor_alias_address=val + }, + update_show_doctor_alert(state,val) { + state.show_doctor_alert=val + }, + update_search(state,val) { + state.search=val + }, + update_search_error_message(state,status) { + state.search_error_message = status + }, + update_search_status(state,status) { + state.search_status = status + }, + update_doctors(state,data) { + state.doctors = data.records + state.total_doctor= data.total + }, + update_selected_doctor(state, doc) { + console.log("BRI1") + console.log(doc) + state.selected_doctor= doc + + if (!doc) return + state.selected_address = null + + if (doc.address) + if (doc.address.length> 0) { + state.selected_address = doc.address[0] + } + }, + update_selected_address(state,addr) { + state.selected_address = addr + }, + update_search_pj_error_message(state,status) { + state.search_pj_error_message = status + }, + update_search_pj_status(state,status) { + state.search_pj_status = status + }, + update_doctors_pj(state,data) { + state.doctors_pj = data.records + let flag_found = false + data.records.forEach(function(d) { + if (d.M_DoctorIsDefaultPJ == 'Y' ) { + state.selected_doctor_pj = d + flag_found = true + } + }) + if (! flag_found & data.records.length > 0 ) state.selected_doctor_pj = data.records[0] + }, + update_selected_doctor_pj(state,doc) { + state.selected_doctor_pj = doc + }, + + increment_mounted(state, n) { + state.mounted = state.mounted + n; + } + }, + actions: { + async search_pj(context) { + context.commit("update_search_pj_status",1) + try { + let resp= await api.searchPj() + if (resp.status != "OK") { + context.commit("update_search_pj_status",3) + context.commit("update_search_pj_error_message",resp.message) + } else { + context.commit("update_search_pj_status",2) + context.commit("update_search_pj_error_message","") + let data = { + total : resp.data.total, + records : resp.data.records + } + context.commit("update_doctors_pj",data) + } + } catch(e) { + context.commit("update_search_pj_status",3) + context.commit("update_search_pj_error_message",e.message ) + } + }, + async search_fpptype(context) { + context.commit("update_search_status",1) + try { + console.log("in "+context.state.searchfpp) + let resp= await api.search_fpptype(context.state.searchfpp) + if (resp.status != "OK") { + context.commit("update_search_status",3) + context.commit("update_search_error_message",resp.message) + } else { + context.commit("update_search_status",2) + context.commit("update_search_error_message","") + let data = { + records : resp.data.records, + selected: resp.data.selected + } + context.commit("update_fpptypes",data) + context.commit("update_selected_fpptype",data.selected) + } + } catch(e) { + context.commit("update_search_status",3) + context.commit("update_search_error_message",e.message ) + } + }, + async search(context) { + context.commit("update_is_loading_doctor",true) + try { + console.log("in search doctor module") + let resp= await api.search(context.state.search) + if (resp.status != "OK") { + context.commit("update_is_loading_doctor",false) + context.commit("update_search_error_message",resp.message) + } else { + context.commit("update_is_loading_doctor",false) + context.commit("update_search_error_message","") + let data = { + total : resp.data.total, + records : resp.data.records + } + context.commit("update_doctors", data) + } + } catch(e) { + context.commit("update_is_loading_doctor",false) + context.commit("update_search_error_message",e.message ) + } + } + } +} diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/modules/doctor_new.js b/test/vuex/one-fo-registration-walk-in-stemcell/modules/doctor_new.js new file mode 100644 index 0000000..057ddc4 --- /dev/null +++ b/test/vuex/one-fo-registration-walk-in-stemcell/modules/doctor_new.js @@ -0,0 +1,285 @@ +// 1 => LOADING +// 2 => DONE +// 3 => ERROR +import * as api from "../api/doctor.js" +import * as area from "../api/area.js" +import * as other from "../api/other.js" + +export default { + namespaced: true, + state: { + search : '', + search_status: 0, + search_error_message: "", + + sexs: [], + selected_sex: null, + param_name: '', + param_prefix1: '', + param_prefix2: '', + param_sufix1: '', + param_sufix2: '', + param_sufix3: '', + param_hp: '', + param_note: '', + param_address: '', + + provinces: [], + selected_province: null, + cities: [], + selected_city: null, + districts: [], + selected_district: null, + villages: [], + selected_village: null, + dialog_new: false, + + adhoc: false + }, + + mutations: { + update_search(state,val) { + state.search=val + }, + + update_search_error_message(state,status) { + state.search_error_message = status + }, + + update_search_status(state,status) { + state.search_status = status + }, + + update_dialog_new(state, d) { + state.dialog_new = d + }, + + update_sexs(state, d) { + state.sexs = d.records + }, + + update_selected_sex(state, d) { + state.selected_sex = d + }, + + update_provinces(state, d) { + state.provinces = d.records + state.cities = [] + state.districts = [] + state.villages = [] + state.selected_city = null + state.selected_district = null + state.selected_village = null + + for (let i in d.records) + if (d.records[i].is_default == "Y") + state.selected_province = d.records[i] + }, + + update_selected_province(state, d) { + state.selected_province = d + }, + + update_districts(state, d) { + state.districts = d.records + state.villages = [] + state.selected_village = null + + for (let i in d.records) + if (d.records[i].is_default == "Y") + state.selected_district = d.records[i] + }, + + update_selected_district(state, d) { + state.selected_district = d + }, + + update_cities(state, d) { + state.cities = d.records + state.districts = [] + state.villages = [] + state.selected_district = null + state.selected_village = null + + for (let i in d.records) + if (d.records[i].is_default == "Y") + state.selected_city = d.records[i] + }, + + update_selected_city(state, d) { + state.selected_city = d + }, + + update_villages(state, d) { + state.villages = d.records + + for (let i in d.records) + if (d.records[i].is_default == "Y") + state.selected_village = d.records[i] + }, + + update_selected_village(state, d) { + state.selected_village = d + }, + + update_param(state, d) { + state['param_'+d.param] = d.val + }, + + update_adhoc(state, d) { + state.adhoc = d + } + }, + actions: { + async save(context) { + context.commit('update_search_status', 1) + try { + let d = { + name: context.state.param_name, + prefix1: context.state.param_prefix1, + prefix2: context.state.param_prefix2, + sufix1: context.state.param_sufix1, + sufix2: context.state.param_sufix2, + sufix3: context.state.param_sufix3, + sex: context.state.selected_sex.M_SexID, + hp: context.state.param_hp, + note: context.state.param_note, + address: context.state.param_address, + village: context.state.selected_village.M_KelurahanID + } + + let resp = await api.save(one_token(), d) + if (resp.status != 'OK') { + context.commit('update_search_status', 3) + context.commit('update_search_error_message', resp.message) + } else { + context.commit('update_search_status', 2) + context.commit('update_search_error_message', '') + let data = { + records: resp.data.records, + total: resp.data.total + } + + context.commit('update_adhoc', true) + context.commit('doctor/update_doctors', data, {root:true}) + context.commit('doctor/update_search', data.records[0].M_DoctorRealName, {root:true}) + context.commit('doctor/update_selected_doctor', data.records[0], {root:true}) + context.commit('delivery/update_params', {d_id:data.records[0].M_DoctorID}, {root:true}) + context.dispatch('delivery/search', null, {root:true}) + + context.commit('update_dialog_new', false) + context.commit('update_dialog_loading', false, {root:true}) + + + } + } catch(e) { + console.log(e) + } + }, + + async search_sex(context) { + context.commit('update_search_status', 1) + try { + let resp = await other.search_sex() + if (resp.status != 'OK') { + context.commit('update_search_status', 3) + context.commit('update_search_error_message', resp.message) + } else { + context.commit('update_search_status', 2) + context.commit('update_search_error_message', '') + let data = { + records: resp.data.records + } + + context.commit('update_sexs', data) + } + } catch(e) { + + } + }, + + async search_province(context) { + context.commit('update_search_status', 1) + try { + let resp = await area.search_province() + if (resp.status != 'OK') { + context.commit('update_search_status', 3) + context.commit('update_search_error_message', resp.message) + } else { + context.commit('update_search_status', 2) + context.commit('update_search_error_message', '') + let data = { + records: resp.data.records + } + + context.commit('update_provinces', data) + } + } catch(e) { + + } + }, + + async search_city(context) { + context.commit('update_search_status', 1) + try { + let resp = await area.search_city(context.state.selected_province.M_ProvinceID) + if (resp.status != 'OK') { + context.commit('update_search_status', 3) + context.commit('update_search_error_message', resp.message) + } else { + context.commit('update_search_status', 2) + context.commit('update_search_error_message', '') + let data = { + records: resp.data.records + } + + context.commit('update_cities', data) + } + } catch(e) { + + } + }, + + async search_district(context) { + context.commit('update_search_status', 1) + try { + let resp = await area.search_district(context.state.selected_city.M_CityID) + if (resp.status != 'OK') { + context.commit('update_search_status', 3) + context.commit('update_search_error_message', resp.message) + } else { + context.commit('update_search_status', 2) + context.commit('update_search_error_message', '') + let data = { + records: resp.data.records + } + + context.commit('update_districts', data) + } + } catch(e) { + + } + }, + + async search_village(context) { + context.commit('update_search_status', 1) + try { + let resp = await area.search_kelurahan(context.state.selected_district.M_DistrictID) + if (resp.status != 'OK') { + context.commit('update_search_status', 3) + context.commit('update_search_error_message', resp.message) + } else { + context.commit('update_search_status', 2) + context.commit('update_search_error_message', '') + let data = { + records: resp.data.records + } + + context.commit('update_villages', data) + } + } catch(e) { + + } + } + } +} diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/modules/history.js b/test/vuex/one-fo-registration-walk-in-stemcell/modules/history.js new file mode 100644 index 0000000..1f780a5 --- /dev/null +++ b/test/vuex/one-fo-registration-walk-in-stemcell/modules/history.js @@ -0,0 +1,112 @@ +// 1 => LOADING +// 2 => DONE +// 3 => ERROR +import * as api from "../api/history.js" +import doctor from "./doctor.js" +window.api = api + +export default { + namespaced: true, + state: { + noreg:'', + search: '', + search_status:0, + search_error_message:'', + search_dialog_is_active: false, + histories: [], + + history_dialog: false + }, + mutations: { + update_search_dialog_is_active(state,status) { + state.search_dialog_is_active = status + }, + + update_search_error_message(state,status) { + state.search_error_message = status + }, + + update_search(state,val) { + state.search=val + }, + + update_search_status(state,status) { + state.search_status = status + }, + + update_histories(state, data) { + state.histories = data + }, + + update_history_dialog(state, v) { + state.history_dialog = v + } + }, + actions: { + async search(context) { + context.commit("update_search_status",1) + try { + let resp = await api.search(context.rootState.patient.selected_patient.M_PatientID) + if (resp.status != "OK") { + context.commit("update_search_status",3) + context.commit("update_search_error_message", resp.message) + } else { + context.commit("update_search_status",2) + context.commit("update_search_error_message","") + + let data = { + records : resp.data.records + } + context.commit("update_histories", resp.data.records) + context.commit('update_history_dialog',true) + } + } catch(e) { + context.commit("update_search_status",3) + context.commit("update_search_error_message",e.message ) + } + }, + async get_databyorder_id(context,prm) { + context.commit("update_search_status",1) + try { + prm.token = one_token() + let resp = await api.get_databyorder_id(prm) + if (resp.status != "OK") { + context.commit("update_search_status",3) + context.commit("update_search_error_message", resp.message) + } else { + context.commit("update_search_status",2) + context.commit("update_search_error_message","") + + let data = { + records : resp.data.records + } + console.log(data.records.status) + if(data.records.status === 'N'){ + context.commit('update_message_error', 'satu...dua...tiga permen manis rasanya, coba cek agreement sepertinya sudah kadaluarsa', {root:true}) + context.commit('update_dialog_error', true, {root:true}) + } + else{ + var rst = data.records.data + //console.log(rst) + let doctors = [] + doctors.push(rst['selected_doctor']) + //console.log(doctors) + context.commit('doctor/update_doctors', {records:doctors,total:doctors.length}, {root:true}) + context.commit('doctor/update_selected_doctor', doctors[0], {root:true}) + context.commit('doctor/update_selected_address', rst['selected_address'], {root:true}) + context.commit('company/update_companies', {records:rst['companies'],total:rst['companies'].length}, {root:true}) + context.commit('company/update_selected_company', rst['selected_company'], {root:true}) + context.commit('company/update_selected_mou', rst['selected_mou'], {root:true}) + context.commit('delivery/update_data_deliveries', rst['data_deliveries'], {root:true}) + context.commit('history/update_history_dialog',false,{root:true}) + context.dispatch('px/search_pxs', prm.order_id, {root:true}) + } + + } + } catch(e) { + context.commit("update_search_status",3) + context.commit("update_search_error_message",e.message ) + } + } + } +} diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/modules/language.js b/test/vuex/one-fo-registration-walk-in-stemcell/modules/language.js new file mode 100644 index 0000000..3f61ff3 --- /dev/null +++ b/test/vuex/one-fo-registration-walk-in-stemcell/modules/language.js @@ -0,0 +1,78 @@ +// 1 => LOADING +// 2 => DONE +// 3 => ERROR +import * as api from "../api/language.js" + +export default { + namespaced: true, + state: { + search_status:0, + search_error_message:'', + languages: [], + languages_2: [], + selected_language: {}, + selected_language_2: null + }, + mutations: { + update_search_error_message(state,status) { + state.search_error_message = status + }, + + update_search_status(state,status) { + state.search_status = status + }, + + update_languages(state, data) { + state.languages= data.records + let x = Object.assign([], state.languages) + if (data.records.length > 0) { + state.selected_language = data.records[0] + x.splice(0, 1) + } + + state.languages_2 = x + }, + + update_selected_language(state, val) { + state.selected_language = val + + let x = Object.assign([], state.languages) + let idx = 999 + if (val) + if (val.id) + for (let i in x) + if (x[i].id == val.id && x[i].is_si == val.is_si) + idx = i + + x.splice(idx, 1) + state.languages_2 = x + state.selected_language_2 = null + }, + + update_selected_language_2(state, val) { + state.selected_language_2 = val + } + }, + actions: { + async search(context) { + context.commit("update_search_status",1) + try { + let resp= await api.search() + if (resp.status != "OK") { + context.commit("update_search_status",3) + context.commit("update_search_error_message",resp.message) + } else { + context.commit("update_search_status",2) + context.commit("update_search_error_message","") + let data = { + records : resp.data.records + } + context.commit("update_languages", data) + } + } catch(e) { + context.commit("update_search_status",3) + context.commit("update_search_error_message",e.message ) + } + } + } +} diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/modules/order.js b/test/vuex/one-fo-registration-walk-in-stemcell/modules/order.js new file mode 100644 index 0000000..654cdc3 --- /dev/null +++ b/test/vuex/one-fo-registration-walk-in-stemcell/modules/order.js @@ -0,0 +1,842 @@ +// 1 => LOADING +// 2 => DONE +// 3 => ERROR +import * as api from "../api/order.js" + +export default { + namespaced: true, + state: { + order_id: 0, + queue: "", + is_from_clinic: false, + + catatan_fo: '', + diagnosa: '', + patient_note: '', + + finish_dialog_is_active: false, + current_order: {}, + + received_sample: { + flag: 'N', + time: '' + }, + + tabs: [ + { "label": "DEMOGRAFI", "icon": "opacity", "code": "01", "enabled": true }, + { "label": "PEMERIKSAAN", "icon": "verified_user", "code": "02", "enabled": true }, + { "label": "PEMBAYARAN", "icon": "motorcycle", "code": "03", "enabled": false } + ], + + print_dialog_is_active: false, + rpt_url: window.BASE_URL + '/one-ui/test/vuex/common/under-cons.pdf', + dialog_start: true, + status_start: 'Y', + time_start: undefined, + elapsedTime: 0, + show_time: null, + loading_process: false, + stest: [], + mcuid: 0, + preid: 0, + patientBarcode: [], + url_preregister : '', + url_register: '', + in_saving: false, + loading_data_patient: false, + uuid: '', + form_code: '', + url_qrform: '', + preregister_promise:'', + message_error:'', + dialog_pop_up_error: false, + loading_save: false, + url_menu_cashier: '' + }, + mutations: { + update_url_menu_cashier(state, val) { + state.url_menu_cashier = val + }, + update_loading_save(state, val) { + state.loading_save = val + }, + update_message_error(state, val) { + state.message_error = val + }, + update_dialog_pop_up_error(state, val) { + state.dialog_pop_up_error = val + }, + update_preregister_promise(state, val) { + state.preregister_promise = val + }, + update_url_qrform(state, val) { + state.url_qrform = val + }, + update_uuid(state, val) { + state.uuid = val + }, + update_form_code(state, val) { + state.form_code = val + }, + update_loading_data_patient(state, val) { + state.loading_data_patient = val + }, + update_in_saving(state, val) { + state.in_saving = val + }, + update_url_preregister(state, val) { + state.url_preregister = val + }, + update_url_register(state, val) { + state.url_register = val + }, + update_patientBarcode(state, val) { + state.patientBarcode = val + }, + update_preid(state, val) { + state.preid = val + }, + update_mcuid(state, val) { + state.mcuid = val + }, + update_stest(state, val) { + state.stest = val + }, + update_loading_process(state, val) { + state.loading_process = val + }, + update_show_time(state, val) { + state.show_time = val + }, + update_elapsedTime(state, val) { + state.elapsedTime = val + }, + update_dialog_start(state, val) { + state.dialog_start = val + }, + update_status_start(state, val) { + state.status_start = val + }, + update_time_start(state, val) { + state.time_start = val + }, + update_patient_note(state, val) { + state.patient_note = val + }, + update_catatan_fo(state, val) { + state.catatan_fo = val + }, + update_diagnosa(state, val) { + state.diagnosa = val + }, + update_finish_dialog_is_active(state, val) { + state.finish_dialog_is_active = val + }, + update_current_order(state, val) { + state.current_order = val + }, + + update_received_sample(state, val) { + state.received_sample = val + }, + + update_tab_enable(state, v) { + state.tabs[v[0]].enabled = v[1] + }, + + update_from_clinic(state, v) { + state.is_from_clinic = v + }, + + update_queue(state, v) { + state.queue = v + }, + + update_order_id(state, v) { + state.order_id = v + }, + + reset_form(state) { + state.order_id = 0 + state.queue = "" + state.is_from_clinic = false + state.catatan_fo = "" + state.diagnosa = "" + state.patient_note = "" + }, + + update_print_dialog_is_active(state, val) { + state.print_dialog_is_active = val + }, + + update_rpt_url(state, v) { + state.rpt_url = v + } + }, + actions: { + async save(context) { + + var req = []; + var detail = []; + var px_tmp = []; + var st = context.rootState.px.selected_test; + for (let i in st) { + let x = { + t_id: st[i]['T_TestID'], + t_name: st[i]['T_TestName'], + t_amount: st[i]['T_PriceAmount'], + t_discount: st[i]['T_PriceDisc'], + t_discount_rp: st[i]['T_PriceDiscRp'], + t_subtotal: st[i]['T_PriceSubTotal'], + t_total: st[i]['T_PriceTotal'], + t_cito: st[i]['T_TestIsCito']?st[i]['T_TestIsCito']:'N', + nat_test: st[i]['nat_test']?st[i]['nat_test']:null, + t_req: 'N', + t_reqnote: '', + t_ispacket: st[i]['is_packet']?st[i]['is_packet']:'N', + t_packetid: st[i]['packet_id']?st[i]['packet_id']:0, + packet_type: st[i]['packet_type']?st[i]['packet_type']:'', + packet_name: st[i]['packet_name']?st[i]['packet_name']:'', + t_px_type: st[i]['px_type']?st[i]['px_type']:'PX' + } + + let rq = context.rootState.px.requirement + for (let j in rq) { + if (rq[j].label == st[i].T_TestRequirement) { + x.t_req = (rq[j].checked ? 'Y' : 'N') + x.t_reqnote = rq[j].note + } + } + + px_tmp.push(x) + } + + let req_status = context.rootState.px.req_status + req = { + status : req_status, + reqs : req_status == 'Y' ? [] : context.rootState.px.reqs + } + + detail = px_tmp; + + let prm = {} + prm.token = one_token() + prm.selected_patient = context.rootState.patient.selected_patient + prm.patient_age = context.rootState.patient.selected_patient.patient_age + prm.patient_note = context.state.patient_note + prm.diagnosa = context.state.diagnosa + prm.catatan_fo = context.state.catatan_fo + prm.selected_icd10 = context.rootState.patient.selected_icd10 + prm.selected_doctor = context.rootState.doctor.selected_doctor + prm.selected_language = context.rootState.language.selected_language ? context.rootState.language.selected_language.id : 1 + prm.selected_language_2 = context.rootState.language.selected_language_2 ? context.rootState.language.selected_language_2.id : 0 + prm.selected_project = context.rootState.company.selected_project + prm.selected_fisik_template = context.rootState.company.selected_fisik_template + prm.selected_company = context.rootState.company.selected_company + prm.selected_mou = context.rootState.company.selected_mou + prm.detail = px_tmp + prm.received_sample = context.rootState.order.received_sample.flag ?context.rootState.order.received_sample.flag:"N" + + // Konversi format waktu ke MySQL format (YYYY-MM-DD H:i:s) + // Format input: "301220250900" (ddmmyyyyhhmm) -> Output: "2025-12-30 09:00:00" + let receivedTime = context.rootState.order.received_sample.time + if (receivedTime) { + // Parse format ddmmyyyyhhmm (12 digit tanpa separator) + // Contoh: "301220250900" -> "30-12-2025 09:00" + if (receivedTime.match(/^\d{12}$/)) { + let day = receivedTime.substring(0, 2) // 30 + let month = receivedTime.substring(2, 4) // 12 + let year = receivedTime.substring(4, 8) // 2025 + let hour = receivedTime.substring(8, 10) // 09 + let minute = receivedTime.substring(10, 12) // 00 + + // Format MySQL: YYYY-MM-DD H:i:s + receivedTime = `${year}-${month}-${day} ${hour}:${minute}:00` + } + } + prm.received_sample_time = receivedTime + prm.queue = context.state.queue + prm.queue_id = context.state.queue_id + prm.deliveries = context.rootState.delivery.data_deliveries + prm.cito_id = context.rootState.px.selected_cito ? context.rootState.px.selected_cito.Nat_CitoID : 0 + prm.schedule = context.rootState.px.appx_schedule + prm.req = req + + + try { + let refs = context.rootState.reference.selected_reference || []; + if (!Array.isArray(refs)) refs = [refs]; + refs = refs.filter(r => r && r.M_ReferenceID); + + prm.reference = refs; + + let ordertype = context.rootState.reference.selected_ordertype || null; + prm.ordertype = ordertype; + + let resp = await api.save(prm); + + console.log('save respon' , resp.data) + if (resp.status != "200") { + context.commit('update_in_saving', false) + context.commit('update_loading_process', false) + context.commit('update_dialog_loading', false, { root: true }) + context.commit('update_message_error', resp.data.message) + context.commit('update_dialog_pop_up_error', true) + } else { + // Dialog loading + + if(resp.data.status != 'OK'){ + context.commit('update_in_saving', false) + context.commit('update_loading_process', false) + context.commit('update_dialog_loading', false, { root: true }) + context.commit('update_message_error', resp.data.message) + context.commit('update_dialog_pop_up_error', true) + return; + } + + context.commit('update_loading_process', false) + context.commit('update_dialog_loading', false, { root: true }) + context.commit('update_in_saving', false) + + if(resp.data.data.tipe == 'new'){ + context.commit('patient/update_selected_patient', resp.data.data.order_header, { root: true }) + context.commit('payment/update_selected_patient', resp.data.data.order_header, { root: true }) + context.commit("update_current_order", resp.data.data) + context.commit('update_uuid', resp.data.data.uuid) + context.commit('update_form_code', resp.data.data.form_code) + context.commit('update_url_qrform', resp.data.data.url_qrform) + context.commit('update_finish_dialog_is_active', true) + + context.commit('payment/update_order_id', resp.data.data.order_id, { root: true }) + context.commit("payment/update_order", resp.data.data, { root: true }) + context.commit('update_url_menu_cashier', resp.data.data.url_menu_cashier) + } + } + } catch (e) { + context.commit('update_loading_process', false) + context.commit('update_dialog_loading', false, { root: true }) + context.commit('update_in_saving', false) + } + }, + + async load_from_clinic(context) { + let queue = context.state.queue; + + try { + let resp = await api.load_from_clinic(queue) + + if (resp.status != "200") { + // context.commit("update_search_status",3) + // context.commit("update_search_error_message",resp.message) + alert('error') + } else { + + if (resp.data.status != "OK") { + + return; + } + + let data = resp.data.data + context.commit('update_from_clinic', true) + + context.commit('patient/update_selected_patient', data.patient, { root: true }) + context.commit('doctor/update_doctors', { records: [data.doctor], total: 1 }, { root: true }) + context.commit('doctor/update_selected_doctor', data.doctor, { root: true }) + context.commit('doctor/update_search', data.doctor.search, { root: true }) + + // Delivery + context.commit('delivery/update_params', { p_id: data.patient.M_PatientID }, { root: true }) + context.commit('delivery/update_params', { d_id: data.doctor.M_DoctorID }, { root: true }) + + + // Company + let search = data.company.search + delete (data.company.search) + + setTimeout(function () { context.commit('company/update_companies', { records: [data.company], total: 1 }, { root: true }) }, 0) + setTimeout(function () { context.commit('company/update_search', search, { root: true }) }, 0) + setTimeout(function () { context.commit('company/update_selected_company', data.company, { root: true }) }, 0) + + setTimeout(function () { context.commit('company/update_selected_mou', data.company.mou[0], { root: true }) }, 0) + // setTimeout(function() { context.commit('company/selected_xx', data.company.mou[0], {root:true}) }, 0) + + // PX + // context.commit("px/update_selected_test", data.test, {root:true}) + // context.commit("px/update_requirement", data.req, {root:true}) + + // Delivery + context.dispatch('delivery/search', null, { root: true }) + + // PX + context.dispatch('px/search_pxs_clinic', data.order_id, { root: true }) + } + } catch (e) { + // context.commit("update_search_status",3) + // context.commit("update_search_error_message",e.message ) + } + }, + async load(context) { + let id = context.state.order_id; + + try { + let resp = await api.load(id) + + if (resp.status != "200") { + // context.commit("update_search_status",3) + // context.commit("update_search_error_message",resp.message) + alert('error') + } else { + + if (resp.data.status != "OK") { + return; + } + + let data = resp.data.data + + + if (id !== -1) + context.commit('patient/update_selected_patient', data.patient, { root: true }) + + //context.commit('doctor/update_doctors', { records: [data.doctor], total: 1 }, { root: true }) + // context.commit('doctor/update_selected_doctor', data.doctor, { root: true }) + context.commit('doctor/update_search', data.doctor.search, { root: true }) + + // Delivery + context.commit('delivery/update_params', { p_id: data.patient.M_PatientID }, { root: true }) + context.commit('delivery/update_params', { d_id: data.doctor.M_DoctorID }, { root: true }) + + + // Company + let search = data.company.search + delete (data.company.search) + + setTimeout(function () { context.commit('company/update_companies', { records: [data.company], total: 1 }, { root: true }) }, 0) + setTimeout(function () { context.commit('company/update_search', search, { root: true }) }, 0) + setTimeout(function () { context.commit('company/update_selected_company', data.company, { root: true }) }, 0) + + setTimeout(function () { context.commit('company/update_selected_mou', data.company.mou[0], { root: true }) }, 0) + // setTimeout(function() { context.commit('company/selected_xx', data.company.mou[0], {root:true}) }, 0) + + context.commit('update_received_sample', data.order.rec_sample); + + // PX + context.commit("px/update_selected_test", data.test, { root: true }) + context.commit("px/update_requirement", data.req, { root: true }) + + // Delivery + context.dispatch('delivery/search', null, { root: true }) + + // Enable tab + context.commit('update_tab_enable', [2, true]) + + setTimeout(function () { + context.commit('update_from_clinic', false) + }, 15000) + + } + } catch (e) { + // context.commit("update_search_status",3) + // context.commit("update_search_error_message",e.message ) + } + }, + + async reset_form(context) { + context.commit("reset_form") + context.commit("patient/update_selected_patient", {}, { root: true }) + context.commit("doctor/update_doctors", { records: [], total: 0 }, { root: true }) + context.commit("doctor/update_selected_doctor", {}, { root: true }) + context.commit("doctor/update_selected_doctor_pj", {}, { root: true }) + + // context.commit("delivery/update_deliveries", [], {root:true}) + // context.commit("delivery/update_selected_delivery", {}, {root:true}) + context.commit("delivery/update_params", { p_id: 0, d_id: 0, o_id: 0 }, { root: true }) + context.dispatch("delivery/search", null, { root: true }) + + context.commit("px/update_selected_test", [], { root: true }) + context.commit("px/update_requirement", [], { root: true }) + + // Company + context.commit("company/reset_company") + }, + async load_preregister(context, prm) { + //context.commit("update_search_status",1) + try { + prm.token = one_token() + let resp = await api.load_preregister(prm) + //alert("dasdasd") + // console.log(resp) + + // context.commit("update_search_status",2) + // context.commit("update_search_error_message","") + // alert("aaaaaaaaaaaaaa") + //console.log("dasdasdasd") + let data = { + records: resp.data.records + } + console.log(resp) + var rst = resp.data.data.records + + console.log(rst) + context.commit('patient/update_selected_patient', rst['patient'], { root: true }) + if (rst['patient']['M_PatientPhoto']) { + context.commit('photo/update_photo_url', rst['patient']['M_PatientPhoto'], { root: true }) + } + + let refs = rst['selected_reference'] || []; + if (!Array.isArray(refs)) refs = [refs]; + + let doctors = [] + doctors.push(rst['selected_doctor']) + console.log(doctors) + + context.commit('doctor/update_doctors', { records: doctors, total: doctors.length }, { root: true }) + context.commit('doctor/update_selected_doctor', doctors[0], { root: true }) + context.commit('doctor/update_selected_address', rst['selected_address'], { root: true }) + context.commit('reference/update_references', refs, { root: true }) + context.commit('reference/update_selected_reference', refs, { root: true }) + console.log('selesai doctor') + console.log(rst['companies']) + context.commit('company/update_companies', { records: rst['companies'], total: 1 }, { root: true }) + console.log(context.rootState.company.companies) + context.commit('company/update_order_companies', rst['companies'], { root: true }) + //console.log(context.rootState.company.companies) + context.commit('company/update_selected_company', rst['selected_company'], { root: true }) + context.commit('company/update_selected_mou', rst['selected_mou'], { root: true }) + console.log('selesai company') + context.commit('delivery/update_data_deliveries', rst['data_deliveries'], { root: true }) + console.log('selesai delivery') + context.commit('update_stest', rst['tests']) + console.log('selesai test 1') + //context.commit('history/update_history_dialog',false,{root:true}) + //context.dispatch('px/search', {}, { root: true }) + if (rst['tests']) { + rst['tests'].forEach(function (test) { + context.dispatch('selectPx', test) + }); + + } + context.commit('update_preregister_promise', rst['result_promise']) + console.log('selesai load') + + + + + + + } catch (e) { + // context.commit("update_search_status",3) + // context.commit("update_search_error_message",e.message ) + } + }, + async selectPx(context, px) { + // console.log(context) + var in_selectPx = false + console.log(px) + //debugger + console.log("start select px") + if (!window.one_token()) { + //context.commit('update_message_error', 'Maaf, koneksi Anda sempat terputus silahkan Log Out dan Login kembali',{root:true}) + //context.commit('update_dialog_error', true,{root:true}) + return + } + + + try { + console.log(in_selectPx) + // START LOADING + //context.commit('update_dialog_loading', true) + console.log('px type ' + px.px_type) + + // IF PROFILE + if (px.px_type == "PR" || px.px_type == "PXR") + return context.dispatch('selectProfile', px) + + + // SEARCH NAT TEST + let nt = context.rootState.px.nat_test + let found_nt = false + for (let i in px.nat_test) { + if (nt.indexOf(px.nat_test[i]) > -1) + found_nt = true + } + + if (found_nt) { + alert('Pemeriksaan tersebut sudah ada !') + // END LOADING + //context.commit('update_dialog_loading', false,{root:true}) + return + } + + //if (in_selectPx) return + in_selectPx = true + let selected_test = context.rootState.px.selected_test + let flag_found = false + selected_test.forEach(function (t, idx) { + if (t.T_TestID == px.T_TestID) { + selected_test[idx] = px + flag_found = true + } + }) + if (!flag_found) { + selected_test.push(px) + let tests = context.rootState.px.tests + let p_idx = -1 + tests.forEach(function (t, idx) { + if (t.T_TestID == px.T_TestID) { + p_idx = idx + } + }) + if (p_idx >= 0) { + _.pullAt(tests, [p_idx]) + let dt = { + records: tests, + total: tests.length + } + context.commit('px/update_tests', dt, { root: true }) + } + } + context.commit('px/update_selected_test', selected_test, { root: true }) + console.log('load data patient px') + context.commit('update_loading_data_patient', true) + if (px.px_type !== "PN") { + let req = px.requirement + let reqs = context.rootState.px.requirement + if (req.length > 0) { + for (let i in req) { + let found = false + for (let j in reqs) { + if (reqs[j]['req_id'] == req[i]['req_id']) + found = j + } + + if (!found) + reqs.push({ + px_id: [px.T_TestID], + label: req[i]['req_name'], + error_message: 'Hasil harus di isi', + is_error: true, + checked: false, + note: '', + req_id: req[i]['req_id'] + }) + else + reqs[found].px_id.push(px.T_TestID) + } + + context.commit('px/update_requirement', reqs, { root: true }) + } + } + + + context.dispatch('px/appx_schedule', {}, { root: true }) + + in_selectPx = false + context.commit('px/update_nat_test', {}, { root: true }) + context.commit('update_loading_data_patient', true) + console.log('load data patient px') + + // END LOADING + if (px.px_type == "PN") + //context.commit('update_loading_data_patient', false) + context.dispatch('px/packet_reqs', { pxs: px.child_test }, { root: true }) + //context.commit('update_dialog_loading', false,{root:true}) + } catch (e) { + console.log(e) + in_selectPx = false + } + }, + + async selectProfile(context, px) { + + try { + var in_selectPx = false + // SEARCH NAT TEST + let nt = context.rootState.px.nat_test + let found_nt = false + for (let i in px.nat_test) { + if (nt.indexOf(px.nat_test[i]) > -1) + found_nt = true + } + + if (found_nt) { + alert('Pemeriksaan tersebut sudah ada !') + // END LOADING + // context.commit('update_dialog_loading', false,{root:true}) + return + } + + let pxs = px.child_test + + for (let i in pxs) { + px = pxs[i] + + let selected_test = context.rootState.px.selected_test + let flag_found = false + + selected_test.push(px) + let tests = context.rootState.px.tests + let p_idx = -1 + tests.forEach(function (t, idx) { + if (t.T_TestID == px.T_TestID) { + p_idx = idx + } + }) + + if (p_idx >= 0) { + _.pullAt(tests, [p_idx]) + let dt = { + records: tests, + total: tests.length + } + context.commit('px/update_tests', dt, { root: true }) + } + + context.commit('px/update_selected_test', selected_test, { root: true }) + + let req = px.requirement + + let reqs = context.rootState.px.requirement + if (req.length > 0) { + for (let i in req) { + let found = false + for (let j in reqs) { + if (reqs[j]['req_id'] == req[i]['req_id']) + found = j + } + + if (!found) + reqs.push({ + px_id: [px.T_TestID], + label: req[i]['req_name'], + error_message: 'Hasil harus di isi', + is_error: true, + checked: false, + note: '', + req_id: req[i]['req_id'] + }) + else + reqs[found].px_id.push(px.T_TestID) + } + + context.commit('px/update_requirement', reqs, { root: true }) + } + } + + context.dispatch('px/appx_schedule', {}, { root: true }) + //in_selectPx = false + context.commit('px/update_nat_test', {}, { root: true }) + console.log('load data patient profile') + context.commit('update_loading_data_patient', true) + + // END LOADING + //context.commit('update_dialog_loading', false,{root:true}) + + } catch (e) { + console.log(e) + // END LOADING + //context.commit('update_dialog_loading', false,{root:true}) + // in_selectPx = false + } + }, + async get_time_start(context, prm) { + try { + prm.token = one_token() + let resp = await api.get_time_start(prm) + if (resp.data.status != "OK") { + + } else { + var t_orderid = resp.data.data.orderid + var url_preregister = resp.data.data.url_preregister + var url_register = resp.data.data.url_register + console.log(t_orderid) + console.log(url_preregister) + console.log(url_register) + + context.commit('update_url_preregister', url_preregister) + context.commit('update_url_register', url_register) + if(t_orderid > 0){ + alert('Data telah terdaftar !!!') + var url_string = window.location.href + var url = new URL(url_string); + var mcuid = url.searchParams.get("mcuid") + location.replace("/one-ui/" +url_preregister +"?mcuid="+mcuid) + + }else{ + context.commit('update_dialog_start', false) + context.commit('update_show_time', resp.data.data.records) + context.commit('update_status_start', 'Y') + if (prm.pre_id) { + context.dispatch("load_preregister", { id: context.state.order_id }) + } + } + + } + } catch (e) { + + } + + }, + async getbarcode(context, prm) { + context.commit("update_get_data_status", 1) + try { + prm.token = one_token(); + console.log(prm); + let resp = await api.lookupbarcodes(prm) + if (resp.status != "OK") { + // context.commit("update_get_data_status", 3) + var snackbar = context.state.snackbar + snackbar.color = 'red' + snackbar.value = true + snackbar.multi_line = 'single-line' + snackbar.text = 'Gagal get barcode' + context.commit("update_snackbar", snackbar) + } else { + context.commit("update_get_data_status", 2) + let data = { + records: resp.data.records, + total: resp.data.total + } + let barcodes = resp.data.records + context.commit("update_patientBarcode", data.records) + let arrprm = []; + let arrprmst = []; + for (let index = 0; index < barcodes.length; index++) { + const e = barcodes[index]; + arrprm.push(e.T_BarcodeLabBarcode) + if (e.type === 'nonlab') { + arrprmst.push(e.T_SampleTypeID) + console.log('print so') + console.log("nolab so ganti group") + console.log("param ganti") + console.log("balik lagi") + // one_print_barcode_so(e.T_SampleTypeID) + } + } + if (arrprm.length > 0) { + //one_print_barcode_pk(arrprm.join(",")); + } + + if (arrprmst.length > 0) { + one_print_barcode_sov1(arrprmst.join(",")); + } + // let inp = {}; + // inp.id = prm.id; + // inp.no_lab = prm.no_lab; + // inp.name = prm.name; + // inp.register_date = prm.register_date; + // one_print_qrcode(inp); + // // console.log("Input prm") + // // console.log(inp) + // console.log("print barcode new") + // console.log(inp) + // one_print_qrcode_patient(inp); + + } + } catch (e) { + console.log(e) + // context.commit("update_get_data_status", 3) + } + } + + } +} diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/modules/other.js b/test/vuex/one-fo-registration-walk-in-stemcell/modules/other.js new file mode 100644 index 0000000..59b9407 --- /dev/null +++ b/test/vuex/one-fo-registration-walk-in-stemcell/modules/other.js @@ -0,0 +1,209 @@ +// 1 => LOADING +// 2 => DONE +// 3 => ERROR +import * as api from "../api/other.js" + +export default { + namespaced: true, + state: { + search : '', + search_status: 0, + search_error_message: "", + + sex: [], + total_sex: 0, + selected_sex: {}, + + title: [], + total_title: 0, + selected_title: {}, + + banks: [], + accounts: [], + cards: [], + + religions: [], + total_religion: 0, + selected_religion: {}, + + mounted: 0 + }, + mutations: { + update_title(state, val) { + state.title=val + }, + update_search(state, val) { + state.search=val + }, + update_search_error_message(state,status) { + state.search_error_message = status + }, + update_search_status(state,status) { + state.search_status = status + }, + update_sex(state, data) { + state.sex = data.records + state.total_sex = data.total + }, + update_selected_sex(state, doc) { + state.selected_sex = doc + if (doc.title) { + state.title = doc.title + } else { + state.title = [] + } + }, + update_selected_title(state, doc) { + state.selected_title = doc + }, + + update_banks(state, d) { + state.banks = d.records + }, + + update_cards(state, d) { + state.cards = d.records + }, + + update_accounts(state, d) { + state.accounts = d.records + }, + + update_religion(state, data) { + state.religions = data.records + state.total_religion = data.total + }, + + update_selected_religion(state, doc) { + state.selected_religion = doc + } + }, + actions: { + + async search_sex(context) { + context.commit("update_search_status", 1) + try { + let resp= await api.search_sex(context.state.search) + if (resp.status != "OK") { + context.commit("update_search_status", 3) + context.commit("update_search_error_message",resp.message) + } else { + context.commit("update_search_status",2) + context.commit("update_search_error_message","") + let data = { + total : resp.data.total, + records : resp.data.records + } + context.commit("update_sex", data) + } + } catch(e) { + context.commit("update_search_status",3) + context.commit("update_search_error_message",e.message ) + } + }, + + async search_religion(context) { + console.log('search_religion') + context.commit("update_search_status", 1) + try { + let resp= await api.search_religion({token:window.one_token()}) + if (resp.status != "OK") { + context.commit("update_search_status", 3) + context.commit("update_search_error_message", resp.message) + } else { + context.commit("update_search_status",2) + context.commit("update_search_error_message","") + let data = { + total : resp.data.total, + records : resp.data.records + } + context.commit("update_religion", data) + } + } catch(e) { + context.commit("update_search_status",3) + context.commit("update_search_error_message",e.message ) + } + }, + + async search_bank(context) { + context.commit("update_search_status", 1) + try { + let resp= await api.search_bank(context.state.search, null, "Y") + if (resp.status != "OK") { + context.commit("update_search_status", 3) + context.commit("update_search_error_message",resp.message) + } else { + context.commit("update_search_status",2) + context.commit("update_search_error_message","") + let data = { + records : resp.data.records + } + context.commit("update_banks", data) + } + } catch(e) { + context.commit("update_search_status",3) + context.commit("update_search_error_message",e.message ) + } + }, + + async search_card(context) { + context.commit("update_search_status", 1) + try { + let resp= await api.search_bank(context.state.search, "Y") + if (resp.status != "OK") { + context.commit("update_search_status", 3) + context.commit("update_search_error_message",resp.message) + } else { + context.commit("update_search_status",2) + context.commit("update_search_error_message","") + let data = { + records : resp.data.records + } + context.commit("update_cards", data) + } + } catch(e) { + context.commit("update_search_status",3) + context.commit("update_search_error_message",e.message ) + } + }, + + async search_accounts(context) { + context.commit("update_search_status", 1) + try { + let resp= await api.search_accounts(context.state.search) + if (resp.status != "OK") { + context.commit("update_search_status", 3) + context.commit("update_search_error_message",resp.message) + } else { + context.commit("update_search_status",2) + context.commit("update_search_error_message","") + let data = { + records : resp.data.records + } + context.commit("update_accounts", data) + } + } catch(e) { + context.commit("update_search_status",3) + context.commit("update_search_error_message",e.message ) + } + }, + async get_titles(context, prm) { + context.commit("update_search_status", 1) + try { + prm.token = window.one_token() + let resp= await api.get_titles(prm) + if (resp.status != "OK") { + context.commit("update_search_status", 3) + context.commit("update_search_error_message",resp.message) + } else { + context.commit("update_search_status",2) + context.commit("update_search_error_message","") + context.commit("update_title", resp.data.records) + } + } catch(e) { + context.commit("update_search_status",3) + context.commit("update_search_error_message",e.message ) + } + } + } +} diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/modules/patient.js b/test/vuex/one-fo-registration-walk-in-stemcell/modules/patient.js new file mode 100644 index 0000000..5c065c6 --- /dev/null +++ b/test/vuex/one-fo-registration-walk-in-stemcell/modules/patient.js @@ -0,0 +1,485 @@ +// 1 => LOADING +// 2 => DONE +// 3 => ERROR +import * as api from "../api/patient.js" +window.api = api + +export default { + namespaced: true, + state: { + noreg:'', + search: '', + search_status:0, + search_error_message:'', + search_dialog_is_active: false, + patients: [], + total_patient: 0, + total_display: 0, + selected_patient: {}, + + patient_new: {}, + patient_new_dialog_is_active: false, + + idtypes: [{id:'NNIDN',name:'KTP'},{id:'PPN',name:'Passport'}], + selected_idtype: {id:'NNIDN',name:'KTP'}, + current_page:1, + edit: false, + dialog_birthday:false, + show_more:true, + loading:false, + update_autocomplete_status:false, + regions:[], + selected_region:{}, + countries:[], + selected_country:{}, + search_country:'', + act:'', + selected_gender:{}, + genders:[{id:'male',name:'Laki-laki'},{id:'female',name:'Perempuan'},{id:'other',name:'Lainnya'}], + corporates:[], + selected_corporate:{}, + loading_corporate:false, + blood_types:[], + selected_blood_type:{}, + loading_blood_type:false, + blood_rh_types:[], + selected_blood_rh_type:{}, + loading_blood_rh_type:false, + education_types:[], + selected_education_type:{}, + loading_education_type:false, + etnic_types:[], + selected_etnic_type:{}, + loading_etnic_type:false, + icd10:[], + selected_icd10:{}, + loading_icd10:false + }, + mutations: { + update_loading_icd10(state,val) { + state.loading_icd10 = val + }, + update_blood_types(state,val) { + state.blood_types = val + }, + update_selected_blood_type(state,val) { + state.selected_blood_type = val + }, + update_loading_blood_type(state,val) { + state.loading_blood_type = val + }, + update_blood_rh_types(state,val) { + state.blood_rh_types = val + }, + update_selected_blood_rh_type(state,val) { + state.selected_blood_rh_type = val + }, + update_loading_blood_rh_type(state,val) { + state.loading_blood_rh_type = val + }, + update_education_types(state,val) { + state.education_types = val + }, + update_selected_education_type(state,val) { + state.selected_education_type = val + }, + update_loading_education_type(state,val) { + state.loading_education_type = val + }, + update_etnic_types(state,val) { + state.etnic_types = val + }, + update_selected_etnic_type(state,val) { + state.selected_etnic_type = val + }, + update_loading_etnic_type(state,val) { + state.loading_etnic_type = val + }, + update_loading_corporate(state,val) { + state.loading_corporate = val + }, + update_corporates(state,val) { + state.corporates = val + }, + update_selected_corporate(state,val) { + state.selected_corporate = val + }, + update_genders(state,val) { + state.genders = val + }, + update_selected_gender(state,val) { + state.selected_gender = val + }, + update_act(state,val) { + state.act = val + }, + update_search_country(state,val) { + state.search_country = val + }, + update_countries(state,val) { + state.countries = val + }, + update_selected_country(state,val) { + state.selected_country = val + }, + update_regions(state,val) { + state.regions = val + }, + update_selected_region(state,val) { + state.selected_region = val + }, + update_autocomplete_status(state,val) { + state.update_autocomplete_status = val + }, + update_icd10(state,val) { + state.icd10 = val + }, + update_selected_icd10(state,val) { + state.selected_icd10 = val + }, + update_loading(state,status) { + state.loading = status + }, + update_show_more(state,status) { + state.show_more = status + }, + update_current_page(state,status) { + state.current_page = status + }, + update_dialog_birthday(state,status) { + state.dialog_birthday = status + }, + update_search_dialog_is_active(state,status) { + state.search_dialog_is_active = status + }, + update_search_error_message(state,status) { + state.search_error_message = status + }, + update_noreg(state,val) { + state.noreg=val + }, + update_search(state,val) { + state.search=val + }, + update_search_status(state,status) { + state.search_status = status + }, + update_patients(state,data) { + state.patients= data.records + state.total_patient = data.total + //state.total_display = data.total_display + }, + update_selected_patient(state,val) { + var now = moment(new Date()) + var dob = moment(new Date(val.M_PatientDOB)) + var year = now.diff(dob,'years') + dob.add(year,'years') + var month = now.diff(dob,'months') + dob.add(month,'months') + var day = now.diff(dob,'days') + if (isNaN(year)) val.patient_age = '' + else val.patient_age = `${year} tahun ${month} bulan ${day} hari` + + state.selected_patient=val + // store.state.patientaddress.patient_id = val.M_PatientID + + // photo + + }, + + update_patient_new(state, v) { + state.patient_new = v + }, + + update_patient_new_dialog_is_active(state, v) { + state.patient_new_dialog_is_active = v + }, + + update_idtypes(state, v) { + state.idtypes = v.records + }, + + update_selected_idtype(state, v) { + state.selected_idtype = v + }, + + update_edit(state, v) { + state.edit = v + } + }, + actions: { + async search(context, prm) { + context.commit("update_search_status",1) + try { + //context.commit("update_loading",true) + let resp= await api.search(context.state.noreg,context.state.search,context.state.current_page) + if (resp.status != "OK") { + context.commit("update_search_status",3) + context.commit("update_search_error_message",resp.message) + } else { + context.commit("update_search_status",2) + context.commit("update_search_error_message","") + let data = { + records : resp.data.records, + total: resp.data.total + } + context.commit("update_loading",false) + if (prm && prm.use) + context.commit("update_patients",{records : [],total:0}) + + if(data.records.length > 0){ + if(context.state.patients.length > 0){ + var data_before = context.state.patients + var idx_last = data_before.length - 1 + data_before[idx_last].divider = 'Y' + data.records.forEach(function(entry) { + data_before.push(entry) + }) + context.commit("update_patients",{records : data_before,total:data_before.length}) + } + else{ + context.commit("update_patients",data) + } + + context.commit("update_show_more",true) + } + else{ + context.commit("update_show_more",false) + context.commit("update_current_page",1) + } + + if (prm) + if (prm.use) { + let pat = context.state.patients[prm.use_idx] + console.log(pat) + context.commit('update_selected_patient', pat) + if(pat.info.birthday == 'Y') + context.commit('update_dialog_birthday', true) + + context.commit('order/update_patient_note', pat.M_PatientNote, {root:true}) + context.dispatch('delivery/search_deliveries',{type:'patient',id:pat.M_PatientID},{root:true}) + + context.commit('photo/update_patient_id', pat.M_PatientID, {root: true}) + } + } + } catch(e) { + context.commit("update_loading",false) + context.commit("update_search_status",3) + context.commit("update_search_error_message",e.message ) + } + }, + + async add_new(context, prm) { + context.commit("update_search_status",1) + try { + + let resp + if (context.state.edit){ + resp = await api.edit(prm, context.state.selected_patient.M_PatientID) + + } + else + resp = await api.add_new(prm) + + if (resp.status != "OK") { + context.commit("update_search_status",3) + context.commit("update_search_error_message", resp.message) + } else { + context.commit("update_search_status",2) + context.commit("update_search_error_message","") + + if (prm.use) { + context.commit('update_noreg', resp.data.noreg) + context.commit('update_search', '') + + context.dispatch('search', {use:true, use_idx:0}) + context.dispatch('delivery/search_deliveries',{type:'patient',id:resp.data.id},{root:true}) + + } + + // commit("patientaddress/test", "X", { root: true }) + } + } catch(e) { + context.commit("update_search_status",3) + context.commit("update_search_error_message",e.message ) + } + }, + + async search_idtype(context) { + context.commit("update_search_status",1) + try { + let resp= await api.search_idtype() + if (resp.status != "OK") { + context.commit("update_search_status",3) + context.commit("update_search_error_message",resp.message) + } else { + context.commit("update_search_status",2) + context.commit("update_search_error_message","") + + let data = { + records : resp.data.records + } + + context.commit("update_idtypes", data) + } + } catch(e) { + context.commit("update_search_status",3) + context.commit("update_search_error_message",e.message ) + } + }, + async searchregion(context, prm) { + context.commit("update_loading",true) + try { + let resp= await api.searchregion(prm) + if (resp.status != "OK") { + context.commit("update_loading",false) + context.commit("update_search_error_message",resp.message) + } else { + context.commit("update_loading",false) + context.commit("update_search_error_message","") + context.commit("update_regions", resp.data.records) + } + } catch(e) { + context.commit("update_loading",false) + context.commit("update_search_error_message",e.message ) + } + }, + async search_countries(context, prm) { + context.commit("update_loading",true) + try { + let resp= await api.search_countries(prm) + if (resp.status != "OK") { + context.commit("update_loading",false) + context.commit("update_search_error_message",resp.message) + } else { + context.commit("update_loading",false) + context.commit("update_search_error_message","") + context.commit("update_countries", resp.data.records) + } + } catch(e) { + context.commit("update_loading",false) + context.commit("update_search_error_message",e.message ) + } + }, + async search_corporate(context, prm) { + context.commit("update_loading_corporate",true) + try { + let resp= await api.search_corporate(prm) + if (resp.status != "OK") { + context.commit("update_loading_corporate",false) + context.commit("update_search_error_message",resp.message) + } else { + context.commit("update_loading_corporate",false) + context.commit("update_search_error_message","") + context.commit("update_corporates", resp.data.records) + } + } catch(e) { + context.commit("update_loading_corporate",false) + context.commit("update_search_error_message",e.message ) + } + }, + async search_blood_type(context, prm) { + context.commit("update_loading_blood_type",true) + try { + let resp= await api.search_blood_type(prm) + if (resp.status != "OK") { + context.commit("update_loading_blood_type",false) + context.commit("update_search_error_message",resp.message) + } else { + context.commit("update_loading_blood_type",false) + context.commit("update_search_error_message","") + context.commit("update_blood_types", resp.data.records) + } + } catch(e) { + context.commit("update_loading_blood_type",false) + context.commit("update_search_error_message",e.message ) + } + }, + async search_education_type(context, prm) { + context.commit("update_loading_education_type",true) + try { + let resp= await api.search_education_type(prm) + if (resp.status != "OK") { + context.commit("update_loading_education_type",false) + context.commit("update_search_error_message",resp.message) + } else { + context.commit("update_loading_education_type",false) + context.commit("update_search_error_message","") + context.commit("update_education_types", resp.data.records) + } + } catch(e) { + context.commit("update_loading_education_type",false) + context.commit("update_search_error_message",e.message ) + } + }, + async search_blood_rh_type(context, prm) { + context.commit("update_loading_blood_type",true) + try { + let resp= await api.search_blood_rh_type(prm) + if (resp.status != "OK") { + context.commit("update_loading_blood_rh_type",false) + context.commit("update_search_error_message",resp.message) + } else { + context.commit("update_loading_blood_rh_type",false) + context.commit("update_search_error_message","") + context.commit("update_blood_rh_types", resp.data.records) + } + } catch(e) { + context.commit("update_loading_blood_rh_type",false) + context.commit("update_search_error_message",e.message ) + } + }, + async search_etnic_type(context, prm) { + context.commit("update_loading_etnic_type",true) + try { + let resp= await api.search_etnic_type(prm) + if (resp.status != "OK") { + context.commit("update_loading_etnic_type",false) + context.commit("update_search_error_message",resp.message) + } else { + context.commit("update_loading_etnic_type",false) + context.commit("update_search_error_message","") + context.commit("update_etnic_types", resp.data.records) + } + } catch(e) { + context.commit("update_loading_etnic_type",false) + context.commit("update_search_error_message",e.message ) + } + }, + async search_etnic_type(context, prm) { + context.commit("update_loading_etnic_type",true) + try { + let resp= await api.search_etnic_type(prm) + if (resp.status != "OK") { + context.commit("update_loading_etnic_type",false) + context.commit("update_search_error_message",resp.message) + } else { + context.commit("update_loading_etnic_type",false) + context.commit("update_search_error_message","") + context.commit("update_etnic_types", resp.data.records) + } + } catch(e) { + context.commit("update_loading_etnic_type",false) + context.commit("update_search_error_message",e.message ) + } + }, + async search_icd10(context, prm) { + context.commit("update_loading_icd10",true) + try { + prm.token = window.one_token() + let resp= await api.search_icd10(prm) + if (resp.status != "OK") { + context.commit("update_loading_icd10",false) + context.commit("update_search_error_message",resp.message) + } else { + context.commit("update_loading_icd10",false) + context.commit("update_search_error_message","") + context.commit("update_icd10", resp.data.records) + } + } catch(e) { + context.commit("update_loading_icd10",false) + context.commit("update_search_error_message",e.message ) + } + }, + } +} diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/modules/patientaddress.js b/test/vuex/one-fo-registration-walk-in-stemcell/modules/patientaddress.js new file mode 100644 index 0000000..c068e43 --- /dev/null +++ b/test/vuex/one-fo-registration-walk-in-stemcell/modules/patientaddress.js @@ -0,0 +1,86 @@ +// 1 => LOADING +// 2 => DONE +// 3 => ERROR +import * as api from "../api/patientaddress.js" +window.api = api + +export default { + namespaced: true, + state: { + noreg:'', + search: '', + search_status:0, + search_error_message:'', + search_dialog_is_active: false, + patients: [], + total_patient: 0, + total_display: 0, + selected_patient: {}, + + address: [], + patient_id: 0 + }, + mutations: { + update_search_dialog_is_active(state,status) { + state.search_dialog_is_active = status + }, + update_search_error_message(state,status) { + state.search_error_message = status + }, + update_noreg(state,val) { + state.noreg=val + }, + update_search(state,val) { + state.search=val + }, + update_search_status(state,status) { + state.search_status = status + }, + update_patients(state,data) { + state.patients= data.records + state.total_patient = data.total + state.total_display = data.total_display + }, + update_selected_patient(state,val) { + state.selected_patient=val + }, + + update_address(state, val) { + state.address = val; + }, + + testx(state, val) { + state.patient_id = val + } + }, + actions: { + async search(context,prm) { + context.commit("update_search_status",1) + try { + let resp= await api.getAll(context.state.patient_id) + if (resp.status != "OK") { + context.commit("update_search_status",3) + context.commit("update_search_error_message",resp.message) + } else { + context.commit("update_search_status",2) + context.commit("update_search_error_message","") + let data = resp.data; + context.commit("update_address",data) + } + } catch(e) { + context.commit("update_search_status",3) + context.commit("update_search_error_message",e.message ) + } + }, + + async loadAddress(context, prm) { + + } + }, + + methods: { + tests (a) { + alert(a) + } + } +} diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/modules/payment.js b/test/vuex/one-fo-registration-walk-in-stemcell/modules/payment.js new file mode 100644 index 0000000..077336c --- /dev/null +++ b/test/vuex/one-fo-registration-walk-in-stemcell/modules/payment.js @@ -0,0 +1,339 @@ +// 1 => LOADING +// 2 => DONE +// 3 => ERROR +import * as api from "../api/payment.js" + +export default { + namespaced: true, + state: { + order_id: 0, + + selected_patient: { + order_no: '-', + order_date: '-', + order_mou: '-', + order_company: '-', + patient_name: '-', + patient_mr: '-', + doctor_sender: '-', + doctor_sender_address: '-', + doctor_pj: '-' + }, + + order_detail: [ + // { n:1, d_id:1, t_id:1, t_name:'SGOT', t_price:80000, t_disctotal:7000, t_total:73000 }, + // { n:2, d_id:2, t_id:2, t_name:'SGPT', t_price:75000, t_disctotal:8000, t_total:67000 } + ], + order_delivery: [], + + order_subtotal: 0, + order_rounding: 0, + order_total: 0, + order_company: { + is_bill: "N", + min_dp: 0, + min_dp_rp: 0, + on_hold: "N", + on_hold_text: "" + }, + + payment_cash_amount: 0, + payment_debit_amount: 0, + payment_credit_amount: 0, + + payments: [], + payment_total: 0, + + payment_id: 0, + payment_number: '', + finish_dialog_is_active: false, + + paid: false, + savepayment:false, + promises:[] + }, + mutations: { + update_promises(state, data) { + state.promises = data + }, + update_order (state, data) { + state.selected_patient = data.order_header + context.state.order_subtotal = resp.data.order_header.order_subtotal; + context.state.order_rounding = resp.data.order_header.order_rounding; + context.state.order_total = resp.data.order_header.order_total; + context.state.order_company = { + is_bill: resp.data.order_header.M_CompanyIsBill, + min_dp: resp.data.order_header.M_CompanyMinDP, + min_dp_rp: Math.round(resp.data.order_header.M_CompanyMinDP * resp.data.order_header.order_total / 100), + on_hold: resp.data.order_header.M_CompanyIsAgingOnHold, + on_hold_text: resp.data.order_header.M_CompanyIsAgingOnHoldNote + } + + }, + + update_order_id (state, id) { + state.order_id = id + }, + update_savepayment (state, id) { + state.savepayment = id + }, + + update_payment(state, o) { + if (o.type == 'cash') + state.payment_cash_amount = o.amount + if (o.type == 'debit') + state.payment_debit_amount = o.amount + if (o.type == 'credit') + state.payment_credit_amount = o.amount + }, + + update_payments(state, o) { + state.payments = o + + // Total payments + let total = 0 + for (let i in o) { + o[i].payment_actual = Math.round(o[i].payment_actual) + total += o[i].payment_actual + } + + state.payment_total = total + + // Calculate change + for (let i in o) { + o[i].payment_amount = o[i].payment_actual + + if (o[i].payment_type_code == 'CASH') { + o[i].payment_change = 0 + let chg = total - state.order_total; + + if (chg > o[i].payment_actual) + chg = o[i].payment_actual + if (chg < 0) + chg = 0 + + o[i].payment_change = chg + + // re-calculate payment amount + o[i].payment_amount = o[i].payment_actual - o[i].payment_change + state.payment_total -= chg + } + } + + state.payments = o + }, + + reset_payment(state) { + state.payment_total = 0 + }, + + update_finish_dialog_is_active(state, val) { + state.finish_dialog_is_active = val + }, + + update_payment_number(state, val) { + state.payment_number = val + }, + + update_payment_id(state, val) { + state.payment_id = val + }, + + update_paid(state, val) { + state.paid = val + }, + + update_order_company(state, val) { + state.order_company = val + } + }, + actions: { + async get_order(context, prm) { + // context.commit("update_search_status",1) + try { + let resp= await api.get_order(prm) + if (resp.status != "OK") { + // context.commit("update_search_status",3) + // context.commit("update_search_error_message",resp.message) + } else { + // context.commit("update_search_status",2) + // context.commit("update_search_error_message","") + let data = resp.data.data + context.commit("update_order", data) + + // commit("patientaddress/test", "X", { root: true }) + } + } catch(e) { + // context.commit("update_search_status",3) + // context.commit("update_search_error_message",e.message ) + } + }, + + async search(context, prm) { + // context.commit("update_search_status",1) + try { + let resp= await api.search(prm) + if (resp.status != "OK") { + // context.commit("update_search_status",3) + // context.commit("update_search_error_message",resp.message) + } else { + // context.commit("update_search_status",2) + // context.commit("update_search_error_message","") + let data = resp.data + context.commit("update_payments", data) + + // commit("patientaddress/test", "X", { root: true }) + } + } catch(e) { + // context.commit("update_search_status",3) + // context.commit("update_search_error_message",e.message ) + } + }, + + async save(context) { + context.state.savepayment = true + console.log('disabled payment') + console.log(context.state.savepayment) + var order_id = context.state.order_id; + let payments = [] + let p = context.state.payments + for (let i in context.state.payments) { + if (Math.round(p[i].payment_amount) == 0) + continue; + + payments.push({ + type: p[i].payment_type_id, + amount: p[i].payment_amount, + actual: p[i].payment_actual, + changes: p[i].payment_change, + note: p[i].payment_note, + card: p[i].payment_card_id, + edc: p[i].payment_edc_id, + account: p[i].payment_account_id + }) + } + + // context.commit("update_search_status",1) + try { + let resp= await api.save(one_token(), order_id, payments) + + if (resp.status != "200") { + // context.commit("update_search_status",3) + // context.commit("update_search_error_message",resp.message) + alert('error') + context.state.savepayment = false + } else { + context.state.savepayment = false + context.commit('update_payment_number', resp.data.data.payment_number) + context.commit('update_payment_id', resp.data.data.payment_id) + context.commit('update_finish_dialog_is_active', true) + context.commit('update_paid', true) + } + } catch(e) { + // context.commit("update_search_status",3) + // context.commit("update_search_error_message",e.message ) + } + }, + + async print_nota (context, a) { + let usr = one_user() + console.log("yesy nota") + console.log(usr) + let ts = Date.now() / 1000 | 0 + let x = context.rootState.company.selected_mou + let rpt_url = '/birt/run?__report=report/onelab/fo/rpt_t_003.rptdesign&PID='+a+'&username='+usr.M_StaffName+'&__format=pdf&ts='+ts + if (x.M_MouIsBill == 'Y') + rpt_url = '/birt/run?__report=report/onelab/fo/rpt_t_006.rptdesign&__format=pdf&username='+usr.M_StaffName+'&PID='+a+'&ts='+ts + + context.commit('order/update_rpt_url', window.BASE_URL + rpt_url, {root:true}) + context.commit('order/update_print_dialog_is_active', true, {root:true}) + }, + + async print_notain (context, a) { + let usr = one_user() + console.log("yesy nota") + console.log(usr) + let ts = Date.now() / 1000 | 0 + let x = context.rootState.company.selected_mou + let rpt_url = '/birt/run?__report=report/onelab/fo/rpt_t_003i.rptdesign&PID='+a+'&username='+usr.M_StaffName+'&__format=pdf&ts='+ts + if (x.M_MouIsBill == 'Y') + rpt_url = '/birt/run?__report=report/onelab/fo/rpt_t_006.rptdesign&__format=pdf&username='+usr.M_StaffName+'&PID='+a+'&ts='+ts + + context.commit('order/update_rpt_url', window.BASE_URL + rpt_url, {root:true}) + context.commit('order/update_print_dialog_is_active', true, {root:true}) + }, + + async print_invoice (context, a) { + let usr = one_user() + console.log("yesy invoice") + console.log(usr) + context.commit('order/update_rpt_url', window.BASE_URL + '/birt/run?__report=report/onelab/fo/rpt_t_001.rptdesign&PID='+a+'&username='+usr.M_StaffName+'&__format=pdf', {root:true}) + context.commit('order/update_print_dialog_is_active', true, {root:true}) + }, + + async print_control_xx (context, a) { + let usr = one_user() + console.log("yesy control") + console.log(usr) + context.commit('order/update_rpt_url', window.BASE_URL + '/birt/run?__report=report/onelab/lab/rpt_fo_001.rptdesign&PID='+a+'&username='+usr.M_StaffName+'&__format=pdf', {root:true}) + context.commit('order/update_print_dialog_is_active', true, {root:true}) + }, + async reset (context, prm) { + try { + //alert("acacadvadv") + prm.token = one_token() + let resp= await api.endshowtime(prm) + if (resp.data.status != "OK") { + console.log(resp.data.message) + //alert('stop') + } else { + var url_string = window.location.href + var url = new URL(url_string); + var pre_id = url.searchParams.get("pre_id") + var mcuid = url.searchParams.get("mcuid") + console.log(pre_id) + //alert('cdcadscsdvds') + let x_url = url + x_url.searchParams.delete("pre_id") + x_url.searchParams.delete("mcuid") + x_url.searchParams.delete("type") + if(prm.type == 'pay'){ + let url_cashier = context.rootState.order.current_order.url_menu_cashier+'?nolab='+context.rootState.order.current_order.noreg; + location.replace('/one-ui/'+url_cashier) + }else{ + location.reload() + } + } + } catch(e) { + + } + + }, + async print_control (context, prm) { + let usr = one_user() + console.log("yesy control") + console.log(usr) + context.commit('order/update_rpt_url', window.BASE_URL + '/birt/run?__report=report/onelab/lab/rpt_fo_001.rptdesign&PID='+prm.order_id+'&username='+usr.M_StaffName+'&__format=pdf', {root:true}) + context.commit('order/update_print_dialog_is_active', true, {root:true}) + + }, + async get_details_order(context, prm) { + try { + prm.token = one_token(); + let resp = await api.get_details_order(prm); + if(resp.status == 'OK'){ + context.state.order_detail = resp.data.order_detail; + context.state.order_delivery = resp.data.order_delivery; + context.state.promises = resp.data.order_promise; + } + else{ + context.commit("update_message_error", resp.message); + context.commit("update_dialog_pop_up_error", true); + } + } catch (e) { + console.log(e) + } + } + + } +} diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/modules/payment.js-- b/test/vuex/one-fo-registration-walk-in-stemcell/modules/payment.js-- new file mode 100644 index 0000000..e89ba14 --- /dev/null +++ b/test/vuex/one-fo-registration-walk-in-stemcell/modules/payment.js-- @@ -0,0 +1,304 @@ +// 1 => LOADING +// 2 => DONE +// 3 => ERROR +import * as api from "../api/payment.js" + +export default { + namespaced: true, + state: { + order_id: 0, + + selected_patient: { + order_no: '-', + order_date: '-', + order_mou: '-', + order_company: '-', + patient_name: '-', + patient_mr: '-', + doctor_sender: '-', + doctor_sender_address: '-', + doctor_pj: '-' + }, + + order_detail: [ + // { n:1, d_id:1, t_id:1, t_name:'SGOT', t_price:80000, t_disctotal:7000, t_total:73000 }, + // { n:2, d_id:2, t_id:2, t_name:'SGPT', t_price:75000, t_disctotal:8000, t_total:67000 } + ], + order_delivery: [], + + order_subtotal: 0, + order_rounding: 0, + order_total: 0, + order_company: { + is_bill: "N", + min_dp: 0, + min_dp_rp: 0, + on_hold: "N", + on_hold_text: "" + }, + + payment_cash_amount: 0, + payment_debit_amount: 0, + payment_credit_amount: 0, + + payments: [], + payment_total: 0, + + payment_id: 0, + payment_number: '', + finish_dialog_is_active: false, + + paid: false, + savepayment:false + }, + mutations: { + update_order (state, data) { + state.selected_patient = data.order_header + state.order_detail = data.order_detail + state.order_delivery = data.order_delivery + + state.order_subtotal = data.order_header.order_subtotal + state.order_rounding = data.order_header.order_rounding + state.order_total = data.order_header.order_total + + state.order_company = { + is_bill: data.order_header.M_CompanyIsBill, + min_dp: data.order_header.M_CompanyMinDP, + min_dp_rp: Math.round(data.order_header.M_CompanyMinDP * data.order_header.order_total / 100), + on_hold: data.order_header.M_CompanyIsAgingOnHold, + on_hold_text: data.order_header.M_CompanyIsAgingOnHoldNote + } + }, + + update_order_id (state, id) { + state.order_id = id + }, + update_savepayment (state, id) { + state.savepayment = id + }, + + update_payment(state, o) { + if (o.type == 'cash') + state.payment_cash_amount = o.amount + if (o.type == 'debit') + state.payment_debit_amount = o.amount + if (o.type == 'credit') + state.payment_credit_amount = o.amount + }, + + update_payments(state, o) { + state.payments = o + + // Total payments + let total = 0 + for (let i in o) { + o[i].payment_actual = Math.round(o[i].payment_actual) + total += o[i].payment_actual + } + + state.payment_total = total + + // Calculate change + for (let i in o) { + o[i].payment_amount = o[i].payment_actual + + if (o[i].payment_type_code == 'CASH') { + o[i].payment_change = 0 + let chg = total - state.order_total; + + if (chg > o[i].payment_actual) + chg = o[i].payment_actual + if (chg < 0) + chg = 0 + + o[i].payment_change = chg + + // re-calculate payment amount + o[i].payment_amount = o[i].payment_actual - o[i].payment_change + state.payment_total -= chg + } + } + + state.payments = o + }, + + reset_payment(state) { + state.payment_total = 0 + }, + + update_finish_dialog_is_active(state, val) { + state.finish_dialog_is_active = val + }, + + update_payment_number(state, val) { + state.payment_number = val + }, + + update_payment_id(state, val) { + state.payment_id = val + }, + + update_paid(state, val) { + state.paid = val + }, + + update_order_company(state, val) { + state.order_company = val + } + }, + actions: { + async get_order(context, prm) { + // context.commit("update_search_status",1) + try { + let resp= await api.get_order(prm) + if (resp.status != "OK") { + // context.commit("update_search_status",3) + // context.commit("update_search_error_message",resp.message) + } else { + // context.commit("update_search_status",2) + // context.commit("update_search_error_message","") + let data = resp.data.data + context.commit("update_order", data) + + // commit("patientaddress/test", "X", { root: true }) + } + } catch(e) { + // context.commit("update_search_status",3) + // context.commit("update_search_error_message",e.message ) + } + }, + + async search(context, prm) { + // context.commit("update_search_status",1) + try { + let resp= await api.search(prm) + if (resp.status != "OK") { + // context.commit("update_search_status",3) + // context.commit("update_search_error_message",resp.message) + } else { + // context.commit("update_search_status",2) + // context.commit("update_search_error_message","") + let data = resp.data + context.commit("update_payments", data) + + // commit("patientaddress/test", "X", { root: true }) + } + } catch(e) { + // context.commit("update_search_status",3) + // context.commit("update_search_error_message",e.message ) + } + }, + + async save(context) { + context.state.savepayment = true + console.log('disabled payment') + console.log(context.state.savepayment) + var order_id = context.state.order_id; + let payments = [] + let p = context.state.payments + for (let i in context.state.payments) { + if (Math.round(p[i].payment_amount) == 0) + continue; + + payments.push({ + type: p[i].payment_type_id, + amount: p[i].payment_amount, + actual: p[i].payment_actual, + changes: p[i].payment_change, + note: p[i].payment_note, + card: p[i].payment_card_id, + edc: p[i].payment_edc_id, + account: p[i].payment_account_id + }) + } + + // context.commit("update_search_status",1) + try { + let resp= await api.save(one_token(), order_id, payments) + + if (resp.status != "200") { + // context.commit("update_search_status",3) + // context.commit("update_search_error_message",resp.message) + alert('error') + context.state.savepayment = false + } else { + context.state.savepayment = false + context.commit('update_payment_number', resp.data.data.payment_number) + context.commit('update_payment_id', resp.data.data.payment_id) + context.commit('update_finish_dialog_is_active', true) + context.commit('update_paid', true) + } + } catch(e) { + // context.commit("update_search_status",3) + // context.commit("update_search_error_message",e.message ) + } + }, + + async print_nota (context, a) { + let usr = one_user() + console.log("yesy nota") + console.log(usr) + let ts = Date.now() / 1000 | 0 + let x = context.rootState.company.selected_mou + let rpt_url = '/birt/run?__report=report/onelab/fo/rpt_t_003.rptdesign&PID='+a+'&username='+usr.M_UserUsername+'&__format=pdf&ts='+ts + if (x.M_MouIsBill == 'Y') + rpt_url = '/birt/run?__report=report/onelab/fo/rpt_t_006.rptdesign&__format=pdf&username='+usr.M_UserUsername+'&PID='+a+'&ts='+ts + + context.commit('order/update_rpt_url', window.BASE_URL + rpt_url, {root:true}) + context.commit('order/update_print_dialog_is_active', true, {root:true}) + }, + + async print_notain (context, a) { + let usr = one_user() + console.log("yesy nota") + console.log(usr) + let ts = Date.now() / 1000 | 0 + let x = context.rootState.company.selected_mou + let rpt_url = '/birt/run?__report=report/onelab/fo/rpt_t_003i.rptdesign&PID='+a+'&username='+usr.M_UserUsername+'&__format=pdf&ts='+ts + if (x.M_MouIsBill == 'Y') + rpt_url = '/birt/run?__report=report/onelab/fo/rpt_t_006.rptdesign&__format=pdf&username='+usr.M_UserUsername+'&PID='+a+'&ts='+ts + + context.commit('order/update_rpt_url', window.BASE_URL + rpt_url, {root:true}) + context.commit('order/update_print_dialog_is_active', true, {root:true}) + }, + + async print_invoice (context, a) { + let usr = one_user() + console.log("yesy invoice") + console.log(usr) + context.commit('order/update_rpt_url', window.BASE_URL + '/birt/run?__report=report/onelab/fo/rpt_t_001.rptdesign&PID='+a+'&username='+usr.M_UserUsername+'&__format=pdf', {root:true}) + context.commit('order/update_print_dialog_is_active', true, {root:true}) + }, + + async print_control_xx (context, a) { + let usr = one_user() + console.log("yesy control") + console.log(usr) + context.commit('order/update_rpt_url', window.BASE_URL + '/birt/run?__report=report/onelab/lab/rpt_fo_001.rptdesign&PID='+a+'&username='+usr.M_UserUsername+'&__format=pdf', {root:true}) + context.commit('order/update_print_dialog_is_active', true, {root:true}) + }, + async reset (context, prm) { + try { + prm.token = one_token() + let resp= await api.endshowtime(prm) + if (resp.data.status != "OK") { + + } else { + location.reload() + } + } catch(e) { + + } + + }, + async print_control (context, prm) { + let usr = one_user() + console.log("yesy control") + console.log(usr) + context.commit('order/update_rpt_url', window.BASE_URL + '/birt/run?__report=report/onelab/lab/rpt_fo_001.rptdesign&PID='+prm.order_id+'&username='+usr.M_UserUsername+'&__format=pdf', {root:true}) + context.commit('order/update_print_dialog_is_active', true, {root:true}) + + } + + } +} diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/modules/photo.js b/test/vuex/one-fo-registration-walk-in-stemcell/modules/photo.js new file mode 100644 index 0000000..32212b2 --- /dev/null +++ b/test/vuex/one-fo-registration-walk-in-stemcell/modules/photo.js @@ -0,0 +1,51 @@ +// 1 => LOADING +// 2 => DONE +// 3 => ERROR +import * as api from "../api/photo.js" +window.api = api + +export default { + namespaced: true, + state: { + dialog_photo: false, + photo_64: '', + photo_url: '/one-ui/no-profile-male-img.gif', + default_photo_url: '/one-ui/no-profile-male-img.gif', + patient_id: 0 + }, + mutations: { + update_dialog_photo (state, v) { + state.dialog_photo = v + }, + + update_photo_64 (state, data) { + state.photo_64 = data + }, + + update_photo_url (state, data) { + state.photo_url = data + }, + + update_patient_id (state, id) { + state.patient_id = id + } + }, + actions: { + async upload(context) { + + try { + console.log(context.rootState.patient.selected_patient) + let resp = await api.upload(one_token(), context.rootState.patient.selected_patient.M_PatientID, context.state.photo_64) + + if (resp.status != "OK") { + + } else { + context.commit('update_photo_url', resp.data.photo_url); + context.commit('update_dialog_photo', false) + } + } catch(e) { + console.log(e) + } + } + } +} diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/modules/px.js b/test/vuex/one-fo-registration-walk-in-stemcell/modules/px.js new file mode 100644 index 0000000..2916802 --- /dev/null +++ b/test/vuex/one-fo-registration-walk-in-stemcell/modules/px.js @@ -0,0 +1,794 @@ +// 1 => LOADING +// 2 => DONE +// 3 => ERROR +import * as api from "../api/px.js" + +export default { + namespaced: true, + state: { + search: '', + search_token: {}, + search_status:0, + search_error_message:'', + tests: [], + total_test: 0, + selected_test: [], + + search_panel: '', + search_panel_status:0, + panels: [], + total_panel: 0, + selected_panel: [], + requirement: [], + appx_schedule: '', + + search_profile: '', + profiles: [], + total_profile: 0, + + cito: {test:[], panel:[]}, + nat_test: [], + + req_status: "X", + reqs: [], + + citos: [], + selected_cito: null, + is_cito: "N", + loading_promise: false, + promise_by_pxs: [] + }, + mutations: { + update_promise_by_pxs(state, val) { + state.promise_by_pxs = val + }, + update_loading_promise(state, val) { + state.loading_promise = val + }, + update_search_token(state, val) { + state.search_token = val + }, + update_requirement(state,val) { + state.requirement = val + }, + update_search_error_message(state,status) { + state.search_error_message = status + }, + update_selected_test(state,val) { + // if (state.cito.length > 0) { + for (var i in val) { + val[i]['T_TestIsCito'] = 'N' + if (state.cito.test.indexOf(val[i]['T_TestID']) > -1) + val[i]['T_TestIsCito'] = 'Y' + } + // } + + state.selected_test = val + }, + update_mouCompanyID(state,val) { + state.mouCompanyID=val + }, + update_search(state,val) { + state.search=val + }, + update_search_status(state,status) { + state.search_status = status + }, + update_tests(state,data) { + state.tests= data.records + state.total_test= data.total + }, + update_search_panel(state,val) { + state.search_panel=val + }, + update_search_panel_status(state,status) { + state.search_panel_status = status + }, + update_panels(state,data) { + state.panels = data.records + state.total_panel = data.total + }, + update_selected_panel(state,val) { + state.selected_panel= val + }, + + update_cito(state, val) { + let test = state.selected_test + let cito = state.cito + // if (val.length > 0) { + + for (var i in test) { + test[i]['T_TestIsCito'] = 'N' + if (val.v.indexOf(test[i]['T_TestID']) > -1) + test[i]['T_TestIsCito'] = 'Y' + } + + // } + + cito[val.t] = val.v + console.log(cito) + state.cito = cito + state.selected_test = test + }, + + update_appx_schedule(state, v) { + state.appx_schedule = v + }, + + update_search_profile(state, v) { + state.search_profile = v + }, + + update_profiles(state, data) { + state.profiles = data.records + state.total_profile = data.total + }, + + update_nat_test(state) { + let px = state.selected_test + let nt = [] + for (let i in px) { + for (let j in px[i].nat_test) { + nt.push(px[i].nat_test[j]) + } + } + + state.nat_test = nt + }, + + update_req_status(state, val) { + state.req_status = val + }, + + update_reqs(state, val) { + state.reqs = val + }, + + update_citos(state, val) { + state.citos = val.records + }, + + update_selected_cito(state, val) { + state.selected_cito = val + }, + + update_is_cito(state, val) { + state.is_cito = val + } + }, + actions: { + async packet_reqs(context,prm) { + console.log(prm) + context.commit("update_search_panel_status",1) + try { + prm.token = one_token() + let resp= await api.packet_reqs(prm) + if (resp.status != "OK") { + context.commit("update_search_panel_status",3) + context.commit("update_search_error_message",resp.message) + } else { + context.commit("update_search_panel_status",2) + context.commit("update_search_error_message","") + + let req = resp.data + console.log(req) + let reqs = context.state.requirement + if (req.length > 0) { + for(let i in req) { + let found = false + for(let j in reqs) { + if (reqs[j]['req_id'] == req[i]['req_id']) + found = j + } + + if (!found){ + reqs.push({ + px_id: req[i]['tests'], + label: req[i]['req_name'], + error_message: 'Hasil harus di isi', + is_error: true, + checked : false, + note: '', + req_id: req[i]['req_id'] + }) + } + else{ + if(req[i]['tests'].length > 0){ + req[i]['tests'].forEach(function(xtestid) { + if(reqs[found].px_id.indexOf(xtestid) == -1) + reqs[found].px_id.push(xtestid) + }) + } + } + + } + + context.commit('update_requirement', reqs) + console.log('selesai paket req') + context.commit('order/update_loading_data_patient', true, { root: true }) + } + } + } catch(e) { + context.commit("update_search_panel_status",3) + context.commit("update_search_error_message",e.message ) + } + }, + async get_requirement(context, test_id) { + try { + let resp = await api.get_requirement(test_id) + if (resp.status != "OK") { + return [] + } else { + return resp.data || [] + } + } catch(e) { + console.error('Error getting requirement:', e) + return [] + } + }, + delete_px (context, test) { + let sel = context.state.selected_test + sel.forEach(function(t, idx) { + if(t.T_TestID == test.T_TestID && t.px_type == test.px_type) { + sel.splice(idx,1) + } + }) + context.commit("update_selected_test", sel) + + let cito = context.state.cito.test + if(cito.length > 0){ + let cito_idx = cito.indexOf(test.T_TestID) + if (cito_idx > -1) + cito.splice(cito_idx, 1) + } + + let tests = context.state.tests + if (tests == undefined ) tests = [] + let idx_exist_test = _.findIndex(tests, function(o) { return o.T_TestID == test.T_TestID }) + if(idx_exist_test > -1){ + tests.splice(idx_exist_test, 1) + } + tests.push(test) + + + //context.dispatch("search") + let dt = { + records : tests, + total: tests.length + } + + context.commit("update_tests", dt) + context.dispatch("delete_req", test) + // context.dispatch("update_req", null) + context.dispatch("appx_schedule") + context.commit('update_nat_test') + }, + + delete_req(context, px) { + let reqs = context.state.requirement + let selectedTests = context.state.selected_test + let testIdsToRemove = new Set() // Gunakan Set untuk lookup O(1) + + // Kumpulkan semua test ID yang perlu dihapus + if(px.px_type === 'PN' && px.child_test) { + // Untuk packet, hapus semua child test IDs + px.child_test.forEach(entry => testIdsToRemove.add(entry.T_TestID)) + } else { + // Untuk test biasa, hapus test ID tersebut + testIdsToRemove.add(px.T_TestID) + } + + // Buat Set dari semua test IDs yang masih ada di selected_test (setelah dihapus) + let remainingTestIds = new Set() + selectedTests.forEach(test => { + if(!testIdsToRemove.has(test.T_TestID)) { + remainingTestIds.add(test.T_TestID) + } + }) + + // Update requirement: hapus test IDs dari px_id array + let updatedReqs = reqs.map(req => { + // Hapus test IDs yang ada di testIdsToRemove dari array px_id + req.px_id = req.px_id.filter(testId => !testIdsToRemove.has(testId)) + return req + }).filter(reqItem => { + // Hapus requirement hanya jika px_id array sudah kosong + // Tapi pastikan tidak ada test lain di selected_test yang masih menggunakan requirement dengan req_id yang sama + if(reqItem.px_id.length === 0) { + // Cek apakah masih ada test lain di selected_test yang memiliki requirement dengan req_id yang sama + // Kita perlu cek requirement dari setiap test yang masih ada + let stillInUse = false + for(let test of selectedTests) { + if(!testIdsToRemove.has(test.T_TestID) && test.requirement) { + // Cek apakah test ini memiliki requirement dengan req_id yang sama + let hasSameReq = test.requirement.some(testReq => testReq.req_id == reqItem.req_id) + if(hasSameReq) { + stillInUse = true + break + } + } + } + // Hapus requirement jika tidak ada lagi test yang menggunakannya + return stillInUse + } + return true // Keep requirement jika px_id masih ada + }) + + context.commit('update_requirement', updatedReqs) + }, + + async search(context) { + if (!one_token()) { + context.commit("update_search_status", 3) + context.commit("update_search_error_message", 'No TOKEN Found') + + context.commit('update_message_error', 'Maaf, koneksi Anda sempat terputus silahkan Log Out dan Login kembali', {root:true}) + context.commit('update_dialog_error', true, {root:true}) + return + } + + context.commit("update_search_status",1) + try { + let mouCompanyID = 0 + console.log('context.rootState.company.selected_mou', context.rootState.company.selected_mou) + if (context.rootState.company.selected_mou.price_header_id) { + mouCompanyID = context.rootState.company.selected_mou.price_header_id + } + let search_token = context.state.search_token + if (search_token.hasOwnProperty("token")) { + console.log('CancelToken', search_token.token) + search_token.cancel() + } + search_token = axios.CancelToken.source() + context.commit("update_search_token",search_token) + console.log('CancelToken Start',search_token.token) + + //clear the result 1st + let data = { + records : [], + total: 0 + } + context.commit("update_tests",data) + console.log('selesai dari px.js') + let project_id = 0 + if ( + context.rootState.company.selected_project && + context.rootState.company.selected_project.id + ) { + project_id = context.rootState.company.selected_project.id + } + + let resp = await api.search( + mouCompanyID, + context.state.search, + search_token.token, + project_id + ) + if (resp.status != "OK") { + context.commit("update_search_status",3) + context.commit("update_search_error_message",resp.message) + } else { + context.commit("update_search_status",2) + context.commit("update_search_error_message","") + let data = { + records : resp.data.records, + total: resp.data.total + } + ///////////////////////////// + var dadata = [] + var xdata = resp.data.records + let selected_test = context.state.selected_test + xdata.forEach( function(t,idx) { + if (t.px_type == "PR" ){ + var xchk = true + t.child_test.forEach( function(natx){ + var idxx =_.findIndex(selected_test, function(o) { return o.T_TestID == natx.T_TestID }) + if(idxx !== -1){ + xchk = false + } + }) + if(xchk){ + dadata.push(t) + } + } + else{ + var idxx =_.findIndex(selected_test, function(o) { return o.T_TestID == t.T_TestID }) + if(idxx === -1){ + dadata.push(t) + } + } + + }) + var newdata = { + records : dadata, + total: dadata.length + } + context.commit("update_tests",newdata) + + ////////////////////////////////////////////// + } + + } catch(e) { + context.commit("update_search_status",3) + context.commit("update_search_error_message",e.message ) + console.log(e) + } + }, + + async panel(context,prm) { + context.commit("update_search_panel_status",1) + try { + let mouCompanyID = 0 + if (context.rootState.company.selected_mou.M_MouCompanyID) { + mouCompanyID = context.rootState.company.selected_mou.M_MouCompanyID + } + let resp= await api.panel(mouCompanyID,context.state.search) + if (resp.status != "OK") { + context.commit("update_search_panel_status",3) + context.commit("update_search_error_message",resp.message) + } else { + context.commit("update_search_panel_status",2) + context.commit("update_search_error_message","") + let data = { + records : resp.data.records, + total: resp.data.total + } + context.commit("update_panels",data) + } + } catch(e) { + context.commit("update_search_panel_status",3) + context.commit("update_search_error_message",e.message ) + } + }, + async get_promise_by_pxs(context, pxs) { + context.commit("update_loading_promise", true) + try { + let prm = { + pxs: pxs, + token: one_token() + } + let resp= await api.get_promise_by_pxs(prm) + if (resp.status != "OK") { + context.commit("update_loading_promise", false) + context.commit("update_search_error_message",resp.message) + } else { + context.commit("update_loading_promise", false) + context.commit("update_search_error_message","") + let data = { + records : resp.data.records, + total: resp.data.total + } + context.commit("update_promise_by_pxs",data) + } + } catch(e) { + context.commit("update_loading_promise", false) + context.commit("update_search_error_message",e.message ) + } + }, + + async profile(context) { + context.commit("update_search_panel_status", 1) + try { + let mou_id = 0 + if (context.rootState.company.selected_mou.M_MouID) { + mou_id = context.rootState.company.selected_mou.M_MouID + } + + let resp = await api.profile(mou_id, context.state.search_profile) + if (resp.status != "OK") { + context.commit("update_search_panel_status",3) + context.commit("update_search_error_message",resp.message) + } else { + context.commit("update_search_panel_status",2) + context.commit("update_search_error_message","") + let data = { + records : resp.data.records, + total: resp.data.total + } + context.commit("update_profiles", data) + } + } catch(e) { + context.commit("update_search_panel_status",3) + context.commit("update_search_error_message",e.message ) + } + }, + + async get_price(context, prm) { + context.commit("update_search_status",1) + try { + + //let mou_id = context.rootState.company.selected_mou.M_MouID + let resp = await api.get_price(prm.test_id, prm.mou_id, prm.cito) + + if (resp.status != "OK") { + context.commit("update_search_status",3) + context.commit("update_search_error_message",resp.message) + } else { + context.commit("update_search_status",2) + context.commit("update_search_error_message","") + + let x = context.state.selected_test + console.log("kentut berot") + console.log(prm.cito) + for (let i in x) { + if (x[i].T_TestID == prm.test_id) { + if ((Math.round(resp.data.test_price) == 0 && x[i].T_TestForceSell != "Y") || + Math.round(resp.data.test_price) < 0 ) { + alert('Pemeriksaan ini belum ada harga CITO-nya !') + console.log(x[i].T_TestName) + x[i].T_TestIsCito = "N" + let n = context.state.cito.test.indexOf(x[i].T_TestID) + if (n > -1) + context.state.cito.test.splice(n, 1) + } + else { + x[i].T_PriceAmount = resp.data.test_price + x[i].T_PriceDisc = resp.data.test_disc + x[i].T_PriceDiscRp = resp.data.test_discrp + } + } + } + // context.commit('update_message_error', 'satu...dua...tiga permen manis rasanya, coba cek agreement sepertinya sudah kadaluarsa', {root:true}) + //context.commit('update_dialog_error', true, {root:true}) + + context.commit("update_selected_test", x) + context.commit("update_nat_test") + } + } catch(e) { + context.commit("update_search_status",3) + context.commit("update_search_error_message",e.message ) + + } + }, + + async appx_schedule(context) { + context.commit("update_search_status",1) + try { + + let ids = [] + let pn_ids = [] + context.commit("update_appx_schedule", '-') + + let pxs = context.state.selected_test + for (let i in pxs) { + if (pxs[i].px_type == 'PN') + pn_ids.push(pxs[i].T_TestID) + else + ids.push(pxs[i].T_TestID) + } + + let resp = await api.appx_schedule(ids.join(','), pn_ids.join(',')) + + if (resp.status != "OK") { + context.commit("update_search_status", 3) + context.commit("update_search_error_message",resp.message) + } else { + context.commit("update_search_status", 2) + context.commit("update_search_error_message","") + console.log('appx_schedule data response') + console.log(resp.data.records) + context.commit("update_appx_schedule", resp.data.records) + } + } catch(e) { + context.commit("update_search_status",3) + context.commit("update_search_error_message", e.message ) + + } + }, + + async search_cito(context) { + context.commit("update_search_status",1) + try { + let resp= await api.search_cito(one_token()) + if (resp.status != "OK") { + context.commit("update_search_status",3) + context.commit("update_search_error_message", resp.message) + } else { + context.commit("update_search_status",2) + context.commit("update_search_error_message","") + let data = { + records : resp.data.records + } + context.commit("update_citos", data) + + for (let i in data.records) + if (data.records[i].Nat_CitoIsDefault == "Y") + context.commit('update_selected_cito', data.records[i]) + } + } catch(e) { + context.commit("update_search_status",3) + context.commit("update_search_error_message", e.message ) + } + }, + + async search_pxs(context, id) { + context.commit("update_search_status",1) + // LOADING + context.commit('update_dialog_loading', true, {root:true}) + + try { + let mouCompanyID = 0 + if (context.rootState.company.selected_mou.M_MouID) { + mouCompanyID = context.rootState.company.selected_mou.M_MouID + } + let resp= await api.search_pxs(mouCompanyID, id) + if (resp.status != "OK") { + context.commit("update_search_status",3) + context.commit("update_search_error_message",resp.message) + + // LOADING + context.commit('update_dialog_loading', false, {root:true}) + } else { + context.commit("update_search_status",2) + context.commit("update_search_error_message","") + + let x = resp.data.records + + for (let k in x) { + // SEARCH NAT TEST + let px = x[k] + let nt = context.state.nat_test + let found_nt = false + for (let i in px.nat_test) { + if (nt.indexOf(px.nat_test[i]) > -1) + found_nt = true + } + + if (found_nt) + continue + + let selected_test = context.state.selected_test + let flag_found = false + selected_test.forEach( function(t, idx) { + if (t.T_TestID == px.T_TestID) { + selected_test[idx] = px + flag_found = true + } + }) + + if (!flag_found) { + selected_test.push(px) + } + context.commit('update_selected_test', selected_test) + + let req = px.requirement + let reqs = context.state.requirement + if (req.length > 0) { + for(let i in req) { + let found = false + for(let j in reqs) { + if (reqs[j]['req_id'] == req[i]['req_id']) + found = j + } + + if (!found) + reqs.push({ + px_id: [px.T_TestID], + label: req[i]['req_name'], + error_message: 'Hasil harus di isi', + is_error: true, + checked : false, + note: '', + req_id: req[i]['req_id'] + }) + else + reqs[found].px_id.push(px.T_TestID) + } + + context.commit('update_requirement', reqs) + } + + + context.commit('update_nat_test') + // END LOADING + + } + + context.dispatch('appx_schedule') + context.commit('update_dialog_loading', false, {root:true}) + context.commit('history/update_history_dialog', false, {root:true}) + context.commit('change_tab', '02', {root:true}) + } + } catch(e) { + context.commit("update_search_status",3) + context.commit("update_search_error_message",e.message ) + console.log(e) + } + }, + + async search_pxs_clinic(context, id) { + context.commit("update_search_status",1) + // LOADING + context.commit('update_dialog_loading', true, {root:true}) + + try { + let mouCompanyID = 0 + if (context.rootState.company.selected_mou.M_MouID) { + mouCompanyID = context.rootState.company.selected_mou.M_MouID + } + let resp= await api.search_pxs_clinic(mouCompanyID, id) + if (resp.status != "OK") { + context.commit("update_search_status",3) + context.commit("update_search_error_message",resp.message) + + // LOADING + context.commit('update_dialog_loading', false, {root:true}) + } else { + context.commit("update_search_status",2) + context.commit("update_search_error_message","") + + let x = resp.data.records + + for (let k in x) { + // SEARCH NAT TEST + let px = x[k] + let nt = context.state.nat_test + let found_nt = false + for (let i in px.nat_test) { + if (nt.indexOf(px.nat_test[i]) > -1) + found_nt = true + } + + if (found_nt) + continue + + let selected_test = context.state.selected_test + let flag_found = false + selected_test.forEach( function(t, idx) { + if (t.T_TestID == px.T_TestID) { + selected_test[idx] = px + flag_found = true + } + }) + + if (!flag_found) { + selected_test.push(px) + } + context.commit('update_selected_test', selected_test) + + let req = px.requirement + let reqs = context.state.requirement + if (req.length > 0) { + for(let i in req) { + let found = false + for(let j in reqs) { + if (reqs[j]['req_id'] == req[i]['req_id']) + found = j + } + + if (!found) + reqs.push({ + px_id: [px.T_TestID], + label: req[i]['req_name'], + error_message: 'Hasil harus di isi', + is_error: true, + checked : false, + note: '', + req_id: req[i]['req_id'] + }) + else + reqs[found].px_id.push(px.T_TestID) + } + + context.commit('update_requirement', reqs) + } + + + context.commit('update_nat_test') + // END LOADING + + } + + context.dispatch('appx_schedule') + context.commit('update_dialog_loading', false, {root:true}) + context.commit('history/update_history_dialog', false, {root:true}) + context.commit('change_tab', '02', {root:true}) + } + } catch(e) { + context.commit("update_search_status",3) + context.commit("update_search_error_message",e.message ) + console.log(e) + } + } + } +} diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/modules/reference.js b/test/vuex/one-fo-registration-walk-in-stemcell/modules/reference.js new file mode 100644 index 0000000..f719c12 --- /dev/null +++ b/test/vuex/one-fo-registration-walk-in-stemcell/modules/reference.js @@ -0,0 +1,101 @@ +// 1 => LOADING +// 2 => DONE +// 3 => ERROR +import * as api from "../api/reference.js"; + +export default { + namespaced: true, + state: { + search_status: 0, + search_error_message: "", + references: [], + selected_reference: [], + ordertypes: [], + selected_ordertype: null + }, + + mutations: { + update_references(state, value) { + state.references = Array.isArray(value) ? value : []; + }, + + update_selected_reference(state, value) { + if (Array.isArray(value)) state.selected_reference = value; + else if (value && typeof value === "object") state.selected_reference = [value]; + else state.selected_reference = []; + }, + + update_ordertypes(state, value) { + state.ordertypes = Array.isArray(value) ? value : []; + }, + + update_selected_ordertype(state, value) { + if (value && typeof value === "object") state.selected_ordertype = value; + else state.selected_ordertype = null; + }, + + update_search_error_message(state, msg) { + state.search_error_message = msg || ""; + }, + + update_search_status(state, status) { + state.search_status = status; + } + }, + + actions: { + async searchreference({ commit }, search = "") { + commit("update_search_status", 1); + try { + const resp = await api.searchreference(search); + + if (!resp || resp.status !== "OK") { + commit("update_search_status", 3); + commit("update_search_error_message", resp ? resp.message : "Unknown error"); + commit("update_references", []); + return; + } + + const records = + (resp.data && Array.isArray(resp.data.records) && resp.data.records) || + (Array.isArray(resp.records) && resp.records) || + []; + + commit("update_references", records); + commit("update_search_status", 2); + commit("update_search_error_message", ""); + } catch (e) { + commit("update_search_status", 3); + commit("update_search_error_message", e.message); + commit("update_references", []); + } + }, + + async searchordertype({ commit }, search = "") { + commit("update_search_status", 1); + try { + const resp = await api.searchordertype(search); + + if (!resp || resp.status !== "OK") { + commit("update_search_status", 3); + commit("update_search_error_message", resp ? resp.message : "Unknown error"); + commit("update_ordertypes", []); + return; + } + + const records = + (resp.data && Array.isArray(resp.data.records) && resp.data.records) || + (Array.isArray(resp.records) && resp.records) || + []; + + commit("update_ordertypes", records); + commit("update_search_status", 2); + commit("update_search_error_message", ""); + } catch (e) { + commit("update_search_status", 3); + commit("update_search_error_message", e.message); + commit("update_ordertypes", []); + } + } + } +}; \ No newline at end of file diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/mutation.js b/test/vuex/one-fo-registration-walk-in-stemcell/mutation.js new file mode 100644 index 0000000..e69de29 diff --git a/test/vuex/one-fo-registration-walk-in-stemcell/store.js b/test/vuex/one-fo-registration-walk-in-stemcell/store.js new file mode 100644 index 0000000..86a3710 --- /dev/null +++ b/test/vuex/one-fo-registration-walk-in-stemcell/store.js @@ -0,0 +1,68 @@ +// State +// data ... +// Mutations +// +// +// Actions +import patient from "./modules/patient.js"; +import history from "./modules/history.js"; +import patientaddress from "./modules/patientaddress.js"; +import doctor from "./modules/doctor.js"; +import doctor_new from "./modules/doctor_new.js"; +import language from "./modules/language.js"; +import order from "./modules/order.js"; +import delivery from "./modules/delivery.js"; +import company from "./modules/company.js"; +import px from "./modules/px.js"; +import payment from "./modules/payment.js"; +import other from "./modules/other.js"; +import area from "./modules/area.js"; +import photo from "./modules/photo.js"; +import reference from "./modules/reference.js"; +import system from "../../../apps/modules/system/system.js"; + +export const store = new Vuex.Store({ + state : { + tab_active : '01', + dialog_loading : false, + dialog_error : false, + message_error: '-' + }, + + mutations : { + change_tab(state, tab) { + state.tab_active = tab; + }, + + update_dialog_loading(state, v) { + state.dialog_loading = v + }, + + update_dialog_error(state, v) { + state.dialog_error = v + }, + + update_message_error(state, v) { + state.message_error = v + } + }, + + modules : { + patient: patient, + history: history, + patientaddress: patientaddress, + doctor: doctor, + doctor_new: doctor_new, + language: language, + order: order, + delivery: delivery, + company: company, + px:px, + payment:payment, + other:other, + area:area, + photo:photo, + reference:reference, + system: system + } +}); -- 2.49.1 From 075d809d8e8db081170e2eabd02f669467896817 Mon Sep 17 00:00:00 2001 From: "sas.fajri" Date: Wed, 24 Jun 2026 13:40:01 +0700 Subject: [PATCH 2/3] 3Z4LPN - update git workflow note --- AGENTS.md | 3 +++ CLAUDE.md | 3 +++ 2 files changed, 6 insertions(+) diff --git a/AGENTS.md b/AGENTS.md index d34c45c..5069ec2 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -21,6 +21,9 @@ - Contoh: `6D9QD6 - buat api baru` - Jangan buat commit tanpa kode task dari user. - Kode task digunakan untuk sinkronisasi timesheet Odoo. +- Sebelum push atau menyiapkan merge branch kerja, selalu cek base branch remote yang benar terlebih dahulu, lalu jalankan `git fetch origin` dan `git rebase` ke base remote tersebut agar conflict muncul lebih awal dan proses merge lebih minim error. +- Push branch kerja ke remote lalu buat merge request ke `main`; proses merge ikuti permission dan alur review repo, jangan direct push ke `main` kecuali diminta eksplisit. +- Jangan pernah melakukan `git push --force` atau varian force-push lain. - Lalu `git push` tanpa kerja tambahan yang tidak diperlukan. ## Auto Sync ke Devcpone diff --git a/CLAUDE.md b/CLAUDE.md index a45abe8..2db704f 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -4,6 +4,9 @@ - Contoh: `6D9QD6 - buat api baru` - Jangan buat commit tanpa kode task dari user. - Kode task digunakan untuk sinkronisasi timesheet Odoo. +- Sebelum push atau menyiapkan merge branch kerja, selalu cek base branch remote yang benar terlebih dahulu, lalu jalankan `git fetch origin` dan `git rebase` ke base remote tersebut agar conflict muncul lebih awal dan proses merge lebih minim error. +- Push branch kerja ke remote lalu buat merge request ke `main`; proses merge ikuti permission dan alur review repo, jangan direct push ke `main` kecuali diminta eksplisit. +- Jangan pernah melakukan `git push --force` atau varian force-push lain. # Auto Sync ke Devcpone - Repo ini punya **post-commit hook** di `.githooks/post-commit` yang otomatis menjalankan `scripts/devcpone_sync.sh`. -- 2.49.1 From a2915d659fdca25c2c7d1c7dfa2b40f3212258fa Mon Sep 17 00:00:00 2001 From: "sas.fajri" Date: Wed, 24 Jun 2026 13:41:55 +0700 Subject: [PATCH 3/3] 3Z4LPN - ignore claude workspace --- .gitignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4c5f206 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.claude/ -- 2.49.1