Initial import
This commit is contained in:
430
one-ui/masterdata/one-md-subgroup/modules/doctor.js
Normal file
430
one-ui/masterdata/one-md-subgroup/modules/doctor.js
Normal file
@@ -0,0 +1,430 @@
|
||||
// 1 => LOADING
|
||||
// 2 => DONE
|
||||
// 3 => ERROR
|
||||
import * as api from "../api/doctor.js"
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
doctors: [],
|
||||
save_status: 0,
|
||||
save_error_message: '',
|
||||
dialog_form_doctor: false,
|
||||
dialog_status_order: false,
|
||||
lookup_doctor: 0,
|
||||
search_status: 0,
|
||||
errors: [],
|
||||
startdate: moment(new Date()).format('YYYY-MM-DD'),
|
||||
enddate: moment(new Date()).format('YYYY-MM-DD'),
|
||||
bases: [],
|
||||
base: {},
|
||||
omzettypes: [],
|
||||
omzettype: {},
|
||||
doctortypes: [],
|
||||
doctortype: {},
|
||||
agingtypes: [],
|
||||
agingtype: {},
|
||||
statuss: [],
|
||||
autospecialists:[],
|
||||
autospecialist:{},
|
||||
autocitys:[],
|
||||
autocity:{},
|
||||
autodistricts:[],
|
||||
autodistrict:{},
|
||||
autokelurahans:[],
|
||||
autokelurahan:{},
|
||||
name: '',
|
||||
minvalueR: '',
|
||||
maxvalueR: '',
|
||||
isminvalueinclusiveR: false,
|
||||
ismaxvalueinclusiveR: false,
|
||||
noteR: '',
|
||||
minvalueS: '',
|
||||
maxvalueS: '',
|
||||
isminvalueinclusiveS: true,
|
||||
ismaxvalueinclusiveS: false,
|
||||
noteS: '',
|
||||
minvalueI: '',
|
||||
maxvalueI: '',
|
||||
isminvalueinclusiveI: true,
|
||||
ismaxvalueinclusiveI: false,
|
||||
noteI: '',
|
||||
current_page:1,
|
||||
x_search: '',
|
||||
total_data: 0,
|
||||
selected_doctor: {
|
||||
name: ""
|
||||
}
|
||||
},
|
||||
mutations: {
|
||||
update_selected_doctor(state, val) {
|
||||
state.selected_doctor = val
|
||||
},
|
||||
update_x_search(state, val) {
|
||||
state.x_search = val
|
||||
},
|
||||
update_current_page(state, val) {
|
||||
state.current_page = val
|
||||
},
|
||||
update_total_data(state, val) {
|
||||
state.total_data = val
|
||||
},
|
||||
update_autospecialists(state,data){
|
||||
state.autospecialists = data
|
||||
},
|
||||
update_autospecialist(state,val){
|
||||
state.autospecialist = val
|
||||
},
|
||||
update_autocitys(state,data){
|
||||
state.autocitys = data
|
||||
},
|
||||
update_autocity(state,val){
|
||||
state.autocity = val
|
||||
},
|
||||
update_autodistricts(state,data){
|
||||
state.autodistricts = data
|
||||
},
|
||||
update_autodistrict(state,val){
|
||||
state.autodistrict = val
|
||||
},
|
||||
update_autokelurahans(state,data){
|
||||
state.autokelurahans = data
|
||||
},
|
||||
update_autokelurahan(state,val){
|
||||
state.autokelurahan = val
|
||||
},
|
||||
update_name(state, val) {
|
||||
state.name = val
|
||||
},
|
||||
update_minvalueR(state, val) {
|
||||
state.minvalueR = val
|
||||
},
|
||||
update_maxvalueR(state, val) {
|
||||
state.maxvalueR = val
|
||||
},
|
||||
update_isminvalueinclusiveR(state, val) {
|
||||
state.isminvalueinclusiveR = val
|
||||
},
|
||||
update_ismaxvalueinclusiveR(state, val) {
|
||||
state.ismaxvalueinclusiveR = val
|
||||
},
|
||||
update_noteR(state, val) {
|
||||
state.noteR = val
|
||||
},
|
||||
update_minvalueS(state, val) {
|
||||
state.minvalueS = val
|
||||
},
|
||||
update_maxvalueS(state, val) {
|
||||
state.maxvalueS = val
|
||||
},
|
||||
update_isminvalueinclusiveS(state, val) {
|
||||
state.isminvalueinclusiveS = val
|
||||
},
|
||||
update_ismaxvalueinclusiveS(state, val) {
|
||||
state.ismaxvalueinclusiveS = val
|
||||
},
|
||||
update_noteS(state, val) {
|
||||
state.noteS = val
|
||||
},
|
||||
update_minvalueI(state, val) {
|
||||
state.minvalueI = val
|
||||
},
|
||||
update_maxvalueI(state, val) {
|
||||
state.maxvalueI = val
|
||||
},
|
||||
update_isminvalueinclusiveI(state, val) {
|
||||
state.isminvalueinclusiveI = val
|
||||
},
|
||||
update_ismaxvalueinclusiveI(state, val) {
|
||||
state.ismaxvalueinclusiveI = val
|
||||
},
|
||||
update_noteI(state, val) {
|
||||
state.noteI = val
|
||||
},
|
||||
update_errors(state, val) {
|
||||
state.errors = val
|
||||
},
|
||||
update_doctors(state, data) {
|
||||
state.doctors = data
|
||||
},
|
||||
update_save_status(state, val) {
|
||||
state.save_status = val
|
||||
},
|
||||
update_save_error_message(state, val) {
|
||||
state.save_error_message = val
|
||||
},
|
||||
update_dialog_form_doctor(state, val) {
|
||||
state.dialog_form_doctor = val
|
||||
},
|
||||
update_lookup_doctor(state, val) {
|
||||
state.lookup_doctor = val
|
||||
},
|
||||
update_startdate(state, val) {
|
||||
state.startdate = val
|
||||
},
|
||||
update_enddate(state, val) {
|
||||
state.enddate = val
|
||||
},
|
||||
update_bases(state, data) {
|
||||
state.bases = data
|
||||
},
|
||||
update_base(state, val) {
|
||||
state.base = val
|
||||
},
|
||||
update_omzettypes(state, data) {
|
||||
state.omzettypes = data
|
||||
},
|
||||
update_omzettype(state, val) {
|
||||
state.omzettype = val
|
||||
},
|
||||
update_doctortypes(state, data) {
|
||||
state.doctortypes = data
|
||||
},
|
||||
update_doctortype(state, val) {
|
||||
state.doctortype = val
|
||||
},
|
||||
update_agingtypes(state, data) {
|
||||
state.agingtypes = data
|
||||
},
|
||||
update_agingtype(state, val) {
|
||||
state.agingtype = val
|
||||
},
|
||||
update_search_status(state, val) {
|
||||
state.search_status = val
|
||||
},
|
||||
update_statuss(state, data) {
|
||||
state.statuss = data
|
||||
},
|
||||
update_dialog_status_order(state, val) {
|
||||
state.dialog_status_order = val
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
async save(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.save(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
} else {
|
||||
var data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
if (data.total !== -1) {
|
||||
context.commit("update_save_status", 2)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
context.commit("specialist/update_alert_success", true, {
|
||||
root: true
|
||||
})
|
||||
|
||||
context.commit("update_dialog_form_doctor", false)
|
||||
var msg = "Antibiotik " + prm.name + " Specialist " + prm.specialistname + " sudah disimpan dong"
|
||||
context.commit("specialist/update_msg_success", msg, {
|
||||
root: true
|
||||
})
|
||||
context.commit("specialist/update_alert_success", true, {
|
||||
root: true
|
||||
})
|
||||
context.dispatch("lookupbyname", {
|
||||
specialist: prm.sspecialist,
|
||||
doctor: prm.sdoctor,
|
||||
current_page: 1,
|
||||
lastid: -1
|
||||
})
|
||||
} else {
|
||||
context.commit("update_errors", resp.data.errors)
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async lookupx(context, prm) {
|
||||
context.commit("update_lookup_doctor", 1)
|
||||
try {
|
||||
let resp = await api.lookupx(one_token(), prm.id)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_lookup_doctor", 3)
|
||||
} else {
|
||||
context.commit("update_lookup_doctor", 2)
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_doctors", data.records)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_lookup_doctor", 3)
|
||||
}
|
||||
},
|
||||
async lookup(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.lookup(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_doctors", data.records)
|
||||
console.log('status')
|
||||
console.log(data.records.statuss)
|
||||
context.commit("update_statuss", data.records.statuss)
|
||||
context.commit("update_total_data", data.total)
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
}
|
||||
},
|
||||
async lookupbyname(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.lookupbyname(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_doctors", data.records)
|
||||
console.log(data.records)
|
||||
context.commit("update_total_data", data.total)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
}
|
||||
},
|
||||
async delete(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
let resp = await api.xdelete(one_token(), prm.xid)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("specialist/update_save_status", 3, {
|
||||
root: true
|
||||
})
|
||||
context.commit("specialist/update_save_error_message", resp.message, {
|
||||
root: true
|
||||
})
|
||||
} else {
|
||||
context.commit("specialist/update_save_status", 2, {
|
||||
root: true
|
||||
})
|
||||
context.commit("specialist/update_save_error_message", resp.message, {
|
||||
root: true
|
||||
})
|
||||
context.commit("specialist/update_alert_success", true, {
|
||||
root: true
|
||||
})
|
||||
|
||||
//context.commit("update_dialog_form_schedule_promise", false)
|
||||
var msg = "Antibiotik sudah dihapus dong"
|
||||
context.commit("specialist/update_msg_success", msg, {
|
||||
root: true
|
||||
})
|
||||
context.commit("specialist/update_alert_success", true, {
|
||||
root: true
|
||||
})
|
||||
context.dispatch("lookupbyname", {
|
||||
specialist: prm.sspecialist,
|
||||
doctor: prm.sdoctor,
|
||||
current_page: 1,
|
||||
lastid: -1
|
||||
})
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async searchspecialist(context,prm) {
|
||||
context.commit("specialist/update_autocomplete_status",1,{root: true})
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp= await api.searchspecialist(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("specialist/update_autocomplete_status",3,{root: true})
|
||||
} else {
|
||||
context.commit("specialist/update_autocomplete_status",2,{root: true})
|
||||
let data = {
|
||||
records : resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_autospecialists",resp.data.records)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("specialist/update_autocomplete_status",3,{root: true})
|
||||
}
|
||||
},
|
||||
async searchcity(context,prm) {
|
||||
context.commit("specialist/update_autocomplete_status",1,{root: true})
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp= await api.searchcity(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("specialist/update_autocomplete_status",3,{root: true})
|
||||
} else {
|
||||
context.commit("specialist/update_autocomplete_status",2,{root: true})
|
||||
let data = {
|
||||
records : resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_autocitys",resp.data.records)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("specialist/update_autocomplete_status",3,{root: true})
|
||||
}
|
||||
},
|
||||
async searchdistrict(context,prm) {
|
||||
context.commit("specialist/update_autocomplete_status",1,{root: true})
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp= await api.searchdistrict(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("specialist/update_autocomplete_status",3,{root: true})
|
||||
} else {
|
||||
context.commit("specialist/update_autocomplete_status",2,{root: true})
|
||||
let data = {
|
||||
records : resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_autodistricts",resp.data.records)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("specialist/update_autocomplete_status",3,{root: true})
|
||||
}
|
||||
},
|
||||
async searchkelurahan(context,prm) {
|
||||
context.commit("specialist/update_autocomplete_status",1,{root: true})
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp= await api.searchkelurahan(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("specialist/update_autocomplete_status",3,{root: true})
|
||||
} else {
|
||||
context.commit("specialist/update_autocomplete_status",2,{root: true})
|
||||
let data = {
|
||||
records : resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_autokelurahans",resp.data.records)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("specialist/update_autocomplete_status",3,{root: true})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
341
one-ui/masterdata/one-md-subgroup/modules/subgroup.js
Normal file
341
one-ui/masterdata/one-md-subgroup/modules/subgroup.js
Normal file
@@ -0,0 +1,341 @@
|
||||
// 1 => LOADING
|
||||
// 2 => DONE
|
||||
// 3 => ERROR
|
||||
import * as api from "../api/subgroup.js"
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
subgroups: [],
|
||||
save_status: 0,
|
||||
save_error_message: '',
|
||||
dialog_form_subgroup: false,
|
||||
dialog_status_order: false,
|
||||
lookup_subgroup: 0,
|
||||
search_status: 0,
|
||||
errors: [],
|
||||
startdate: moment(new Date()).format('YYYY-MM-DD'),
|
||||
enddate: moment(new Date()).format('YYYY-MM-DD'),
|
||||
bases: [],
|
||||
base: {},
|
||||
omzettypes: [],
|
||||
omzettype: {},
|
||||
subgrouptypes: [],
|
||||
subgrouptype: {},
|
||||
agingtypes: [],
|
||||
agingtype: {},
|
||||
statuss: [],
|
||||
autogroups: [],
|
||||
autogroup: {},
|
||||
autocitys: [],
|
||||
autocity: {},
|
||||
autodistricts: [],
|
||||
autodistrict: {},
|
||||
autokelurahans: [],
|
||||
autokelurahan: {},
|
||||
autocompanys: [],
|
||||
autocompany: {},
|
||||
automous: [],
|
||||
automou: {},
|
||||
autodoctors: [],
|
||||
autodoctor: {},
|
||||
addressdoctors: [],
|
||||
addressdoctor: {},
|
||||
current_page: 1,
|
||||
x_search: '',
|
||||
total_data: 0,
|
||||
selected_subgroup: {
|
||||
name: ""
|
||||
},
|
||||
get_data_status: 0,
|
||||
get_data_error_message: '',
|
||||
alert_success: false,
|
||||
msg_success: "",
|
||||
autocomplete_status: 0,
|
||||
search_status: 0
|
||||
},
|
||||
mutations: {
|
||||
update_autocomplete_status(state, val) {
|
||||
state.autocomplete_status = val
|
||||
},
|
||||
update_selected_subgroup(state, val) {
|
||||
state.selected_subgroup = val
|
||||
},
|
||||
update_x_search(state, val) {
|
||||
state.x_search = val
|
||||
},
|
||||
update_current_page(state, val) {
|
||||
state.current_page = val
|
||||
},
|
||||
update_total_data(state, val) {
|
||||
state.total_data = val
|
||||
},
|
||||
update_autogroups(state, data) {
|
||||
state.autogroups = data
|
||||
},
|
||||
update_autogroup(state, val) {
|
||||
state.autogroup = val
|
||||
},
|
||||
update_autocitys(state, data) {
|
||||
state.autocitys = data
|
||||
},
|
||||
update_autocity(state, val) {
|
||||
state.autocity = val
|
||||
},
|
||||
update_autocompanys(state, data) {
|
||||
state.autocompanys = data
|
||||
},
|
||||
update_autocompany(state, val) {
|
||||
state.autocompany = val
|
||||
},
|
||||
update_automous(state, data) {
|
||||
state.automous = data
|
||||
},
|
||||
update_automou(state, val) {
|
||||
state.automou = val
|
||||
},
|
||||
update_autodoctors(state, data) {
|
||||
state.autodoctors = data
|
||||
},
|
||||
update_autodoctor(state, val) {
|
||||
state.autodoctor = val
|
||||
},
|
||||
update_addressdoctors(state, data) {
|
||||
state.addressdoctors = data
|
||||
},
|
||||
update_addressdoctor(state, val) {
|
||||
state.addressdoctor = val
|
||||
},
|
||||
update_autodistricts(state, data) {
|
||||
state.autodistricts = data
|
||||
},
|
||||
update_autodistrict(state, val) {
|
||||
state.autodistrict = val
|
||||
},
|
||||
update_autokelurahans(state, data) {
|
||||
state.autokelurahans = data
|
||||
},
|
||||
update_autokelurahan(state, val) {
|
||||
state.autokelurahan = val
|
||||
},
|
||||
update_errors(state, val) {
|
||||
state.errors = val
|
||||
},
|
||||
update_subgroups(state, data) {
|
||||
state.subgroups = data
|
||||
},
|
||||
update_save_status(state, val) {
|
||||
state.save_status = val
|
||||
},
|
||||
update_save_error_message(state, val) {
|
||||
state.save_error_message = val
|
||||
},
|
||||
update_dialog_form_subgroup(state, val) {
|
||||
state.dialog_form_subgroup = val
|
||||
},
|
||||
update_lookup_subgroup(state, val) {
|
||||
state.lookup_subgroup = val
|
||||
},
|
||||
update_startdate(state, val) {
|
||||
state.startdate = val
|
||||
},
|
||||
update_enddate(state, val) {
|
||||
state.enddate = val
|
||||
},
|
||||
update_bases(state, data) {
|
||||
state.bases = data
|
||||
},
|
||||
update_base(state, val) {
|
||||
state.base = val
|
||||
},
|
||||
update_omzettypes(state, data) {
|
||||
state.omzettypes = data
|
||||
},
|
||||
update_omzettype(state, val) {
|
||||
state.omzettype = val
|
||||
},
|
||||
update_subgrouptypes(state, data) {
|
||||
state.subgrouptypes = data
|
||||
},
|
||||
update_subgrouptype(state, val) {
|
||||
state.subgrouptype = val
|
||||
},
|
||||
update_agingtypes(state, data) {
|
||||
state.agingtypes = data
|
||||
},
|
||||
update_agingtype(state, val) {
|
||||
state.agingtype = val
|
||||
},
|
||||
update_search_status(state, val) {
|
||||
state.search_status = val
|
||||
},
|
||||
update_statuss(state, data) {
|
||||
state.statuss = data
|
||||
},
|
||||
update_dialog_status_order(state, val) {
|
||||
state.dialog_status_order = val
|
||||
},
|
||||
update_get_data_status(state, val) {
|
||||
state.get_data_status = val
|
||||
},
|
||||
update_get_data_error_message(state, val) {
|
||||
state.get_data_error_message = val
|
||||
},
|
||||
update_alert_success(state, val) {
|
||||
state.alert_success = val
|
||||
},
|
||||
update_msg_success(state, val) {
|
||||
state.msg_success = val
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
async save(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.save(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
} else {
|
||||
var data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
if (data.total !== -1) {
|
||||
context.commit("update_save_status", 2)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
context.commit("update_alert_success", true)
|
||||
|
||||
context.commit("update_dialog_form_subgroup", false)
|
||||
var msg = "Subgroup " + prm.name + " sudah disimpan dong"
|
||||
context.commit("update_msg_success", msg)
|
||||
context.commit("update_alert_success", true)
|
||||
context.dispatch("lookupbyname", {
|
||||
subgroup: prm.ssubgroup,
|
||||
current_page: prm.current_page,
|
||||
lastid: -1
|
||||
})
|
||||
} else {
|
||||
context.commit("update_errors", resp.data.errors)
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async lookupx(context, prm) {
|
||||
context.commit("update_lookup_subgroup", 1)
|
||||
try {
|
||||
let resp = await api.lookupx(one_token(), prm.id)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_lookup_subgroup", 3)
|
||||
} else {
|
||||
context.commit("update_lookup_subgroup", 2)
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_subgroups", data.records)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_lookup_subgroup", 3)
|
||||
}
|
||||
},
|
||||
async lookup(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.lookup(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_subgroups", data.records)
|
||||
console.log('status')
|
||||
console.log(data.records.statuss)
|
||||
context.commit("update_statuss", data.records.statuss)
|
||||
context.commit("update_total_data", data.total)
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
}
|
||||
},
|
||||
async lookupbyname(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.lookupbyname(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_subgroups", data.records)
|
||||
console.log(data.records)
|
||||
context.commit("update_total_data", data.total)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
}
|
||||
},
|
||||
async delete(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
let resp = await api.xdelete(one_token(), prm.xid)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
} else {
|
||||
context.commit("update_save_status", 2)
|
||||
context.commit("update_save_error_message", resp.message)
|
||||
context.commit("update_alert_success", true)
|
||||
|
||||
//context.commit("update_dialog_form_schedule_promise", false)
|
||||
var msg = "Subgroup sudah dihapus dong"
|
||||
context.commit("update_msg_success", msg)
|
||||
context.commit("update_alert_success", true)
|
||||
context.dispatch("lookupbyname", {
|
||||
regional: prm.sregional,
|
||||
subgroup: prm.ssubgroup,
|
||||
current_page: 1,
|
||||
lastid: -1
|
||||
})
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async searchgroup(context, prm) {
|
||||
context.commit("update_autocomplete_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.searchgroup(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_autocomplete_status", 3)
|
||||
} else {
|
||||
context.commit("update_autocomplete_status", 2)
|
||||
let data = {
|
||||
records: resp.data.records,
|
||||
total: resp.data.total
|
||||
}
|
||||
context.commit("update_autogroups", resp.data.records)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_autocomplete_status", 3)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user