Flatten nested repos
This commit is contained in:
574
test/vuex/one-list-consumable/components/oneConsumableList.vue
Normal file
574
test/vuex/one-list-consumable/components/oneConsumableList.vue
Normal file
@@ -0,0 +1,574 @@
|
||||
<template>
|
||||
<v-layout class="fill-height" column>
|
||||
<!-- Alert dialog -->
|
||||
<v-dialog v-model="dialogdeletealert" max-width="30%">
|
||||
<v-card>
|
||||
<v-card-title class="headline grey lighten-2 pt-2 pb-2" primary-title>
|
||||
Peringatan !
|
||||
</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 xs12>
|
||||
{{ msgalert }}
|
||||
</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 v-if="xact_notreset === 'notreset' || xact === 'reset' || xact === 'save'" color="primary" flat @click="dialogdeletealert = false">
|
||||
Tutup
|
||||
</v-btn>
|
||||
<v-btn v-if="xact === 'reset'" color="primary" flat
|
||||
@click="resetAll()">
|
||||
Yakin lah
|
||||
</v-btn>
|
||||
<v-btn v-if="xact === 'save'" color="primary" flat
|
||||
@click="saveConsumableAll()">
|
||||
Yakin lah
|
||||
</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
<!-- End alert dialog -->
|
||||
<!-- ERROR DIALOG -->
|
||||
<v-dialog v-model="dialog_error" max-width="500px">
|
||||
<v-card>
|
||||
<v-card-title>
|
||||
<span>ERROR !</span>
|
||||
<v-spacer></v-spacer>
|
||||
</v-card-title>
|
||||
<v-divider></v-divider>
|
||||
<div class="ma-3 red--text">{{ msgError }}</div>
|
||||
<v-divider></v-divider>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="primary" flat @click="dialog_error = false">Close</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
<!-- END ERROR DIALOG -->
|
||||
<!-- Snackbar -->
|
||||
<v-snackbar v-model="snackbar" :timeout="5000" :multi-line="false" :vertical="false" :top="true" :color="clr"
|
||||
:value="snackbar">
|
||||
{{ msgsnackbar }}
|
||||
<v-btn flat @click="snackbar = false"> Tutup </v-btn>
|
||||
</v-snackbar>
|
||||
<!-- End Snackbar -->
|
||||
<!-- Form Dialog -->
|
||||
<v-dialog v-model="dialog_form" persistent width="50%">
|
||||
<v-card>
|
||||
<v-card-title>
|
||||
<span class="title">Tambah Consumable</span>
|
||||
</v-card-title>
|
||||
<v-divider></v-divider>
|
||||
<v-card-text class="pt-3 pb-0">
|
||||
<v-layout row wrap>
|
||||
<v-flex xs12>
|
||||
<v-select v-model="xgetitemconsumable" :items="vitems" item-text="M_ConsumableName"
|
||||
item-value="consumableid" :error="itemconsumable_error_message !== ''" :error-messages="itemconsumable_error_message"
|
||||
@blur="itemconsumableValidation"
|
||||
return-object label="Pilih Item" required>
|
||||
</v-select>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card-text>
|
||||
<v-divider></v-divider>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="primary" flat @click="dialog_form = false">Tutup</v-btn>
|
||||
<v-btn color="primary" flat
|
||||
@click="saveAdd()">Simpan</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
<!-- End Form Dialog -->
|
||||
|
||||
<v-card class="mb-2 pa-2">
|
||||
<v-card-title>
|
||||
<span class="title font-weight-light">PEMERIKSAAN :</span>
|
||||
</v-card-title>
|
||||
<v-layout row wrap class="scroll-container" style="max-height:200px;overflow: auto;">
|
||||
<v-flex class="border-bottom-dashed" xs12 pt-2 pl-2 pr-2 pb-4>
|
||||
<v-layout xs12 row wrap>
|
||||
<v-flex xs6 v-for="(vst,idx) in vtests" :key="`6${idx}`" class="pr-2 pb-1">
|
||||
<v-layout row>
|
||||
<v-chip
|
||||
color="orange"
|
||||
label
|
||||
text-color="white"
|
||||
style="white-space: normal; display: block;"
|
||||
>{{ vst.testname }}</v-chip>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card>
|
||||
<v-card>
|
||||
<v-layout row>
|
||||
<v-flex pt-2 pl-2>
|
||||
<div class="text-md-right">
|
||||
<v-btn
|
||||
v-if="this.selected_consumable.isHidden == true"
|
||||
color="primary"
|
||||
@click="addConsumable()"
|
||||
>
|
||||
Tambah Consumable
|
||||
</v-btn>
|
||||
</div>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<v-layout row style="max-height:500px;overflow: auto;">
|
||||
<v-flex xs12 pl-2 pr-2 pt-2 pb-2>
|
||||
<v-data-table :headers="headers" :items="xconsumables" :isLoading="isLoading" hide-actions class="elevation-1 fixed_header">
|
||||
<template slot="items" slot-scope="props">
|
||||
<td class="text-xs-left px-2">
|
||||
{{ props.item.M_ConsumableName }}
|
||||
</td>
|
||||
<td class="text-xs-center px-2">
|
||||
<div v-if="props.item.isHidden === true">
|
||||
<v-text-field class="mt-3"
|
||||
v-model="props.item.T_ConsumableQty"
|
||||
item-value="T_ConsumableQty"
|
||||
solo single-line label="" type="number"></v-text-field>
|
||||
</div>
|
||||
<div v-if="props.item.isHidden === false">
|
||||
<v-text-field class="mt-3"
|
||||
v-model="props.item.M_ConsumableDefaultQty"
|
||||
item-value="M_ConsumableDefaultQty"
|
||||
solo single-line label="" type="number"></v-text-field>
|
||||
</div>
|
||||
</td>
|
||||
<td class="text-xs-center px-2">
|
||||
<div v-if="props.item.isHidden === true">
|
||||
<v-layout row>
|
||||
<v-flex>
|
||||
<v-select
|
||||
:items="props.item.units"
|
||||
v-model="props.item.M_SatuanID"
|
||||
return-object
|
||||
item-value="M_SatuanID"
|
||||
item-text="M_SatuanName"
|
||||
solo
|
||||
class="mt-3"
|
||||
></v-select>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</div>
|
||||
<div v-if="props.item.isHidden === false">
|
||||
<v-layout row>
|
||||
<v-flex>
|
||||
<v-select
|
||||
:items="props.item.units"
|
||||
v-model="props.item.M_SatuanID"
|
||||
return-object
|
||||
item-value="M_SatuanID"
|
||||
item-text="M_SatuanName"
|
||||
solo
|
||||
class="mt-3"
|
||||
></v-select>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</div>
|
||||
|
||||
</td>
|
||||
</template>
|
||||
</v-data-table>
|
||||
|
||||
<v-layout row>
|
||||
<v-flex pt-2 pl-2>
|
||||
<div class="text-md-right pt-2 pb-2">
|
||||
<v-btn
|
||||
color="error"
|
||||
@click="confirmResetAll()"
|
||||
>
|
||||
Reset
|
||||
</v-btn>
|
||||
|
||||
<v-btn
|
||||
color="primary"
|
||||
@click="openSaveConsumableAll()"
|
||||
>
|
||||
Simpan
|
||||
</v-btn>
|
||||
</div>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card>
|
||||
|
||||
</v-layout>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.searchbox .v-input.v-text-field .v-input__slot {
|
||||
min-height: 60px;
|
||||
}
|
||||
|
||||
.searchbox .v-btn {
|
||||
min-height: 60px;
|
||||
}
|
||||
|
||||
table.v-table tbody td,
|
||||
table.v-table tbody th {
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
table.v-table thead tr {
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
.scroll-container {
|
||||
scroll-padding: 50px 0 0 50px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar {
|
||||
width: 7px;
|
||||
}
|
||||
|
||||
/* this targets the default scrollbar (compulsory) */
|
||||
|
||||
::-webkit-scrollbar-track {
|
||||
background-color: #73baf3;
|
||||
}
|
||||
|
||||
/* the new scrollbar will have a flat appearance with the set background color */
|
||||
|
||||
::-webkit-scrollbar-thumb {
|
||||
background-color: #2196f3;
|
||||
}
|
||||
|
||||
/* this will style the thumb, ignoring the track */
|
||||
|
||||
::-webkit-scrollbar-button {
|
||||
background-color: #0079da;
|
||||
}
|
||||
|
||||
/* optionally, you can style the top and the bottom buttons (left and right for horizontal bars) */
|
||||
|
||||
::-webkit-scrollbar-corner {
|
||||
background-color: black;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
data() {
|
||||
return {
|
||||
xgetitemconsumable: 0,
|
||||
itemconsumable_error_message: "",
|
||||
clr: "success",
|
||||
msgalert: "",
|
||||
dialogdeletealert: false,
|
||||
headers: [{
|
||||
text: "ITEM",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "10%",
|
||||
class: "pa-2 teal lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "QTY",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "10%",
|
||||
class: "pa-2 teal lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "UNIT",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "10%",
|
||||
class: "pa-2 teal lighten-3 white--text"
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
computed: {
|
||||
vtests() {
|
||||
return this.$store.state.consumable.tests
|
||||
},
|
||||
selected_orderheaderid() {
|
||||
return this.$store.state.consumable.selected_orderheaderid
|
||||
},
|
||||
xconsumables() {
|
||||
return this.$store.state.consumable.consumables
|
||||
},
|
||||
isLoading() {
|
||||
return this.$store.state.consumable.search_consumable == 1
|
||||
},
|
||||
dialog_form: {
|
||||
get() {
|
||||
return this.$store.state.consumable.dialog_form
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("consumable/update_dialog_form", val)
|
||||
this.$store.dispatch("consumable/get_item")
|
||||
}
|
||||
},
|
||||
units() {
|
||||
return this.$store.state.consumable.satuans
|
||||
},
|
||||
selected_consumable: {
|
||||
get() {
|
||||
return this.$store.state.consumable.selected_consumable
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("consumable/update_selected_consumable", val)
|
||||
}
|
||||
},
|
||||
vitems() {
|
||||
return this.$store.state.consumable.items
|
||||
},
|
||||
snackbar: {
|
||||
get() {
|
||||
return this.$store.state.consumable.alert_success
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("consumable/update_alert_success", val)
|
||||
}
|
||||
},
|
||||
msgsnackbar: {
|
||||
get() {
|
||||
return this.$store.state.consumable.msg_success
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("consumable/update_msg_success", val)
|
||||
}
|
||||
},
|
||||
dialog_error: {
|
||||
get() {
|
||||
return this.$store.state.consumable.alert_error
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("consumable/update_alert_error", val)
|
||||
},
|
||||
},
|
||||
msgError() {
|
||||
return this.$store.state.consumable.error_message
|
||||
},
|
||||
xact: {
|
||||
get() {
|
||||
return this.$store.state.consumable.act
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("consumable/update_act", val)
|
||||
}
|
||||
},
|
||||
xact_notreset: {
|
||||
get() {
|
||||
return this.$store.state.consumable.act_notreset
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("consumable/update_act_notreset", val)
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
thr_search_orderheader: _.debounce(function () {
|
||||
this.$store.dispatch("consumable/gettest")
|
||||
this.$store.dispatch("consumable/searchconsumable")
|
||||
this.$store.dispatch("consumable/get_item")
|
||||
// this.$store.dispatch("consumable/get_satuan")
|
||||
}, 1000),
|
||||
// isSelected(p) {
|
||||
// return p.M_ConsumableID == this.$store.state.consumable.selected_consumable.M_ConsumableID
|
||||
// },
|
||||
selectMe(selected) {
|
||||
this.$store.commit("consumable/update_selected_consumable", selected)
|
||||
// this.$store.commit("consumable/update_last_id", selected.M_ConsumableID)
|
||||
},
|
||||
//validation
|
||||
itemconsumableValidation() {
|
||||
if (this.xgetitemconsumable.consumableid < 1 || !this.xgetitemconsumable.consumableid) {
|
||||
this.itemconsumable_error_message = "Pilih salah satu item"
|
||||
}
|
||||
if (this.xgetitemconsumable.consumableid > 0) {
|
||||
this.itemconsumable_error_message = ""
|
||||
}
|
||||
},
|
||||
resetAllInput() {
|
||||
this.xgetitemconsumable.consumableid = 0
|
||||
this.itemconsumable_error_message = ""
|
||||
},
|
||||
// tambah consumable
|
||||
addConsumable() {
|
||||
this.dialog_form = true
|
||||
this.xgetitemconsumable = ""
|
||||
this.resetAllInput()
|
||||
},
|
||||
saveAdd() {
|
||||
this.itemconsumableValidation()
|
||||
if (this.itemconsumable_error_message === "") {
|
||||
let prm = {
|
||||
orderheaderid: this.$store.state.consumable.selected_orderheaderid,
|
||||
consumableid: this.xgetitemconsumable.consumableid,
|
||||
satuanid: this.xgetitemconsumable.M_ConsumableDefaultM_SatuanID,
|
||||
qty: this.xgetitemconsumable.M_ConsumableDefaultQty,
|
||||
name: this.xgetitemconsumable.M_ConsumableName
|
||||
}
|
||||
this.$store.dispatch("consumable/addconsumable", prm)
|
||||
}
|
||||
},
|
||||
// reset
|
||||
confirmResetAll() {
|
||||
if (this.selected_consumable.isHidden === false) {
|
||||
this.$store.commit("consumable/update_act_notreset", "notreset")
|
||||
this.$store.commit("consumable/update_act", "")
|
||||
this.msgalert = "Tidak bisa di reset, Pasien belum memiliki item consumable"
|
||||
this.dialogdeletealert = true
|
||||
} else if (this.selected_consumable.isHidden === true) {
|
||||
this.$store.commit("consumable/update_act", "reset")
|
||||
this.msgalert = "Yakin, mau reset semua consumable ?"
|
||||
this.dialogdeletealert = true
|
||||
}
|
||||
},
|
||||
resetAll() {
|
||||
let prm = {
|
||||
orderheaderid: this.$store.state.consumable.selected_orderheaderid
|
||||
}
|
||||
this.$store.dispatch("consumable/reset", prm)
|
||||
this.dialogdeletealert = false
|
||||
},
|
||||
// save consumable
|
||||
openSaveConsumableAll() {
|
||||
this.$store.commit("consumable/update_act", "save")
|
||||
this.msgalert = "Yakin, mau simpan CONSUMABLE ?"
|
||||
|
||||
let datas = []
|
||||
for (let i = 0; i < this.xconsumables.length; i++) {
|
||||
const item = this.xconsumables[i];
|
||||
// console.log(item)
|
||||
var unitx = item.units
|
||||
// console.log(unitx)
|
||||
for (let j = 0; j < unitx.length; j++) {
|
||||
const itemUnit = unitx[j];
|
||||
var unit = itemUnit.M_SatuanID
|
||||
// console.log(unit)
|
||||
}
|
||||
|
||||
if (item.M_ConsumableDefaultQty === null ||
|
||||
item.M_ConsumableDefaultQty === "" ||
|
||||
item.T_ConsumableQty === null ||
|
||||
item.T_ConsumableQty === "")
|
||||
{
|
||||
this.clr = "black";
|
||||
this.msgsnackbar = "QTY ada yang kosong"
|
||||
this.snackbar = true;
|
||||
this.dialogdeletealert = false
|
||||
break;
|
||||
} else if (item.M_ConsumableDefaultQty !== null &&
|
||||
item.M_ConsumableDefaultQty !== "" &&
|
||||
item.T_ConsumableQty !== null &&
|
||||
item.T_ConsumableQty !== "")
|
||||
{
|
||||
this.dialogdeletealert = true
|
||||
}
|
||||
}
|
||||
},
|
||||
saveConsumableAll() {
|
||||
|
||||
if (this.selected_consumable.isHidden === false) {
|
||||
let datas = []
|
||||
for (let i = 0; i < this.xconsumables.length; i++) {
|
||||
const item = this.xconsumables[i];
|
||||
// console.log(item)
|
||||
var unitx = item.units
|
||||
// console.log(unitx)
|
||||
for (let j = 0; j < unitx.length; j++) {
|
||||
const itemUnit = unitx[j];
|
||||
var unit = itemUnit.M_SatuanID
|
||||
}
|
||||
|
||||
if (item.M_ConsumableDefaultQty === null ||
|
||||
item.M_ConsumableDefaultQty === "" ||
|
||||
item.M_ConsumableDefaultQty === "0" ||
|
||||
item.M_ConsumableDefaultQty === 0)
|
||||
{
|
||||
this.clr = "black";
|
||||
this.msgsnackbar = "QTY ada yang kosong"
|
||||
this.snackbar = true;
|
||||
this.dialogdeletealert = true
|
||||
break;
|
||||
} else if (item.M_ConsumableDefaultQty !== null &&
|
||||
item.M_ConsumableDefaultQty !== "")
|
||||
{
|
||||
this.dialogdeletealert = false
|
||||
const prm = {
|
||||
"orderheaderId": this.$store.state.consumable.selected_orderheaderid,
|
||||
"satuanId": item.M_SatuanID,
|
||||
"consumableId": item.M_ConsumableID,
|
||||
"consumableQty": item.M_ConsumableDefaultQty,
|
||||
"type": item.isHidden
|
||||
}
|
||||
datas.push(prm)
|
||||
}
|
||||
}
|
||||
// console.log("prm" + JSON.stringify(datas))
|
||||
if (datas.length > 0) {
|
||||
this.$store.dispatch("consumable/saveAllConsumable", {"data": datas})
|
||||
}
|
||||
} else if (this.selected_consumable.isHidden === true) {
|
||||
let datas = []
|
||||
for (let i = 0; i < this.xconsumables.length; i++) {
|
||||
const item = this.xconsumables[i];
|
||||
// console.log(item)
|
||||
var unitx = item.units
|
||||
// console.log(unitx)
|
||||
for (let j = 0; j < unitx.length; j++) {
|
||||
const itemUnit = unitx[j];
|
||||
var unit = itemUnit.M_SatuanID
|
||||
}
|
||||
|
||||
if (item.T_ConsumableQty === null ||
|
||||
item.T_ConsumableQty === "")
|
||||
{
|
||||
this.clr = "black";
|
||||
this.msgsnackbar = "QTY ada yang kosong"
|
||||
this.snackbar = true;
|
||||
this.dialogdeletealert = true
|
||||
break;
|
||||
} else if (item.T_ConsumableQty !== null &&
|
||||
item.T_ConsumableQty !== "")
|
||||
{
|
||||
this.dialogdeletealert = false
|
||||
const prm = {
|
||||
"orderheaderId": this.$store.state.consumable.selected_orderheaderid,
|
||||
"satuanId": item.M_SatuanID,
|
||||
"consumableId": item.M_ConsumableID,
|
||||
"consumableQty": item.T_ConsumableQty,
|
||||
"type": item.isHidden
|
||||
}
|
||||
datas.push(prm)
|
||||
}
|
||||
}
|
||||
// console.log("prm" + JSON.stringify(datas))
|
||||
if (datas.length > 0) {
|
||||
this.$store.dispatch("consumable/saveAllConsumable", {"data": datas})
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
selected_orderheaderid(val, old) {
|
||||
this.thr_search_orderheader()
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
315
test/vuex/one-list-consumable/components/onePatientList.vue
Normal file
315
test/vuex/one-list-consumable/components/onePatientList.vue
Normal file
@@ -0,0 +1,315 @@
|
||||
<template>
|
||||
<v-layout class="fill-height" column>
|
||||
|
||||
<v-card class="mb-2 pa-2 searchbox">
|
||||
<v-layout row>
|
||||
<v-flex xs6>
|
||||
<v-menu
|
||||
v-model="menufilterdatestart"
|
||||
:close-on-content-click="false" :nudge-right="40" lazy
|
||||
transition="scale-transition" offset-y full-width max-width="290px" min-width="290px">
|
||||
<template v-slot:activator="{ on }">
|
||||
<v-text-field
|
||||
v-model="filterComputedDateFormattedStart"
|
||||
class="mr-3" label="Tanggal Awal"
|
||||
outline hide-details readonly v-on="on"
|
||||
@blur="date = deFormatedDate(filterComputedDateFormattedStart)"></v-text-field>
|
||||
</template>
|
||||
<v-date-picker no-title
|
||||
v-model="xdatestart" @input="menufilterdatestart = false"></v-date-picker>
|
||||
</v-menu>
|
||||
</v-flex>
|
||||
<v-flex xs6>
|
||||
<v-menu
|
||||
v-model="menufilterdateend"
|
||||
:close-on-content-click="false" :nudge-right="40" lazy
|
||||
transition="scale-transition" offset-y full-width max-width="290px" min-width="290px">
|
||||
<template v-slot:activator="{ on }">
|
||||
<v-text-field
|
||||
v-model="filterComputedDateFormattedEnd"
|
||||
label="Tanggal Akhir"
|
||||
outline hide-details readonly v-on="on"
|
||||
@blur="date = deFormatedDate(filterComputedDateFormattedEnd)"></v-text-field>
|
||||
</template>
|
||||
<v-date-picker no-title
|
||||
v-model="xdateend" @input="menufilterdateend = false"></v-date-picker>
|
||||
</v-menu>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
|
||||
<v-layout row class="pt-2">
|
||||
<v-flex xs6>
|
||||
<v-text-field style="font-size:14px" label="No Reg / Nama" class="mr-3" outline
|
||||
v-model="vsearch" hide-details></v-text-field>
|
||||
</v-flex>
|
||||
<v-flex xs6>
|
||||
<v-autocomplete label="Kel. Pelanggan" v-model="selected_company" :items="xcompanys"
|
||||
:search-input.sync="search_company" auto-select-first hide-details style="font-size:14px" outline
|
||||
no-filter item-text="name" return-object no-data-text="Semua Kel. Pelanggan">
|
||||
<template slot="item" slot-scope="{ item }">
|
||||
<v-list-tile-content>
|
||||
<v-list-tile-title v-text="item.name"></v-list-tile-title>
|
||||
</v-list-tile-content>
|
||||
</template>
|
||||
</v-autocomplete>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card>
|
||||
<v-card>
|
||||
<v-layout row style="max-height:650px;overflow: auto;">
|
||||
<v-flex xs12 pl-2 pr-2 pt-2 pb-2>
|
||||
<v-data-table :headers="headers" :items="xpatients" :isLoading="isLoading" :pagination.sync="pagination" class="elevation-1 fixed_header">
|
||||
<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.rownumber }}
|
||||
</td>
|
||||
<td class="text-xs-left pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">
|
||||
{{ props.item.T_OrderHeaderLabNumber }}
|
||||
</td>
|
||||
<td class="text-xs-center pa-2" v-bind:class="{'amber lighten-4':isSelected(props.item)}" @click="selectMe(props.item)">
|
||||
{{ props.item.patient_fullname }}
|
||||
</td>
|
||||
|
||||
</template>
|
||||
<template>
|
||||
<div class="text-xs-center">
|
||||
<v-pagination v-model="page" :length="15" :total-visible="7"></v-pagination>
|
||||
</div>
|
||||
</template>
|
||||
</v-data-table>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card>
|
||||
|
||||
</v-layout>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.searchbox .v-input.v-text-field .v-input__slot {
|
||||
min-height: 60px;
|
||||
}
|
||||
|
||||
.searchbox .v-btn {
|
||||
min-height: 60px;
|
||||
}
|
||||
|
||||
table.v-table tbody td,
|
||||
table.v-table tbody th {
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
table.v-table thead tr {
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
.scroll-container {
|
||||
scroll-padding: 50px 0 0 50px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar {
|
||||
width: 7px;
|
||||
}
|
||||
|
||||
/* this targets the default scrollbar (compulsory) */
|
||||
|
||||
::-webkit-scrollbar-track {
|
||||
background-color: #73baf3;
|
||||
}
|
||||
|
||||
/* the new scrollbar will have a flat appearance with the set background color */
|
||||
|
||||
::-webkit-scrollbar-thumb {
|
||||
background-color: #2196f3;
|
||||
}
|
||||
|
||||
/* this will style the thumb, ignoring the track */
|
||||
|
||||
::-webkit-scrollbar-button {
|
||||
background-color: #0079da;
|
||||
}
|
||||
|
||||
/* optionally, you can style the top and the bottom buttons (left and right for horizontal bars) */
|
||||
|
||||
::-webkit-scrollbar-corner {
|
||||
background-color: black;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
data() {
|
||||
return {
|
||||
search_company: "",
|
||||
menufilterdatestart: false,
|
||||
menufilterdateend:false,
|
||||
date: new Date().toISOString().substr(0, 10),
|
||||
headers: [{
|
||||
text: "NO",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "5%",
|
||||
class: "pa-2 teal lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "NO REG",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "8%",
|
||||
class: "pa-2 teal lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "NAMA",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "20%",
|
||||
class: "pa-2 teal lighten-3 white--text"
|
||||
},
|
||||
],
|
||||
page: 1,
|
||||
pagination: {
|
||||
descending: false,
|
||||
page: 1,
|
||||
rowsPerPage: 5,
|
||||
sortBy: 'T_OrderHeaderLabNumber',
|
||||
totalItems: this.$store.state.patient.total_patients
|
||||
},
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.$store.dispatch("patient/search", {
|
||||
startdate: this.$store.state.patient.start_date,
|
||||
enddate: this.$store.state.patient.end_date,
|
||||
search: this.vsearch,
|
||||
companyid: this.selected_company.id,
|
||||
last_id: -1
|
||||
})
|
||||
},
|
||||
computed: {
|
||||
xcompanys() {
|
||||
return this.$store.state.patient.companys
|
||||
},
|
||||
selected_company: {
|
||||
get() {
|
||||
return this.$store.state.patient.selected_company
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("patient/update_selected_company", val)
|
||||
this.searchPatient()
|
||||
}
|
||||
},
|
||||
xpatients() {
|
||||
return this.$store.state.patient.patients
|
||||
},
|
||||
isLoading() {
|
||||
return this.$store.state.patient.search_status == 1
|
||||
},
|
||||
vsearch: {
|
||||
get() {
|
||||
return this.$store.state.patient.x_search
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("patient/update_x_search", val)
|
||||
}
|
||||
},
|
||||
xdatestart: {
|
||||
get() {
|
||||
return this.$store.state.patient.start_date
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("patient/update_start_date",val)
|
||||
this.$store.commit("patient/update_last_id", -1)
|
||||
}
|
||||
},
|
||||
xdateend: {
|
||||
get() {
|
||||
return this.$store.state.patient.end_date
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("patient/update_end_date",val)
|
||||
this.$store.commit("patient/update_last_id", -1)
|
||||
}
|
||||
},
|
||||
filterComputedDateFormattedStart () {
|
||||
return this.formatDate(this.xdatestart)
|
||||
},
|
||||
filterComputedDateFormattedEnd () {
|
||||
return this.formatDate(this.xdateend)
|
||||
},
|
||||
selected_patient: {
|
||||
get() {
|
||||
return this.$store.state.patient.selected_patient
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
isSelected(p) {
|
||||
return p.T_OrderHeaderID == this.$store.state.patient.selected_patient.T_OrderHeaderID
|
||||
},
|
||||
selectMe(selected) {
|
||||
this.$store.commit("patient/update_selected_patient", selected)
|
||||
this.$store.commit("patient/update_last_id", selected.T_OrderHeaderID)
|
||||
this.$store.commit("consumable/update_last_id", -1)
|
||||
},
|
||||
thr_search_company: _.debounce(function () {
|
||||
this.$store.dispatch("patient/getcompany", this.search_company)
|
||||
}, 1000),
|
||||
thr_search: _.debounce(function () {
|
||||
this.$store.dispatch("patient/search", {
|
||||
startdate: this.$store.state.patient.start_date,
|
||||
enddate: this.$store.state.patient.end_date,
|
||||
search: this.vsearch,
|
||||
companyid: this.selected_company.id,
|
||||
last_id: -1
|
||||
})
|
||||
}, 1000),
|
||||
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')}`
|
||||
},
|
||||
searchPatient() {
|
||||
this.$store.dispatch("patient/search", {
|
||||
startdate: this.$store.state.patient.start_date,
|
||||
enddate: this.$store.state.patient.end_date,
|
||||
search: this.vsearch,
|
||||
companyid: this.selected_company.id,
|
||||
last_id: -1
|
||||
})
|
||||
}
|
||||
},
|
||||
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();
|
||||
},
|
||||
vsearch(val, old) {
|
||||
this.vsearch = val
|
||||
this.thr_search()
|
||||
},
|
||||
xdatestart(val, old) {
|
||||
this.xdatestart = val
|
||||
this.thr_search()
|
||||
},
|
||||
xdateend(val, old) {
|
||||
this.xdateend = val
|
||||
this.thr_search()
|
||||
},
|
||||
selected_patient(val, old) {
|
||||
this.$store.commit("consumable/update_selected_orderheaderid", val.T_OrderHeaderID)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user