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,139 @@
const URL = "/one-api/mockup/email/";
export async function search(prm) {
try {
var resp = await axios.post(URL + 'done/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 getkerajaan(prm) {
try {
var resp = await axios.post(URL + 'done/getkerajaan',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 dosend(prm) {
try {
var resp = await axios.post(URL + 'done/dosend',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 save(prm) {
try {
var resp = await axios.post(URL + 'done/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 updateemail(prm) {
try {
var resp = await axios.post(URL + 'done/updateemail',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 sendemail(prm) {
try {
var resp = await axios.post(URL + 'done/sendemail',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 checkbarcode(prm) {
try {
var resp = await axios.post(URL + 'done/checkbarcode',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,102 @@
const URL = "/one-api/mockup/email/";
export async function search(prm) {
try {
var resp = await axios.post(URL + 'patient/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 lookup_barcodes(prm) {
try {
var resp = await axios.post(URL + 'patient/lookup_barcodes',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 getstatuspergroup(prm) {
try {
var resp = await axios.post(URL + 'patient/getstatuspergroup',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 save(token, patient, status) {
try {
var resp = await axios.post(URL + 'patient/save', {
token:token,
patient: patient,
status: status
});
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 verify(prm) {
try {
var resp = await axios.post(URL + 'patient/verify', 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,524 @@
<template>
<v-layout class="fill-height" column>
<v-dialog v-model="xdialogreceiver" persistent max-width="450">
<v-card>
<v-card-title color="indigo" class="headline">Serah Terima</v-card-title>
<v-card-text>
<v-layout ma-1 row>
<v-flex xs12>
<v-select class="mini-select" :items="receivertypes"
item-text="name"
return-object
hide-details
v-model="selected_receiver_type"
label="Receiver" outline hide-details></v-select>
</v-flex>
</v-layout>
<v-layout ma-1 v-if="selected_receiver_type.id !== 'YBS'" row>
<v-flex xs12>
<v-text-field
label="Nama Penerima"
v-model="receiver.name"
hide-details
outline
></v-text-field>
</v-flex>
</v-layout>
<v-layout ma-1 v-if="selected_receiver_type.id !== 'YBS'" row>
<v-flex xs12>
<v-text-field
label="Hp Penerima"
v-model="receiver.hp"
hide-details
outline
></v-text-field>
</v-flex>
</v-layout>
<v-layout ma-1 v-if="selected_receiver_type.id !== 'YBS'" row>
<v-flex xs12>
<v-text-field
label="Info Lainnya"
v-model="receiver.info"
hide-details
outline
></v-text-field>
</v-flex>
</v-layout>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="error darken-1" flat @click="xdialogreceiver = false">Tutup</v-btn>
<v-btn color="primary darken-1" flat @click="saveReceiver()">Simpan</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<v-dialog v-model="xdialogaction" persistent max-width="350">
<v-card>
<v-card-title color="warning" class="headline">Konfirmasi</v-card-title>
<v-card-text v-html="xmsgaction">
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="primary darken-1" flat @click="closeDialogAction()">OK</v-btn>
<v-btn color="error darken-1" flat @click="xdialogaction = false">Tutup</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<v-snackbar
v-model="snackbar.value"
:timeout="snackbar.timeout"
>
{{ snackbar.text }}
<v-btn
color="blue"
text
@click="snackbar.value = false"
>
Tutup
</v-btn>
</v-snackbar>
<v-card class="mb-2 pa-2 searchbox">
<v-layout row>
<v-flex xs2 mt-1 pr-2>
<v-menu
v-model="menufilterdatestart"
: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="filterComputedDateFormattedStart"
outline
label="Janji Hasil"
hide-details
readonly
v-on="on"
@blur="date = deFormatedDate(filterComputedDateFormattedStart)"
></v-text-field>
</template>
<v-date-picker v-model="xdatestart" no-title @input="menufilterdatestart = false"></v-date-picker>
</v-menu>
</v-flex>
<v-flex xs3 mt-1 pr-2>
<v-text-field
label="Cari..."
outline
placeholder='No Reg / Nama'
v-model="nolab"
hide-details
v-on:keyup.enter="searchPatient"
></v-text-field>
</v-flex>
<!--<v-flex xs3 mt-1 pr-2>
<v-text-field
label="Nama"
outline
v-model="name"
v-on:keyup.enter="searchPatient"
hide-details
></v-text-field>
</v-flex>-->
<v-flex xs4 mt-1 pr-2>
<v-select class="mini-select" :items="statuses"
item-text="name"
return-object
v-model="selected_status"
label="Status" outline hide-details></v-select>
</v-flex>
<!--<v-btn class="xs3 ma-1" color="success" @click="searchPatient" >Search</v-btn>-->
<!--<span @click="searchPatient" class="icon-medium-fill-base white--text success iconsearch-search"></span>-->
</v-layout>
</v-card>
<v-card >
<v-layout row>
<v-flex xs12 pl-2 pr-2 pt-2 pb-2>
<v-data-table
:headers="headers"
:items="patients"
: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),'amber':props.item.iscito === 'Y'}" @click="selectMe(props.item)">{{props.item.date_promise}}</td>
<td class="pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item),'amber':props.item.iscito === 'Y'}" @click="selectMe(props.item)">{{props.item.T_OrderHeaderLabNumber}}</td>
<td class="pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item),'amber':props.item.iscito === 'Y'}" @click="selectMe(props.item)">{{props.item.patient_fullname}}</td>
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item),'amber':props.item.iscito === 'Y'}" @click="selectMe(props.item)">{{props.item.M_CompanyName}}</td>
<td class="text-xs-center pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item),'amber':props.item.iscito === 'Y'}" @click="selectMe(props.item)">
<v-btn v-if="props.item.status === 'P' && ( props.item.status_lunas === 'Y' || props.item.status_bill === 'Y')" small @click="sendEmail(props.item)" class="ma-2" tile color="indigo" dark>kirim email</v-btn>
<v-btn style="color:white" depressed v-if="props.item.status === 'P' && props.item.status_lunas === 'N' && props.item.status_bill === 'N'" small class="ma-2" tile color="grey" dark>kirim email</v-btn>
</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-alert :status="openalertverification" :msg="msgalertverification" @forget-dialog-alert="forgetAlertVerification()" @close-dialog-alert="closeAlertVerification()"></one-dialog-alert>
<one-dialog-info :status="opendialogverification" :msg="msginfoverification" @close-dialog-info="closeInfoVerification()"></one-dialog-info>
</v-layout>
</template>
<style scoped>
.searchbox .v-input.v-text-field .v-input__slot{
min-height:40px;
}
.searchbox .v-btn {
min-height:40px;
}
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("patient/search",{
startdate:this.xdatestart,
name:this.name,
nolab: this.nolab,
status: this.selected_status.id,
current_page:1,
lastid:-1
})
},
methods : {
isSelected(p) {
if(p.iscito === 'Y')
return false
else
return p.T_OrderHeaderID == this.$store.state.patient.selected_patient.T_OrderHeaderID
},
searchPatient() {
this.$store.dispatch("patient/search",{
startdate:this.xdatestart,
name:this.name,
nolab: this.nolab,
status: this.selected_status.id,
current_page:1,
lastid:-1
})
},
selectMe(pat) {
this.$store.commit("patient/update_selected_patient",pat)
var patients = this.$store.state.patient.patients
var idx = _.findIndex(patients, function(o) { return o.T_OrderHeaderID === pat.T_OrderHeaderID })
this.$store.commit("patient/update_last_id",idx)
this.$store.dispatch("patient/getstatuspergroup",pat)
},
closeInfoVerification(){
this.$store.commit("patient/update_open_dialog_verification",false)
this.searchPatient()
},
closeAlertVerification(){
this.$store.commit("patient/update_open_alert_verification",false)
},
forgetAlertVerification(){
this.$store.commit("patient/update_no_save",0)
this.$store.commit("patient/update_open_alert_verification",false)
},
verify(value,act){
this.$store.commit("patient/update_selected_patient",value)
value.act = act
this.$store.commit("patient/update_now_prm",value)
if(act === 'Y'){
var prm = this.$store.state.patient.now_prm
prm.name = this.name
prm.nolab = this.nolab
this.$store.commit("done/update_current_page",1)
prm.done_search = {
startdate:this.$store.state.done.start_date,
enddate:this.$store.state.done.end_date,
search:this.$store.state.done.search,
current_page:1,
lastid:-1
}
this.$store.dispatch("patient/verify",prm)
}
else{
var xxver = value.verifications
xxver.forEach(function(entry,index) {
if(entry.xid === '0')
xxver[index].chex = true
})
this.$store.commit("patient/update_verifications",xxver)
this.$store.commit("patient/update_dialoglist",true)
this.$store.commit("patient/update_show_simpan_tolak",false)
}
},
closeDialogAction(){
var prm = this.$store.state.patient.now_prm
this.$store.dispatch("patient/verify",prm)
},
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')}`
},
openReceive(value){
this.$store.commit("done/update_selected_patient_done",value)
this.selected_receiver_type = {id:'YBS',name:'YBS'}
this.receiver.name = this.$store.state.done.selected_patient_done.patient_fullname
this.receiver.hp = this.$store.state.done.selected_patient_done.patient_hp
this.receiver.info = ""
this.xdialogreceiver = true
},
sendEmail(trx){
var prm = trx
this.$store.dispatch("done/sendemail",prm)
}
},
computed: {
receivertypes(){
return [{id:'YBS',name:'YBS'},{id:'X',name:'Orang Lain'}]
},
xdialogreceiver: {
get() {
return this.$store.state.done.dialog_receiver
},
set(val) {
this.$store.commit("done/update_dialog_receiver",val)
//this.searchPatient()
}
},
selected_receiver_type: {
get() {
return this.$store.state.done.selected_receiver_type
},
set(val) {
this.$store.commit("done/update_selected_receiver_type",val)
if(val.id === 'YBS'){
this.receiver.name = this.$store.state.patient.selected_patient.patient_fullname
this.receiver.hp = this.$store.state.patient.selected_patient.patient_hp
this.receiver.info = ""
}
else{
this.receiver.name = ""
this.receiver.hp = ""
this.receiver.info = ""
}
}
},
receiver: {
get() {
return this.$store.state.done.receiver
},
set(val) {
this.$store.commit("done/update_receiver",val)
//this.searchPatient()
}
},
filterComputedDateFormattedStart () {
return this.formatDate(this.xdatestart)
},
statuses(){
return [{id:'P',name:'Siap diemail'},{id:'X',name:'Belum siap diemail'},{id:'S',name:'Sedang dikirim'},{id:'R',name:'Terkirim'}]
},
selected_status: {
get() {
return this.$store.state.patient.selected_status
},
set(val) {
this.$store.commit("patient/update_selected_status",val)
this.searchPatient()
}
},
snackbar: {
get() {
return this.$store.state.patient.snackbar
},
set(val) {
this.$store.commit("patient/update_snackbar",val)
}
},
name: {
get() {
return this.$store.state.patient.name
},
set(val) {
this.$store.commit("patient/update_name",val)
}
},
nolab: {
get() {
return this.$store.state.patient.nolab
},
set(val) {
this.$store.commit("patient/update_nolab",val)
}
},
isLoading() {
return this.$store.state.patient.search_status == 1
},
patients() {
return this.$store.state.patient.patients
},
opendialogverification: {
get() {
return this.$store.state.patient.open_dialog_verification
},
set(val) {
this.$store.commit("patient/update_open_dialog_verification",false)
}
},
msginfoverification(){
return this.$store.state.patient.msg_info_verification
},
openalertverification: {
get() {
return this.$store.state.patient.open_alert_verification
},
set(val) {
this.$store.commit("patient/open_alert_verification",false)
}
},
msgalertverification(){
return this.$store.state.patient.msg_alert_verification
},
xdialogaction:{
get() {
return this.$store.state.patient.dialog_action
},
set(val) {
this.$store.commit("patient/update_dialog_action",val)
}
},
xmsgaction:{
get() {
return this.$store.state.patient.msg_action
},
set(val) {
this.$store.commit("patient/update_msg_action",val)
}
},
btnsaveseen:{
get() {
return this.$store.state.patient.btn_save_seen
},
set(val) {
this.$store.commit("patient/update_btn_save_seen",val)
}
},
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",{
startdate:this.xdatestart,
name:this.name,
nolab: this.nolab,
status: this.selected_status.id,
current_page:val,
lastid:-1
})
}
},
xtotal_page: {
get() {
return this.$store.state.patient.total_patient
},
set(val) {
this.$store.commit("patient/update_total_patient",val)
}
},
xdatestart : {
get() {
return this.$store.state.patient.start_date
},
set(val) {
this.$store.commit("patient/update_start_date",val)
this.searchPatient()
}
},
},
data() {
return {
menufilterdatestart:false,
date: new Date().toISOString().substr(0, 10),
items: [],
headers: [
{
text: "JANJI HASIL",
align: "left",
sortable: false,
value: "mr",
width: "10%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "NO REG",
align: "left",
sortable: false,
value: "lab",
width: "12%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "PASIEN",
align: "left",
sortable: false,
value: "lab",
width: "15%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "KEL. PELANGGAN",
align: "left",
sortable: false,
value: "name",
width: "20%",
class: "pa-2 blue lighten-3 white--text"
},
{
text: "AKSI",
align: "center",
sortable: false,
value: "name",
width: "10%",
class: "pa-2 blue lighten-3 white--text"
}
],
};
}
}
</script>

View File

@@ -0,0 +1,631 @@
<template>
<v-layout class="fill-height" column>
<v-dialog v-model="dialogemail" persistent max-width="490">
<v-card>
<v-card-title style="color:#fff" class="headline grey darken-1">Ganti email</v-card-title>
<v-card-text>
<v-layout pa-2 class="grey lighten-2" row>
<v-flex xs12>
<v-text-field
v-model="edited_email"
label="Email"
></v-text-field>
</v-flex>
</v-layout>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="grey darken-1" flat @click="dialogemail = false">Tutup</v-btn>
<v-btn dark color="grey darken-1" @click="updateEmail">Simpan</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<v-dialog v-model="dialogbarcode" persistent max-width="490">
<v-card>
<v-card-title style="color:#fff" class="headline grey darken-1">Cetak Barcode</v-card-title>
<v-card-text>
<v-layout pa-2 class="grey lighten-2" row>
</v-layout>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="grey darken-1" flat @click="dialogbarcode = false">Tutup</v-btn>
<v-btn dark color="grey darken-1" @click="printMultipleBarcode">Cetak terpilih [ {{selected_barcode.length}} ]</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<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-dialog v-model="dialogemail" persistent max-width="490">
<v-card>
<v-card-title style="color:#fff" class="headline grey darken-1">ganti email</v-card-title>
<v-card-text>
<v-layout pa-2 class="grey lighten-2" row>
<v-flex xs12>
<v-text-field
v-model="edited_email"
label="Email"
></v-text-field>
</v-flex>
</v-layout>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="grey darken-1" flat @click="dialogemail = false">Tutup</v-btn>
<v-btn dark color="grey darken-1" @click="updateEmail">Simpan</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<v-card class="mb-2 pa-2">
<v-layout mb-2 align-center row >
<v-flex class="mx-auto" xs3 pr-2>
<v-img
v-if="!selected_patient"
aspect-ratio="1"
class="grey lighten-2"
>
</v-img>
<v-img
v-if="selected_patient"
:src="selected_patient.photo"
aspect-ratio="1"
class="grey lighten-2"
>
<template v-slot:placeholder>
<v-layout row
class="fill-height ma-0"
align="center"
justify="center"
>
</v-layout>
</template>
</v-img>
</v-flex>
</v-layout>
<v-layout row>
<v-flex class="mx-auto text-xs-center" d-flex>
<h3 v-if="!selected_patient" style="text-decoration:underline" class="body-2">NOT FOUND</h3>
<h3 v-if="selected_patient" style="text-decoration:underline" class="body-2">{{selected_patient.T_OrderHeaderLabNumber}}</h3>
</v-flex>
</v-layout>
<v-layout mb-2 row>
<v-flex class="mx-auto text-xs-center" d-flex>
<h3 v-if="!selected_patient" class="subtitle-2">NOT FOUND</h3>
<h3 v-if="selected_patient" class="subtitle-2">{{selected_patient.patient_fullname}}</h3>
</v-flex>
</v-layout>
<v-divider></v-divider>
<v-layout pa-2 row>
<h3 class="body-2">PENGIRIMAN HASIL</h3>
</v-layout>
<v-divider></v-divider>
<v-layout mb-2 wrap>
<v-flex class="xs12 pt-2">
<v-chip v-if="info_deliveries " v-for="delivery in info_deliveries"
class="ma-1"
label
>
{{delivery.label}}
<span class="mono" v-if="delivery.code !== 'PICKUP' && delivery.code !== 'EMAIL'"> [{{delivery.destination}}]</span>
<span style="cursor:pointer" @click="changeEmail(delivery)" title="ganti email" class="mono" v-if="delivery.code !== 'PICKUP' && delivery.code === 'EMAIL'"> [{{delivery.destination}}]</span>
</v-chip>
</v-flex>
</v-layout>
<v-divider></v-divider>
<v-layout pa-2 row>
<h3 class="body-2">INFO TAGIHAN</h3>
</v-layout>
<v-divider></v-divider>
<v-layout mt-1 mb-1 row>
<v-flex class="xs5 pl-2">
<h3 class="subtitle-1">TOTAL TAGIHAN</h3>
</v-flex>
<v-flex style="font-size:20px;font-weight:bold" class="mono xs7 pr-3 text-xs-right">
<span v-if="info_bill">Rp {{convertMoney(info_bill.total_bill)}}</span>
<span v-if="!info_bill">Rp -</span>
</v-flex>
</v-layout>
<v-layout mb-1 row>
<v-flex class="xs5 pl-2">
<h3 class="body-1">TOTAL BAYAR</h3>
</v-flex>
<v-flex style="font-size:20px;font-weight:bold" class="mono xs7 pr-3 text-xs-right">
<span v-if="info_bill">Rp {{convertMoney(info_bill.paid)}}</span>
<span v-if="!info_bill">Rp -</span>
</v-flex>
</v-layout>
<v-layout v-if="info_bill && info_bill.status !== 'Y'" mb-2 row>
<v-flex class="xs5 pl-2">
<h3 class="body-2">KURANG BAYAR</h3>
</v-flex>
<v-flex style="font-size:20px;font-weight:bold;color:red" class="mono xs7 pr-3 text-xs-right">
<span v-if="info_bill && info_bill.status !== 'Y'">Rp {{convertMoney(info_bill.unpaid)}}</span>
<span v-if="!info_bill">Rp -</span>
</v-flex>
</v-layout>
<v-layout mb-2 row>
<v-flex xs12 class="ma-2">
<v-btn @click="goToCashier()" color="error" v-if="info_bill && info_bill.status !== 'Y'" block outline>BELUM LUNAS</v-btn>
<v-btn color="success" v-if="info_bill && info_bill.status === 'Y'" block >LUNAS</v-btn>
</v-flex>
</v-layout>
<v-divider></v-divider>
<v-layout pa-2 row>
<h3 class="body-2">INFO PEMERIKSAAN</h3>
</v-layout>
<v-divider></v-divider>
<div v-if="info_test" v-for="test in info_test">
<v-layout mt-1 mb-1 row>
<v-flex class="xs12 pl-2">
<h3 style="text-weight:bold" dark color="success" class="mono body-2">{{test.DocumentationGroupName}}</h3>
</v-flex>
</v-layout>
<v-layout mb-2 wrap>
<v-flex class="xs12">
<v-chip v-for="detail in test.details"
class="ma-1"
label
v-if="detail.status !== 'X'"
color="success"
dark
>
{{detail.testname}}
</v-chip>
<v-chip v-for="detail in test.details"
class="ma-1"
label
v-if="detail.status === 'X'"
color="grey"
dark
>
{{detail.testname}}
</v-chip>
</v-flex>
</v-layout>
</div>
</v-card>
<one-dialog-alert :status="openalertconfirmation" :msg="msgalertconfirmation" @forget-dialog-alert="forgetAlertConfirmation()" @close-dialog-alert="closeAlertConfirmation()"></one-dialog-alert>
<one-dialog-info :status="opendialoginfo" :msg="msginfo" @close-dialog-info="closeDialogInfo()"></one-dialog-info>
</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("form/getalmaries")
this.$store.dispatch("done/getkerajaan",{
nolab: this.nolab,
groupid:this.selected_filter_kerajaan.id
})
},
methods : {
changeEmail(value){
this.selected_email = value
this.edited_email = value.destination
this.dialogemail = true
},
convertMoney(money){
return one_money(money)
},
changeCbxAll(value){
var arr = this.xtransactions
this.indeterminatex = false
this.btn_hide = true
arr.forEach((el)=>{el.chex = value})
var selected = _.filter(arr, function(o) { return o.chex; })
this.$store.commit("done/update_selected_transaction",selected)
if(selected.length > 0)
this.btn_hide = false
},
printSingleBarcode(value){
var label = value.T_BarcodeLabBarcode
if(value.type === 'barcode')
one_print_barcode_pk(label)
else
one_print_barcode_formulir(value.id)
},
printMultipleBarcode(){
var arr = this.barcodes
var xarrtojoin = []
var xformulir = {}
_.forEach(arr, function(value) {
//console.log(value)
if(value.chex && value.type === 'barcode'){
xarrtojoin.push(value.T_BarcodeLabBarcode)
}
if(value.chex && value.type === 'formulir'){
xformulir = value
}
})
if(xarrtojoin.length > 0 ){
one_print_barcode_pk(xarrtojoin.join(','))
}
if(!_.isEmpty(xformulir)){
//console.log("oeoeooeoe")
one_print_barcode_formulir(xformulir.id)
}
},
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')}`
},
isSelected(p) {
return p.ohid == this.$store.state.done.selected_transaction.ohid
},
searchTransaction() {
this.$store.dispatch("done/search",{
nolab: this.nolab,
groupid:this.selected_filter_kerajaan.id
})
},
selectMe(trx) {
},
closeAlertConfirmation(){
this.$store.commit("done/update_open_alert_confirmation",false)
},
forgetAlertConfirmation(){
this.$store.commit("done/update_no_save",0)
this.$store.commit("done/update_open_alert_confirmation",false)
},
updateAlert_success(val){
this.$store.commit("done/update_alert_success",val)
},
setNewTransaction(){
this.$store.commit("done/update_selected_transaction",{})
this.$store.commit("done/update_act",'new')
},
closeDialogSuccess(){
let arrtrx = this.$store.state.done.transactions
var idx = _.findIndex(arrtrx, item => item.T_SampleStorageID === this.$store.state.done.last_id)
console.log(idx)
this.$store.dispatch("done/search",{
startdate:this.xdatestart,
enddate: this.xdateend,
search:this.search,
current_page:1,
lastid: idx
})
this.$store.commit("done/update_dialog_success",false)
},
closeDialogInfo(){
this.$store.commit("done/update_open_dialog_info",false)
},
openbarcodeprint(value){
this.bar_chx_all = false
this.indeterminatex = false
this.dialogbarcode = true
this.selected_barcode = []
this.$store.dispatch("patient/lookup_barcodes",value)
},
checkTop(){
this.btn_hide = true
var barcodes = this.xtransactions
var selected = _.filter(barcodes, function(o) { return o.chex; })
this.bar_chx_all = false
this.indeterminatex = false
if(selected.length > 0 && barcodes.length === selected.length){
this.bar_chx_all = true
this.indeterminatex = false
this.btn_hide = false
}
if(selected.length > 0 && barcodes.length > selected.length){
this.bar_chx_all = false
this.indeterminatex = true
this.btn_hide = false
}
this.$store.commit("done/update_selected_transaction",selected)
},
doSend(){
//console.log("closedialogaction")
this.btn_hide = true
var barcodes = this.xtransactions
var selected = _.filter(barcodes, function(o) { return o.chex; })
if(selected.length > 0){
this.$store.dispatch("done/dosend",{
name:this.name,
nolab:this.nolab,
selected:selected
})
}
},
updateEmail(){
//console.log("closedialogaction")
var prm = this.selected_email
prm.edited_email = this.edited_email
this.$store.dispatch("done/updateemail",prm)
},
goToCashier(){
console.log(location)
var xdate = this.selected_patient.T_OrderHeaderDate
var noreg = this.selected_patient.T_OrderHeaderLabNumber
var type = 'email'
// location.replace("/one-ui/test/vuex/one-fo-cashier-new-payment/" + "?id=" +noreg+"&xdate="+xdate+"&type="+fo)
}
},
computed: {
dialogemail: {
get() {
return this.$store.state.done.dialog_email
},
set(val) {
this.$store.commit("done/update_dialog_email",val)
}
},
edited_email: {
get() {
return this.$store.state.done.edited_email
},
set(val) {
this.$store.commit("done/update_edited_email",val)
}
},
selected_patient(){
return this.$store.state.patient.selected_patient
},
info_deliveries(){
return this.$store.state.done.info_deliveries
},
info_test(){
return this.$store.state.done.info_test
},
info_bill(){
return this.$store.state.done.info_bill
},
filter_kerajaan: {
get() {
return this.$store.state.done.filter_kerajaan
},
set(val) {
this.$store.commit("done/update_filter_kerajaan",val)
}
},
selected_filter_kerajaan: {
get() {
return this.$store.state.done.selected_filter_kerajaan
},
set(val) {
this.$store.commit("done/update_selected_filter_kerajaan",val)
this.searchTransaction()
}
},
btn_hide: {
get() {
return this.$store.state.done.btn_hide
},
set(val) {
this.$store.commit("done/update_btn_hide",val)
}
},
name: {
get() {
return this.$store.state.done.name
},
set(val) {
this.$store.commit("done/update_name",val)
}
},
nolab: {
get() {
return this.$store.state.done.nolab
},
set(val) {
this.$store.commit("done/update_nolab",val)
}
},
dialogsuccess: {
get() {
return this.$store.state.done.dialog_success
},
set(val) {
this.$store.commit("done/update_dialog_success",val)
}
},
msgsuccess(){
return this.$store.state.done.msg_success
},
snackbar: {
get() {
return this.$store.state.done.alert_success
},
set(val) {
this.$store.commit("done/update_alert_success",val)
}
},
barcodes: {
get() {
return this.$store.state.patient.barcodes
},
set(val) {
this.$store.commit("done/update_patient_barcodes",val)
}
},
isLoading() {
return this.$store.state.done.search_status == 1
},
xdatestart : {
get() {
return this.$store.state.done.start_date
},
set(val) {
this.$store.commit("done/update_start_date",val)
this.searchTransaction()
}
},
xdateend : {
get() {
return this.$store.state.done.end_date
},
set(val) {
this.$store.commit("done/update_end_date",val)
this.searchTransaction()
}
},
filterComputedDateFormattedStart () {
return this.formatDate(this.xdatestart)
},
filterComputedDateFormattedEnd () {
return this.formatDate(this.xdateend)
},
xtransactions() {
console.log(this.$store.state.done.transactions)
return this.$store.state.done.transactions
},
openalertconfirmation: {
get() {
return this.$store.state.done.open_alert_confirmation
},
set(val) {
this.$store.commit("done/update_open_alert_confirmation",val)
}
},
opendialoginfo: {
get() {
return this.$store.state.done.open_dialog_info
},
set(val) {
this.$store.commit("done/update_open_dialog_info",false)
}
},
msginfo(){
return this.$store.state.done.msg_info
},
curr_page: {
get() {
return this.$store.state.done.current_page
},
set(val) {
this.$store.commit("done/update_current_page",val)
this.$store.dispatch("done/search",{
startdate:this.xdatestart,
enddate: this.xdateend,
current_page:val,
lastid:-1
})
}
},
xtotal_page: {
get() {
return this.$store.state.done.total_page
},
set(val) {
this.$store.commit("done/update_total_page",val)
}
},
bar_chx_all: {
get() {
return this.$store.state.done.bar_chx_all
},
set(val) {
this.$store.commit("done/update_bar_chx_all",val)
}
},
},
data() {
return {
msgalertconfirmation:"Perubahan yang telah dilakukan belum disimpan dong !",
menufilterdatestart:false,
menufilterdateend:false,
dialogbarcode:false,
date: new Date().toISOString().substr(0, 10),
items: [],
page:1,
indeterminatex:false,
checkednotall:false,
selected_email:'',
//bar_chx_all:false,
selected_barcode:[],
headers: [
{
text: "NO REG",
align: "left",
sortable: false,
value: "lab",
width: "25%",
class: "pa-2 blue-grey text-xs-left white--text"
},
{
text: "NAMA",
align: "left",
sortable: false,
value: "name",
width: "35%",
class: "pa-2 blue-grey text-xs-left white--text"
},
{
text: "PEMERIKSAAN",
align: "center",
sortable: false,
value: "status",
width: "30%",
class: "pa-2 blue-grey text-xs-left white--text"
}
],
pagination:{
descending: false,
page: 1,
rowsPerPage: 5,
sortBy: 'T_SampleStorageDate',
totalItems: this.$store.state.done.total_transactions
}
};
}
}
</script>

View File

@@ -0,0 +1,183 @@
<template>
<v-layout fil-height column>
<v-dialog v-model="dialogvalidation" persistent width="300">
<v-card>
<v-card-title class="headline">Peringatan !</v-card-title>
<v-card-text>
<v-alert v-for="item in msgdialogvalidation"
:value="true"
type="error"
>
{{item}} [ Belum ada alasan ]
</v-alert>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="green darken-1" flat @click="dialogvalidation = false">OK</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<v-dialog v-model="dialoglist" persistent width="350">
<v-card>
<v-card-title style="font-size: 18px;padding-left: 12px;padding-top: 8px">Pilih data yang belum sesuai</v-card-title>
<v-card-text>
<v-layout wrap>
<v-flex xs12 pa-2 v-for="(vp,idx) in vdoctor" :key="vp.id">
<v-layout pl-2 row>
<v-flex x12>
<v-layout row>
<v-flex pt-1 xs2>
<span @click="changeCheck(vp.chex,idx)" v-if="vp.chex === true" style="background: rgb(252, 252, 252);border: 2px solid #767575;" class="icon-medium-fill-base-small white--text"></span>
<span @click="changeCheck(vp.chex,idx)" v-if="vp.chex === false" style="background:#9e9e9e7a" class="icon-medium-fill-base-small white--text red"><v-icon dark>close</v-icon></span>
</v-flex>
<v-flex xs12>
<v-text-field
:label="vp.label"
hide-details
placeholder="Isikan alasan di sini"
v-model="vp.note"
outline
></v-text-field>
</v-flex>
</v-layout>
</v-flex>
</v-layout>
</v-flex>
</v-layout>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="black" flat @click="dialoglist = false">Tutup</v-btn>
<v-btn v-if="seen_button && show_simpan_tolak" color="primary darken-1" flat @click="tolak()">Simpan</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</v-layout>
</template>
<style scoped>
</style>
<script>
module.exports = {
components : {
'one-field-verification' : httpVueLoader('../../common/oneFieldVerification.1.vue'),
'one-testing-component':httpVueLoader('../../common/oneTestingComponent.vue'),
'one-field-verification-patient-doctor':httpVueLoader('../../common/oneFieldVerificationPatientDoctor.vue')
},
data () {
return {
dialogvalidation: false,
msgdialogvalidation:[]
}
},
computed: {
patient_age() {
if ( this.patient == undefined) {
return ''
}
return window.calculate_age(this.patient.M_PatientDOB)
},
xshow() {
return this.$store.state.patient.show_right
},
patient() {
return this.$store.state.patient.selected_patient
},
vpatient() {
return this.$store.state.verification.verification_patient
},
vdoctor() {
return this.$store.state.patient.verifications
},
status(){
return this.$store.state.status.selected_status
},
seen_button: {
get() {
return this.$store.state.patient.btn_save_seen
},
set(val) {
this.$store.commit("patient/update_btn_save_seen",val)
}
},
dialoglist: {
get() {
return this.$store.state.patient.dialoglist
},
set(val) {
this.$store.commit("patient/update_dialoglist",val)
}
},
show_simpan_tolak: {
get() {
return this.$store.state.patient.show_simpan_tolak
},
set(val) {
this.$store.commit("patient/update_show_simpan_tolak",val)
}
},
},
methods : {
changeCheck(val,idx){
this.show_simpan_tolak = false
var xxx = this.$store.state.patient.verifications
var xnew = val === true ?false:true
xxx[idx].chex = xnew
this.$store.commit("patient/update_verifications",xxx)
var xtolak = _.filter(xxx, function(o) { return !o.chex })
if(xtolak.length > 0)
this.show_simpan_tolak = true
},
updateDataTxtParentDoctor(idx, val) {
var verifications = this.$store.state.patient.verifications
verifications[idx].note = val
this.$store.commit("patient/update_verifications",verifications)
var xcount = this.$store.state.patient.no_save + 1
this.$store.commit("patient/update_no_save",xcount)
},
updateDataCbxParentDoctor(idx, val) {
var verifications = this.$store.state.patient.verifications
verifications[idx].chex = val
this.$store.commit("patient/update_verifications",verifications)
var xcount = this.$store.state.patient.no_save + 1
this.$store.commit("patient/update_no_save",xcount)
},
tolak(){
var xerrors = []
var allArr = this.$store.state.patient.selected_patient
allArr.verifications.forEach(function(value) {
if(value.chex === false && value.note === "")
xerrors.push(value.label);
});
if(xerrors.length === 0){
var prm = this.$store.state.patient.selected_patient
prm.act = 'N'
prm.name = this.$store.state.patient.name
prm.nolab = this.$store.state.patient.nolab
this.$store.commit("done/update_current_page",1)
prm.done_search = {
startdate:this.$store.state.done.start_date,
enddate:this.$store.state.done.end_date,
search:this.$store.state.done.search,
current_page:1,
lastid:-1
}
this.$store.dispatch("patient/verify",prm)
}
else{
var msg = ""
xerrors.forEach(function(value) {
msg += '<v-alert :value="true" type="error">'+value+'</v-alert>'
});
this.msgdialogvalidation = xerrors
this.dialogvalidation = true
}
},
}
}
</script>

View File

@@ -0,0 +1,122 @@
<!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 xs9 class="left" fill-height pa-1>
<one-fo-verification-list></one-fo-verification-list>
</v-flex>
<v-flex xs3 class="right" fill-height pa-1>
<!-- komponen kanan -->
<!--<one-fo-verification-simple-right></one-fo-verification-simple-right>-->
<one-fo-verification-list-right></one-fo-verification-list-right>
</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/vendor/socket.io.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 ?>';
var socketIoUrl = "http://" + window.location.host + ":9090/";
//for testing
window.store = store;
new Vue({
store,
el: '#app',
methods: {
tab_selected : function(tab) {
return this.$store.state.tab_selected == tab
}
},
data : {
socket : io.connect(socketIoUrl,{forceNew:false})
},
mounted() {
let self = this;
/*this.socket.on("notification", function(msg) {
switch(msg.type) {
case "fo-register" :
//search patient
let name = self.$store.state.patient.name
let nolab= self.$store.state.patient.nolab
store.dispatch("patient/search",{
name : name,
nolab : nolab
})
break;
}
});*/
},
components: {
'one-navbar': httpVueLoader('../../../apps/components/oneNavbarComponent.vue'),
'one-footer': httpVueLoader('../../../apps/components/oneFooter.vue'),
'one-fo-verification-list': httpVueLoader('./components/oneFoVerificationList.vue'),
'one-fo-verification-simple-right' : httpVueLoader('./components/oneFoVerificationSimpleRight.vue'),
'one-fo-verification-list-right' : httpVueLoader('./components/oneFoVerificationRightList.vue'),
}
})
</script>
<style>
[v-cloak] {
display: none
}
.left {
}
.right {
}
</style>
</body>
</html>

View File

@@ -0,0 +1,340 @@
// 1 => LOADING
// 2 => DONE
// 3 => ERROR
import * as api from "../api/done.js"
export default {
namespaced: true,
state: {
last_id:-1,
last_saved_id:-1,
x_addr_id:0,
act:'new',
act_addr:'new',
get_data_status:0,
search_trx: 0,
search_status: 0,
search_error_message: '',
start_date:moment(new Date()).format('YYYY-MM-DD'),
end_date:moment(new Date()).format('YYYY-MM-DD'),
total_transaction: 0,
transactions:[],
selected_transaction: [],
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: "",
autocomplete_status:0,
dialog_form_address: false,
errors:[],
open_dialog_info:false,
msg_info:'',
current_page:1,
total_page:1,
total_transactions:0,
search:'',
name:'',
nolab:'',
btn_hide:true,
bar_chx_all:false,
filter_kerajaan:[],
selected_filter_kerajaan:{},
info_deliveries:[],
info_test:[],
info_bill:[],
selected_patient_done:{},
receiver:{name:'',hp:'',info:''},
dialog_receiver:false,
selected_receiver_type:{id:'YBS',name:'YBS'},
dialog_email:false,
edited_email:''
},
mutations: {
update_dialog_email(state, val) {
state.dialog_email = val
},
update_edited_email(state, val) {
state.edited_email = val
},
update_selected_patient_done(state, val) {
state.selected_patient_done = val
},
update_selected_receiver_type(state, val) {
state.selected_receiver_type = val
},
update_dialog_receiver(state, val) {
state.dialog_receiver = val
},
update_receiver(state, val) {
state.receiver = val
},
update_info_deliveries(state, val) {
state.info_deliveries = val
},
update_info_test(state, val) {
state.info_test = val
},
update_info_bill(state, val) {
state.info_bill = val
},
update_filter_kerajaan(state, val) {
state.filter_kerajaan = val
},
update_selected_filter_kerajaan(state, val) {
state.selected_filter_kerajaan = val
},
update_bar_chx_all(state, val) {
state.bar_chx_all = val
},
update_btn_hide(state, val) {
state.btn_hide = val
},
update_nolab(state, val) {
state.nolab = val
},
update_name(state, val) {
state.name = val
},
update_search(state, val) {
state.search = val
},
update_total_page(state, val) {
state.total_page = val
},
update_current_page(state, val) {
state.current_page = 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_start_date(state, val) {
state.start_date = val
},
update_end_date(state, val) {
state.end_date = 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_transaction(state, val) {
state.search_transaction = val
},
update_transactions(state, data) {
state.transactions = data
},
update_selected_transaction(state, val) {
state.selected_transaction = 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_search_status(state, val) {
state.search_status = val
},
update_errors(state, val) {
state.errors = val
},
update_total_transactions(state, val) {
state.total_transactions = val
},
update_open_dialog_info(state, val) {
state.open_dialog_info = val
},
update_msg_info(state, val) {
state.msg_info = val
},
},
actions: {
async search(context, prm) {
context.commit("update_search_transaction", 1)
try {
prm.token = one_token()
let resp = await api.search(prm)
if (resp.status != "OK") {
context.commit("update_search_transaction", 3)
context.commit("update_search_error_message", resp.message)
} else {
context.commit("update_search_transaction", 2)
context.commit("update_search_error_message", "")
let data = {
records: resp.data.records,
total: resp.data.total
}
context.commit("update_transactions", data.records)
context.commit("update_total_transactions", data.total)
context.commit("update_total_page", data.total)
context.commit("update_bar_chx_all", false)
context.commit("update_btn_hide", true)
/*if(prm.lastid === -1){
context.commit("update_selected_transaction", data.records[0])
var doc = data.records[0]
}
else{
context.commit("update_selected_transaction", data.records[prm.lastid])
var doc = data.records[prm.lastid]
}*/
}
} catch (e) {
context.commit("update_search_transaction", 3)
context.commit("update_search_error_message", e.message)
console.log(e)
}
},
async getkerajaan(context,prm) {
context.commit("update_save_status",1)
try {
prm.token = one_token()
let resp= await api.getkerajaan(prm)
if (resp.status != "OK") {
context.commit("update_save_status",3)
} else {
context.commit("update_save_status",2)
let data = {
records : resp.data.records
}
context.commit("update_filter_kerajaan",data.records)
context.commit("update_selected_filter_kerajaan",data.records[0])
context.dispatch("search",{nolab:prm.nolab,groupid:context.state.selected_filter_kerajaan.id})
}
} catch(e) {
context.commit("update_save_status",3)
console.log(e)
}
},
async dosend(context,prm) {
context.commit("update_save_status",1)
try {
prm.token = one_token()
let resp= await api.dosend(prm)
if (resp.status != "OK") {
context.commit("update_save_status",3)
} else {
context.commit("update_save_status",2)
let data = {
records : resp.data.records
}
context.dispatch("search",{nolab:prm.nolab,groupid:context.state.selected_filter_kerajaan.id})
}
} catch(e) {
context.commit("update_save_status",3)
console.log(e)
}
},
async updateemail(context,prm) {
context.commit("update_save_status",1)
try {
prm.token = one_token()
let resp= await api.updateemail(prm)
if (resp.status != "OK") {
context.commit("update_save_status",3)
} else {
context.commit("update_save_status",2)
let data = {
records : resp.data.records
}
context.commit("update_dialog_email",false)
context.dispatch("patient/search",{
startdate:context.rootState.patient.start_date,
name:'',
nolab: context.rootState.patient.nolab,
status: context.rootState.patient.selected_status.id,
current_page:1,
lastid:context.rootState.patient.last_id
},{root:true})
}
} catch(e) {
context.commit("update_save_status",3)
console.log(e)
}
},
async sendemail(context,prm) {
context.commit("update_save_status",1)
try {
prm.token = one_token()
let resp= await api.sendemail(prm)
if (resp.status != "OK") {
context.commit("update_save_status",3)
} else {
context.commit("update_save_status",2)
let data = {
records : resp.data.records
}
context.commit("update_dialog_receiver",false)
context.commit("update_info_deliveries",[])
context.commit("update_info_bill",[])
context.commit("update_info_test",[])
context.dispatch("patient/search",{
startdate:context.rootState.patient.start_date,
name:'',
nolab: context.rootState.patient.nolab,
status: context.rootState.patient.selected_status.id,
current_page:1,
lastid:-1
},{root:true})
}
} catch(e) {
context.commit("update_save_status",3)
console.log(e)
}
},
}
}

View File

@@ -0,0 +1,290 @@
// 1 => LOADING
// 2 => DONE
// 3 => ERROR
import * as api from "../api/patient.js"
export default {
namespaced: true,
state: {
last_id:-1,
search_patient: 0,
search_error_message: '',
patients: [],
patient_address: [],
doctor_address: [],
total_patient: 0,
selected_patient: {},
now_prm:{},
save_status: 0,
btn_save_seen: true,
pgrs_save: false,
save_error_message: '',
open_dialog_verification: false,
msg_info_verification: "",
no_save: 0,
open_alert_verification: false,
msg_alert_verification: "Yakin, belum disimpan lhoooo ?",
msg_action:'',
dialog_action:false,
show_right:'N',
verifications:[],
snackbar:{value:false,timeout:4000,text:''},
name:'',
nolab:'',
disabled_button:false,
dialoglist:false,
lookup:0,
barcodes:[],
show_simpan_tolak:false,
selected_status:{id:'P',name:'Siap diemail'},
current_page:1,
start_date:moment(new Date()).format('YYYY-MM-DD')
},
mutations: {
update_last_id(state, data) {
state.last_id = data
},
update_start_date(state, data) {
state.start_date = data
},
update_current_page(state, data) {
state.current_page = data
},
update_selected_status(state, data) {
state.selected_status = data
},
update_show_simpan_tolak(state, data) {
state.show_simpan_tolak = data
},
update_barcodes(state, data) {
state.barcodes = data
},
update_lookup(state, data) {
state.lookup = data
},
update_dialoglist(state, data) {
state.dialoglist = data
},
update_disabled_button(state, data) {
state.disabled_button = data
},
update_name(state, val) {
state.name = val
},
update_nolab(state, val) {
state.nolab = val
},
update_snackbar(state, patient) {
state.snackbar = patient
},
update_now_prm(state, patient) {
state.now_prm = patient
},
update_search_error_message(state, patient) {
state.search_error_message = patient
},
update_search_patient(state, patient) {
state.search_patient = patient
},
update_patients(state, data) {
state.patients = data.records
state.total_patient = data.total
},
update_selected_patient(state, val) {
state.selected_patient = 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_dialog_action(state, val) {
state.dialog_action = val },
update_msg_action(state, val) {
state.msg_action = val
},
update_save_error_message(state, msg) {
state.save_error_message = ''
},
update_open_dialog_verification(state, val) {
state.open_dialog_verification = val
},
update_msg_info_verification(state, val) {
state.msg_info_verification = val
},
update_no_save(state, val) {
state.no_save = val
},
update_open_alert_verification(state, val) {
state.open_alert_verification = val
},
update_msg_alert_verification(state, val) {
state.msg_alert_verification = val
},
update_show_right(state, patient) {
state.show_right = patient
},
update_verifications(state, value) {
state.verifications = value
},
},
actions: {
async search(context, prm) {
context.commit("update_search_patient", 1)
try {
prm.token = one_token()
let resp = await api.search(prm)
if (resp.status != "OK") {
context.commit("update_search_patient", 3)
context.commit("update_search_error_message", resp.message)
} else {
context.commit("update_search_patient", 2)
context.commit("update_search_error_message", "")
let data = {
records: resp.data.records,
total: resp.data.total
}
context.commit("update_patients", data)
//context.commit("update_total_patient", data.total)
if(prm.lastid == -1){
context.commit("update_selected_patient", data.records[0])
var pat = data.records[0]
context.dispatch("getstatuspergroup",pat)
}
else{
context.commit("update_selected_patient", data.records[prm.lastid])
var pat = data.records[prm.lastid]
context.dispatch("getstatuspergroup",pat)
}
}
} catch (e) {
context.commit("update_search_patient", 3)
context.commit("update_search_error_message", e.message)
console.log(e)
}
},
async lookup_barcodes(context,prm) {
context.commit("update_lookup",1)
try {
prm.token = one_token()
let resp= await api.lookup_barcodes(prm)
if (resp.status != "OK") {
context.commit("update_lookup",3)
} else {
context.commit("update_lookup",2)
let data = {
records : resp.data.records
}
context.commit("update_barcodes",data.records)
}
} catch(e) {
context.commit("update_lookup",3)
console.log(e)
}
},
async getstatuspergroup(context,prm) {
context.commit("update_lookup",1)
try {
prm.token = one_token()
let resp= await api.getstatuspergroup(prm)
if (resp.status != "OK") {
context.commit("update_lookup",3)
} else {
context.commit("update_lookup",2)
let data = {
records : resp.data.records
}
context.commit("done/update_info_bill",data.records['info_bill'],{root:true})
context.commit("done/update_info_deliveries",data.records['info_deliveries'],{root:true})
context.commit("done/update_info_test",data.records['info_test'],{root:true})
}
} catch(e) {
context.commit("update_lookup",3)
console.log(e)
}
},
async save(context, prm) {
context.commit("update_save_status", 1)
context.commit("update_btn_save_seen", false)
context.commit("update_pgrs_save", true)
try {
let resp = await api.save(one_token(),prm.patient, prm.status)
if (resp.status != "OK") {
context.commit("update_save_status", 3)
context.commit("update_save_error_message", resp.message)
} else {
context.commit("update_save_status", 2)
context.commit("update_save_error_message", resp.message)
context.commit("update_no_save", 0)
context.commit("update_btn_save_seen", true)
context.commit("update_pgrs_save", false)
let data = {
records: resp.data.records,
total: resp.data.total
}
let msg = data.records.message
context.commit("update_msg_info_verification", msg)
context.commit("update_open_dialog_verification", true)
}
} catch (e) {
context.commit("update_save_status", 3)
context.commit("update_save_error_message", e.message)
console.log(e)
}
},
async verify(context, prm) {
context.commit("update_save_status", 1)
context.commit("update_btn_save_seen", false)
context.commit("update_pgrs_save", true)
try {
prm.token = one_token()
let resp = await api.verify(prm)
if (resp.status != "OK") {
context.commit("update_save_status", 3)
context.commit("update_btn_save_seen", true)
context.commit("update_save_error_message", resp.message)
} else {
context.commit("update_save_status", 2)
context.commit("update_save_error_message", resp.message)
context.commit("update_no_save", 0)
context.commit("update_btn_save_seen", true)
context.commit("update_pgrs_save", false)
context.commit("disabled_button", false)
let data = {
records: resp.data.records,
total: resp.data.total
}
let msg = data.records.message
if(prm.act === 'Y')
context.commit("update_dialog_action", false)
else
context.commit("update_dialoglist", false)
var snackbar = {value:true,timeout:4000,text:msg}
context.commit("update_snackbar",snackbar)
var xprm = {
name:prm.name,
nolab: prm.nolab,
//status: prm.status
}
context.dispatch("search",xprm)
context.dispatch("done/search",prm.done_search,{root:true})
}
} catch (e) {
context.commit("update_save_status", 3)
context.commit("update_btn_save_seen", true)
context.commit("update_save_error_message", e.message)
console.log(e)
}
}
}
}

View File

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