Initial import

This commit is contained in:
sas.fajri
2026-05-25 20:01:37 +07:00
commit 710d7c1b97
10371 changed files with 2381698 additions and 0 deletions

View File

@@ -0,0 +1,267 @@
const URL = "/one-api/v1/masterdata/";
export async function search(prm) {
try {
var resp = await axios.post(URL + 'doctorv3/search', prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function getsexreg(token) {
try {
var resp = await axios.post(URL + 'doctorv3/getsexreg',{token:token});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function save(prm) {
try {
var resp = await axios.post(URL + 'doctorv3/save',prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function newdoctor(prm) {
try {
var resp = await axios.post(URL + 'doctorv3/newdoctor',prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function xdelete(prm) {
try {
var resp = await axios.post(URL + 'doctorv3/deletedoctor',prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function getaddress(prm) {
try {
var resp = await axios.post(URL + 'doctorv3/getaddress',prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function searchcity(token,prm) {
try {
var resp = await axios.post(URL + 'doctorv3/searchcity',{token:token,search:prm});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function searchstaff(token,prm) {
try {
var resp = await axios.post(URL + 'doctorv3/searchstaff',{token:token,name:prm});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function getdistrict(token,prm) {
try {
var resp = await axios.post(URL + 'doctorv3/getdistrict',{id:prm.M_CityID,token:token});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function getkelurahan(token,prm) {
try {
var resp = await axios.post(URL + 'doctorv3/getkelurahan',{token:token,id:prm.M_DistrictID});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function getjpa(token) {
try {
var resp = await axios.post(URL + 'doctorv3/getjpa',{token:token});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function savenewaddress(prm) {
try {
var resp = await axios.post(URL + 'doctorv3/savenewaddress',prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function saveeditaddress(prm) {
try {
var resp = await axios.post(URL + 'doctorv3/saveeditaddress',prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function deleteaddress(prm) {
try {
var resp = await axios.post(URL + 'doctorv3/deleteaddress',prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}

View File

@@ -0,0 +1,451 @@
<template>
<v-layout v-if="xact !== 'new'" column >
<v-dialog v-model="dialogconfirmationdeleteaddr" persistent max-width="290">
<v-card>
<v-card-title
dark
class="headline error pt-2 pb-2"
primary-title
style="color:white"
>
<h4 dark>Konfirmasi</h4>
</v-card-title>
<v-card-text>
{{msgconfirmationdeleteaddr}}
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn small v-if="!checkError('deleteutama')" color="error darken-1 text-sm-left" flat @click="doDeleteAddr()">Hapus</v-btn>
<v-btn small color="primary darken-1 text-sm-right" flat @click="dialogconfirmationdeleteaddr = false">Batal</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<v-dialog v-model="dialogformaddress" persistent max-width="650">
<v-card>
<v-card-title>
<span class="headline">Form Alamat Dokter</span>
</v-card-title>
<v-card-text class="pt-0 pb-0">
<v-layout wrap>
<v-flex xs8 pa-1>
<v-text-field v-model="labeladdress" label="Label"></v-text-field>
<p v-if="checkError('requiredlabel')" class="error pl-2 pr-2" style="color:#fff">Jangan kosong dong</p>
<p v-if="checkError('readonlyutama')" class="error pl-2 pr-2" style="color:#fff">Biarkan jadi yang utama</p>
</v-flex>
<v-flex xs4 pa-1>
<v-select
item-text="Nat_JpaName"
return-object
:items="xjpas"
v-model="jpaaddress"
hide-details
label="JPA"
></v-select>
<p v-if="checkError('requiredjpa')" class="error pl-2 pr-2" style="color:#fff">Jangan kosong dong</p>
</v-flex>
<v-flex xs12>
<v-layout row>
<v-flex xs4 pa-1>
<v-autocomplete
label="Kota"
v-model="cityaddress"
:items="xcities"
:search-input.sync="search_city"
auto-select-first
hide-details
no-filter
item-text="M_CityName"
return-object
:loading="isLoading"
no-data-text="Pilih Kota"
>
<template
slot="item"
slot-scope="{ item }"
>
<v-list-tile-content>
<v-list-tile-title v-text="item.M_CityName"></v-list-tile-title>
</v-list-tile-content>
</template>
</v-autocomplete>
<p v-if="checkError('requiredcity')" class="error pl-2 pr-2" style="color:#fff">Jangan kosong deh</p>
</v-flex>
<v-flex xs4 pa-1>
<v-select
item-text="M_DistrictName"
return-object
:items="xdistricts"
v-model="districtaddress"
hide-details
label="Kecamatan*"
></v-select>
<p v-if="checkError('requireddistrict')" class="error pl-2 pr-2" style="color:#fff">Jangan kosong dong</p>
</v-flex>
<v-flex xs4 pa-1>
<v-select
item-text="M_KelurahanName"
return-object
:items="xkelurahans"
v-model="kelurahanaddress"
hide-details
label="Kelurahan / Desa*"
></v-select>
<p v-if="checkError('requiredkelurahan')" class="error pl-2 pr-2" style="color:#fff">Jangan kosong deh</p>
</v-flex>
</v-layout>
</v-flex>
<v-flex xs12>
<v-textarea
box
label="Alamat Lengkap"
v-model="descriptionaddress"
hide-details
></v-textarea>
<p v-if="checkError('requireddescription')" class="error pl-2 pr-2" style="color:#fff">Jangan kosong dong</p>
</v-flex>
</v-layout>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="blue darken-1" flat @click="dialogformaddress = false">Tutup</v-btn>
<v-btn v-if="xactaddr === 'new'" color="blue darken-1" flat @click="saveNewAddress()">Simpan</v-btn>
<v-btn v-if="xactaddr === 'edit'" color="blue darken-1" flat @click="saveEditAddress()">Simpan</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<v-card>
<v-layout row>
<v-flex xs12>
<v-subheader red--text text--lighten-1> ALAMAT DOKTER
<v-flex text-md-right>
<v-btn @click="createNewAddress()" small color="info">Baru</v-btn>
</v-flex>
</v-subheader>
<v-divider></v-divider>
<v-layout row wrap>
<v-flex xs12 pa-2>
<v-data-table
:headers="headers"
:items="xaddresses"
:loading="isLoading"
hide-actions class="elevation-1">
<template slot="items" slot-scope="props">
<td class="text-xs-center pa-2">
<v-icon color="error" @click="deleteAddress(props.item)">delete</v-icon>
<v-icon class="ml-3" color="primary" @click="editAddress(props.item)">edit</v-icon>
</td>
<td class="text-xs-left pa-2">{{ props.item.M_DoctorAddressNote}}</td>
<td class="text-xs-left pa-2">{{ props.item.M_DoctorAddressDescription}}</td>
<td class="text-xs-left pa-2">{{ props.item.Nat_JpaName}}</td>
</template>
</v-data-table>
</v-flex>
</v-layout>
</v-flex>
</v-layout>
</v-card>
</v-layout>
</template>
<style scoped>
</style>
<script>
module.exports = {
data: () => ({
search_city:'',
oldlabel:'',
headers: [
{
text: "AKSI",
align: "center",
sortable: false,
value: "action",
width: "10%",
class: "pa-1 blue lighten-3 white--text"
},
{
text: "LABEL",
align: "left",
sortable: false,
value: "mr",
width: "10%",
class: "pa-1 blue lighten-3 white--text"
},
{
text: "ALAMAT",
align: "left",
sortable: false,
value: "lab",
width: "40%",
class: "pa-1 blue lighten-3 white--text"
},
{
text: "JPA",
align: "left",
sortable: false,
value: "lab",
width: "20%",
class: "pa-1 blue lighten-3 white--text"
}
]
}),
computed: {
dialogconfirmationdeleteaddr:{
get() {
return this.$store.state.doctor.dialog_confirmation_delete_addr
},
set(val) {
this.$store.commit("doctor/update_dialog_confirmation_delete_addr",val)
}
},
msgconfirmationdeleteaddr(){
return this.$store.state.doctor.msg_confirmation_delete_addr
},
xact() {
return this.$store.state.doctor.act
},
xactaddr() {
return this.$store.state.doctor.act_addr
},
dialogformaddress:{
get() {
return this.$store.state.doctor.dialog_form_address
},
set(val) {
this.$store.commit("doctor/update_dialog_form_address",val)
}
},
isLoading() {
return this.$store.state.doctor.search_status == 1
},
xaddresses(p) {
return this.$store.state.doctor.addresses
},
xcities(){
return this.$store.state.doctor.cities
},
labeladdress:{
get() {
return this.$store.state.doctor.label_address
},
set(val) {
this.$store.commit("doctor/update_label_address",val)
}
},
cityaddress:{
get() {
return this.$store.state.doctor.city_address
},
set(val) {
this.$store.commit("doctor/update_city_address",val)
this.$store.dispatch("doctor/getdistrict",this.$store.state.doctor.city_address)
}
},
xdistricts(){
return this.$store.state.doctor.districts
},
districtaddress:{
get() {
return this.$store.state.doctor.district_address
},
set(val) {
this.$store.commit("doctor/update_district_address",val)
this.$store.dispatch("doctor/getkelurahan",this.$store.state.doctor.district_address)
}
},
xkelurahans(){
return this.$store.state.doctor.kelurahans
},
kelurahanaddress:{
get() {
return this.$store.state.doctor.kelurahan_address
},
set(val) {
this.$store.commit("doctor/update_kelurahan_address",val)
}
},
xjpas(){
return this.$store.state.doctor.jpas
},
jpaaddress:{
get() {
return this.$store.state.doctor.jpa_address
},
set(val) {
this.$store.commit("doctor/update_jpa_address",val)
}
},
descriptionaddress:{
get() {
return this.$store.state.doctor.description_address
},
set(val) {
this.$store.commit("doctor/update_description_address",val)
}
},
},
methods : {
createNewAddress(){
this.$store.commit("doctor/update_act_addr",'new')
this.search_city = ''
this.labeladdress = ''
this.$store.commit("doctor/update_cities",[])
this.cityaddress = {}
this.$store.commit("doctor/update_districts",[])
this.districtaddress = {}
this.$store.commit("doctor/update_kelurahans",[])
this.kelurahanaddress = {}
//this.$store.commit("doctor/update_jpas",[])
this.jpaaddress = {}
this.descriptionaddress = ''
this.$store.commit("doctor/update_dialog_form_address",true)
},
thr_search_city: _.debounce( function () {
this.$store.dispatch("doctor/searchcity",this.search_city)
},2000),
checkError(value){
var errors = this.$store.state.doctor.errors
if(errors.includes(value)){
return true
}
else{
return false
}
},
saveNewAddress(){
this.$store.commit("doctor/update_errors",[])
var errors = this.$store.state.doctor.errors
if(this.labeladdress === ''){
errors.push("requiredlabel")
}
if(_.isEmpty(this.cityaddress)){
errors.push("requiredcity")
}
if(_.isEmpty(this.districtaddress)){
errors.push("requireddistrict")
}
if(_.isEmpty(this.kelurahanaddress)){
errors.push("requiredkelurahan")
}
if(_.isEmpty(this.$store.state.doctor.jpa_address)){
errors.push("requiredjpa")
}
if(_.isEmpty(this.descriptionaddress)){
errors.push("requireddescription")
}
if(errors.length === 0){
var prm = {}
prm.M_DoctorAddressM_DoctorID = this.$store.state.doctor.selected_doctor.M_DoctorID
prm.M_DoctorName = this.$store.state.doctor.selected_doctor.M_DoctorName
prm.M_DoctorAddressNote = this.labeladdress
prm.M_DoctorAddressDescription = this.descriptionaddress
prm.M_DoctorAddressM_KelurahanID = this.kelurahanaddress.M_KelurahanID
prm.M_DoctorAddressNat_JpaID = this.$store.state.doctor.jpa_address.Nat_JpaID
this.$store.dispatch("doctor/savenewaddress",prm)
}
},
editAddress(value){
console.log("matahasa")
this.$store.commit("doctor/update_act_addr",'edit')
this.$store.commit("doctor/update_x_addr_id",value.M_DoctorAddressID)
this.labeladdress = value.M_DoctorAddressNote
this.oldlabel = value.M_DoctorAddressNote
this.$store.commit("doctor/update_cities",[{M_CityID:value.M_CityID,M_CityName:value.M_CityName}])
this.cityaddress = {M_CityID:value.M_CityID,M_CityName:value.M_CityName}
this.$store.commit("doctor/update_districts",[{M_DistrictID:value.M_DistrictID,M_DistrictName:value.M_DistrictName}])
this.districtaddress = {M_DistrictID:value.M_DistrictID,M_DistrictName:value.M_DistrictName}
this.$store.commit("doctor/update_kelurahans",[{M_KelurahanID:value.M_DoctorAddressM_KelurahanID,M_KelurahanName:value.M_KelurahanName}])
this.kelurahanaddress = {M_KelurahanID:value.M_DoctorAddressM_KelurahanID,M_KelurahanName:value.M_KelurahanName}
//this.$store.commit("doctor/update_jpas",[{Nat_JpaID:value.M_DoctorAddressNat_JpaID,Nat_JpaName:value.Nat_JpaName}])
this.jpaaddress = {Nat_JpaID:value.M_DoctorAddressNat_JpaID,Nat_JpaName:value.Nat_JpaName}
this.descriptionaddress = value.M_DoctorAddressDescription
this.$store.commit("doctor/update_dialog_form_address",true)
},
saveEditAddress(){
this.$store.commit("doctor/update_errors",[])
var errors = this.$store.state.doctor.errors
if(this.labeladdress === ''){
errors.push("requiredlabel")
}
if(this.oldlabel.toLowerCase() === 'utama' && this.labeladdress.toLowerCase() !== 'utama'){
errors.push("readonlyutama")
}
if(_.isEmpty(this.cityaddress)){
errors.push("requiredcity")
}
if(_.isEmpty(this.districtaddress)){
errors.push("requireddistrict")
}
if(_.isEmpty(this.kelurahanaddress)){
errors.push("requiredkelurahan")
}
if(_.isEmpty(this.$store.state.doctor.jpa_address)){
errors.push("requiredjpa")
}
if(_.isEmpty(this.descriptionaddress)){
errors.push("requireddescription")
}
if(errors.length === 0){
var prm = {}
prm.M_DoctorAddressID = this.$store.state.doctor.x_addr_id
prm.M_DoctorAddressM_DoctorID = this.$store.state.doctor.selected_doctor.M_DoctorID
prm.M_DoctorName = this.$store.state.doctor.selected_doctor.M_DoctorName
prm.M_DoctorAddressNote = this.labeladdress
prm.M_DoctorAddressDescription = this.descriptionaddress
prm.M_DoctorAddressM_KelurahanID = this.kelurahanaddress.M_KelurahanID
prm.M_DoctorAddressNat_JpaID = this.$store.state.doctor.jpa_address.Nat_JpaID
this.$store.dispatch("doctor/saveeditaddress",prm)
}
},
deleteAddress(value){
this.$store.commit("doctor/update_act_addr",'delete')
this.$store.commit("doctor/update_x_addr_id",value.M_DoctorAddressID)
this.$store.commit("doctor/update_errors",[])
this.oldlabel = value.M_DoctorAddressNote
var errors = this.$store.state.doctor.errors
if(value.M_DoctorAddressNote.toLowerCase() === 'utama'){
errors.push("deleteutama")
}
var msg = ''
if(errors.includes("deleteutama")){
msg = "Biarkan yang utama tetap ada"
}
else{
msg = "Yakin, akan menghapus data alamat dokter "+value.M_DoctorAddressNote+" ?"
}
this.$store.commit("doctor/update_msg_confirmation_delete_addr",msg)
this.$store.commit("doctor/update_dialog_confirmation_delete_addr",true)
},
doDeleteAddr(){
var prm = {}
prm.M_DoctorAddressID = this.$store.state.doctor.x_addr_id
prm.M_DoctorAddressM_DoctorOldCode = this.$store.state.doctor.selected_doctor.M_DoctorOldCode
prm.M_DoctorName = this.$store.state.doctor.selected_doctor.M_DoctorName
prm.M_DoctorAddressNote = this.oldlabel
this.$store.dispatch("doctor/deleteaddress",prm)
}
},
watch: {
search_city(val,old) {
if (val == old ) return
if (! val) return
if (val.length < 1 ) return
if (this.$store.state.doctor.update_autocomplete_status == 1 ) return
this.thr_search_city()
}
}
}
</script>

View File

@@ -0,0 +1,397 @@
<template>
<v-layout v-if="xact !== 'new'" column >
<v-dialog v-model="dialogconfirmationdeleteaddr" persistent max-width="290">
<v-card>
<v-card-title
dark
class="headline error pt-2 pb-2"
primary-title
style="color:white"
>
<h4 dark>Konfirmasi</h4>
</v-card-title>
<v-card-text>
{{msgconfirmationdeleteaddr}}
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn small v-if="!checkError('deleteutama')" color="error darken-1 text-sm-left" flat @click="doDeleteAddr()">Hapus</v-btn>
<v-btn small color="primary darken-1 text-sm-right" flat @click="dialogconfirmationdeleteaddr = false">Batal</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<v-dialog v-model="dialogformaddress" persistent max-width="650">
<v-card>
<v-card-title>
<span class="headline">Form Alamat Dokter</span>
</v-card-title>
<v-card-text class="pt-0 pb-0">
<v-layout wrap>
<v-flex xs12>
<v-text-field v-model="labeladdress" label="Label"></v-text-field>
<p v-if="checkError('requiredlabel')" class="error pl-2 pr-2" style="color:#fff">Jangan kosong dong</p>
<p v-if="checkError('readonlyutama')" class="error pl-2 pr-2" style="color:#fff">Biarkan jadi yang utama</p>
</v-flex>
<v-flex xs12>
<v-layout row>
<v-flex xs4 pa-1>
<v-autocomplete
label="Kota"
v-model="cityaddress"
:items="xcities"
:search-input.sync="search_city"
auto-select-first
no-filter
item-text="M_CityName"
return-object
:loading="isLoading"
no-data-text="Pilih Kota"
>
<template
slot="item"
slot-scope="{ item }"
>
<v-list-tile-content>
<v-list-tile-title v-text="item.M_CityName"></v-list-tile-title>
</v-list-tile-content>
</template>
</v-autocomplete>
<p v-if="checkError('requiredcity')" class="error pl-2 pr-2" style="color:#fff">Jangan kosong dong</p>
</v-flex>
<v-flex xs4 pa-1>
<v-select
item-text="M_DistrictName"
return-object
:items="xdistricts"
v-model="districtaddress"
label="Kecamatan*"
></v-select>
<p v-if="checkError('requireddistrict')" class="error pl-2 pr-2" style="color:#fff">Jangan kosong dong</p>
</v-flex>
<v-flex xs4 pa-1>
<v-select
item-text="M_KelurahanName"
return-object
:items="xkelurahans"
v-model="kelurahanaddress"
label="Kelurahan / Desa*"
></v-select>
<p v-if="checkError('requiredkelurahan')" class="error pl-2 pr-2" style="color:#fff">Jangan kosong dong</p>
</v-flex>
</v-layout>
</v-flex>
<v-flex xs12>
<v-textarea
box
label="Alamat Lengkap"
v-model="descriptionaddress"
></v-textarea>
<p v-if="checkError('requireddescription')" class="error pl-2 pr-2" style="color:#fff">Jangan kosong dong</p>
</v-flex>
</v-layout>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="blue darken-1" flat @click="dialogformaddress = false">Tutup</v-btn>
<v-btn v-if="xactaddr === 'new'" color="blue darken-1" flat @click="saveNewAddress()">Simpan</v-btn>
<v-btn v-if="xactaddr === 'edit'" color="blue darken-1" flat @click="saveEditAddress()">Simpan</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<v-card>
<v-layout row>
<v-flex xs12>
<v-subheader red--text text--lighten-1> ALAMAT DOKTER
<v-flex text-md-right>
<v-btn @click="createNewAddress()" small color="info">Baru</v-btn>
</v-flex>
</v-subheader>
<v-divider></v-divider>
<v-layout row wrap>
<v-flex xs12 pa-2>
<v-data-table
:headers="headers"
:items="xaddresses"
:loading="isLoading"
hide-actions class="elevation-1">
<template slot="items" slot-scope="props">
<td class="text-xs-center pa-2">
<v-icon color="error" @click="deleteAddress(props.item)">delete</v-icon>
<v-icon class="ml-3" color="primary" @click="editAddress(props.item)">edit</v-icon>
</td>
<td class="text-xs-left pa-2">{{ props.item.M_DoctorAddressNote}}</td>
<td class="text-xs-left pa-2">{{ props.item.M_DoctorAddressDescription}}</td>
</template>
</v-data-table>
</v-flex>
</v-layout>
</v-flex>
</v-layout>
</v-card>
</v-layout>
</template>
<style scoped>
</style>
<script>
module.exports = {
data: () => ({
search_city:'',
oldlabel:'',
headers: [
{
text: "AKSI",
align: "center",
sortable: false,
value: "action",
width: "10%",
class: "pa-1 blue lighten-3 white--text"
},
{
text: "LABEL",
align: "left",
sortable: false,
value: "mr",
width: "20%",
class: "pa-1 blue lighten-3 white--text"
},
{
text: "ALAMAT",
align: "left",
sortable: false,
value: "lab",
width: "40%",
class: "pa-1 blue lighten-3 white--text"
}
]
}),
computed: {
dialogconfirmationdeleteaddr:{
get() {
return this.$store.state.doctor.dialog_confirmation_delete_addr
},
set(val) {
this.$store.commit("doctor/update_dialog_confirmation_delete_addr",val)
}
},
msgconfirmationdeleteaddr(){
return this.$store.state.doctor.msg_confirmation_delete_addr
},
xact() {
return this.$store.state.doctor.act
},
xactaddr() {
return this.$store.state.doctor.act_addr
},
dialogformaddress:{
get() {
return this.$store.state.doctor.dialog_form_address
},
set(val) {
this.$store.commit("doctor/update_dialog_form_address",val)
}
},
isLoading() {
return this.$store.state.doctor.search_status == 1
},
xaddresses(p) {
return this.$store.state.doctor.addresses
},
xcities(){
return this.$store.state.doctor.cities
},
labeladdress:{
get() {
return this.$store.state.doctor.label_address
},
set(val) {
this.$store.commit("doctor/update_label_address",val)
}
},
cityaddress:{
get() {
return this.$store.state.doctor.city_address
},
set(val) {
this.$store.commit("doctor/update_city_address",val)
this.$store.dispatch("doctor/getdistrict",this.$store.state.doctor.city_address)
}
},
xdistricts(){
return this.$store.state.doctor.districts
},
districtaddress:{
get() {
return this.$store.state.doctor.district_address
},
set(val) {
this.$store.commit("doctor/update_district_address",val)
this.$store.dispatch("doctor/getkelurahan",this.$store.state.doctor.district_address)
}
},
xkelurahans(){
return this.$store.state.doctor.kelurahans
},
kelurahanaddress:{
get() {
return this.$store.state.doctor.kelurahan_address
},
set(val) {
this.$store.commit("doctor/update_kelurahan_address",val)
}
},
descriptionaddress:{
get() {
return this.$store.state.doctor.description_address
},
set(val) {
this.$store.commit("doctor/update_description_address",val)
}
},
},
methods : {
createNewAddress(){
this.$store.commit("doctor/update_act_addr",'new')
this.search_city = ''
this.labeladdress = ''
this.$store.commit("doctor/update_cities",[])
this.cityaddress = {}
this.$store.commit("doctor/update_districts",[])
this.districtaddress = {}
this.$store.commit("doctor/update_kelurahans",[])
this.kelurahanaddress = {}
this.descriptionaddress = ''
this.$store.commit("doctor/update_dialog_form_address",true)
},
thr_search_city: _.debounce( function () {
this.$store.dispatch("doctor/searchcity",this.search_city)
},2000),
checkError(value){
var errors = this.$store.state.doctor.errors
if(errors.includes(value)){
return true
}
else{
return false
}
},
saveNewAddress(){
this.$store.commit("doctor/update_errors",[])
var errors = this.$store.state.doctor.errors
if(this.labeladdress === ''){
errors.push("requiredlabel")
}
if(_.isEmpty(this.cityaddress)){
errors.push("requiredcity")
}
if(_.isEmpty(this.districtaddress)){
errors.push("requireddistrict")
}
if(_.isEmpty(this.kelurahanaddress)){
errors.push("requiredkelurahan")
}
if(_.isEmpty(this.descriptionaddress)){
errors.push("requireddescription")
}
if(errors.length === 0){
var prm = {}
prm.M_DoctorAddressM_DoctorID = this.$store.state.doctor.selected_doctor.M_DoctorID
prm.M_DoctorName = this.$store.state.doctor.selected_doctor.M_DoctorName
prm.M_DoctorAddressNote = this.labeladdress
prm.M_DoctorAddressDescription = this.descriptionaddress
prm.M_DoctorAddressM_KelurahanID = this.kelurahanaddress.M_KelurahanID
this.$store.dispatch("doctor/savenewaddress",prm)
}
},
editAddress(value){
this.$store.commit("doctor/update_act_addr",'edit')
this.$store.commit("doctor/update_x_addr_id",value.M_DoctorAddressID)
this.labeladdress = value.M_DoctorAddressNote
this.oldlabel = value.M_DoctorAddressNote
this.$store.commit("doctor/update_cities",[{M_CityID:value.M_CityID,M_CityName:value.M_CityName}])
this.cityaddress = {M_CityID:value.M_CityID,M_CityName:value.M_CityName}
this.$store.commit("doctor/update_districts",[{M_DistrictID:value.M_DistrictID,M_DistrictName:value.M_DistrictName}])
this.districtaddress = {M_DistrictID:value.M_DistrictID,M_DistrictName:value.M_DistrictName}
this.$store.commit("doctor/update_kelurahans",[{M_KelurahanID:value.M_DoctorAddressM_KelurahanID,M_KelurahanName:value.M_KelurahanName}])
this.kelurahanaddress = {M_KelurahanID:value.M_DoctorAddressM_KelurahanID,M_KelurahanName:value.M_KelurahanName}
this.descriptionaddress = value.M_DoctorAddressDescription
this.$store.commit("doctor/update_dialog_form_address",true)
},
saveEditAddress(){
this.$store.commit("doctor/update_errors",[])
var errors = this.$store.state.doctor.errors
if(this.labeladdress === ''){
errors.push("requiredlabel")
}
if(this.oldlabel.toLowerCase() === 'utama' && this.labeladdress.toLowerCase() !== 'utama'){
errors.push("readonlyutama")
}
if(_.isEmpty(this.cityaddress)){
errors.push("requiredcity")
}
if(_.isEmpty(this.districtaddress)){
errors.push("requireddistrict")
}
if(_.isEmpty(this.kelurahanaddress)){
errors.push("requiredkelurahan")
}
if(_.isEmpty(this.descriptionaddress)){
errors.push("requireddescription")
}
if(errors.length === 0){
var prm = {}
prm.M_DoctorAddressID = this.$store.state.doctor.x_addr_id
prm.M_DoctorAddressM_DoctorID = this.$store.state.doctor.selected_doctor.M_DoctorID
prm.M_DoctorName = this.$store.state.doctor.selected_doctor.M_DoctorName
prm.M_DoctorAddressNote = this.labeladdress
prm.M_DoctorAddressDescription = this.descriptionaddress
prm.M_DoctorAddressM_KelurahanID = this.kelurahanaddress.M_KelurahanID
this.$store.dispatch("doctor/saveeditaddress",prm)
}
},
deleteAddress(value){
this.$store.commit("doctor/update_act_addr",'delete')
this.$store.commit("doctor/update_x_addr_id",value.M_DoctorAddressID)
this.$store.commit("doctor/update_errors",[])
this.oldlabel = value.M_DoctorAddressNote
var errors = this.$store.state.doctor.errors
if(value.M_DoctorAddressNote.toLowerCase() === 'utama'){
errors.push("deleteutama")
}
var msg = ''
if(errors.includes("deleteutama")){
msg = "Biarkan yang utama tetap ada"
}
else{
msg = "Yakin, akan menghapus data alamat dokter "+value.M_DoctorAddressNote+" ?"
}
this.$store.commit("doctor/update_msg_confirmation_delete_addr",msg)
this.$store.commit("doctor/update_dialog_confirmation_delete_addr",true)
},
doDeleteAddr(){
var prm = {}
prm.M_DoctorAddressID = this.$store.state.doctor.x_addr_id
prm.M_DoctorAddressM_DoctorID = this.$store.state.doctor.selected_doctor.M_DoctorID
prm.M_DoctorName = this.$store.state.doctor.selected_doctor.M_DoctorName
prm.M_DoctorAddressNote = this.oldlabel
this.$store.dispatch("doctor/deleteaddress",prm)
}
},
watch: {
search_city(val,old) {
if (val == old ) return
if (! val) return
if (val.length < 1 ) return
if (this.$store.state.doctor.update_autocomplete_status == 1 ) return
this.thr_search_city()
}
}
}
</script>

View File

@@ -0,0 +1,480 @@
<template>
<v-layout>
<v-flex xs12>
<v-layout row wrap>
<v-flex xs3>
<v-card class="mb-2 mr-2" >
<v-card-title
dark
class="headline info pt-2 pb-2"
primary-title
style="color:white"
>
<h5 dark>terere</h5>
</v-card-title>
<v-card-text>
<v-btn small color="error"><v-icon left>close</v-icon>fsafsaf</v-btn>
<v-btn small color="error"><v-icon left>close</v-icon>fsafsaf</v-btn>
</v-card-text>
</v-card>
</v-flex>
<v-flex xs3>
<v-card class="mb-2 mr-2" >
<v-card-title
dark
class="headline info pt-2 pb-2"
primary-title
style="color:white"
>
<h5 dark>terere</h5>
</v-card-title>
<v-card-text>
<v-btn small color="error"><v-icon left>close</v-icon>fsafsaf</v-btn>
<v-btn small color="error"><v-icon left>close</v-icon>fsafsaf</v-btn>
<v-btn small color="error"><v-icon left>close</v-icon>fsafsaf</v-btn>
<v-btn small color="error"><v-icon left>close</v-icon>fsafsaf</v-btn>
</v-card-text>
</v-card>
</v-flex>
<v-flex xs3>
<v-card class="mb-2 mr-2" >
<v-card-title
dark
class="headline info pt-2 pb-2"
primary-title
style="color:white"
>
<h5 dark>terere</h5>
</v-card-title>
<v-card-text>
<v-btn small color="error"><v-icon left>close</v-icon>fsafsaf</v-btn>
<v-btn small color="error"><v-icon left>close</v-icon>fsafsaf</v-btn>
<v-btn small color="error"><v-icon left>close</v-icon>fsafsaf</v-btn>
</v-card-text>
</v-card>
</v-flex>
<v-flex xs3>
<v-card class="mb-2 mr-2" >
<v-card-title
dark
class="headline info pt-2 pb-2"
primary-title
style="color:white"
>
<h5 dark>terere</h5>
</v-card-title>
<v-card-text>
<v-btn small color="error"><v-icon left>close</v-icon>fsafsaf</v-btn>
<v-btn small color="error"><v-icon left>close</v-icon>fsafsaf</v-btn>
</v-card-text>
</v-card>
</v-flex>
<v-flex xs3>
<v-card class="mb-2 mr-2" >
<v-card-title
dark
class="headline info pt-2 pb-2"
primary-title
style="color:white"
>
<h5 dark>terere</h5>
</v-card-title>
<v-card-text>
<v-btn small color="error"><v-icon left>close</v-icon>fsafsaf</v-btn>
<v-btn small color="error"><v-icon left>close</v-icon>fsafsaf</v-btn>
<v-btn small color="error"><v-icon left>close</v-icon>fsafsaf</v-btn>
<v-btn small color="error"><v-icon left>close</v-icon>fsafsaf</v-btn>
</v-card-text>
</v-card>
</v-flex>
</v-layout>
</v-flex>
</v-layout>
</template>
<style scoped>
</style>
<script>
module.exports = {
data: () => ({
search_staff: ''
}),
computed: {
dialogconfirmationdelete: {
get() {
return this.$store.state.doctor.dialog_confirmation_delete
},
set(val) {
this.$store.commit("doctor/update_dialog_confirmation_delete", val)
}
},
isLoading() {
return this.$store.state.doctor.search_status == 1
},
msgconfirmationdelete() {
return this.$store.state.doctor.msg_confirmation_delete
},
xact() {
return this.$store.state.doctor.act
},
detail() {
return this.$store.state.doctor.selected_doctor
},
xpreffix: {
get() {
return this.$store.state.doctor.preffix
},
set(val) {
this.$store.commit("doctor/update_preffix", val)
this.$store.commit("doctor/update_no_save", 1)
}
},
xpreffix2: {
get() {
return this.$store.state.doctor.preffix2
},
set(val) {
this.$store.commit("doctor/update_preffix2", val)
this.$store.commit("doctor/update_no_save", 1)
}
},
xdoctorname: {
get() {
return this.$store.state.doctor.doctor_name
},
set(val) {
this.$store.commit("doctor/update_doctor_name", val)
this.$store.commit("doctor/update_no_save", 1)
}
},
xsuffix: {
get() {
return this.$store.state.doctor.suffix
},
set(val) {
this.$store.commit("doctor/update_suffix", val)
this.$store.commit("doctor/update_no_save", 1)
}
},
xsuffix2: {
get() {
return this.$store.state.doctor.suffix2
},
set(val) {
this.$store.commit("doctor/update_suffix2", val)
this.$store.commit("doctor/update_no_save", 1)
}
},
xsuffix3: {
get() {
return this.$store.state.doctor.suffix3
},
set(val) {
this.$store.commit("doctor/update_suffix3", val)
this.$store.commit("doctor/update_no_save", 1)
}
},
xsexes() {
return this.$store.state.doctor.sexes
},
xsex: {
get() {
return this.$store.state.doctor.selected_sex
},
set(val) {
this.$store.commit("doctor/update_selected_sex", val)
this.$store.commit("doctor/update_no_save", 1)
}
},
xreligions() {
return this.$store.state.doctor.religions
},
xreligion: {
get() {
return this.$store.state.doctor.selected_religion
},
set(val) {
this.$store.commit("doctor/update_selected_religion", val)
this.$store.commit("doctor/update_no_save", 1)
}
},
xstaffs() {
return this.$store.state.doctor.staffs
},
xstaff: {
get() {
return this.$store.state.doctor.staff
},
set(val) {
this.$store.commit("doctor/update_staff", val)
}
},
xphone: {
get() {
return this.$store.state.doctor.phone
},
set(val) {
this.$store.commit("doctor/update_phone", val)
this.$store.commit("doctor/update_no_save", 1)
}
},
xhp: {
get() {
return this.$store.state.doctor.hp
},
set(val) {
this.$store.commit("doctor/update_hp", val)
this.$store.commit("doctor/update_no_save", 1)
}
},
xemail: {
get() {
return this.$store.state.doctor.email
},
set(val) {
this.$store.commit("doctor/update_email", val)
this.$store.commit("doctor/update_no_save", 1)
}
},
xnote: {
get() {
return this.$store.state.doctor.note
},
set(val) {
this.$store.commit("doctor/update_note", val)
this.$store.commit("doctor/update_no_save", 1)
}
},
xpj: {
get() {
return this.$store.state.doctor.pj
},
set(val) {
this.$store.commit("doctor/update_pj", val)
this.$store.commit("doctor/update_no_save", 1)
}
},
xpjmcu: {
get() {
return this.$store.state.doctor.pjmcu
},
set(val) {
this.$store.commit("doctor/update_pjmcu", val)
this.$store.commit("doctor/update_no_save", 1)
}
},
xdpj: {
get() {
return this.$store.state.doctor.dpj
},
set(val) {
this.$store.commit("doctor/update_dpj", val)
this.$store.commit("doctor/update_no_save", 1)
}
},
xclinic: {
get() {
return this.$store.state.doctor.clinic
},
set(val) {
this.$store.commit("doctor/update_clinic", val)
this.$store.commit("doctor/update_no_save", 1)
}
},
xmarketingconfirm: {
get() {
return this.$store.state.doctor.marketing_confirm
},
set(val) {
this.$store.commit("doctor/update_marketing_confirm", val)
this.$store.commit("doctor/update_no_save", 1)
}
},
xdefault: {
get() {
return this.$store.state.doctor.is_default
},
set(val) {
this.$store.commit("doctor/update_is_default", val)
this.$store.commit("doctor/update_no_save", 1)
}
},
isdefaultemail: {
get() {
return this.$store.state.doctor.is_default_email
},
set(val) {
this.$store.commit("doctor/update_is_default_email", val)
}
},
xdob: {
get() {
return this.$store.state.doctor.dob
},
set(val) {
this.$store.commit("doctor/update_dob", val)
this.$store.commit("doctor/update_no_save", 1)
}
},
selected_specialist: {
get() {
return this.$store.state.doctor.selected_specialist
},
set(val) {
this.$store.commit("doctor/update_selected_specialist", val)
this.$store.commit("doctor/update_no_save", 1)
}
},
xspecialistes() {
return this.$store.state.doctor.specialistes
},
},
methods: {
checkError(value) {
var errors = this.$store.state.doctor.errors
if (errors.includes(value)) {
return true
} else {
return false
}
},
changeBtnFlagPJ(value) {
var newval = (value === 'Y') ? 'N' : 'Y'
this.xpj = newval
},
changeBtnFlagPJMCU(value) {
var newval = (value === 'Y') ? 'N' : 'Y'
this.xpjmcu = newval
},
changeBtnFlagDefaultEmail(value) {
if (this.xemail !== '') {
var newval = (value === 'Y') ? 'N' : 'Y'
this.isdefaultemail = newval
} else {
var msg = "si mail main ayunan, email kosong jangan dibiarkan"
this.$store.commit("doctor/update_msg_info", msg)
this.$store.commit("doctor/update_open_dialog_info", true)
}
},
changeBtnFlagDefaultPJ(value) {
var newval = (value === 'Y') ? 'N' : 'Y'
this.xdpj = newval
},
changeBtnFlagDefault(value) {
var newval = (value === 'Y') ? 'N' : 'Y'
this.xdefault = newval
},
changeBtnFlagClinic(value) {
var newval = (value === 'Y') ? 'N' : 'Y'
this.xclinic = newval
},
changeBtnFlagMarketing(value) {
var newval = (value === 'Y') ? 'N' : 'Y'
this.xmarketingconfirm = newval
},
saveData() {
this.$store.commit("doctor/update_errors", [])
var errors = this.$store.state.doctor.errors
if (this.xdoctorname === '') {
errors.push("requirename")
}
if (_.isEmpty(this.xsex)) {
errors.push("requiresex")
}
var xDate = moment(this.$store.state.doctor.M_DoctorDOB, 'DD-MM-YYYY', true)
var isValidDate = xDate.isValid()
if (errors.length === 0) {
var prm = {}
prm.M_DoctorID = this.$store.state.doctor.selected_doctor.M_DoctorID
prm.M_DoctorPrefix = this.xpreffix
prm.M_DoctorPrefix2 = this.xpreffix2
prm.M_DoctorName = this.xdoctorname
prm.M_DoctorSufix = this.xsuffix
prm.M_DoctorSufix2 = this.xsuffix2
prm.M_DoctorSufix3 = this.xsuffix3
prm.M_DoctorM_SexID = this.$store.state.doctor.selected_sex.M_SexID
prm.M_DoctorM_ReligionID = this.$store.state.doctor.selected_religion.M_ReligionID
prm.M_DoctorM_StaffID = this.xstaff.Nat_StaffID
prm.M_DoctorM_StaffNIK = this.xstaff.Nat_StaffNIK
prm.M_DoctorEmail = this.xemail
prm.M_DoctorHP = this.xhp
prm.M_DoctorNote = this.xnote
prm.M_DoctorPhone = this.xphone
prm.M_DoctorIsMarketingConfirm = this.xmarketingconfirm
prm.M_DoctorEmailIsDefault = this.isdefaultemail
prm.M_DoctorM_SpecialistID = this.selected_specialist.id
prm.M_DoctorDOB = this.xdob
this.$store.dispatch("doctor/save", prm)
}
},
thr_search_staff: _.debounce(function () {
this.$store.dispatch("doctor/searchstaff", this.search_staff)
}, 2000),
saveNewDoctor() {
this.$store.commit("doctor/update_errors", [])
var errors = this.$store.state.doctor.errors
if (this.xdoctorname === '') {
errors.push("requirename")
}
if (_.isEmpty(this.xsex)) {
errors.push("requiresex")
}
if (errors.length === 0) {
var prm = {}
prm.M_DoctorID = 0
prm.M_DoctorPrefix = this.xpreffix
prm.M_DoctorPrefi2 = this.xpreffi2
prm.M_DoctorName = this.xdoctorname
prm.M_DoctorSufix = this.xsuffix
prm.M_DoctorSufix2 = this.xsuffix2
prm.M_DoctorSufix3 = this.xsuffix3
prm.M_DoctorM_SexID = this.$store.state.doctor.selected_sex.M_SexID
prm.M_DoctorM_ReligionID = this.$store.state.doctor.selected_religion.M_ReligionID
prm.M_DoctorM_StaffID = this.xstaff.Nat_StaffID
prm.M_DoctorM_StaffNIK = this.xstaff.Nat_StaffNIK
prm.M_DoctorEmail = this.xemail
prm.M_DoctorHP = this.xhp
prm.M_DoctorNote = this.xnote
prm.M_DoctorPhone = this.xphone
prm.M_DoctorIsMarketingConfirm = this.xmarketingconfirm
prm.M_DoctorEmailIsDefault = this.isdefaultemail
prm.M_DoctorM_SpecialistID = this.selected_specialist.id
prm.M_DoctorDOB = this.xdob
this.$store.dispatch("doctor/newdoctor", prm)
}
},
deleteData() {
let msg = "Yakin, akan menghapus data dokter " + this.xdoctorname + " ?"
this.$store.commit("doctor/update_msg_confirmation_delete", msg)
this.$store.commit("doctor/update_dialog_confirmation_delete", true)
},
doDeleteData() {
var prm = {}
prm.M_DoctorID = this.$store.state.doctor.selected_doctor.M_DoctorID
prm.M_DoctorPrefix = this.xpreffix
prm.M_DoctorPrefix2 = this.xpreffix2
prm.M_DoctorName = this.xdoctorname
prm.M_DoctorSufix = this.xsuffix
prm.M_DoctorSufix2 = this.xsuffix2
prm.M_DoctorSufix3 = this.xsuffix3
this.$store.dispatch("doctor/delete", prm)
}
},
watch: {
search_staff(val, old) {
if (val == old) return
if (!val) return
if (val.length < 1) return
if (this.$store.state.doctor.update_autocomplete_status == 1) return
this.thr_search_staff()
}
}
}
</script>

View File

@@ -0,0 +1,511 @@
<template>
<v-layout class="mb-2" column>
<v-dialog v-model="dialogconfirmationdelete" persistent max-width="290">
<v-card>
<v-card-title dark class="headline error pt-2 pb-2" primary-title style="color:white">
<h4 dark>Konfirmasi</h4>
</v-card-title>
<v-card-text>
{{msgconfirmationdelete}}
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn small color="error darken-1 text-sm-left" flat @click="doDeleteData()">Hapus</v-btn>
<v-btn small color="primary darken-1 text-sm-right" flat @click="dialogconfirmationdelete = false">Batal</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<v-card>
<v-layout row>
<v-flex xs12>
<v-subheader red--text text--lighten-1> DETAIL DOKTER
<v-flex text-md-right>
<v-btn v-if="xact === 'new'" @click="saveNewDoctor()" small color="info">Simpan</v-btn>
<v-btn v-if="xact === 'edit'" @click="deleteData()" small color="error">Hapus</v-btn>
<v-btn v-if="xact === 'edit'" @click="saveData()" small color="primary">Simpan</v-btn>
</v-flex>
</v-subheader>
<v-divider></v-divider>
<v-layout row wrap>
<v-flex xs12 pa-2>
<v-layout row>
<v-flex xs2 pa-1>
<v-text-field v-model="xpreffix" label="Imbuhan Awal 1"></v-text-field>
</v-flex>
<v-flex xs2 pa-1>
<v-text-field v-model="xpreffix2" label="Imbuhan Awal 2"></v-text-field>
</v-flex>
<v-flex xs8 pa-1>
<v-text-field v-model="xdoctorname" label="Nama Dokter*"></v-text-field>
<p v-if="checkError('requirename')" class="error pl-2 pr-2" style="color:#fff">Nama harus diisi dong</p>
</v-flex>
</v-layout>
<v-layout row>
<v-flex xs4 pa-1>
<v-text-field v-model="xsuffix" label="Akhiran 1"></v-text-field>
</v-flex>
<v-flex xs4 pa-1>
<v-text-field v-model="xsuffix2" label="Akhiran 2"></v-text-field>
</v-flex>
<v-flex xs4 pa-1>
<v-text-field v-model="xsuffix3" label="Akhiran 3"></v-text-field>
</v-flex>
</v-layout>
<v-layout row>
<v-flex xs6 pa-1>
<v-select item-text="m_sexname" return-object :items="xsexes" v-model="xsex" label="Jenis Kelamin*"></v-select>
<p v-if="checkError('requiresex')" class="error pl-2 pr-2" style="color:#fff">Jenis Kelamin harus diisi dong</p>
</v-flex>
<v-flex xs6 pa-1>
<v-select item-text="M_ReligionName" return-object :items="xreligions" v-model="xreligion" label="Agama"></v-select>
<p v-if="checkError('requirereligion')" class="error pl-2 pr-2" style="color:#fff">Agama harus diisi dong</p>
</v-flex>
</v-layout>
<v-layout row>
<v-flex xs4 pa-1>
<v-text-field v-model="xphone" label="Telepon"></v-text-field>
</v-flex>
<v-flex xs4 pa-1>
<v-text-field v-model="xhp" label="HP"></v-text-field>
</v-flex>
<v-flex xs4 pa-1>
<v-text-field v-model="xemail" label="Email"></v-text-field>
</v-flex>
</v-layout>
<v-layout row>
<v-flex xs12 pa-1>
<v-textarea v-model="xnote" label="Catatan"></v-textarea>
</v-flex>
</v-layout>
<v-layout row>
<v-flex xs6>
<div>
<v-btn @click="changeBtnFlagPJ(xpj)" v-if="xpj === 'N'" small color="error">
<v-icon left>close</v-icon> Penanggung Jawab</v-btn>
<v-btn @click="changeBtnFlagPJ(xpj)" v-if="xpj === 'Y'" small color="success">
<v-icon left>check</v-icon> Penanggung Jawab</v-btn>
</div>
<div>
<v-btn @click="changeBtnFlagDefaultPJ(xdpj)" v-if="xdpj === 'N'" small color="error">
<v-icon left>close</v-icon> Default PJ</v-btn>
<v-btn @click="changeBtnFlagDefaultPJ(xdpj)" v-if="xdpj === 'Y'" small color="success">
<v-icon left>check</v-icon> Default PJ</v-btn>
</div>
<div>
<v-btn @click="changeBtnFlagDefault(xdefault)" v-if="xdefault === 'N'" small color="error">
<v-icon left>close</v-icon> Default Dokter</v-btn>
<v-btn @click="changeBtnFlagDefault(xdefault)" v-if="xdefault === 'Y'" small color="success">
<v-icon left>check</v-icon> Default Dokter</v-btn>
</div>
</v-flex>
<v-flex xs6 class="text-sm-right align-right">
<div>
<v-btn @click="changeBtnFlagDefaultEmail(isdefaultemail)" v-if="xemail != '' && isdefaultemail === 'N'" small color="error">
<v-icon left>close</v-icon> Otomatis pengiriman email </v-btn>
<v-btn @click="changeBtnFlagDefaultEmail(isdefaultemail)" v-if="xemail != '' && isdefaultemail === 'Y'" small color="success">
<v-icon left>check</v-icon> Otomatis pengiriman email</v-btn>
</div>
<div>
<v-btn @click="changeBtnFlagClinic(xclinic)" v-if="xclinic === 'N'" small color="error">
<v-icon left>close</v-icon> Dokter Klinik</v-btn>
<v-btn @click="changeBtnFlagClinic(xclinic)" v-if="xclinic === 'Y'" small color="success">
<v-icon left>check</v-icon> Dokter Klinik</v-btn>
</div>
<div>
<v-btn @click="changeBtnFlagMarketing(xmarketingconfirm)" v-if="xmarketingconfirm === 'N'" small color="error">
<v-icon left>close</v-icon> Belum dikonfirmasi Marketing</v-btn>
<v-btn @click="changeBtnFlagMarketing(xmarketingconfirm)" v-if="xmarketingconfirm === 'Y'" small color="success">
<v-icon left>check</v-icon> Sudah dikonfirmasi Marketing</v-btn>
</div>
</v-flex>
</v-layout>
</v-flex>
</v-layout>
</v-flex>
</v-flex>
</v-card>
</v-layout>
</template>
<style scoped>
table,
td,
th {
border: 1px solid #ddd;
text-align: left;
}
table {
border-collapse: collapse;
width: 100%;
}
th,
td {
padding-top: 5px;
padding-bottom: 5px;
padding-left: 8px;
padding-right: 5px;
}
.mini-input .v-input {
margin-top: 0px;
}
.mini-input .v-input,
.mini-input .v-input--selection-controls,
.mini-input .v-input__slot {
margin-top: 0px;
margin-bottom: 0px;
margin-left: 3px;
}
.mini-input .v-messages {
min-height: 0px;
}
input.fhm-input {
border: 1px solid black;
border-radius: 2px;
-webkit-box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.1),
0 0 4px rgba(0, 0, 0, 0.1);
-moz-box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.1),
0 0 4px rgba(0, 0, 0, 0.1);
box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.1),
0 0 4px rgba(0, 0, 0, 0.1);
padding: 2px 4px;
background: rgba(255, 255, 255, 0.5);
margin: 0 0 1px 0;
width: 30px;
text-align: center;
}
</style>
<script>
module.exports = {
data: () => ({
}),
computed: {
dialogconfirmationdelete: {
get() {
return this.$store.state.doctor.dialog_confirmation_delete
},
set(val) {
this.$store.commit("doctor/update_dialog_confirmation_delete", val)
}
},
msgconfirmationdelete() {
return this.$store.state.doctor.msg_confirmation_delete
},
xact() {
return this.$store.state.doctor.act
},
detail() {
return this.$store.state.doctor.selected_doctor
},
xpreffix: {
get() {
return this.$store.state.doctor.preffix
},
set(val) {
this.$store.commit("doctor/update_preffix", val)
this.$store.commit("doctor/update_no_save", 1)
}
},
xpreffix2: {
get() {
return this.$store.state.doctor.preffix2
},
set(val) {
this.$store.commit("doctor/update_preffix2", val)
this.$store.commit("doctor/update_no_save", 1)
}
},
xdoctorname: {
get() {
return this.$store.state.doctor.doctor_name
},
set(val) {
this.$store.commit("doctor/update_doctor_name", val)
this.$store.commit("doctor/update_no_save", 1)
}
},
xsuffix: {
get() {
return this.$store.state.doctor.suffix
},
set(val) {
this.$store.commit("doctor/update_suffix", val)
this.$store.commit("doctor/update_no_save", 1)
}
},
xsuffix2: {
get() {
return this.$store.state.doctor.suffix2
},
set(val) {
this.$store.commit("doctor/update_suffix2", val)
this.$store.commit("doctor/update_no_save", 1)
}
},
xsuffix3: {
get() {
return this.$store.state.doctor.suffix3
},
set(val) {
this.$store.commit("doctor/update_suffix3", val)
this.$store.commit("doctor/update_no_save", 1)
}
},
xsexes() {
return this.$store.state.doctor.sexes
},
xsex: {
get() {
return this.$store.state.doctor.selected_sex
},
set(val) {
this.$store.commit("doctor/update_selected_sex", val)
this.$store.commit("doctor/update_no_save", 1)
}
},
xreligions() {
return this.$store.state.doctor.religions
},
xreligion: {
get() {
return this.$store.state.doctor.selected_religion
},
set(val) {
this.$store.commit("doctor/update_selected_religion", val)
this.$store.commit("doctor/update_no_save", 1)
}
},
xphone: {
get() {
return this.$store.state.doctor.phone
},
set(val) {
this.$store.commit("doctor/update_phone", val)
this.$store.commit("doctor/update_no_save", 1)
}
},
xhp: {
get() {
return this.$store.state.doctor.hp
},
set(val) {
this.$store.commit("doctor/update_hp", val)
this.$store.commit("doctor/update_no_save", 1)
}
},
xemail: {
get() {
return this.$store.state.doctor.email
},
set(val) {
this.$store.commit("doctor/update_email", val)
this.$store.commit("doctor/update_no_save", 1)
}
},
xnote: {
get() {
return this.$store.state.doctor.note
},
set(val) {
this.$store.commit("doctor/update_note", val)
this.$store.commit("doctor/update_no_save", 1)
}
},
xpj: {
get() {
return this.$store.state.doctor.pj
},
set(val) {
this.$store.commit("doctor/update_pj", val)
this.$store.commit("doctor/update_no_save", 1)
}
},
xdpj: {
get() {
return this.$store.state.doctor.dpj
},
set(val) {
this.$store.commit("doctor/update_dpj", val)
this.$store.commit("doctor/update_no_save", 1)
}
},
xclinic: {
get() {
return this.$store.state.doctor.clinic
},
set(val) {
this.$store.commit("doctor/update_clinic", val)
this.$store.commit("doctor/update_no_save", 1)
}
},
xmarketingconfirm: {
get() {
return this.$store.state.doctor.marketing_confirm
},
set(val) {
this.$store.commit("doctor/update_marketing_confirm", val)
this.$store.commit("doctor/update_no_save", 1)
}
},
xdefault: {
get() {
return this.$store.state.doctor.is_default
},
set(val) {
this.$store.commit("doctor/update_is_default", val)
this.$store.commit("doctor/update_no_save", 1)
}
},
isdefaultemail: {
get() {
return this.$store.state.doctor.is_default_email
},
set(val) {
this.$store.commit("doctor/update_is_default_email", val)
}
}
},
methods: {
checkError(value) {
var errors = this.$store.state.doctor.errors
if (errors.includes(value)) {
return true
} else {
return false
}
},
changeBtnFlagPJ(value) {
var newval = (value === 'Y') ? 'N' : 'Y'
this.xpj = newval
},
changeBtnFlagDefaultEmail(value) {
if (this.xemail !== '') {
var newval = (value === 'Y') ? 'N' : 'Y'
this.isdefaultemail = newval
} else {
var msg = "si mail main ayunan, email kosong jangan dibiarkan"
this.$store.commit("doctor/update_msg_info", msg)
this.$store.commit("doctor/update_open_dialog_info", true)
}
},
changeBtnFlagDefaultPJ(value) {
var newval = (value === 'Y') ? 'N' : 'Y'
this.xdpj = newval
},
changeBtnFlagDefault(value) {
var newval = (value === 'Y') ? 'N' : 'Y'
this.xdefault = newval
},
changeBtnFlagClinic(value) {
var newval = (value === 'Y') ? 'N' : 'Y'
this.xclinic = newval
},
changeBtnFlagMarketing(value) {
var newval = (value === 'Y') ? 'N' : 'Y'
this.xmarketingconfirm = newval
},
saveData() {
this.$store.commit("doctor/update_errors", [])
var errors = this.$store.state.doctor.errors
if (this.xdoctorname === '') {
errors.push("requirename")
}
if (_.isEmpty(this.xsex)) {
errors.push("requiresex")
}
if (_.isEmpty(this.xreligion)) {
errors.push("requirereligion")
}
if (errors.length === 0) {
var prm = {}
prm.M_DoctorID = this.$store.state.doctor.selected_doctor.M_DoctorID
prm.M_DoctorPrefix = this.xpreffix
prm.M_DoctorPrefix2 = this.xpreffix2
prm.M_DoctorName = this.xdoctorname
prm.M_DoctorSufix = this.xsuffix
prm.M_DoctorSufix2 = this.xsuffix2
prm.M_DoctorSufix3 = this.xsuffix3
prm.M_DoctorM_SexID = this.$store.state.doctor.selected_sex.M_SexID
prm.M_DoctorM_ReligionID = this.$store.state.doctor.selected_religion.M_ReligionID
prm.M_DoctorEmail = this.xemail
prm.M_DoctorHP = this.xhp
prm.M_DoctorNote = this.xnote
prm.M_DoctorPhone = this.xphone
prm.M_DoctorIsMarketingConfirm = this.xmarketingconfirm
prm.M_DoctorIsPJ = this.xpj
prm.M_DoctorIsDefaultPJ = this.xdpj
prm.M_DoctorIsClinic = this.xclinic
prm.M_DoctorIsDefault = this.xdefault
prm.M_DoctorEmailIsDefault = this.isdefaultemail
this.$store.dispatch("doctor/save", prm)
}
},
saveNewDoctor() {
this.$store.commit("doctor/update_errors", [])
var errors = this.$store.state.doctor.errors
if (this.xdoctorname === '') {
errors.push("requirename")
}
if (_.isEmpty(this.xsex)) {
errors.push("requiresex")
}
if (_.isEmpty(this.xreligion)) {
errors.push("requirereligion")
}
if (errors.length === 0) {
var prm = {}
prm.M_DoctorID = 0
prm.M_DoctorPrefix = this.xpreffix
prm.M_DoctorPrefi2 = this.xpreffi2
prm.M_DoctorName = this.xdoctorname
prm.M_DoctorSufix = this.xsuffix
prm.M_DoctorSufix2 = this.xsuffix2
prm.M_DoctorSufix3 = this.xsuffix3
prm.M_DoctorM_SexID = this.$store.state.doctor.selected_sex.M_SexID
prm.M_DoctorM_ReligionID = this.$store.state.doctor.selected_religion.M_ReligionID
prm.M_DoctorEmail = this.xemail
prm.M_DoctorHP = this.xhp
prm.M_DoctorNote = this.xnote
prm.M_DoctorPhone = this.xphone
prm.M_DoctorIsMarketingConfirm = this.xmarketingconfirm
prm.M_DoctorIsPJ = this.xpj
prm.M_DoctorIsDefaultPJ = this.xdpj
prm.M_DoctorIsClinic = this.xclinic
prm.M_DoctorIsDefault = this.xdefault
prm.M_DoctorEmailIsDefault = this.isdefaultemail
this.$store.dispatch("doctor/newdoctor", prm)
}
},
deleteData() {
let msg = "Yakin, akan menghapus data dokter " + this.xdoctorname + " ?"
this.$store.commit("doctor/update_msg_confirmation_delete", msg)
this.$store.commit("doctor/update_dialog_confirmation_delete", true)
},
doDeleteData() {
var prm = {}
prm.M_DoctorID = this.$store.state.doctor.selected_doctor.M_DoctorID
prm.M_DoctorPrefix = this.xpreffix
prm.M_DoctorPrefix2 = this.xpreffix2
prm.M_DoctorName = this.xdoctorname
prm.M_DoctorSufix = this.xsuffix
prm.M_DoctorSufix2 = this.xsuffix2
prm.M_DoctorSufix3 = this.xsuffix3
this.$store.dispatch("doctor/delete", prm)
}
}
}
</script>

View File

@@ -0,0 +1,357 @@
<template>
<v-layout class="fill-height" column>
<v-dialog v-model="dialogsuccess" persistent max-width="290">
<v-card>
<v-card-title color="success" class="headline">Berhasil !</v-card-title>
<v-card-text>
{{msgsuccess}}
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="green darken-1" flat @click="closeDialogSuccess">OK</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<v-card class="mb-2 pa-2 searchbox">
<v-layout>
<v-text-field class="xs4 ma-1" label="Nama" @keyup.enter="searchDoctor" outline v-model="name" hide-details></v-text-field>
<v-select item-text="Nat_StaffName" return-object :items="staffs" style="font-size:14px" class="xs4 mini-select ma-1" v-model="selected_filter_staff"
outline hide-details label="marketing"></v-select>
<v-select class="xs4 mini-select ma-1" :items="xstatuses" style="font-size:14px" item-text="label" return-object v-model="xselectedstatus"
label="Status" outline hide-details></v-select>
<!--<span @click="searchDoctor" class="icon-medium-fill-base xs1 white--text success iconsearch-search"></span>-->
<span @click="setNewDoctor" class="icon-medium-fill-base xs1 white--text primary ml-1 icon-add"></span>
</v-layout>
</v-card>
<v-card>
<v-layout row>
<v-flex xs12 pt-2 pb-2>
<v-data-table :headers="headers" :items="doctors" :loading="isLoading" hide-actions class="elevation-1">
<template slot="items" slot-scope="props">
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.M_DoctorCode}}</td>
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.doctor_fullname }}</td>
<td class="text-xs-center pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.M_DoctorPhone}}</td>
<td class="text-xs-center pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.M_DoctorHP}}</td>
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">{{ props.item.status}}</td>
</template>
</v-data-table>
<v-divider></v-divider>
<v-pagination style="margin-top:10px;margin-bottom:10px" v-model="curr_page" :length="xtotal_page"></v-pagination>
</v-flex>
</v-layout>
</v-card>
<!--<one-dialog-info :status="opendialoginfo" :msg="msginfo" @close-dialog-info="closeDialogInfo()"></one-dialog-info>
<one-dialog-alert :status="openalertconfirmation" :msg="msgalertconfirmation" @forget-dialog-alert="forgetAlertConfirmation()"
@close-dialog-alert="closeAlertConfirmation()"></one-dialog-alert>-->
</v-layout>
</template>
<style scoped>
.searchbox .v-input.v-text-field .v-input__slot {
min-height: 60px;
}
.searchbox .v-btn {
min-height: 60px;
}
table.v-table tbody td,
table.v-table tbody th {
height: 40px;
}
table.v-table thead tr {
height: 40px;
}
</style>
<script>
module.exports = {
components: {
'one-dialog-info': httpVueLoader('../../common/oneDialogInfo.vue'),
'one-dialog-alert': httpVueLoader('../../common/oneDialogAlert.vue')
},
mounted() {
this.$store.dispatch("doctor/getsexreg", {
name: this.name,
status: this.xselectedstatus.value,
staff: this.selected_filter_staff.Nat_StaffNIK,
current_page: 1,
lastid: -1
})
this.$store.dispatch("doctor/searchstaff", {
name: this.search_staff
})
},
methods: {
isSelected(p) {
return p.M_DoctorID == this.$store.state.doctor.selected_doctor.M_DoctorID
},
searchDoctor() {
this.$store.dispatch("doctor/search", {
name: this.name,
status: this.xselectedstatus.value,
staff: this.selected_filter_staff.Nat_StaffNIK,
current_page: 1,
lastid: -1
})
},
selectMe(doc) {
console.log(doc)
console.log(this.$store.state.doctor.no_save)
this.$store.commit("doctor/update_act", 'edit')
this.$store.commit("doctor/update_selected_doctor", doc)
this.$store.commit("doctor/update_preffix", doc.M_DoctorPrefix)
this.$store.commit("doctor/update_doctor_name", doc.M_DoctorName)
this.$store.commit("doctor/update_suffix", doc.M_DoctorSufix)
this.$store.commit("doctor/update_selected_sex", {
M_SexID: doc.M_DoctorM_SexID,
m_sexname: doc.M_SexName
})
this.$store.commit("doctor/update_selected_staff", {
Nat_StaffNIK: doc.Nat_StaffNIK,
Nat_StaffName: doc.Nat_StaffName
})
this.$store.commit("doctor/update_staffs",[{Nat_StaffID:doc.Nat_StaffID,Nat_StaffNIK:doc.Nat_StaffNIK,Nat_StaffName:doc.Nat_StaffName}])
this.$store.commit("doctor/update_staff", {
Nat_StaffID:doc.Nat_StaffID,
Nat_StaffNIK: doc.Nat_StaffNIK,
Nat_StaffName: doc.Nat_StaffName
})
this.$store.commit("doctor/update_selected_religion", {
M_ReligionID: doc.M_DoctorM_ReligionID,
M_ReligionName: doc.M_ReligionName
})
this.$store.commit("doctor/update_dob",doc.M_DoctorDOB)
this.$store.commit("doctor/update_selected_specialist",{
id:doc.M_DoctorM_SpecialistID,
name:doc.M_SpecialistName
})
this.$store.commit("doctor/update_phone", doc.M_DoctorPhone)
this.$store.commit("doctor/update_email", doc.M_DoctorEmail)
this.$store.commit("doctor/update_hp", doc.M_DoctorHP)
this.$store.commit("doctor/update_note", doc.M_DoctorNote)
this.$store.commit("doctor/update_pj", doc.M_DoctorIsPJ)
this.$store.commit("doctor/update_pjmcu", doc.M_DoctorIsDefaultMcu)
this.$store.commit("doctor/update_dpj", doc.M_DoctorIsDefaultPJ)
this.$store.commit("doctor/update_clinic", doc.M_DoctorIsClinic)
this.$store.commit("doctor/update_marketing_confirm", doc.M_DoctorIsMarketingConfirm)
this.$store.commit("doctor/update_is_default", doc.M_DoctorIsDefault)
this.$store.commit("doctor/update_is_default_email", doc.M_DoctorEmailIsDefault)
this.$store.dispatch("doctor/getaddress", {
id: doc.M_DoctorID
})
},
closeAlertConfirmation() {
this.$store.commit("doctor/update_open_alert_confirmation", false)
},
forgetAlertConfirmation() {
this.$store.commit("doctor/update_no_save", 0)
this.$store.commit("doctor/update_open_alert_confirmation", false)
},
updateAlert_success(val) {
this.$store.commit("doctor/update_alert_success", val)
},
setNewDoctor() {
this.$store.commit("doctor/update_selected_doctor", {})
this.$store.commit("doctor/update_preffix", '')
this.$store.commit("doctor/update_doctor_name", '')
this.$store.commit("doctor/update_suffix", '')
this.$store.commit("doctor/update_selected_sex", {})
this.$store.commit("doctor/update_selected_religion", {})
this.$store.commit("doctor/update_staff", {})
this.$store.commit("doctor/update_phone", '')
this.$store.commit("doctor/update_email", '')
this.$store.commit("doctor/update_hp", '')
this.$store.commit("doctor/update_note", '')
this.$store.commit("doctor/update_pj", 'N')
this.$store.commit("doctor/update_dpj", 'N')
this.$store.commit("doctor/update_clinic", 'N')
this.$store.commit("doctor/update_marketing_confirm", 'N')
this.$store.commit("doctor/update_is_default", 'N')
this.$store.commit("doctor/update_addresses", [])
this.$store.commit("doctor/update_act", 'new')
},
closeDialogSuccess() {
let arrdoctor = this.$store.state.doctor.doctors
var idx = _.findIndex(arrdoctor, item => item.M_DoctorID === this.$store.state.doctor.last_id)
console.log(idx)
this.$store.dispatch("doctor/search", {
name: this.name,
status: this.xselectedstatus.value,
staff: this.selected_filter_staff.Nat_StaffNIK,
current_page: this.curr_page,
lastid: idx
})
this.$store.commit("doctor/update_dialog_success", false)
}
},
computed: {
selected_filter_staff: {
get() {
return this.$store.state.doctor.selected_filter_staff
},
set(val) {
this.$store.commit("doctor/update_selected_filter_staff", val)
this.searchDoctor()
}
},
staffs: {
get() {
return this.$store.state.doctor.fstaffs
},
set(val) {
this.$store.commit("doctor/update_fstaffs", val)
}
},
dialogsuccess: {
get() {
return this.$store.state.doctor.dialog_success
},
set(val) {
this.$store.commit("doctor/update_dialog_success", val)
}
},
msgsuccess() {
return this.$store.state.doctor.msg_success
},
snackbar: {
get() {
return this.$store.state.doctor.alert_success
},
set(val) {
this.$store.commit("doctor/update_alert_success", val)
}
},
isLoading() {
return this.$store.state.doctor.search_status == 1
},
xstatuses() {
return this.$store.state.doctor.statuses
},
xselectedstatus: {
get() {
return this.$store.state.doctor.selected_status
},
set(val) {
this.$store.commit("doctor/update_selected_status", val)
this.searchDoctor()
}
},
doctors() {
return this.$store.state.doctor.doctors
},
openalertconfirmation: {
get() {
return this.$store.state.doctor.open_alert_confirmation
},
set(val) {
this.$store.commit("doctor/update_open_alert_confirmation", val)
}
},
totaldoctor() {
return this.$store.state.doctor.total_doctor
},
curr_page: {
get() {
return this.$store.state.doctor.current_page
},
set(val) {
this.$store.commit("doctor/update_current_page", val)
this.$store.dispatch("doctor/search", {
name: this.name,
status: this.xselectedstatus.value,
staff: this.selected_filter_staff.Nat_StaffNIK,
current_page: val,
lastid: -1
})
}
},
xtotal_page: {
get() {
return this.$store.state.doctor.total_doctor
},
set(val) {
this.$store.commit("doctor/update_total_doctor", val)
}
},
opendialoginfo: {
get() {
return this.$store.state.doctor.open_dialog_info
},
set(val) {
this.$store.commit("doctor/update_open_dialog_info", val)
}
},
msginfo() {
return this.$store.state.doctor.msg_info
}
},
data() {
return {
msgalertconfirmation: "Perubahan yang telah dilakukan belum disimpan dong !",
items: [],
name: '',
page: 1,
total_pages: 5,
headers: [
{
text: "KODE",
align: "left",
sortable: false,
value: "mr",
width: "8%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "NAMA",
align: "left",
sortable: false,
value: "mr",
width: "25%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "PHONE",
align: "center",
sortable: false,
value: "lab",
width: "10%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "HP",
align: "center",
sortable: false,
value: "name",
width: "10%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "STATUS",
align: "left",
sortable: false,
value: "status",
width: "15%",
class: "pa-2 blue lighten-3 white--text"
}
],
pagination: {
descending: false,
page: 1,
rowsPerPage: 5,
sortBy: 'M_DoctorName',
totalItems: this.$store.state.doctor.total_doctor
}
};
}
}
</script>

View File

@@ -0,0 +1,91 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>One</title>
<link rel="stylesheet" href="../../libs/vendor/css/google-fonts.css">
<link rel="stylesheet" href="../../libs/vendor/css/icomoon-fonts.css">
<link rel="stylesheet" href="../../libs/vendor/css/vuetify.min.css">
</head>
<body>
<div v-cloak id="app">
<v-app id="smartApp" >
<one-navbar></one-navbar>
<v-content style="background:#F5E8DF!important" >
<v-container fluid fill-height class="pl-1 pr-1 pt-2 pb-2">
<v-layout row wrap >
<v-flex xs12 class="left" fill-height pa-1>
<one-md-doctor-detail></one-md-doctor-detail>
</v-flex>
</v-layout>
</v-container>
</v-content>
<one-footer> </one-footer>
</v-app>
</div>
<!-- Vendor -->
<script src="../../libs/vendor/moment.min.js"></script>
<script src="../../libs/vendor/numeral.min.js"></script>
<script src="../../libs/vendor/moment-locale-id.js"></script>
<script src="../../libs/vendor/lodash.js"></script>
<script src="../../libs/vendor/axios.min.js"></script>
<script src="../../libs/vendor/vue.js"></script>
<script src="../../libs/vendor/vuex.js"></script>
<script src="../../libs/vendor/vuetify.js"></script>
<script src="../../libs/vendor/httpVueLoader.js"></script>
<script src="../../libs/one_global.js"></script>
<!-- App Script -->
<?php
$ts = "?ts=" . Date("ymdhis");
?>
<script type="module">
window.calculate_age = function (inp_dob) {
var now = moment(new Date())
var dob = moment(new Date(inp_dob))
var year = now.diff(dob,'years')
dob.add(year,'years')
var month = now.diff(dob,'months')
dob.add(month,'months')
var day = now.diff(dob,'days')
if (isNaN(year)) return ''
return `${year} tahun ${month} bulan ${day} hari`
}
import { store } from './store.js<?php echo $ts ?>';
//for testing
window.store = store;
new Vue({
store,
el: '#app',
methods: {
tab_selected : function(tab) {
return this.$store.state.tab_selected == tab
}
},
components: {
'one-navbar': httpVueLoader('../../apps/components/oneNavbarComponent.vue'),
'one-footer': httpVueLoader('../../apps/components/oneFooter.vue'),
'one-md-doctor-list': httpVueLoader('./components/oneMdDoctorList.vue'),
'one-md-doctor-detail': httpVueLoader('./components/oneMdDoctorDetail.vue'),
'one-md-doctor-address': httpVueLoader('./components/oneMdDoctorAddress.vue')
}
})
</script>
<style>
[v-cloak] {
display: none
}
.left {
}
.right {
}
</style>
</body>
</html>

View File

@@ -0,0 +1,676 @@
// 1 => LOADING
// 2 => DONE
// 3 => ERROR
import * as api from "../api/doctor.js"
export default {
namespaced: true,
state: {
last_id:-1,
last_saved_id:-1,
x_addr_id:0,
act:'edit',
act_addr:'new',
get_data_status:0,
search_doctor: 0,
search_status: 0,
search_error_message: '',
statuses:[{label:'Belum dikonfirmasi marketing', value:'N'},{label:'Sudah dikonfirmasi marketing', value:'Y'}],
selected_status:{label:'Belum dikonfirmasi marketing', value:'N'},
preffix:'',
preffix2:'',
doctor_name:'',
suffix:'',
suffix2:'',
suffix3:'',
doctors: [],
total_doctors:0,
doctor_address: [],
sexes:[],
selected_sex:{},
religions:[],
selected_religion:{},
staffs:[],
staff:{},
fstaffs:[],
selected_staff:{},
phone:'',
hp:'',
note:'',
email:'',
is_default_email:'',
pj:'N',
pjmcu:'N',
dpj:'N',
clinic:'N',
is_default:'N',
marketing_confirm:'N',
total_doctor: 0,
selected_doctor: {},
save_status: 0,
btn_save_seen: true,
pgrs_save: false,
save_error_message: '',
no_save: 0,
open_alert_confirmation:false,
alert_success: false,
msg_success: "",
dialog_success: false,
dialog_confirmation_delete: false,
msg_confirmation_delete: "",
dialog_confirmation_delete_addr: false,
msg_confirmation_delete_addr: "",
autocomplete_status:0,
dialog_form_address: false,
label_address:'',
addresses:[],
cities:[],
city_address:{},
districts:[],
district_address:{},
kelurahans:[],
kelurahan_address:{},
jpas:[],
jpa_address:{},
description_address:'',
errors:[],
current_page:1,
open_dialog_info:false,
msg_info:'',
selected_filter_staff:{},
dob:'',
specialistes:[],
selected_specialist:{}
},
mutations: {
update_dob(state, val) {
state.dob = val
},
update_specialistes(state, val) {
state.specialistes = val
},
update_selected_specialist(state, val) {
state.selected_specialist = val
},
update_selected_filter_staff(state, val) {
state.selected_filter_staff = val
},
update_msg_info(state, val) {
state.msg_info = val
},
update_open_dialog_info(state, val) {
state.open_dialog_info = val
},
update_x_addr_id(state, val) {
state.x_addr_id = val
},
update_last_id(state, val) {
state.last_id = val
},
update_last_saved_id(state, val) {
state.last_saved_id = val
},
update_act(state, val) {
state.act = val
},
update_act_addr(state, val) {
state.act_addr = val
},
update_get_data_status(state, val) {
state.get_data_status = val
},
update_search_error_message(state, patient) {
state.search_error_message = patient
},
update_search_doctor(state, doctor) {
state.search_doctor = doctor
},
update_preffix(state, val) {
state.preffix = val
},
update_preffix2(state, val) {
state.preffix2 = val
},
update_doctor_name(state, val) {
state.doctor_name = val
},
update_suffix(state, val) {
state.suffix = val
},
update_suffix2(state, val) {
state.suffix2 = val
},
update_suffix3(state, val) {
state.suffix3 = val
},
update_doctors(state, data) {
state.doctors = data
},
update_selected_status(state, val) {
state.selected_status = val
},
update_selected_doctor(state, val) {
state.selected_doctor = val
},
update_sexes(state, val) {
state.sexes = val
},
update_selected_sex(state, val) {
state.selected_sex = val
},
update_religions(state, val) {
state.religions = val
},
update_selected_religion(state, val) {
state.selected_religion = val
},
update_staffs(state, val) {
state.staffs = val
},
update_staff(state, val) {
state.staff = val
},
update_fstaffs(state, val) {
state.fstaffs = val
},
update_selected_staff(state, val) {
state.selected_staff = val
},
update_phone(state, val) {
state.phone = val
},
update_is_default_email(state, val) {
state.is_default_email = val
},
update_email(state, val) {
state.email = val
},
update_hp(state, val) {
state.hp = val
},
update_note(state, val) {
state.note = val
},
update_pj(state, val) {
state.pj = val
},
update_pjmcu(state, val) {
state.pjmcu = val
},
update_dpj(state, val) {
state.dpj = val
},
update_clinic(state, val) {
state.clinic = val
},
update_marketing_confirm(state, val) {
state.marketing_confirm = val
},
update_is_default(state, val) {
state.is_default = val
},
update_save_status(state, val) {
state.save_status = val
},
update_btn_save_seen(state, val) {
state.btn_save_seen = val
},
update_pgrs_save(state, val) {
state.pgrs_save = val
},
update_save_error_message(state, msg) {
state.save_error_message = ''
},
update_no_save(state, val) {
state.no_save = val
},
update_open_alert_confirmation(state, val) {
state.open_alert_confirmation = val
},
update_alert_success(state, val) {
state.alert_success = val
},
update_msg_success(state, val) {
state.msg_success = val
},
update_dialog_success(state, val) {
state.dialog_success = val
},
update_dialog_confirmation_delete(state, val) {
state.dialog_confirmation_delete = val
},
update_msg_confirmation_delete(state, val) {
state.msg_confirmation_delete = val
},
update_dialog_confirmation_delete_addr(state, val) {
state.dialog_confirmation_delete_addr = val
},
update_msg_confirmation_delete_addr(state, val) {
state.msg_confirmation_delete_addr = val
},
update_addresses(state, val) {
state.addresses = val
},
update_autocomplete_status(state,val){
state.autocomplete_status = val
},
update_dialog_form_address(state, val) {
state.dialog_form_address = val
},
update_label_address(state, val) {
state.label_address = val
},
update_cities(state, val) {
state.cities = val
},
update_city_address(state, val) {
state.city_address = val
},
update_districts(state, val) {
state.districts = val
},
update_district_address(state, val) {
state.district_address = val
},
update_kelurahans(state, val) {
state.kelurahans = val
},
update_kelurahan_address(state, val) {
state.kelurahan_address = val
},
update_jpas(state, val) {
state.jpas = val
},
update_jpa_address(state, val) {
state.jpa_address = val
},
update_description_address(state, val) {
state.description_address = val
},
update_search_status(state, val) {
state.search_status = val
},
update_errors(state, val) {
state.errors = val
},
update_total_doctor(state, val) {
state.total_doctor = val
},
update_current_page(state, val) {
state.current_page = val
},
},
actions: {
async search(context, prm) {
context.commit("update_search_doctor", 1)
try {
prm.token = one_token()
let resp = await api.search(prm)
if (resp.status != "OK") {
context.commit("update_search_doctor", 3)
context.commit("update_search_error_message", resp.message)
} else {
context.commit("update_search_doctor", 2)
context.commit("update_search_error_message", "")
let data = {
records: resp.data.records,
total: resp.data.total
}
context.commit("update_doctors", data.records)
console.log(data.total)
context.commit("update_total_doctor", data.total)
context.commit("update_no_save", 0)
//context.commit("update_selected_doctor",{})
if(data.records.length > 0){
var doc = {}
if(prm.lastid === -1){
console.log("minsatu")
context.commit("update_selected_doctor", data.records[0])
doc = data.records[0]
}
else{
context.commit("update_selected_doctor", data.records[prm.lastid])
doc = data.records[prm.lastid]
}
context.commit("update_act", 'edit')
context.commit("update_preffix",doc.M_DoctorPrefix)
context.commit("update_preffix2",doc.M_DoctorPrefix2)
context.commit("update_doctor_name",doc.M_DoctorName)
context.commit("update_suffix",doc.M_DoctorSufix)
context.commit("update_suffix2",doc.M_DoctorSufix2)
context.commit("update_suffix3",doc.M_DoctorSufix3)
context.commit("update_selected_sex",{M_SexID:doc.M_DoctorM_SexID,m_sexname:doc.M_SexName})
context.commit("update_selected_staff",{Nat_StaffID:doc.Nat_StaffID,Nat_StaffNIK:doc.Nat_StaffNIK,Nat_StaffName:doc.Nat_StaffName})
context.commit("update_staffs",[{Nat_StaffID:doc.Nat_StaffID,Nat_StaffNIK:doc.Nat_StaffNIK,Nat_StaffName:doc.Nat_StaffName}])
context.commit("update_staff",{Nat_StaffID:doc.Nat_StaffID,Nat_StaffNIK:doc.Nat_StaffNIK,Nat_StaffName:doc.Nat_StaffName})
context.commit("update_selected_religion",{M_ReligionID:doc.M_DoctorM_ReligionID,M_ReligionName:doc.M_ReligionName})
context.commit("update_phone",doc.M_DoctorPhone)
context.commit("update_email",doc.M_DoctorEmail)
context.commit("update_hp",doc.M_DoctorHP)
context.commit("update_pj",doc.M_DoctorIsPJ)
context.commit("update_pjmcu",doc.M_DoctorIsDefaultMcu)
context.commit("update_dpj",doc.M_DoctorIsDefaultPJ)
context.commit("update_clinic",doc.M_DoctorIsClinic)
context.commit("update_marketing_confirm",doc.M_DoctorIsMarketingConfirm)
context.commit("update_is_default",doc.M_DoctorIsDefault)
context.commit("update_dob",doc.M_DoctorDOB)
context.commit("update_selected_specialist",{id:doc.M_DoctorM_SpecialistID,name:doc.M_SpecialistName})
context.dispatch("getaddress",{id:doc.M_DoctorID})
}else{
context.commit("update_act", 'new')
context.commit("update_preffix",'')
context.commit("update_preffix2",'')
context.commit("update_doctor_name",'')
context.commit("update_suffix",'')
context.commit("update_suffix2",'')
context.commit("update_suffix3",'')
context.commit("update_selected_sex",{})
context.commit("update_selected_staff",{})
context.commit("update_staff",{})
context.commit("update_selected_religion",{})
context.commit("update_phone",'')
context.commit("update_email",'')
context.commit("update_hp",'')
context.commit("update_pj",'N')
context.commit("update_pjmcu",'N')
context.commit("update_dpj",'N')
context.commit("update_clinic",'N')
context.commit("update_marketing_confirm",'N')
context.commit("update_is_default",'')
context.commit("update_addresses",[])
context.commit("update_dob",'')
context.commit("update_selected_specialist",{})
//context.dispatch("getaddress",{id:doc.M_DoctorID})
}
}
} catch (e) {
context.commit("update_search_doctor", 3)
context.commit("update_search_error_message", e.message)
console.log(e)
}
},
async getsexreg(context,prm) {
context.commit("update_get_data_status",1)
try {
let resp= await api.getsexreg(one_token())
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_sexes",data.records.sexes)
context.commit("update_specialistes",data.records.specialistes)
context.commit("update_religions",data.records.religions)
context.commit("update_fstaffs",data.records.staffs)
context.commit("update_selected_filter_staff",data.records.staffs[0])
context.commit("update_jpas",data.records.jpas)
prm.staff = data.records.staffs[0].Nat_StaffNIK
context.dispatch("search",prm)
}
} catch(e) {
context.commit("update_get_data_status",3)
}
},
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)
} else {
context.commit("update_save_status",2)
context.commit("update_last_id", prm.M_DoctorID)
context.commit("update_dialog_success", true)
var msg = "Data dokter " + prm.M_DoctorName + " sudah terupdate dong ..."
context.commit("update_msg_success", msg)
}
} catch(e) {
context.commit("update_save_status",3)
}
},
async newdoctor(context,prm) {
context.commit("update_save_status",1)
try {
prm.token = one_token()
let resp= await api.newdoctor(prm)
if (resp.status != "OK") {
context.commit("update_save_status",3)
} else {
context.commit("update_save_status",2)
console.log(resp.data.id)
context.commit("update_last_id", resp.data.id)
context.commit("update_dialog_success", true)
var msg = "Data dokter " + prm.M_DoctorName + " sudah tersimpan dong ..."
context.commit("update_msg_success", msg)
}
} catch(e) {
context.commit("update_save_status",3)
}
},
async delete(context,prm) {
context.commit("update_save_status",1)
try {
prm.token = one_token()
let resp= await api.xdelete(prm)
if (resp.status != "OK") {
context.commit("update_save_status",3)
} else {
context.commit("update_save_status",2)
context.commit("update_last_id", 0)
context.commit("update_dialog_confirmation_delete",false)
context.commit("update_dialog_success", true)
var msg = "Data dokter " + prm.M_DoctorName + " sudah dihapus dong ..."
context.commit("update_msg_success", msg)
context.commit("update_preffix",'')
context.commit("update_preffix2",'')
context.commit("update_doctor_name",'')
context.commit("update_suffix",'')
context.commit("update_suffix2",'')
context.commit("update_suffix3",'')
context.commit("update_selected_sex",{})
context.commit("update_selected_religion",{})
context.commit("update_selected_staff",{})
context.commit("update_phone",'')
context.commit("update_email",'')
context.commit("update_hp",'')
context.commit("update_note",'')
context.commit("update_pj",'N')
context.commit("update_dpj",'N')
context.commit("update_clinic",'N')
context.commit("update_marketing_confirm",'N')
context.commit("update_is_default",'N')
}
} catch(e) {
context.commit("update_save_status",3)
}
},
async getaddress(context,prm) {
context.commit("update_save_status",1)
try {
prm.token = one_token()
let resp= await api.getaddress(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_addresses",data.records)
}
} catch(e) {
context.commit("update_save_status",3)
}
},
async searchstaff(context, prm) {
context.commit("update_autocomplete_status", 1)
try {
let resp = await api.searchstaff(one_token(), 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_staffs", resp.data.records)
}
} catch (e) {
context.commit("update_autocomplete_status", 3)
}
},
async searchcity(context,prm) {
context.commit("update_autocomplete_status",1)
try {
let resp= await api.searchcity(one_token(),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_cities",resp.data.records)
}
} catch(e) {
context.commit("update_autocomplete_status",3)
}
},
async getdistrict(context,prm) {
context.commit("update_get_data_status",1)
try {
let resp= await api.getdistrict(one_token(),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_districts",resp.data.records)
}
} catch(e) {
context.commit("update_get_data_status",3)
}
},
async getkelurahan(context,prm) {
context.commit("update_get_data_status",1)
try {
let resp= await api.getkelurahan(one_token(),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_kelurahans",resp.data.records)
}
} catch(e) {
context.commit("update_get_data_status",3)
}
},
async getjpa(context) {
context.commit("update_get_data_status",1)
try {
let resp= await api.getjpa(one_token())
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_jpas",resp.data.records)
}
} catch(e) {
context.commit("update_get_data_status",3)
}
},
async savenewaddress(context,prm) {
context.commit("update_save_status",1)
try {
prm.token = one_token()
let resp= await api.savenewaddress(prm)
if (resp.status != "OK") {
context.commit("update_save_status",3)
} else {
context.commit("update_save_status",2)
context.commit("update_dialog_form_address",false)
context.commit("update_last_id", prm.M_DoctorAddressM_DoctorID)
context.commit("update_dialog_success", true)
var msg = "Penambahan data alamat dokter " + prm.M_DoctorName + " sudah berhasil dong ..."
context.commit("update_msg_success", msg)
}
} catch(e) {
context.commit("update_save_status",3)
}
},
async saveeditaddress(context,prm) {
context.commit("update_save_status",1)
try {
prm.token = one_token()
let resp= await api.saveeditaddress(prm)
if (resp.status != "OK") {
context.commit("update_save_status",3)
} else {
context.commit("update_save_status",2)
context.commit("update_dialog_form_address",false)
context.commit("update_last_id", prm.M_DoctorAddressM_DoctorID)
context.commit("update_dialog_success", true)
var msg = "Perubahan data alamat dokter " + prm.M_DoctorName + " sudah berhasil dong ..."
context.commit("update_msg_success", msg)
}
} catch(e) {
context.commit("update_save_status",3)
}
},
async deleteaddress(context,prm) {
context.commit("update_save_status",1)
try {
prm.token = one_token()
let resp= await api.deleteaddress(prm)
if (resp.status != "OK") {
context.commit("update_save_status",3)
} else {
context.commit("update_save_status",2)
context.commit("update_dialog_confirmation_delete_addr",false)
context.commit("update_last_id", prm.M_DoctorAddressM_DoctorID)
context.commit("update_dialog_success", true)
var msg = "Penghapusan data alamat "+prm.M_DoctorAddressNote+" dari dokter " + prm.M_DoctorName + " sudah berhasil dong ..."
context.commit("update_msg_success", msg)
}
} catch(e) {
context.commit("update_save_status",3)
}
}
}
}

View File

@@ -0,0 +1,27 @@
// State
// data ...
// Mutations
//
//
// Actions
import doctor from "./modules/doctor.js";
import system from "../../apps/modules/system/system.js";
export const store = new Vuex.Store({
modules: {
doctor: doctor,
system: system
},
state: {
tab_selected: 'pasien-dokter'
},
mutations: {
change_tab(state, ntab) {
state.tab_selected = ntab
}
},
actions: {
change_tab(context, ntab) {
context.commit('change_tab', ntab)
}
}
});