1484 lines
58 KiB
JavaScript
1484 lines
58 KiB
JavaScript
// 1 => LOADING
|
|
// 2 => DONE
|
|
// 3 => ERROR
|
|
import * as api from "../api/patient.js"
|
|
|
|
export default {
|
|
namespaced: true,
|
|
state: {
|
|
last_id: -1,
|
|
last_saved_id: -1,
|
|
x_addr_id: 0,
|
|
act: 'edit',
|
|
act_addr: 'new',
|
|
get_data_status: 0,
|
|
search_patient: 0,
|
|
search_status: 0,
|
|
search_error_message: '',
|
|
norm: '',
|
|
patient_prefix: '',
|
|
patient_name: '',
|
|
patient_suffix: '',
|
|
titles: [],
|
|
selected_title: {},
|
|
dob: '',
|
|
patients: [],
|
|
total_patients: 0,
|
|
patient_address: [],
|
|
sexes: [],
|
|
selected_sex: {},
|
|
religions: [],
|
|
selected_religion: {},
|
|
phone: '',
|
|
hp: '',
|
|
email: '',
|
|
pob: '',
|
|
kartuidentitass: [],
|
|
selected_kartuidentitas: {},
|
|
noidentitas: '',
|
|
note: '',
|
|
nik: '',
|
|
jabatan: '',
|
|
kedudukan: '',
|
|
pj: '',
|
|
location: '',
|
|
job: '',
|
|
total_patient: 0,
|
|
selected_patient: {},
|
|
save_status: 0,
|
|
btn_save_seen: true,
|
|
pgrs_save: false,
|
|
save_error_message: '',
|
|
no_save: 0,
|
|
open_alert_confirmation: false,
|
|
alert_success: false,
|
|
msg_success: "",
|
|
dialog_success: false,
|
|
dialog_confirmation_delete: false,
|
|
msg_confirmation_delete: "",
|
|
dialog_confirmation_delete_addr: false,
|
|
msg_confirmation_delete_addr: "",
|
|
autocomplete_status: 0,
|
|
dialog_form_address: false,
|
|
label_address: '',
|
|
addresses: [],
|
|
cities: [],
|
|
city_address: {},
|
|
companies: [],
|
|
company: {},
|
|
mous: [],
|
|
mou: {},
|
|
doctors: [],
|
|
doctor: {},
|
|
districts: [],
|
|
district_address: {},
|
|
kelurahans: [],
|
|
kelurahan_address: {},
|
|
description_address: '',
|
|
errors: [],
|
|
current_page: 1,
|
|
autocomplete_status: 0,
|
|
status: { id: "N", name: "Belum download" },
|
|
start_date: moment(new Date()).format('YYYY-MM-DD'),
|
|
end_date: moment(new Date()).format('YYYY-MM-DD'),
|
|
selected_mous: [],
|
|
selected_doctors: [],
|
|
xid: -1,
|
|
promise_date: moment(new Date()).format('YYYY-MM-DD'),
|
|
promise_time: moment(new Date()).format('HH:mm'),
|
|
default_mou: {},
|
|
default_doctor: {},
|
|
lookup_order: 0,
|
|
default_doctor_address: {},
|
|
doctor_address: [],
|
|
deliveries: [],
|
|
filter_company: { id: 0 },
|
|
filter_companies: [],
|
|
selected_packets: [],
|
|
selected_tests: [],
|
|
search_packet: '',
|
|
packets: [],
|
|
current_page_packet: 1,
|
|
total_patient_packet: 0,
|
|
search_test: '',
|
|
tests: [],
|
|
current_page_test: 1,
|
|
total_patient_test: 0,
|
|
is_progress: false,
|
|
|
|
// cpone
|
|
mgmmcus: [],
|
|
total_mgmmcu: 0,
|
|
search_mgmmcu: '',
|
|
current_page_mgmmcu: 0,
|
|
selected_mgmmcu: {},
|
|
inp_Mgm_McuLabel: '',
|
|
inp_Mgm_McuPicName: '',
|
|
inp_Mgm_McuPicEmail: '',
|
|
inp_Mgm_McuUserEmail: '',
|
|
inp_Mgm_McuPicPassword: '',
|
|
inp_Mgm_McuUserPassword: '',
|
|
inp_Mgm_McuTotalParticipant: 0,
|
|
inp_Mgm_McuFlagRelasiBayarSendiri: false,
|
|
inp_Mgm_McuBisaTambahPemeriksaan: false,
|
|
inp_Mgm_McuLowBackPainTampilSemua: false,
|
|
inp_Mgm_McuTemplateMulti: false,
|
|
inp_Mgm_McuNote: '',
|
|
templateFisikCb: [],
|
|
selected_templateFisikCb: {},
|
|
corporates: [],
|
|
corporate: {},
|
|
show1: true,
|
|
inp_Mgm_McuPicEmailValidate: '',
|
|
inp_Mgm_McuUserEmailValidate: '',
|
|
detailpackets: [],
|
|
dialog_confirmation_paket: false,
|
|
selected_detail_paketx: {},
|
|
branchs: [],
|
|
selected_branch: {},
|
|
tpriceheaderformCb: [],
|
|
selected_tpriceheaderformCb: {},
|
|
msg_error: '',
|
|
dialog_error: false,
|
|
userMcuLists: [],
|
|
show_delete: false,
|
|
bar_chx_allx: false,
|
|
deleted_usermcus: [],
|
|
usermcuid: 0,
|
|
reportresult: "1",
|
|
generatepasswordby: [
|
|
{ "generatepasswordbycode": "hrd", "generatepasswordbyname": "Generate password pasien oleh HRD" },
|
|
{ "generatepasswordbycode": "cpone", "generatepasswordbyname": "Generate password pasien oleh CPONE" }
|
|
],
|
|
selected_generatepasswordby: {},
|
|
mgm_mcuemailresult: {},
|
|
inp_Mgm_McuPriceWebsite: false,
|
|
covers: [],
|
|
selected_cover: {code: 'DFLT', name: 'Cover Default'},
|
|
backgrounds: [],
|
|
selected_bg: {code: 'DFLT', name: 'Background Default', image: 'one-ui/BackgroundWesterindo.png'},
|
|
multitemplates: [],
|
|
selected_multitemplates: {},
|
|
reportUrlTemplates: [],
|
|
selected_reportUrlTemplate: {},
|
|
// cpone
|
|
},
|
|
mutations: {
|
|
update_multitemplates(state, val) {
|
|
state.multitemplates = val
|
|
},
|
|
update_selected_multitemplates(state, val) {
|
|
state.selected_multitemplates = val
|
|
},
|
|
update_reportUrlTemplates(state, val) {
|
|
state.reportUrlTemplates = val
|
|
},
|
|
update_selected_reportUrlTemplate(state, val) {
|
|
state.selected_reportUrlTemplate = val
|
|
},
|
|
update_covers(state, val) {
|
|
state.covers = val
|
|
},
|
|
update_backgrounds(state, val) {
|
|
state.backgrounds = val
|
|
},
|
|
update_selected_cover(state, val) {
|
|
state.selected_cover = val
|
|
},
|
|
update_selected_bg(state, val) {
|
|
state.selected_bg = val
|
|
},
|
|
update_inp_Mgm_McuPriceWebsite(state, val) {
|
|
state.inp_Mgm_McuPriceWebsite = val
|
|
},
|
|
update_inp_Mgm_McuTemplateMulti(state, val) {
|
|
state.inp_Mgm_McuTemplateMulti = val
|
|
},
|
|
update_mgm_mcuemailresult(state, val) {
|
|
state.mgm_mcuemailresult = val
|
|
},
|
|
update_inp_Mgm_McuLowBackPainTampilSemua(state, val) {
|
|
state.inp_Mgm_McuLowBackPainTampilSemua = val
|
|
},
|
|
// cpone
|
|
update_generatepasswordby(state, val) {
|
|
state.generatepasswordby = val
|
|
},
|
|
update_selected_generatepasswordby(state, val) {
|
|
state.selected_generatepasswordby = val
|
|
},
|
|
update_reportresult(state, val) {
|
|
state.reportresult = val
|
|
},
|
|
update_show_delete(state, val) {
|
|
state.show_delete = val
|
|
},
|
|
update_bar_chx_allx(state, val) {
|
|
state.bar_chx_allx = val
|
|
},
|
|
update_deleted_usermcus(state, val) {
|
|
state.deleted_usermcus = val
|
|
},
|
|
update_usermcuid(state, val) {
|
|
state.usermcuid = val
|
|
},
|
|
update_userMcuLists(state, val) {
|
|
state.userMcuLists = val
|
|
},
|
|
update_deleted_userMcuLists(state, val) {
|
|
state.userMcuLists.splice(val, 1)
|
|
},
|
|
update_msg_error(state, val) {
|
|
state.msg_error = val
|
|
},
|
|
update_dialog_error(state, val) {
|
|
state.dialog_error = val
|
|
},
|
|
update_tpriceheaderformCb(state, status) {
|
|
state.tpriceheaderformCb = status
|
|
},
|
|
update_selected_tpriceheaderformCb(state, status) {
|
|
state.selected_tpriceheaderformCb = status
|
|
},
|
|
update_branchs(state, val) {
|
|
state.branchs = val
|
|
},
|
|
update_selected_branch(state, val) {
|
|
state.selected_branch = val
|
|
},
|
|
update_selected_detail_paketx(state, val) {
|
|
state.selected_detail_paketx = val
|
|
},
|
|
update_dialog_confirmation_paket(state, val) {
|
|
state.dialog_confirmation_paket = val
|
|
},
|
|
update_detailpackets(state, val) {
|
|
state.detailpackets = val
|
|
},
|
|
update_inp_Mgm_McuPicEmailValidate(state, val) {
|
|
state.inp_Mgm_McuPicEmailValidate = val
|
|
},
|
|
update_inp_Mgm_McuUserEmailValidate(state, val) {
|
|
state.inp_Mgm_McuUserEmailValidate = val
|
|
},
|
|
update_show1(state, val) {
|
|
state.show1 = val
|
|
},
|
|
update_corporates(state, val) {
|
|
state.corporates = val
|
|
},
|
|
update_corporate(state, val) {
|
|
state.corporate = val
|
|
},
|
|
update_templateFisikCb(state, status) {
|
|
state.templateFisikCb = status
|
|
},
|
|
update_selected_templateFisikCb(state, status) {
|
|
state.selected_templateFisikCb = status
|
|
},
|
|
update_inp_Mgm_McuNote(state, status) {
|
|
state.inp_Mgm_McuNote = status
|
|
},
|
|
update_inp_Mgm_McuBisaTambahPemeriksaan(state, status) {
|
|
state.inp_Mgm_McuBisaTambahPemeriksaan = status
|
|
},
|
|
update_inp_Mgm_McuFlagRelasiBayarSendiri(state, status) {
|
|
state.inp_Mgm_McuFlagRelasiBayarSendiri = status
|
|
},
|
|
update_inp_Mgm_McuLabel(state, status) {
|
|
state.inp_Mgm_McuLabel = status
|
|
},
|
|
update_inp_Mgm_McuPicName(state, status) {
|
|
state.inp_Mgm_McuPicName = status
|
|
},
|
|
update_inp_Mgm_McuPicEmail(state, status) {
|
|
state.inp_Mgm_McuPicEmail = status
|
|
},
|
|
update_inp_Mgm_McuUserEmail(state, status) {
|
|
state.inp_Mgm_McuUserEmail = status
|
|
},
|
|
update_inp_Mgm_McuPicPassword(state, status) {
|
|
state.inp_Mgm_McuPicPassword = status
|
|
},
|
|
update_inp_Mgm_McuUserPassword(state, status) {
|
|
state.inp_Mgm_McuUserPassword = status
|
|
},
|
|
update_inp_Mgm_McuTotalParticipant(state, status) {
|
|
state.inp_Mgm_McuTotalParticipant = status
|
|
},
|
|
update_mgmmcus(state, status) {
|
|
state.mgmmcus = status
|
|
},
|
|
update_total_mgmmcu(state, val) {
|
|
state.total_mgmmcu = val
|
|
},
|
|
update_search_mgmmcu(state, status) {
|
|
state.search_mgmmcu = status
|
|
},
|
|
update_current_page_mgmmcu(state, status) {
|
|
state.current_page_mgmmcu = status
|
|
},
|
|
update_selected_mgmmcu(state, val) {
|
|
state.selected_mgmmcu = val
|
|
},
|
|
// cpone
|
|
update_is_progress(state, status) {
|
|
state.is_progress = status
|
|
},
|
|
update_total_patient_test(state, status) {
|
|
state.total_patient_test = status
|
|
},
|
|
update_tests(state, status) {
|
|
state.tests = status
|
|
},
|
|
update_current_page_test(state, status) {
|
|
state.current_page_test = status
|
|
},
|
|
update_search_test(state, status) {
|
|
state.search_test = status
|
|
},
|
|
update_total_patient_packet(state, status) {
|
|
state.total_patient_packet = status
|
|
},
|
|
update_packets(state, status) {
|
|
state.packets = status
|
|
},
|
|
update_current_page_packet(state, status) {
|
|
state.current_page_packet = status
|
|
},
|
|
update_search_packet(state, status) {
|
|
state.search_packet = status
|
|
},
|
|
update_selected_packets(state, status) {
|
|
state.selected_packets = status
|
|
},
|
|
update_selected_tests(state, status) {
|
|
state.selected_tests = status
|
|
},
|
|
update_filter_company(state, val) {
|
|
state.filter_company = val
|
|
},
|
|
update_filter_companies(state, val) {
|
|
state.filter_companies = val
|
|
},
|
|
update_deliveries(state, val) {
|
|
state.deliveries = val
|
|
},
|
|
update_doctor_address(state, val) {
|
|
state.doctor_address = val
|
|
},
|
|
update_default_doctor_address(state, val) {
|
|
state.default_doctor_address = val
|
|
},
|
|
update_lookup_order(state, val) {
|
|
state.lookup_order = val
|
|
},
|
|
update_default_mou(state, val) {
|
|
state.default_mou = val
|
|
},
|
|
update_default_doctor(state, val) {
|
|
state.default_doctor = val
|
|
},
|
|
update_promise_date(state, val) {
|
|
state.promise_date = val
|
|
},
|
|
update_promise_time(state, val) {
|
|
state.promise_time = val
|
|
},
|
|
update_xid(state, val) {
|
|
state.xid = val
|
|
},
|
|
update_selected_doctors(state, val) {
|
|
state.selected_doctors = val
|
|
},
|
|
update_selected_mous(state, val) {
|
|
state.selected_mous = val
|
|
},
|
|
update_companies(state, val) {
|
|
state.companies = val
|
|
},
|
|
update_company(state, val) {
|
|
state.company = val
|
|
},
|
|
update_mous(state, val) {
|
|
state.mous = val
|
|
},
|
|
update_mou(state, val) {
|
|
state.mou = val
|
|
},
|
|
update_doctors(state, val) {
|
|
state.doctors = val
|
|
},
|
|
update_doctor(state, val) {
|
|
state.doctor = val
|
|
},
|
|
update_autocomplete_status(state, val) {
|
|
state.autocomplete_status = val
|
|
},
|
|
update_start_date(state, val) {
|
|
state.start_date = val
|
|
},
|
|
update_end_date(state, val) {
|
|
state.end_date = val
|
|
},
|
|
update_status(state, val) {
|
|
state.status = val
|
|
},
|
|
update_current_page(state, val) {
|
|
state.current_page = val
|
|
},
|
|
update_x_addr_id(state, val) {
|
|
state.x_addr_id = val
|
|
},
|
|
update_last_id(state, val) {
|
|
state.last_id = val
|
|
},
|
|
update_last_saved_id(state, val) {
|
|
state.last_saved_id = val
|
|
},
|
|
update_act(state, val) {
|
|
state.act = val
|
|
},
|
|
update_act_addr(state, val) {
|
|
state.act_addr = val
|
|
},
|
|
update_get_data_status(state, val) {
|
|
state.get_data_status = val
|
|
},
|
|
update_search_error_message(state, patient) {
|
|
state.search_error_message = patient
|
|
},
|
|
update_search_patient(state, patient) {
|
|
state.search_patient = patient
|
|
},
|
|
update_dob(state, val) {
|
|
state.dob = val
|
|
},
|
|
update_patient_prefix(state, val) {
|
|
state.patient_prefix = val
|
|
},
|
|
update_patient_name(state, val) {
|
|
state.patient_name = val
|
|
},
|
|
update_patient_suffix(state, val) {
|
|
state.patient_suffix = val
|
|
},
|
|
update_norm(state, val) {
|
|
state.norm = val
|
|
},
|
|
update_titles(state, val) {
|
|
state.titles = val
|
|
},
|
|
update_selected_title(state, val) {
|
|
state.selected_title = val
|
|
},
|
|
update_patients(state, data) {
|
|
state.patients = data
|
|
},
|
|
update_selected_patient(state, val) {
|
|
state.selected_patient = val
|
|
},
|
|
update_sexes(state, val) {
|
|
state.sexes = val
|
|
},
|
|
update_selected_sex(state, val) {
|
|
state.selected_sex = val
|
|
},
|
|
update_religions(state, val) {
|
|
state.religions = val
|
|
},
|
|
update_selected_religion(state, val) {
|
|
state.selected_religion = val
|
|
},
|
|
update_phone(state, val) {
|
|
state.phone = val
|
|
},
|
|
update_email(state, val) {
|
|
state.email = val
|
|
},
|
|
update_pob(state, val) {
|
|
state.pob = val
|
|
},
|
|
update_hp(state, val) {
|
|
state.hp = val
|
|
},
|
|
update_kartuidentitass(state, val) {
|
|
state.kartuidentitass = val
|
|
},
|
|
update_selected_kartuidentitas(state, val) {
|
|
state.selected_kartuidentitas = val
|
|
},
|
|
update_noidentitas(state, val) {
|
|
state.noidentitas = val
|
|
},
|
|
update_note(state, val) {
|
|
state.note = val
|
|
},
|
|
update_nik(state, val) {
|
|
state.nik = val
|
|
},
|
|
update_jabatan(state, val) {
|
|
state.jabatan = val
|
|
},
|
|
update_kedudukan(state, val) {
|
|
state.kedudukan = val
|
|
},
|
|
update_pj(state, val) {
|
|
state.pj = val
|
|
},
|
|
update_location(state, val) {
|
|
state.location = val
|
|
},
|
|
update_job(state, val) {
|
|
state.job = val
|
|
},
|
|
update_save_status(state, val) {
|
|
state.save_status = val
|
|
},
|
|
update_btn_save_seen(state, val) {
|
|
state.btn_save_seen = val
|
|
},
|
|
update_pgrs_save(state, val) {
|
|
state.pgrs_save = val
|
|
},
|
|
update_save_error_message(state, msg) {
|
|
state.save_error_message = ''
|
|
},
|
|
update_no_save(state, val) {
|
|
state.no_save = val
|
|
},
|
|
update_open_alert_confirmation(state, val) {
|
|
state.open_alert_confirmation = val
|
|
},
|
|
update_alert_success(state, val) {
|
|
state.alert_success = val
|
|
},
|
|
update_msg_success(state, val) {
|
|
state.msg_success = val
|
|
},
|
|
update_dialog_success(state, val) {
|
|
state.dialog_success = val
|
|
},
|
|
update_dialog_confirmation_delete(state, val) {
|
|
state.dialog_confirmation_delete = val
|
|
},
|
|
update_msg_confirmation_delete(state, val) {
|
|
state.msg_confirmation_delete = val
|
|
},
|
|
update_dialog_confirmation_delete_addr(state, val) {
|
|
state.dialog_confirmation_delete_addr = val
|
|
},
|
|
update_msg_confirmation_delete_addr(state, val) {
|
|
state.msg_confirmation_delete_addr = val
|
|
},
|
|
update_addresses(state, val) {
|
|
state.addresses = val
|
|
},
|
|
update_autocomplete_status(state, val) {
|
|
state.autocomplete_status = val
|
|
},
|
|
update_dialog_form_address(state, val) {
|
|
state.dialog_form_address = val
|
|
},
|
|
update_label_address(state, val) {
|
|
state.label_address = val
|
|
},
|
|
update_cities(state, val) {
|
|
state.cities = val
|
|
},
|
|
update_city_address(state, val) {
|
|
state.city_address = val
|
|
},
|
|
update_districts(state, val) {
|
|
state.districts = val
|
|
},
|
|
update_district_address(state, val) {
|
|
state.district_address = val
|
|
},
|
|
update_kelurahans(state, val) {
|
|
state.kelurahans = val
|
|
},
|
|
update_kelurahan_address(state, val) {
|
|
state.kelurahan_address = val
|
|
},
|
|
update_description_address(state, val) {
|
|
state.description_address = val
|
|
},
|
|
update_search_status(state, val) {
|
|
state.search_status = val
|
|
},
|
|
update_errors(state, val) {
|
|
state.errors = val
|
|
},
|
|
update_total_patients(state, val) {
|
|
state.total_patients = val
|
|
},
|
|
update_total_patient(state, val) {
|
|
state.total_patient = val
|
|
}
|
|
},
|
|
actions: {
|
|
// cpone
|
|
// async createSSMou(context, prm) {
|
|
// context.commit("update_save_status", 1)
|
|
// try {
|
|
// prm.token = one_token()
|
|
|
|
// let resp = await api.createSSMou(prm)
|
|
// if (resp.status != "OK") {
|
|
// context.commit("update_msg_error",resp.message)
|
|
// context.commit("update_dialog_error",true)
|
|
// context.commit("update_save_status", 3)
|
|
// } else {
|
|
// context.commit("update_save_status", 2)
|
|
// let data = {
|
|
// records: resp.data.records,
|
|
// total: resp.data.total
|
|
// }
|
|
|
|
// var msg = "validasi berhasil "
|
|
|
|
// context.commit("update_dialog_success", true)
|
|
// context.commit("update_msg_success", msg)
|
|
// }
|
|
// } catch (e) {
|
|
// context.commit("update_save_status", 3)
|
|
// }
|
|
// },
|
|
async removeUserMcuTemp(context, idx) {
|
|
context.commit("update_deleted_userMcuLists", idx)
|
|
},
|
|
async getemailresult(context, prm) {
|
|
context.commit("update_get_data_status", 1)
|
|
try {
|
|
prm.token = one_token()
|
|
let resp = await api.getemailresult(prm)
|
|
if (resp.status != "OK") {
|
|
context.commit("update_get_data_status", 3)
|
|
} else {
|
|
context.commit("update_get_data_status", 2)
|
|
context.commit("update_mgm_mcuemailresult", resp.data.records)
|
|
}
|
|
} catch (e) {
|
|
context.commit("update_get_data_status", 3)
|
|
}
|
|
},
|
|
async getusermcu(context, prm) {
|
|
context.commit("update_get_data_status", 1)
|
|
try {
|
|
prm.token = one_token()
|
|
let resp = await api.getusermcu(prm)
|
|
if (resp.status != "OK") {
|
|
context.commit("update_get_data_status", 3)
|
|
} else {
|
|
context.commit("update_get_data_status", 2)
|
|
let data = {
|
|
records: resp.data.records,
|
|
total: resp.data.total
|
|
}
|
|
context.commit("update_userMcuLists", data.records)
|
|
}
|
|
} catch (e) {
|
|
context.commit("update_get_data_status", 3)
|
|
}
|
|
},
|
|
async getTPriceHeaderCurrent(context) {
|
|
context.commit("update_search_patient", 1)
|
|
try {
|
|
var prm = { token: one_token() }
|
|
let resp = await api.getTPriceHeaderCurrent(prm)
|
|
if (resp.status != "OK") {
|
|
context.commit("update_search_patient", 3)
|
|
} else {
|
|
context.commit("update_search_patient", 2)
|
|
let data = {
|
|
records: resp.data.records,
|
|
}
|
|
context.commit("update_tpriceheaderformCb", resp.data.records)
|
|
}
|
|
} catch (e) {
|
|
context.commit("update_search_patient", 3)
|
|
}
|
|
},
|
|
|
|
async getBranch(context) {
|
|
context.commit("update_search_patient", 1)
|
|
try {
|
|
var prm = { token: one_token() }
|
|
let resp = await api.getBranch(prm)
|
|
if (resp.status != "OK") {
|
|
context.commit("update_search_patient", 3)
|
|
} else {
|
|
context.commit("update_search_patient", 2)
|
|
let data = {
|
|
records: resp.data.records,
|
|
}
|
|
context.commit("update_branchs", resp.data.records)
|
|
}
|
|
} catch (e) {
|
|
context.commit("update_search_patient", 3)
|
|
}
|
|
},
|
|
|
|
async getDetailPacketByID(context, prm) {
|
|
context.commit("update_search_patient", 1)
|
|
try {
|
|
prm.token = one_token()
|
|
let resp = await api.getDetailPacketByID(prm)
|
|
if (resp.status != "OK") {
|
|
context.commit("update_search_patient", 3)
|
|
context.commit("update_search_error_message", resp.message)
|
|
} else {
|
|
context.commit("update_search_patient", 2)
|
|
context.commit("update_search_error_message", "")
|
|
let data = {
|
|
records: resp.data.records,
|
|
// total: resp.data.total
|
|
}
|
|
context.commit("update_detailpackets", data.records)
|
|
context.commit("update_dialog_confirmation_paket", true)
|
|
// context.commit("update_total_mgmmcu", data.total)
|
|
context.commit("update_no_save", 0)
|
|
if (prm.lastid === -1) {
|
|
//context.commit("update_selected_patient", data.records[0])
|
|
/*context.dispatch("getaddress", {
|
|
id: pat.M_PatientID
|
|
})*/
|
|
} else {
|
|
//context.commit("update_selected_patient", data.records[prm.lastid])
|
|
/*context.dispatch("getaddress", {
|
|
id: pat.M_PatientID
|
|
})*/
|
|
}
|
|
|
|
}
|
|
} catch (e) {
|
|
context.commit("update_search_patient", 3)
|
|
context.commit("update_search_error_message", e.message)
|
|
console.log(e)
|
|
}
|
|
},
|
|
|
|
async getPackets(context, prm) {
|
|
context.commit("update_get_data_status", 1)
|
|
try {
|
|
prm.token = one_token()
|
|
let selpat = context.state.selected_patient
|
|
if(!_.isEmpty(selpat)){
|
|
prm.Mgm_McuID = selpat.Mgm_McuID
|
|
}
|
|
let resp = await api.getPackets(prm)
|
|
if (resp.status != "OK") {
|
|
context.commit("update_get_data_status", 3)
|
|
} else {
|
|
context.commit("update_get_data_status", 2)
|
|
let data = {
|
|
records: resp.data.records,
|
|
total: resp.data.total
|
|
}
|
|
context.commit("update_is_progress", false)
|
|
context.commit("update_packets", data.records)
|
|
context.commit("update_total_patient_packet", data.total)
|
|
|
|
}
|
|
} catch (e) {
|
|
context.commit("update_get_data_status", 3)
|
|
}
|
|
},
|
|
|
|
async getCover(context, prm) {
|
|
context.commit("update_get_data_status", 1)
|
|
try {
|
|
console.log('dadasda')
|
|
console.log(prm)
|
|
prm.token = one_token()
|
|
let resp = await api.getCover(prm)
|
|
if (resp.status != "OK") {
|
|
context.commit("update_get_data_status", 3)
|
|
} else {
|
|
context.commit("update_get_data_status", 2)
|
|
let data = {
|
|
records: resp.data.records,
|
|
total: resp.data.total
|
|
}
|
|
context.commit("update_is_progress", false)
|
|
//context.commit("update_packets", data.records)
|
|
context.commit("update_selected_cover", resp.data.records)
|
|
|
|
|
|
}
|
|
} catch (e) {
|
|
context.commit("update_get_data_status", 3)
|
|
}
|
|
},
|
|
async getBg(context, prm) {
|
|
context.commit("update_get_data_status", 1)
|
|
try {
|
|
console.log('Get BG')
|
|
console.log(prm)
|
|
prm.token = one_token()
|
|
let resp = await api.getBg(prm)
|
|
if (resp.status != "OK") {
|
|
context.commit("update_get_data_status", 3)
|
|
} else {
|
|
context.commit("update_get_data_status", 2)
|
|
let data = {
|
|
records: resp.data.records,
|
|
total: resp.data.total
|
|
}
|
|
context.commit("update_is_progress", false)
|
|
//context.commit("update_packets", data.records)
|
|
context.commit("update_selected_bg", data.records)
|
|
|
|
|
|
}
|
|
} catch (e) {
|
|
context.commit("update_get_data_status", 3)
|
|
}
|
|
},
|
|
|
|
async searchcorporate(context, prm) {
|
|
context.commit("update_autocomplete_status", 1)
|
|
try {
|
|
prm.token = one_token()
|
|
|
|
let resp = await api.searchcorporate(prm)
|
|
if (resp.status != "OK") {
|
|
context.commit("update_autocomplete_status", 3)
|
|
} else {
|
|
context.commit("update_autocomplete_status", 2)
|
|
let data = {
|
|
records: resp.data.records,
|
|
total: resp.data.total
|
|
}
|
|
context.commit("update_corporates", resp.data.records)
|
|
}
|
|
} catch (e) {
|
|
context.commit("update_autocomplete_status", 3)
|
|
}
|
|
},
|
|
|
|
async getTemplateFisikMapping(context) {
|
|
context.commit("update_search_patient", 1)
|
|
try {
|
|
var prm = { token: one_token() }
|
|
let resp = await api.getTemplateFisikMapping(prm)
|
|
if (resp.status != "OK") {
|
|
context.commit("update_search_patient", 3)
|
|
} else {
|
|
context.commit("update_search_patient", 2)
|
|
let data = {
|
|
records: resp.data.records,
|
|
}
|
|
context.commit("update_templateFisikCb", resp.data.records)
|
|
}
|
|
} catch (e) {
|
|
context.commit("update_search_patient", 3)
|
|
}
|
|
},
|
|
async getReportUrlTemplates(context, prm) {
|
|
context.commit("update_get_data_status", 1)
|
|
try {
|
|
var xprm = prm || {}
|
|
xprm.token = one_token()
|
|
let resp = await api.getReportUrlTemplates(xprm)
|
|
if (resp.status != "OK") {
|
|
context.commit("update_get_data_status", 3)
|
|
} else {
|
|
context.commit("update_get_data_status", 2)
|
|
const rows = resp.data.records || []
|
|
context.commit("update_reportUrlTemplates", rows)
|
|
if (resp.data.selected) {
|
|
context.commit("update_selected_reportUrlTemplate", resp.data.selected)
|
|
}
|
|
}
|
|
} catch (e) {
|
|
context.commit("update_get_data_status", 3)
|
|
}
|
|
},
|
|
|
|
async searchv0(context, prm) {
|
|
context.commit("update_search_patient", 1)
|
|
try {
|
|
prm.token = one_token()
|
|
let resp = await api.searchv0(prm)
|
|
if (resp.status != "OK") {
|
|
context.commit("update_search_patient", 3)
|
|
context.commit("update_search_error_message", resp.message)
|
|
} else {
|
|
context.commit("update_search_patient", 2)
|
|
context.commit("update_search_error_message", "")
|
|
let data = {
|
|
records: resp.data.records,
|
|
total: resp.data.total
|
|
}
|
|
context.commit("update_mgmmcus", data.records)
|
|
context.commit("update_total_mgmmcu", data.total)
|
|
context.commit("update_no_save", 0)
|
|
context.commit("update_covers", resp.data.covers)
|
|
context.commit("update_backgrounds", resp.data.backgrounds)
|
|
if (prm.lastid === -1) {
|
|
//context.commit("update_selected_patient", data.records[0])
|
|
/*context.dispatch("getaddress", {
|
|
id: pat.M_PatientID
|
|
})*/
|
|
} else {
|
|
//context.commit("update_selected_patient", data.records[prm.lastid])
|
|
/*context.dispatch("getaddress", {
|
|
id: pat.M_PatientID
|
|
})*/
|
|
}
|
|
|
|
}
|
|
} catch (e) {
|
|
context.commit("update_search_patient", 3)
|
|
context.commit("update_search_error_message", e.message)
|
|
console.log(e)
|
|
}
|
|
},
|
|
async savesetupv0(context, prm) {
|
|
context.commit("update_save_status", 1)
|
|
try {
|
|
prm.token = one_token()
|
|
|
|
let resp = await api.savesetupv0(prm)
|
|
if (resp.status != "OK") {
|
|
context.commit("update_msg_error", resp.message)
|
|
context.commit("update_dialog_error", true)
|
|
context.commit("update_save_status", 3)
|
|
} else {
|
|
context.commit("update_save_status", 2)
|
|
let data = {
|
|
records: resp.data.records,
|
|
total: resp.data.total
|
|
}
|
|
// context.commit("update_company", {})
|
|
// context.commit("update_selected_mous", [])
|
|
// context.commit("update_selected_patient", {})
|
|
// context.commit("update_mou", {})
|
|
// context.commit("update_selected_doctors", [])
|
|
// context.commit("update_start_date", moment(new Date()).format('YYYY-MM-DD'))
|
|
// context.commit("update_end_date", moment(new Date()).format('YYYY-MM-DD'))
|
|
// context.commit("update_promise_date", moment(new Date()).format('YYYY-MM-DD'))
|
|
// context.commit("update_promise_time",moment(new Date()).format('HH:mm'))
|
|
// context.commit("update_default_mou", {})
|
|
// context.commit("update_default_doctor", {})
|
|
// context.commit("update_default_doctor_address", {})
|
|
// context.commit("update_doctor_address", [])
|
|
// context.commit("update_dialog_success", true)
|
|
// context.commit("update_packets", [])
|
|
// context.commit("update_tests", [])
|
|
// context.commit("update_selected_packets", [])
|
|
// context.commit("update_selected_tests", [])
|
|
// context.commit("update_current_page_test", 1)
|
|
|
|
context.commit("update_corporate", {})
|
|
context.commit("update_selected_templateFisikCb", {})
|
|
context.commit("update_inp_Mgm_McuNote", "")
|
|
context.commit("update_inp_Mgm_McuBisaTambahPemeriksaan", false)
|
|
context.commit("update_inp_Mgm_McuFlagRelasiBayarSendiri", false)
|
|
context.commit("update_inp_Mgm_McuLabel", "")
|
|
context.commit("update_start_date", moment(new Date()).format('YYYY-MM-DD'))
|
|
context.commit("update_end_date", moment(new Date()).format('YYYY-MM-DD'))
|
|
context.commit("update_selected_packets", [])
|
|
context.commit("update_inp_Mgm_McuPicPassword", "")
|
|
context.commit("update_inp_Mgm_McuTotalParticipant", 0)
|
|
context.commit("update_inp_Mgm_McuPicName", "")
|
|
context.commit("update_inp_Mgm_McuPicEmail", "")
|
|
context.commit("update_current_page_packet", 1)
|
|
context.commit("update_total_patient_packet", 0)
|
|
context.commit("update_selected_tpriceheaderformCb", {})
|
|
context.commit("update_selected_branch", {})
|
|
context.commit("update_userMcuLists", [])
|
|
context.commit("update_inp_Mgm_McuUserEmail", "")
|
|
context.commit("update_inp_Mgm_McuUserPassword", "")
|
|
context.commit("update_reportresult", "1")
|
|
context.commit("update_selected_generatepasswordby", {})
|
|
context.commit("update_selected_reportUrlTemplate", {})
|
|
context.commit("update_inp_Mgm_McuLowBackPainTampilSemua", false)
|
|
// context.commit("update_total_patient_test", 0)
|
|
|
|
if (context.state.act === 'new')
|
|
var msg = "Pembuatan setup nomor " + resp.data.records.xnumber + " sudah berhasil dong ..."
|
|
else
|
|
var msg = "Perubahan setup nomor " + resp.data.records.xnumber + " sudah berhasil dong ..."
|
|
|
|
context.commit("update_dialog_success", true)
|
|
context.commit("update_msg_success", msg)
|
|
}
|
|
} catch (e) {
|
|
context.commit("update_save_status", 3)
|
|
}
|
|
},
|
|
|
|
async deletev0(context, prm) {
|
|
context.commit("update_save_status", 1)
|
|
try {
|
|
prm.token = one_token()
|
|
let resp = await api.xdeletev0(prm)
|
|
if (resp.status != "OK") {
|
|
context.commit("update_save_status", 3)
|
|
} else {
|
|
context.commit("update_save_status", 2)
|
|
context.commit("update_last_id", 0)
|
|
context.commit("update_dialog_confirmation_delete", false)
|
|
context.commit("update_dialog_success", true)
|
|
var msg = "Data setup " + prm.code + " sudah dihapus dong ..."
|
|
context.commit("update_msg_success", msg)
|
|
context.commit("update_corporate", {})
|
|
context.commit("update_selected_templateFisikCb", {})
|
|
context.commit("update_inp_Mgm_McuNote", "")
|
|
context.commit("update_inp_Mgm_McuBisaTambahPemeriksaan", false)
|
|
context.commit("update_inp_Mgm_McuFlagRelasiBayarSendiri", false)
|
|
context.commit("update_inp_Mgm_McuLabel", "")
|
|
context.commit("update_start_date", moment(new Date()).format('YYYY-MM-DD'))
|
|
context.commit("update_end_date", moment(new Date()).format('YYYY-MM-DD'))
|
|
context.commit("update_selected_packets", [])
|
|
context.commit("update_inp_Mgm_McuPicPassword", "")
|
|
context.commit("update_inp_Mgm_McuTotalParticipant", 0)
|
|
context.commit("update_inp_Mgm_McuPicName", "")
|
|
context.commit("update_inp_Mgm_McuPicEmail", "")
|
|
context.commit("update_reportresult", "1")
|
|
context.commit("update_selected_generatepasswordby", {})
|
|
context.commit("update_selected_reportUrlTemplate", {})
|
|
// context.commit("update_current_page_packet", 1)
|
|
// context.commit("update_total_patient_packet", 0)
|
|
}
|
|
} catch (e) {
|
|
context.commit("update_save_status", 3)
|
|
}
|
|
},
|
|
// cpone
|
|
async search(context, prm) {
|
|
context.commit("update_search_patient", 1)
|
|
try {
|
|
prm.token = one_token()
|
|
let resp = await api.search(prm)
|
|
if (resp.status != "OK") {
|
|
context.commit("update_search_patient", 3)
|
|
context.commit("update_search_error_message", resp.message)
|
|
} else {
|
|
context.commit("update_search_patient", 2)
|
|
context.commit("update_search_error_message", "")
|
|
let data = {
|
|
records: resp.data.records,
|
|
total: resp.data.total
|
|
}
|
|
context.commit("update_mgmmcu", data.records)
|
|
context.commit("update_total_patient", data.total)
|
|
context.commit("update_no_save", 0)
|
|
if (prm.lastid === -1) {
|
|
//context.commit("update_selected_patient", data.records[0])
|
|
/*context.dispatch("getaddress", {
|
|
id: pat.M_PatientID
|
|
})*/
|
|
} else {
|
|
//context.commit("update_selected_patient", data.records[prm.lastid])
|
|
/*context.dispatch("getaddress", {
|
|
id: pat.M_PatientID
|
|
})*/
|
|
}
|
|
|
|
}
|
|
} catch (e) {
|
|
context.commit("update_search_patient", 3)
|
|
context.commit("update_search_error_message", e.message)
|
|
console.log(e)
|
|
}
|
|
},
|
|
async getdatapackets(context, prm) {
|
|
context.commit("update_get_data_status", 1)
|
|
try {
|
|
prm.token = one_token()
|
|
let resp = await api.getdatapackets(prm)
|
|
if (resp.status != "OK") {
|
|
context.commit("update_get_data_status", 3)
|
|
} else {
|
|
context.commit("update_get_data_status", 2)
|
|
let data = {
|
|
records: resp.data.records,
|
|
total: resp.data.total
|
|
}
|
|
context.commit("update_is_progress", false)
|
|
context.commit("update_packets", data.records)
|
|
context.commit("update_total_patient_packet", data.total)
|
|
|
|
}
|
|
} catch (e) {
|
|
context.commit("update_get_data_status", 3)
|
|
}
|
|
},
|
|
async getmultitemplates(context, prm) {
|
|
context.commit("update_is_progress", true)
|
|
try {
|
|
prm.token = one_token()
|
|
let resp = await api.getmultitemplates(prm)
|
|
if (resp.status != "OK") {
|
|
context.commit("update_get_data_status", 3)
|
|
} else {
|
|
context.commit("update_get_data_status", 2)
|
|
|
|
context.commit("update_is_progress", false)
|
|
context.commit("update_multitemplates", resp.data.records)
|
|
|
|
}
|
|
} catch (e) {
|
|
context.commit("update_is_progress", false)
|
|
}
|
|
},
|
|
async getdatatests(context, prm) {
|
|
context.commit("update_get_data_status", 1)
|
|
try {
|
|
prm.token = one_token()
|
|
let resp = await api.getdatatests(prm)
|
|
if (resp.status != "OK") {
|
|
context.commit("update_get_data_status", 3)
|
|
} else {
|
|
context.commit("update_get_data_status", 2)
|
|
let data = {
|
|
records: resp.data.records,
|
|
total: resp.data.total
|
|
}
|
|
context.commit("update_is_progress", false)
|
|
context.commit("update_tests", data.records)
|
|
context.commit("update_total_patient_test", data.total)
|
|
|
|
}
|
|
} catch (e) {
|
|
context.commit("update_get_data_status", 3)
|
|
}
|
|
},
|
|
async getsexreg(context) {
|
|
context.commit("update_get_data_status", 1)
|
|
try {
|
|
let resp = await api.getsexreg(one_token())
|
|
if (resp.status != "OK") {
|
|
context.commit("update_get_data_status", 3)
|
|
} else {
|
|
context.commit("update_get_data_status", 2)
|
|
let data = {
|
|
records: resp.data.records,
|
|
total: resp.data.total
|
|
}
|
|
context.commit("update_sexes", data.records.sexes)
|
|
context.commit("update_religions", data.records.religions)
|
|
context.commit("update_titles", data.records.titles)
|
|
context.commit("update_kartuidentitass", data.records.kartuidentitass)
|
|
}
|
|
} catch (e) {
|
|
context.commit("update_get_data_status", 3)
|
|
}
|
|
},
|
|
async save(context, prm) {
|
|
context.commit("update_save_status", 1)
|
|
try {
|
|
prm.token = one_token()
|
|
let resp = await api.save(prm)
|
|
if (resp.status != "OK") {
|
|
context.commit("update_save_status", 3)
|
|
} else {
|
|
context.commit("update_save_status", 2)
|
|
context.commit("update_last_id", prm.M_PatientID)
|
|
context.commit("update_dialog_success", true)
|
|
var msg = "Data pasien " + prm.M_PatientName + " sudah terupdate dong ..."
|
|
context.commit("update_msg_success", msg)
|
|
|
|
}
|
|
} catch (e) {
|
|
context.commit("update_save_status", 3)
|
|
}
|
|
},
|
|
async newpatient(context, prm) {
|
|
context.commit("update_save_status", 1)
|
|
try {
|
|
prm.token = one_token()
|
|
let resp = await api.newpatient(prm)
|
|
if (resp.status != "OK") {
|
|
context.commit("update_save_status", 3)
|
|
} else {
|
|
context.commit("update_save_status", 2)
|
|
console.log(resp.data.id)
|
|
context.commit("update_last_id", resp.data.id)
|
|
context.commit("update_dialog_success", true)
|
|
var msg = "Data pasien " + prm.M_PatientName + " sudah tersimpan dong ..."
|
|
context.commit("update_msg_success", msg)
|
|
|
|
}
|
|
} catch (e) {
|
|
context.commit("update_save_status", 3)
|
|
}
|
|
},
|
|
async delete(context, prm) {
|
|
context.commit("update_save_status", 1)
|
|
try {
|
|
prm.token = one_token()
|
|
let resp = await api.xdelete(prm)
|
|
if (resp.status != "OK") {
|
|
context.commit("update_save_status", 3)
|
|
} else {
|
|
context.commit("update_save_status", 2)
|
|
context.commit("update_last_id", 0)
|
|
context.commit("update_dialog_confirmation_delete", false)
|
|
context.commit("update_dialog_success", true)
|
|
var msg = "Data setup " + prm.code + " sudah dihapus dong ..."
|
|
context.commit("update_msg_success", msg)
|
|
context.commit("update_company", {})
|
|
context.commit("update_selected_mous", [])
|
|
context.commit("update_mou", {})
|
|
context.commit("update_selected_doctors", [])
|
|
context.commit("update_start_date", moment(new Date()).format('YYYY-MM-DD'))
|
|
context.commit("update_end_date", moment(new Date()).format('YYYY-MM-DD'))
|
|
context.commit("update_promise_date", moment(new Date()).format('YYYY-MM-DD'))
|
|
context.commit("update_promise_time", moment(new Date()).format('HH:mm'))
|
|
context.commit("update_default_mou", {})
|
|
context.commit("update_default_doctor", {})
|
|
context.commit("update_default_doctor_address", {})
|
|
context.commit("update_doctor_address", [])
|
|
}
|
|
} catch (e) {
|
|
context.commit("update_save_status", 3)
|
|
}
|
|
},
|
|
async getaddress(context, prm) {
|
|
context.commit("update_save_status", 1)
|
|
try {
|
|
prm.token = one_token()
|
|
let resp = await api.getaddress(prm)
|
|
if (resp.status != "OK") {
|
|
context.commit("update_save_status", 3)
|
|
} else {
|
|
context.commit("update_save_status", 2)
|
|
let data = {
|
|
records: resp.data.records,
|
|
total: resp.data.total
|
|
}
|
|
context.commit("update_addresses", data.records)
|
|
}
|
|
} catch (e) {
|
|
context.commit("update_save_status", 3)
|
|
}
|
|
},
|
|
async searchcity(context, prm) {
|
|
context.commit("update_autocomplete_status", 1)
|
|
try {
|
|
let resp = await api.searchcity(one_token(), prm)
|
|
if (resp.status != "OK") {
|
|
context.commit("update_autocomplete_status", 3)
|
|
} else {
|
|
context.commit("update_autocomplete_status", 2)
|
|
let data = {
|
|
records: resp.data.records,
|
|
total: resp.data.total
|
|
}
|
|
context.commit("update_cities", resp.data.records)
|
|
}
|
|
} catch (e) {
|
|
context.commit("update_autocomplete_status", 3)
|
|
}
|
|
},
|
|
async searchdoctor(context, prm) {
|
|
context.commit("update_autocomplete_status", 1)
|
|
try {
|
|
var xpar = {}
|
|
xpar.search = prm
|
|
xpar.token = one_token()
|
|
let resp = await api.searchdoctor(xpar)
|
|
if (resp.status != "OK") {
|
|
context.commit("update_autocomplete_status", 3)
|
|
} else {
|
|
context.commit("update_autocomplete_status", 2)
|
|
let data = {
|
|
records: resp.data.records,
|
|
total: resp.data.total
|
|
}
|
|
var arr = resp.data.records
|
|
var xsel = context.state.selected_doctors
|
|
var filtered = arr.filter(o1 => xsel.filter(o2 => o2.id === o1.id).length === 0)
|
|
context.commit("update_doctors", filtered)
|
|
}
|
|
} catch (e) {
|
|
context.commit("update_autocomplete_status", 3)
|
|
}
|
|
},
|
|
async searchcompany(context, prm) {
|
|
context.commit("update_autocomplete_status", 1)
|
|
try {
|
|
prm.token = one_token()
|
|
|
|
let resp = await api.searchcompany(prm)
|
|
if (resp.status != "OK") {
|
|
context.commit("update_autocomplete_status", 3)
|
|
} else {
|
|
context.commit("update_autocomplete_status", 2)
|
|
let data = {
|
|
records: resp.data.records,
|
|
total: resp.data.total
|
|
}
|
|
context.commit("update_companies", resp.data.records)
|
|
}
|
|
} catch (e) {
|
|
context.commit("update_autocomplete_status", 3)
|
|
}
|
|
},
|
|
async filtersearchcompany(context, prm) {
|
|
context.commit("update_autocomplete_status", 1)
|
|
try {
|
|
prm.token = one_token()
|
|
|
|
let resp = await api.filtersearchcompany(prm)
|
|
if (resp.status != "OK") {
|
|
context.commit("update_autocomplete_status", 3)
|
|
} else {
|
|
context.commit("update_autocomplete_status", 2)
|
|
let data = {
|
|
records: resp.data.records,
|
|
total: resp.data.total
|
|
}
|
|
context.commit("update_filter_companies", resp.data.records)
|
|
}
|
|
} catch (e) {
|
|
context.commit("update_autocomplete_status", 3)
|
|
}
|
|
},
|
|
async getdistrict(context, prm) {
|
|
context.commit("update_get_data_status", 1)
|
|
try {
|
|
let resp = await api.getdistrict(one_token(), prm)
|
|
if (resp.status != "OK") {
|
|
context.commit("update_get_data_status", 3)
|
|
} else {
|
|
context.commit("update_get_data_status", 2)
|
|
let data = {
|
|
records: resp.data.records,
|
|
total: resp.data.total
|
|
}
|
|
context.commit("update_districts", resp.data.records)
|
|
}
|
|
} catch (e) {
|
|
context.commit("update_get_data_status", 3)
|
|
}
|
|
},
|
|
async getkelurahan(context, prm) {
|
|
context.commit("update_get_data_status", 1)
|
|
try {
|
|
let resp = await api.getkelurahan(one_token(), prm)
|
|
if (resp.status != "OK") {
|
|
context.commit("update_get_data_status", 3)
|
|
} else {
|
|
context.commit("update_get_data_status", 2)
|
|
let data = {
|
|
records: resp.data.records,
|
|
total: resp.data.total
|
|
}
|
|
context.commit("update_kelurahans", resp.data.records)
|
|
}
|
|
} catch (e) {
|
|
context.commit("update_get_data_status", 3)
|
|
}
|
|
},
|
|
async savenewaddress(context, prm) {
|
|
context.commit("update_save_status", 1)
|
|
try {
|
|
prm.token = one_token()
|
|
let resp = await api.savenewaddress(prm)
|
|
if (resp.status != "OK") {
|
|
context.commit("update_save_status", 3)
|
|
} else {
|
|
context.commit("update_save_status", 2)
|
|
context.commit("update_dialog_form_address", false)
|
|
context.commit("update_last_id", prm.M_PatientAddressM_PatientID)
|
|
context.commit("update_dialog_success", true)
|
|
var msg = "Penambahan data alamat pasien " + prm.M_PatientName + " sudah berhasil dong ..."
|
|
context.commit("update_msg_success", msg)
|
|
|
|
}
|
|
} catch (e) {
|
|
context.commit("update_save_status", 3)
|
|
}
|
|
},
|
|
async saveeditaddress(context, prm) {
|
|
context.commit("update_save_status", 1)
|
|
try {
|
|
prm.token = one_token()
|
|
let resp = await api.saveeditaddress(prm)
|
|
if (resp.status != "OK") {
|
|
context.commit("update_save_status", 3)
|
|
} else {
|
|
context.commit("update_save_status", 2)
|
|
context.commit("update_dialog_form_address", false)
|
|
context.commit("update_last_id", prm.M_PatientAddressM_PatientID)
|
|
context.commit("update_dialog_success", true)
|
|
var msg = "Perubahan data alamat pasien " + prm.M_PatientName + " sudah berhasil dong ..."
|
|
context.commit("update_msg_success", msg)
|
|
|
|
}
|
|
} catch (e) {
|
|
context.commit("update_save_status", 3)
|
|
}
|
|
},
|
|
async deleteaddress(context, prm) {
|
|
context.commit("update_save_status", 1)
|
|
try {
|
|
prm.token = one_token()
|
|
let resp = await api.deleteaddress(prm)
|
|
if (resp.status != "OK") {
|
|
context.commit("update_save_status", 3)
|
|
} else {
|
|
context.commit("update_save_status", 2)
|
|
context.commit("update_dialog_confirmation_delete_addr", false)
|
|
context.commit("update_last_id", prm.M_PatientAddressM_PatientID)
|
|
context.commit("update_dialog_success", true)
|
|
var msg = "Penghapusan data alamat " + prm.M_PatientAddressNote + " dari pasien " + prm.M_PatientName + " sudah berhasil dong ..."
|
|
context.commit("update_msg_success", msg)
|
|
|
|
}
|
|
} catch (e) {
|
|
context.commit("update_save_status", 3)
|
|
}
|
|
},
|
|
async getmou(context, prm) {
|
|
context.commit("update_lookup_order", 1)
|
|
try {
|
|
prm.start_date = context.state.start_date
|
|
prm.end_date = context.state.end_date
|
|
prm.token = one_token()
|
|
let resp = await api.getmou(prm)
|
|
if (resp.status != "OK") {
|
|
context.commit("update_lookup_order", 3)
|
|
} else {
|
|
context.commit("update_lookup_order", 2)
|
|
let data = {
|
|
records: resp.data.records,
|
|
total: resp.data.total
|
|
}
|
|
context.commit("update_mous", resp.data.records)
|
|
context.commit("update_mou", {})
|
|
context.commit("update_selected_mous", [])
|
|
}
|
|
} catch (e) {
|
|
context.commit("update_lookup_order", 3)
|
|
}
|
|
},
|
|
async getdeliveries(context, prm) {
|
|
context.commit("update_lookup_order", 1)
|
|
try {
|
|
prm.token = one_token()
|
|
let resp = await api.getdeliveries(prm)
|
|
if (resp.status != "OK") {
|
|
context.commit("update_lookup_order", 3)
|
|
} else {
|
|
context.commit("update_lookup_order", 2)
|
|
let data = {
|
|
records: resp.data.records,
|
|
total: resp.data.total
|
|
}
|
|
context.commit("update_deliveries", resp.data.records)
|
|
|
|
}
|
|
} catch (e) {
|
|
context.commit("update_lookup_order", 3)
|
|
}
|
|
},
|
|
}
|
|
}
|