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 )
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
134
test/vuex/one-process-resultentry-v4-debug/modules/re_fna.js
Normal file
134
test/vuex/one-process-resultentry-v4-debug/modules/re_fna.js
Normal file
@@ -0,0 +1,134 @@
|
||||
// 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_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)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
102
test/vuex/one-process-resultentry-v4-debug/modules/re_history.js
Normal file
102
test/vuex/one-process-resultentry-v4-debug/modules/re_history.js
Normal file
@@ -0,0 +1,102 @@
|
||||
// 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,
|
||||
|
||||
// HISTORY
|
||||
total_px: 0,
|
||||
pxs: [{
|
||||
date: '2019-07-07',
|
||||
data: [
|
||||
{px_name: 'Hematologi Rutin', is_result: 'N', result: '', flag: '', level:1},
|
||||
{px_name: 'Trombosit', is_result: 'Y', result: '300', flag: 'H', level:2},
|
||||
{px_name: 'Leukosit', is_result: 'Y', result: '100', flag: '', level:2},
|
||||
{px_name: 'Hemoglobin', is_result: 'Y', result: '105', flag: '', level:2} ]
|
||||
},
|
||||
{
|
||||
date: '2019-06-07',
|
||||
data: [
|
||||
{px_name: 'SGOT', is_result: 'Y', result: '230', flag: '', level:1},
|
||||
{px_name: 'SGPT', is_result: 'Y', result: '320', flag: 'H', level:1} ]
|
||||
}],
|
||||
selected_px: {},
|
||||
selected_px_idx: 0,
|
||||
|
||||
dialog_history: false,
|
||||
selected_tab: 0
|
||||
},
|
||||
mutations: {
|
||||
update_search_dialog_is_active(state,status) {
|
||||
state.search_dialog_is_active = status
|
||||
},
|
||||
update_search_error_message(state,status) {
|
||||
state.search_error_message = status
|
||||
},
|
||||
|
||||
update_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_dialog_history(state, v) {
|
||||
state.dialog_history = v
|
||||
},
|
||||
|
||||
update_selected_tab(state, v) {
|
||||
state.selected_tab = v
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
async history(context) {
|
||||
context.commit("update_search_status", 1)
|
||||
try {
|
||||
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_pxs', {
|
||||
records: resp.data
|
||||
})
|
||||
|
||||
if (resp.data.length > 0) {
|
||||
context.commit('update_selected_tab', resp.data[0].id)
|
||||
}
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_search_status",3)
|
||||
context.commit("update_search_error_message",e.message )
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
191
test/vuex/one-process-resultentry-v4-debug/modules/re_normal.js
Normal file
191
test/vuex/one-process-resultentry-v4-debug/modules/re_normal.js
Normal file
@@ -0,0 +1,191 @@
|
||||
import * as api from "../api/re_normal.js"
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
error:'',
|
||||
status:0,
|
||||
result: {}
|
||||
},
|
||||
mutations: {
|
||||
update_error(state,status) {
|
||||
state.error = status
|
||||
},
|
||||
update_status(state,status) {
|
||||
state.status= status
|
||||
},
|
||||
update_result(state,status) {
|
||||
state.result= status
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
async update(context,order_detail_id) {
|
||||
context.commit("update_error", "")
|
||||
context.commit("update_status", 1)
|
||||
context.commit("update_result", {})
|
||||
try {
|
||||
let g_id = 0
|
||||
let resp= await api.update(one_token(),order_detail_id )
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_status", 3)
|
||||
context.commit("update_error", resp.message)
|
||||
} else {
|
||||
context.commit("update_status", 2)
|
||||
context.commit("update_error","")
|
||||
let data = resp.data.records
|
||||
context.commit("update_result", data)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_search_status", 3)
|
||||
context.commit("update_search_error_message",e.message )
|
||||
}
|
||||
},
|
||||
|
||||
async save(context) {
|
||||
let data = []
|
||||
let x = context.state.pxs
|
||||
let rerun = context.state.selected_rerun
|
||||
for (let i in x) {
|
||||
let y = x[i]
|
||||
if ((y.result != null && y.result != y.result_old) || (y.note != y.note_old)) {
|
||||
let resultInstrumentID = 0
|
||||
if ( y.hasOwnProperty('resultInstrumentID') ) {
|
||||
resultInstrumentID = y.resultInstrumentID
|
||||
}
|
||||
data.push({id:y.id, result:y.result, note:y.note, test_id:y.t_testid, test_name:y.t_testname,
|
||||
resultInstrumentID,
|
||||
order_id:context.state.order_id})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (data.length < 1) {
|
||||
alert('Tidak ada data yang perlu disimpan !')
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
let ptn = context.rootState.re_patient
|
||||
let resp= await api.save(one_token(), ptn.lang_id, ptn.lang_si, 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 save_template(context) {
|
||||
|
||||
try {
|
||||
let resp= await api.save_template(one_token(), context.state.selected_px.t_testid, context.state.template_new_value)
|
||||
|
||||
if (resp.status != "OK") {
|
||||
context.commit('update_dup_template_error', {status:true, messages:'Value tersebut sudah ada !'})
|
||||
|
||||
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_dialog_template_new", false)
|
||||
|
||||
let pxs = context.state.pxs
|
||||
for (let i in pxs) {
|
||||
if (pxs[i].t_testid == context.state.selected_px.t_testid)
|
||||
pxs[i].template = resp.data
|
||||
}
|
||||
|
||||
context.commit('update_dup_template_error', {status:false, messages:''})
|
||||
context.commit('update_pxs', {records:pxs, total:context.state.total_px})
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_search_status",3)
|
||||
context.commit("update_search_error_message",e.message )
|
||||
}
|
||||
},
|
||||
|
||||
async lang_export(context) {
|
||||
|
||||
try {
|
||||
let sp = context.rootState.re_patient
|
||||
let resp= await api.lang_export(one_token(), sp.selected_patient.T_OrderHeaderID,
|
||||
sp.lang_id, sp.lang_si)
|
||||
|
||||
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_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 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,122 @@
|
||||
// 1 => LOADING
|
||||
// 2 => DONE
|
||||
// 3 => ERROR
|
||||
import * as api from "../api/re_normal_method.js"
|
||||
window.api = api
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
order_id: 0,
|
||||
nattest_id: 0,
|
||||
|
||||
search_status:0,
|
||||
search_error_message:'',
|
||||
search_dialog_is_active: false,
|
||||
|
||||
methods: [],
|
||||
selected_method: null,
|
||||
normals: [],
|
||||
selected_normal: null,
|
||||
|
||||
dialog_method: false,
|
||||
dialog_normal: false
|
||||
|
||||
},
|
||||
mutations: {
|
||||
update_search_dialog_is_active(state,status) {
|
||||
state.search_dialog_is_active = status
|
||||
},
|
||||
update_search_error_message(state,status) {
|
||||
state.search_error_message = status
|
||||
},
|
||||
|
||||
update_search_status(state,status) {
|
||||
state.search_status = status
|
||||
},
|
||||
|
||||
update_id(state, id) {
|
||||
state.order_id = id
|
||||
},
|
||||
|
||||
update_nattest_id(state, id) {
|
||||
state.nattest_id = id
|
||||
},
|
||||
|
||||
update_methods(state, d) {
|
||||
state.methods = d.records
|
||||
},
|
||||
|
||||
update_selected_method(state, d) {
|
||||
state.selected_method = d
|
||||
},
|
||||
|
||||
update_normals(state, d) {
|
||||
state.normals = d.records
|
||||
},
|
||||
|
||||
update_selected_normal(state, d) {
|
||||
state.selected_normal = d
|
||||
},
|
||||
|
||||
update_dialog_method(state, v) {
|
||||
state.dialog_method = v
|
||||
},
|
||||
|
||||
update_dialog_normal(state, v) {
|
||||
state.dialog_normal = v
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
async search_method(context) {
|
||||
context.commit("update_search_status", 1)
|
||||
try {
|
||||
|
||||
let resp = await api.search_method(one_token(), context.state.nattest_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
|
||||
}
|
||||
context.commit("update_methods", data)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_search_status", 3)
|
||||
context.commit("update_search_error_message",e.message )
|
||||
}
|
||||
},
|
||||
|
||||
async save_method(context) {
|
||||
try {
|
||||
|
||||
let resp = await api.save_method(one_token(), context.state.order_id, context.state.selected_method.Nat_MethodeID)
|
||||
if (resp.status != "OK") {
|
||||
|
||||
context.commit("update_search_status", 3)
|
||||
context.commit("update_search_error_message", resp.message)
|
||||
} else {
|
||||
context.commit("update_search_status",2)
|
||||
context.commit("update_search_error_message","")
|
||||
|
||||
let x = context.rootState.re_px.selected_px
|
||||
x.methode_id = resp.data.data.method_id
|
||||
x.methode_name = resp.data.data.method_name
|
||||
x.normal_id = resp.data.data.normal_id
|
||||
x.normal_note = resp.data.data.normal_note
|
||||
context.commit('re_px/update_selected_px', x, {root:true})
|
||||
context.commit("update_dialog_method", false)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_search_status",3)
|
||||
context.commit("update_search_error_message",e.message )
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,155 @@
|
||||
// 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_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)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
233
test/vuex/one-process-resultentry-v4-debug/modules/re_patient.js
Normal file
233
test/vuex/one-process-resultentry-v4-debug/modules/re_patient.js
Normal file
@@ -0,0 +1,233 @@
|
||||
// 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),
|
||||
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: [],
|
||||
|
||||
langs: [],
|
||||
lang_code: "ID",
|
||||
lang_id: 0,
|
||||
lang_si: "N",
|
||||
|
||||
dialog_req: false,
|
||||
dialog_note: false,
|
||||
result_note: '',
|
||||
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
|
||||
if (val) {
|
||||
state.langs = val.lang
|
||||
|
||||
state.lang_code = val.lang[0].code
|
||||
state.lang_id = val.lang[0].id
|
||||
state.lang_si = val.lang[0].is_si
|
||||
|
||||
state.result_note = val.T_OrderHeaderResultNote
|
||||
} else {
|
||||
state.langs = []
|
||||
state.lang_code =
|
||||
state.lang_id =
|
||||
state.lang_si = null
|
||||
state.result_note = ""
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
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_lang(state, lang) {
|
||||
state.lang_code = lang.code
|
||||
state.lang_id = lang.id
|
||||
state.lang_si = lang.is_si
|
||||
},
|
||||
|
||||
update_dialog_note(state, v) {
|
||||
state.dialog_note = v
|
||||
},
|
||||
|
||||
update_result_note(state, v) {
|
||||
state.result_note = v
|
||||
},
|
||||
|
||||
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 inp_no = context.state.search
|
||||
if (inp_no.length == 9 && inp_no.substr(0,2) == "ZL" ) {
|
||||
inp_no = await window.xno(inp_no)
|
||||
}
|
||||
let company_id = 0
|
||||
if (context.rootState.company.company) {
|
||||
company_id = context.rootState.company.company.M_CompanyID
|
||||
}
|
||||
let resp= await api.search(one_token(), context.state.sdate, inp_no , 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 save_note(context) {
|
||||
context.commit("update_search_status", 1)
|
||||
try {
|
||||
let resp= await api.save_note(one_token(), context.state.selected_patient.T_OrderHeaderID, context.state.result_note)
|
||||
|
||||
if (resp.status != "OK") {
|
||||
|
||||
context.commit("update_search_status", 3)
|
||||
context.commit("update_search_error_message", resp.message)
|
||||
} else {
|
||||
context.commit("update_search_status",2)
|
||||
context.commit("update_search_error_message","")
|
||||
console.log(resp)
|
||||
|
||||
context.commit('update_dialog_note', false)
|
||||
let x = context.state.selected_patient
|
||||
let y = context.state.patients
|
||||
for (let i in y)
|
||||
if (x.T_OrderHeaderID == y[i].T_OrderHeaderID)
|
||||
y[i].T_OrderHeaderResultNote = context.state.result_note
|
||||
|
||||
context.commit("update_patients", {
|
||||
records : y,
|
||||
total: context.state.total_patient,
|
||||
total_page: context.state.total_patient_page
|
||||
})
|
||||
}
|
||||
} 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 )
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
278
test/vuex/one-process-resultentry-v4-debug/modules/re_px.js
Normal file
278
test/vuex/one-process-resultentry-v4-debug/modules/re_px.js
Normal file
@@ -0,0 +1,278 @@
|
||||
// 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,
|
||||
|
||||
// template
|
||||
dialog_template_new: false,
|
||||
template_new_value: "",
|
||||
dup_template_error: {status:false, messages:''},
|
||||
|
||||
groups: [{group_id:'1', group_name:'DUMMY - KIMIA'}, {group_id:'2', group_name:'DUMMY - HEMATOLOGI'}],
|
||||
selected_group: {},
|
||||
|
||||
reruns: [{date:'2019-07-10 08:00', instrument:'COBAS', result:'56'}, {date:'2019-07-10 08:20', instrument:'COBAS', result:'68'}],
|
||||
selected_rerun: {},
|
||||
dialog_rerun: false,
|
||||
snackbar: false
|
||||
},
|
||||
mutations: {
|
||||
update_search_dialog_is_active(state,status) {
|
||||
state.search_dialog_is_active = status
|
||||
},
|
||||
update_search_error_message(state,status) {
|
||||
state.search_error_message = status
|
||||
},
|
||||
|
||||
update_search_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_dialog_template_new(state, v) {
|
||||
state.dialog_template_new = v
|
||||
},
|
||||
|
||||
update_template_new_value(state, v) {
|
||||
state.template_new_value = v
|
||||
},
|
||||
|
||||
update_dup_template_error(state, v) {
|
||||
state.dup_template_error = v
|
||||
},
|
||||
|
||||
update_groups(state, v) {
|
||||
state.groups = v.records
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
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,
|
||||
context.rootState.re_patient.lang_id,
|
||||
context.rootState.re_patient.lang_si,
|
||||
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
|
||||
}
|
||||
context.commit("update_pxs", data)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_search_status", 3)
|
||||
context.commit("update_search_error_message",e.message )
|
||||
}
|
||||
},
|
||||
|
||||
async save(context) {
|
||||
let data = []
|
||||
let x = context.state.pxs
|
||||
let rerun = context.state.selected_rerun
|
||||
for (let i in x) {
|
||||
let y = x[i]
|
||||
if ((y.result != null && y.result != y.result_old) || (y.note != y.note_old)) {
|
||||
let resultInstrumentID = 0
|
||||
if ( y.hasOwnProperty('resultInstrumentID') ) {
|
||||
resultInstrumentID = y.resultInstrumentID
|
||||
}
|
||||
data.push({id:y.id, result:y.result, note:y.note, test_id:y.t_testid, test_name:y.t_testname,
|
||||
resultInstrumentID,
|
||||
order_id:context.state.order_id})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (data.length < 1) {
|
||||
alert('Tidak ada data yang perlu disimpan !')
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
let ptn = context.rootState.re_patient
|
||||
let resp= await api.save(one_token(), ptn.lang_id, ptn.lang_si, 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 save_template(context) {
|
||||
|
||||
try {
|
||||
let resp= await api.save_template(one_token(), context.state.selected_px.t_testid, context.state.template_new_value)
|
||||
|
||||
if (resp.status != "OK") {
|
||||
context.commit('update_dup_template_error', {status:true, messages:'Value tersebut sudah ada !'})
|
||||
|
||||
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_dialog_template_new", false)
|
||||
|
||||
let pxs = context.state.pxs
|
||||
for (let i in pxs) {
|
||||
if (pxs[i].t_testid == context.state.selected_px.t_testid)
|
||||
pxs[i].template = resp.data
|
||||
}
|
||||
|
||||
context.commit('update_dup_template_error', {status:false, messages:''})
|
||||
context.commit('update_pxs', {records:pxs, total:context.state.total_px})
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_search_status",3)
|
||||
context.commit("update_search_error_message",e.message )
|
||||
}
|
||||
},
|
||||
|
||||
async lang_export(context) {
|
||||
|
||||
try {
|
||||
let sp = context.rootState.re_patient
|
||||
let resp= await api.lang_export(one_token(), sp.selected_patient.T_OrderHeaderID,
|
||||
sp.lang_id, sp.lang_si)
|
||||
|
||||
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_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 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 )
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user