Flatten nested repos
This commit is contained in:
256
test/vuex/app-dokter/one-md-request-upload/api/patient.js
Normal file
256
test/vuex/app-dokter/one-md-request-upload/api/patient.js
Normal file
@@ -0,0 +1,256 @@
|
||||
const URL = "/one-api/one-doctor/";
|
||||
|
||||
export async function search(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'requestupload/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 process_request_upload(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'requestupload/process_request_upload', 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 change_reupload(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'requestupload/change_reupload', 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 searchdoctor(token,prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'patient/searchdoctor',{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 searchtest(token,prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'patient/searchtest',{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_promises(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'patient/lookup_promises', 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 getdatadob(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'patient/getdatadob', 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 updatedob(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'patient/updatedob', 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 gettimelinedelivery(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'patient/gettimelinedelivery', 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_promises(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'patient/save_promises', 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 confirm(prm) {
|
||||
try {
|
||||
var resp = await axios.post(URL + 'patient/confirm', 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
|
||||
};
|
||||
}
|
||||
}
|
||||
58
test/vuex/app-dokter/one-md-request-upload/api/payment.js
Normal file
58
test/vuex/app-dokter/one-md-request-upload/api/payment.js
Normal 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
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -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>
|
||||
@@ -0,0 +1,504 @@
|
||||
<template>
|
||||
<div>
|
||||
<v-dialog
|
||||
v-model="xpromisedialog"
|
||||
persistent
|
||||
max-width="30%"
|
||||
>
|
||||
<v-card>
|
||||
<v-card-title
|
||||
class="headline teal white--text pt-2 pb-2"
|
||||
primary-title
|
||||
|
||||
>
|
||||
<h4 dark>Ganti janji hasil</h4>
|
||||
</v-card-title>
|
||||
<v-card-text class="pt-2 pb-2">
|
||||
<v-layout wrap>
|
||||
<v-flex xs12>
|
||||
<v-layout v-for="promise in xpromises" row>
|
||||
<v-flex xs9 pr-1>
|
||||
<v-text-field
|
||||
label="Tanggal"
|
||||
v-model="promise.xdate"
|
||||
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
<v-flex xs3 pl-1>
|
||||
<v-text-field
|
||||
label="Jam"
|
||||
v-model="promise.xtime"
|
||||
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout row>
|
||||
<v-flex xs12 d-flex>
|
||||
<p v-for="error in errors" class="error pl-2 pr-2" style="color:#fff">janji manis jangan kau ingkari, janji hasil {{error.xdate}} {{error.xtime}} , masih salah dong formatnya (dd-mm-yyyy hh:mm)</p>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card-text>
|
||||
<v-divider></v-divider>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn
|
||||
color="cyan"
|
||||
flat
|
||||
@click="doSavePromise()"
|
||||
>
|
||||
Simpan
|
||||
</v-btn>
|
||||
<v-btn
|
||||
color="black"
|
||||
flat
|
||||
@click="xpromisedialog = false"
|
||||
>
|
||||
Tutup
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
<v-layout class="fill-height" column>
|
||||
<v-card class="mb-2 pa-2 searchbox" >
|
||||
<v-layout row>
|
||||
<v-flex xs3>
|
||||
<v-select class="xs3 mini-select ma-1"
|
||||
:items="filters"
|
||||
item-text="name"
|
||||
return-object
|
||||
v-model="selected_filter"
|
||||
label="Filter" outline hide-details></v-select>
|
||||
</v-flex>
|
||||
<v-flex xs3>
|
||||
<v-text-field class="xs3 ma-1"
|
||||
label="Cari ..."
|
||||
placeholder="Nama / No Reg"
|
||||
outline
|
||||
v-on:keyup.enter="searchPatient"
|
||||
v-model="searchnamelab"
|
||||
hide-details
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
<v-flex xs3>
|
||||
<v-select class="xs3 mini-select ma-1" :items="statuses"
|
||||
item-text="name"
|
||||
return-object
|
||||
v-model="status"
|
||||
label="Status" outline hide-details></v-select>
|
||||
</v-flex>
|
||||
<!--<span @click="searchPatient" class="icon-medium-fill-base xs1 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" >
|
||||
<tr :class="{notlunas: props.item.flaglunas=='N'} ">
|
||||
<td class="text-xs-left pa-2 'cito': isCito(props.item)" v-bind:class="{'':isSelected(props.item),'cito': props.item.T_OrderHeaderIsCito === 'Y'}" @click="selectMe(props.item)">
|
||||
{{ props.item.T_OrderHeaderLabNumber}} <v-btn @click="patientComing(props.item)" v-if="props.item.last_status < 7 && notToday(props.item)" small style="min-width:10px;margin:0" flat color="teal"><v-icon>assignment_returned</v-icon></v-btn>
|
||||
</td>
|
||||
<td class="text-xs-left pa-2 'cito': isCito(props.item)" v-bind:class="{'':isSelected(props.item),'cito': props.item.T_OrderHeaderIsCito === 'Y'}" @click="selectMe(props.item)">{{ props.item.M_PatientName}}</td>
|
||||
<td class="text-xs-left pa-2 'cito': isCito(props.item)" v-bind:class="{'':isSelected(props.item),'cito': props.item.T_OrderHeaderIsCito === 'Y'}" @click="selectMe(props.item)">{{ props.item.M_CompanyName}} : {{ props.item.M_MouName}}</td>
|
||||
<td class="text-xs-left pa-2 'cito': isCito(props.item)" v-bind:class="{'':isSelected(props.item),'cito': props.item.T_OrderHeaderIsCito === 'Y'}" @click="selectMe(props.item)"
|
||||
v-html="(props.item.janji)">
|
||||
</td>
|
||||
<td class="text-xs-left pa-2 'cito': isCito(props.item) " v-bind:class="{'':isSelected(props.item) , 'cito': props.item.T_OrderHeaderIsCito === 'Y'}" @click="selectMe(props.item)"
|
||||
v-html="splittest(props.item.test)" />
|
||||
</td>
|
||||
<td class="text-xs-left pa-2 'cito': isCito(props.item)" v-bind:class="{'':isSelected(props.item),'cito': props.item.T_OrderHeaderIsCito === 'Y'}" @click="selectMe(props.item)">{{ props.item.delivery}}</td>
|
||||
<td class="text-xs-left pa-2 'cito': isCito(props.item)" v-bind:class="{'':isSelected(props.item),'cito': props.item.T_OrderHeaderIsCito === 'Y'}" @click="selectMe(props.item)">{{ props.item.status}}
|
||||
<span v-if="props.item.unpaid > 0">
|
||||
{{ number_format(props.item.unpaid) }}
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
</template>
|
||||
</v-data-table>
|
||||
<v-divider></v-divider>
|
||||
<v-layout>
|
||||
<v-flex >
|
||||
<v-pagination
|
||||
style="margin-top:10px;margin-bottom:10px"
|
||||
v-model="curr_page"
|
||||
:length="xtotal_page" >
|
||||
</v-pagination>
|
||||
</v-flex>
|
||||
<v-flex >
|
||||
<p style="margin-top:13px;color: rgba(0,0,0,0.54);font-size:12px;">Menampilkan <span class="red--text">{{xtotal_patients}}</span> dari <span class="red--text">{{xtotalpatients}}</span> total data</p>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card>
|
||||
<one-dialog-alert :status="openalertnopay" :msg="msgalertnopay" @forget-dialog-alert="forgetAlertNoPay()" @close-dialog-alert="closeAlertNoPay()"></one-dialog-alert>
|
||||
</v-layout>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.notlunas {
|
||||
color: red;
|
||||
}
|
||||
.cito {
|
||||
color: white;
|
||||
background-color:#FFC107;
|
||||
}
|
||||
.citoo {
|
||||
color: red;
|
||||
}
|
||||
|
||||
span.xtd {
|
||||
margin-right:10px;
|
||||
}
|
||||
.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;
|
||||
}
|
||||
|
||||
.v-messages{
|
||||
min-height:0px!important;
|
||||
}
|
||||
|
||||
</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",{
|
||||
filter:this.selected_filter.id,
|
||||
search: this.searchnamelab,
|
||||
status: this.status.value,
|
||||
current_page:1,
|
||||
lastidx:0
|
||||
})
|
||||
},
|
||||
methods : {
|
||||
number_format(val) {
|
||||
return numeral(val).format('0,0');
|
||||
},
|
||||
notToday(item){
|
||||
return item.order_date !== moment(new Date()).format('YYYY-MM-DD')
|
||||
},
|
||||
splittest(inp){
|
||||
let a_test = inp.split(',')
|
||||
let s_test = ''
|
||||
for(let i=0;i<a_test.length;i++) {
|
||||
let test = a_test[i]
|
||||
let a_cito = test.split('^')
|
||||
s_test += '<span class="xtd '
|
||||
if (a_cito[1] == 'Y') s_test += 'citoo'
|
||||
s_test += '" >'
|
||||
s_test += a_cito[0] + '</span>'
|
||||
}
|
||||
return s_test
|
||||
},
|
||||
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.T_OrderHeaderID == this.$store.state.patient.selected_patient.T_OrderHeaderID
|
||||
},
|
||||
isCito(p) {
|
||||
return p.cito== 1
|
||||
},
|
||||
searchPatient() {
|
||||
this.$store.dispatch("patient/search",{
|
||||
filter:this.selected_filter.id,
|
||||
search: this.searchnamelab,
|
||||
status: this.status.value,
|
||||
current_page:1,
|
||||
lastidx:0
|
||||
})
|
||||
},
|
||||
selectMe(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_lastidx",idx)
|
||||
this.$store.commit("patient/update_selected_patient",pat)
|
||||
},
|
||||
closeAlertNoPay(){
|
||||
this.$store.commit("patient/update_open_alert_no_pay",false)
|
||||
},
|
||||
forgetAlertNoPay(){
|
||||
var xval = this.$store.state.payment.types
|
||||
var valpay = 0
|
||||
xval.forEach(function(obj){
|
||||
obj.leftvalue = 0
|
||||
obj.rightvalue = 0
|
||||
})
|
||||
this.$store.commit("payment/update_total_payment",0)
|
||||
this.$store.commit("patient/update_open_alert_no_pay",false)
|
||||
},
|
||||
patientComing(patient){
|
||||
var prm = patient
|
||||
this.$store.dispatch("patient/lookup_promises",prm)
|
||||
},
|
||||
doSavePromise(){
|
||||
let arrx = this.$store.state.patient.promises
|
||||
var errors = []
|
||||
arrx.forEach(function(arr) {
|
||||
var xDate = moment(arr.xdate, 'DD-MM-YYYY', true)
|
||||
var isValidDate = xDate.isValid()
|
||||
var xTime = moment(arr.xtime, 'HH:mm', true)
|
||||
var isValidTime = xTime.isValid()
|
||||
if(!isValidDate){
|
||||
errors.push(arr)
|
||||
}
|
||||
if(!isValidTime){
|
||||
errors.push(arr)
|
||||
}
|
||||
})
|
||||
|
||||
this.errors = errors
|
||||
if(errors.length === 0){
|
||||
var prm = {
|
||||
data : arrx,
|
||||
orderid:this.$store.state.patient.selected_patient.T_OrderHeaderID
|
||||
}
|
||||
prm.search = {
|
||||
filter:this.selected_filter.id,
|
||||
search: this.searchnamelab,
|
||||
status: this.status.value,
|
||||
current_page:this.$store.state.patient.current_page,
|
||||
lastidx:this.$store.state.patient.lastidx
|
||||
}
|
||||
this.$store.dispatch("patient/savepromises",prm)
|
||||
}
|
||||
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
xpromisedialog:{
|
||||
get() {
|
||||
return this.$store.state.patient.promise_dialog
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("patient/update_promise_dialog",val)
|
||||
}
|
||||
},
|
||||
xpromises: {
|
||||
get() {
|
||||
return this.$store.state.patient.promises
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("patient/update_promises",val)
|
||||
}
|
||||
},
|
||||
xstartdate:{
|
||||
get() {
|
||||
return this.$store.state.patient.start_date
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("patient/update_start_date",val)
|
||||
}
|
||||
},
|
||||
xenddate:{
|
||||
get() {
|
||||
return this.$store.state.patient.end_date
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("patient/update_end_date",val)
|
||||
}
|
||||
},
|
||||
searchnamelab:{
|
||||
get() {
|
||||
return this.$store.state.patient.search
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("patient/update_search",val)
|
||||
//this.searchPatient()
|
||||
}
|
||||
},
|
||||
statuses(){
|
||||
return this.$store.state.patient.statuses
|
||||
},
|
||||
status:{
|
||||
get() {
|
||||
return this.$store.state.patient.selected_status
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("patient/update_selected_status",val)
|
||||
this.searchPatient()
|
||||
}
|
||||
},
|
||||
startDateFormatted () {
|
||||
return this.formatDate(this.xstartdate)
|
||||
},
|
||||
endDateFormatted () {
|
||||
return this.formatDate(this.xenddate)
|
||||
},
|
||||
isLoading() {
|
||||
return this.$store.state.patient.search_status == 1
|
||||
},
|
||||
patients() {
|
||||
return this.$store.state.patient.patients
|
||||
},
|
||||
openalertnopay:{
|
||||
get() {
|
||||
return this.$store.state.patient.open_alert_no_pay
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("patient/update_open_alert_no_pay",false)
|
||||
}
|
||||
},
|
||||
msgalertnopay(){
|
||||
return this.$store.state.patient.msg_alert_no_pay
|
||||
},
|
||||
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",{
|
||||
filter:this.selected_filter.id,
|
||||
search: this.searchnamelab,
|
||||
status: this.status.value,
|
||||
current_page:val,
|
||||
lastidx:this.$store.state.patient.lastidx
|
||||
})
|
||||
}
|
||||
},
|
||||
xtotal_page: {
|
||||
get() {
|
||||
return this.$store.state.patient.total_page
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("patient/update_total_page",val)
|
||||
}
|
||||
},
|
||||
|
||||
xtotal_patients: {
|
||||
get() {
|
||||
return this.$store.state.patient.total_patient
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("patient/update_total_patient",val)
|
||||
}
|
||||
},
|
||||
|
||||
xtotalpatients() {
|
||||
return this.$store.state.patient.total_patients
|
||||
},
|
||||
xtotalfilterpatients() {
|
||||
return this.$store.state.patient.total_filter_patients
|
||||
},
|
||||
filters: {
|
||||
get() {
|
||||
return this.$store.state.patient.filters
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("patient/update_filters",val)
|
||||
}
|
||||
},
|
||||
selected_filter: {
|
||||
get() {
|
||||
return this.$store.state.patient.selected_filter
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("patient/update_selected_filter",val)
|
||||
this.searchPatient()
|
||||
}
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
items: [],
|
||||
menustartdate:false,
|
||||
menuenddate:false,
|
||||
errors:[],
|
||||
headers: [
|
||||
{
|
||||
text: "NO REG",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "lab",
|
||||
width: "10%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "NAMA",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "name",
|
||||
width: "15%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "AGREEMENT",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "name",
|
||||
width: "10%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
|
||||
{
|
||||
text: "JANJI HASIL",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "status",
|
||||
width: "15%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
|
||||
{
|
||||
text: "PEMERIKSAAN",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "status",
|
||||
width: "30%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
|
||||
{
|
||||
text: "PENGIRIMAN",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "status",
|
||||
width: "10%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
},
|
||||
|
||||
{
|
||||
text: "STATUS",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "status",
|
||||
width: "10%",
|
||||
class: "pa-2 blue lighten-3 white--text"
|
||||
}
|
||||
],
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
File diff suppressed because it is too large
Load Diff
95
test/vuex/app-dokter/one-md-request-upload/index.php
Normal file
95
test/vuex/app-dokter/one-md-request-upload/index.php
Normal file
@@ -0,0 +1,95 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<title>One</title>
|
||||
<link rel="stylesheet" href="../../../../libs/vendor/css/google-fonts.css">
|
||||
<link rel="stylesheet" href="../../../../libs/vendor/css/icomoon-fonts.css">
|
||||
<link rel="stylesheet" href="../../../../libs/vendor/css/vuetify.min.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div v-cloak id="app">
|
||||
<v-app id="smartApp" >
|
||||
<one-navbar></one-navbar>
|
||||
<v-content style="background:#F5E8DF!important" >
|
||||
<v-container fluid fill-height class="pl-1 pr-1 pt-2 pb-2">
|
||||
<v-layout row wrap >
|
||||
<v-flex xs12 class="left" fill-height pa-1>
|
||||
<one-patient-list></one-patient-list>
|
||||
</v-flex>
|
||||
<!-- <v-flex xs6 class="right" fill-height pa-1> -->
|
||||
<!-- komponen kanan -->
|
||||
<!-- <one-fo-cashier-payment></one-fo-cashier-payment>-->
|
||||
<!-- </v-flex> -->
|
||||
</v-layout>
|
||||
</v-container>
|
||||
</v-content>
|
||||
<one-footer> </one-footer>
|
||||
</v-app>
|
||||
</div>
|
||||
|
||||
<!-- Vendor -->
|
||||
<script src="../../../../libs/vendor/moment.min.js"></script>
|
||||
<script src="../../../../libs/vendor/numeral.min.js"></script>
|
||||
<script src="../../../../libs/vendor/moment-locale-id.js"></script>
|
||||
<script src="../../../../libs/vendor/lodash.js"></script>
|
||||
<script src="../../../../libs/vendor/axios.min.js"></script>
|
||||
<script src="../../../../libs/vendor/vue.js"></script>
|
||||
<script src="../../../../libs/vendor/vuex.js"></script>
|
||||
<script src="../../../../libs/vendor/vuetify.js"></script>
|
||||
<script src="../../../../libs/vendor/httpVueLoader.js"></script>
|
||||
<script src="../../../../libs/one_global.js"></script>
|
||||
<script src="../../../../libs/one_print_barcode.js"></script>
|
||||
<script src="../../../../libs/one_print_robo.js"></script>
|
||||
<!-- App Script -->
|
||||
<?php
|
||||
$ts = "?ts=" . Date("ymdhis");
|
||||
?>
|
||||
<script type="module">
|
||||
window.calculate_age = function (inp_dob) {
|
||||
var now = moment(new Date())
|
||||
var dob = moment(new Date(inp_dob))
|
||||
var year = now.diff(dob,'years')
|
||||
dob.add(year,'years')
|
||||
var month = now.diff(dob,'months')
|
||||
dob.add(month,'months')
|
||||
var day = now.diff(dob,'days')
|
||||
if (isNaN(year)) return ''
|
||||
return `${year} tahun ${month} bulan ${day} hari`
|
||||
}
|
||||
|
||||
|
||||
import { store } from './store.js<?php echo $ts ?>';
|
||||
//for testing
|
||||
window.store = store;
|
||||
new Vue({
|
||||
store,
|
||||
el: '#app',
|
||||
methods: {
|
||||
tab_selected : function(tab) {
|
||||
return this.$store.state.tab_selected == tab
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'one-navbar': httpVueLoader('../../../../apps/components/oneNavbarComponent.vue'),
|
||||
'one-footer': httpVueLoader('../../../../apps/components/oneFooter.vue'),
|
||||
'one-patient-list': httpVueLoader('./components/onePatientList.vue')
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<style>
|
||||
[v-cloak] {
|
||||
display: none
|
||||
}
|
||||
.left {
|
||||
}
|
||||
.right {
|
||||
}
|
||||
</style>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
536
test/vuex/app-dokter/one-md-request-upload/modules/patient.js
Normal file
536
test/vuex/app-dokter/one-md-request-upload/modules/patient.js
Normal file
@@ -0,0 +1,536 @@
|
||||
// 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:[{name:'Belum Lunas',value:'N'},{name:'Lunas',value:'Y'}, {name:'Semua',value:'A'}],
|
||||
selected_status:{name:'Belum Lunas',value:'N'},
|
||||
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'},
|
||||
doctors:[],
|
||||
selected_doctor:{id:0,name:'Semua'},
|
||||
dialog_timeline_delivery:false,
|
||||
timeline_delivery:[],
|
||||
dialog_update_dob:false,
|
||||
show_form_dob:'N',
|
||||
data_patient:{},
|
||||
alert_success: false,
|
||||
msg_success: "",
|
||||
filter_tests:[],
|
||||
selected_filter_test:{}
|
||||
},
|
||||
mutations: {
|
||||
update_filter_tests(state, val) {
|
||||
state.filter_tests = val
|
||||
},
|
||||
update_selected_filter_test(state, val) {
|
||||
state.selected_filter_test = val
|
||||
},
|
||||
update_alert_success(state, val) {
|
||||
state.alert_success = val
|
||||
},
|
||||
update_msg_success(state, val) {
|
||||
state.msg_success = val
|
||||
},
|
||||
update_data_patient(state, val) {
|
||||
state.data_patient = val
|
||||
},
|
||||
update_show_form_dob(state, val) {
|
||||
state.show_form_dob = val
|
||||
},
|
||||
update_dialog_update_dob(state, val) {
|
||||
state.dialog_update_dob = val
|
||||
},
|
||||
update_timeline_delivery(state, val) {
|
||||
state.timeline_delivery = val
|
||||
},
|
||||
update_dialog_timeline_delivery(state, val) {
|
||||
state.dialog_timeline_delivery = val
|
||||
},
|
||||
update_companies(state, val) {
|
||||
state.companies = val
|
||||
},
|
||||
update_selected_company(state, val) {
|
||||
state.selected_company = val
|
||||
},
|
||||
update_doctors(state, val) {
|
||||
state.doctors = val
|
||||
},
|
||||
update_selected_doctor(state, val) {
|
||||
state.selected_doctor = val
|
||||
},
|
||||
update_dialog_barcode(state, val) {
|
||||
state.dialog_barcode = val
|
||||
},
|
||||
update_barcodes(state, val) {
|
||||
state.barcodes = 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.records
|
||||
state.total_patient = data.total
|
||||
state.total_page = data.total
|
||||
state.total_patients = data.total
|
||||
state.total_filter_patients = data.total_filter
|
||||
},
|
||||
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
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
async search(context, prm) {
|
||||
context.commit("update_search_patient", 1)
|
||||
try {
|
||||
console.log(prm)
|
||||
prm.token = one_token()
|
||||
let data = {
|
||||
records: [],
|
||||
total: 0,
|
||||
total_filter: 0
|
||||
}
|
||||
context.commit("update_patients", data)
|
||||
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,
|
||||
total_filter: resp.data.total_filter
|
||||
}
|
||||
console.log("")
|
||||
console.log(data.records)
|
||||
context.commit("update_patients", data)
|
||||
context.commit("update_total_page", data.total)
|
||||
context.commit("update_total_patients_all", resp.data.total_all)
|
||||
|
||||
// if(prm.lastidx === -1){
|
||||
// context.commit("update_selected_patient", data.records[0])
|
||||
// if(!_.isEmpty(data.records[0]))
|
||||
// context.commit("payment/update_notes",data.records[0].notes,{root:true})
|
||||
// else
|
||||
// context.commit("payment/update_notes",[],{root:true})
|
||||
// }
|
||||
// else{
|
||||
// context.commit("update_selected_patient", data.records[prm.lastidx])
|
||||
// context.commit("payment/update_notes",data.records[prm.lastidx].notes,{root:true})
|
||||
// }
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_search_patient", 3)
|
||||
context.commit("update_search_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
async process_request_upload(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
prm.RequestUploadT_OrderHeaderID
|
||||
prm.RequestUploadOrderPatientID
|
||||
|
||||
let resp = await api.process_request_upload(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 xsearch = prm.search
|
||||
|
||||
// var xsearch = prm.dataProcess.search
|
||||
// context.dispatch("search",xsearch)
|
||||
|
||||
var prmSearch = {
|
||||
startdate: prm.startdate,
|
||||
enddate: prm.enddate,
|
||||
search: prm.search
|
||||
}
|
||||
|
||||
context.dispatch("search",prmSearch)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
|
||||
async change_reupload(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
prm.RequestUploadT_OrderHeaderID
|
||||
prm.RequestUploadOrderPatientID
|
||||
|
||||
let resp = await api.change_reupload(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 xsearch = prm.search
|
||||
|
||||
// var xsearch = prm.dataProcess.search
|
||||
// context.dispatch("search",xsearch)
|
||||
|
||||
|
||||
var prmSearch = {
|
||||
startdate: prm.startdate,
|
||||
enddate: prm.enddate,
|
||||
search: prm.search
|
||||
}
|
||||
|
||||
context.dispatch("search",prmSearch)
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_save_status", 3)
|
||||
context.commit("update_save_error_message", e.message)
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
|
||||
async lookup_promises(context,prm) {
|
||||
context.commit("update_lookup_status",1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp= await api.lookup_promises(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_promises",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 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 getdatadob(context,prm) {
|
||||
context.commit("update_lookup_status",1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp= await api.getdatadob(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_data_patient",data.records)
|
||||
context.commit("update_show_form_dob",resp.data.status)
|
||||
context.commit("update_dialog_update_dob",true)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_lookup_status",3)
|
||||
context.commit("update_lookup_error_message",e.message )
|
||||
}
|
||||
},
|
||||
async gettimelinedelivery(context,prm) {
|
||||
context.commit("update_lookup_status",1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp= await api.gettimelinedelivery(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_timeline_delivery",data.records)
|
||||
context.commit("update_dialog_timeline_delivery",true)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_lookup_status",3)
|
||||
context.commit("update_lookup_error_message",e.message )
|
||||
}
|
||||
},
|
||||
async savepromises(context, prm) {
|
||||
context.commit("update_save_status", 1)
|
||||
try {
|
||||
prm.token = one_token()
|
||||
let resp = await api.save_promises(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
|
||||
}
|
||||
context.commit("update_promises",data.records)
|
||||
context.commit("update_promise_dialog",false)
|
||||
var xsearch = prm.search
|
||||
|
||||
context.dispatch("search",xsearch)
|
||||
}
|
||||
} 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 searchdoctor(context,prm) {
|
||||
context.commit("update_autocomplete_status",1)
|
||||
try {
|
||||
let resp= await api.searchdoctor(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_doctors",resp.data.records)
|
||||
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_autocomplete_status",3)
|
||||
}
|
||||
},
|
||||
async searchtest(context,prm) {
|
||||
context.commit("update_autocomplete_status",1)
|
||||
try {
|
||||
let resp= await api.searchtest(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_filter_tests",resp.data.records)
|
||||
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_autocomplete_status",3)
|
||||
}
|
||||
},
|
||||
async updatedob(context,prm) {
|
||||
context.commit("update_autocomplete_status",1)
|
||||
try {
|
||||
prm.orderid = context.state.selected_patient.T_OrderHeaderID
|
||||
prm.token = one_token()
|
||||
let resp= await api.updatedob(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_dialog_update_dob",false)
|
||||
var msg = "Terima kasih telah meng-update tanggal lahir, jadi gak bingung dong kalo mau ultah"
|
||||
if(prm.status === 'Y'){
|
||||
msg = "Terima kasih, Mimin akan melanjutkan request ini ke bagian proses"
|
||||
}
|
||||
context.commit("update_msg_success",msg)
|
||||
context.commit("update_alert_success",true)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_autocomplete_status",3)
|
||||
}
|
||||
},
|
||||
async confirm(context,prm) {
|
||||
context.commit("update_autocomplete_status",1)
|
||||
try {
|
||||
prm.orderid = context.state.selected_patient.T_OrderHeaderID
|
||||
prm.token = one_token()
|
||||
let resp= await api.confirm(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_autocomplete_status",3)
|
||||
} else {
|
||||
context.commit("update_autocomplete_status",2)
|
||||
|
||||
var msg = "Berhasil dikonfirmasi, dan siap diupload"
|
||||
if(prm.status === 'R')
|
||||
msg = "Berhasil siap diupload ulang"
|
||||
context.commit("update_msg_success",msg)
|
||||
context.commit("update_alert_success",true)
|
||||
context.dispatch("search",prm.table)
|
||||
}
|
||||
} catch(e) {
|
||||
context.commit("update_autocomplete_status",3)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
149
test/vuex/app-dokter/one-md-request-upload/modules/payment.js
Normal file
149
test/vuex/app-dokter/one-md-request-upload/modules/payment.js
Normal 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 )
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
29
test/vuex/app-dokter/one-md-request-upload/store.js
Normal file
29
test/vuex/app-dokter/one-md-request-upload/store.js
Normal 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)
|
||||
}
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user