523 lines
18 KiB
Vue
523 lines
18 KiB
Vue
<template>
|
|
<v-layout class="fill-height" column>
|
|
<v-dialog v-model="dialogsuccess" persistent max-width="290">
|
|
<v-card>
|
|
<v-card-title color="success" class="headline">Berhasil !</v-card-title>
|
|
<v-card-text>
|
|
{{msgsuccess}}
|
|
</v-card-text>
|
|
<v-card-actions>
|
|
<v-spacer></v-spacer>
|
|
<v-btn color="green darken-1" flat @click="closeDialogSuccess">OK</v-btn>
|
|
</v-card-actions>
|
|
</v-card>
|
|
</v-dialog>
|
|
<v-dialog v-model="dialogbarcode" persistent max-width="490">
|
|
<v-card>
|
|
<v-card-title style="color:#fff" class="headline grey darken-1">Cetak Barcode</v-card-title>
|
|
<v-card-text>
|
|
<v-layout pa-2 class="grey lighten-2" row>
|
|
|
|
|
|
</v-layout>
|
|
|
|
</v-card-text>
|
|
<v-card-actions>
|
|
<v-spacer></v-spacer>
|
|
<v-btn color="grey darken-1" flat @click="dialogbarcode = false">Tutup</v-btn>
|
|
<v-btn dark color="grey darken-1" @click="printMultipleBarcode">Cetak terpilih [ {{selected_barcode.length}} ]</v-btn>
|
|
|
|
</v-card-actions>
|
|
</v-card>
|
|
</v-dialog>
|
|
<v-card class="mb-2 pa-2 searchbox">
|
|
<v-layout align-center row >
|
|
<v-flex xs3>
|
|
<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
|
|
class="mr-2"
|
|
v-model="filterComputedDateFormattedStart"
|
|
label="Tanggal Transaksi"
|
|
|
|
outline
|
|
hide-details
|
|
readonly
|
|
v-on="on"
|
|
@blur="date = deFormatedDate(filterComputedDateFormattedStart)"
|
|
></v-text-field>
|
|
</template>
|
|
<v-date-picker v-model="xdatestart" no-title @input="menufilterdatestart = false"></v-date-picker>
|
|
</v-menu>
|
|
</v-flex>
|
|
<v-flex xs4 pr-2>
|
|
<v-text-field
|
|
label="Cari"
|
|
outline
|
|
v-model="nolab"
|
|
Placeholder="No Reg / Nama"
|
|
hide-details
|
|
v-on:keyup.enter="searchTransaction"
|
|
></v-text-field>
|
|
</v-flex>
|
|
<v-flex xs3 pr-2>
|
|
<v-select class="mini-select"
|
|
:items="filter_kerajaan"
|
|
item-text="name"
|
|
return-object
|
|
style="font-size:14px"
|
|
v-model="selected_filter_kerajaan"
|
|
label="Pengambilan Hasil" outline hide-details></v-select>
|
|
</v-flex>
|
|
<!--<v-flex xs2 v-if="btn_hide === false" text-md-right>
|
|
<span title="Terima" @click="doSend" class="icon-medium-fill-base xs1 white--text success"><v-icon large dark>move_to_inbox</v-icon></span>
|
|
</v-flex>-->
|
|
<!--<span @click="searchTransaction" class="icon-medium-fill-base xs1 white--text success iconsearch-search"></span>-->
|
|
|
|
</v-layout>
|
|
</v-card>
|
|
<v-card >
|
|
<v-layout style="overflow-x:auto;max-height:610px" row>
|
|
<v-flex xs12 pl-2 pr-2 pt-2 pb-2>
|
|
<v-data-table
|
|
:headers="headers"
|
|
:items="xtransactions"
|
|
:loading="isLoading"
|
|
hide-actions
|
|
class="elevation-1">
|
|
|
|
<template v-slot:items="props">
|
|
<td class="text-xs-left pa-2">
|
|
<span class="font-weight-bold subtitle-2" style="color:#800000">{{ props.item.ordernumber_ext }}</span>
|
|
<span class="font-weight-bold caption black--text">{{ props.item.ordernumber }}</span>
|
|
</td>
|
|
<td class="text-xs-left pa-2">
|
|
<p title="janji hasil" class="mb-0 mono caption">{{props.item.promise_datetime}}</p>
|
|
<p class="mb-0 font-weight-black">{{ props.item.patient_fullname}}</p>
|
|
<p class="mb-0"><kbd>{{ props.item.delivery }}</kbd></p>
|
|
</td>
|
|
<td class="text-xs-left pa-2">
|
|
{{props.item.group_name}}
|
|
</td>
|
|
<td class="text-xs-left pa-2">
|
|
<p class="mb-0 mono font-weight-black caption">{{ props.item.sender_name}}</p>
|
|
<p class="mb-0 mono"><kbd color="info">{{ props.item.send_time }}</kbd></p>
|
|
</td>
|
|
<td class="text-xs-left pa-2">
|
|
<p class="mb-0 mono font-weight-black caption">{{ props.item.receiver_name}}</p>
|
|
<p class="mb-0 mono"><kbd color="pink">{{ props.item.receive_time }}</kbd></p>
|
|
</td>
|
|
<td class="text-xs-center pa-2">
|
|
<span title="Balikin" v-if="props.item.status === 'R'" @click="cancelReceived(props.item)" class="icon-medium-fill-base-small white--text black">
|
|
<v-icon dark>cancel</v-icon>
|
|
</span>
|
|
<span title="Sudah selesai" v-if="props.item.status === 'D'" class="icon-medium-fill-base-small white--text teal">
|
|
<v-icon dark>lock</v-icon>
|
|
</span>
|
|
</td>
|
|
</template>
|
|
</v-data-table>
|
|
</v-flex>
|
|
</v-layout>
|
|
</v-card>
|
|
<one-dialog-alert :status="openalertconfirmation" :msg="msgalertconfirmation" @forget-dialog-alert="forgetAlertConfirmation()" @close-dialog-alert="closeAlertConfirmation()"></one-dialog-alert>
|
|
<one-dialog-info :status="opendialoginfo" :msg="msginfo" @close-dialog-info="closeDialogInfo()"></one-dialog-info>
|
|
</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;
|
|
}
|
|
|
|
</style>
|
|
|
|
<script>
|
|
module.exports = {
|
|
components : {
|
|
'one-dialog-info':httpVueLoader('../../common/oneDialogInfo.vue'),
|
|
'one-dialog-alert':httpVueLoader('../../common/oneDialogAlert.vue')
|
|
},
|
|
mounted() {
|
|
//this.$store.dispatch("form/getalmaries")
|
|
this.$store.dispatch("patient/getkerajaan",{
|
|
xdate:this.xdatestart,
|
|
nolab: this.nolab,
|
|
groupid:this.selected_filter_kerajaan.id
|
|
})
|
|
},
|
|
methods : {
|
|
changeCbxAll(value){
|
|
var arr = this.xtransactions
|
|
this.indeterminatex = false
|
|
this.btn_hide = true
|
|
arr.forEach((el)=>{el.chex = value})
|
|
var selected = _.filter(arr, function(o) { return o.chex; })
|
|
this.$store.commit("patient/update_selected_transaction",selected)
|
|
if(selected.length > 0)
|
|
this.btn_hide = false
|
|
},
|
|
printSingleBarcode(value){
|
|
var label = value.T_BarcodeLabBarcode
|
|
if(value.type === 'barcode')
|
|
one_print_barcode_pk(label)
|
|
else
|
|
one_print_barcode_formulir(value.id)
|
|
},
|
|
printMultipleBarcode(){
|
|
var arr = this.barcodes
|
|
var xarrtojoin = []
|
|
var xformulir = {}
|
|
_.forEach(arr, function(value) {
|
|
//console.log(value)
|
|
if(value.chex && value.type === 'barcode'){
|
|
xarrtojoin.push(value.T_BarcodeLabBarcode)
|
|
}
|
|
if(value.chex && value.type === 'formulir'){
|
|
xformulir = value
|
|
}
|
|
})
|
|
if(xarrtojoin.length > 0 ){
|
|
one_print_barcode_pk(xarrtojoin.join(','))
|
|
}
|
|
|
|
if(!_.isEmpty(xformulir)){
|
|
//console.log("oeoeooeoe")
|
|
one_print_barcode_formulir(xformulir.id)
|
|
}
|
|
|
|
},
|
|
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.ohid == this.$store.state.patient.selected_transaction.ohid
|
|
},
|
|
searchTransaction() {
|
|
this.$store.dispatch("patient/search",{
|
|
xdate:this.xdatestart,
|
|
nolab: this.nolab,
|
|
groupid:this.selected_filter_kerajaan.id
|
|
})
|
|
},
|
|
selectMe(trx) {
|
|
|
|
},
|
|
closeAlertConfirmation(){
|
|
this.$store.commit("patient/update_open_alert_confirmation",false)
|
|
},
|
|
forgetAlertConfirmation(){
|
|
this.$store.commit("patient/update_no_save",0)
|
|
this.$store.commit("patient/update_open_alert_confirmation",false)
|
|
},
|
|
updateAlert_success(val){
|
|
this.$store.commit("patient/update_alert_success",val)
|
|
},
|
|
setNewTransaction(){
|
|
this.$store.commit("patient/update_selected_transaction",{})
|
|
this.$store.commit("patient/update_act",'new')
|
|
|
|
},
|
|
closeDialogSuccess(){
|
|
let arrtrx = this.$store.state.patient.transactions
|
|
var idx = _.findIndex(arrtrx, item => item.T_SampleStorageID === this.$store.state.patient.last_id)
|
|
console.log(idx)
|
|
this.$store.dispatch("patient/search",{
|
|
startdate:this.xdatestart,
|
|
enddate: this.xdateend,
|
|
search:this.search,
|
|
current_page:1,
|
|
lastid: idx
|
|
})
|
|
this.$store.commit("patient/update_dialog_success",false)
|
|
},
|
|
closeDialogInfo(){
|
|
this.$store.commit("patient/update_open_dialog_info",false)
|
|
},
|
|
openbarcodeprint(value){
|
|
this.bar_chx_all = false
|
|
this.indeterminatex = false
|
|
this.dialogbarcode = true
|
|
this.selected_barcode = []
|
|
this.$store.dispatch("patient/lookup_barcodes",value)
|
|
},
|
|
checkTop(){
|
|
this.btn_hide = true
|
|
var barcodes = this.xtransactions
|
|
var selected = _.filter(barcodes, function(o) { return o.chex; })
|
|
this.bar_chx_all = false
|
|
this.indeterminatex = false
|
|
if(selected.length > 0 && barcodes.length === selected.length){
|
|
this.bar_chx_all = true
|
|
this.indeterminatex = false
|
|
this.btn_hide = false
|
|
}
|
|
if(selected.length > 0 && barcodes.length > selected.length){
|
|
this.bar_chx_all = false
|
|
this.indeterminatex = true
|
|
this.btn_hide = false
|
|
}
|
|
this.$store.commit("patient/update_selected_transaction",selected)
|
|
|
|
},
|
|
cancelReceived(value){
|
|
//console.log("closedialogaction")
|
|
this.$store.dispatch("patient/cancelreceived",value)
|
|
|
|
},
|
|
|
|
},
|
|
computed: {
|
|
filter_kerajaan: {
|
|
get() {
|
|
return this.$store.state.patient.filter_kerajaan
|
|
},
|
|
set(val) {
|
|
this.$store.commit("patient/update_filter_kerajaan",val)
|
|
}
|
|
},
|
|
selected_filter_kerajaan: {
|
|
get() {
|
|
return this.$store.state.patient.selected_filter_kerajaan
|
|
},
|
|
set(val) {
|
|
this.$store.commit("patient/update_selected_filter_kerajaan",val)
|
|
this.searchTransaction()
|
|
}
|
|
},
|
|
btn_hide: {
|
|
get() {
|
|
return this.$store.state.patient.btn_hide
|
|
},
|
|
set(val) {
|
|
this.$store.commit("patient/update_btn_hide",val)
|
|
}
|
|
},
|
|
name: {
|
|
get() {
|
|
return this.$store.state.patient.name
|
|
},
|
|
set(val) {
|
|
this.$store.commit("patient/update_name",val)
|
|
}
|
|
},
|
|
nolab: {
|
|
get() {
|
|
return this.$store.state.patient.nolab
|
|
},
|
|
set(val) {
|
|
this.$store.commit("patient/update_nolab",val)
|
|
}
|
|
},
|
|
dialogsuccess: {
|
|
get() {
|
|
return this.$store.state.patient.dialog_success
|
|
},
|
|
set(val) {
|
|
this.$store.commit("patient/update_dialog_success",val)
|
|
}
|
|
},
|
|
msgsuccess(){
|
|
return this.$store.state.patient.msg_success
|
|
},
|
|
snackbar: {
|
|
get() {
|
|
return this.$store.state.patient.alert_success
|
|
},
|
|
set(val) {
|
|
this.$store.commit("patient/update_alert_success",val)
|
|
}
|
|
},
|
|
barcodes: {
|
|
get() {
|
|
return this.$store.state.patient.barcodes
|
|
},
|
|
set(val) {
|
|
this.$store.commit("patient/update_patient_barcodes",val)
|
|
}
|
|
},
|
|
isLoading() {
|
|
return this.$store.state.patient.search_status == 1
|
|
},
|
|
xdatestart : {
|
|
get() {
|
|
return this.$store.state.patient.start_date
|
|
},
|
|
set(val) {
|
|
this.$store.commit("patient/update_start_date",val)
|
|
this.searchTransaction()
|
|
}
|
|
},
|
|
xdateend : {
|
|
get() {
|
|
return this.$store.state.patient.end_date
|
|
},
|
|
set(val) {
|
|
this.$store.commit("patient/update_end_date",val)
|
|
this.searchTransaction()
|
|
}
|
|
},
|
|
filterComputedDateFormattedStart () {
|
|
return this.formatDate(this.xdatestart)
|
|
},
|
|
filterComputedDateFormattedEnd () {
|
|
return this.formatDate(this.xdateend)
|
|
},
|
|
xtransactions() {
|
|
console.log(this.$store.state.patient.transactions)
|
|
return this.$store.state.patient.transactions
|
|
},
|
|
openalertconfirmation: {
|
|
get() {
|
|
return this.$store.state.patient.open_alert_confirmation
|
|
},
|
|
set(val) {
|
|
this.$store.commit("patient/update_open_alert_confirmation",val)
|
|
}
|
|
},
|
|
opendialoginfo: {
|
|
get() {
|
|
return this.$store.state.patient.open_dialog_info
|
|
},
|
|
set(val) {
|
|
this.$store.commit("patient/update_open_dialog_info",false)
|
|
}
|
|
},
|
|
msginfo(){
|
|
return this.$store.state.patient.msg_info
|
|
},
|
|
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.xdatestart,
|
|
enddate: this.xdateend,
|
|
current_page:val,
|
|
lastid:-1
|
|
})
|
|
}
|
|
},
|
|
xtotal_page: {
|
|
get() {
|
|
return this.$store.state.patient.total_page
|
|
},
|
|
set(val) {
|
|
this.$store.commit("patient/update_total_page",val)
|
|
}
|
|
},
|
|
bar_chx_all: {
|
|
get() {
|
|
return this.$store.state.patient.bar_chx_all
|
|
},
|
|
set(val) {
|
|
this.$store.commit("patient/update_bar_chx_all",val)
|
|
}
|
|
},
|
|
},
|
|
data() {
|
|
return {
|
|
msgalertconfirmation:"Perubahan yang telah dilakukan belum disimpan dong !",
|
|
menufilterdatestart:false,
|
|
menufilterdateend:false,
|
|
dialogbarcode:false,
|
|
date: new Date().toISOString().substr(0, 10),
|
|
items: [],
|
|
page:1,
|
|
indeterminatex:false,
|
|
checkednotall:false,
|
|
//bar_chx_all:false,
|
|
selected_barcode:[],
|
|
headers: [
|
|
{
|
|
text: "NO REG",
|
|
align: "left",
|
|
sortable: false,
|
|
value: "name",
|
|
width: "10%",
|
|
class: "pa-2 pink text-xs-left white--text"
|
|
},
|
|
{
|
|
text: "NAMA",
|
|
align: "left",
|
|
sortable: false,
|
|
value: "status",
|
|
width: "20%",
|
|
class: "pa-2 pink text-xs-left white--text"
|
|
},
|
|
{
|
|
text: "PEMERIKSAAN",
|
|
align: "left",
|
|
sortable: false,
|
|
value: "status",
|
|
width: "25%",
|
|
class: "pa-2 pink text-xs-left white--text"
|
|
},
|
|
{
|
|
text: "PENGIRIM",
|
|
align: "left",
|
|
sortable: false,
|
|
value: "status",
|
|
width: "15%",
|
|
class: "pa-2 pink text-xs-left white--text"
|
|
},
|
|
{
|
|
text: "PENERIMA",
|
|
align: "left",
|
|
sortable: false,
|
|
value: "status",
|
|
width: "15%",
|
|
class: "pa-2 pink text-xs-left white--text"
|
|
},
|
|
{
|
|
text: "AKSI",
|
|
align: "center",
|
|
sortable: false,
|
|
value: "status",
|
|
width: "10%",
|
|
class: "pa-2 pink text-xs-left white--text"
|
|
}
|
|
],
|
|
pagination:{
|
|
descending: false,
|
|
page: 1,
|
|
rowsPerPage: 5,
|
|
sortBy: 'T_SampleStorageDate',
|
|
totalItems: this.$store.state.patient.total_transactions
|
|
}
|
|
};
|
|
}
|
|
}
|
|
</script>
|