Flatten nested repos

This commit is contained in:
sas.fajri
2026-04-27 10:13:31 +07:00
parent 01c2963a43
commit 8347aef8f4
17935 changed files with 5015229 additions and 3 deletions

View File

@@ -0,0 +1,69 @@
// 1 => LOADING
// 2 => DONE
// 3 => ERROR
import * as api from "../api/delivery.js"
export default {
namespaced: true,
state: {
lookup_delivery:0,
lookup_error_message:'',
deliveries: [],
total_delivery: 0,
selected_delivery: {},
address_patient:[],
address_doctor:[],
hp_patient:'',
hp_doctor:''
},
mutations: {
update_lookup_error_message(state,status) {
state.search_error_message = status
},
update_lookup_delivery(state,status) {
state.lookup_delivery = status
},
update_deliveries(state,data) {
state.deliveries= data.records
state.total_delivery= data.total
},
update_selected_delivery(state,val) {
state.selected_delivery=val
},
update_address_patient(state,val) {
state.address_patient=val
},
update_address_doctor(state,val) {
state.address_doctor=val
},
update_hp_patient(state,val) {
state.hp_patient = val
},
update_hp_doctor(state,val) {
state.hp_doctor = val
}
},
actions: {
async lookup(context) {
context.commit("update_lookup_delivery",1)
try {
let resp= await api.lookup(one_token())
if (resp.status != "OK") {
context.commit("update_lookup_delivery",3)
context.commit("update_lookup_error_message",resp.message)
} else {
context.commit("update_lookup_delivery",2)
context.commit("update_lookup_error_message","")
let data = {
records : resp.data.records,
total: resp.data.total
}
context.commit("update_deliveries",data)
}
} catch(e) {
context.commit("update_lookup_delivery",3)
context.commit("update_lookup_error_message",e.message )
}
}
}
}

View File

@@ -0,0 +1,43 @@
// 1 => LOADING
// 2 => DONE
// 3 => ERROR
//import * as api from "../api/patient.js"
export default {
namespaced: true,
state: {
verification_delivery:[
{'id':1,'check':false,'note':'','label':'Email ke Dokter : emaildoctor@email.com'},
{'id':2,'check':false,'note':'','label':'Kirim ke Pasien : Jl. Padepokan Rindu No. 99 Tegal Barat'}
],
verification_payment:[
{'id':1,'check':false,'note':'','label':'Minimum pembayaran terpenuhi'}
]
},
mutations: {
update_testing_txt_parent_patient(state,data) {
state.verification_patient[data.idx].note = data.val
},
update_testing_cbx_parent_patient(state,data) {
state.verification_patient[data.idx].check = data.val
},
update_verification_patient(state,data){
state.verification_patient = data.verification_patient
},
update_verification_doctor(state,data){
state.verification_doctor = data.verification_doctor
},
update_testing_txt_parent_doctor(state,data) {
state.verification_doctor[data.idx].note = data.val
},
update_testing_cbx_parent_doctor(state,data) {
state.verification_doctor[data.idx].check = data.val
}
},
actions: {
}
}

View File

@@ -0,0 +1,190 @@
// 1 => LOADING
// 2 => DONE
// 3 => ERROR
import * as api from "../api/done.js"
export default {
namespaced: true,
state: {
last_id:-1,
last_saved_id:-1,
x_addr_id:0,
act:'new',
act_addr:'new',
get_data_status:0,
search_trx: 0,
search_status: 0,
search_error_message: '',
start_date:moment(new Date()).format('YYYY-MM-DD'),
end_date:moment(new Date()).format('YYYY-MM-DD'),
total_transaction: 0,
transactions:[],
selected_transaction: {},
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: "",
autocomplete_status:0,
dialog_form_address: false,
errors:[],
open_dialog_info:false,
msg_info:'',
current_page:1,
total_page:1,
total_transactions:0,
search:'',
selected_sampletype:{},
msg_action:'',
dialog_action:false,
},
mutations: {
update_dialog_action(state, val) {
state.dialog_action = val
},
update_msg_action(state, val) {
state.msg_action = val
},
update_selected_sampletype(state, val) {
state.selected_sampletype = val
},
update_search(state, val) {
state.search = val
},
update_total_page(state, val) {
state.total_page = 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_start_date(state, val) {
state.start_date = val
},
update_end_date(state, val) {
state.end_date = 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_transaction(state, val) {
state.search_transaction = val
},
update_transactions(state, data) {
state.transactions = data
},
update_selected_transaction(state, val) {
state.selected_transaction = 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_search_status(state, val) {
state.search_status = val
},
update_errors(state, val) {
state.errors = val
},
update_total_transactions(state, val) {
state.total_transactions = val
},
update_open_dialog_info(state, val) {
state.open_dialog_info = val
},
update_msg_info(state, val) {
state.msg_info = val
},
},
actions: {
async search(context, prm) {
context.commit("update_search_transaction", 1)
try {
prm.token = one_token()
let resp = await api.search(prm)
if (resp.status != "OK") {
context.commit("update_search_transaction", 3)
context.commit("update_search_error_message", resp.message)
} else {
context.commit("update_search_transaction", 2)
context.commit("update_search_error_message", "")
let data = {
records: resp.data.records,
total: resp.data.total
}
context.commit("update_transactions", data.records)
context.commit("update_total_transactions", data.total)
context.commit("update_total_page", data.total)
context.commit("update_no_save", 0)
/*if(prm.lastid === -1){
context.commit("update_selected_transaction", data.records[0])
var doc = data.records[0]
}
else{
context.commit("update_selected_transaction", data.records[prm.lastid])
var doc = data.records[prm.lastid]
}*/
}
} catch (e) {
context.commit("update_search_transaction", 3)
context.commit("update_search_error_message", e.message)
console.log(e)
}
}
}
}

View File

@@ -0,0 +1,263 @@
// 1 => LOADING
// 2 => DONE
// 3 => ERROR
import * as api from "../api/patient.js"
export default {
namespaced: true,
state: {
search_patient: 0,
search_error_message: '',
patients: [],
patient_address: [],
doctor_address: [],
total_patient: 0,
selected_patient: {},
now_prm:{},
save_status: 0,
btn_save_seen: true,
pgrs_save: false,
save_error_message: '',
open_dialog_verification: false,
msg_info_verification: "",
no_save: 0,
open_alert_verification: false,
msg_alert_verification: "Yakin, belum disimpan lhoooo ?",
msg_action:'',
dialog_action:false,
show_right:'N',
verifications:[],
snackbar:{value:false,timeout:4000,text:''},
name:'',
nolab:'',
disabled_button:false,
dialoglist:false,
lookup:0,
barcodes:[]
},
mutations: {
update_barcodes(state, data) {
state.barcodes = data
},
update_lookup(state, data) {
state.lookup = data
},
update_dialoglist(state, data) {
state.dialoglist = data
},
update_disabled_button(state, data) {
state.disabled_button = data
},
update_name(state, val) {
state.name = val
},
update_nolab(state, val) {
state.nolab = val
},
update_snackbar(state, patient) {
state.snackbar = patient
},
update_now_prm(state, patient) {
state.now_prm = patient
},
update_search_error_message(state, patient) {
state.search_error_message = patient
},
update_search_patient(state, patient) {
state.search_patient = patient
},
update_patients(state, data) {
state.patients = data.records
state.total_patient = data.total
},
update_selected_patient(state, val) {
state.selected_patient = 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_dialog_action(state, val) {
state.dialog_action = val },
update_msg_action(state, val) {
state.msg_action = val
},
update_save_error_message(state, msg) {
state.save_error_message = ''
},
update_open_dialog_verification(state, val) {
state.open_dialog_verification = val
},
update_msg_info_verification(state, val) {
state.msg_info_verification = val
},
update_no_save(state, val) {
state.no_save = val
},
update_open_alert_verification(state, val) {
state.open_alert_verification = val
},
update_msg_alert_verification(state, val) {
state.msg_alert_verification = val
},
update_show_right(state, patient) {
state.show_right = patient
},
update_verifications(state, value) {
state.verifications = value
},
},
actions: {
async search(context, prm) {
context.commit("update_search_patient", 1)
try {
let resp = await api.search(one_token(), prm.nolab, prm.name, prm.status)
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_patients", data)
context.commit("update_selected_patient", data.records[0])
var pat = data.records[0]
context.commit("update_show_right","N")
if(pat.check_status !== '2'){
context.commit("update_show_right","Y")
context.commit("update_verifications",pat.verifications)
}
}
} catch (e) {
context.commit("update_search_patient", 3)
context.commit("update_search_error_message", e.message)
console.log(e)
}
},
async lookup_barcodes(context,prm) {
context.commit("update_lookup",1)
try {
prm.token = one_token()
let resp= await api.lookup_barcodes(prm)
if (resp.status != "OK") {
context.commit("update_lookup",3)
} else {
context.commit("update_lookup",2)
let data = {
records : resp.data.records
}
context.commit("update_barcodes",data.records)
}
} catch(e) {
context.commit("update_lookup",3)
console.log(e)
}
},
async addnewlabel(context, prm) {
context.commit("update_save_status", 1)
try {
prm.token = one_token()
let resp = await api.addnewlabel(prm)
if (resp.status != "OK") {
context.commit("update_save_status", 3)
context.commit("update_save_error_message", resp.message)
} else {
context.commit("update_save_status", 2)
context.commit("update_save_error_message", resp.message)
context.dispatch("lookup_barcodes",{ohid:prm.orderid})
context.commit("done/update_dialog_action",false,{root:true})
}
} catch (e) {
context.commit("update_save_status", 3)
context.commit("update_save_error_message", e.message)
console.log(e)
}
},
async save(context, prm) {
context.commit("update_save_status", 1)
context.commit("update_btn_save_seen", false)
context.commit("update_pgrs_save", true)
try {
let resp = await api.save(one_token(),prm.patient, prm.status)
if (resp.status != "OK") {
context.commit("update_save_status", 3)
context.commit("update_save_error_message", resp.message)
} else {
context.commit("update_save_status", 2)
context.commit("update_save_error_message", resp.message)
context.commit("update_no_save", 0)
context.commit("update_btn_save_seen", true)
context.commit("update_pgrs_save", false)
let data = {
records: resp.data.records,
total: resp.data.total
}
let msg = data.records.message
context.commit("update_msg_info_verification", msg)
context.commit("update_open_dialog_verification", true)
}
} catch (e) {
context.commit("update_save_status", 3)
context.commit("update_save_error_message", e.message)
console.log(e)
}
},
async verify(context, prm) {
context.commit("update_save_status", 1)
context.commit("update_btn_save_seen", false)
context.commit("update_pgrs_save", true)
try {
prm.token = one_token()
let resp = await api.verify(prm)
if (resp.status != "OK") {
context.commit("update_save_status", 3)
context.commit("update_btn_save_seen", true)
context.commit("update_save_error_message", resp.message)
} else {
context.commit("update_save_status", 2)
context.commit("update_save_error_message", resp.message)
context.commit("update_no_save", 0)
context.commit("update_btn_save_seen", true)
context.commit("update_pgrs_save", false)
context.commit("disabled_button", false)
let data = {
records: resp.data.records,
total: resp.data.total
}
let msg = data.records.message
if(prm.act === 'Y')
context.commit("update_dialog_action", false)
else
context.commit("update_dialoglist", false)
var snackbar = {value:true,timeout:4000,text:msg}
context.commit("update_snackbar",snackbar)
var xprm = {
name:prm.name,
nolab: prm.nolab,
//status: prm.status
}
context.dispatch("search",xprm)
context.dispatch("done/search",prm.done_search,{root:true})
}
} catch (e) {
context.commit("update_save_status", 3)
context.commit("update_btn_save_seen", true)
context.commit("update_save_error_message", e.message)
console.log(e)
}
}
}
}

View File

@@ -0,0 +1,65 @@
// 1 => LOADING
// 2 => DONE
// 3 => ERROR
import * as api from "../api/px.js"
export default {
namespaced: true,
state: {
dialog_px_is_active: false,
search_status : 0,
pxs:[],
total_px: 0,
search:'',
selected_px: {},
moucompany:{}
},
mutations: {
update_dialog_px_is_active(state,status) {
state.dialog_px_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_pxs(state,data) {
state.pxs= data.records
state.total_px= data.total
},
update_selected_px(state,val) {
state.selected_px=val
},
update_moucompany(state,val) {
state.moucompany={companyid:val.T_OrderHeaderM_CompanyID,mouid:val.T_OrderHeaderM_MouID,orderdate:val.orderdate}
}
},
actions: {
async search(context,prm) {
context.commit("update_search_status",1)
try {
let resp= await api.search(context.state.search, context.state.moucompany.companyid,context.state.moucompany.mouid,context.state.moucompany.orderdate,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,
total: resp.data.total
}
context.commit("update_pxs",data)
}
} catch(e) {
context.commit("update_search_status",3)
context.commit("update_search_error_message",e.message )
}
}
}
}

View File

@@ -0,0 +1,53 @@
// 1 => LOADING
// 2 => DONE
// 3 => ERROR
import * as api from "../api/status.js"
export default {
namespaced: true,
state: {
lookup_status:0,
lookup_error_message:'',
statuses: [],
total_status: 0,
selected_status: {"id":2,"code":"FO.Verification","name":"Baru"}
},
mutations: {
update_lookup_error_message(state,status) {
state.search_error_message = status
},
update_lookup_status(state,status) {
state.search_status = status
},
update_statuses(state,data) {
state.statuses= data.records
state.total_status= data.total
},
update_selected_status(state,val) {
state.selected_status=val
}
},
actions: {
async lookup(context) {
context.commit("update_lookup_status",1)
try {
let resp= await api.lookup()
if (resp.status != "OK") {
context.commit("update_lookup_status",3)
context.commit("update_lookup_error_message",resp.message)
} else {
context.commit("update_lookup_status",2)
context.commit("update_lookup_error_message","")
let data = {
records : resp.data.records,
total: resp.data.total
}
context.commit("update_statuses",data)
}
} catch(e) {
context.commit("update_lookup_status",3)
context.commit("update_lookup_error_message",e.message )
}
}
}
}

View File

@@ -0,0 +1,71 @@
// 1 => LOADING
// 2 => DONE
// 3 => ERROR
import * as api from "../api/supplies.js"
export default {
namespaced: true,
state: {
save_status: 0,
save_error_message: '',
no_save: 0,
btn_save_seen: true,
pgrs_save: false,
open_alert_supplies: false,
msg_alert_supplies: "Yakin, belum disimpan lhoooo ?"
},
mutations: {
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, val) {
state.save_error_message = val
},
update_no_save(state, val) {
state.no_save = val
},
update_open_alert_supplies(state, val) {
state.open_alert_supplies = val
},
update_msg_alert_supplies(state, val) {
state.msg_alert_supplies = val
}
},
actions: {
async save(context, prm) {
context.commit("update_save_status", 1)
context.commit("update_btn_save_seen", false)
context.commit("update_pgrs_save", true)
try {
let resp = await api.save(one_token(),prm.orderid, prm.supplies,prm.barcode)
if (resp.status != "OK") {
context.commit("update_save_status", 3)
context.commit("update_save_error_message", resp.message)
} else {
context.commit("update_save_status", 2)
context.commit("update_save_error_message", resp.message)
context.commit("update_no_save", 0)
context.commit("update_btn_save_seen", true)
context.commit("update_pgrs_save", false)
let data = {
records: resp.data.records,
total: resp.data.total
}
context.commit("verification/update_verification_supplies", data.records.supplies, { root: true })
context.commit("verification/update_verification_barcode", data.records.barcode, { root: true })
}
} catch (e) {
context.commit("update_save_status", 3)
context.commit("update_save_error_message", e.message)
console.log(e)
}
}
}
}

View File

@@ -0,0 +1,19 @@
// 1 => LOADING
// 2 => DONE
// 3 => ERROR
//import * as api from "../api/patient.js"
export default {
namespaced: true,
state: {
supplies:[],
barcodes:[]
},
mutations: {
},
actions: {
}
}

View File

@@ -0,0 +1,33 @@
// 1 => LOADING
// 2 => DONE
// 3 => ERROR
//import * as api from "../api/patient.js"
export default {
namespaced: true,
state: {
verification_patient_name :{check:false,note:'',label:'Nama x sudah sesuai'},
testing:'fajri ganteng',
testingObj:{check:true,note:'sdvsdvds',label:'nama ne udah bener 1 ?'}
},
mutations: {
update_patient_name(state,data) {
state.verification_patient_name = data
},
update_testing(state,data) {
state.testing = data
},
update_testing_obj(state,data) {
state.testingObj = data
},
update_testing_txt(state,data) {
state.testingObj.note = data
},
update_testing_cbx(state,data) {
state.testingObj.check = data
}
},
actions: {
}
}

View File

@@ -0,0 +1,132 @@
// 1 => LOADING
// 2 => DONE
// 3 => ERROR
//import * as api from "../api/patient.js"
export default {
namespaced: true,
state: {
dialog_delivery_is_active: false,
verification_patient: [
{ 'id': 1, 'chex': false, 'note': '', 'label': 'Nama sudah sesuai' },
{ 'id': 2, 'chex': false, 'note': '', 'label': 'No RM sudah sesuai' },
{ 'id': 3, 'chex': false, 'note': '', 'label': 'Alamat sudah sesuai' },
{ 'id': 4, 'chex': false, 'note': '', 'label': 'No HP sudah sesuai' },
{ 'id': 5, 'chex': false, 'note': '', 'label': 'DOB sudah sesuai' },
{ 'id': 6, 'chex': false, 'note': '', 'label': 'Umur sudah sesuai' }
],
verification_doctor: [
{ 'id': 1, 'chex': false, 'note': '', 'label': 'Nama dokter sudah sesuai' },
{ 'id': 2, 'chex': false, 'note': '', 'label': 'Alamat sudah sesuai' }
],
verification_delivery: [
{ 'id': 1, 'chex': false, 'note': '', 'vilageid': 0, 'type': 'reguler', 'label': 'Email ke Dokter : emaildoctor@email.com' },
{ 'id': 2, 'chex': false, 'note': '', 'vilageid': 2, 'type': 'indigo', 'label': 'Kirim ke Pasien : Jl. Padepokan Rindu No. 99 Tegal Barat' }
],
verification_payment: [
{ 'id': 1, 'chex': false, 'note': '', 'type': 'reguler', 'label': 'Minimum pembayaran terpenuhi' }
],
verification_supplies: [
{ 'id': 1, 'chex': false, 'qty': '', 'name': '-' }
],
verification_barcode: [
{ 'id': 1, 'chex': false, 'qty': '', 'samplename': '-', 'barcodenumber': '-', 'qty': 1 }
],
verification_companymou: [
{ 'id': 1, 'chex': false, 'note': '', 'label': 'Nama comany sudah sesuai' },
{ 'id': 2, 'chex': false, 'note': '', 'label': 'Mou sudah sesuai' }
],
verification_px: [
{ 'id': 1, 'chex': false, 'pxname': '', 'bruto': '-', 'discount': '-', 'total': 1, 'addon': false }
],
verification_info: [
{ 'id': 6, 'chex': false, 'note': '', 'label': 'Receive sample only' }
]
},
mutations: {
update_dialog_delivery_is_active(state, status) {
state.dialog_delivery_is_active = status
},
update_testing_txt_parent_patient(state, data) {
state.verification_patient[data.idx].note = data.val
},
update_testing_cbx_parent_patient(state, data) {
state.verification_patient[data.idx].chex = data.val
},
update_verification_patient(state, data) {
state.verification_patient = data
},
update_verification_doctor(state, data) {
state.verification_doctor = data
},
update_testing_txt_parent_doctor(state, data) {
state.verification_doctor[data.idx].note = data.val
},
update_testing_cbx_parent_doctor(state, data) {
state.verification_doctor[data.idx].chex = data.val
},
update_verification_delivery(state, data) {
state.verification_delivery = data
},
update_testing_txt_parent_delivery(state, data) {
state.verification_delivery[data.idx].note = data.val
},
update_testing_cbx_parent_delivery(state, data) {
state.verification_delivery[data.idx].chex = data.val
},
update_verification_payment(state, data) {
state.verification_payment = data
},
update_testing_txt_parent_payment(state, data) {
state.verification_payment[data.idx].note = data.val
},
update_testing_cbx_parent_payment(state, data) {
state.verification_payment[data.idx].chex = data.val
},
update_verification_supplies(state, data) {
state.verification_supplies = data
},
update_testing_txt_parent_supplies(state, data) {
state.verification_supplies[data.idx].qty = data.val
},
update_testing_cbx_parent_supplies(state, data) {
state.verification_supplies[data.idx].chex = data.val
},
update_verification_barcode(state, data) {
state.verification_barcode = data
},
update_testing_qty_parent_barcode(state, data) {
state.verification_barcode[data.idx].qty = data.val
},
update_testing_cbx_parent_barcode(state, data) {
state.verification_barcode[data.idx].chex = data.val
},
update_verification_company_mou(state, data) {
state.verification_companymou = data
},
update_testing_txt_parent_company_mou(state, data) {
state.verification_companymou[data.idx].note = data.val
},
update_testing_cbx_parent_company_mou(state, data) {
state.verification_companymou[data.idx].chex = data.val
},
update_verification_px(state, data) {
state.verification_px = data
},
update_testing_cbx_parent_px(state, data) {
state.verification_px[data.idx].chex = data.val
},
update_verification_info(state, data) {
state.verification_info = data
},
update_testing_txt_parent_info(state, data) {
state.verification_info[data.idx].note = data.val
},
update_testing_cbx_parent_info(state, data) {
state.verification_info[data.idx].chex = data.val
}
},
actions: {
}
}

View File

@@ -0,0 +1,61 @@
// 1 => LOADING
// 2 => DONE
// 3 => ERROR
import * as api from "../api/verificationdoctor.js"
export default {
namespaced: true,
state: {
ohid:0,
lookup_verification_doctor:0,
lookup_error_message:'',
verifications:[]
},
mutations: {
update_ohid(state,val) {
state.ohid = val
},
update_lookup_error_message(state,msg) {
state.lookup_error_message = msg
},
update_lookup_verification_doctor(state,status) {
state.lookup_verification_doctor = status
},
update_verifications(state,data) {
state.verifications = data.records
},
update_txt_verication_doctor(state,data) {
state.verifications[data.idx].note = data.val
},
update_cbx_verification_doctor(state,data) {
state.verifications[data.idx].check = data.val
}
},
actions: {
async lookup(context,prm) {
if(context.state.ohid !== prm.ohid){
context.commit("update_lookup_verification_doctor",1)
try {
let resp= await api.lookup(prm.ohid)
if (resp.status != "OK") {
context.commit("update_lookup_verification_doctor",3)
context.commit("update_lookup_error_message",resp.message)
} else {
context.commit("update_lookup_verification_doctor",2)
context.commit("update_lookup_error_message","")
let data = {
records : resp.data.records
}
context.commit("update_verifications",data)
context.commit("update_ohid",prm.ohid)
}
} catch(e) {
context.commit("lookup_verification_doctor",3)
context.commit("update_lookup_error_message",e.message )
console.log(e)
}
}
}
}
}

View File

@@ -0,0 +1,56 @@
// 1 => LOADING
// 2 => DONE
// 3 => ERROR
import * as api from "../api/vilage.js"
export default {
namespaced: true,
state: {
search_status : 0,
vilages:[],
total_vilages: 0,
selected_vilage: {}
},
mutations: {
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_vilages(state,data) {
state.vilages= data.records
state.total_vilages= data.total
},
update_selected_vilage(state,val) {
state.selected_vilage=val
}
},
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_vilages",data)
}
} catch(e) {
context.commit("update_search_status",3)
context.commit("update_search_error_message",e.message )
}
}
}
}