Flatten nested repos
This commit is contained in:
154
test/vuex/one-process-resultentry-v4-debug/modules/re_lcprep.js
Normal file
154
test/vuex/one-process-resultentry-v4-debug/modules/re_lcprep.js
Normal file
@@ -0,0 +1,154 @@
|
||||
// 1 => LOADING
|
||||
// 2 => DONE
|
||||
// 3 => ERROR
|
||||
import * as api from "../api/re_px.js"
|
||||
window.api = api
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
get_data_status:0,
|
||||
save_status:0,
|
||||
dialog_lcprep:false,
|
||||
diagnosis_klinis:'',
|
||||
makroskopis:'',
|
||||
mikroskopis:'',
|
||||
kesimpulan:'',
|
||||
saran:'',
|
||||
selected_lcprep:{},
|
||||
results:[],
|
||||
doctors:[],
|
||||
selected_doctor:{},
|
||||
adekuasi:[],
|
||||
kategoriumum:[],
|
||||
interpretasi:[],
|
||||
maturasi:[]
|
||||
},
|
||||
mutations: {
|
||||
update_maturasi(state,value) {
|
||||
state.maturasi = value
|
||||
},
|
||||
update_doctors(state,value) {
|
||||
state.doctors = value
|
||||
},
|
||||
update_selected_doctor(state,value) {
|
||||
state.selected_doctor = value
|
||||
},
|
||||
update_save_status(state,value) {
|
||||
state.save_status = value
|
||||
},
|
||||
update_results(state,value) {
|
||||
state.results = value
|
||||
},
|
||||
update_adekuasi(state,value) {
|
||||
state.adekuasi = value
|
||||
},
|
||||
update_kategoriumum(state,value) {
|
||||
state.kategoriumum = value
|
||||
},
|
||||
update_interpretasi(state,value) {
|
||||
state.interpretasi = value
|
||||
},
|
||||
update_get_data_status(state,value) {
|
||||
state.get_data_status = value
|
||||
},
|
||||
update_selected_lcprep(state,value) {
|
||||
state.selected_lcprep = value
|
||||
},
|
||||
update_dialog_lcprep(state,value) {
|
||||
state.dialog_lcprep = value
|
||||
},
|
||||
update_diagnosis_klinis(state,value) {
|
||||
state.diagnosis_klinis = value
|
||||
},
|
||||
update_makroskopis(state,value) {
|
||||
state.makroskopis = value
|
||||
},
|
||||
update_mikroskopis(state,value) {
|
||||
state.mikroskopis = value
|
||||
},
|
||||
update_kesimpulan(state,value) {
|
||||
state.kesimpulan = value
|
||||
},
|
||||
update_saran(state,value) {
|
||||
state.saran = value
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
async get_lcprepresult(context,prm) {
|
||||
context.commit("update_get_data_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.getlcprepresult(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_results", data.records['results'])
|
||||
context.commit("update_adekuasi", data.records['adekuasi'])
|
||||
context.commit("update_kategoriumum", data.records['kategoriumum'])
|
||||
context.commit("update_interpretasi", data.records['interpretasi'])
|
||||
context.commit("update_doctors", data.records['doctors'])
|
||||
var selected_doctor = {
|
||||
id:data.records['results'][0]['doctor_id'],
|
||||
name:data.records['results'][0]['doctor_name']
|
||||
}
|
||||
context.commit("update_selected_doctor", selected_doctor)
|
||||
context.commit("update_dialog_lcprep", true)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_get_data_status", 3)
|
||||
}
|
||||
},
|
||||
async get_doctors(context,prm) {
|
||||
context.commit("update_get_data_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.get_doctors(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_doctors", data.records)
|
||||
context.commit("update_selected_doctor", {})
|
||||
context.commit("update_dialog_fna", true)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_get_data_status", 3)
|
||||
}
|
||||
},
|
||||
async saveresult_lcprep(context,prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
//prm.id = context.state.selected_fna.id
|
||||
prm.token = one_token()
|
||||
let resp = await api.saveresult_lcprep(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_dialog_lcprep", false)
|
||||
context.dispatch('re_px/search','',{root:true})
|
||||
context.dispatch('re_patient/info_req','',{root:true})
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user