Flatten nested repos
This commit is contained in:
@@ -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,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>
|
||||
{{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>
|
||||
{{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> — <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>
|
||||
@@ -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>
|
||||
Reference in New Issue
Block a user