Flatten nested repos
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
import * as api from "../api/company.js"
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
loading: false,
|
||||
company: { M_CompanyID : 0 , M_CompanyName : 'All'},
|
||||
companies: [],
|
||||
error: '',
|
||||
token: {}
|
||||
},
|
||||
mutations: {
|
||||
update_loading(state,status) {
|
||||
state.loading= status
|
||||
},
|
||||
update_company(state,status) {
|
||||
state.company= status
|
||||
},
|
||||
update_companies(state,status) {
|
||||
state.companies= status
|
||||
},
|
||||
update_error(state,status) {
|
||||
state.error= status
|
||||
},
|
||||
update_token(state,status) {
|
||||
state.token= status
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
async search(context,qry) {
|
||||
context.commit("update_loading", true)
|
||||
try {
|
||||
let token = context.state.token
|
||||
if (token.hasOwnProperty("token")) {
|
||||
token.cancel()
|
||||
}
|
||||
token = axios.CancelToken.source()
|
||||
context.commit("update_token",token)
|
||||
|
||||
let resp= await api.search(one_token(),qry, token.token)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_loading", false)
|
||||
context.commit("update_error", resp.message)
|
||||
} else {
|
||||
context.commit("update_loading",false)
|
||||
context.commit("update_error","")
|
||||
context.commit('update_companies',resp.data.data)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_loading",false)
|
||||
context.commit("update_error",e.message )
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,136 @@
|
||||
// 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_cytologi:false,
|
||||
diagnosis_klinis:'',
|
||||
makroskopis:'',
|
||||
mikroskopis:'',
|
||||
kesimpulan:'',
|
||||
saran:'',
|
||||
selected_cytologi:{},
|
||||
results:[],
|
||||
doctors:[],
|
||||
selected_doctor:{}
|
||||
},
|
||||
mutations: {
|
||||
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_get_data_status(state,value) {
|
||||
state.get_data_status = value
|
||||
},
|
||||
update_selected_fna(state,value) {
|
||||
state.selected_fna = value
|
||||
},
|
||||
update_dialog_cytologi(state,value) {
|
||||
state.dialog_cytologi = 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_cytologiresult(context,prm) {
|
||||
context.commit("update_get_data_status", 1)
|
||||
try {
|
||||
console.log(prm)
|
||||
prm.token = one_token()
|
||||
console.log("wweee")
|
||||
let resp = await api.getcytologiresult(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_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_cytologi", 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_cytologi", true)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_get_data_status", 3)
|
||||
}
|
||||
},
|
||||
async saveresult_cytologi(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_cytologi(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_cytologi", false)
|
||||
context.dispatch('re_px/search','',{root:true})
|
||||
context.dispatch('re_patient/info_req','',{root:true})
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,172 @@
|
||||
// 1 => LOADING
|
||||
// 2 => DONE
|
||||
// 3 => ERROR
|
||||
import * as api from "../api/re_dnafragmentasi.js"
|
||||
window.api = api
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
get_data_status:0,
|
||||
save_status:0,
|
||||
dialog_dnafragmentasi:false,
|
||||
diagnosis_klinis:'',
|
||||
halo_luas:'',
|
||||
halo_sedang:'',
|
||||
halo_sempit:'',
|
||||
tanpa_halo:'',
|
||||
kesimpulan:'',
|
||||
catatan:'',
|
||||
dfi:'',
|
||||
selected_methode:{},
|
||||
results:[],
|
||||
doctors:[],
|
||||
selected_doctor:{},
|
||||
onprocess:false,
|
||||
methodes:[],
|
||||
selected_dnafragmentasi:{}
|
||||
},
|
||||
mutations: {
|
||||
update_selected_dnafragmentasi(state,value) {
|
||||
state.selected_dnafragmentasi = value
|
||||
},
|
||||
update_methodes(state,value) {
|
||||
state.methodes = value
|
||||
},
|
||||
update_selected_methode(state,value) {
|
||||
state.selected_methode = value
|
||||
},
|
||||
update_dfi(state,value) {
|
||||
state.dfi = value
|
||||
},
|
||||
update_onprocess(state,value) {
|
||||
state.onprocess = 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_get_data_status(state,value) {
|
||||
state.get_data_status = value
|
||||
},
|
||||
update_selected_fna(state,value) {
|
||||
state.selected_fna = value
|
||||
},
|
||||
update_dialog_dnafragmentasi(state,value) {
|
||||
state.dialog_dnafragmentasi = value
|
||||
},
|
||||
update_diagnosis_klinis(state,value) {
|
||||
state.diagnosis_klinis = value
|
||||
},
|
||||
update_halo_luas(state,value) {
|
||||
state.halo_luas = value
|
||||
},
|
||||
update_halo_sedang(state,value) {
|
||||
state.halo_sedang = value
|
||||
},
|
||||
update_halo_sempit(state,value) {
|
||||
state.halo_sempit = value
|
||||
},
|
||||
update_tanpa_halo(state,value) {
|
||||
state.tanpa_halo = value
|
||||
},
|
||||
update_kesimpulan(state,value) {
|
||||
state.kesimpulan = value
|
||||
},
|
||||
update_catatan(state,value) {
|
||||
state.catatan = value
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
async get_dnafragmentasiresult(context,prm) {
|
||||
context.commit("update_get_data_status", 1)
|
||||
try {
|
||||
//console.log(prm)
|
||||
prm.token = one_token()
|
||||
|
||||
let resp = await api.getdnafragmentasiresult(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
|
||||
}
|
||||
console.log(data.records)
|
||||
context.commit("update_dialog_dnafragmentasi", true)
|
||||
context.commit("update_results", data.records['results'])
|
||||
context.commit("update_doctors", data.records['doctors'])
|
||||
context.commit("update_methodes", data.records['methodes'])
|
||||
var selected_doctor = {
|
||||
id:data.records['results']['doctor_id'],
|
||||
name:data.records['results']['doctor_name']
|
||||
}
|
||||
context.commit("update_selected_doctor", selected_doctor)
|
||||
var selected_methode = {
|
||||
id:data.records['results']['methode_id'],
|
||||
name:data.records['results']['methode_name']
|
||||
}
|
||||
console.log("ger result dna fragmentasi")
|
||||
context.commit("update_selected_methode", selected_methode)
|
||||
|
||||
}
|
||||
} 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_dnafragmentasi", true)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_get_data_status", 3)
|
||||
}
|
||||
},
|
||||
async saveresult_dnafragmentasi(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_dnafragmentasi(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_onprocess", false)
|
||||
context.commit("update_dialog_dnafragmentasi", false)
|
||||
context.dispatch('re_px/search','',{root:true})
|
||||
context.dispatch('re_patient/info_req','',{root:true})
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
134
test/vuex/one-process-resultverification-v21/modules/re_fna.js
Normal file
134
test/vuex/one-process-resultverification-v21/modules/re_fna.js
Normal file
@@ -0,0 +1,134 @@
|
||||
// 1 => LOADING
|
||||
// 2 => DONE
|
||||
// 3 => ERROR
|
||||
import * as api from "../api/re_fna.js"
|
||||
window.api = api
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
get_data_status:0,
|
||||
save_status:0,
|
||||
dialog_fna:false,
|
||||
diagnosis_klinis:'',
|
||||
makroskopis:'',
|
||||
mikroskopis:'',
|
||||
kesimpulan:'',
|
||||
saran:'',
|
||||
selected_fna:{},
|
||||
results:[],
|
||||
doctors:[],
|
||||
selected_doctor:{}
|
||||
},
|
||||
mutations: {
|
||||
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_get_data_status(state,value) {
|
||||
state.get_data_status = value
|
||||
},
|
||||
update_selected_fna(state,value) {
|
||||
state.selected_fna = value
|
||||
},
|
||||
update_dialog_fna(state,value) {
|
||||
state.dialog_fna = 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_fnaresult(context,prm) {
|
||||
context.commit("update_get_data_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.getfnaresult(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_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_fna", 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_fna(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_fna(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_fna", false)
|
||||
context.dispatch('re_px/search','',{root:true})
|
||||
context.dispatch('re_patient/info_req','',{root:true})
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
import * as api from "../api/re_history.js"
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
order_id:0,
|
||||
search_status:0,
|
||||
search_error_message:'',
|
||||
result: [],
|
||||
selected_px:[] ,
|
||||
dates: [],
|
||||
pxs: [],
|
||||
|
||||
dialog_history: false,
|
||||
selected_tab: 0
|
||||
},
|
||||
mutations: {
|
||||
update_search_error_message(state,status) {
|
||||
state.search_error_message = status
|
||||
},
|
||||
update_search_status(state,status) {
|
||||
state.search_status = status
|
||||
},
|
||||
update_id(state, id) {
|
||||
state.order_id = id
|
||||
},
|
||||
update_dates(state, dates) {
|
||||
state.dates= dates
|
||||
},
|
||||
update_result(state, result) {
|
||||
state.result= result
|
||||
},
|
||||
update_pxs(state, pxs) {
|
||||
state.pxs = pxs
|
||||
},
|
||||
update_selected_px(state, px) {
|
||||
state.selected_px = px
|
||||
},
|
||||
|
||||
update_dialog_history(state, v) {
|
||||
state.dialog_history = v
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
async history(context) {
|
||||
context.commit("update_search_status", 1)
|
||||
try {
|
||||
context.commit('update_pxs', [])
|
||||
context.commit('update_result', [])
|
||||
context.commit('update_dates', [])
|
||||
let resp= await api.history(one_token(), context.rootState.re_patient.selected_patient.T_OrderHeaderID)
|
||||
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_result', resp.data.result)
|
||||
context.commit('update_selected_px', resp.data.pxs)
|
||||
context.commit('update_pxs', resp.data.pxs)
|
||||
context.commit('update_dates',resp.data.dates)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_search_status",3)
|
||||
context.commit("update_search_error_message",e.message )
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,154 @@
|
||||
// 1 => LOADING
|
||||
// 2 => DONE
|
||||
// 3 => ERROR
|
||||
import * as api from "../api/re_lcprep.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)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
216
test/vuex/one-process-resultverification-v21/modules/re_mikro.js
Normal file
216
test/vuex/one-process-resultverification-v21/modules/re_mikro.js
Normal file
@@ -0,0 +1,216 @@
|
||||
// 1 => LOADING
|
||||
// 2 => DONE
|
||||
// 3 => ERROR
|
||||
import * as api from "../api/re_mikro.js"
|
||||
window.api = api
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
get_data_status:0,
|
||||
save_status:0,
|
||||
dialog_mikro:false,
|
||||
diagnosis_klinis:'',
|
||||
hasil_biakan:'',
|
||||
sample_name:'',
|
||||
kesimpulan:'',
|
||||
saran:'',
|
||||
result_other:'',
|
||||
selected_mikro:{},
|
||||
results:{xid:'0',orderdetail_id:'0',T_BacteriaID:'0',T_BacteriaName:'',doctor_id:'0',doctor_name:'',details:[]},
|
||||
doctors:[],
|
||||
selected_doctor:{},
|
||||
adekuasi:[],
|
||||
kategoriumum:[],
|
||||
interpretasi:[],
|
||||
maturasi:[],
|
||||
bacteries:[],
|
||||
selected_bacteria:{},
|
||||
result_values:[{id:'Negatif',value:'Negatif'},{id:'Positif',value:'Positif'},{id:'other',value:'Lainnya'}],
|
||||
selected_result_value:{id:'Negatif',value:'Negatif'}
|
||||
},
|
||||
mutations: {
|
||||
update_result_other(state,value) {
|
||||
state.result_other = value
|
||||
},
|
||||
update_result_values(state,value) {
|
||||
state.result_values = value
|
||||
},
|
||||
update_selected_result_value(state,value) {
|
||||
state.selected_result_value = value
|
||||
},
|
||||
update_bacteries(state,value) {
|
||||
state.bacteries = value
|
||||
},
|
||||
update_selected_bacteria(state,value) {
|
||||
state.selected_bacteria = value
|
||||
},
|
||||
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_mikro(state,value) {
|
||||
state.selected_mikro = value
|
||||
},
|
||||
update_dialog_mikro(state,value) {
|
||||
state.dialog_mikro = value
|
||||
},
|
||||
update_diagnosis_klinis(state,value) {
|
||||
state.diagnosis_klinis = value
|
||||
},
|
||||
update_hasil_biakan(state,value) {
|
||||
state.hasil_biakan = value
|
||||
},
|
||||
update_sample_name(state,value) {
|
||||
state.sample_name = value
|
||||
},
|
||||
update_kesimpulan(state,value) {
|
||||
state.kesimpulan = value
|
||||
},
|
||||
update_saran(state,value) {
|
||||
state.saran = value
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
async get_mikroresult(context,prm) {
|
||||
context.commit("update_get_data_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
console.log(prm)
|
||||
let resp = await api.getmikroresult(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_selected_bacteria",{})
|
||||
context.commit("update_selected_doctor", {})
|
||||
// context.commit("update_results", {xid:'0',orderdetail_id:'0',T_BacteriaID:'0',T_BacteriaName:'',doctor_id:'0',doctor_name:'',details:[]})
|
||||
|
||||
context.commit("update_doctors", data.records['doctors'])
|
||||
context.commit("update_bacteries", data.records['bacteries'])
|
||||
|
||||
if(!_.isEmpty(data.records['results'])){
|
||||
context.commit("update_results", data.records['results'])
|
||||
var rows = data.records['results']
|
||||
context.commit("update_selected_bacteria",{id:rows['T_BacteriaID'],name:rows['T_BacteriaName']})
|
||||
var selected_doctor = {
|
||||
id:rows['doctor_id'],
|
||||
name:rows['doctor_name']
|
||||
}
|
||||
|
||||
context.commit("update_selected_doctor", selected_doctor)
|
||||
var selected_result_vaue = {
|
||||
id:rows['result_value'],
|
||||
value:rows['result_value']
|
||||
}
|
||||
if(rows['result_value'] === 'other'){
|
||||
selected_result_vaue = {
|
||||
id:'other',
|
||||
value:'Lainnya'
|
||||
}
|
||||
}
|
||||
|
||||
context.commit("update_selected_result_value", selected_result_vaue)
|
||||
}
|
||||
context.commit("update_dialog_mikro", true)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_get_data_status", 3)
|
||||
}
|
||||
},
|
||||
async getantibiotics(context,prm) {
|
||||
context.commit("update_get_data_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.getantibiotics(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
|
||||
}
|
||||
var results = context.state.results
|
||||
results.details = data.records
|
||||
context.commit("update_results", results)
|
||||
}
|
||||
} 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_mikro(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_mikro(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_mikro", false)
|
||||
context.dispatch('re_px/search','',{root:true})
|
||||
context.dispatch('re_patient/info_req','',{root:true})
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,155 @@
|
||||
// 1 => LOADING
|
||||
// 2 => DONE
|
||||
// 3 => ERROR
|
||||
import * as api from "../api/re_papsmear.js"
|
||||
window.api = api
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
get_data_status:0,
|
||||
save_status:0,
|
||||
dialog_papsmear:false,
|
||||
diagnosis_klinis:'',
|
||||
makroskopis:'',
|
||||
mikroskopis:'',
|
||||
kesimpulan:'',
|
||||
saran:'',
|
||||
selected_papsmear:{},
|
||||
results:[],
|
||||
doctors:[],
|
||||
selected_doctor:{},
|
||||
checks:[],
|
||||
bahans:[],
|
||||
categories:[],
|
||||
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_checks(state,value) {
|
||||
state.checks = value
|
||||
},
|
||||
update_bahans(state,value) {
|
||||
state.bahans = value
|
||||
},
|
||||
update_categories(state,value) {
|
||||
state.categories = value
|
||||
},
|
||||
update_get_data_status(state,value) {
|
||||
state.get_data_status = value
|
||||
},
|
||||
update_selected_papsmear(state,value) {
|
||||
state.selected_papsmear = value
|
||||
},
|
||||
update_dialog_papsmear(state,value) {
|
||||
state.dialog_papsmear = 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_papsmearresult(context,prm) {
|
||||
context.commit("update_get_data_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.getpapsmearresult(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_checks", data.records['checks'])
|
||||
context.commit("update_bahans", data.records['bahans'])
|
||||
context.commit("update_maturasi", data.records['maturasi'])
|
||||
context.commit("update_categories", data.records['categories'])
|
||||
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_papsmear", 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_papsmear(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_papsmear(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_papsmear", false)
|
||||
context.dispatch('re_px/search','',{root:true})
|
||||
context.dispatch('re_patient/info_req','',{root:true})
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,163 @@
|
||||
// 1 => LOADING
|
||||
// 2 => DONE
|
||||
// 3 => ERROR
|
||||
import * as api from "../api/re_patient.js"
|
||||
window.api = api
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
order_id:0,
|
||||
search: '',
|
||||
nolab: '',
|
||||
//sdate: new Date().toISOString().substr(0, 10),
|
||||
sdate: moment().format('YYYY-MM-DD'),
|
||||
edate: null,
|
||||
|
||||
search_status:0,
|
||||
search_error_message:'',
|
||||
search_dialog_is_active: false,
|
||||
|
||||
patients: [],
|
||||
total_patient: 0,
|
||||
total_patient_page: 0,
|
||||
curr_patient_page: 1,
|
||||
selected_patient: { },
|
||||
|
||||
|
||||
// PX
|
||||
total_px: 0,
|
||||
pxs: [],
|
||||
|
||||
dialog_req: false,
|
||||
info_req: {req_fo:[],req_spec_col:[],req_spec_ver:[],req_samp_ver:[],req_pre_an:[]}
|
||||
},
|
||||
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_nolab(state, val) {
|
||||
state.nolab = 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_patient_page = data.total_page
|
||||
},
|
||||
|
||||
update_curr_patient_page(state, data) {
|
||||
state.curr_patient_page = data
|
||||
},
|
||||
|
||||
update_selected_patient(state,val) {
|
||||
state.selected_patient=val
|
||||
},
|
||||
|
||||
update_id(state, id) {
|
||||
state.order_id = id
|
||||
},
|
||||
|
||||
update_pxs(state, pxs) {
|
||||
state.pxs = pxs.records
|
||||
},
|
||||
|
||||
update_sdate(state, date) {
|
||||
state.sdate = date
|
||||
},
|
||||
|
||||
update_edate(state, date) {
|
||||
state.edate = date
|
||||
},
|
||||
|
||||
update_info_req(state, v) {
|
||||
state.info_req = v
|
||||
},
|
||||
|
||||
update_dialog_req(state, v) {
|
||||
state.dialog_req = v
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
async search(context) {
|
||||
context.commit("update_search_status", 1)
|
||||
try {
|
||||
let g_id = 0
|
||||
if (context.rootState.re_px.selected_group)
|
||||
g_id = context.rootState.re_px.selected_group.group_id
|
||||
|
||||
let company_id=0
|
||||
if (context.rootState.company.company)
|
||||
company_id = context.rootState.company.company.M_CompanyID
|
||||
|
||||
context.commit("update_selected_patient", {})
|
||||
let resp= await api.search(one_token(), context.state.sdate, context.state.search, g_id,
|
||||
context.state.curr_patient_page, company_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,
|
||||
total_page: resp.data.total_page
|
||||
}
|
||||
context.commit("update_patients", data)
|
||||
|
||||
if (data.records.length < 1) {
|
||||
context.commit('update_selected_patient', null)
|
||||
context.commit('re_px/update_pxs', [], {root:true})
|
||||
}
|
||||
else {
|
||||
context.commit('update_selected_patient', data.records[0])
|
||||
context.commit('re_px/update_id', data.records[0].T_OrderHeaderID, {root:true})
|
||||
context.dispatch('re_px/search', null, {root:true})
|
||||
|
||||
context.dispatch('info_req')
|
||||
}
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_search_status",3)
|
||||
context.commit("update_search_error_message",e.message )
|
||||
}
|
||||
},
|
||||
|
||||
async info_req(context) {
|
||||
context.commit("update_search_status", 1)
|
||||
try {
|
||||
let resp= await api.info_req(one_token(), context.state.selected_patient.T_OrderHeaderID)
|
||||
|
||||
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_info_req', resp.data)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_search_status", 3)
|
||||
context.commit("update_search_error_message", e.message )
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,191 @@
|
||||
// 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_preparasisperma:false,
|
||||
results:{},
|
||||
doctors:[],
|
||||
selected_doctor:{},
|
||||
methodes:[],
|
||||
selected_methode:{},
|
||||
onprocess:false,
|
||||
images:[],
|
||||
pre_image:{},
|
||||
post_image:{},
|
||||
show_progrees_upload:false,
|
||||
selected_preparasisperma:{}
|
||||
},
|
||||
mutations: {
|
||||
update_selected_preparasisperma(state,value) {
|
||||
state.selected_preparasisperma = value
|
||||
},
|
||||
update_show_progrees_upload(state,value) {
|
||||
state.show_progrees_upload = value
|
||||
},
|
||||
update_pre_image(state,value) {
|
||||
state.pre_image = value
|
||||
},
|
||||
update_post_image(state,value) {
|
||||
state.post_image = value
|
||||
},
|
||||
update_images(state,value) {
|
||||
state.images = value
|
||||
},
|
||||
update_onprocess(state,value) {
|
||||
state.onprocess = value
|
||||
},
|
||||
update_methodes(state,value) {
|
||||
state.methodes = value
|
||||
},
|
||||
update_selected_methode(state,value) {
|
||||
state.selected_methode = 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_get_data_status(state,value) {
|
||||
state.get_data_status = value
|
||||
},
|
||||
update_dialog_preparasisperma(state,value) {
|
||||
state.dialog_preparasisperma = value
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
async get_preparasispermaresult(context,prm) {
|
||||
context.commit("update_get_data_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.getpreparasispermaresult(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_doctors", data.records['doctors'])
|
||||
context.commit("update_methodes", data.records['methodes'])
|
||||
context.commit("update_post_image", '')
|
||||
context.commit("update_pre_image", '')
|
||||
if(data.records['images']){
|
||||
data.records['images'].forEach(function(image) {
|
||||
if(image.type == 'PRE'){
|
||||
context.commit("update_pre_image", image)
|
||||
}
|
||||
else{
|
||||
context.commit("update_post_image", image)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
var selected_doctor = {
|
||||
id:data.records['results']['doctor_id'],
|
||||
name:data.records['results']['doctor_name']
|
||||
}
|
||||
console.log(selected_doctor)
|
||||
context.commit("update_selected_doctor", selected_doctor)
|
||||
var selected_methode = {
|
||||
id:data.records['results']['methode_id'],
|
||||
name:data.records['results']['methode_name']
|
||||
}
|
||||
console.log(selected_doctor)
|
||||
context.commit("update_selected_methode", selected_methode)
|
||||
context.commit("update_dialog_preparasisperma", true)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_get_data_status", 3)
|
||||
}
|
||||
},
|
||||
async get_doctors_preparasi_sperma(context,prm) {
|
||||
context.commit("update_get_data_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.get_doctors_preparasi_sperma(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_preparasisperma", true)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_get_data_status", 3)
|
||||
}
|
||||
},
|
||||
async saveresult(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_preparasi_sperma(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_onprocess", false)
|
||||
context.commit("update_dialog_preparasisperma", false)
|
||||
context.dispatch('re_px/search','',{root:true})
|
||||
context.dispatch('re_patient/info_req','',{root:true})
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
}
|
||||
},
|
||||
async uploadimage_preparasi_sperma(context,prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
//prm.id = context.state.selected_fna.id
|
||||
// prm.token = one_token()
|
||||
let resp = await api.uploadimage_preparasi_sperma(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_show_progrees_upload", false)
|
||||
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_onprocess", false)
|
||||
context.commit("update_show_progrees_upload", false)
|
||||
|
||||
if(data.records[0].type === 'PRE')
|
||||
context.commit("update_pre_image", data.records[0])
|
||||
else
|
||||
context.commit("update_post_image", data.records[0])
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_show_progrees_upload", false)
|
||||
context.commit("update_save_status", 3)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
358
test/vuex/one-process-resultverification-v21/modules/re_px.js
Normal file
358
test/vuex/one-process-resultverification-v21/modules/re_px.js
Normal file
@@ -0,0 +1,358 @@
|
||||
// 1 => LOADING
|
||||
// 2 => DONE
|
||||
// 3 => ERROR
|
||||
import * as api from "../api/re_px.js"
|
||||
window.api = api
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
order_id:0,
|
||||
|
||||
search_status:0,
|
||||
search_error_message:'',
|
||||
search_dialog_is_active: false,
|
||||
|
||||
// PX
|
||||
total_px: 0,
|
||||
pxs: [],
|
||||
selected_px: {},
|
||||
selected_px_idx: 0,
|
||||
|
||||
groups: [],
|
||||
selected_group: {},
|
||||
|
||||
reruns: [],
|
||||
selected_rerun: {},
|
||||
dialog_rerun: false,
|
||||
snackbar: false,
|
||||
snackbar_err: false,
|
||||
|
||||
dialog_trend: false,
|
||||
info_trend: {},
|
||||
|
||||
dialog_pre: false,
|
||||
info_pre : {},
|
||||
|
||||
dialog_reject: false,
|
||||
reject_actions: [{"val":"1", "label":"Rerun"}, {"val":"3", "label":"Tolak Sampel"}],
|
||||
selected_reject_action: null
|
||||
},
|
||||
mutations: {
|
||||
update_dialog_pre(state, v) {
|
||||
state.dialog_pre= v
|
||||
},
|
||||
|
||||
update_info_pre(state, v) {
|
||||
state.info_pre= v
|
||||
},
|
||||
|
||||
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_status(state,status) {
|
||||
state.search_status = status
|
||||
},
|
||||
|
||||
update_id(state, id) {
|
||||
state.order_id = id
|
||||
},
|
||||
|
||||
update_pxs(state, pxs) {
|
||||
state.pxs = pxs.records
|
||||
},
|
||||
|
||||
update_selected_px(state, px) {
|
||||
state.selected_px = px
|
||||
},
|
||||
|
||||
update_selected_px_idx(state, idx) {
|
||||
state.selected_px_idx = idx
|
||||
},
|
||||
|
||||
update_selected_group(state, group) {
|
||||
state.selected_group = group
|
||||
},
|
||||
|
||||
update_dialog_rerun(state, v) {
|
||||
state.dialog_rerun = v
|
||||
},
|
||||
|
||||
update_reruns(state, reruns) {
|
||||
state.reruns = reruns.records
|
||||
},
|
||||
|
||||
update_selected_rerun(state, rerun) {
|
||||
state.selected_rerun = rerun
|
||||
},
|
||||
|
||||
update_snackbar(state, v) {
|
||||
state.snackbar = v
|
||||
},
|
||||
|
||||
update_snackbar_err(state, v) {
|
||||
state.snackbar_err = v
|
||||
},
|
||||
|
||||
update_dialog_trend(state, v) {
|
||||
state.dialog_trend = v
|
||||
},
|
||||
|
||||
update_info_trend(state, v) {
|
||||
state.info_trend = v
|
||||
},
|
||||
|
||||
update_groups(state, v) {
|
||||
state.groups = v.records
|
||||
},
|
||||
|
||||
update_selected_reject_action(state, v) {
|
||||
state.selected_reject_action = v
|
||||
},
|
||||
|
||||
update_dialog_reject(state, v) {
|
||||
state.dialog_reject = v
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
async multi_verification(context,prm) {
|
||||
context.commit("update_search_status", 1)
|
||||
try {
|
||||
await api.multi_verification(one_token(), prm.order_id)
|
||||
context.commit("update_search_status", 0)
|
||||
} catch(e) {
|
||||
context.commit("update_search_error_message",e.message)
|
||||
context.commit("update_search_status", 3)
|
||||
}
|
||||
},
|
||||
async single_verification(context,prm) {
|
||||
context.commit("update_search_status", 1)
|
||||
try {
|
||||
let resp = await api.single_verification(one_token(), prm.order_id, prm.verification)
|
||||
if (resp.status == "ERR") {
|
||||
context.commit("update_search_error_message",resp.message)
|
||||
context.commit("update_search_status", 3)
|
||||
} else {
|
||||
context.commit("update_search_status", 0)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_search_error_message",e.message)
|
||||
context.commit("update_search_status", 3)
|
||||
}
|
||||
},
|
||||
async search(context) {
|
||||
context.commit("update_search_status", 1)
|
||||
try {
|
||||
let g_id = 0
|
||||
if (context.state.selected_group)
|
||||
g_id = context.state.selected_group.group_id
|
||||
let resp= await api.search(one_token(), context.state.order_id, g_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
|
||||
}
|
||||
|
||||
for (let i in data.records) {
|
||||
let x = data.records[i]
|
||||
if (x.verification == "X" && x.sample_handling_perfect == "Y") {
|
||||
if (x.delta_check == "Y" && x.trend_analysis == "Y")
|
||||
x.verification = "Y"
|
||||
else
|
||||
x.verification = "N"
|
||||
|
||||
data.records[i] = x
|
||||
}
|
||||
}
|
||||
|
||||
context.commit("update_pxs", data)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_search_status",3)
|
||||
context.commit("update_search_error_message",e.message )
|
||||
}
|
||||
},
|
||||
|
||||
async confirm(context) {
|
||||
let data = []
|
||||
let x = context.state.pxs
|
||||
for (let i in x) {
|
||||
let y = x[i]
|
||||
if (y.verification != "X" && y.verification_old != y.verification)
|
||||
data.push({id:y.id, trend:y.trend_analysis, delta:y.delta_check, verification:y.verification, test_id:y.t_testid, test_name:y.t_testname})
|
||||
}
|
||||
|
||||
if (data.length < 1) {
|
||||
context.commit('update_snackbar_err', true)
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
let resp= await api.confirm(one_token(), JSON.stringify(data))
|
||||
|
||||
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.dispatch("search")
|
||||
context.commit("update_snackbar", true)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_search_status",3)
|
||||
context.commit("update_search_error_message",e.message )
|
||||
}
|
||||
},
|
||||
|
||||
async delta_check(context) {
|
||||
context.commit("update_search_status", 1)
|
||||
try {
|
||||
let resp= await api.delta_check(one_token(), context.state.selected_px.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","")
|
||||
|
||||
context.commit('update_info_trend', resp.data)
|
||||
context.commit('update_dialog_trend', true)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_search_status",3)
|
||||
context.commit("update_search_error_message",e.message )
|
||||
}
|
||||
},
|
||||
|
||||
async trend_analysis(context) {
|
||||
context.commit("update_search_status", 1)
|
||||
try {
|
||||
let resp= await api.trend_analysis(one_token(), context.state.selected_px.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","")
|
||||
|
||||
context.commit('update_info_trend', resp.data)
|
||||
context.commit('update_dialog_trend', true)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_search_status",3)
|
||||
context.commit("update_search_error_message",e.message )
|
||||
}
|
||||
},
|
||||
|
||||
async pre_analytic(context) {
|
||||
context.commit("update_search_status", 1)
|
||||
try {
|
||||
let resp= await api.pre_analytic(one_token(), context.state.selected_px.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","")
|
||||
|
||||
context.commit('update_info_pre', resp.data)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_search_status",3)
|
||||
context.commit("update_search_error_message",e.message )
|
||||
}
|
||||
},
|
||||
|
||||
async search_group(context) {
|
||||
context.commit("update_search_status", 1)
|
||||
try {
|
||||
|
||||
let resp= await api.search_group()
|
||||
|
||||
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_groups", data)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_search_status", 3)
|
||||
context.commit("update_search_error_message",e.message )
|
||||
}
|
||||
},
|
||||
|
||||
async reject(context) {
|
||||
context.commit("update_search_status", 1)
|
||||
try {
|
||||
let resp= await api.reject(one_token(), context.state.selected_px.id, context.state.selected_reject_action)
|
||||
|
||||
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.dispatch("search")
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_search_status",3)
|
||||
context.commit("update_search_error_message",e.message )
|
||||
}
|
||||
},
|
||||
async search_rerun(context) {
|
||||
context.commit("update_search_status", 1)
|
||||
try {
|
||||
|
||||
let resp= await api.search_rerun(context.state.selected_px.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","")
|
||||
|
||||
context.commit("update_reruns", resp.data)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_search_status", 3)
|
||||
context.commit("update_search_error_message",e.message )
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
// 1 => LOADING
|
||||
// 2 => DONE
|
||||
// 3 => ERROR
|
||||
import * as api from "../api/re_history.js"
|
||||
window.api = api
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
order_id:0,
|
||||
|
||||
search_status:0,
|
||||
search_error_message:'',
|
||||
search_dialog_is_active: false,
|
||||
|
||||
dialog_verification: false
|
||||
},
|
||||
mutations: {
|
||||
update_search_error_message(state,status) {
|
||||
state.search_error_message = status
|
||||
},
|
||||
|
||||
update_search_status(state,status) {
|
||||
state.search_status = status
|
||||
},
|
||||
|
||||
update_id(state, id) {
|
||||
state.order_id = id
|
||||
},
|
||||
|
||||
update_dialog_verification(state, v) {
|
||||
state.dialog_verification = v
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user