init biotest web
This commit is contained in:
119
one-klinik-biotest/test/vuex/one-clinic-form/api/patient.js
Normal file
119
one-klinik-biotest/test/vuex/one-clinic-form/api/patient.js
Normal file
@@ -0,0 +1,119 @@
|
||||
const URL = "/be_clinic.php";
|
||||
|
||||
export async function search(nik, name, dob, hp, current_page) {
|
||||
try {
|
||||
var resp = await axios.post(URL, {
|
||||
cmd:"getpatient",
|
||||
nik: nik,
|
||||
name: name,
|
||||
dob: dob,
|
||||
hp: hp,
|
||||
current_page:current_page
|
||||
});
|
||||
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 getcompanyclinic() {
|
||||
try {
|
||||
var resp = await axios.post(URL, {
|
||||
cmd:"getcompany",
|
||||
});
|
||||
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 getnurseclinic() {
|
||||
try {
|
||||
var resp = await axios.post(URL, {
|
||||
cmd:"getnurse",
|
||||
});
|
||||
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 getdoctorclinic() {
|
||||
try {
|
||||
var resp = await axios.post(URL, {
|
||||
cmd:"getdoctor",
|
||||
});
|
||||
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 addclinic(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL, {
|
||||
cmd:"add",
|
||||
orderDate: prm.orderDate,
|
||||
M_PatientID: prm.M_PatientID,
|
||||
NurseID: prm.NurseID,
|
||||
M_CompanyID: prm.M_CompanyID,
|
||||
Keluhan: prm.Keluhan,
|
||||
Objective: prm.Objective,
|
||||
Kesimpulan: prm.Kesimpulan,
|
||||
Saran: prm.Saran
|
||||
});
|
||||
if (resp.status != 200) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: resp.statusText
|
||||
};
|
||||
}
|
||||
let data = resp.data;
|
||||
return data;
|
||||
} catch(e) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: e.message
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,365 @@
|
||||
<template>
|
||||
<div>
|
||||
<patient-not-chosee-dialog></patient-not-chosee-dialog>
|
||||
<!-- ERROR DIALOG -->
|
||||
<v-dialog v-model="dialog_error" max-width="500px">
|
||||
<v-card>
|
||||
<v-card-title>
|
||||
<span>ERROR !</span>
|
||||
<v-spacer></v-spacer>
|
||||
</v-card-title>
|
||||
<v-divider></v-divider>
|
||||
<div class="ma-3 red--text">{{ msgError }}</div>
|
||||
<v-divider></v-divider>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="primary" flat @click="dialog_error = false">Close</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
<!-- END ERROR DIALOG -->
|
||||
<!-- Snackbar -->
|
||||
<v-snackbar v-model="snackbar" :timeout="5000" :multi-line="false" :vertical="false" :top="true" :color="clr"
|
||||
:value="snackbar">
|
||||
{{ msgsnackbar }}
|
||||
<v-btn flat @click="snackbar = false"> Tutup </v-btn>
|
||||
</v-snackbar>
|
||||
<!-- End Snackbar -->
|
||||
<v-card-title
|
||||
class="teal lighten-2 white--text pt-2 pb-2"
|
||||
primary-title
|
||||
>
|
||||
FORM KLINIK
|
||||
</v-card-title>
|
||||
<v-card-text class="pt-2 pb-2">
|
||||
<v-layout pt-2 row>
|
||||
<v-flex xs6 pr-3>
|
||||
<v-layout row wrap>
|
||||
<v-flex xs8 pr-1>
|
||||
<v-text-field
|
||||
:value="patient.M_PatientNoReg"
|
||||
readonly
|
||||
label="No Reg"
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
<v-flex xs4 pl-1>
|
||||
<v-menu
|
||||
v-model="menufilterdate"
|
||||
:close-on-content-click="false"
|
||||
:nudge-right="40"
|
||||
lazy
|
||||
transition="scale-transition"
|
||||
offset-y
|
||||
full-width
|
||||
max-width="290px" min-width="290px">
|
||||
<template v-slot:activator="{ on }">
|
||||
<v-text-field
|
||||
v-model="filterComputedDateFormatted"
|
||||
class="ma-1"
|
||||
label="Tanggal Order"
|
||||
hide-details
|
||||
readonly
|
||||
v-on="on"
|
||||
@blur="date = deFormatedDate(filterComputedDateFormatted)"></v-text-field>
|
||||
</template>
|
||||
<v-date-picker no-title
|
||||
v-model="xdate" @input="menufilterdate = false"></v-date-picker>
|
||||
</v-menu>
|
||||
</v-flex>
|
||||
<v-flex xs8 pr-1>
|
||||
<v-text-field
|
||||
placeholder=""
|
||||
:value="patient.M_PatientName"
|
||||
label="Nama Pasien"
|
||||
readonly
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
<v-flex xs4 pl-1>
|
||||
<v-text-field
|
||||
placeholder=""
|
||||
:value="patient_dob"
|
||||
label="DOB"
|
||||
readonly
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
<v-flex xs12>
|
||||
<v-textarea
|
||||
auto-grow
|
||||
rows="4"
|
||||
:value="patient.M_PatientAddress"
|
||||
readonly
|
||||
label="Alamat">
|
||||
</v-textarea>
|
||||
</v-flex>
|
||||
<v-flex xs12>
|
||||
<v-select
|
||||
v-model="selected_company"
|
||||
:items="company"
|
||||
item-value="M_PatientTypeID"
|
||||
item-text="M_PatientTypeName"
|
||||
label="Company"
|
||||
return-object
|
||||
>
|
||||
</v-select>
|
||||
<p v-if="checkError('requirecompany')" class="error pl-2 pr-2" style="color:#fff">Pilih company dulu</p>
|
||||
</v-flex>
|
||||
<v-flex xs12>
|
||||
<v-select
|
||||
v-model="selected_nurse"
|
||||
:items="nurse"
|
||||
item-value="A_NurseID"
|
||||
item-text="A_NurseName"
|
||||
label="Perawat"
|
||||
return-object
|
||||
>
|
||||
</v-select>
|
||||
<p v-if="checkError('requirenurse')" class="error pl-2 pr-2" style="color:#fff">Pilih perawat dulu</p>
|
||||
</v-flex>
|
||||
<v-flex xs12>
|
||||
<v-select
|
||||
v-model="selected_doctor"
|
||||
:items="doctor"
|
||||
item-value="A_DoctorID"
|
||||
item-text="A_DoctorName"
|
||||
label="Dokter"
|
||||
return-object
|
||||
>
|
||||
</v-select>
|
||||
<p v-if="checkError('requiredokter')" class="error pl-2 pr-2" style="color:#fff">Pilih dokter dulu</p>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
<v-flex xs6 pl-3>
|
||||
<v-layout row wrap>
|
||||
<v-flex xs12>
|
||||
<v-text-field
|
||||
v-model="keluhan"
|
||||
label="keluhan"
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
<v-flex xs12>
|
||||
<v-text-field
|
||||
v-model="objective"
|
||||
label="Obyektif"
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
<v-flex xs12>
|
||||
<v-textarea
|
||||
auto-grow
|
||||
rows="4"
|
||||
v-model="kesimpulan"
|
||||
label="Kesimpulan">
|
||||
</v-textarea>
|
||||
</v-flex>
|
||||
<v-flex xs12>
|
||||
<v-textarea
|
||||
auto-grow
|
||||
rows="4"
|
||||
v-model="saran"
|
||||
label="Saran">
|
||||
</v-textarea>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn
|
||||
dark
|
||||
color="teal"
|
||||
@click="save_clinic()"
|
||||
>
|
||||
Simpan
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
</div>
|
||||
</template>
|
||||
<style scoped>
|
||||
.v-dialog__container {
|
||||
display: block !important;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
module.exports = {
|
||||
components : {
|
||||
'patient-not-chosee-dialog': httpVueLoader('./patientNotChoseeDialog.vue')
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
keluhan: "",
|
||||
objective: "",
|
||||
kesimpulan: "",
|
||||
saran: "",
|
||||
menufilterdate: false,
|
||||
date: new Date().toISOString().substr(0, 10),
|
||||
clr: "success",
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
this.$store.dispatch('patient/getcompanyclinic')
|
||||
this.$store.dispatch('patient/getnurseclinic')
|
||||
this.$store.dispatch('patient/getdoctorclinic')
|
||||
},
|
||||
computed: {
|
||||
patient() {
|
||||
return this.$store.state.patient.selected_patient
|
||||
},
|
||||
patient_dob () {
|
||||
try {
|
||||
return this.$store.state.patient.selected_patient.M_PatientDOB.split('-').reverse().join('-')
|
||||
} catch (e) {
|
||||
}
|
||||
|
||||
},
|
||||
errors: {
|
||||
get() {
|
||||
return this.$store.state.patient.errors
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit('patient/update_errors',val)
|
||||
}
|
||||
},
|
||||
company() {
|
||||
return this.$store.state.patient.company
|
||||
},
|
||||
selected_company: {
|
||||
get () {
|
||||
return this.$store.state.patient.selected_company
|
||||
},
|
||||
set (val) {
|
||||
this.$store.commit('patient/update_selected_company', val)
|
||||
}
|
||||
},
|
||||
nurse() {
|
||||
return this.$store.state.patient.nurse
|
||||
},
|
||||
selected_nurse: {
|
||||
get () {
|
||||
return this.$store.state.patient.selected_nurse
|
||||
},
|
||||
set (val) {
|
||||
this.$store.commit('patient/update_selected_nurse', val)
|
||||
}
|
||||
},
|
||||
doctor() {
|
||||
return this.$store.state.patient.doctor
|
||||
},
|
||||
selected_doctor: {
|
||||
get () {
|
||||
return this.$store.state.patient.selected_doctor
|
||||
},
|
||||
set (val) {
|
||||
this.$store.commit('patient/update_selected_doctor', val)
|
||||
}
|
||||
},
|
||||
filterComputedDateFormatted () {
|
||||
return this.formatDate(this.xdate)
|
||||
},
|
||||
xdate : {
|
||||
get() {
|
||||
return this.$store.state.patient.date
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("patient/update_date",val)
|
||||
}
|
||||
},
|
||||
snackbar: {
|
||||
get() {
|
||||
return this.$store.state.patient.alert_success
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("patient/update_alert_success", val)
|
||||
}
|
||||
},
|
||||
msgsnackbar() {
|
||||
return this.$store.state.patient.msg_success
|
||||
},
|
||||
dialog_error: {
|
||||
get() {
|
||||
return this.$store.state.patient.alert_error
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("patient/update_alert_error", val)
|
||||
},
|
||||
},
|
||||
msgError() {
|
||||
return this.$store.state.patient.error_message
|
||||
},
|
||||
},
|
||||
methods : {
|
||||
formatDate (date) {
|
||||
if (!date) return null
|
||||
|
||||
const [year, month, day] = date.split('-')
|
||||
return `${day}-${month}-${year}`
|
||||
},
|
||||
deFormatedDate (date) {
|
||||
if (!date) return null
|
||||
|
||||
const [ day,month, year] = date.split('-')
|
||||
return `${year}-${month.padStart(2, '0')}-${day.padStart(2, '0')}`
|
||||
},
|
||||
checkError(value) {
|
||||
var errors = this.$store.state.patient.errors
|
||||
if (errors.includes(value)) {
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
},
|
||||
resetAllInput() {
|
||||
this.xdate = ""
|
||||
this.$store.state.patient.selected_patient = ""
|
||||
this.selected_nurse = ""
|
||||
this.selected_company = ""
|
||||
this.selected_doctor = ""
|
||||
this.keluhan = ""
|
||||
this.objective = ""
|
||||
this.kesimpulan = ""
|
||||
this.saran = ""
|
||||
},
|
||||
save_clinic() {
|
||||
this.$store.commit("patient/update_errors", [])
|
||||
var errors = this.$store.state.patient.errors
|
||||
|
||||
if (_.isEmpty(this.selected_company)) {
|
||||
errors.push("requirecompany")
|
||||
}
|
||||
if (_.isEmpty(this.selected_nurse)) {
|
||||
errors.push("requirenurse")
|
||||
}
|
||||
if (_.isEmpty(this.selected_doctor)) {
|
||||
errors.push("requiredokter")
|
||||
}
|
||||
|
||||
if (errors.length === 0) {
|
||||
if (this.$store.state.patient.selected_patient.M_PatientID == "" ||
|
||||
this.$store.state.patient.selected_patient.M_PatientID == 0 ||
|
||||
this.$store.state.patient.selected_patient.M_PatientID == undefined) {
|
||||
this.$store.commit('patient/update_dialogchosee', true);
|
||||
} else {
|
||||
let prm = {
|
||||
orderDate: this.xdate,
|
||||
M_PatientID: this.$store.state.patient.selected_patient.M_PatientID,
|
||||
NurseID: this.selected_nurse.A_NurseID,
|
||||
M_CompanyID: this.selected_company.M_PatientTypeID,
|
||||
Keluhan: this.keluhan,
|
||||
Objective: this.objective,
|
||||
Kesimpulan: this.kesimpulan,
|
||||
Saran: this.saran
|
||||
}
|
||||
|
||||
// console.log(prm)
|
||||
this.$store.dispatch("patient/addclinic", prm)
|
||||
this.resetAllInput()
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
watch : {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
<template>
|
||||
<v-layout column fill-height>
|
||||
<!-- <v-flex xs12> -->
|
||||
<v-card class="pa-1 mb-2">
|
||||
<v-card-text class="pa-0">
|
||||
<v-layout row wrap>
|
||||
<v-flex xs12>
|
||||
<patient-clinic-search-box></patient-clinic-search-box>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card-text>
|
||||
|
||||
</v-card>
|
||||
<!-- </v-flex> -->
|
||||
|
||||
<!-- <v-flex xs12 grow> -->
|
||||
<v-card class="pa-1 p-left-side grow" grow>
|
||||
<v-card-text class="pa-0">
|
||||
<v-layout row wrap>
|
||||
<v-flex xs12>
|
||||
<patient-clinic-form></patient-clinic-form>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
|
||||
</v-layout>
|
||||
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
/* .p-left-side {
|
||||
min-height: 500px;
|
||||
} */
|
||||
</style>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
components : {
|
||||
'patient-clinic-search-box' : httpVueLoader('./patientClinicSearchBox.vue'),
|
||||
'patient-clinic-form': httpVueLoader('./patientClinicForm.vue'),
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
};
|
||||
},
|
||||
computed : {
|
||||
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,206 @@
|
||||
<template>
|
||||
<v-card flat>
|
||||
<v-layout row align-center >
|
||||
<v-flex xs5 pa-1>
|
||||
<v-text-field
|
||||
label="NIK"
|
||||
placeholder="Cari NIK"
|
||||
class="ma-0"
|
||||
outline
|
||||
hide-details
|
||||
v-model="search_nik"
|
||||
type="search"
|
||||
@keyup.enter="seachingPatient"
|
||||
clearable
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
<v-flex xs5 pa-1>
|
||||
<v-text-field
|
||||
label="Nama"
|
||||
placeholder="Cari Nama"
|
||||
class="ma-0"
|
||||
hide-details
|
||||
v-model="search_name"
|
||||
type="search"
|
||||
outline
|
||||
@keyup.enter="seachingPatient"
|
||||
clearable
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
<v-flex xs5 pa-1>
|
||||
<v-text-field
|
||||
label="Tanggal Lahir"
|
||||
placeholder="format : DD-MM-YYYY , contoh : 22-06-1988"
|
||||
class="ma-0"
|
||||
hide-details
|
||||
type="search"
|
||||
v-model="search_dob"
|
||||
hint="format : DD-MM-YYYY , contoh : 22-06-1988"
|
||||
outline
|
||||
@keyup.enter="seachingPatient"
|
||||
clearable
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
<v-flex xs5 pa-1>
|
||||
<v-text-field
|
||||
label="Nomor HP"
|
||||
placeholder="Cari Nomor HP"
|
||||
class="ma-0"
|
||||
hide-details
|
||||
type="search"
|
||||
outline
|
||||
v-model="search_phone"
|
||||
@keyup.enter="seachingPatient"
|
||||
clearable
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
|
||||
<patient-clinic-search-dialog></patient-clinic-search-dialog>
|
||||
</v-layout>
|
||||
<v-divider ></v-divider>
|
||||
<v-layout row >
|
||||
<v-flex xs12 pl-1>
|
||||
<p class="mb-0 mt-1 mono caption">Tekan <kbd>enter</kbd> untuk memulai pencarian </p>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card>
|
||||
</template>
|
||||
<style scoped>
|
||||
.v-btn {
|
||||
min-width: auto;
|
||||
}
|
||||
|
||||
.v-input__slot {
|
||||
margin-bottom: 0px !important;
|
||||
}
|
||||
|
||||
.v-messages {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.v-text-field--box>.v-input__control>.v-input__slot,.v-text-field--full-width>.v-input__control>.v-input__slot,.v-text-field--outline>.v-input__control>.v-input__slot {
|
||||
min-height: 25px!important;
|
||||
padding-bottom:5px;
|
||||
}
|
||||
|
||||
.v-text-field--box.v-text-field--single-line input,.v-text-field--full-width.v-text-field--single-line input,.v-text-field--outline.v-text-field--single-line input {
|
||||
margin-top: 0px;
|
||||
}
|
||||
|
||||
.one-btn-icon { font-size: 1.5em; height: 42px; }
|
||||
</style>
|
||||
<script>
|
||||
module.exports = {
|
||||
components : {
|
||||
'patient-clinic-search-dialog': httpVueLoader('./patientClinicSearchDialog.vue'),
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
showhint:false,
|
||||
};
|
||||
},
|
||||
mounted () {
|
||||
|
||||
},
|
||||
computed: {
|
||||
search_phone: {
|
||||
get() {
|
||||
return this.$store.state.patient.search_phone
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit('patient/update_search_phone',val)
|
||||
}
|
||||
},
|
||||
search_dob: {
|
||||
get() {
|
||||
return this.$store.state.patient.search_dob
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit('patient/update_search_dob',val)
|
||||
}
|
||||
},
|
||||
search_name: {
|
||||
get() {
|
||||
return this.$store.state.patient.search_name
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit('patient/update_search_name',val)
|
||||
}
|
||||
},
|
||||
search_nik: {
|
||||
get() {
|
||||
return this.$store.state.patient.search_nik
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit('patient/update_search_nik',val)
|
||||
}
|
||||
},
|
||||
noreg: {
|
||||
get() {
|
||||
return this.$store.state.patient.noreg
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit('patient/update_noreg',val)
|
||||
}
|
||||
},
|
||||
search: {
|
||||
get() {
|
||||
return this.$store.state.patient.search
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit('patient/update_search',val)
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
seachingPatient(){
|
||||
console.log('hoe')
|
||||
var search_nik = this.search_nik
|
||||
var search_name = this.search_name
|
||||
var search_dob = this.search_dob
|
||||
var search_phone = this.search_phone
|
||||
if (search_nik.length === 0 && search_name.length === 0 && search_dob.length === 0 && search_phone.length === 0) {
|
||||
this.$store.commit('update_message_error', 'Ketika hanya kehampaan, ku tak sanggup mencari ... terlalu berat, cari tau apa yang ingin kau cari')
|
||||
this.$store.commit('update_dialog_error', true)
|
||||
return
|
||||
}
|
||||
// this.$store.commit('patient/update_act', 'edit')
|
||||
this.showhint = false
|
||||
this.$store.commit('patient/update_search_dialog_is_active',true)
|
||||
var xxdata = {records:[],total:0}
|
||||
this.$store.commit('patient/update_patients',xxdata)
|
||||
|
||||
this.$store.commit('patient/update_current_page',1)
|
||||
this.$store.dispatch('patient/search')
|
||||
},
|
||||
keyup(e) {
|
||||
this.showhint = true
|
||||
console.log('keyup e', e)
|
||||
if (e.which == 13) {
|
||||
if (!window.one_token()) {
|
||||
this.$store.commit('update_message_error', 'Maaf, koneksi Anda sempat terputus silahkan Log Out dan Login kembali')
|
||||
this.$store.commit('update_dialog_error', true)
|
||||
return
|
||||
}
|
||||
var xsearch = this.$store.state.patient.search
|
||||
var xnoreg = this.$store.state.patient.noreg
|
||||
if (xsearch.length === 0 && xnoreg.length === 0) {
|
||||
this.$store.commit('update_message_error', 'Ketika hanya kehampaan, ku tak sanggup mencari ... terlalu berat, cari tau apa yang ingin kau cari')
|
||||
this.$store.commit('update_dialog_error', true)
|
||||
return
|
||||
}
|
||||
// this.$store.commit('patient/update_act', 'edit')
|
||||
this.showhint = false
|
||||
this.$store.commit('patient/update_search_dialog_is_active',true)
|
||||
var xxdata = {records:[],total:0}
|
||||
this.$store.commit('patient/update_patients',xxdata)
|
||||
|
||||
this.$store.commit('patient/update_current_page',1)
|
||||
this.$store.dispatch('patient/search')
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
<template>
|
||||
|
||||
<v-dialog
|
||||
v-model="dialog"
|
||||
width="75%"
|
||||
persistent
|
||||
>
|
||||
<v-card>
|
||||
<v-card-title
|
||||
class="teal subheading white--text pt-2 pb-2"
|
||||
primary-title
|
||||
align-center
|
||||
>
|
||||
<span class="font-weight-thin">LISTING PASIEN</span>
|
||||
</v-card-title>
|
||||
<v-card-text class="pt-2 pb-2">
|
||||
<patient-clinic-search-result></patient-clinic-search-result>
|
||||
</v-card-text>
|
||||
<v-divider></v-divider>
|
||||
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn
|
||||
color="grey"
|
||||
flat
|
||||
@click="dialog = false"
|
||||
>
|
||||
Tutup
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.one-btn-icon { font-size: 1.5em; height: 42px; }
|
||||
</style>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
components : {
|
||||
'patient-clinic-search-result': httpVueLoader('./patientClinicSearchResult.vue')
|
||||
},
|
||||
methods : {
|
||||
search: function() {
|
||||
this.$store.dispatch('patient/search')
|
||||
}
|
||||
},
|
||||
computed : {
|
||||
dialog: {
|
||||
get() {
|
||||
return this.$store.state.patient.search_dialog_is_active;
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit('patient/update_search_dialog_is_active',val);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
watch : {
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,201 @@
|
||||
<template>
|
||||
<div>
|
||||
<v-layout wrap>
|
||||
<v-flex xs12 pl-0 pr-0 pt-2 pb-2>
|
||||
<v-data-table
|
||||
:headers="headers"
|
||||
:items="patients"
|
||||
:loading="isLoading"
|
||||
hide-actions class="elevation-1">
|
||||
|
||||
|
||||
<template slot="no-data">
|
||||
<v-alert :value="isError" color="error" icon="warning">
|
||||
Data Pasien tidak di temukan
|
||||
{{errorMessage}}
|
||||
</v-alert>
|
||||
</template>
|
||||
|
||||
|
||||
<template slot="items" slot-scope="props">
|
||||
<td class="text-xs-left caption mono pt-1 pb-1 pl-2 " v-bind:class="{'teal lighten-4':props.item.divider === 'Y','amber lighten-4':props.item.selected}" @click="selectMe(props.item)">
|
||||
{{ props.item.M_PatientNoReg }}
|
||||
</td>
|
||||
<td class="text-xs-left caption mono pa-1" v-bind:class="{'teal lighten-4':props.item.divider === 'Y','amber lighten-4':props.item.selected}" @click="selectMe(props.item)">
|
||||
<p class="mb-0">{{ props.item.M_PatientName }}</p>
|
||||
<p class="mb-0">{{ props.item.M_PatientIDTypeName }} {{props.item.M_PatientIDNumber}}</p>
|
||||
</td>
|
||||
<td class="text-xs-left caption mono pa-1" v-bind:class="{'teal lighten-4':props.item.divider === 'Y','amber lighten-4':props.item.selected}" @click="selectMe(props.item)">{{ props.item.dob_ina}}</td>
|
||||
<td class="pa-1 caption mono " v-bind:class="{'teal lighten-4':props.item.divider === 'Y','amber lighten-4':props.item.selected}" @click="selectMe(props.item)">{{ props.item.M_PatientAddress }}</td>
|
||||
</template>
|
||||
|
||||
</v-data-table>
|
||||
<div class="text-xs-center pt-2">
|
||||
<v-btn :loading="loading" dark v-if="show_more" @click="showMore()" small color="teal lighten-3">
|
||||
Tampilkan lebih banyak
|
||||
<template v-slot:loader>
|
||||
sedang memuat ...
|
||||
</template>
|
||||
</v-btn>
|
||||
<v-btn depressed v-if="!show_more" small color="grey lighten-2">Tidak ada lagi data</v-btn>
|
||||
</div>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.custom-loader {
|
||||
animation: loader 1s infinite;
|
||||
display: flex;
|
||||
}
|
||||
@-moz-keyframes loader {
|
||||
from {
|
||||
transform: rotate(0);
|
||||
}
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
@-webkit-keyframes loader {
|
||||
from {
|
||||
transform: rotate(0);
|
||||
}
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
@-o-keyframes loader {
|
||||
from {
|
||||
transform: rotate(0);
|
||||
}
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
@keyframes loader {
|
||||
from {
|
||||
transform: rotate(0);
|
||||
}
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
table.v-table tbody td,table.v-table tbody th {
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
table.v-table thead tr {
|
||||
height: 40px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
methods: {
|
||||
showMore(){
|
||||
if(!this.loading){
|
||||
this.$store.commit('patient/update_loading', true)
|
||||
var xnow = this.curr_page
|
||||
this.curr_page = xnow + 1
|
||||
}
|
||||
},
|
||||
selectMe(pat) {
|
||||
this.$store.commit('patient/update_selected_patient', pat)
|
||||
|
||||
this.$store.commit('patient/update_search_dialog_is_active',false)
|
||||
|
||||
|
||||
// clear parameter search
|
||||
this.$store.commit('patient/update_search_nik', '')
|
||||
this.$store.commit('patient/update_search_name', '')
|
||||
this.$store.commit('patient/update_search_dob', '')
|
||||
this.$store.commit('patient/update_search_phone', '')
|
||||
|
||||
}
|
||||
},
|
||||
computed : {
|
||||
loading() {
|
||||
return this.$store.state.patient.loading
|
||||
},
|
||||
show_more() {
|
||||
return this.$store.state.patient.show_more
|
||||
},
|
||||
curr_page: {
|
||||
get() {
|
||||
return this.$store.state.patient.current_page
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("patient/update_current_page",val)
|
||||
this.$store.dispatch('patient/search')
|
||||
}
|
||||
},
|
||||
// xtotal_page: {
|
||||
// get() {
|
||||
// return this.$store.state.patient.total_patient
|
||||
// },
|
||||
// set(val) {
|
||||
// this.$store.commit("patient/update_total_patient",val)
|
||||
// }
|
||||
// },
|
||||
isError() {
|
||||
return this.$store.state.patient.search_status == 3
|
||||
},
|
||||
errorMessage() {
|
||||
return this.$store.state.patient.search_error_message
|
||||
},
|
||||
isLoading() {
|
||||
return this.$store.state.patient.search_status == 1
|
||||
},
|
||||
patients() {
|
||||
return this.$store.state.patient.patients
|
||||
},
|
||||
// total() {
|
||||
// return this.$store.state.patient.total_patient
|
||||
// },
|
||||
// total_display() {
|
||||
// return this.$store.state.patient.total_display
|
||||
// },
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
headers: [
|
||||
{
|
||||
text: "NO REG",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "15%",
|
||||
class: "pa-2 teal lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "NAMA",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "name",
|
||||
width: "25%",
|
||||
class: "pa-2 teal lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "TANGGAL LAHIR",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "hp",
|
||||
width: "15%",
|
||||
class: "pa-2 teal lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "ALAMAT",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "dob",
|
||||
width: "15%",
|
||||
class: "pa-2 teal lighten-3 white--text"
|
||||
}
|
||||
],
|
||||
};
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
<template>
|
||||
|
||||
<v-dialog v-model="dialogchosee" width="500">
|
||||
<v-card>
|
||||
<v-card-title
|
||||
class="headline grey lighten-2 pt-2 pb-2"
|
||||
primary-title
|
||||
>
|
||||
Peringatan!
|
||||
</v-card-title>
|
||||
<v-card-text class="pt-2 pb-2">
|
||||
<h6 class="display-1 text-center">Anda belum memilih pasien</h6>
|
||||
</v-card-text>
|
||||
<v-divider></v-divider>
|
||||
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn
|
||||
color="primary"
|
||||
flat
|
||||
@click="finish"
|
||||
>
|
||||
Tutup
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.one-btn-icon { font-size: 1.5em; height: 42px; }
|
||||
</style>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
components : {
|
||||
|
||||
},
|
||||
methods : {
|
||||
finish: function() {
|
||||
this.dialogchosee = false
|
||||
},
|
||||
},
|
||||
computed : {
|
||||
dialogchosee: {
|
||||
get() {
|
||||
return this.$store.state.patient.dialogchosee;
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit('patient/update_dialogchosee',val);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
watch : {
|
||||
}
|
||||
}
|
||||
</script>
|
||||
93
one-klinik-biotest/test/vuex/one-clinic-form/index.php
Normal file
93
one-klinik-biotest/test/vuex/one-clinic-form/index.php
Normal file
@@ -0,0 +1,93 @@
|
||||
<!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="center" fill-height pa-1>
|
||||
<one-clinic-page></one-clinic-page>
|
||||
</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>
|
||||
<!-- <script src="../../../libs/one_print_barcode.js"></script> -->
|
||||
<!-- <script src="../../../libs/one_print_robo.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-clinic-page': httpVueLoader('./components/patientClinicPage.vue')
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<style>
|
||||
[v-cloak] {
|
||||
display: none
|
||||
}
|
||||
|
||||
.left {}
|
||||
|
||||
.right {}
|
||||
</style>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
287
one-klinik-biotest/test/vuex/one-clinic-form/modules/patient.js
Normal file
287
one-klinik-biotest/test/vuex/one-clinic-form/modules/patient.js
Normal file
@@ -0,0 +1,287 @@
|
||||
// 1 => LOADING
|
||||
// 2 => DONE
|
||||
// 3 => ERROR
|
||||
import * as api from "../api/patient.js"
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
search_dialog_is_active: false,
|
||||
search_status: 0,
|
||||
search_error_message: '',
|
||||
loading: false,
|
||||
patients: [],
|
||||
total_patient: 0,
|
||||
current_page: 1,
|
||||
noreg: '',
|
||||
search: '',
|
||||
show_more: true,
|
||||
selected_patient: {},
|
||||
errors: [],
|
||||
dialogchosee: false,
|
||||
search_nik:'',
|
||||
search_name:'',
|
||||
search_dob:'',
|
||||
search_phone:'',
|
||||
company: [],
|
||||
selected_company: {},
|
||||
nurse: [],
|
||||
selected_nurse: {},
|
||||
doctor: [],
|
||||
selected_doctor: {},
|
||||
date: moment(new Date()).format("YYYY-MM-DD"),
|
||||
save_status: 2,
|
||||
loading_save: false,
|
||||
error_message: "",
|
||||
alert_error: false,
|
||||
dialog_error: false,
|
||||
msg_success: "",
|
||||
alert_success: false,
|
||||
},
|
||||
mutations: {
|
||||
update_search_phone(state, val) {
|
||||
state.search_phone = val
|
||||
},
|
||||
update_search_dob(state, val) {
|
||||
state.search_dob = val
|
||||
},
|
||||
update_search_name(state, val) {
|
||||
state.search_name = val
|
||||
},
|
||||
update_search_nik(state, val) {
|
||||
state.search_nik = val
|
||||
},
|
||||
update_search_dialog_is_active(state, val) {
|
||||
state.search_dialog_is_active = val
|
||||
},
|
||||
update_search_status(state, val) {
|
||||
state.search_status = val
|
||||
},
|
||||
update_search_error_message(state, val) {
|
||||
state.search_error_message = val
|
||||
},
|
||||
update_loading(state, val) {
|
||||
state.loading = val
|
||||
},
|
||||
update_patients(state,data) {
|
||||
state.patients = data.records
|
||||
state.total_patient = data.total
|
||||
},
|
||||
update_current_page(state, val) {
|
||||
state.current_page = val
|
||||
},
|
||||
update_noreg(state,val) {
|
||||
state.noreg = val
|
||||
},
|
||||
update_search(state,val) {
|
||||
state.search = val
|
||||
},
|
||||
update_show_more(state,status) {
|
||||
state.show_more = status
|
||||
},
|
||||
update_selected_patient(state,val) {
|
||||
var now = moment(new Date())
|
||||
var dob = moment(new Date(val.M_PatientDOB))
|
||||
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)) val.patient_age = ''
|
||||
else val.patient_age = `${year} tahun ${month} bulan ${day} hari`
|
||||
|
||||
state.selected_patient = val
|
||||
|
||||
},
|
||||
update_errors(state, val) {
|
||||
state.errors = val
|
||||
},
|
||||
update_dialogchosee(state, val) {
|
||||
state.dialogchosee = val
|
||||
},
|
||||
update_company(state, val) {
|
||||
state.company = val
|
||||
},
|
||||
update_selected_company(state, val) {
|
||||
state.selected_company = val
|
||||
},
|
||||
update_nurse(state, val) {
|
||||
state.nurse = val
|
||||
},
|
||||
update_selected_nurse(state, val) {
|
||||
state.selected_nurse = val
|
||||
},
|
||||
update_doctor(state, val) {
|
||||
state.doctor = val
|
||||
},
|
||||
update_selected_doctor(state, val) {
|
||||
state.selected_doctor = val
|
||||
},
|
||||
update_date(state, val) {
|
||||
state.date = val
|
||||
},
|
||||
update_save_status(state, val) {
|
||||
state.save_status = val
|
||||
},
|
||||
update_loading_save(state, val) {
|
||||
state.loading_save = val
|
||||
},
|
||||
update_error_message(state, val) {
|
||||
state.error_message = val
|
||||
},
|
||||
update_alert_error(state, val) {
|
||||
state.alert_error = val
|
||||
},
|
||||
update_dialog_error(state, val) {
|
||||
state.dialog_error = val
|
||||
},
|
||||
update_msg_success(state, val) {
|
||||
state.msg_success = val
|
||||
},
|
||||
update_alert_success(state, val) {
|
||||
state.alert_success = val
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
async search(context) {
|
||||
context.commit("update_search_status",1)
|
||||
try {
|
||||
//context.commit("update_loading",true)
|
||||
let resp = await api.search(context.state.search_nik,context.state.search_name,context.state.search_dob,context.state.search_phone,context.state.current_page)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_search_status",3)
|
||||
context.commit("update_search_error_message",resp.message)
|
||||
} else {
|
||||
context.commit("update_search_status",false)
|
||||
context.commit("update_search_error_message","")
|
||||
let data = {
|
||||
records : resp.data,
|
||||
total: resp.data.length
|
||||
}
|
||||
context.commit("update_loading",false)
|
||||
|
||||
if(data.records.length > 0){
|
||||
if(context.state.patients.length > 0){
|
||||
var data_before = context.state.patients
|
||||
var idx_last = data_before.length - 1
|
||||
data_before[idx_last].divider = 'Y'
|
||||
data.records.forEach(function(entry) {
|
||||
data_before.push(entry)
|
||||
})
|
||||
context.commit("update_patients",{records : data_before,total:data_before.length})
|
||||
console.log('data_before', data_before)
|
||||
}
|
||||
else{
|
||||
context.commit("update_patients",data)
|
||||
}
|
||||
context.commit("update_show_more",true)
|
||||
}
|
||||
else {
|
||||
context.commit("update_show_more",false)
|
||||
context.commit("update_current_page",1)
|
||||
}
|
||||
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_loading",false)
|
||||
context.commit("update_search_status",3)
|
||||
context.commit("update_search_error_message",e.message )
|
||||
}
|
||||
},
|
||||
|
||||
async getcompanyclinic(context) {
|
||||
context.commit("update_search_status", 1)
|
||||
try {
|
||||
let resp= await api.getcompanyclinic()
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_search_status", 3)
|
||||
context.commit("update_search_error_message",resp.message)
|
||||
} else {
|
||||
context.commit("update_search_status",2)
|
||||
context.commit("update_search_error_message","")
|
||||
let data = {
|
||||
total : resp.data.length,
|
||||
records : resp.data
|
||||
}
|
||||
context.commit("update_company", data.records)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_search_status",3)
|
||||
context.commit("update_search_error_message",e.message )
|
||||
}
|
||||
},
|
||||
|
||||
async getnurseclinic(context) {
|
||||
context.commit("update_search_status", 1)
|
||||
try {
|
||||
let resp= await api.getnurseclinic()
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_search_status", 3)
|
||||
context.commit("update_search_error_message",resp.message)
|
||||
} else {
|
||||
context.commit("update_search_status",2)
|
||||
context.commit("update_search_error_message","")
|
||||
let data = {
|
||||
total : resp.data.length,
|
||||
records : resp.data
|
||||
}
|
||||
context.commit("update_nurse", data.records)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_search_status",3)
|
||||
context.commit("update_search_error_message",e.message )
|
||||
}
|
||||
},
|
||||
|
||||
async getdoctorclinic(context) {
|
||||
context.commit("update_search_status", 1)
|
||||
try {
|
||||
let resp= await api.getdoctorclinic()
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_search_status", 3)
|
||||
context.commit("update_search_error_message",resp.message)
|
||||
} else {
|
||||
context.commit("update_search_status",2)
|
||||
context.commit("update_search_error_message","")
|
||||
let data = {
|
||||
total : resp.data.length,
|
||||
records : resp.data
|
||||
}
|
||||
context.commit("update_doctor", data.records)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_search_status",3)
|
||||
context.commit("update_search_error_message",e.message )
|
||||
}
|
||||
},
|
||||
|
||||
async addclinic(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
context.commit("update_loading_save", true)
|
||||
let resp = await api.addclinic(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_loading_save", false)
|
||||
context.commit("update_error_message", resp.message)
|
||||
context.commit("update_alert_error", true)
|
||||
context.commit("update_dialog_error", true)
|
||||
// context.commit("update_errors", resp.errors)
|
||||
} else {
|
||||
context.commit("update_save_status", 2)
|
||||
context.commit("update_loading_save", false)
|
||||
context.commit("update_error_message", "")
|
||||
context.commit("update_dialog_error", false)
|
||||
var msg = "Berhasil di simpan."
|
||||
context.commit("update_msg_success", msg)
|
||||
context.commit("update_alert_success", true)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_loading_save", false)
|
||||
context.commit("update_error_message", e.message)
|
||||
context.commit("update_alert_error", true)
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
35
one-klinik-biotest/test/vuex/one-clinic-form/store.js
Normal file
35
one-klinik-biotest/test/vuex/one-clinic-form/store.js
Normal file
@@ -0,0 +1,35 @@
|
||||
// State
|
||||
// data ...
|
||||
// Mutations
|
||||
//
|
||||
//
|
||||
// Actions
|
||||
import patient from "./modules/patient.js";
|
||||
import system from "../../../apps/modules/system/system.js";
|
||||
export const store = new Vuex.Store({
|
||||
modules: {
|
||||
patient: patient,
|
||||
system:system
|
||||
},
|
||||
state: {
|
||||
dialog_loading : false,
|
||||
dialog_error : false,
|
||||
message_error: '-'
|
||||
},
|
||||
mutations: {
|
||||
update_dialog_loading(state, v) {
|
||||
state.dialog_loading = v
|
||||
},
|
||||
|
||||
update_dialog_error(state, v) {
|
||||
state.dialog_error = v
|
||||
},
|
||||
|
||||
update_message_error(state, v) {
|
||||
state.message_error = v
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
|
||||
}
|
||||
});
|
||||
Submodule one-klinik-biotest/test/vuex/one-fo-cashier-new-payment-v22 added at 5d89efaf9e
Reference in New Issue
Block a user