Files
FE_CPONE/test/vuex/one-result-print-adm-v7/components/oneProcessReSearchBox.vue
2026-04-27 10:13:31 +07:00

350 lines
12 KiB
Vue

<template>
<div>
<v-card class="mb-1 pa-1">
<v-layout row>
<v-flex xs10>
<v-layout row>
<v-flex xs2>
<one-date-picker
label="Tanggal"
:date="sdate"
data="0"
@change="changeDate"
></one-date-picker>
</v-flex>
<v-flex xs2>
<v-text-field class="ma-1"
label="Cari ..."
placeholder="No Reg / Nama"
outline
hide-details
v-model="search"
v-on:keyup.enter="searchs"
></v-text-field>
</v-flex>
<v-flex class="ma-1 pt-1 text-xs-left" xs1>
<span title="tidak termasuk" v-if="switch_exclude" @click="switch_exclude = !switch_exclude" class="icon-medium-fill-base-small xs1 white--text red"><v-icon dark>assignment_late</v-icon></span>
<span title="termasuk" v-if="!switch_exclude" @click="switch_exclude = !switch_exclude" class="icon-medium-fill-base-small xs1 white--text blue"><v-icon dark>assignment_turned_in</v-icon></span>
</v-flex>
<v-flex style="margin-left:-60px" xs2>
<v-autocomplete
v-model="company"
:items="companies"
outline
:loading="loading_company"
:search-input.sync="search_company"
class=" ma-1 ml-1 mini-select mr-1"
hide-no-data
filled
item-text="M_CompanyName"
item-value="M_CompanyID"
label="Filter Kel. Pelanggan"
placeholder="Cari Kelompok Pelanggan"
return-object
></v-autocomplete>
</v-flex>
<v-flex class="pl-2 pt-1" xs2>
<v-select
:search-input.sync="searchXMou"
autocomplete
outline
v-model="agreement"
:items="agreements"
:disabled="_.isEmpty(company) || company.M_CompanyID === 0"
style="font-size:12px;"
auto-select-first
item-text = "M_MouName"
return-object
label="Agreement"
hide-details
class="mb-1"
>
<template
slot="item"
slot-scope="{ item }"
>
<v-list-tile-content>
<v-list-tile-title v-text="item.M_MouName"></v-list-tile-title>
<v-list-tile-sub-title v-text="getMouDate(item)"></v-list-tile-sub-title>
</v-list-tile-content>
</template>
</v-select>
</v-flex>
</v-layout>
</v-flex>
<v-flex xs2 pt-1 align-center pr-2 class="text-xs-right" >
<v-btn @click="releaseResult()" block dark color="blue darken-2">SERAHKAN</v-btn>
</v-flex>
</v-layout>
<one-dialog-info :status="opendialoginfo" :msg="msginfo" @close-dialog-info="opendialoginfo = false"></one-dialog-info>
</v-card>
</div>
</template>
<style scoped>
.btn-legend {
height: 25px;
width: 25px;
border-radius: 0%;
}
.btn-search {
font-size: 1.5em
}
.v-input input {
max-height: 25px;
}
</style>
<script>
module.exports = {
components : {
'one-date-picker' : httpVueLoader('./oneDatePicker.vue'),
'one-dialog-info':httpVueLoader('../../common/oneDialogInfo.vue')
},
data() {
return {
search_company: '',
search_agreement:'',
opendialoginfo:false,
msginfo:'',
searchXMou:''
}
},
watch : {
search_company(n,o) {
this.$store.dispatch('company/search',n)
},
search_agreement(n,o) {
this.$store.dispatch('company/search_agreement',n)
}
},
computed : {
switch_exclude: {
get() {
return this.$store.state.re_patient.switch_exclude
},
set(val) {
this.$store.commit("re_patient/update_switch_exclude",val)
this.searchs()
}
},
company: {
get() { return this.$store.state.company.company },
set(v) {
this.$store.commit('company/update_company',v)
this.$store.commit('company/update_agreements',v.mous)
this.$store.commit('company/update_agreement',{ M_MouID : 0 , M_MouName : 'All',M_MouStartDate:'',M_MouEndDate:'' })
this.searchs()
}
},
companies() {
return this.$store.state.company.companies
},
agreement: {
get() { return this.$store.state.company.agreement },
set(v) {
this.$store.commit('company/update_agreement',v)
this.searchs()
}
},
agreements() {
return this.$store.state.company.agreements
},
deliveries() {
return this.$store.state.re_patient.deliveries
},
selected_delivery: {
get() { return this.$store.state.re_patient.selected_delivery },
set(v) {
this.$store.commit('re_patient/update_selected_delivery',v)
this.searchs()
//this.$store.dispatch('re_patient/search')
}
},
search_status() {
return this.$store.state.re_patient.search_status
},
loading_company() {
return this.$store.state.company.loading
},
loading_agreement() {
return this.$store.state.company.loading_agreement
},
nolab : {
get () { return this.$store.state.re_patient.nolab },
set (v) { this.$store.commit('re_patient/update_nolab', v) }
},
search : {
get () { return this.$store.state.re_patient.search },
set (v) { this.$store.commit('re_patient/update_search', v) }
},
groups () {
return this.$store.state.re_px.groups
},
selected_group : {
get () { return this.$store.state.re_px.selected_group },
set (v) { this.$store.commit('re_px/update_selected_group', v) }
},
order_id () {
return this.$store.state.re_px.order_id
},
contain_val () {
return this.$store.state.re_px.contain_val
},
lang () {
return {code:this.$store.state.re_patient.selected_patient.M_LangCode, is_si:this.$store.state.re_patient.selected_patient.is_si}
},
img_lang () {
if (this.lang.code == "ID")
return "flag-ina_48.png"
else if (this.lang.code == "EN")
return "flag-us_48.png"
},
sdate : {
get () { return this.$store.state.re_patient.s_date },
set (v) { this.$store.commit('re_patient/update_sdate', v) }
},
selected_patient () {
return this.$store.state.re_patient.selected_patient
},
btn_history_show () {
if (!this.selected_patient) return false
if (!this.selected_patient.is_history) return false
if (this.selected_patient.is_history == "N") return false
return true
},
info_req_perfect () {
let x = false
try {
x = this.$store.state.re_patient.info_req.is_perfect == 'Y';
} catch (error) {
}
return x
},
btn_validation_enable() {
return true
let x = this.$store.state.re_px.pxs
// console.log(x)
let y = 0, n = 0
for(let i in x) {
// console.log(i+' : '+x[i].t_testname+' : '+x[i].is_result+' : '+x[i].validation+' : '+x[i].verification)
if (x[i].is_result == 'Y') {
n++
if (x[i].validation == 'Y')
{y++;}
}
}
// console.log("n:"+n+" y:"+y)
if (y < 1) return false
return true
},
btn_validation_show() {
let x = this.$store.state.re_px.pxs
let z = 0, n = 0
for(let i in x) {
if (x[i].is_result == 'Y') {
n++
if (x[i].validation_old == 'Y')
z++
}
}
if (z == n) return false
return true
}
},
methods : {
getMouDate(item) {
return item.M_MouStartDate + ' s/d ' + item.M_MouEndDate
},
releaseResult() {
var patients = this.$store.state.re_patient.selected_patients
var selectall = this.$store.state.re_patient.bar_chx_all
if(selectall || (!selectall && patients.length > 0 ))
this.$store.dispatch('re_patient/releaseresult')
else{
this.msginfo = "<p>Ijinkan daku bertanya, apa yang harus daku serahkan ? tak ada yang bisa daku perbuat, jika tak satupun yang kau pilih</p>"
this.opendialoginfo = true
}
},
searchs() {
this.$store.commit('re_patient/update_current_page',1)
this.$store.commit('re_patient/update_bar_chx_all', false)
this.$store.dispatch('re_patient/search')
},
keySearch(e) {
if (e.which == 13) {
this.searchs()
}
},
save_result() {
this.$store.dispatch('re_px/confirm')
},
histories() {
this.$store.commit('re_history/update_dialog_history', true)
},
printMe() {
this.$store.commit('re_patient/update_rpt_url', this.$store.state.re_patient.selected_patient.T_OrderHeaderID)
this.$store.commit('re_patient/update_print_dialog', true)
this.$store.dispatch('re_px/print_count')
},
img_lang_2 (lang, si) {
if (lang == "ID" && si == "N")
return "inako.png"
if (lang == "ID" && si == "Y")
return "inasi.png"
if (lang == "EN" && si == "N")
return "engko.png"
if (lang == "EN" && si == "Y")
return "engsi.png"
},
changeDate(x) {
this.sdate = x.new_date
this.searchs()
},
note() {
this.$store.commit('re_patient/update_dialog_note', true)
},
info() {
this.$store.commit('re_patient/update_dialog_req', true)
},
unvalidate() {
this.$store.dispatch('re_px/unvalidate')
}
},
mounted () {
this.$store.dispatch('re_px/search_group')
}
}
</script>