Flatten nested repos

This commit is contained in:
sas.fajri
2026-04-27 10:13:31 +07:00
parent 01c2963a43
commit 8347aef8f4
17935 changed files with 5015229 additions and 3 deletions

View File

@@ -0,0 +1,173 @@
const URL = "/one-api/mockup/cpone-nonlab-upload-document/";
export async function search_patient(prm) {
try {
var resp = await axios.post(URL + 'patient/search_patient', 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 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 searchcompany(token, prm) {
try {
var resp = await axios.post(URL + 'patient/searchcompany', { token: token, search: prm });
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function lookup_statuses(prm) {
try {
var resp = await axios.post(URL + 'patient/lookup_statuses', 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 getdatabarcodes(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 serahkan(prm) {
try {
var resp = await axios.post(URL + 'patient/serahkan', 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 uploadDocument(prm) {
try {
var resp = await axios.post(URL + 'patient/uploadDocument', 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 getdocument(prm) {
try {
var resp = await axios.post(URL + 'patient/getdocument', 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 deleteFile(prm) {
try {
var resp = await axios.post(URL + 'patient/deleteFile', 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,58 @@
const URL = "/one-api/mockup/fo/cashier/";
export async function lookup_type(token) {
try {
var resp = await axios.post(URL + 'payment/lookup_type',{token:token});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function pay(prm) {
try {
var resp = await axios.post(URL + 'payment/pay',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 delete_note(prm) {
try {
var resp = await axios.post(URL + 'payment/delete_note',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,527 @@
<template>
<v-layout column pb-2>
<v-card class="mb-2">
<v-layout row pa-2 align-center wrap >
<table>
<tr>
<th class="text-md-center pt-2 pb-2"> NOTA </th>
<th class="text-md-center pt-2 pb-2"> TIPE PEMBAYARAN </th>
<th class="text-md-center pt-2 pb-2">JUMLAH</th>
<th class="text-md-center pt-2 pb-2">USER</th>
<th class="text-md-center pt-2 pb-2">AKSI</th>
</tr>
<tr class="mini-input" v-if="notes.length > 0" v-for="(note,index) in notes">
<td width="30%" v-bind:class="{ 'red--text':note.note_active === 'N','primary--text':note.note_amount < 0}" style="text-align:center;vertical-align:center;" align="center" >{{note.note_number}}</td>
<td width="30%" v-bind:class="{ 'red--text':note.note_active === 'N','primary--text':note.note_amount < 0}" class="text-md-center pl-3 pr-3">{{note.paymenttypes_name}}</td>
<td width="15%" v-bind:class="{ 'red--text':note.note_active === 'N','primary--text':note.note_amount < 0}" class="text-md-right pl-3 pr-3">{{convertMoney(note.note_amount)}}</td>
<td width="20%" v-bind:class="{ 'red--text':note.note_active === 'N','primary--text':note.note_amount < 0}" class="text-md-center pr-2">{{note.note_user}}</td>
<td class="text-md-center">
<span @click="printNote(note,index)" class="icon-medium-fill-base xs1 white--text info icon-print"></span>
</td>
</tr>
<tr class="mini-input" v-if="notes.length === 0">
<td colspan="5" class="text-md-center pr-2">
Tidak ada data
</td>
</tr>
</table>
</v-layout>
<v-layout style="border-top:1px dashed rgb(221,221,221)" row mt-1 mb-1></v-layout>
<v-layout row mt-1 mb-1 pl-2 pr-2>
<v-btn class="text-md-center" @click="printInvoice()" color="teal" dark>
Invoice
</v-btn>
<v-btn class="text-md-center" @click="printKw()" color="print" dark>
Kwitansi
</v-btn>
</v-layout>
</v-card>
<v-card >
<v-layout row pa-2 align-center wrap >
<v-flex xs6>
<v-layout row>
<v-flex xs12>
<div class="label-tagihan text-xs-left">Total Tagihan</div>
</v-flex>
</v-layout>
<v-layout pt-1 row>
<v-flex xs9>
<div class="text-xs-left warning--text">Minimun DP ({{selectedpatient.mindp_percent}}%)</div>
</v-flex>
<v-flex xs3>
<div class="text-xs-right warning--text">{{convertMoney(selectedpatient.mindp_amount)}}</div>
</v-flex>
</v-layout>
</v-flex>
<v-flex xs6>
<div class="text-tagihan text-xs-right"><kbd>{{convertMoney(restbill)}}</kbd></div>
</v-flex>
</v-layout>
<v-layout style="border-top:1px dashed rgb(221,221,221)" row mt-1 mb-1></v-layout>
<div v-for="(type, index) in types">
<v-layout row pt-2 pb-1 pl-2 align-center wrap >
<v-flex xs12>
<v-switch
v-model="type.chex"
@change="updateChx(type,index)"
:label="type.chexlabel"
></v-switch>
</v-flex>
</v-layout>
<v-layout row pa-2 align-center wrap >
<v-flex xs2>
<div class="sub-title pl-2">{{type.leftlabel}}</div>
</v-flex>
<v-flex xs4>
<div class="pa-2">
<input type="text" @change="updateTotal()" :class="{ 'disabled-background':type.chex === false }" :disabled="!type.chex" v-model="type.leftvalue" class="input-plain text-xs-right font-weight-bold"/>
</div>
</v-flex>
<v-flex xs2>
<div class="sub-title pl-2">{{type.rightlabel}}</div>
</v-flex>
<v-flex xs4>
<div class="pa-2">
<input type="text" :class="{ 'disabled-background':type.chex === false, 'text-xs-right':type.code === 'CASH' }" :disabled="!type.chex" v-model="type.rightvalue" class="input-plain"/>
</div>
</v-flex>
</v-layout>
<v-layout style="border-top:1px dashed rgb(221,221,221)" row mt-1 mb-1></v-layout>
</div>
<v-layout row pa-2 align-center wrap >
<v-flex xs6>
<div class="label-tagihan text-xs-left">
<v-btn @click="pay()" color="warning" dark>
Bayar
</v-btn>
</div>
</v-flex>
<v-flex xs6>
<div class="text-tagihan text-xs-right"><kbd>{{convertMoney(totpay)}}</kbd></div>
</v-flex>
</v-layout>
</v-card>
<template>
<v-dialog
v-model="xdialogpaysuccess"
max-width="30%"
persistent
>
<v-card>
<v-card-title
class="headline success pt-2 pb-2"
primary-title
>
<h4 style="color:#FFEBEE">Pembayaran Berhasil</h4>
</v-card-title>
<v-card-text class="pt-2 pb-2">
<v-layout row>
<v-flex xs12 d-flex>
<v-layout row>
<v-flex pb-1 xs12>
<v-layout row>
<v-flex pt-2 pr-2 v-html="xmsgpaysuccess" xs12>
</v-flex>
</v-layout>
</v-flex>
</v-layout>
</v-flex>
</v-layout>
</v-card-text>
<v-divider></v-divider>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn
flat
@click="doPrint()"
>
Print
</v-btn>
<v-btn
color="error"
flat
@click="closeDialogPaySuccess(false)"
>
Tutup
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</template>
<template>
<v-dialog
v-model="xdialogdelete"
persistent
max-width="30%"
>
<v-card>
<v-card-title
:class="{ 'red':!_.isEmpty(xnotadelete), 'success':_.isEmpty(xnotadelete) }"
class="headline darken-1 pt-2 pb-2"
primary-title
>
<h4 style="color:#FFEBEE">
<span v-if="!_.isEmpty(xnotadelete)">Peringatan !</span>
<span v-if="_.isEmpty(xnotadelete)">Berhasil !</span>
</h4>
</v-card-title>
<v-card-text class="pt-2 pb-2">
<v-layout row>
<v-flex xs12 d-flex>
<v-layout row>
<v-flex pb-1 xs12>
<v-layout row>
<v-flex pt-2 pr-2 v-html="xmsgdelete" xs12>
</v-flex>
</v-layout>
<v-layout v-if="!_.isEmpty(xnotadelete)" row>
<v-flex pt-2 pr-2 xs12>
<input style="border: 1px solid black;padding: 5px;width: 100%;" type="text" placeholder="Catatan (*Wajib diisi)" v-model="xnotedelete" class="input-plain"/>
</v-flex>
</v-layout>
</v-flex>
</v-layout>
</v-flex>
</v-layout>
</v-card-text>
<v-divider></v-divider>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn
color="error"
v-if="!_.isEmpty(xnotadelete) && xnotedelete "
flat
@click="doDeleteNote()"
>
Yakin dong !
</v-btn>
<v-btn
v-if="!_.isEmpty(xnotadelete)"
color="primary"
flat
@click="xdialogdelete = false"
>
Tutup
</v-btn>
<v-btn
v-if="_.isEmpty(xnotadelete)"
color="primary"
flat
@click="closeDialogDelete()"
>
Tutup
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</template>
<one-dialog-print :title="printtitle" :width="printwidth" :height="500" :status="openprintnote" :urlprint="urlprintnote" @close-dialog-print="openprintnote = false"></one-dialog-print>
</v-layout>
</template>
<style scoped>
.label-tagihan{
text-align:left;
font-size: 25px;
font-family: open sans, tahoma, sans-serif;
font-weight:700;
}
.sub-header{
text-align:left;
font-size: 18px;
font-family: open sans, tahoma, sans-serif;
font-weight:700;
}
.sub-title{
text-align:left;
font-size: 14px;
font-family: open sans, tahoma, sans-serif;
font-weight:700;
}
.text-tagihan{
text-align:left;
font-size: 42px;
font-family: open sans, tahoma, sans-serif;
}
.disabled-background{
background:#b7b7b7;
}
.input-cash{
width: 100%;
padding: 8px 14px;
box-sizing: border-box;
border: 2px solid grey;
border-radius: 4px;
font-size: 22px;
font-weight:700;
text-align:right;
}
.input-plain{
width: 100%;
padding: 4px 8px;
box-sizing: border-box;
border: 2px solid grey;
border-radius: 4px;
font-size: 14px;
}
.v-input, .v-input__slot, .v-messages{
margin:0px;
padding:0px;
min-height: 0px;
}
.v-input--selection-controls:not(.v-input--hide-details) .v-input__slot {
margin-bottom: 0px;
}
table {
font-family: arial, sans-serif;
border-collapse: collapse;
width: 100%;
background:white;
border: 0px;
}
th, td {
border: 1px solid black;
border-collapse: collapse;
padding-top: 2px;
padding-bottom: 2px;
}
table>tr>td {
padding: 8px;
}
table>tr>td:first {
padding-left:15px!important;
}
.mini-input .v-input{
margin-top: 0px;
}
.mini-input .v-input, .mini-input .v-input--selection-controls,.mini-input .v-input__slot{
margin-top: 0px;
margin-bottom:0px;
margin-left:3px;
}
.mini-input .v-messages{
min-height:0px;
}
.border-bottom-dashed{
border-bottom : 1px dashed rgba(0,0,0,.12);
}
</style>
<script>
module.exports = {
components : {
'one-field-verification' : httpVueLoader('../../common/oneFieldVerificationSupply.vue'),
'one-dialog-print':httpVueLoader('../../common/oneDialogPrintX.vue')
},
data () {
return {
checkbox: true,
radioGroup: 1,
switchCash: true,
switchDebit: false,
switchKredit: false,
dialog:false,
urlprintnote:'',
printtitle:'',
printwidth:600
}
},
mounted() {
this.$store.dispatch("payment/lookup_type")
},
computed: {
notes(){
return this.$store.state.payment.notes
},
xdialogpaysuccess(){
return this.$store.state.payment.dialog_pay_success
},
xmsgpaysuccess(){
return this.$store.state.payment.paynumber
},
types() {
return this.$store.state.payment.types
},
totpay() {
return this.$store.state.payment.total_payment
},
restbill(){
if(this.$store.state.patient.patients.length > 0){
return this.$store.state.patient.selected_patient.totalbill - this.$store.state.patient.selected_patient.paid
}
else{
return 0
}
},
xdialogdelete:{
get() {
return this.$store.state.payment.dialog_delete
},
set(val) {
this.$store.commit("payment/update_dialog_delete",val)
}
},
xmsgdelete(){
return this.$store.state.payment.msg_delete
},
xnotadelete(){
return this.$store.state.payment.nota_delete
},
xnotedelete:{
get() {
return this.$store.state.payment.note_delete
},
set(val) {
this.$store.commit("payment/update_note_delete",val)
}
},
openprintnote: {
get() {
return this.$store.state.payment.open_print_note
},
set(val) {
this.$store.commit("payment/update_open_print_note",false)
}
},
selectedpatient(){
return this.$store.state.patient.selected_patient
}
},
methods : {
convertMoney(money){
return one_money(money)
},
closeDialogPaySuccess(){
let arrpatient = this.$store.state.patient.patients
var idx = _.findIndex(arrpatient, item => item.T_OrderHeaderID === this.$store.state.patient.selected_patient.T_OrderHeaderID)
this.$store.commit("payment/update_dialog_pay_success",false)
this.$store.commit("patient/update_selected_patient",{})
this.$store.dispatch("patient/search",{
startdate:this.$store.state.patient.start_date,
enddate:this.$store.state.patient.end_date,
search: this.$store.state.patient.search,
status: this.$store.state.patient.selected_status.value,
current_page:this.$store.state.patient.current_page,
lastidx:idx
})
},
updateTotal(){
var xval = this.$store.state.payment.types
let xcash = _.filter(xval, {code: 'CASH'})
let xother = _.filter(xval, type => type.code !== 'CASH')
var valother = 0
xother.forEach(function(obj){
valother += parseInt(obj.leftvalue)
})
let restother = this.restbill - valother
let xchange = parseInt(xcash[0].leftvalue) - restother
xcash[0].rightvalue = Math.max(0, xchange)
let idxcash = _.findIndex(xval, item => item.code === 'CASH')
xval[idxcash] = xcash[0]
this.$store.commit("payment/update_types",{records :xval,total:xval.length })
let totpaid = valother + ( parseInt(xcash[0].leftvalue) - Math.max(0, xchange) )
this.$store.commit("payment/update_total_payment",totpaid)
},
pay(){
var xval = this.$store.state.payment.types
var valpay = 0
let xcash = _.filter(xval, {code: 'CASH'})
xval.forEach(function(obj){
valpay += parseInt(obj.leftvalue)
})
if(valpay > 0 || xcash[0].leftvalue ){
let prm = {orderid:this.$store.state.patient.selected_patient.T_OrderHeaderID,payments:this.$store.state.payment.types}
this.$store.dispatch("payment/pay",prm)
}
},
deleteNote(note,idx){
this.$store.commit("payment/update_note_delete","")
this.$store.commit("payment/update_nota_delete",note)
let xmsg = "Yakin , mau hapus nota nomor <span style='color:red'>"+note.note_number+"</span> ?"
this.$store.commit("payment/update_msg_delete",xmsg)
this.$store.commit("payment/update_dialog_delete",true)
},
doDeleteNote(){
let prm = {catatan:this.$store.state.payment.note_delete,nota:this.$store.state.payment.nota_delete}
this.$store.dispatch("payment/delete_note",prm)
},
closeDialogDelete(){
let arrpatient = this.$store.state.patient.patients
var idx = _.findIndex(arrpatient, item => item.T_OrderHeaderID === this.$store.state.patient.selected_patient.T_OrderHeaderID)
this.$store.commit("payment/update_dialog_delete",false)
this.$store.commit("patient/update_selected_patient",{})
this.$store.dispatch("patient/search",{
startdate:this.$store.state.patient.start_date,
enddate:this.$store.state.patient.end_date,
search: this.$store.state.patient.search,
status: this.$store.state.patient.selected_status.value,
lastidx:idx
})
},
updateChx(val,idx){
let xobj = this.$store.state.payment.types
xobj[idx].leftvalue = 0
xobj[idx].rightvalue = 0
this.$store.commit("payment/update_types",{records :xobj,total:xobj.length })
this.updateTotal()
},
printNote(val,idx){
this.printwidth = 600
this.printtitle = ""
let user = one_user()
var rpt = 'rpt_t_003'
if(val.note_amount < 0)
rpt = 'rpt_t_004'
this.urlprintnote = "/birt/run?__report=report/one/fo/"+rpt+".rptdesign&__format=pdf&username="+user.M_UserUsername+"&PID="+val.note_id
this.$store.commit("payment/update_open_print_note",true)
},
doPrint(){
this.printtitle = ""
this.closeDialogPaySuccess()
let user = one_user()
let payments = this.$store.state.payment.last_payments
let xcash = _.filter(payments, {code: 'CASH'})
var rpt = 'rpt_t_003'
if(xcash[0].leftvalue < 0)
rpt = 'rpt_t_004'
this.urlprintnote = "/birt/run?__report=report/one/fo/"+rpt+".rptdesign&__format=pdf&username="+user.M_UserUsername+"&PID="+this.$store.state.payment.idx
this.$store.commit("payment/update_open_print_note",true)
},
printKw(){
this.printwidth = 800
this.printtitle = ""
let idx = this.$store.state.patient.selected_patient.T_OrderHeaderID
let user = one_user()
this.urlprintnote = "/birt/run?__report=report/one/fo/rpt_t_002.rptdesign&__format=pdf&username="+user.M_UserUsername+"&PID="+idx
this.$store.commit("payment/update_open_print_note",true)
},
printInvoice(){
this.printwidth = 800
this.printtitle = ""
let idx = this.$store.state.patient.selected_patient.T_OrderHeaderID
let user = one_user()
this.urlprintnote = "/birt/run?__report=report/one/fo/rpt_t_001.rptdesign&__format=pdf&username="+user.M_UserUsername+"&PID="+idx
this.$store.commit("payment/update_open_print_note",true)
}
}
}
</script>

View File

@@ -0,0 +1,385 @@
<template>
<div>
<v-dialog
v-model="dialog_details"
max-width="98%"
persistent
scrollable
>
<v-card>
<v-card-title
class="title grey lighten-2"
>
Informasi detail
</v-card-title>
<v-card-text >
<v-layout row style="width:98%">
<v-flex xs12>
<p class="subheader grey--text">DATA PASIEN</p>
</v-flex>
</v-layout>
<v-layout align-center row>
<v-flex xs12>
<p class="body-1 mb-1 font-weight-black"><v-icon small>bookmark</v-icon> {{selected_detail.noreg}}</p>
</v-flex>
</v-layout>
<v-layout align-center row>
<v-flex xs12>
<p>{{selected_detail.name}}</p>
</v-flex>
</v-layout>
<v-layout align-center row>
<v-flex xs12>
<p class="body-1 mb-1 font-weight-black"><v-icon small>location_on</v-icon> {{selected_detail.district}}</p>
</v-flex>
</v-layout>
<v-layout align-center row>
<v-flex xs12>
<p class="mb-1">{{selected_detail.destination}}</p>
<p class="orange--text">Catatan : {{selected_detail.note}}</p>
</v-flex>
</v-layout>
<v-divider></v-divider>
<v-layout align-center row>
<v-flex pa-0 ml-0 xs12>
<v-radio-group v-if="selected_detail.status !== 'D'" v-model="selected_receive_status">
<template v-slot:label>
<div class="body-1 grey--text">PILIH STATUS </div>
</template>
<p v-if="error_status" class="caption red--text mb-1"> ... statusnya ya jangan lupa</p>
<v-radio v-for="xradio in radios" @change="selectStatus(xradio)" :value="xradio.id">
<template v-slot:label>
<div class="body-1">{{xradio.name}}</div>
</template>
</v-radio>
</v-radio-group>
<p class="mb-0" v-if="selected_detail.status === 'D'">
<v-btn small block class="ml-0 mb-0 mt-2" color="teal" v-if="selected_detail.status === 'D'" outline>
<v-icon small color="teal">check_box</v-icon>
&nbsp;&nbsp;{{selected_detail.receiver_status_name}}
</v-btn>
</p>
<p class="mb-2" v-if="selected_detail.status === 'D'">
<v-btn block class="ml-0" color="teal" dark small>
<v-icon small dark>alarm</v-icon>
&nbsp;&nbsp;{{selected_detail.received_time}}
</v-btn>
</p>
</v-flex>
</v-layout>
<v-layout row>
<v-flex xs12>
<v-text-field
:disabled="selected_receive_status === '1'"
label="Penerima"
placeholder="Isikan penerima"
v-model="selected_detail.receiver"
hide-details
box
></v-text-field>
<p v-if="error_receiver" class="caption red--text mb-1"> ... diisi ya penerimanya</p>
</v-flex>
</v-layout>
<v-layout row>
<v-flex xs12>
<v-text-field
v-if="selected_detail.status !== 'D' && selected_detail.rest !== '0' && selected_detail.flag_bill === 'N'"
suffix="Rp"
placeholder="Isikan pembayaran"
single-line
v-model="selected_detail.pay"
reverse
hide-details
box
></v-text-field>
<kbd class="mt-1 mono caption" v-if="selected_detail.status === 'D' && (selected_detail.pay !== '0' || selected_detail.pay !== 0)"
color="teal">BAYAR : Rp {{convertMoney(selected_detail.pay)}}</kbd>
</v-flex>
</v-layout>
<v-layout v-if="selected_detail.status !== 'D' && ( selected_detail.rest !== '0' ) && selected_detail.flag_bill === 'N'" row>
<v-flex xs12>
<p class="mt-1 caption red--text">Kurang bayar : Rp {{convertMoney(selected_detail.rest)}}</p>
</v-flex>
</v-layout>
</v-card-text>
<v-divider></v-divider>
<v-card-actions>
<v-btn
block
color="danger"
flat
@click="dialog_details = false"
>
TUTUP
</v-btn>
<v-spacer></v-spacer>
<v-btn
v-if="selected_detail.status !== 'D'"
block
color="primary"
flat
@click="serahkan()"
>
SELESAI
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<v-layout row>
<v-flex xs12 sm6 offset-sm3>
<v-card>
<v-toolbar color="teal" dark>
<v-toolbar-side-icon><v-icon>keyboard_arrow_left</v-icon></v-toolbar-side-icon>
<v-toolbar-title class="text-xs-center">{{selected_spk.xnumber}}</v-toolbar-title>
<v-spacer></v-spacer>
<v-menu bottom left>
<template v-slot:activator="{ on }">
<v-btn
dark
icon
v-on="on"
>
<v-icon>more_vert</v-icon>
</v-btn>
</template>
<v-list>
<v-list-tile
v-for="(xspk,spk_idx) in spks"
@click="select_spk(xspk)"
>
<v-list-tile-title>{{ xspk.xnumber }}</v-list-tile-title>
</v-list-tile>
</v-list>
</v-menu>
</v-toolbar>
<v-list subheader v-for="(detail,idx) in selected_spk.details" three-line>
<v-subheader>{{detail.delivery_name}}</v-subheader>
<v-divider></v-divider>
<template v-for="(item, index) in detail.details">
<v-list-tile
ripple
@click="openDetails(item,spk_idx,idx,index)"
style="height:auto;min-height:88px"
>
<v-list-tile-content>
<v-list-tile-title class="body-2">{{item.noreg}} {{item.name}}</v-list-tile-title>
<v-list-tile-sub-title class="body-1">
<span class='text--primary'>{{item.district}} </span> &mdash; <span class='grey--text caption'>{{item.destination}}</span>
</v-list-tile-sub-title>
<v-list-tile-sub-title class="caption orange--text">
Catatan : {{item.note}}
</v-list-tile-sub-title>
</v-list-tile-content>
<v-list-tile-action>
<v-list-tile-action-text v-if="item.status !== 'D' && item.rest !== '0' && item.flag_bill === 'N'" class="text-right mono red--text caption">
{{convertMoney(item.rest)}}
</v-list-tile-action-text>
<v-spacer></v-spacer>
<v-icon v-if="item.status === 'D'"
color="teal"
>
done
</v-icon>
<v-icon v-if="item.status !== 'D'"
color="grey"
>
remove
</v-icon>
</v-list-tile-action>
</v-list-tile>
<v-divider
v-if="index + 1 < items.length"
:key="index"
></v-divider>
</template>
</v-list>
</v-card>
</v-flex>
</v-layout>
</div>
</template>
<style scoped>
.v-list--three-line .v-list__tile {
height:auto;
min-height: 88px;
}
</style>
<script>
module.exports = {
components : {
'one-dialog-info':httpVueLoader('../../common/oneDialogInfo.vue'),
'one-dialog-alert':httpVueLoader('../../common/oneDialogAlert.vue')
},
mounted() {
this.$store.dispatch("patient/lookup_statuses",{})
this.$store.dispatch("patient/search",{})
},
methods : {
convertMoney(money){
return one_money(money)
},
openDetails(item,spk_index,idx,detail_idx){
//console.log(spk_index)
this.error_receiver = false
this.error_status = false
this.spk_idx = spk_index
console.log(this.spk_idx)
this.idx = idx
console.log(idx)
this.detail_idx = detail_idx
console.log(detail_idx)
this.selected_detail = item
this.radios = this.$store.state.patient.statuses
this.selected_receive_status = null
//this.selected_receive_status = item.receiver_status_id
this.dialog_details = true
},
select_spk(spk){
this.selected_spk = spk
},
selectStatus(value){
console.log(value)
//var value = this.selected_receive_status
if(value.id === '1' || value.id === 1){
this.selected_detail.receiver = this.selected_detail.name
}
else{
this.selected_detail.receiver = ''
if(value.id !== '2' || value.id === 2){
this.selected_detail.receiver = '-'
}
}
this.selected_detail.receiver_status_id = value.id
this.selected_detail.receiver_status_name = value.name
},
serahkan(){
this.error_receiver = false
this.error_status = false
var param = this.selected_detail
if( parseInt(param.receiver_status_id) !== 0){
var goon = true
var msg = ''
if( param.receiver_status_id == '2' || param.receiver_status_id !== 2){
if(param.receiver === ''){
goon = false
this.error_receiver = true
}
}
param.spk_idx = this.spk_idx
param.last_idx = this.idx
param.last_detail_idx = this.detail_idx
if(goon)
this.$store.dispatch("patient/serahkan",param)
}
else{
this.error_status = true
}
}
},
computed: {
xtotalpatients() {
return this.$store.state.patient.total_patients
},
spks: {
get() {
return this.$store.state.patient.patients
},
set(val) {
this.$store.commit("patient/update_patients",val)
}
},
selected_spk: {
get() {
return this.$store.state.patient.selected_patient
},
set(val) {
this.$store.commit("patient/update_selected_patient",val)
}
},
filters: {
get() {
return this.$store.state.patient.filters
},
set(val) {
this.$store.commit("patient/update_filters",val)
}
},
dialog_details: {
get() {
return this.$store.state.patient.dialog_details
},
set(val) {
this.$store.commit("patient/update_dialog_details",val)
}
},
},
data () {
return {
//selected_spk :{},
error_receiver:false,
error_status:false,
spk_idx:0,
idx:0,
detail_idx:0,
switchMe: true,
radios:[],
//dialog_details:false,
selected_radio: [2],
selected_receive_status:null,
selected_detail:{},
spk_lists: [
{ title: 'Click Me' },
{ title: 'Click Me' },
{ title: 'Click Me' },
{ title: 'Click Me 2' }
],
items: [
{
district:"Tamansari",
destination:"Jl. Muararajeun Tengah No. 23",
noreg:"210220001DA",
name:"Fajri Hardhita Murti",
status_payment:"Y",
rest:"1500000",
pay:"1500000",
status:"D",
note:"-"
},
{
district:"Buahbatu",
destination:"Jl. Slamet Riyadi No. 203",
noreg:"210220002DA",
name:"Agus Rahman",
status_payment:"N",
rest:"200000",
pay:"0",
status:"S",
note:"-"
},
{
district:"Buahbatu",
destination:"Jl. Slamet Riyadi No. 203",
noreg:"210220003DA",
name:"Wika Setyawati",
status_payment:"Y",
rest:"0",
pay:"0",
status:"D",
note:"Titipkan saja ke rumah sebelah kanan, namanya bu wati"
},
]
}
}
}
</script>

View File

@@ -0,0 +1,88 @@
<template>
<v-layout row justify-center>
<v-dialog v-model="dialog_scanner" persistent max-width="290">
<v-card>
<v-card-title class="headline">Arahkan kamera ke QR / Barcode</v-card-title>
<v-card-text>
<div id="qr-reader" style="width:200px"></div>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="green darken-1" flat @click="startscan">mulai</v-btn>
<v-btn color="green darken-1" flat @click="dialog_scanner = false">tutup</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</v-layout>
</template>
<script>
module.exports = {
components : {
'one-dialog-info':httpVueLoader('../../common/oneDialogInfo.vue'),
'one-dialog-alert':httpVueLoader('../../common/oneDialogAlert.vue')
},
mounted() {
},
methods : {
startscan(){
this.isScanning = true;
this.html5QrCode = new Html5Qrcode("qr-reader");
this.html5QrCode.start(
{ facingMode: "environment" },
{
fps: 10,
qrbox: { width: 250, height: 250 }
},
this.qrCodeSuccessCallback)
.catch(err => {
console.error(`Error scanning QR code: ${err}`);
this.isScanning = false;
});
},
qrCodeSuccessCallback(decodedText, decodedResult){
alert(`QR Code Content: ${decodedText}`);
},
},
computed: {
dialog_scanner: {
get() {
return this.$store.state.patient.dialog_scanner
},
set(val) {
this.$store.commit("patient/update_dialog_scanner",val)
}
}
},
data() {
return {
isDialogVisible: false,
isScanning: false,
html5QrCode: null
}
},
watch : {
dialog_scanner (n, o) {
console.log('blallal')
if (n == true) {
} else {
if (this.isScanning && this.html5QrCode) {
this.html5QrCode.stop().then(() => {
this.isScanning = false;
}).catch(err => {
console.error('Failed to stop QR code scanning.', err);
});
}
}
},
}
}
</script>

View File

@@ -0,0 +1,735 @@
<!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>CPONE</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">
<v-snackbar color="success" v-model="snackbarSuccess" right="right" :timeout="3000" top="top">
{{ successMsg }}
<v-btn color="white" flat @click="snackbarSuccess = false"> Close </v-btn>
</v-snackbar>
<v-snackbar color="error" v-model="snackbarError" right="right" :timeout="3000" top="top">
{{ errorMsg }}
<v-btn color="white" flat @click="snackbarError = false"> Close </v-btn>
</v-snackbar>
<v-dialog persistent v-model="dialogUpload" width="90%">
<v-card>
<v-card-title class="headline grey lighten-2" primary-title>
Upload Dokumen
</v-card-title>
<v-card-text>
<v-progress-linear v-if="uploadLoading" :indeterminate="uploadLoading"></v-progress-linear>
<v-btn block :disabled="uploadLoading" color="blue-grey" class="white--text" @click='pickFile'>
Pilih Dokumen
<v-icon right dark>attach_file</v-icon>
</v-btn>
<!-- <v-text-field label=" Pilih Gambar" hide-details @click='pickFile' v-model='filesData' prepend-icon='attach_file' class="mt-2"></v-text-field> -->
<input type="file" style="display: none" ref="image" accept=".doc, .docx, .pdf, .xls, .xlsx, image/*" :value="filesData" multiple @change="onFilePicked">
<fieldset v-if="selectedFile.length > 0">
<legend class="px-3">
{{ selectedFile.length }} item terpilih
</legend>
<v-layout row wrap class="pa-2 text-wrap">
<!-- <v-btn small color="primary" v-for="(data, index) in selectedFile" :key="index" class="mr-2" dark>
<p class="text-truncate">{{ data.imageName }}</p>
</v-btn> -->
<v-chip v-for="(data, index) in selectedFile" @input="removeFile(data.imageName)" close :key="index" class="mr-2 text-truncate">
{{ data.imageName }}
</v-chip>
</v-layout>
</fieldset>
</v-card-text>
<v-divider></v-divider>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="error" :disabled="uploadLoading" flat @click="dialogUpload = false">
Tutup
</v-btn>
<v-btn color="primary" :disabled="uploadLoading" flat @click="uploadData()">
Simpan
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<v-dialog v-model="dialogPreview" width="90%">
<v-card>
<v-card-title class="headline grey lighten-2" primary-title>
Dokumen
</v-card-title>
<v-card-text>
<v-layout column wrap class="pa-2 text-wrap">
<P v-if="filePathList.length===0">Belum ada dokumen yang di upload</P>
<div v-for="(data, index) in filePathList">
<p class="mb-0 pb-0 font-weight-bold subheading text-wrap">{{ data.file }}</p>
<v-btn color="blue-grey" class="white--text" @click="download(data.file)">
Download
<v-icon class="ml-2" left dark>cloud_download</v-icon>
</v-btn>
<v-btn color="error" class="white--text" @click="deleteFile(data)">
Hapus
<v-icon class="ml-2" left dark>delete</v-icon>
</v-btn>
<!-- <v-chip @click="download(data.file)" :key="index" class="mr-2 text-truncate">
{{ data.file }}
</v-chip> -->
<img v-if="!['doc','docx','xls','xlsx','pdf'].includes(data.type)" width="100%" class="mb-2" height="400px" style="object-fit: cover;" :src="getDataPath(data.file)" alt="Dinosaur" />
<object v-if="['pdf'].includes(data.type)" :data="getDataPath(data.file)" class="mb-2" width="100%" height="300"></object>
<!-- <iframe v-if="data.type !== 'pdf'" width="100%" height="300" class="mb-2" :src="getDataPathNonPdf(data.file)"></iframe> -->
<iframe v-if="['doc','docx','xls','xlsx'].includes(data.type)" width="100%" height="300" class="mb-2" :src="getDataPathNonPdf(data.file)"></iframe>
</div>
</v-layout>
</v-card-text>
<v-divider></v-divider>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="error" flat @click="dialogPreview = false">
Tutup
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<one-navbar></one-navbar>
<v-dialog v-model="status_selesai" max-width="290" persistent>
<v-card>
<v-card-title class="headline">Selamat !</v-card-title>
<v-card-text>
Anda telah selesai melakukan seluruh pemeriksaan medical check up, silahkan mengisi survey
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="primary darken-1" flat="flat" @click="goToSurvey()">
Klik untuk isi surve
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<v-content style="background:#F5E8DF!important">
<v-container fluid>
<template>
<div id="e3" style="max-width: 400px; margin:auto" class="grey lighten-3">
<v-toolbar>
<v-btn icon>
<v-icon>assignment</v-icon>
</v-btn>
<v-toolbar-title>Upload Dokumen</v-toolbar-title>
<v-spacer></v-spacer>
<!--<v-btn icon>
<v-icon>search</v-icon>
</v-btn>-->
</v-toolbar>
<v-card>
<v-container fluid grid-list-lg>
<v-layout row wrap>
<v-flex xs12>
<!-- <v-card flat class="pb-4">
<v-img class="mt-2" :src="photo_qr" height="115px" contain></v-img>
</v-card> -->
<v-card color="primary" class="white--text">
<v-layout row>
<v-flex xs7>
<v-card-title primary-title>
<div>
<div class="headline mb-1">{{data_patient.labnumber}}</div>
<p class="mb-0">{{data_patient.patient_name}} <span v-if="data_patient.nip">/ {{data_patient.nip}}</span></p>
<p class="mb-0 caption">{{data_patient.patient_age}}</p>
<!--<div class="caption">{{data_patient.order_date}}</div>-->
<p class="mb-0 caption font-weight-bold">{{data_patient.corporate_name}}</p>
</div>
</v-card-title>
</v-flex>
<v-flex xs5>
<v-img class="mt-2" :src="data_patient.photo" height="115px" contain></v-img>
</v-flex>
</v-layout>
<v-divider light></v-divider>
<v-card-actions class="pa-3">
{{data_patient.gender}}
<v-spacer></v-spacer>
<p class="mb-0">{{data_patient.dob}}</p>
</v-card-actions>
</v-card>
<v-list class="mt-4" subheader>
<v-subheader>Pemeriksaan</v-subheader>
<v-list-group v-if="data_packet.length > 0" v-for="item in data_packet" :key="item.packet_name" v-model="item.active" :prepend-icon="item.action" no-action>
<template v-slot:activator>
<v-list-tile>
<v-list-tile-content>
<v-list-tile-title>{{ item.packet_name }}</v-list-tile-title>
</v-list-tile-content>
</v-list-tile>
</template>
<v-list-tile v-for="subItem in item.details" :key="subItem.test_name" @click="">
<v-list-tile-content>
<v-list-tile-title>{{ subItem.test_name }}</v-list-tile-title>
</v-list-tile-content>
<v-list-tile-action>
<v-icon>{{ subItem.action }}</v-icon>
</v-list-tile-action>
</v-list-tile>
</v-list-group>
<v-card v-if="data_tests.length > 0" flat>
<v-form>
<v-text-field v-for="(test,k_test) in data_tests" :key="test.test_name" label="" prepend-inner-icon="label_important" :value="test.test_name" single-line full-width hide-details></v-text-field>
<v-divider v-if="k_test <= data.tests.length - 1"></v-divider>
</v-form>
</v-card>
</v-list>
<v-subheader>Pemeriksaan / Pengambilan Sample</v-subheader>
<!--<v-subheader v-if="data_sample_lab.length > 0" inset>Laboratorium</v-subheader>-->
<!-- <v-list-tile v-if="data_sample_lab.length > 0" v-for="sample in data_sample_lab" :key="sample.barcode" avatar @click="" three-line class="mb-2">
<v-list-tile-avatar>
<v-icon class="blue white--text">colorize</v-icon>
</v-list-tile-avatar>
<v-list-tile-content>
<v-list-tile-title>{{ sample.sampletype_name }}</v-list-tile-title>
<v-list-tile-sub-title class="font-weight-bold">{{sample.staff_name}}</v-list-tile-sub-title>
<v-list-tile-sub-title class="caption">{{ sample.receive_date }} {{ sample.receive_time }}</v-list-tile-sub-title>
</v-list-tile-content>
<v-list-tile-action>
<v-btn icon ripple>
<v-icon v-if="sample.is_sampling == 'N' || sample.is_received == 'N'" color="grey lighten-1">info</v-icon>
<v-icon v-if="sample.is_sampling == 'Y' && sample.is_received == 'Y'" color="success lighten-1">check_circle</v-icon>
</v-btn>
</v-list-tile-action>
</v-list-tile> -->
<!--<v-subheader v-if="data_sample_radiodiagnostic.length > 0" inset>Radiodiagnostik</v-subheader>-->
<v-list-tile v-if="data_sample_radiodiagnostic.length > 0" v-for="sample in data_sample_radiodiagnostic" :key="sample.barcode" avatar three-line class="mb-2">
<v-list-tile-avatar @click="openDialogUpload(sample)">
<v-icon class="amber white--text">assignment_ind</v-icon>
</v-list-tile-avatar>
<v-list-tile-content @click="openDialogUpload(sample)">
<v-list-tile-title>{{ sample.sampletype_name }}</v-list-tile-title>
<v-list-tile-sub-title class="font-weight-bold">{{sample.staff_name}}</v-list-tile-sub-title>
<v-list-tile-sub-title class="caption">{{ sample.receive_date }} {{ sample.receive_time }}</v-list-tile-sub-title>
</v-list-tile-content>
<v-list-tile-action>
<v-btn icon ripple @click="openDialogPreview(sample)">
<v-icon v-if="sample.is_sampling == 'N' || sample.is_received == 'N'" color="grey lighten-1">info</v-icon>
<v-icon v-if="sample.is_sampling == 'Y' && sample.is_received == 'Y'" color="success lighten-1">info</v-icon>
</v-btn>
</v-list-tile-action>
</v-list-tile>
<!--<v-subheader v-if="data_sample_electromedic.length > 0" inset>Elektromedik</v-subheader>-->
<v-list-tile v-if="data_sample_electromedic.length > 0" v-for="sample in data_sample_electromedic" :key="sample.barcode" avatar three-line class="mb-2">
<v-list-tile-avatar @click="openDialogUpload(sample)">
<v-icon class="teal white--text">contacts</v-icon>
</v-list-tile-avatar>
<v-list-tile-content @click="openDialogUpload(sample)">
<v-list-tile-title>{{ sample.sampletype_name }}</v-list-tile-title>
<v-list-tile-sub-title class="font-weight-bold">{{sample.staff_name}}</v-list-tile-sub-title>
<v-list-tile-sub-title class="caption">{{ sample.receive_date }} {{ sample.receive_time }}</v-list-tile-sub-title>
</v-list-tile-content>
<v-list-tile-action>
<v-btn icon ripple @click="openDialogPreview(sample)">
<v-icon v-if="sample.is_sampling == 'N' || sample.is_received == 'N'" color="grey lighten-1">info</v-icon>
<v-icon v-if="sample.is_sampling == 'Y' && sample.is_received == 'Y'" color="success lighten-1">info</v-icon>
</v-btn>
</v-list-tile-action>
</v-list-tile>
<v-list-tile v-if="data_sample_other.length > 0" v-for="sample in data_sample_other" :key="sample.barcode" avatar three-line class="mb-2">
<v-list-tile-avatar @click="openDialogUpload(sample)">
<v-icon class="teal white--text">contacts</v-icon>
</v-list-tile-avatar>
<v-list-tile-content @click="openDialogUpload(sample)">
<v-list-tile-title>{{ sample.sampletype_name }}</v-list-tile-title>
<v-list-tile-sub-title class="font-weight-bold">{{sample.staff_name}}</v-list-tile-sub-title>
<v-list-tile-sub-title class="caption">{{ sample.receive_date }} {{ sample.receive_time }}</v-list-tile-sub-title>
</v-list-tile-content>
<v-list-tile-action>
<v-btn icon ripple @click="openDialogPreview(sample)">
<v-icon v-if="sample.is_sampling == 'N' || sample.is_received == 'N'" color="grey lighten-1">info</v-icon>
<v-icon v-if="sample.is_sampling == 'Y' && sample.is_received == 'Y'" color="success lighten-1">info</v-icon>
</v-btn>
</v-list-tile-action>
</v-list-tile>
<!--<v-subheader v-if="data_sample_other.length > 0" inset>Layanan Klinik</v-subheader>-->
<!-- <v-list-tile v-if="data_sample_other.length > 0" v-for="sample in data_sample_other" :key="sample.barcode" avatar @click="" three-line class="mb-2">
<v-list-tile-avatar>
<v-icon class="orange darken-2 white--text">accessibility</v-icon>
</v-list-tile-avatar>
<v-list-tile-content>
<v-list-tile-title>{{ sample.sampletype_name }}</v-list-tile-title>
<v-list-tile-sub-title class="font-weight-bold">{{sample.staff_name}}</v-list-tile-sub-title>
<v-list-tile-sub-title class="caption">{{ sample.receive_date }} {{ sample.receive_time }}</v-list-tile-sub-title>
</v-list-tile-content>
<v-list-tile-action>
<v-btn icon ripple>
<v-icon v-if="sample.is_sampling == 'N' || sample.is_received == 'N'" color="grey lighten-1">info</v-icon>
<v-icon v-if="sample.is_sampling == 'Y' && sample.is_received == 'Y'" color="success lighten-1">check_circle</v-icon>
</v-btn>
</v-list-tile-action>
</v-list-tile> -->
<!-- <v-list-tile avatar @click="goToSurvey()">
<v-list-tile-avatar>
<v-icon class="purple darken-2 white--text">assignment</v-icon>
</v-list-tile-avatar>
<v-list-tile-content>
<v-list-tile-title>{{ data_survey.sampletype_name }}</v-list-tile-title>
<v-list-tile-sub-title>{{ data_survey.receive_date }} {{ data_survey.receive_time }}</v-list-tile-sub-title>
</v-list-tile-content>
<v-list-tile-action>
<v-btn icon ripple>
<v-icon v-if="data_survey.is_sampling == 'N' || data_survey.is_received == 'N'" color="grey lighten-1">info</v-icon>
<v-icon v-if="data_survey.is_sampling == 'Y' && data_survey.is_received == 'Y'" color="success lighten-1">check_circle</v-icon>
</v-btn>
</v-list-tile-action>
</v-list-tile> -->
</v-list>
</v-flex>
</v-layout>
</v-container>
</v-card>
<v-card class="mt-1 pt-1 pa-2">
<v-btn block color="primary" @click="openscanner()">
Refresh
</v-btn>
<qr-scanner></qr-scanner>
</v-card>
</div>
</template>
</v-container>
</v-content>
<one-footer> </one-footer>
</v-app>
</div>
<!-- Vendor -->
<script src="../../../libs/vendor/html5-qrcode.min.js"></script>
<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',
components: {
'one-navbar': httpVueLoader('../../../apps/components/oneNavbarComponent.vue'),
'one-footer': httpVueLoader('../../../apps/components/oneFooter.vue'),
'one-patient-list': httpVueLoader('./components/onePatientList.vue'),
'qr-scanner': httpVueLoader('./components/oneQRscanner.vue')
},
mounted: function() {
var url_string = window.location.href
var url = new URL(url_string);
var id = url.searchParams.get("id");
var noreg = url.searchParams.get("noreg");
this.$store.commit('patient/update_order_id', id)
this.$store.commit('patient/update_noreg', noreg)
this.$store.dispatch('patient/load_data')
},
methods: {
deleteFile(data) {
let a = confirm("Apakah anda yakin menghapus dokumen" + data.file + " ?");
if (a) {
this.$store.dispatch('patient/deleteFile', data.documentID)
}
},
downloadFile(fileName) {
fetch(`download.php?file=${fileName}`)
.then(response => {
if (!response.ok) throw new Error('Network response was not ok');
return response.blob();
})
.then(blob => {
const url = window.URL.createObjectURL(blob);
const link = document.createElement('a');
link.href = url;
link.setAttribute('download', fileName);
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
})
.catch(error => {
console.error('Error downloading file:', error);
});
},
download(name) {
// window.open("/one-api/mockup/cpone-nonlab-upload-document/patient/downloadfile/" + name, '_self')
// window.location = "/one-api/mockup/cpone-nonlab-upload-document/patient/downloadfile/" + name;
// `/one-api/mockup/cpone-nonlab-upload-document/patient/downloadfile/${name}`
fetch(this.filePath + name)
.then(response => {
if (!response.ok) throw new Error('Network response was not ok');
return response.blob();
})
.then(blob => {
const url = window.URL.createObjectURL(blob);
const link = document.createElement('a');
link.href = url;
link.setAttribute('download', name);
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
})
.catch(error => {
console.error('Error downloading file:', error);
});
},
getDataPath(name) {
return this.filePath + name;
},
getDataPathNonPdf(name) {
let link = window.location.protocol + "//" + window.location.hostname + this.filePath + name
let link2 = " https://view.officeapps.live.com/op/embed.aspx?src=" + link
return link2
// return "https://docs.google.com/viewer?url=" + link + "&embedded=true"
},
uploadData() {
this.$store.dispatch('patient/uploadDocument')
},
getBase64(file) {
return new Promise((resolve, reject) => {
const reader = new FileReader();
reader.readAsDataURL(file);
reader.onload = () => resolve(reader.result);
reader.onerror = error => reject(error);
});
},
openDialogUpload(val) {
if (parseInt(val.soID) == 0) return;
this.selectedTest = val;
this.selectedFile = [];
this.dialogUpload = true;
},
openDialogPreview(val) {
if (parseInt(val.soID) == 0) return;
this.selectedTest = val;
this.$store.dispatch('patient/getdocument')
this.selectedFile = [];
this.dialogPreview = true;
},
removeFile(name) {
if (this.uploadLoading) return;
for (let i = 0; i < this.selectedFile.length; i++) {
const e = this.selectedFile[i];
if (e.imageName === name) {
this.selectedFile.splice(i, 1);
}
}
},
pickFile() {
this.$refs.image.click()
},
async onFilePicked(e) {
let a = [];
const files = e.target.files
console.log(files);
let validation = []
for (let i = 0; i < files.length; i++) {
const e = files[i];
let fileSize = (e.size / 1024 / 1024);
if (fileSize > 3) {
validation.push(e.name);
continue;
}
console.log(e);
let data = {}
data.imageName = e.name
if (data.imageName.lastIndexOf('.') <= 0) {
return
}
data.base64 = await this.getBase64(e);
console.log(data.base64);
data.imageFile = e // this is an image file that can be sent to server...
a.push(data);
}
this.selectedFile = a;
if (validation.length > 0) {
alert("File " + validation.join(", ") + " berukuran lebih besar dari 3 MB");
}
// if (files[0] !== undefined) {
// this.imageName = files[0].name
// if (this.imageName.lastIndexOf('.') <= 0) {
// return
// }
// const fr = new FileReader()
// fr.readAsDataURL(files[0])
// fr.addEventListener('load', () => {
// this.imageUrl = fr.result
// this.imageFile = files[0] // this is an image file that can be sent to server...
// })
// } else {
// this.imageName = ''
// this.imageFile = ''
// this.imageUrl = ''
// }
},
goToSurvey: function() {
console.log('aloha')
let order_id = this.$store.state.patient.order_id
let noreg = this.$store.state.patient.noreg
window.location = "/one-ui/test/vuex/cpone-control-card-survey/?noreg=" + noreg + "&id=" + order_id
},
openscanner() {
//this.dialog_scanner = true
location.reload()
}
},
computed: {
dialogUpload: {
get() {
return this.$store.state.patient.dialogUpload
},
set(val) {
this.$store.commit("patient/update_dialogUpload", val)
}
},
successMsg: {
get() {
return this.$store.state.patient.successMsg;
},
set(val) {
this.$store.commit("patient/update_successMsg", val);
},
},
errorMsg: {
get() {
return this.$store.state.patient.errorMsg;
},
set(val) {
this.$store.commit("patient/update_errorMsg", val);
},
},
snackbarError: {
get() {
return this.$store.state.patient.snackbarError;
},
set(val) {
this.$store.commit("patient/update_snackbarError", val);
},
},
snackbarSuccess: {
get() {
return this.$store.state.patient.snackbarSuccess;
},
set(val) {
this.$store.commit("patient/update_snackbarSuccess", val);
},
},
selectedFile: {
get() {
return this.$store.state.patient.selectedFile
},
set(val) {
this.$store.commit("patient/update_selectedFile", val)
}
},
dialogPreview: {
get() {
return this.$store.state.patient.dialogPreview
},
set(val) {
this.$store.commit("patient/update_dialogPreview", val)
}
},
uploadLoading() {
return this.$store.state.patient.uploadLoading
},
photo_qr() {
return this.$store.state.patient.photo_qr
},
status_selesai() {
return this.$store.state.patient.status_selesai
},
filePath() {
return this.$store.state.patient.filePath
},
filePathList() {
return this.$store.state.patient.filePathList
},
dialog_scanner: {
get() {
return this.$store.state.patient.dialog_scanner
},
set(val) {
this.$store.commit("patient/update_dialog_scanner", val)
}
},
selectedTest: {
get() {
return this.$store.state.patient.selectedTest
},
set(val) {
this.$store.commit("patient/update_selectedTest", val)
}
},
data_patient() {
return this.$store.state.patient.data_patient
},
data_packet() {
return this.$store.state.patient.data_packet
},
data_tests() {
return this.$store.state.patient.data_tests
},
data_sample_lab() {
return this.$store.state.patient.data_sample_lab
},
data_sample_radiodiagnostic() {
return this.$store.state.patient.data_sample_radiodiagnostic
},
data_sample_electromedic() {
return this.$store.state.patient.data_sample_electromedic
},
data_sample_other() {
return this.$store.state.patient.data_sample_other
},
data_survey() {
return this.$store.state.patient.data_survey
},
},
data() {
return {
filesData: [],
items2: [{
icon: 'assignment',
iconClass: 'blue white--text',
title: 'Vacation itinerary',
subtitle: 'Jan 20, 2014'
},
{
icon: 'call_to_action',
iconClass: 'amber white--text',
title: 'Kitchen remodel',
subtitle: 'Jan 10, 2014'
}
],
items: [{
action: 'healing',
title: 'Paket Pria 2024',
items: [{
title: 'List Item'
},
{
title: 'List Item'
},
{
title: 'List Item'
}
]
}]
}
}
})
</script>
<style>
[v-cloak] {
display: none
}
.left {}
.right {}
</style>
</body>
</html>

View File

@@ -0,0 +1,533 @@
// 1 => LOADING
// 2 => DONE
// 3 => ERROR
import * as api from "../api/patient.js"
export default {
namespaced: true,
state: {
lastidx: 0,
lookup_status: 0,
lookup_error_message: '',
search_patient: 0,
search_error_message: '',
start_date: moment(new Date()).format('YYYY-MM-DD'),
end_date: moment(new Date()).format('YYYY-MM-DD'),
search: '',
total_patiens: 0,
total_filter_patiens: 0,
total_patients_all: 0,
patients: [],
total_patient: 0,
selected_patient: { totalbill: 0 },
save_error_message: '',
statuses: [],
selected_status: {},
open_alert_no_pay: false,
msg_alert_no_pay: "Loh ... Gak jadi bayar dong ?",
current_page: 1,
total_page: 0,
filters: [{ id: 'day', name: 'Hari ini' }, { id: 'notsampled', name: 'Belum sampling' }, { id: 'all', name: 'Tampilkan semua' }],
selected_filter: { id: 'day', name: 'Hari ini' },
promise_dialog: false,
promises: [],
errors: [],
save_status: 0,
save_error_message: '',
barcodes: [],
dialog_barcode: false,
autocomplete_status: 0,
companies: [],
selected_company: { id: 0, name: 'Semua' },
dialog_details: false,
order_id: 0,
noreg: '',
data_patient: [],
data_packet: [],
data_tests: [],
data_sample_lab: [],
data_sample_radiodiagnostic: [],
data_sample_electromedic: [],
data_sample_other: [],
dialog_scanner: false,
data_survey: {},
status_selesai: false,
photo_qr: "",
dialogUpload: false,
dialogPreview: false,
selectedFile: [],
uploadLoading: false,
selectedTest: {},
filePathList: [],
filePath: "/one-media/one-document-nonlab/",
errorMsg: '',
snackbarSuccess: false,
snackbarError: false,
successMsg: '',
},
mutations: {
update_errorMsg(state, val) {
state.errorMsg = val
},
update_snackbarSuccess(state, val) {
state.snackbarSuccess = val
},
update_snackbarError(state, val) {
state.snackbarError = val
},
update_successMsg(state, val) {
state.successMsg = val
},
update_filePathList(state, val) {
state.filePathList = val
},
update_filePath(state, val) {
state.filePath = val
},
update_photo_qr(state, val) {
state.photo_qr = val
},
update_selectedTest(state, val) {
state.selectedTest = val
},
update_status_selesai(state, val) {
state.status_selesai = val
},
update_data_survey(state, val) {
state.data_survey = val
},
update_dialog_scanner(state, val) {
state.dialog_scanner = val
},
update_data_sample_other(state, val) {
state.data_sample_other = val
},
update_data_sample_electromedic(state, val) {
state.data_sample_electromedic = val
},
update_data_sample_radiodiagnostic(state, val) {
state.data_sample_radiodiagnostic = val
},
update_data_sample_lab(state, val) {
state.data_sample_lab = val
},
update_data_tests(state, val) {
state.data_tests = val
},
update_data_packet(state, val) {
state.data_packet = val
},
update_data_patient(state, val) {
state.data_patient = val
},
update_order_id(state, val) {
state.order_id = val
},
update_noreg(state, val) {
state.noreg = val
},
update_dialog_details(state, val) {
state.dialog_details = val
},
update_companies(state, val) {
state.companies = val
},
update_selected_company(state, val) {
state.selected_company = val
},
update_dialog_barcode(state, val) {
state.dialog_barcode = val
},
update_statuses(state, val) {
state.statuses = val
},
update_total_patients_all(state, val) {
state.total_patients_all = val
},
update_save_status(state, val) {
state.save_status = val
},
update_save_error_message(state, val) {
state.save_error_message = val
},
update_lookup_error_message(state, val) {
state.lookup_error_message = val
},
update_lookup_status(state, status) {
state.lookup_status = status
},
update_promise_dialog(state, val) {
state.promise_dialog = val
},
update_promises(state, val) {
state.promises = val
},
update_errors(state, val) {
state.errors = val
},
update_lastidx(state, val) {
state.lastidx = val
},
update_selected_filter(state, val) {
state.selected_filter = val
},
update_filters(state, val) {
state.filters = val
},
update_total_page(state, val) {
state.total_page = val
},
update_total_patient(state, val) {
state.total_patient = val
},
update_current_page(state, val) {
state.current_page = val
},
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
},
update_selected_patient(state, val) {
state.selected_patient = val
},
update_start_date(state, val) {
state.start_date = val
},
update_autocomplete_status(state, val) {
state.autocomplete_status = val
},
update_end_date(state, val) {
state.end_date = val
},
update_search(state, val) {
state.search = val
},
update_selected_status(state, val) {
state.selected_status = val
},
update_open_alert_no_pay(state, val) {
state.open_alert_no_pay = val
},
update_msg_alert_no_pay(state, val) {
state.msg_alert_no_pay = val
},
update_uploadLoading(state, val) {
state.uploadLoading = val
},
update_selectedFile(state, val) {
state.selectedFile = val
},
update_dialogPreview(state, val) {
state.dialogPreview = val
},
update_uploadLoading(state, val) {
state.uploadLoading = val
},
update_dialogUpload(state, val) {
state.dialogUpload = val
},
},
actions: {
async load_data(context) {
context.commit("update_search_patient", 1)
try {
//console.log(prm)
let prm = {}
prm.order_id = context.state.order_id
prm.noreg = context.state.noreg
let resp = await api.search_patient(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_patient = resp.data.data_patient
let data_packet = resp.data.data_packet
let data_tests = resp.data.data_tests
let data_sample_lab = resp.data.data_sample_lab
let data_sample_radiodiagnostic = resp.data.data_sample_radiodiagnostic
let data_sample_electromedic = resp.data.data_sample_electromedic
let data_sample_other = resp.data.data_sample_other
let data_survey = resp.data.data_survey
context.commit("update_data_patient", data_patient)
context.commit("update_data_packet", data_packet)
context.commit("update_data_tests", data_tests)
context.commit("update_data_sample_lab", data_sample_lab)
context.commit("update_data_sample_radiodiagnostic", data_sample_radiodiagnostic)
context.commit("update_data_sample_electromedic", data_sample_electromedic)
context.commit("update_data_sample_other", data_sample_other)
context.commit("update_data_survey", data_survey)
//https://devcpone.aplikasi.web.id/one-media/one-qrpatient/patient_qr_R2407110001.png
let photo_qr = "/one-media/one-qrpatient/patient_qr_" + data_patient.labnumber + ".png"
context.commit("update_photo_qr", photo_qr)
let status_selesai = true
if (data_sample_lab.length > 0) {
data_sample_lab.forEach(data => {
if (data.is_received === 'N')
status_selesai = false
})
}
if (data_sample_radiodiagnostic.length > 0) {
data_sample_radiodiagnostic.forEach(data => {
if (data.is_received === 'N')
status_selesai = false
})
}
if (data_sample_electromedic.length > 0) {
data_sample_electromedic.forEach(data => {
if (data.is_received === 'N')
status_selesai = false
})
}
if (data_sample_other.length > 0) {
data_sample_other.forEach(data => {
if (data.is_received === 'N')
status_selesai = false
})
}
if (!_.isEmpty(data_survey)) {
status_selesai = false
}
context.commit("update_status_selesai", status_selesai)
}
} catch (e) {
context.commit("update_search_patient", 3)
context.commit("update_search_error_message", e.message)
console.log(e)
}
},
async search(context, prm) {
context.commit("update_search_patient", 1)
try {
//console.log(prm)
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
}
console.log(data.records)
context.commit("update_patients", data.records)
if (data.records.length > 0)
context.commit("update_selected_patient", data.records[0])
}
} catch (e) {
context.commit("update_search_patient", 3)
context.commit("update_search_error_message", e.message)
console.log(e)
}
},
async lookup_statuses(context, prm) {
context.commit("update_lookup_status", 1)
try {
prm.token = one_token()
let resp = await api.lookup_statuses(prm)
if (resp.status != "OK") {
context.commit("update_lookup_status", 3)
context.commit("update_lookup_error_message", resp.message)
} else {
context.commit("update_lookup_status", 2)
context.commit("update_lookup_error_message", "")
let data = {
records: resp.data.records,
total: resp.data.total
}
context.commit("update_statuses", data.records)
//context.commit("update_promise_dialog",true)
}
} catch (e) {
context.commit("update_lookup_status", 3)
context.commit("update_lookup_error_message", e.message)
}
},
async uploadDocument(context) {
context.commit("update_lookup_status", 1)
context.commit("update_uploadLoading", true)
try {
let prm = {}
prm.data = context.state.selectedFile
prm.test = context.state.selectedTest
prm.token = one_token()
let resp = await api.uploadDocument(prm)
if (resp.status != "OK") {
context.commit("update_lookup_status", 3)
context.commit("update_lookup_error_message", resp.message)
context.commit("update_uploadLoading", false)
context.commit("update_errorMsg", resp.message)
context.commit("update_snackbarError", true)
} else {
context.commit("update_lookup_status", 2)
context.commit("update_lookup_error_message", "")
context.commit("update_uploadLoading", false)
context.commit("update_dialogUpload", false)
context.commit("update_selectedFile", [])
context.commit("update_errorMsg", '')
context.commit("update_successMsg", 'Berhasil upload dokumen')
context.commit("update_snackbarSuccess", true)
let data = {
records: resp.data.records,
total: resp.data.total
}
context.commit("update_statuses", data.records)
//context.commit("update_promise_dialog",true)
}
} catch (e) {
context.commit("update_lookup_status", 3)
context.commit("update_uploadLoading", false)
context.commit("update_lookup_error_message", e.message)
context.commit("update_errorMsg", e.message)
context.commit("update_snackbarError", true)
}
},
async getdatabarcodes(context, prm) {
context.commit("update_lookup_status", 1)
try {
prm.token = one_token()
let resp = await api.getdatabarcodes(prm)
if (resp.status != "OK") {
context.commit("update_lookup_status", 3)
context.commit("update_lookup_error_message", resp.message)
} else {
context.commit("update_lookup_status", 2)
context.commit("update_lookup_error_message", "")
let data = {
records: resp.data.records,
total: resp.data.total
}
context.commit("update_barcodes", data.records)
context.commit("update_dialog_barcode", true)
}
} catch (e) {
context.commit("update_lookup_status", 3)
context.commit("update_lookup_error_message", e.message)
}
},
async serahkan(context, prm) {
context.commit("update_save_status", 1)
try {
prm.token = one_token()
let resp = await api.serahkan(prm)
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", "")
let data = {
records: resp.data.records,
total: resp.data.total
}
var row_data = prm
row_data.status = 'D'
row_data.received_time = resp.data.records.received_time
var patients = context.state.patients
//console.log(patients)
//console.log(prm.last_idx)
//console.log(prm.last_detail_idx)
//console.log(patients.details)
patients[prm.spk_idx].details[prm.last_idx].details[prm.last_detail_idx] = row_data
context.commit("update_patients", patients)
context.commit("update_dialog_details", false)
}
} catch (e) {
context.commit("update_save_status", 3)
context.commit("update_save_error_message", e.message)
console.log(e)
}
},
async searchcompany(context, prm) {
context.commit("update_autocomplete_status", 1)
try {
let resp = await api.searchcompany(one_token(), prm)
if (resp.status != "OK") {
context.commit("update_autocomplete_status", 3)
} else {
context.commit("update_autocomplete_status", 2)
let data = {
records: resp.data.records,
total: resp.data.total
}
context.commit("update_companies", resp.data.records)
}
} catch (e) {
context.commit("update_autocomplete_status", 3)
}
},
async getdocument(context) {
context.commit("update_autocomplete_status", 1)
try {
let prm = {};
prm.token = one_token();
prm.orderID = context.state.selectedTest.orderID
prm.soID = context.state.selectedTest.soID
let resp = await api.getdocument(prm)
if (resp.status != "OK") {
context.commit("update_autocomplete_status", 3)
} else {
context.commit("update_autocomplete_status", 2)
let data = {
records: resp.data.records,
total: resp.data.total
}
context.commit("update_filePathList", resp.data.records)
}
} catch (e) {
context.commit("update_autocomplete_status", 3)
}
},
async deleteFile(context, id) {
context.commit("update_autocomplete_status", 1)
try {
let prm = {};
prm.token = one_token();
prm.id = id
let resp = await api.deleteFile(prm)
if (resp.status != "OK") {
context.commit("update_autocomplete_status", 3)
context.commit("update_errorMsg", resp.message)
context.commit("update_snackbarError", true)
} else {
context.commit("update_autocomplete_status", 2)
context.commit("update_dialogPreview", false);
context.commit("update_errorMsg", '')
context.commit("update_successMsg", 'Berhasil hapus data')
context.commit("update_snackbarSuccess", true)
}
} catch (e) {
context.commit("update_autocomplete_status", 3)
context.commit("update_errorMsg", e.message)
context.commit("update_snackbarError", true)
}
}
}
}

View File

@@ -0,0 +1,149 @@
// 1 => LOADING
// 2 => DONE
// 3 => ERROR
import * as api from "../api/payment.js"
export default {
namespaced: true,
state: {
lookup_status:0,
lookup_error_message:'',
types: [],
total_payment:0,
reload_after_save: false,
dialog_pay_success:false,
paynumber :'',
notes :[],
dialog_delete:false,
msg_delete:'',
note_delete:'',
nota_delete:{},
open_print_note:false,
idx:0,
last_payments:{}
},
mutations: {
update_lookup_error_message(state,val) {
state.lookup_error_message = val
},
update_lookup_status(state,status) {
state.lookup_status = status
},
update_types(state,data) {
state.types = data.records
state.total_type = data.total
},
update_selected_status(state,val) {
state.selected_status=val
},
update_total_payment(state,val) {
state.total_payment=val
},
update_reload_after_save(state,val) {
state.reload_after_save=val
},
update_dialog_pay_success(state,val) {
state.dialog_pay_success=val
},
update_paynumber(state,val) {
state.paynumber=val
},
update_notes(state,val) {
state.notes=val
},
update_dialog_delete(state,val) {
state.dialog_delete=val
},
update_note_delete(state,val) {
state.note_delete=val
},
update_msg_delete(state,val) {
state.msg_delete=val
},
update_nota_delete(state,val) {
state.nota_delete=val
},
update_open_print_note(state,val) {
state.open_print_note=val
},
update_idx(state,val) {
state.idx=val
},
update_last_payments(state,val) {
state.last_payments=val
}
},
actions: {
async lookup_type(context) {
context.commit("update_lookup_status",1)
try {
let resp= await api.lookup_type(one_token())
if (resp.status != "OK") {
context.commit("update_lookup_status",3)
context.commit("update_lookup_error_message",resp.message)
} else {
context.commit("update_lookup_status",2)
context.commit("update_lookup_error_message","")
let data = {
records : resp.data.records,
total: resp.data.total
}
context.commit("update_types",data)
}
} catch(e) {
context.commit("update_lookup_status",3)
context.commit("update_lookup_error_message",e.message )
}
},
async pay(context,prm) {
context.commit("update_lookup_status",1)
try {
prm.token = one_token()
let resp= await api.pay(prm)
if (resp.status != "OK") {
context.commit("update_lookup_status",3)
context.commit("update_lookup_error_message",resp.message)
} else {
context.commit("update_lookup_status",2)
context.commit("update_lookup_error_message","")
let data = {
records : resp.data.records.types,
total: resp.data.total
}
let xnumber = resp.data.records.data.numberx
let id = resp.data.records.data.idx
context.commit("update_types",data)
context.commit("update_last_payments",prm.payments)
context.commit("update_idx",id)
context.commit("update_total_payment",0)
context.commit("update_paynumber","Pembayaran nomor <span style='color:red'>"+xnumber+"</span> telah berhasil")
context.commit("update_dialog_pay_success",true)
}
} catch(e) {
context.commit("update_lookup_status",3)
context.commit("update_lookup_error_message",e.message )
}
},
async delete_note(context,prm) {
context.commit("update_lookup_status",1)
try {
prm.token = one_token()
let resp= await api.delete_note(prm)
if (resp.status != "OK") {
context.commit("update_lookup_status",3)
context.commit("update_lookup_error_message",resp.message)
} else {
context.commit("update_lookup_status",2)
context.commit("update_lookup_error_message","")
let xmsg = "Nota nomor <span style='color:red'>"+prm.nota.note_number+"</span> telah dihapus"
context.commit("update_msg_delete",xmsg)
context.commit("update_note_delete",'')
context.commit("update_nota_delete",{})
}
} catch(e) {
context.commit("update_lookup_status",3)
context.commit("update_lookup_error_message",e.message )
}
}
}
}

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB