Flatten nested repos

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

View File

@@ -0,0 +1,444 @@
<template>
<v-layout class="fill-height" column>
<!--<v-card class="pa-2 mb-2">
<v-layout row>
<v-flex xs12>
<v-btn :loading="loading_download" block class="text-md-center" @click="download_data()" color="teal" dark>
DOWNLOAD DATA ORDER
</v-btn>
</v-flex>
</v-layout>
</v-card>-->
<v-card class="mb-2 pa-2 searchbox">
<v-layout align-center>
<span title="kembali ke penyerahan hasil" v-if="show_btn_back" @click="backToFoReceiver()"
class="icon-medium-fill-base xs1 white--text indigo darken-1"><v-icon dark>reply</v-icon></span>
<v-menu ref="menustartdate" v-model="menustartdate" :close-on-content-click="false" :nudge-right="0" lazy
transition="scale-transition" offset-y full-width max-width="290px" min-width="290px">
<template v-slot:activator="{ on }">
<v-text-field v-model="startDateFormatted" label="Tanggal Push Order" readonly hide-details
class="xs3 ma-1" outline v-on="on" @blur="deFormatedDate(startDateFormatted)"></v-text-field>
</template>
<v-date-picker v-model="xstartdate" no-title @input="menustartdate = false"></v-date-picker>
</v-menu>
<!--<v-menu
ref="menus"
v-model="menuenddate"
:close-on-content-click="false"
:nudge-right="0"
lazy
transition="scale-transition"
offset-y
full-width
max-width="290px"
min-width="290px"
>
<template v-slot:activator="{ on }">
<v-text-field
v-model="endDateFormatted"
label="Tanggal Akhir"
readonly
hide-details
class="xs3 ma-1"
outline
v-on="on"
@blur="deFormatedDate(startDateFormatted)"
></v-text-field>
</template>
<v-date-picker v-model="xenddate" no-title @input="menuenddate = false"></v-date-picker>
</v-menu> -->
<v-text-field class="xs3 ma-1" label="Cari ..." placeholder="Nama / No Reg" v-on:keyup.enter="searchPatient"
outline v-model="searchnamelab" hide-details></v-text-field>
<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>
<span @click="searchPatient" class="icon-medium-fill-base xs1 white--text warning iconsearch-search"></span>
</v-layout>
</v-card>
<v-card>
<v-layout row>
<v-flex xs12 pl-2 pr-2 pt-2 pb-2>
<v-data-table :headers="headers" :items="patients" :loading="isLoading" hide-actions class="elevation-1">
<template slot="items" slot-scope="props">
<td class="text-xs-center pa-2" v-bind:class="{ 'amber lighten-4': isSelected(props.item) }"
@click="selectMe(props.item)">
{{ props.item.push_date }}
</td>
<td class="text-xs-left pa-2" v-bind:class="{ 'amber lighten-4': isSelected(props.item) }"
@click="selectMe(props.item)">
<p style="color:#800000" class="font-weight-bold mb-0">{{ props.item.T_OrderHeaderLabNumber }}
</p>
<kbd v-if="props.item.Api_PushLISLabNumber && props.item.Api_PushStatus === 'SUCCESS'"
class="font-weight-black caption mb-0">{{ props.item.Api_PushLISLabNumber }}</kbd>
<p v-if="props.item.Api_PushStatus === 'ERROR'"
class="font-weight-black red--text caption mb-0">Gagal push order
(x{{ props.item.Api_PushRetry }})</p>
<p v-if="props.item.Api_PushStatus === ''" class="font-weight-bold grey--text caption mb-0">
Belum melakukan push order</p>
<p v-if="props.item.Api_PushStatus === 'SUCCESS'"
class="font-weight-bold green--text caption mb-0">
Push order berhasil</p>
<p v-if="props.item.Api_PushStatus !== 'SUCCESS' && props.item.Api_PushStatus !== ''"
class="font-weight-bold red--text caption mb-0">
Push order gagal</p>
</td>
<td class="text-xs-left pa-2" v-bind:class="{ 'amber lighten-4': isSelected(props.item) }"
@click="selectMe(props.item)">
{{ props.item.M_PatientName }}
</td>
<td class="text-xs-left pa-2" v-bind:class="{ 'amber lighten-4': isSelected(props.item) }"
@click="selectMe(props.item)">
<p class="mb-0">{{ props.item.nik }}</p>
<!--<p v-if="props.item.order_nik_yankes" class="font-weight-black caption mb-0">{{ props.item.order_nik_yankes }}</p>-->
</td>
<td class="text-xs-center pa-2" v-bind:class="{ 'amber lighten-4': isSelected(props.item) }"
@click="selectMe(props.item)">
<v-btn v-if="props.item.Api_PushStatus === 'ERROR' || props.item.Api_PushStatus === '' || props.item.Api_PushStatus !== 'SUCCESS'"
title="push order" style="min-width:40px" small class=" text-md-center"
@click="rePushOrder(props.item)" color="warning" dark>
<v-icon small>cached</v-icon>
</v-btn>
<v-btn depressed v-if="props.item.Api_PushStatus === 'SUCCESS'" title="terkirim"
style="min-width:40px" small class=" text-md-center" color="success" dark>
<v-icon small>check</v-icon>
</v-btn>
</td>
</template>
</v-data-table>
<v-divider></v-divider>
<v-pagination style="margin-top:10px;margin-bottom:10px" v-model="curr_page"
:length="xtotal_page"></v-pagination>
</v-flex>
</v-layout>
</v-card>
<one-dialog-alert :status="openalertnopay" :msg="msgalertnopay" @forget-dialog-alert="forgetAlertNoPay()"
@close-dialog-alert="closeAlertNoPay()"></one-dialog-alert>
</v-layout>
</template>
<style scoped>
.searchbox .v-input.v-text-field .v-input__slot {
min-height: 40px;
}
.searchbox .v-btn {
min-height: 40px;
}
table.v-table tbody td,
table.v-table tbody th {
height: 40px;
}
table.v-table thead tr {
height: 40px;
}
.v-messages {
min-height: 0px !important;
}
table,
td,
th {
border: .5px solid rgba(0, 0, 0, .12);
text-align: left;
}
table {
border-collapse: collapse;
width: 100%;
}
</style>
<script>
module.exports = {
components: {
'one-dialog-info': httpVueLoader('../../common/oneDialogInfo.vue'),
'one-dialog-alert': httpVueLoader('../../common/oneDialogAlert.vue')
},
mounted() {
var url_string = window.location.href
var url = new URL(url_string);
var id = url.searchParams.get("id")
var xdate = url.searchParams.get("xdate")
var type = url.searchParams.get("type")
if (id) {
this.xstartdate = xdate
this.xenddate = xdate
this.searchnamelab = id
this.status = { name: 'Semua', value: 'A' }
this.show_btn_back = true
this.type_back_btn = type
}
this.$store.dispatch("patient/search", {
startdate: this.xstartdate,
enddate: this.xenddate,
search: this.searchnamelab,
status: this.status.value,
current_page: 1,
lastidx: 0
})
},
methods: {
rePushOrder(pat) {
this.$store.dispatch("patient/rePushOrder", pat);
},
download_data() {
this.$store.dispatch("patient/download_data", {});
},
thr_search_company: _.debounce(function () {
this.$store.dispatch("patient/searchcompany", this.search_company);
}, 2000),
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
},
searchPatient() {
this.$store.dispatch("patient/search", {
startdate: this.xstartdate,
enddate: this.xenddate,
search: this.searchnamelab,
status: this.status.value,
current_page: 1,
lastidx: this.$store.state.patient.lastidx
})
},
selectMe(pat) {
this.$store.commit("patient/update_selected_patient", pat)
let patients = this.$store.state.patient.patients
patients.forEach(function (obj, index) {
if (obj.T_OrderHeaderID == pat.T_OrderHeaderID) {
this.$store.commit("patient/update_lastidx", index)
}
})
//this.$store.dispatch("patient/getlogs", {})
},
editorder(pat) {
this.$store.commit("test/update_orderid", pat.T_OrderHeaderID)
this.$store.commit("test/update_mouid", pat.T_OrderHeaderM_MouID)
console.log('edit order')
this.$store.commit("test/update_test_dialog", true)
this.$store.commit("test/update_test_all", [])
this.$store.dispatch("test/lookup", { orderid: pat.T_OrderHeaderID })
this.$store.dispatch("test/lookup_promises", { orderid: pat.T_OrderHeaderID })
this.$store.commit("test/update_test_message", "")
this.$store.commit("test/update_save_status", 0)
this.$store.commit("test/update_save_status_verification", 0)
this.$store.commit("test/update_show_cito_dropdown", "N")
this.$store.commit("test/update_selected_cito", {})
this.$store.commit("test/update_test_dialog", true)
},
closeAlertNoPay() {
this.$store.commit("patient/update_open_alert_no_pay", false)
},
forgetAlertNoPay() {
var xval = this.$store.state.paymentnew.types
var valpay = 0
xval.forEach(function (obj) {
obj.chex = false
obj.leftvalue = 0
obj.rightvalue = 0
obj.selected_card = { id: 0, name: '' }
obj.selected_edc = { id: 0, name: '' }
})
this.$store.commit("paymentnew/update_total_payment", 0)
this.$store.commit("patient/update_open_alert_no_pay", false)
},
backToFoReceiver() {
this.show_btn_back = false
if (this.type_back_btn === 'fo')
location.replace("/one-ui/test/vuex/one-fo-handover-patient/")
if (this.type_back_btn === 'email')
location.replace("/one-ui/test/vuex/one-fo-handover-email/")
}
},
computed: {
loading_download() {
return this.$store.state.patient.loading_download;
},
xcompanies() {
return this.$store.state.patient.companies;
},
selected_company: {
get() {
return this.$store.state.patient.selected_company;
},
set(val) {
this.$store.commit("patient/update_selected_company", val)
this.searchPatient()
}
},
xstartdate: {
get() {
return this.$store.state.patient.start_date
},
set(val) {
this.$store.commit("patient/update_start_date", val)
this.searchPatient()
}
},
xenddate: {
get() {
return this.$store.state.patient.end_date
},
set(val) {
this.$store.commit("patient/update_end_date", val)
this.searchPatient()
}
},
searchnamelab: {
get() {
return this.$store.state.patient.search
},
set(val) {
this.$store.commit("patient/update_search", val)
}
},
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", {
startdate: this.xstartdate,
enddate: this.xenddate,
search: this.searchnamelab,
status: this.status.value,
current_page: val,
lastidx: 0
})
}
},
xtotal_page: {
get() {
return this.$store.state.patient.total_page
},
set(val) {
this.$store.commit("patient/update_total_page", val)
}
},
},
data() {
return {
items: [],
search_company: "",
menustartdate: false,
menuenddate: false,
show_btn_back: false,
type_back_btn: '',
headers: [
{
text: "TGL. PUSH",
align: "center",
sortable: false,
value: "mr",
width: "15%",
class: "pa-2 warning white--text"
},
{
text: "NO REG",
align: "center",
sortable: false,
value: "lab",
width: "20%",
class: "pa-2 warning white--text"
},
{
text: "NAMA",
align: "center",
sortable: false,
value: "name",
width: "35%",
class: "pa-2 warning white--text"
},
{
text: "NIK",
align: "center",
sortable: false,
value: "status",
width: "10%",
class: "pa-2 warning white--text"
},
{
text: "AKSI",
align: "center",
sortable: false,
value: "aksi",
width: "10%",
class: "pa-2 warning white--text"
}
],
}
},
watch: {
search_company(val, old) {
if (val == old) return;
if (!val) return;
if (val.length < 1) return;
if (this.$store.state.patient.update_autocomplete_status == 1) return;
this.thr_search_company();
}
}
}
</script>

View File

@@ -0,0 +1,441 @@
<template>
<v-layout class="fill-height" column>
<!--<v-card class="pa-2 mb-2">
<v-layout row>
<v-flex xs12>
<v-btn :loading="loading_download" block class="text-md-center" @click="download_data()" color="teal" dark>
DOWNLOAD DATA ORDER
</v-btn>
</v-flex>
</v-layout>
</v-card>-->
<v-card class="mb-2 pa-2 searchbox">
<v-layout align-center>
<span title="kembali ke penyerahan hasil" v-if="show_btn_back" @click="backToFoReceiver()"
class="icon-medium-fill-base xs1 white--text indigo darken-1"><v-icon dark>reply</v-icon></span>
<v-menu ref="menustartdate" v-model="menustartdate" :close-on-content-click="false" :nudge-right="0" lazy
transition="scale-transition" offset-y full-width max-width="290px" min-width="290px">
<template v-slot:activator="{ on }">
<v-text-field v-model="startDateFormatted" label="Tanggal Push Order" readonly hide-details
class="xs3 ma-1" outline v-on="on" @blur="deFormatedDate(startDateFormatted)"></v-text-field>
</template>
<v-date-picker v-model="xstartdate" no-title @input="menustartdate = false"></v-date-picker>
</v-menu>
<!--<v-menu
ref="menus"
v-model="menuenddate"
:close-on-content-click="false"
:nudge-right="0"
lazy
transition="scale-transition"
offset-y
full-width
max-width="290px"
min-width="290px"
>
<template v-slot:activator="{ on }">
<v-text-field
v-model="endDateFormatted"
label="Tanggal Akhir"
readonly
hide-details
class="xs3 ma-1"
outline
v-on="on"
@blur="deFormatedDate(startDateFormatted)"
></v-text-field>
</template>
<v-date-picker v-model="xenddate" no-title @input="menuenddate = false"></v-date-picker>
</v-menu> -->
<v-text-field class="xs3 ma-1" label="Cari ..." placeholder="Nama / No Reg" v-on:keyup.enter="searchPatient"
outline v-model="searchnamelab" hide-details></v-text-field>
<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>
<span @click="searchPatient" class="icon-medium-fill-base xs1 white--text warning iconsearch-search"></span>
</v-layout>
</v-card>
<v-card>
<v-layout row>
<v-flex xs12 pl-2 pr-2 pt-2 pb-2>
<v-data-table :headers="headers" :items="patients" :loading="isLoading" hide-actions class="elevation-1">
<template slot="items" slot-scope="props">
<td class="text-xs-center pa-2" v-bind:class="{ 'amber lighten-4': isSelected(props.item) }"
@click="selectMe(props.item)">
{{ props.item.push_date }}
</td>
<td class="text-xs-left pa-2" v-bind:class="{ 'amber lighten-4': isSelected(props.item) }"
@click="selectMe(props.item)">
<p style="color:#800000" class="font-weight-bold mb-0">{{ props.item.T_OrderHeaderLabNumber }}
</p>
<kbd v-if="props.item.Api_PushLISLabNumber && props.item.Api_PushStatus === 'SUCCESS'"
class="font-weight-black caption mb-0">{{ props.item.Api_PushLISLabNumber }}</kbd>
<p v-if="props.item.Api_PushStatus === 'ERROR'"
class="font-weight-black red--text caption mb-0">Gagal push order
(x{{ props.item.Api_PushRetry }})</p>
<p v-if="props.item.Api_PushStatus === ''" class="font-weight-bold grey--text caption mb-0">
Belum melakukan push order</p>
<p v-if="props.item.Api_PushStatus === 'SUCCESS'"
class="font-weight-bold green--text caption mb-0">
Push order berhasil</p>
</td>
<td class="text-xs-left pa-2" v-bind:class="{ 'amber lighten-4': isSelected(props.item) }"
@click="selectMe(props.item)">
{{ props.item.M_PatientName }}
</td>
<td class="text-xs-left pa-2" v-bind:class="{ 'amber lighten-4': isSelected(props.item) }"
@click="selectMe(props.item)">
<p class="mb-0">{{ props.item.nik }}</p>
<!--<p v-if="props.item.order_nik_yankes" class="font-weight-black caption mb-0">{{ props.item.order_nik_yankes }}</p>-->
</td>
<td class="text-xs-center pa-2" v-bind:class="{ 'amber lighten-4': isSelected(props.item) }"
@click="selectMe(props.item)">
<v-btn v-if="props.item.Api_PushStatus === 'ERROR' || props.item.Api_PushStatus === ''"
title="push order" style="min-width:40px" small class=" text-md-center"
@click="rePushOrder(props.item)" color="warning" dark>
<v-icon small>cached</v-icon>
</v-btn>
<v-btn depressed v-if="props.item.Api_PushStatus === 'SUCCESS'" title="terkirim"
style="min-width:40px" small class=" text-md-center" color="success" dark>
<v-icon small>check</v-icon>
</v-btn>
</td>
</template>
</v-data-table>
<v-divider></v-divider>
<v-pagination style="margin-top:10px;margin-bottom:10px" v-model="curr_page"
:length="xtotal_page"></v-pagination>
</v-flex>
</v-layout>
</v-card>
<one-dialog-alert :status="openalertnopay" :msg="msgalertnopay" @forget-dialog-alert="forgetAlertNoPay()"
@close-dialog-alert="closeAlertNoPay()"></one-dialog-alert>
</v-layout>
</template>
<style scoped>
.searchbox .v-input.v-text-field .v-input__slot {
min-height: 40px;
}
.searchbox .v-btn {
min-height: 40px;
}
table.v-table tbody td,
table.v-table tbody th {
height: 40px;
}
table.v-table thead tr {
height: 40px;
}
.v-messages {
min-height: 0px !important;
}
table,
td,
th {
border: .5px solid rgba(0, 0, 0, .12);
text-align: left;
}
table {
border-collapse: collapse;
width: 100%;
}
</style>
<script>
module.exports = {
components: {
'one-dialog-info': httpVueLoader('../../common/oneDialogInfo.vue'),
'one-dialog-alert': httpVueLoader('../../common/oneDialogAlert.vue')
},
mounted() {
var url_string = window.location.href
var url = new URL(url_string);
var id = url.searchParams.get("id")
var xdate = url.searchParams.get("xdate")
var type = url.searchParams.get("type")
if (id) {
this.xstartdate = xdate
this.xenddate = xdate
this.searchnamelab = id
this.status = { name: 'Semua', value: 'A' }
this.show_btn_back = true
this.type_back_btn = type
}
this.$store.dispatch("patient/search", {
startdate: this.xstartdate,
enddate: this.xenddate,
search: this.searchnamelab,
status: this.status.value,
current_page: 1,
lastidx: 0
})
},
methods: {
rePushOrder(pat) {
this.$store.dispatch("patient/rePushOrder", pat);
},
download_data() {
this.$store.dispatch("patient/download_data", {});
},
thr_search_company: _.debounce(function () {
this.$store.dispatch("patient/searchcompany", this.search_company);
}, 2000),
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
},
searchPatient() {
this.$store.dispatch("patient/search", {
startdate: this.xstartdate,
enddate: this.xenddate,
search: this.searchnamelab,
status: this.status.value,
current_page: 1,
lastidx: this.$store.state.patient.lastidx
})
},
selectMe(pat) {
this.$store.commit("patient/update_selected_patient", pat)
let patients = this.$store.state.patient.patients
patients.forEach(function (obj, index) {
if (obj.T_OrderHeaderID == pat.T_OrderHeaderID) {
this.$store.commit("patient/update_lastidx", index)
}
})
//this.$store.dispatch("patient/getlogs", {})
},
editorder(pat) {
this.$store.commit("test/update_orderid", pat.T_OrderHeaderID)
this.$store.commit("test/update_mouid", pat.T_OrderHeaderM_MouID)
console.log('edit order')
this.$store.commit("test/update_test_dialog", true)
this.$store.commit("test/update_test_all", [])
this.$store.dispatch("test/lookup", { orderid: pat.T_OrderHeaderID })
this.$store.dispatch("test/lookup_promises", { orderid: pat.T_OrderHeaderID })
this.$store.commit("test/update_test_message", "")
this.$store.commit("test/update_save_status", 0)
this.$store.commit("test/update_save_status_verification", 0)
this.$store.commit("test/update_show_cito_dropdown", "N")
this.$store.commit("test/update_selected_cito", {})
this.$store.commit("test/update_test_dialog", true)
},
closeAlertNoPay() {
this.$store.commit("patient/update_open_alert_no_pay", false)
},
forgetAlertNoPay() {
var xval = this.$store.state.paymentnew.types
var valpay = 0
xval.forEach(function (obj) {
obj.chex = false
obj.leftvalue = 0
obj.rightvalue = 0
obj.selected_card = { id: 0, name: '' }
obj.selected_edc = { id: 0, name: '' }
})
this.$store.commit("paymentnew/update_total_payment", 0)
this.$store.commit("patient/update_open_alert_no_pay", false)
},
backToFoReceiver() {
this.show_btn_back = false
if (this.type_back_btn === 'fo')
location.replace("/one-ui/test/vuex/one-fo-handover-patient/")
if (this.type_back_btn === 'email')
location.replace("/one-ui/test/vuex/one-fo-handover-email/")
}
},
computed: {
loading_download() {
return this.$store.state.patient.loading_download;
},
xcompanies() {
return this.$store.state.patient.companies;
},
selected_company: {
get() {
return this.$store.state.patient.selected_company;
},
set(val) {
this.$store.commit("patient/update_selected_company", val)
this.searchPatient()
}
},
xstartdate: {
get() {
return this.$store.state.patient.start_date
},
set(val) {
this.$store.commit("patient/update_start_date", val)
this.searchPatient()
}
},
xenddate: {
get() {
return this.$store.state.patient.end_date
},
set(val) {
this.$store.commit("patient/update_end_date", val)
this.searchPatient()
}
},
searchnamelab: {
get() {
return this.$store.state.patient.search
},
set(val) {
this.$store.commit("patient/update_search", val)
}
},
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", {
startdate: this.xstartdate,
enddate: this.xenddate,
search: this.searchnamelab,
status: this.status.value,
current_page: val,
lastidx: 0
})
}
},
xtotal_page: {
get() {
return this.$store.state.patient.total_page
},
set(val) {
this.$store.commit("patient/update_total_page", val)
}
},
},
data() {
return {
items: [],
search_company: "",
menustartdate: false,
menuenddate: false,
show_btn_back: false,
type_back_btn: '',
headers: [
{
text: "TGL. PUSH",
align: "center",
sortable: false,
value: "mr",
width: "15%",
class: "pa-2 warning white--text"
},
{
text: "NO REG",
align: "center",
sortable: false,
value: "lab",
width: "20%",
class: "pa-2 warning white--text"
},
{
text: "NAMA",
align: "center",
sortable: false,
value: "name",
width: "35%",
class: "pa-2 warning white--text"
},
{
text: "NIK",
align: "center",
sortable: false,
value: "status",
width: "10%",
class: "pa-2 warning white--text"
},
{
text: "AKSI",
align: "center",
sortable: false,
value: "aksi",
width: "10%",
class: "pa-2 warning white--text"
}
],
}
},
watch: {
search_company(val, old) {
if (val == old) return;
if (!val) return;
if (val.length < 1) return;
if (this.$store.state.patient.update_autocomplete_status == 1) return;
this.thr_search_company();
}
}
}
</script>

View File

@@ -0,0 +1,681 @@
<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 grey darken-1 icon-print"></span>
<!--<v-btn small @click="printNote(note,index)" color="primary" dark>
Print
</v-btn>
<v-btn small @click="deleteNote(note,index)" v-if="note.note_active === 'Y'" color="error" dark>
Hapus
</v-btn>-->
</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 ({{xmindp_percent}}%)</div>
</v-flex>
<v-flex xs3>
<div class="text-xs-right warning--text">{{convertMoney(xmindp_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 pl-2 row align-center wrap >
<v-flex xs4 class="pa-1">
<!--<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"/>-->
<v-text-field
label="Jumlah"
:disabled="!type.chex" v-model="type.leftvalue"
@change="updateTotal()"
outline
></v-text-field>
</v-flex>
<v-flex xs4 v-if="type.code === 'CASH' || type.code === 'VOUCHER'" class="pa-1">
<v-text-field
v-if="type.code === 'CASH'"
label="Kembali"
:disabled="!type.chex" v-model="type.rightvalue"
@change="updateTotal()"
outline
></v-text-field>
<v-text-field
v-if="type.code === 'VOUCHER'"
label="Kode Voucher"
:disabled="!type.chex" v-model="type.rightvalue"
outline
></v-text-field>
</v-flex>
<v-flex xs4 v-if="type.code === 'DEBIT' || type.code === 'CREDIT'" class="pa-1">
<v-autocomplete
label="Kartu"
v-model="type.selected_card"
@change="changeCard('card',type.selected_card,index)"
:disabled="!type.chex"
:items="banks"
auto-select-first
no-filter
outline
item-text="name"
item-value="id"
return-object
no-data-text=""
>
</v-autocomplete>
</v-flex>
<v-flex xs4 v-if="type.code === 'DEBIT' || type.code === 'CREDIT'" class="pa-1">
<v-autocomplete
label="EDC"
v-model="type.selected_edc"
@change="changeCard('edc',type.selected_card,index)"
:disabled="!type.chex"
:items="banks"
auto-select-first
outline
no-filter
item-text="name"
item-value="id"
return-object
no-data-text=""
>
</v-autocomplete>
</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 v-if="xdisable_btn_pay === 'N'" @click="pay()" color="warning" dark>
Bayar XXX
</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,
search_card:'',
search_edc:'',
isLoading:false,
fajrihidebtnpay:'Y'
}
},
mounted() {
this.$store.dispatch("payment/lookup_type")
},
computed: {
cards(){
return this.$store.state.payment.cards
},
banks(){
return this.$store.state.payment.banks
},
xmindp_percent(){
if(this.$store.state.patient.selected_patient){
return this.$store.state.patient.selected_patient.mindp_percent
}
else{
return 0
}
},
xmindp_amount(){
if(this.$store.state.patient.selected_patient){
return this.$store.state.patient.selected_patient.mindp_amount
}
else{
return 0
}
},
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){
return this.$store.state.patient.selected_patient.unpaid
}
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
},
xdisable_btn_pay: {
get() {
return this.$store.state.patient.pay_disabled
},
set(val) {
console.log(val)
this.$store.commit("patient/update_pay_disabled",val)
}
},
},
methods : {
changeCard(type,value,idx){
var types = this.$store.state.payment.types
if(type === 'card')
types[idx].selected_card = value
if(type === 'edc')
types[idx].selected_edc = value
},
colorbginp(value){
if(value.chex === false){
return 'grey'
}
else{
return 'white'
}
},
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)
})
console.log('val other '+valother)
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)
var payments = this.$store.state.payment.types
this.xdisable_btn_pay = 'N'
let selected_payments = _.filter(payments, {chex: true})
selected_payments.forEach(function(obj){
console.log(obj.leftvalue)
if(obj.leftvalue === 0 || obj.leftvalue === '0'){
console.log('harusnya Y')
this.xdisable_btn_pay = 'Y'
}
})
console.log(this.xdisable_btn_pay)
},
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){
//this.check_disable_btn_status()
let xobj = this.$store.state.payment.types
xobj[idx].leftvalue = 0
xobj[idx].rightvalue = 0
if((xobj[idx].code === 'DEBIT' || xobj[idx].code === 'CREDIT') && val.chex === false){
xobj[idx].selected_card = {id:0,name:''}
xobj[idx].selected_edc = {id:0,name:''}
}
this.$store.commit("payment/update_types",{records :xobj,total:xobj.length })
// this.check_disable_btn_status()
this.updateTotal()
},
check_disable_btn_status(){
this.xdisable_btn_pay = 'N'
var payments = this.$store.state.payment.types
let selected_payments = _.filter(payments, {chex: true})
console.log(this.xdisable_btn_pay)
selected_payments.forEach(function(obj){
if(obj.leftvalue === 0){
this.xdisable_btn_pay = 'Y'
}
if(obj.code === 'DEBIT' || obj.code === 'CREDIT'){
console.log(obj)
if(obj.selected_card.id === '0' || obj.selected_card.id === 0 || obj.selected_edc.id === '0' || obj.selected_edc.id === 0){
this.xdisable_btn_pay = 'Y'
console.log('oye')
console.log(this.xdisable_btn_pay)
}
}
})
},
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)
},
thr_search_card: _.debounce( function () {
this.$store.dispatch("payment/searchcard",this.search_card)
},2000)
},
watch: {
search_card(val,old) {
if (val == old ) return
if (! val) return
if (val.length < 1 ) return
if (this.$store.state.payment.update_lookup_status == 1 ) return
this.thr_search_card()
}
}
}
</script>

View File

@@ -0,0 +1,781 @@
<template>
<div>
<v-layout row>
<v-flex xs12>
<v-card >
<v-card-title class="primary white--text">
<span class="title">Response</span>
</v-card-title>
<v-card-text>
<blockquote v-if="_.isEmpty(selectedpatient)" class="blockquote">Anda belum pilih pasien di listing sebelah kiri</blockquote>
<p v-if="!_.isEmpty(selectedpatient)">{{selectedpatient.Api_PushResponse}}</p>
</v-card-text>
</v-card>
</v-flex>
</v-layout>
<v-layout row>
<v-flex xs12>
<v-card class="mt-3" >
<v-card-title class="blue-grey white--text">
<span class="title">Params</span>
</v-card-title>
<v-card-text >
<blockquote v-if="_.isEmpty(selectedpatient)" class="blockquote">Anda belum pilih pasien di listing sebelah kiri</blockquote>
<p v-if="!_.isEmpty(selectedpatient)">{{selectedpatient.Api_PushParams}}</p>
</v-card-text>
</v-card>
</v-flex>
</v-layout>
</div>
</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;
}
.amount-right{
text-align:right!important;
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-dialog-info':httpVueLoader('../../common/oneDialogInfo.vue'),
'one-field-verification' : httpVueLoader('../../common/oneFieldVerificationSupply.vue'),
'one-dialog-print':httpVueLoader('../../common/oneDialogPrintX.vue'),
'one-dialog-print-red':httpVueLoader('../../common/oneDialogPrintX.vue')
},
data () {
return {
interval: null,
items: [
{
id: 1,
color: 'info',
icon: ICONS['info']
}
],
nonce: 2,
searchPrint:'',
selected_typeprint:{},
typeprints:[
{id:'inv1',name:'Invoice I'},
{id:'inv2',name:'Invoice II'},
{id:'bp',name:'Bukti Pemeriksaan I'},
{id:'bp1',name:'Bukti Pemeriksaan II'},
{id:'bp2',name:'Bukti Pemeriksaan III'},
{id:'kw1',name:'Kwitansi I'},
{id:'kw2',name:'Kwitansi II'},
//{id:'kkp',name:'KKP'},
{id:'ic',name:'Inform Concern'}
],
dialog_languages:false,
type_dialog_lang:'',
data_dialog_language:{},
act_printkw:'',
xdialogatasnama: false,
pembayaran_atas_nama: '',
checkbox: true,
radioGroup: 1,
switchCash: true,
switchDebit: false,
switchKredit: false,
dialog:false,
urlprintnotered:'',
printtitle:'',
printwidth:'60%',
search_card:'',
search_edc:'',
isLoading:false,
fajrihidebtnpay:'Y'
}
},
mounted() {
this.$store.dispatch("paymentnew/lookup_type")
this.$store.dispatch("paymentnew/lookup_banks")
this.$store.dispatch("paymentnew/lookup_accounts")
this.$store.dispatch("paymentnew/getlanguages")
},
computed: {
urlprintnote: {
get () {
return this.$store.state.paymentnew.urlprintnote
},
set (v) {
this.$store.commit('paymentnew/update_urlprintnote', v)
}
},
setting_controll: {
get () {
return this.$store.state.paymentnew.setting_controll
},
set (v) {
this.$store.commit('paymentnew/update_setting_controll', v)
}
},
data_station_location : {
get () {
return this.$store.state.paymentnew.data_station_location
},
set (v) {
this.$store.commit('paymentnew/update_data_station_location', v)
}
},
languages: {
get() {
return this.$store.state.paymentnew.languages
},
set(val) {
this.$store.commit("paymentnew/update_languages",val)
}
},
selected_language: {
get() {
return this.$store.state.paymentnew.selected_language
},
set(val) {
this.$store.commit("paymentnew/update_selected_language",val)
if(val.code == 'ID'){
this.pembayaran_atas_nama = this.$store.state.patient.selected_patient.M_PatientName
}else{
this.pembayaran_atas_nama = this.$store.state.patient.selected_patient.M_PatientName_eng
}
}
},
opendialoginfo: {
get() {
return this.$store.state.paymentnew.open_dialog_info
},
set(val) {
this.$store.commit("paymentnew/update_open_dialog_info",false)
}
},
msginfo: {
get() {
return this.$store.state.paymentnew.msg_info
},
set(val) {
this.$store.commit("paymentnew/update_msg_info",false)
}
},
save_process(){
return this.$store.state.paymentnew.save_process
},
cards(){
return this.$store.state.paymentnew.cards
},
banks(){
return this.$store.state.paymentnew.banks
},
accounts(){
return this.$store.state.paymentnew.accounts
},
xmindp_percent(){
if(this.$store.state.patient.selected_patient){
return this.$store.state.patient.selected_patient.mindp_percent
}
else{
return 0
}
},
xmindp_amount(){
if(this.$store.state.patient.selected_patient){
return this.$store.state.patient.selected_patient.mindp_amount
}
else{
return 0
}
},
notes(){
return this.$store.state.paymentnew.notes
},
xdialogpaysuccess: {
get() {
return this.$store.state.paymentnew.dialog_pay_success
},
set(val) {
this.$store.commit("paymentnew/update_dialog_pay_success",false)
}
},
loading_send(){
return this.$store.state.patient.loading_send
},
unduhan(){
return this.$store.state.patient.unduhan
},
xmsgpaysuccess(){
return this.$store.state.paymentnew.paynumber
},
types() {
return this.$store.state.paymentnew.types
},
totpay() {
return this.$store.state.paymentnew.total_payment
},
restbill(){
if(this.$store.state.patient.patients){
if(this.$store.state.patient.selected_patient && this.$store.state.patient.selected_patient.unpaid)
return this.$store.state.patient.selected_patient.unpaid
else
return 0
}
else{
return 0
}
},
xdialogdelete:{
get() {
return this.$store.state.paymentnew.dialog_delete
},
set(val) {
this.$store.commit("paymentnew/update_dialog_delete",val)
}
},
xmsgdelete(){
return this.$store.state.paymentnew.msg_delete
},
xnotadelete(){
return this.$store.state.paymentnew.nota_delete
},
xnotedelete:{
get() {
return this.$store.state.paymentnew.note_delete
},
set(val) {
this.$store.commit("paymentnew/update_note_delete",val)
}
},
openprintnote: {
get() {
return this.$store.state.paymentnew.open_print_note
},
set(val) {
this.$store.commit("paymentnew/update_open_print_note",false)
}
},
openprintnotered: {
get() {
return this.$store.state.paymentnew.open_print_note
},
set(val) {
this.$store.commit("paymentnew/update_open_print_note",false)
}
},
selectedpatient(){
return this.$store.state.patient.selected_patient
},
logs(){
return this.$store.state.patient.logs
},
xdisable_btn_pay: {
get() {
return this.$store.state.paymentnew.disable_btn_pay
},
set(val) {
this.$store.commit("paymentnew/update_disable_btn_pay",val)
}
},
},
methods : {
sendResult(){
this.$store.dispatch('patient/sendresult', this.selectedpatient)
},
PrintControlCard(){
this.printwidth = 800
this.printtitle = ""
this.$store.dispatch('paymentnew/save_control', {data:this.data_station_location})
},
openSettingControl(){
this.$store.dispatch("paymentnew/getLocations");
},
typePrintNow(){
var selected_x = this.selected_typeprint
if(selected_x.id === 'inv1')
this.printInvoice()
if(selected_x.id === 'inv2')
this.printInvoice2()
if(selected_x.id === 'bp')
this.printBP()
if(selected_x.id === 'bp1')
this.printBP1()
if(selected_x.id === 'bp2')
this.printBP2()
if(selected_x.id === 'kw1')
this.printKw('v1')
if(selected_x.id === 'kw2')
this.printKw('v2')
if(selected_x.id === 'kkp')
this.printKkp()
if(selected_x.id === 'ic')
this.printIc()
},
changeCard(type,value,idx){
var types = this.$store.state.paymentnew.types
if(type === 'card')
types[idx].selected_card = value
if(type === 'edc')
types[idx].selected_edc = value
if(type === 'account')
types[idx].selected_account = value
this.$store.commit("paymentnew/update_types",{records:types,total:types.length})
this.updateTotal()
},
colorbginp(value){
if(value.chex === false){
return 'grey'
}
else{
return 'white'
}
},
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("paymentnew/update_dialog_pay_success",false)
this.$store.commit("patient/update_selected_patient",{})
console.log(this.$store.state.paymentnew.types)
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.paymentnew.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)
})
//console.log('val other '+valother)
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("paymentnew/update_types",{records :xval,total:xval.length })
let totpaid = valother + ( parseInt(xcash[0].leftvalue) - Math.max(0, xchange) )
this.$store.commit("paymentnew/update_total_payment",totpaid)
},
pay(){
this.$store.commit("paymentnew/update_save_process",true)
var go_pay = true
let xval = this.$store.state.paymentnew.types
var valpay = 0
var xmsginfo = ''
let xcash = _.filter(xval, {code: 'CASH'})
xval.forEach(function(obj){
valpay += parseInt(obj.leftvalue)
})
let selected_payments = _.filter(this.$store.state.paymentnew.types, {chex: true})
//console.log(selected_payments)
var numberpay = 0
selected_payments.forEach(function(xobj){
var obj = JSON.parse(JSON.stringify(xobj))
if(obj.code === 'CASH' && parseInt(obj.leftvalue) === 0){
go_pay = false
xmsginfo += "<p>Mau bayar pake daun ?</p>"
}
else if(obj.code === 'DEBIT' && ( parseInt(obj.leftvalue) === 0 || parseInt(obj.selected_card.id) === 0 || parseInt(obj.selected_edc.id) === 0 )){
console.log(obj.code)
go_pay = false
xmsginfo += "<p>Bawain pacar bibit buah kedongdong, Kalo bayar pake debit diisi yang lengkap dong</p>"
}
else if(obj.code === 'CREDIT' && ( parseInt(obj.leftvalue) === 0 || parseInt(obj.selected_card.id) === 0 || parseInt(obj.selected_edc.id) === 0 )){
go_pay = false
xmsginfo += "<p>Pergi berlayar pake odong-odong, Kalo bayar pake kredit diisi yang lengkap dong</p>"
}
else if(obj.code === 'TRANSFER' && ( parseInt(obj.leftvalue) === 0 || parseInt(obj.selected_account.id) === 0 || obj.selected_account === '')){
go_pay = false
xmsginfo += "<p>Salah bermanuver kecebur selokan dong, Kalo mau transfer diisi yang lengkap dong</p>"
}
if(parseInt(obj.leftvalue) !== 0){
numberpay = numberpay + parseInt(obj.leftvalue)
}
})
if(selected_payments.length > 0 && go_pay){
console.log('sisa tagihan : '+this.restbill)
if(parseInt(this.restbill) === 0 && numberpay > 0){
//console.log("klo 0 ke sini")
xmsginfo += "<p>Yuk kita ke penghulu, jangan kawin lari ... hayooo!!! diretur dulu, kalau mau bayar lagi</p>"
this.$store.commit("paymentnew/update_msg_info",xmsginfo)
this.$store.commit("paymentnew/update_open_dialog_info",true)
this.$store.commit("paymentnew/update_save_process",false)
}
else{
let prm = {coba:0,orderid:this.$store.state.patient.selected_patient.T_OrderHeaderID,payments:this.$store.state.paymentnew.types}
this.$store.dispatch("paymentnew/pay",prm)
}
}
else{
if(selected_payments.length == 0)
xmsginfo += "<p>Mau bayar pake daun ?</p>"
this.$store.commit("paymentnew/update_msg_info",xmsginfo)
this.$store.commit("paymentnew/update_open_dialog_info",true)
this.$store.commit("paymentnew/update_save_process",false)
// console.log(this.opendialoginfo)
}
},
deleteNote(note,idx){
this.$store.commit("paymentnew/update_note_delete","")
this.$store.commit("paymentnew/update_nota_delete",note)
let xmsg = "Yakin , mau hapus nota nomor <span style='color:red'>"+note.note_number+"</span> ?"
this.$store.commit("paymentnew/update_msg_delete",xmsg)
this.$store.commit("paymentnew/update_dialog_delete",true)
},
doDeleteNote(){
let prm = {catatan:this.$store.state.paymentnew.note_delete,nota:this.$store.state.paymentnew.nota_delete}
this.$store.dispatch("paymentnew/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("paymentnew/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){
var selpat = this.$store.state.patient.selected_patient
var firstamount = 0
if(selpat.unpaid)
firstamount = selpat.unpaid
let xobj = this.$store.state.paymentnew.types
if((xobj[idx].code === 'DEBIT' || xobj[idx].code === 'CREDIT' || xobj[idx].code === 'TRANSFER') && val.chex === false){
xobj[idx].selected_card = {id:0,name:''}
xobj[idx].selected_edc = {id:0,name:''}
xobj[idx].selected_account = {id:0,name:''}
}
var valother = 0
xobj.forEach(function(obj){
if(obj.chex && ( obj.code != val.code))
valother += parseInt(obj.leftvalue)
})
if(!val.chex){
xobj[idx].leftvalue = 0
var x = "Y"
this.xdisable_btn_pay = x
console.log('disable '+this.xdisable_btn_pay )
}
else
xobj[idx].leftvalue = firstamount - valother
this.$store.commit("paymentnew/update_types",{records :xobj,total:xobj.length })
this.updateTotal()
},
check_disable_btn_status(){
this.xdisable_btn_pay = 'N'
var payments = this.$store.state.paymentnew.types
let selected_payments = _.filter(payments, {chex: true})
console.log(this.xdisable_btn_pay)
selected_payments.forEach(function(obj){
if(obj.leftvalue === 0){
this.xdisable_btn_pay = 'Y'
console.log('disable '+this.xdisable_btn_pay )
}
if(obj.code === 'DEBIT' || obj.code === 'CREDIT' || obj.code === 'TRANSFER'){
console.log(obj)
if(obj.selected_card.id === '0' || obj.selected_card.id === 0 || obj.selected_edc.id === '0' || obj.selected_edc.id === 0 || obj.selected_account.id === '0' || obj.selected_account.id === 0){
this.xdisable_btn_pay = 'Y'
console.log('oye')
console.log(this.xdisable_btn_pay)
}
}
})
},
selectedLanguage(){
if(this.type_dialog_lang == 'nota'){
this.printNoteAfterLang()
}
if(this.type_dialog_lang == 'invoice'){
this.printInvoiceAfterLang()
}
},
printNote(val,idx){
this.dialog_languages = true
this.data_dialog_language = val
this.type_dialog_lang = 'nota'
this.selected_language = {id:'1',code:'ID',name:'Bahasa Indonesia'}
},
printNoteAfterLang(){
this.dialog_languages = false
var val = this.data_dialog_language
//console.log(val)
this.printtitle = ""
let user = one_user()
var rpt = 'rpt_t_003'
if(val.note_amount < 0)
rpt = 'rpt_t_004'
if(this.selected_language.code == 'EN'){
rpt = rpt+'_eng'
}
this.urlprintnote = "/birt/run?__report=report/one/fo/"+rpt+".rptdesign&__format=pdf&username="+user.M_StaffName+"&PID="+val.note_id
this.$store.commit("paymentnew/update_open_print_note",true)
},
printNotered(val,idx){
this.printtitle = ""
let user = one_user()
var rpt = 'rpt_t_003i'
if(val.note_amount < 0)
rpt = 'rpt_t_004'
this.urlprintnote = "/birt/run?__report=report/one/fo/"+rpt+".rptdesign&__format=pdf&username="+user.M_StaffName+"&PID="+val.note_id
this.$store.commit("paymentnew/update_open_print_note",true)
},
doPrint(){
this.printtitle = ""
this.closeDialogPaySuccess()
let user = one_user()
let payments = this.$store.state.paymentnew.last_payments
console.log(payments)
//let xcash = _.filter(payments, {chex: true})
let xcash = _.filter(payments, function(o) { return o.leftvalue < 0})
var rpt = 'rpt_t_003'
if(xcash.length > 0)
rpt = 'rpt_t_004'
console.log(xcash)
console.log(rpt)
this.urlprintnote = "/birt/run?__report=report/one/fo/"+rpt+".rptdesign&__format=pdf&username="+user.M_StaffName+"&PID="+this.$store.state.paymentnew.idx
this.$store.commit("paymentnew/update_open_print_note",true)
},
printKw(act) {
this.type_dialog_lang = 'kwitansi'
this.selected_language = {id:'1',code:'ID',name:'Bahasa Indonesia'}
this.act_printkw = act
this.pembayaran_atas_nama = this.$store.state.patient.selected_patient.M_PatientName
this.xdialogatasnama = true
},
printKwV2(){
this.printwidth = 800
this.printtitle = ""
let idx = this.$store.state.patient.selected_patient.T_OrderHeaderID
let user = one_user()
let an_name = "&an=" + encodeURIComponent(this.pembayaran_atas_nama )
var rpt = ''
if(this.act_printkw == 'v1'){
rpt = 'rpt_t_002'
}
else{
rpt = 'rpt_t_002i'
}
if(this.selected_language.code == 'EN'){
rpt = rpt+'_eng'
}
this.urlprintnote = "/birt/run?__report=report/one/fo/"+rpt+".rptdesign&__format=pdf&username="+user.M_StaffName+"&PID="+idx + an_name
this.$store.commit("paymentnew/update_open_print_note",true)
},
printBP(){
this.printwidth = 800
this.printtitle = ""
let idx = this.$store.state.patient.selected_patient.T_OrderHeaderID
let user = one_user()
let an_name = "&an=" + encodeURIComponent(this.pembayaran_atas_nama )
this.urlprintnote = "/birt/run?__report=report/one/fo/rpt_t_006.rptdesign&__format=pdf&username="+user.M_StaffName+"&PID="+idx + an_name
this.$store.commit("paymentnew/update_open_print_note",true)
},
printBP1(){
this.printwidth = 800
this.printtitle = ""
let idx = this.$store.state.patient.selected_patient.T_OrderHeaderID
let user = one_user()
let an_name = "&an=" + encodeURIComponent(this.pembayaran_atas_nama )
this.urlprintnote = "/birt/run?__report=report/one/fo/rpt_t_006i.rptdesign&__format=pdf&username="+user.M_StaffName+"&PID="+idx + an_name
this.$store.commit("paymentnew/update_open_print_note",true)
},
printBP2(){
this.printwidth = 800
this.printtitle = ""
let idx = this.$store.state.patient.selected_patient.T_OrderHeaderID
let user = one_user()
let an_name = "&an=" + encodeURIComponent(this.pembayaran_atas_nama )
this.urlprintnote = "/birt/run?__report=report/one/fo/rpt_t_006ii.rptdesign&__format=pdf&username="+user.M_StaffName+"&PID="+idx + an_name
this.$store.commit("paymentnew/update_open_print_note",true)
},
printInvoice(){
this.dialog_languages = true
this.type_dialog_lang = 'invoice'
this.selected_language = {id:'1',code:'ID',name:'Bahasa Indonesia'}
},
printInvoiceAfterLang(){
this.dialog_languages = false
this.printwidth = 800
this.printtitle = ""
let idx = this.$store.state.patient.selected_patient.T_OrderHeaderID
let user = one_user()
var rpt = 'rpt_t_001'
if(this.selected_language.code == 'EN'){
rpt = rpt+'_eng'
}
this.urlprintnote = "/birt/run?__report=report/one/fo/"+rpt+".rptdesign&__format=pdf&username="+user.M_StaffName+"&PID="+idx
this.$store.commit("paymentnew/update_open_print_note",true)
},
printInvoice2(){
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_001i.rptdesign&__format=pdf&username="+user.M_StaffName+"&PID="+idx
this.$store.commit("paymentnew/update_open_print_note",true)
},
printKkp(){
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/lab/rpt_fo_001.rptdesign&__format=pdf&username="+user.M_StaffName+"&PID="+idx
this.$store.commit("paymentnew/update_open_print_note",true)
},
printIc(){
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_inform_concern.rptdesign&__format=pdf&username="+user.M_StaffName+"&PID="+idx
this.$store.commit("paymentnew/update_open_print_note",true)
}
}
}
</script>

View File

@@ -0,0 +1,784 @@
<template>
<v-layout row justify-center>
<v-dialog
v-model="promisedialog"
persistent
max-width="30%"
>
<v-card>
<v-card-title
class="headline darken-1 pt-2 pb-2"
primary-title
>
Konfirmasi
</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 v-html="msgdialogpromise" xs12>
</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="black"
flat
@click="promisedialog = false"
>
Tutup
</v-btn>
<v-btn
color="purple"
flat
@click="closeDialogPromise()"
>
Lanjutkan
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<v-dialog v-model="testdialog" persistent max-width="50%">
<v-card >
<v-card-title
dark
class="headline warning pt-2 pb-2"
primary-title
style="color:white"
>
<h4>Pemeriksaan</h4>
</v-card-title>
<v-card-text class="pt-2 pb-2">
<v-layout pa-2 row wrap>
<v-flex xs12 pl-1>
<v-card flat>
<v-flex xs12 mb-2 pa-2>
<v-layout row>
<v-flex pt-2 xs4>
<h4 class="mb-1">Tambah Pemeriksaan</h4>
</v-flex>
<v-flex style="text-align:right" pt-1 xs8>
<v-progress-circular v-if="getdatastatus === 1"
indeterminate
color="primary"
></v-progress-circular>
</v-flex>
</v-layout>
<v-layout row>
<v-flex pr-1 xs6>
<v-autocomplete
label="Pemeriksaan"
v-model="vtest"
outline
:items="vtests"
:search-input.sync="search_test"
auto-select-first
no-filter
hide-details
item-text="pxname"
return-object
:loading="isLoading"
no-data-text="Cari Pemeriksaan ..."
>
<template
slot="item"
slot-scope="{ item }"
>
<v-list-tile-content>
<v-list-tile-title v-text="item.pxname"></v-list-tile-title>
</v-list-tile-content>
</template>
</v-autocomplete>
</v-flex>
<v-flex class="xs6 pl-3">
<v-btn
small
fab
dark
depressed
color="warning"
@click="addTestToAll()"
>
<v-icon>add</v-icon>
</v-btn>
</v-flex>
</v-layout>
</v-flex>
</v-card>
<v-card >
<v-flex xs12 pa-0 pt-1 pb-1>
<v-layout row>
<v-flex pa-0 xs12>
<v-flex text-md-right>
<v-select
v-if="showdropdowncito === 'Y'"
item-text="name"
return-object
:items="citos"
v-model="selected_cito"
label="Pilihan Cito"
></v-select>
</v-flex>
</v-flex>
</v-layout>
<v-layout row>
<v-flex pa-0 pl-1 pr-1 pt-0 xs12>
<v-data-table
:headers="headers"
:items="testsall"
:loading="isLoading"
hide-actions>
<template slot="items" slot-scope="props">
<tr>
<td class="text-xs-center pa-2 pl-2" >
<v-checkbox color="warning" class="text-xs-center" primary hide-details @change="changeTestAll(props.item,props.item.status)" v-model="props.item.status"></v-checkbox>
</td>
<td class="text-xs-center pa-2" >
<v-checkbox color="warning" class="text-xs-center" primary hide-details @change="changeTestCito(props.item)" v-model="props.item.cito"></v-checkbox>
</td>
<td class="text-xs-left pa-2" >
{{ props.item.pxname }}
<v-select
v-if="(props.item.xid !== 0 || props.item.xid !== '0') && props.item.status === false"
item-text="label"
return-object
:items="charges"
hide-details
v-model="props.item.charge"
@change="changeCharge(props.item,props.item.charge)"
label="Pilihan potongan admin"
></v-select>
</td>
<td class="text-xs-center pa-2">{{ convertMoney(props.item.bruto) }}</td>
<td class="text-xs-center pa-2">{{ convertMoney(props.item.discount) }}</td>
<td class="text-xs-center pa-2">
<span v-if="(props.item.xid !== 0 || props.item.xid !== '0') && props.item.status">{{ convertMoney(props.item.total) }}</span>
<span v-if="(props.item.xid !== 0 || props.item.xid !== '0') && props.item.status === false" style="text-decoration: line-through;">{{ convertMoney(props.item.total) }}</span>
<span v-if="(props.item.xid !== 0 || props.item.xid !== '0') && props.item.status === false">{{totalRetur(props.item)}}</span>
</td>
</tr>
</template>
</v-data-table>
</v-flex>
</v-layout>
</v-flex>
</v-card>
</v-flex>
</v-layout>
</v-card-text>
<v-divider></v-divider>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn
flat
@click="closeDialogOrder"
>
Tutup
</v-btn>
<v-btn v-if="getdatastatus !== 1" style="margin-right:0" @click="checkPromiseOrderAdd()" flat color="warning" dark>Simpan</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<one-dialog-error :status="opendialogerror" :msg="msgerror" @close-dialog-error="opendialogerror = false"></one-dialog-error>
</v-layout>
</template>
<style scoped>
table {
font-family: arial, sans-serif;
btest-collapse: collapse;
width: 100%;
background:white;
btest: 1px solid #ddd!important;
}
th, td {
padding: .75rem 1.25rem;
btest: 1px solid #ddd!important;
}
table>tr>td {
padding: .75rem 1.25rem;
btest: 1px solid #ddd!important;
}
table>tr>td:first {
padding-left:15px!important;
}
</style>
<script>
module.exports = {
components : {
'one-dialog-error':httpVueLoader('../../common/oneDialogErrorFajri.vue')
},
data () {
return {
printwidth:600,
search_test:'',
orderid:-1,
mouid:-1,
is_loading:false,
isLoading:false,
error_promise:false,
error_promise_dialog:false,
selected_promise:{},
opendialogerror:false,
msgerror:"",
promiseright:'-',
charges:[{value:0,label:'0%'},{value:5,label:'5%'},{value:10,label:'10%'},{value:25,label:'25%'}],
headers: [
{
text: "STATUS",
align: "left",
sortable: false,
value: "status",
width: "10%",
class: "pa-1 warning white--text"
},
{
text: "CITO",
align: "left",
sortable: false,
value: "cito",
width: "10%",
class: "pa-1 warning white--text"
},
{
text: "PEMERIKSAAN",
align: "left",
sortable: false,
value: "testname",
width: "30%",
class: "pa-1 warning white--text"
},
{
text: "BRUTO",
align: "center",
sortable: false,
value: "bruto",
width: "20%",
class: "pa-1 warning white--text"
},
{
text: "DISKON",
align: "center",
sortable: false,
value: "discount",
width: "20%",
class: "pa-1 warning white--text"
},
{
text: "TOTAL",
align: "center",
sortable: false,
value: "total",
width: "20%",
class: "pa-1 warning white--text"
}
],
headerverifications :[
{
text: "STATUS",
align: "center",
sortable: false,
value: "status",
width: "7%",
class: "pa-1 warning white--text"
},
{
text: "CITO",
align: "center",
sortable: false,
value: "cito",
width: "7%",
class: "pa-1 warning white--text"
},
{
text: "PEMERIKSAAN",
align: "left",
sortable: false,
value: "testname",
width: "15%",
class: "pa-1 warning white--text"
},
{
text: "BRUTO",
align: "center",
sortable: false,
value: "bruto",
width: "10%",
class: "pa-1 warning white--text"
},
{
text: "DISKON",
align: "center",
sortable: false,
value: "discount",
width: "10%",
class: "pa-1 warning white--text"
},
{
text: "TOTAL",
align: "center",
sortable: false,
value: "total",
width: "15%",
class: "pa-1 warning white--text"
}
]
}
},
computed: {
testdialog:{
get() {
return this.$store.state.test.test_dialog
},
set(val) {
this.$store.commit("test/update_test_dialog",val)
}
},
savestatusverification(){
return this.$store.state.test.save_status_verification
},
vmsgsave(){
return this.$store.state.test.save_message
},
vstatussave(){
return this.$store.state.test.save_status
},
testsregistration(){
return this.$store.state.test.test_registration
},
testsverification(){
return this.$store.state.test.test_verification
},
testsall(){
return this.$store.state.test.test_all
},
vtests(){
return this.$store.state.test.tests
},
vtest:{
get() {
return this.$store.state.test.test
},
set(val) {
this.$store.commit("test/update_test",val)
console.log(val.promise)
this.promiseright = val.promise
this.$store.commit("test/update_show_promise_right",true)
}
},
vcito:{
get() {
return this.$store.state.test.cito
},
set(val) {
this.$store.commit("test/update_cito",val)
}
},
citos(){
return this.$store.state.test.citos
},
selected_cito:{
get() {
return this.$store.state.test.selected_cito
},
set(val) {
this.$store.commit("test/update_selected_cito",val)
}
},
xpromises(){
return this.$store.state.test.promises
},
xpromise:{
get() {
return this.$store.state.test.promise
},
set(val) {
this.$store.commit("test/update_promise",val)
}
},
promisedialog:{
get() {
return this.$store.state.test.promise_dialog
},
set(val) {
this.$store.commit("test/update_promise_dialog",val)
}
},
msgdialogpromise:{
get() {
return this.$store.state.test.msg_promise_dialog
},
set(val) {
this.$store.commit("test/update_msg_promise_dialog",val)
}
},
showpromiseleft:{
get() {
return this.$store.state.test.show_promise_left
},
set(val) {
this.$store.commit("test/update_show_promise_left",val)
}
},
showpromiseright:{
get() {
return this.$store.state.test.show_promise_right
},
set(val) {
this.$store.commit("test/update_show_promise_right",val)
}
},
promiseleft:{
get() {
return this.$store.state.test.promise_left
},
set(val) {
this.$store.commit("test/update_promise_left",val)
}
},
getdatastatus:{
get() {
return this.$store.state.test.save_status
},
set(val) {
this.$store.commit("test/update_save_status",val)
}
},
showdropdowncito:{
get() {
return this.$store.state.test.show_cito_dropdown
},
set(val) {
this.$store.commit("test/update_show_cito_dropdown",val)
}
},
},
methods : {
showExist() {
this.opendialogerror = true
this.msgerror = "Pemeriksaan Sudah Ada"
},
totalRetur(row){
var charge = parseFloat(row.charge.value)
var charge_amount = (charge/100) * parseFloat(row.total)
var totalaftercharge = parseFloat(row.total) - (charge_amount)
return one_money(totalaftercharge)
},
convertMoney(money){
return one_money(money)
},
saveTestAdditionVerification(){
let arrtest = this.$store.state.test.test_verification
var prm = {
orderid:this.$store.state.patient.selected_patient.orderid,
tests:arrtest
}
this.$store.dispatch("test/savetestadditionalverification",prm)
},
changePromise(value){
let arrtest = this.$store.state.test.test_verification
var idx = _.findIndex(arrtest, item => item.idx === value.idx)
arrtest[idx]['promise'] = value.promise
this.$store.commit("test/update_test_verification",arrtest)
},
closeDialogOrder(){
if(this.savestatus !== 2){
this.$store.commit("test/update_test_dialog",false)
}
else{
let arrpatient = this.$store.state.patient.patients
var idx = _.findIndex(arrpatient, item => item.idx === this.$store.state.patient.selected_patient.idx)
this.$store.dispatch("patient/search",{
search: this.$store.state.patient.search,
status: this.$store.state.patient.selected_status.value,
lastidx:idx
})
this.$store.commit("test/update_test_dialog",false)
}
},
changeCharge(row,value){
var oldArr = this.$store.state.test.test_all
var idx = _.findIndex(oldArr, row)
oldArr[idx].active = 'Y'
oldArr[idx].charge = value
this.$store.commit("test/update_test_all",oldArr)
},
changeTestAll(row,value){
var oldArr = this.$store.state.test.test_all
var idx = _.findIndex(oldArr, row)
let nowstatus = row.status
if(nowstatus == false && row.xid != '0'){
this.$store.dispatch("test/checkstatus",row)
}
else{
oldArr[idx].active = 'Y'
oldArr[idx].status = nowstatus
this.$store.commit("test/update_test_all",oldArr)
}
},
changeTestCito(value){
this.$store.commit("test/update_selected_test",value)
var prm = value
prm.orderid = this.$store.state.patient.selected_patient.orderid
this.$store.dispatch("test/getnewprice",prm)
},
thr_search_test: _.debounce( function () {
var oldArr = this.$store.state.test.test_all
this.promiseright = '-'
var prm = {
orderid:this.$store.state.test.orderid,
search: this.search_test,
cito:this.$store.state.test.cito
}
this.$store.dispatch("test/searchtest",prm)
},2000),
addTestToAll(){
var xtestall = this.$store.state.test.test_all
var all_nattest = []
var xchecked_test = _.filter(xtestall, function(o) { return o.status })
xchecked_test = xchecked_test
xchecked_test.forEach(function(test_a) {
//console.log(test_a)
//debugger
test_a.nat_test.forEach(function(x_test_a) {
all_nattest.push(x_test_a)
})
})
var xtestadditional = this.$store.state.test.test
var is_exist = false
var xnattest_now = xtestadditional.nat_test
//debugger
//console.log(xnattest_now)
//debugger
xnattest_now.forEach(function(nattest_a) {
var idx_check = _.findIndex(all_nattest, function(o) { return parseInt(o) === parseInt(nattest_a) })
if(idx_check !== -1)
is_exist = true
})
if(!is_exist){
console.log(xtestadditional.type)
if(xtestadditional.type !== 'PXR' && xtestadditional.type !== 'PR'){
xtestall.push(xtestadditional)
}
else if(xtestadditional.type === 'PXR' || xtestadditional.type === 'PR'){
var child_test = xtestadditional.child_test
console.log(child_test)
child_test.forEach(function(entry) {
var new_test = {}
new_test.xid = '0'
new_test.nat_testid = entry.Nat_TestID
new_test.nat_test = entry.nat_test
new_test.is_packet = entry.is_packet
new_test.packet_id = entry.packet_id
new_test.type = entry.px_type
new_test.pxid = entry.T_TestID
new_test.pxcode = entry.pxcode
new_test.pxsascode = entry.T_TestSasCode
new_test.pxname = entry.T_TestSasCode+" "+entry.T_TestName
new_test.test_name = entry.T_TestName
new_test.isresult = entry.isresult
new_test.bruto = entry.T_PriceAmount
new_test.discountpersen = entry.T_PriceDisc
new_test.discountrp = entry.T_PriceDiscRp
new_test.discount = ( ( entry.T_PriceDisc / 100 ) * entry.T_PriceAmount ) + entry.T_PriceDiscRp
//new_test.discount = ( ( entry.T_PriceDisc / 100 ) * entry.T_PriceAmount ) - entry.T_PriceDiscRp
new_test.total = entry.T_PriceAmount - new_test.discount
new_test.status = true
new_test.cito = false
new_test.cito_before = "N"
new_test.promise = ""
xtestall.push(new_test)
})
}
this.$store.commit("test/update_test_all",xtestall)
this.$store.commit("test/update_test",{})
}
},
addTestToAllxx(){
var xtestall = this.$store.state.test.test_all
var xtestadditional = this.$store.state.test.test
//nat_testid tambaha/n
let n_id = xtestadditional.nat_testid
// all child_test
let x_idx = _.findIndex(xtestall, function(p) {
console.log('n_id', n_id)
console.log('px_nat_testid', p.nat_testid)
return n_id == parseInt(p.nat_testid)
});
let flag_exists = false
if (x_idx > -1 ) flag_exists = true
if (! flag_exists) {
if(xtestadditional.child_test != ''){
let add_ct = JSON.parse(xtestadditional.child_test)
for(let idx =0; idx < add_ct.length ; idx++) {
let add_ct_id = add_ct[idx].pxnat_testid
let x_idx = _.findIndex(xtestall, function(p) {
console.log('ct id', add_ct_id)
console.log('px_nat_testid', p.nat_testid)
return add_ct_id == parseInt(p.nat_testid)
});
if (x_idx > -1 ) {
flag_exists = true
break
}
}
}
}
if (flag_exists) {
this.showExist()
return
}
var xnew = {
xid:0,
type:xtestadditional.type,
status:'Y',
cito:false,
cito_before:'N',
testid:xtestadditional.pxid,
testcode:xtestadditional.pxcode,
testsascode:xtestadditional.pxsascode,
testname:xtestadditional.pxname,
isresult:xtestadditional.isresult,
bruto:xtestadditional.bruto,
discount:xtestadditional.discounttotal,
discountpersen:xtestadditional.discount,
discountrp:xtestadditional.discountrp,
charge:{value:0,label:'0%'},
total:xtestadditional.total,
nat_test:xtestadditional.nat_test,
child_test:xtestadditional.child_test,
is_packet:xtestadditional.is_packet,
packet_id:xtestadditional.packet_id
}
if(xnew.type === 'PN' || xnew.type === 'PX'){
xtestall.push(xnew)
this.$store.commit("test/update_test_all",xtestall)
this.$store.commit("test/update_test",{})
}
if(xnew.type === 'PXR'){
xnew.orderid = this.$store.state.patient.selected_patient.orderid
var params = {all:xtestall,new:xnew}
this.$store.dispatch("test/getchildrenprofil",params)
}
if(xnew.type === 'SINGLE-PR'){
var child_test = JSON.parse(xtestadditional.child_test)
console.log(child_test)
child_test.forEach(item => {
var xxnew = {
xid:0,
type:'SINGLE',
status:'Y',
cito:false,
cito_before:'N',
testid:item.pxid,
testcode:item.pxcode,
testsascode:item.pxsascode,
testname:item.pxname,
isresult:item.isresult,
bruto:item.bruto,
discount:item.discounttotal,
discountpersen:item.discount,
discountrp:item.discountrp,
charge:{value:0,label:'0%'},
total:item.total
}
xtestall.push(xxnew)
})
this.$store.commit("test/update_test_all",xtestall)
this.$store.commit("test/update_test",{})
}
},
saveTestAdditional(){
var prm = {
orderid:this.$store.state.patient.selected_patient.orderid,
testall: this.$store.state.test.test_all,
selected_cito:this.$store.state.test.selected_cito
}
this.$store.dispatch("test/savetestadditional",prm)
},
checkPromiseOrderAdd(){
this.$store.commit("test/update_act",'additional')
var prm = {
orderid:this.$store.state.patient.selected_patient.orderid,
tests: this.$store.state.test.test_all
}
this.$store.dispatch("test/checkpromisetests",prm)
},
checkPromiseOrderVerification(){
this.$store.commit("test/update_act",'verification')
var prm = {
orderid:this.$store.state.patient.selected_patient.orderid,
tests: this.$store.state.test.test_verification
}
this.$store.dispatch("test/checkpromisetests",prm)
},
openDialogPromise(value){
this.error_promise_dialog = false
this.selected_promise = {}
this.$store.commit("test/update_selected_detail_verification",value)
this.promisedialog = true
},
addPromiseTodetail(){
if(this.selected_promise){
let arrtest = this.$store.state.test.test_verification
console.log(arrtest)
var idx = _.findIndex(arrtest, item => item.idx === this.$store.state.test.selected_detail_verification.idx)
arrtest[idx]['promise'] = this.selected_promise.id
arrtest[idx]['promisename'] = this.selected_promise.name
this.$store.commit("test/update_test_verification",arrtest)
this.promisedialog = false
}
else{
this.error_promise_dialog = true
}
},
closeDialogPromise(){
var act = this.$store.state.test.act
this.promisedialog = false
if(act === 'additional')
this.saveTestAdditional()
else
this.saveTestAdditionVerification()
}
},
watch: {
search_test(val,old) {
if (val == old ) return
if (! val) return
if (val == '') return
if (val.length < 1 ) return
if (this.$store.state.test.autocomplete_status == 1 ) return
this.thr_search_test()
}
}
}
</script>