Flatten nested repos
This commit is contained in:
397
test/vuex/cpone-setup-mcu/components/oneMdPatientAddress.vue
Normal file
397
test/vuex/cpone-setup-mcu/components/oneMdPatientAddress.vue
Normal file
@@ -0,0 +1,397 @@
|
||||
<template>
|
||||
<v-layout v-if="xact !== 'new'" column >
|
||||
<v-dialog v-model="dialogconfirmationdeleteaddr" persistent max-width="290">
|
||||
<v-card>
|
||||
<v-card-title
|
||||
dark
|
||||
class="headline error pt-2 pb-2"
|
||||
primary-title
|
||||
style="color:white"
|
||||
>
|
||||
<h4 dark>Konfirmasi</h4>
|
||||
</v-card-title>
|
||||
<v-card-text>
|
||||
{{msgconfirmationdeleteaddr}}
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn small v-if="!checkError('deleteutama')" color="error darken-1 text-sm-left" flat @click="doDeleteAddr()">Hapus</v-btn>
|
||||
<v-btn small color="primary darken-1 text-sm-right" flat @click="dialogconfirmationdeleteaddr = false">Batal</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
<v-dialog v-model="dialogformaddress" persistent max-width="650">
|
||||
<v-card>
|
||||
<v-card-title>
|
||||
<span class="headline">Form Alamat Pasien</span>
|
||||
</v-card-title>
|
||||
<v-card-text class="pt-0 pb-0">
|
||||
<v-layout wrap>
|
||||
<v-flex xs12>
|
||||
<v-text-field v-model="labeladdress" label="Label"></v-text-field>
|
||||
<p v-if="checkError('requiredlabel')" class="error pl-2 pr-2" style="color:#fff">Jangan kosong dong</p>
|
||||
<p v-if="checkError('readonlyutama')" class="error pl-2 pr-2" style="color:#fff">Biarkan jadi yang utama</p>
|
||||
</v-flex>
|
||||
<v-flex xs12>
|
||||
<v-layout row>
|
||||
<v-flex xs4 pa-1>
|
||||
<v-autocomplete
|
||||
label="Kota"
|
||||
v-model="cityaddress"
|
||||
:items="xcities"
|
||||
:search-input.sync="search_city"
|
||||
auto-select-first
|
||||
no-filter
|
||||
item-text="M_CityName"
|
||||
return-object
|
||||
:loading="isLoading"
|
||||
no-data-text="Pilih Kota"
|
||||
>
|
||||
<template
|
||||
slot="item"
|
||||
slot-scope="{ item }"
|
||||
>
|
||||
<v-list-tile-content>
|
||||
<v-list-tile-title v-text="item.M_CityName"></v-list-tile-title>
|
||||
</v-list-tile-content>
|
||||
</template>
|
||||
</v-autocomplete>
|
||||
<p v-if="checkError('requiredcity')" class="error pl-2 pr-2" style="color:#fff">Jangan kosong dong</p>
|
||||
</v-flex>
|
||||
<v-flex xs4 pa-1>
|
||||
<v-select
|
||||
item-text="M_DistrictName"
|
||||
return-object
|
||||
:items="xdistricts"
|
||||
v-model="districtaddress"
|
||||
label="Kecamatan*"
|
||||
></v-select>
|
||||
<p v-if="checkError('requireddistrict')" class="error pl-2 pr-2" style="color:#fff">Jangan kosong dong</p>
|
||||
</v-flex>
|
||||
<v-flex xs4 pa-1>
|
||||
<v-select
|
||||
item-text="M_KelurahanName"
|
||||
return-object
|
||||
:items="xkelurahans"
|
||||
v-model="kelurahanaddress"
|
||||
label="Kelurahan / Desa*"
|
||||
></v-select>
|
||||
<p v-if="checkError('requiredkelurahan')" class="error pl-2 pr-2" style="color:#fff">Jangan kosong dong</p>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
<v-flex xs12>
|
||||
<v-textarea
|
||||
box
|
||||
label="Alamat Lengkap"
|
||||
v-model="descriptionaddress"
|
||||
></v-textarea>
|
||||
<p v-if="checkError('requireddescription')" class="error pl-2 pr-2" style="color:#fff">Jangan kosong dong</p>
|
||||
</v-flex>
|
||||
|
||||
</v-layout>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn color="blue darken-1" flat @click="dialogformaddress = false">Tutup</v-btn>
|
||||
<v-btn v-if="xactaddr === 'new'" color="blue darken-1" flat @click="saveNewAddress()">Simpan</v-btn>
|
||||
<v-btn v-if="xactaddr === 'edit'" color="blue darken-1" flat @click="saveEditAddress()">Simpan</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
<v-card>
|
||||
<v-layout row>
|
||||
<v-flex xs12>
|
||||
<v-subheader red--text text--lighten-1> ALAMAT PASIEN
|
||||
<v-flex text-md-right>
|
||||
<v-btn @click="createNewAddress()" small color="info">Baru</v-btn>
|
||||
</v-flex>
|
||||
</v-subheader>
|
||||
<v-divider></v-divider>
|
||||
<v-layout row wrap>
|
||||
<v-flex xs12 pa-2>
|
||||
<v-data-table
|
||||
:headers="headers"
|
||||
:items="xaddresses"
|
||||
:loading="isLoading"
|
||||
hide-actions class="elevation-1">
|
||||
<template slot="items" slot-scope="props">
|
||||
<td class="text-xs-center pa-2">
|
||||
<v-icon color="error" @click="deleteAddress(props.item)">delete</v-icon>
|
||||
<v-icon class="ml-3" color="primary" @click="editAddress(props.item)">edit</v-icon>
|
||||
</td>
|
||||
<td class="text-xs-left pa-2">{{ props.item.M_PatientAddressNote}}</td>
|
||||
<td class="text-xs-left pa-2">{{ props.item.M_PatientAddressDescription}}</td>
|
||||
</template>
|
||||
</v-data-table>
|
||||
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-flex>
|
||||
</v-flex>
|
||||
</v-card>
|
||||
</v-layout>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
data: () => ({
|
||||
search_city:'',
|
||||
oldlabel:'',
|
||||
headers: [
|
||||
{
|
||||
text: "AKSI",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
value: "action",
|
||||
width: "10%",
|
||||
class: "pa-1 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "LABEL",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "20%",
|
||||
class: "pa-1 blue lighten-3 white--text"
|
||||
},
|
||||
{
|
||||
text: "ALAMAT",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "lab",
|
||||
width: "40%",
|
||||
class: "pa-1 blue lighten-3 white--text"
|
||||
}
|
||||
]
|
||||
}),
|
||||
computed: {
|
||||
dialogconfirmationdeleteaddr:{
|
||||
get() {
|
||||
return this.$store.state.patient.dialog_confirmation_delete_addr
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("patient/update_dialog_confirmation_delete_addr",val)
|
||||
}
|
||||
},
|
||||
msgconfirmationdeleteaddr(){
|
||||
return this.$store.state.patient.msg_confirmation_delete_addr
|
||||
},
|
||||
xact() {
|
||||
return this.$store.state.patient.act
|
||||
},
|
||||
xactaddr() {
|
||||
return this.$store.state.patient.act_addr
|
||||
},
|
||||
dialogformaddress:{
|
||||
get() {
|
||||
return this.$store.state.patient.dialog_form_address
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("patient/update_dialog_form_address",val)
|
||||
}
|
||||
},
|
||||
isLoading() {
|
||||
return this.$store.state.patient.search_status == 1
|
||||
},
|
||||
xaddresses(p) {
|
||||
return this.$store.state.patient.addresses
|
||||
},
|
||||
xcities(){
|
||||
return this.$store.state.patient.cities
|
||||
},
|
||||
labeladdress:{
|
||||
get() {
|
||||
return this.$store.state.patient.label_address
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("patient/update_label_address",val)
|
||||
}
|
||||
},
|
||||
cityaddress:{
|
||||
get() {
|
||||
return this.$store.state.patient.city_address
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("patient/update_city_address",val)
|
||||
this.$store.dispatch("patient/getdistrict",this.$store.state.patient.city_address)
|
||||
}
|
||||
},
|
||||
xdistricts(){
|
||||
return this.$store.state.patient.districts
|
||||
},
|
||||
districtaddress:{
|
||||
get() {
|
||||
return this.$store.state.patient.district_address
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("patient/update_district_address",val)
|
||||
this.$store.dispatch("patient/getkelurahan",this.$store.state.patient.district_address)
|
||||
}
|
||||
},
|
||||
xkelurahans(){
|
||||
return this.$store.state.patient.kelurahans
|
||||
},
|
||||
kelurahanaddress:{
|
||||
get() {
|
||||
return this.$store.state.patient.kelurahan_address
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("patient/update_kelurahan_address",val)
|
||||
}
|
||||
},
|
||||
descriptionaddress:{
|
||||
get() {
|
||||
return this.$store.state.patient.description_address
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("patient/update_description_address",val)
|
||||
}
|
||||
},
|
||||
},
|
||||
methods : {
|
||||
createNewAddress(){
|
||||
this.$store.commit("patient/update_act_addr",'new')
|
||||
this.search_city = ''
|
||||
this.labeladdress = ''
|
||||
this.$store.commit("patient/update_cities",[])
|
||||
this.cityaddress = {}
|
||||
this.$store.commit("patient/update_districts",[])
|
||||
this.districtaddress = {}
|
||||
this.$store.commit("patient/update_kelurahans",[])
|
||||
this.kelurahanaddress = {}
|
||||
this.descriptionaddress = ''
|
||||
this.$store.commit("patient/update_dialog_form_address",true)
|
||||
},
|
||||
thr_search_city: _.debounce( function () {
|
||||
this.$store.dispatch("patient/searchcity",this.search_city)
|
||||
},2000),
|
||||
checkError(value){
|
||||
var errors = this.$store.state.patient.errors
|
||||
if(errors.includes(value)){
|
||||
return true
|
||||
}
|
||||
else{
|
||||
return false
|
||||
}
|
||||
},
|
||||
saveNewAddress(){
|
||||
this.$store.commit("patient/update_errors",[])
|
||||
var errors = this.$store.state.patient.errors
|
||||
if(this.labeladdress === ''){
|
||||
errors.push("requiredlabel")
|
||||
}
|
||||
if(_.isEmpty(this.cityaddress)){
|
||||
errors.push("requiredcity")
|
||||
}
|
||||
if(_.isEmpty(this.districtaddress)){
|
||||
errors.push("requireddistrict")
|
||||
}
|
||||
if(_.isEmpty(this.kelurahanaddress)){
|
||||
errors.push("requiredkelurahan")
|
||||
}
|
||||
if(_.isEmpty(this.descriptionaddress)){
|
||||
errors.push("requireddescription")
|
||||
}
|
||||
|
||||
if(errors.length === 0){
|
||||
var prm = {}
|
||||
prm.M_PatientAddressM_PatientID = this.$store.state.patient.selected_patient.M_PatientID
|
||||
prm.M_PatientName = this.$store.state.patient.selected_patient.M_PatientName
|
||||
prm.M_PatientAddressNote = this.labeladdress
|
||||
prm.M_PatientAddressDescription = this.descriptionaddress
|
||||
prm.M_PatientAddressM_KelurahanID = this.kelurahanaddress.M_KelurahanID
|
||||
this.$store.dispatch("patient/savenewaddress",prm)
|
||||
}
|
||||
},
|
||||
editAddress(value){
|
||||
this.$store.commit("patient/update_act_addr",'edit')
|
||||
this.$store.commit("patient/update_x_addr_id",value.M_PatientAddressID)
|
||||
this.labeladdress = value.M_PatientAddressNote
|
||||
this.oldlabel = value.M_PatientAddressNote
|
||||
this.$store.commit("patient/update_cities",[{M_CityID:value.M_CityID,M_CityName:value.M_CityName}])
|
||||
this.cityaddress = {M_CityID:value.M_CityID,M_CityName:value.M_CityName}
|
||||
this.$store.commit("patient/update_districts",[{M_DistrictID:value.M_DistrictID,M_DistrictName:value.M_DistrictName}])
|
||||
this.districtaddress = {M_DistrictID:value.M_DistrictID,M_DistrictName:value.M_DistrictName}
|
||||
this.$store.commit("patient/update_kelurahans",[{M_KelurahanID:value.M_PatientAddressM_KelurahanID,M_KelurahanName:value.M_KelurahanName}])
|
||||
this.kelurahanaddress = {M_KelurahanID:value.M_PatientAddressM_KelurahanID,M_KelurahanName:value.M_KelurahanName}
|
||||
this.descriptionaddress = value.M_PatientAddressDescription
|
||||
this.$store.commit("patient/update_dialog_form_address",true)
|
||||
},
|
||||
saveEditAddress(){
|
||||
this.$store.commit("patient/update_errors",[])
|
||||
var errors = this.$store.state.patient.errors
|
||||
if(this.labeladdress === ''){
|
||||
errors.push("requiredlabel")
|
||||
}
|
||||
if(this.oldlabel.toLowerCase() === 'utama' && this.labeladdress.toLowerCase() !== 'utama'){
|
||||
errors.push("readonlyutama")
|
||||
}
|
||||
if(_.isEmpty(this.cityaddress)){
|
||||
errors.push("requiredcity")
|
||||
}
|
||||
if(_.isEmpty(this.districtaddress)){
|
||||
errors.push("requireddistrict")
|
||||
}
|
||||
if(_.isEmpty(this.kelurahanaddress)){
|
||||
errors.push("requiredkelurahan")
|
||||
}
|
||||
if(_.isEmpty(this.descriptionaddress)){
|
||||
errors.push("requireddescription")
|
||||
}
|
||||
|
||||
if(errors.length === 0){
|
||||
var prm = {}
|
||||
prm.M_PatientAddressID = this.$store.state.patient.x_addr_id
|
||||
prm.M_PatientAddressM_PatientID = this.$store.state.patient.selected_patient.M_PatientID
|
||||
prm.M_PatientName = this.$store.state.patient.selected_patient.M_PatientName
|
||||
prm.M_PatientAddressNote = this.labeladdress
|
||||
prm.M_PatientAddressDescription = this.descriptionaddress
|
||||
prm.M_PatientAddressM_KelurahanID = this.kelurahanaddress.M_KelurahanID
|
||||
this.$store.dispatch("patient/saveeditaddress",prm)
|
||||
}
|
||||
},
|
||||
deleteAddress(value){
|
||||
this.$store.commit("patient/update_act_addr",'delete')
|
||||
this.$store.commit("patient/update_x_addr_id",value.M_PatientAddressID)
|
||||
this.$store.commit("patient/update_errors",[])
|
||||
this.oldlabel = value.M_PatientAddressNote
|
||||
var errors = this.$store.state.patient.errors
|
||||
if(value.M_PatientAddressNote.toLowerCase() === 'utama'){
|
||||
errors.push("deleteutama")
|
||||
}
|
||||
var msg = ''
|
||||
if(errors.includes("deleteutama")){
|
||||
msg = "Biarkan yang utama tetap ada"
|
||||
}
|
||||
else{
|
||||
msg = "Yakin, akan menghapus data alamat pasien "+value.M_PatientAddressNote+" ?"
|
||||
}
|
||||
|
||||
this.$store.commit("patient/update_msg_confirmation_delete_addr",msg)
|
||||
this.$store.commit("patient/update_dialog_confirmation_delete_addr",true)
|
||||
},
|
||||
doDeleteAddr(){
|
||||
var prm = {}
|
||||
prm.M_PatientAddressID = this.$store.state.patient.x_addr_id
|
||||
prm.M_PatientAddressM_PatientID = this.$store.state.patient.selected_patient.M_PatientID
|
||||
prm.M_PatientName = this.$store.state.patient.selected_patient.M_PatientName
|
||||
prm.M_PatientAddressNote = this.oldlabel
|
||||
this.$store.dispatch("patient/deleteaddress",prm)
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
search_city(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_city()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
1322
test/vuex/cpone-setup-mcu/components/oneMdPatientDetail.vue
Normal file
1322
test/vuex/cpone-setup-mcu/components/oneMdPatientDetail.vue
Normal file
File diff suppressed because it is too large
Load Diff
605
test/vuex/cpone-setup-mcu/components/oneMdPatientList.vue
Normal file
605
test/vuex/cpone-setup-mcu/components/oneMdPatientList.vue
Normal file
@@ -0,0 +1,605 @@
|
||||
<template>
|
||||
<v-layout class="fill-height" column>
|
||||
<!-- alert dialog -->
|
||||
<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>
|
||||
<!-- alert dialog -->
|
||||
<v-card class="mb-2 pa-2 searchbox">
|
||||
<v-layout row>
|
||||
<!-- <v-flex class="text-xs-center" pa-1 xs5>
|
||||
<v-select
|
||||
style="font-size:11px"
|
||||
item-text="name"
|
||||
outline
|
||||
return-object
|
||||
class="mini-select"
|
||||
:items="statuses"
|
||||
v-model="status"
|
||||
label="status" hide-details></v-select>
|
||||
</v-flex> -->
|
||||
<!-- <v-flex class="text-xs-center" pa-1 xs5>
|
||||
<v-autocomplete
|
||||
style="font-size:12px"
|
||||
outline
|
||||
label="Cari Kel. Pelanggan ..."
|
||||
v-model="filter_company"
|
||||
:items="filter_companies"
|
||||
:search-input.sync="filter_search_company"
|
||||
auto-select-first
|
||||
|
||||
no-filter
|
||||
item-text="name"
|
||||
return-object
|
||||
:loading="isLoading"
|
||||
hide-details
|
||||
no-data-text="Pilih 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> -->
|
||||
|
||||
<!-- inputan search -->
|
||||
<v-flex pt-1 pl-2 pr-2 pb-1 xs12>
|
||||
<v-text-field
|
||||
color="black"
|
||||
label="Cari"
|
||||
placeholder="Ketikkan Kode / Nama, Lalu tekan Enter"
|
||||
v-model="search_mgmmcu"
|
||||
@keyup.enter="searchMgmMcu()"
|
||||
outline
|
||||
single-line
|
||||
hide-details
|
||||
></v-text-field>
|
||||
</v-flex>
|
||||
<v-flex class="text-xs-right" xs2>
|
||||
<span @click="setNewSetupX" class="icon-medium-fill-base xs1 white--text deep-orange accent-1 mr-0 icon-add"></span>
|
||||
</v-flex>
|
||||
</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 v-bind:class="{'amber lighten-4':isSelected(props.item)}" class="text-xs-left pa-1">
|
||||
{{ props.item.McuOfflinePrepareCode}}
|
||||
</td>
|
||||
<td v-bind:class="{'amber lighten-4':isSelected(props.item)}" class="text-xs-left pa-1">
|
||||
<p class="mb-0 caption">{{ props.item.start_date}} - {{ props.item.end_date}}</p>
|
||||
<p class="mb-1 caption">{{ props.item.M_CompanyName}}</p>
|
||||
</td>
|
||||
<td v-bind:class="{'amber lighten-4':isSelected(props.item)}" class="text-xs-left pa-1" >
|
||||
<v-btn style="min-width:25px;margin:0" @click="editRow(props.item)" small color="info"><v-icon small>edit</v-icon></v-btn>
|
||||
<v-btn v-if="status.id === 'N'" style="min-width:25px;margin:0" @click="deleteData(props.item)" small color="error"><v-icon small>close</v-icon></v-btn>
|
||||
</td>
|
||||
</template>
|
||||
</v-data-table> -->
|
||||
<v-data-table
|
||||
:headers="headers"
|
||||
:items="mgmmcus"
|
||||
:loading="isLoading"
|
||||
hide-actions
|
||||
class="elevation-1">
|
||||
<template slot="items" slot-scope="props">
|
||||
<td v-bind:class="{'amber lighten-4':isSelected(props.item)}" class="text-xs-left pa-1">
|
||||
{{ props.item.Mgm_McuNumber}}
|
||||
</td>
|
||||
<td v-bind:class="{'amber lighten-4':isSelected(props.item)}" class="text-xs-left pa-1">
|
||||
<p class="mb-0 caption">{{ props.item.Mgm_McuLabel}}</p>
|
||||
<p class="mb-1 caption">{{ props.item.Mgm_McuStartDateTxt}} - {{ props.item.Mgm_McuEndDateTxt}}</p>
|
||||
<p class="mb-1 caption">{{ props.item.CorporateName}}</p>
|
||||
</td>
|
||||
<td v-bind:class="{'amber lighten-4':isSelected(props.item)}" class="text-xs-left pa-1" >
|
||||
<v-btn style="min-width:25px;margin:0" @click="editRow(props.item)" small color="info"><v-icon small>edit</v-icon></v-btn>
|
||||
<!-- <v-btn v-if="status.id === 'N'" style="min-width:25px;margin:0" @click="deleteData(props.item)" small color="error"><v-icon small>close</v-icon></v-btn> -->
|
||||
<v-btn style="min-width:25px;margin:0" @click="deleteData(props.item)" small color="error"><v-icon small>close</v-icon></v-btn>
|
||||
</td>
|
||||
</template>
|
||||
</v-data-table>
|
||||
<v-pagination style="margin-top:10px;margin-bottom:10px" :total-visible="15" v-model="curr_page" :length="xtotal_page"></v-pagination>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card>
|
||||
<one-dialog-alert :status="openalertconfirmation" :msg="msgalertconfirmation" @forget-dialog-alert="forgetAlertConfirmation()" @close-dialog-alert="closeAlertConfirmation()"></one-dialog-alert>
|
||||
</v-layout>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
table.v-table tbody td,table.v-table tbody th {
|
||||
height: 35px;
|
||||
}
|
||||
|
||||
table.v-table thead tr {
|
||||
height: 35px;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
module.exports = {
|
||||
components: {
|
||||
'one-dialog-info' : httpVueLoader('../../common/oneDialogInfo.vue'),
|
||||
'one-dialog-alert': httpVueLoader('../../common/oneDialogAlert.vue')
|
||||
},
|
||||
mounted() {
|
||||
this.setNewSetup()
|
||||
this.setNewSetupX()
|
||||
this.$store.dispatch("patient/search", {
|
||||
status: this.status,
|
||||
current_page: this.curr_page,
|
||||
company:0,
|
||||
lastid: -1
|
||||
})
|
||||
|
||||
// load table 1
|
||||
this.$store.dispatch("patient/searchv0", {
|
||||
search: this.search,
|
||||
current_page: this.curr_page,
|
||||
lastid: -1
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
// cpone
|
||||
isSelected(p) {
|
||||
return p.Mgm_McuID == this.$store.state.patient.selected_patient.Mgm_McuID
|
||||
},
|
||||
editRow(row){
|
||||
console.log('data for edit', row)
|
||||
this.$store.commit("patient/update_show1", false);
|
||||
this.$store.commit("patient/update_selected_patient", row)
|
||||
this.$store.commit("patient/update_act", 'edit')
|
||||
this.$store.commit("patient/update_xid", row.Mgm_McuID)
|
||||
|
||||
this.$store.commit("patient/update_inp_Mgm_McuLabel",row.Mgm_McuLabel)
|
||||
this.$store.commit("patient/update_inp_Mgm_McuPicPassword",row.Mgm_McuPicPassword)
|
||||
this.$store.commit("patient/update_inp_Mgm_McuTotalParticipant",row.Mgm_McuTotalParticipant)
|
||||
this.$store.commit("patient/update_inp_Mgm_McuPicEmail",row.Mgm_McuPicEmail)
|
||||
|
||||
this.$store.commit("patient/update_start_date", moment(row.Mgm_McuStartDate).format('YYYY-MM-DD'))
|
||||
this.$store.commit("patient/update_end_date", moment(row.Mgm_McuEndDate).format('YYYY-MM-DD'))
|
||||
|
||||
if(row.Mgm_McuFlagRelasiBayarSendiri == "Y") {
|
||||
this.$store.commit("patient/update_inp_Mgm_McuFlagRelasiBayarSendiri",true)
|
||||
}
|
||||
// else {
|
||||
// if(row.Mgm_McuFlagRelasiBayarSendiri == "N") {
|
||||
// this.$store.commit("patient/update_inp_Mgm_McuBisaTambahPemeriksaan",false)
|
||||
// }
|
||||
// }
|
||||
|
||||
// if(row.Mgm_McuFlagRelasiBayarSendiri == "N") {
|
||||
// this.$store.commit("patient/update_inp_Mgm_McuBisaTambahPemeriksaan",false)
|
||||
// }
|
||||
|
||||
if(row.Mgm_McuBisaTambahPemeriksaan == "Y") {
|
||||
this.$store.commit("patient/update_inp_Mgm_McuBisaTambahPemeriksaan",true)
|
||||
}
|
||||
// else {
|
||||
// if(row.Mgm_McuBisaTambahPemeriksaan == "N") {
|
||||
// this.$store.commit("patient/update_inp_Mgm_McuBisaTambahPemeriksaan",false)
|
||||
// }
|
||||
// }
|
||||
|
||||
this.$store.commit("patient/update_corporate", {
|
||||
id:row.Mgm_McuCorporateID,
|
||||
name:row.CorporateName
|
||||
})
|
||||
|
||||
this.$store.commit("patient/update_corporates", [
|
||||
{
|
||||
id:row.Mgm_McuCorporateID,
|
||||
name:row.CorporateName
|
||||
}
|
||||
])
|
||||
|
||||
this.$store.commit("patient/update_selected_templateFisikCb",{
|
||||
FisikTemplateMappingID: row.Mgm_McuTemplateFisikTemplateMappingID,
|
||||
FisikTemplateMappingName: row.FisikTemplateMappingName
|
||||
})
|
||||
|
||||
this.$store.commit("patient/update_inp_Mgm_McuNote", row.Mgm_McuNote)
|
||||
|
||||
this.$store.commit("patient/update_selected_packets", row.packets)
|
||||
this.$store.dispatch("patient/getPackets", {
|
||||
searchPacket : this.$store.state.patient.search_packet,
|
||||
current_page: 1,
|
||||
})
|
||||
|
||||
// this.$store.commit("patient/update_companies", [{id:row.McuOfflinePrepareM_CompanyID,name:row.M_CompanyName}])
|
||||
// this.$store.commit("patient/update_company", {id:row.McuOfflinePrepareM_CompanyID,name:row.M_CompanyName})
|
||||
// this.$store.commit("patient/update_mous", row.allmous)
|
||||
// this.$store.commit("patient/update_mou", {})
|
||||
// this.$store.commit("patient/update_selected_mous", row.mous)
|
||||
// this.$store.commit("patient/update_deliveries", row.deliveries)
|
||||
// this.$store.commit("patient/update_selected_doctors", row.doctors)
|
||||
// this.$store.commit("patient/update_default_mou", row.default_mou)
|
||||
// this.$store.commit("patient/update_default_doctor", row.default_doctor)
|
||||
// this.$store.commit("patient/update_start_date", moment(row.McuOfflinePrepareStartDate).format('YYYY-MM-DD'))
|
||||
// this.$store.commit("patient/update_end_date", moment(row.McuOfflinePrepareEndDate).format('YYYY-MM-DD'))
|
||||
// this.$store.commit("patient/update_promise_date", row.promise_date)
|
||||
// this.$store.commit("patient/update_promise_time", row.promise_time)
|
||||
// this.$store.commit("patient/update_doctor_address", row.doctor_address)
|
||||
// this.$store.commit("patient/update_default_doctor_address", row.default_doctor_address)
|
||||
// this.$store.commit('patient/update_selected_packets', row.packets)
|
||||
// this.$store.commit('patient/update_selected_tests', row.tests)
|
||||
|
||||
// var prm = row.default_mou
|
||||
// prm.current_page = 1
|
||||
// prm.search = ''
|
||||
// this.$store.dispatch("patient/getdatapackets", prm)
|
||||
// this.$store.dispatch("patient/getdatatests", prm)
|
||||
|
||||
},
|
||||
deleteData(row) {
|
||||
// this.$store.commit("patient/update_selected_patient", row)
|
||||
// console.log(this.$store.state.patient.selected_patient)
|
||||
// let msg = "Yakin, akan menghapus data setup " + this.$store.state.patient.selected_patient.McuOfflinePrepareCode + " ?"
|
||||
// this.$store.commit("patient/update_msg_confirmation_delete", msg)
|
||||
// this.$store.commit("patient/update_dialog_confirmation_delete", true)
|
||||
|
||||
this.$store.commit("patient/update_selected_mgmmcu", row)
|
||||
console.log(this.$store.state.patient.selected_mgmmcu)
|
||||
let msg = "Yakin, akan menghapus data setup " + this.$store.state.patient.selected_mgmmcu.Mgm_McuNumber + " ?"
|
||||
this.$store.commit("patient/update_msg_confirmation_delete", msg)
|
||||
this.$store.commit("patient/update_dialog_confirmation_delete", true)
|
||||
},
|
||||
setNewSetupX(){
|
||||
this.$store.commit("patient/update_act", 'new')
|
||||
this.$store.commit("patient/update_xid", -1)
|
||||
// this.$store.commit("patient/update_company", {})
|
||||
this.$store.commit("patient/update_corporate", {})
|
||||
this.$store.commit("patient/update_selected_templateFisikCb",{})
|
||||
this.$store.commit("patient/update_inp_Mgm_McuNote","")
|
||||
this.$store.commit("patient/update_inp_Mgm_McuBisaTambahPemeriksaan",false)
|
||||
this.$store.commit("patient/update_inp_Mgm_McuFlagRelasiBayarSendiri",false)
|
||||
this.$store.commit("patient/update_inp_Mgm_McuLabel","")
|
||||
this.$store.commit("patient/update_start_date", moment(new Date()).format('YYYY-MM-DD'))
|
||||
this.$store.commit("patient/update_end_date", moment(new Date()).format('YYYY-MM-DD'))
|
||||
this.$store.commit("patient/update_selected_packets", [])
|
||||
this.$store.commit("patient/update_inp_Mgm_McuPicPassword","")
|
||||
this.$store.commit("patient/update_inp_Mgm_McuTotalParticipant",0)
|
||||
this.$store.commit("patient/update_inp_Mgm_McuPicEmail","")
|
||||
},
|
||||
searchMgmMcu(){
|
||||
// var prm = this.default_mou
|
||||
// prm.search = this.search_mgmmcu
|
||||
// prm.current_page = 1
|
||||
|
||||
var prm = {}
|
||||
prm.search = this.search_mgmmcu
|
||||
// prm.current_page = 1
|
||||
prm.current_page = this.curr_page
|
||||
this.$store.commit("patient/update_current_page", 1)
|
||||
this.$store.dispatch("patient/searchv0", prm)
|
||||
},
|
||||
// cpone
|
||||
thr_search_company: _.debounce( function () {
|
||||
//console.log(this.search_company)
|
||||
this.$store.dispatch("patient/filtersearchcompany",{search:this.filter_search_company})
|
||||
},2000),
|
||||
// editRow(row){
|
||||
// this.$store.commit("patient/update_selected_patient", row)
|
||||
// this.$store.commit("patient/update_act", 'edit')
|
||||
// this.$store.commit("patient/update_xid", row.McuOfflinePrepareID)
|
||||
// this.$store.commit("patient/update_companies", [{id:row.McuOfflinePrepareM_CompanyID,name:row.M_CompanyName}])
|
||||
// this.$store.commit("patient/update_company", {id:row.McuOfflinePrepareM_CompanyID,name:row.M_CompanyName})
|
||||
// this.$store.commit("patient/update_mous", row.allmous)
|
||||
// this.$store.commit("patient/update_mou", {})
|
||||
// this.$store.commit("patient/update_selected_mous", row.mous)
|
||||
// this.$store.commit("patient/update_deliveries", row.deliveries)
|
||||
// this.$store.commit("patient/update_selected_doctors", row.doctors)
|
||||
// this.$store.commit("patient/update_default_mou", row.default_mou)
|
||||
// this.$store.commit("patient/update_default_doctor", row.default_doctor)
|
||||
// this.$store.commit("patient/update_start_date", moment(row.McuOfflinePrepareStartDate).format('YYYY-MM-DD'))
|
||||
// this.$store.commit("patient/update_end_date", moment(row.McuOfflinePrepareEndDate).format('YYYY-MM-DD'))
|
||||
// this.$store.commit("patient/update_promise_date", row.promise_date)
|
||||
// this.$store.commit("patient/update_promise_time", row.promise_time)
|
||||
// this.$store.commit("patient/update_doctor_address", row.doctor_address)
|
||||
// this.$store.commit("patient/update_default_doctor_address", row.default_doctor_address)
|
||||
// this.$store.commit('patient/update_selected_packets', row.packets)
|
||||
// this.$store.commit('patient/update_selected_tests', row.tests)
|
||||
|
||||
// var prm = row.default_mou
|
||||
// prm.current_page = 1
|
||||
// prm.search = ''
|
||||
// this.$store.dispatch("patient/getdatapackets", prm)
|
||||
// this.$store.dispatch("patient/getdatatests", prm)
|
||||
|
||||
// },
|
||||
// isSelected(p) {
|
||||
// return p.McuOfflinePrepareID == this.$store.state.patient.selected_patient.McuOfflinePrepareID
|
||||
// },
|
||||
searchPatient() {
|
||||
this.$store.dispatch("patient/search", {
|
||||
status: this.status,
|
||||
current_page: 1,
|
||||
lastid: -1
|
||||
})
|
||||
this.$store.commit("patient/update_current_page", 1)
|
||||
},
|
||||
selectMe(pat) {
|
||||
if (this.$store.state.patient.no_save == 0) {
|
||||
this.$store.commit("patient/update_selected_patient", pat)
|
||||
} else {
|
||||
this.$store.commit("patient/update_open_alert_confirmation", true)
|
||||
}
|
||||
},
|
||||
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)
|
||||
},
|
||||
closeDialogSuccess() {
|
||||
let arrpatient = this.$store.state.patient.patients
|
||||
var idx = _.findIndex(arrpatient, item => item.M_PatientID === this.$store.state.patient.last_id)
|
||||
console.log(idx)
|
||||
// this.$store.dispatch("patient/search", {
|
||||
// status: this.status,
|
||||
// current_page: this.curr_page,
|
||||
// lastid: idx
|
||||
// })
|
||||
|
||||
this.$store.dispatch("patient/searchv0", {
|
||||
status: this.status,
|
||||
current_page: this.curr_page,
|
||||
lastid: idx
|
||||
})
|
||||
this.$store.commit("patient/update_dialog_success", false)
|
||||
},
|
||||
setNewSetup(){
|
||||
this.$store.commit("patient/update_act", 'new')
|
||||
this.$store.commit("patient/update_xid", -1)
|
||||
this.$store.commit("patient/update_company", {})
|
||||
this.$store.commit("patient/update_mous", [])
|
||||
this.$store.commit("patient/update_mou", {})
|
||||
this.$store.commit("patient/update_selected_mous", [])
|
||||
this.$store.commit("patient/update_selected_doctors", [])
|
||||
this.$store.commit("patient/update_start_date", moment(new Date()).format('YYYY-MM-DD'))
|
||||
this.$store.commit("patient/update_end_date", moment(new Date()).format('YYYY-MM-DD'))
|
||||
this.$store.commit("patient/update_default_mou", {})
|
||||
this.$store.commit("patient/update_default_doctor", {})
|
||||
this.$store.commit("patient/update_default_doctor_address", {})
|
||||
this.$store.commit("patient/update_doctor_address", [])
|
||||
this.$store.commit("patient/update_packets", [])
|
||||
this.$store.commit("patient/update_tests", [])
|
||||
this.$store.commit("patient/update_selected_packets", [])
|
||||
this.$store.commit("patient/update_selected_tests", [])
|
||||
this.$store.commit("patient/update_current_page_test", 1)
|
||||
this.$store.commit("patient/update_current_page_packet", 1)
|
||||
this.$store.commit("patient/update_total_patient_packet", 0)
|
||||
this.$store.commit("patient/update_total_patient_test", 0)
|
||||
},
|
||||
// deleteData(row) {
|
||||
// // this.$store.commit("patient/update_selected_patient", row)
|
||||
// // console.log(this.$store.state.patient.selected_patient)
|
||||
// // let msg = "Yakin, akan menghapus data setup " + this.$store.state.patient.selected_patient.McuOfflinePrepareCode + " ?"
|
||||
// // this.$store.commit("patient/update_msg_confirmation_delete", msg)
|
||||
// // this.$store.commit("patient/update_dialog_confirmation_delete", true)
|
||||
|
||||
// this.$store.commit("patient/update_selected_mgmmcu", row)
|
||||
// console.log(this.$store.state.patient.selected_mgmmcu)
|
||||
// let msg = "Yakin, akan menghapus data setup " + this.$store.state.patient.selected_mgmmcu.Mgm_McuNumber + " ?"
|
||||
// this.$store.commit("patient/update_msg_confirmation_delete", msg)
|
||||
// this.$store.commit("patient/update_dialog_confirmation_delete", true)
|
||||
// },
|
||||
// doDeleteData() {
|
||||
// var prm = {}
|
||||
// prm.id = this.$store.state.patient.selected_patient.McuOfflinePrepareID
|
||||
// prm.code = this.$store.state.patient.selected_patient.McuOfflinePrepareCode
|
||||
// console.log(prm)
|
||||
// this.$store.dispatch("patient/delete", prm)
|
||||
// }
|
||||
},
|
||||
computed: {
|
||||
// cpone
|
||||
search_mgmmcu: {
|
||||
get() {
|
||||
return this.$store.state.patient.search_mgmmcu
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("patient/update_search_mgmmcu", val)
|
||||
this.$store.commit("patient/update_no_save", 1)
|
||||
}
|
||||
},
|
||||
mgmmcus() {
|
||||
return this.$store.state.patient.mgmmcus
|
||||
},
|
||||
// cpone
|
||||
filter_companies(){
|
||||
return this.$store.state.patient.filter_companies
|
||||
},
|
||||
filter_company:{
|
||||
get() {
|
||||
return this.$store.state.patient.filter_company
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("patient/update_filter_company",val)
|
||||
//this.$store.dispatch("patient/getmou",this.$store.state.patient.company)
|
||||
this.$store.dispatch("patient/search", {
|
||||
status: this.status,
|
||||
current_page: this.curr_page,
|
||||
company:val.id,
|
||||
lastid: -1
|
||||
})
|
||||
}
|
||||
},
|
||||
dialogconfirmationdelete: {
|
||||
get() {
|
||||
return this.$store.state.patient.dialog_confirmation_delete
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("patient/update_dialog_confirmation_delete", val)
|
||||
}
|
||||
},
|
||||
msgconfirmationdelete() {
|
||||
return this.$store.state.patient.msg_confirmation_delete
|
||||
},
|
||||
status: {
|
||||
get() {
|
||||
return this.$store.state.patient.status
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("patient/update_status", val)
|
||||
this.$store.dispatch("patient/search", {
|
||||
status: val,
|
||||
current_page: this.curr_page,
|
||||
company:this.$store.state.patient.filter_company.id,
|
||||
lastid: -1
|
||||
})
|
||||
}
|
||||
},
|
||||
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)
|
||||
}
|
||||
},
|
||||
isLoading() {
|
||||
return this.$store.state.patient.search_status == 1
|
||||
},
|
||||
patients() {
|
||||
return this.$store.state.patient.patients
|
||||
},
|
||||
totalpatient() {
|
||||
return this.$store.state.patient.total_patient
|
||||
},
|
||||
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", {
|
||||
// status: this.status,
|
||||
// current_page: val,
|
||||
// lastid: -1
|
||||
// })
|
||||
|
||||
var prm = {}
|
||||
prm.search = this.search_mgmmcu
|
||||
prm.current_page = val
|
||||
// this.$store.commit("patient/update_current_page_mgmmcu", 1)
|
||||
this.$store.dispatch("patient/searchv0", prm)
|
||||
}
|
||||
},
|
||||
xtotal_page: {
|
||||
get() {
|
||||
return this.$store.state.patient.total_mgmmcu
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("patient/update_total_mgmmcu", val)
|
||||
}
|
||||
},
|
||||
// xtotal_page: {
|
||||
// get() {
|
||||
// return this.$store.state.patient.total_patient
|
||||
// },
|
||||
// set(val) {
|
||||
// this.$store.commit("patient/update_total_patient", val)
|
||||
// }
|
||||
// },
|
||||
openalertconfirmation: {
|
||||
get() {
|
||||
return this.$store.state.patient.open_alert_confirmation
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("patient/update_open_alert_confirmation", val)
|
||||
}
|
||||
},
|
||||
|
||||
},
|
||||
watch: {
|
||||
filter_search_company(val,old) {
|
||||
//console.log(val)
|
||||
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()
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
filter_search_company:'',
|
||||
statuses:[{id:"N",name:"Belum download"},{id:"Y",name:"Sudah download"}],
|
||||
msgalertconfirmation: "Perubahan yang telah dilakukan belum disimpan dong !",
|
||||
items: [],
|
||||
name: '',
|
||||
snorm: '',
|
||||
page: 1,
|
||||
headers: [
|
||||
{
|
||||
text: "KODE",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "mr",
|
||||
width: "20%",
|
||||
class: "pa-2 deep-orange accent-1 white--text"
|
||||
},
|
||||
{
|
||||
text: "NAMA",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "lab",
|
||||
width: "55%",
|
||||
class: "pa-2 deep-orange accent-1 white--text"
|
||||
},
|
||||
{
|
||||
text: "AKSI",
|
||||
align: "left",
|
||||
sortable: false,
|
||||
value: "lab",
|
||||
width: "15%",
|
||||
class: "pa-2 deep-orange accent-1 white--text"
|
||||
}
|
||||
],
|
||||
pagination: {
|
||||
descending: false,
|
||||
page: 1,
|
||||
rowsPerPage: 5,
|
||||
sortBy: 'Mgm_McuID',
|
||||
// totalItems: this.$store.state.patient.total_patients
|
||||
totalItems: this.$store.state.patient.total_mgmmcu
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user