Flatten nested repos
This commit is contained in:
443
test/vuex/one-fo-data-old-cpone/components/oneFoCashierList.vue
Normal file
443
test/vuex/one-fo-data-old-cpone/components/oneFoCashierList.vue
Normal file
@@ -0,0 +1,443 @@
|
||||
<template>
|
||||
<v-layout class="fill-height" column>
|
||||
<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 Awal"
|
||||
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-text-field
|
||||
class="xs3 ma-1"
|
||||
label="Cari ..."
|
||||
placeholder="Nama / No Reg / NPK"
|
||||
v-on:keyup.enter="searchPatient"
|
||||
outline
|
||||
v-model="searchnamelab"
|
||||
hide-details
|
||||
></v-text-field>
|
||||
|
||||
<span
|
||||
@click="searchPatient"
|
||||
class="icon-medium-fill-base xs1 white--text info iconsearch-search"
|
||||
></span>
|
||||
</v-layout>
|
||||
</v-card>
|
||||
<v-card>
|
||||
<v-layout row>
|
||||
<v-flex xs12 pl-2 pr-2 pt-2 pb-2>
|
||||
<v-data-table
|
||||
:headers="headers"
|
||||
:items="patients"
|
||||
:loading="isLoading"
|
||||
hide-actions
|
||||
class="elevation-1"
|
||||
>
|
||||
<template slot="items" slot-scope="props">
|
||||
<td
|
||||
class="text-xs-left pa-2"
|
||||
v-bind:class="{ 'amber lighten-4': isSelected(props.item) }"
|
||||
@click="selectMe(props.item)"
|
||||
>
|
||||
<p class="font-weight-black caption mb-0">
|
||||
{{ props.item.T_OrderHeaderLabNumber }}
|
||||
</p>
|
||||
</td>
|
||||
<td
|
||||
class="text-xs-center pa-2"
|
||||
v-bind:class="{ 'amber lighten-4': isSelected(props.item) }"
|
||||
@click="selectMe(props.item)"
|
||||
>
|
||||
{{ props.item.order_dob }}
|
||||
</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">NPK : {{ props.item.M_PatientNIP }}</p>
|
||||
<p class="font-weight-black caption mb-0">
|
||||
PATIENT_ID Lama : {{ props.item.M_PatientOldPID }}
|
||||
</p>
|
||||
<p class="mb-0">Department : {{ props.item.M_PatientDepartement }}</p>
|
||||
</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: 0.5px solid rgba(0, 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: "Belum Lunas", value: "N" };
|
||||
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: {
|
||||
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: 0,
|
||||
});
|
||||
},
|
||||
selectMe(pat) {
|
||||
let totpay = this.$store.state.paymentnew.total_payment;
|
||||
if (totpay === 0) {
|
||||
let xobj = this.$store.state.paymentnew.types;
|
||||
console.log(xobj);
|
||||
xobj.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_types", {
|
||||
records: xobj,
|
||||
total: xobj.length,
|
||||
});
|
||||
this.$store.commit("patient/update_selected_patient", pat);
|
||||
this.$store.commit("paymentnew/update_total_payment", 0);
|
||||
this.$store.commit("paymentnew/update_notes", pat.notes);
|
||||
} else {
|
||||
this.$store.commit("patient/update_open_alert_no_pay", true);
|
||||
}
|
||||
},
|
||||
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: {
|
||||
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.$store.dispatch("patient/searchcompany", "");
|
||||
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. TRANSAKSI",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "10%",
|
||||
class: "pa-2 info white--text",
|
||||
},
|
||||
{
|
||||
text: "DOB",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
value: "lab",
|
||||
width: "14%",
|
||||
class: "pa-2 info white--text",
|
||||
},
|
||||
{
|
||||
text: "NAMA",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
value: "name",
|
||||
width: "25%",
|
||||
class: "pa-2 info white--text",
|
||||
},
|
||||
|
||||
{
|
||||
text: "INFO",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
value: "status",
|
||||
width: "35%",
|
||||
class: "pa-2 info 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>
|
||||
@@ -0,0 +1,496 @@
|
||||
<template>
|
||||
<v-layout class="fill-height" column>
|
||||
<v-dialog v-model="dialog_success" width="500">
|
||||
<v-card>
|
||||
<v-card-title class="headline info lighten-2" primary-title dark>
|
||||
Info
|
||||
</v-card-title>
|
||||
|
||||
<v-card-text>
|
||||
<p>Pergabungan sukses</p>
|
||||
</v-card-text>
|
||||
|
||||
<v-divider></v-divider>
|
||||
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="grey" flat @click="closeSuccess()"> Tutup </v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
<v-dialog v-model="dialog_alert" width="500">
|
||||
<v-card>
|
||||
<v-card-title class="headline red lighten-2" primary-title dark>
|
||||
Peringatan
|
||||
</v-card-title>
|
||||
|
||||
<v-card-text>
|
||||
{{ msg_alert }}
|
||||
</v-card-text>
|
||||
|
||||
<v-divider></v-divider>
|
||||
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="grey" flat @click="dialog_alert = false"> Batal </v-btn>
|
||||
<v-btn color="primary" v-if="bolehjalan" @click="doGabungkan()">Lakukan</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
<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-text-field
|
||||
class="xs3 ma-1"
|
||||
label="Cari ..."
|
||||
placeholder="Nama / No Reg / NPK"
|
||||
v-on:keyup.enter="searchPatient"
|
||||
outline
|
||||
v-model="searchnamelab"
|
||||
hide-details
|
||||
></v-text-field>
|
||||
|
||||
<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.order_dob }}
|
||||
</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">NPK : {{ props.item.NPK }}</p>
|
||||
<p class="font-weight-black caption mb-0">
|
||||
PATIENT_ID Lama : {{ props.item.PATIENT_ID }}
|
||||
</p>
|
||||
<p class="mb-0">Department : {{ props.item.DEPT }}</p>
|
||||
</td>
|
||||
<td
|
||||
class="text-xs-left pa-2"
|
||||
v-bind:class="{ 'amber lighten-4': isSelected(props.item) }"
|
||||
@click="selectMe(props.item)"
|
||||
>
|
||||
<v-btn dark @click="gabungkan(props.item)" color="red">Gabungkan</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: 0.5px solid rgba(0, 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: "Belum Lunas", value: "N" };
|
||||
this.show_btn_back = true;
|
||||
this.type_back_btn = type;
|
||||
}
|
||||
|
||||
this.$store.dispatch("patient/search_old_patient", {
|
||||
startdate: this.xstartdate,
|
||||
enddate: this.xenddate,
|
||||
search: this.searchnamelab,
|
||||
status: this.status.value,
|
||||
current_page: 1,
|
||||
lastidx: 0,
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
closeSuccess() {
|
||||
this.dialog_success = false;
|
||||
this.$store.dispatch("patient/search_old_patient", {
|
||||
startdate: this.xstartdate,
|
||||
enddate: this.xenddate,
|
||||
search: this.searchnamelab,
|
||||
status: this.status.value,
|
||||
current_page: this.curr_page,
|
||||
lastidx: 0,
|
||||
});
|
||||
},
|
||||
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) {
|
||||
//console.log(this.$store.state.patient.old_selected_patient);
|
||||
let x = this.$store.state.patient.old_selected_patient;
|
||||
if (!_.isEmpty(x))
|
||||
return p.REG_NO == this.$store.state.patient.old_selected_patient.REG_NO;
|
||||
else return false;
|
||||
},
|
||||
searchPatient() {
|
||||
this.$store.dispatch("patient/search_old_patient", {
|
||||
startdate: this.xstartdate,
|
||||
enddate: this.xenddate,
|
||||
search: this.searchnamelab,
|
||||
status: this.status.value,
|
||||
current_page: 1,
|
||||
lastidx: 0,
|
||||
});
|
||||
},
|
||||
selectMe(pat) {
|
||||
this.$store.commit("patient/update_old_selected_patient", pat);
|
||||
},
|
||||
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/");
|
||||
},
|
||||
doGabungkan() {
|
||||
this.loading = true;
|
||||
this.dialog_alert = false;
|
||||
var valnew = this.$store.state.patient.selected_patient;
|
||||
var valold = this.$store.state.patient.old_selected_patient;
|
||||
this.$store.dispatch("patient/gabungkan", { new: valnew, old: valold });
|
||||
},
|
||||
gabungkan(pat) {
|
||||
this.bolehjalan = false;
|
||||
this.selectMe(pat);
|
||||
var valnew = this.$store.state.patient.selected_patient;
|
||||
console.log(pat);
|
||||
if (!_.isEmpty(valnew)) {
|
||||
// console.log(pat);
|
||||
this.bolehjalan = true;
|
||||
let msg_alert =
|
||||
"Apakah anda yakin, menggabungkan pasien " +
|
||||
valnew.M_PatientName +
|
||||
" dengan " +
|
||||
pat.M_PatientName +
|
||||
" ?";
|
||||
this.msg_alert = msg_alert;
|
||||
} else {
|
||||
let xmsg_alert =
|
||||
"Anda belum memilih pasien yang akan digabungkan, klik pasien di listing sebelah kiri";
|
||||
this.msg_alert = xmsg_alert;
|
||||
}
|
||||
this.dialog_alert = true;
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
msg_alert: {
|
||||
get() {
|
||||
return this.$store.state.patient.msg_alert;
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("patient/update_msg_alert", val);
|
||||
},
|
||||
},
|
||||
dialog_alert: {
|
||||
get() {
|
||||
return this.$store.state.patient.dialog_alert;
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("patient/update_dialog_alert", val);
|
||||
},
|
||||
},
|
||||
loading: {
|
||||
get() {
|
||||
return this.$store.state.patient.loading;
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("patient/update_loading", val);
|
||||
},
|
||||
},
|
||||
dialog_success: {
|
||||
get() {
|
||||
return this.$store.state.patient.dialog_success;
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("patient/update_dialog_success", val);
|
||||
},
|
||||
},
|
||||
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.$store.dispatch("patient/searchcompany", "");
|
||||
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.old_search;
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("patient/update_old_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.old_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.old_current_page;
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("patient/update_old_current_page", val);
|
||||
this.$store.dispatch("patient/search_old_patient", {
|
||||
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.old_total_page;
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("patient/update_old_total_page", val);
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
bolehjalan: false,
|
||||
items: [],
|
||||
search_company: "",
|
||||
menustartdate: false,
|
||||
menuenddate: false,
|
||||
show_btn_back: false,
|
||||
type_back_btn: "",
|
||||
headers: [
|
||||
{
|
||||
text: "DOB",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
value: "lab",
|
||||
width: "14%",
|
||||
class: "pa-2 warning white--text",
|
||||
},
|
||||
{
|
||||
text: "NAMA",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
value: "name",
|
||||
width: "25%",
|
||||
class: "pa-2 warning white--text",
|
||||
},
|
||||
|
||||
{
|
||||
text: "INFO",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
value: "status",
|
||||
width: "35%",
|
||||
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>
|
||||
@@ -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>
|
||||
File diff suppressed because it is too large
Load Diff
784
test/vuex/one-fo-data-old-cpone/components/oneFoCashierTest.vue
Normal file
784
test/vuex/one-fo-data-old-cpone/components/oneFoCashierTest.vue
Normal 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>
|
||||
Reference in New Issue
Block a user