492 lines
21 KiB
Vue
492 lines
21 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-card class="mb-2 pa-2 searchbox">
|
|
<v-layout>
|
|
<v-flex xs3 pl-1>
|
|
<v-select item-text="M_CompanyName" autocomplete :search-input.sync="searchxCompany" return-object :items="companys" style="font-size:14px"
|
|
class="xs4 mini-select ma-1" v-model="selected_filter_company" outline hide-details label="kel.pelanggan"></v-select>
|
|
</v-flex>
|
|
<v-flex xs3 pl-1>
|
|
<v-select class="xs4 mini-select ma-1" :items="xstatuses" style="font-size:14px" item-text="label" return-object
|
|
v-model="xselectedstatus" label="Status" outline hide-details></v-select>
|
|
</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="mous" :loading="isLoading" hide-actions class="elevation-1">
|
|
<template slot="items" slot-scope="props">
|
|
<tr :class="{'red lighten-4': props.item.isexpired == 'C'}">
|
|
<td class="text-xs-left pa-2" v-html="props.item.M_CompanyName">
|
|
</td>
|
|
<td class="text-xs-left pa-2" v-html="props.item.numberx">
|
|
</td>
|
|
<td class="text-xs-left pa-2" v-html="props.item.namex">
|
|
</td>
|
|
<td class="text-xs-left pa-2" v-html="props.item.periode">
|
|
</td>
|
|
<td class="text-xs-left pa-2" v-html="props.item.M_MouTypeName">
|
|
</td>
|
|
<td class="text-xs-left pa-2">
|
|
<v-icon small class="ml-3" color="primary" @click="editFormMou(props.item)">update</v-icon>
|
|
|
|
</td>
|
|
</tr>
|
|
</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>
|
|
<template>
|
|
<v-layout row justify-center>
|
|
<v-dialog v-model="dialogmou" persistent max-width="600px">
|
|
<v-card>
|
|
<v-card-title>
|
|
<span class="headline">Form Perpanjang Agreement</span>
|
|
</v-card-title>
|
|
<v-card-text class="pt-0 pb-0">
|
|
<v-form ref="formcompanymou" v-model="validmou" lazy-validation>
|
|
<v-layout wrap>
|
|
<v-flex xs12>
|
|
AGREEMENT : {{name}} <span> [ <span style="color:#2196F3;font-weight: 900;">{{number}} </span> ]
|
|
</v-flex>
|
|
<v-flex xs12>
|
|
<v-layout>
|
|
<v-flex xs6 pa-1>
|
|
<v-text-field label="Tgl. Mulai" placeholder="dd-mm-yyyy" mask="##-##-####" v-model="xstartdate"></v-text-field>
|
|
</v-flex>
|
|
<v-flex xs6 pa-1>
|
|
<v-text-field label="Tgl. Selesai" placeholder="dd-mm-yyyy" mask="##-##-####" v-model="xenddate"></v-text-field>
|
|
</v-flex>
|
|
</v-layout>
|
|
</v-layout>
|
|
</v-card-text>
|
|
<v-card-actions>
|
|
<v-spacer></v-spacer>
|
|
<v-btn color="blue darken-1" flat @click="updateDialogFormMou()">Tutup</v-btn>
|
|
<v-btn color="blue darken-1" flat @click="saveFormMou()">Simpan Perubahan</v-btn>
|
|
</v-card-actions>
|
|
</v-form>
|
|
</v-card>
|
|
</v-dialog>
|
|
</v-layout>
|
|
</template>
|
|
<template>
|
|
|
|
<v-dialog v-model="dialog_alert_verif" max-width="600px">
|
|
<v-card>
|
|
<v-card-title class="headline red 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>
|
|
{{msgalertverif}}
|
|
</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="primary" flat @click="close_alert_verif()">
|
|
Tutup
|
|
</v-btn>
|
|
</v-card-actions>
|
|
</v-card>
|
|
</v-dialog>
|
|
|
|
</template>
|
|
<one-dialog-info :status="opendialoginfo" :msg="msginfo" @close-dialog-info="closeDialogInfo()"></one-dialog-info>
|
|
<one-dialog-alert :status="openalertconfirmation" :msg="msgalertconfirmation" @forget-dialog-alert="forgetAlertConfirmation()"
|
|
@close-dialog-alert="closeAlertConfirmation()"></one-dialog-alert>
|
|
</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("mou/getsexreg", {
|
|
status: this.xselectedstatus.value,
|
|
company: this.selected_filter_company.M_CompanyID,
|
|
current_page: 1,
|
|
lastid: -1
|
|
})
|
|
this.$store.dispatch("mou/searchcompany", {
|
|
name: this.search_company
|
|
})
|
|
/*this.$store.dispatch("mou/search",{
|
|
name:this.name,
|
|
status: this.xselectedstatus.value,
|
|
current_page:1,
|
|
lastid:-1
|
|
})*/
|
|
},
|
|
methods: {
|
|
isSelected(p) {
|
|
return p.M_MouID == this.$store.state.mou.selected_mou.M_MouID
|
|
},
|
|
searchMou() {
|
|
this.$store.dispatch("mou/search", {
|
|
status: this.xselectedstatus.value,
|
|
company: this.selected_filter_company.M_CompanyID,
|
|
current_page: 1,
|
|
lastid: -1
|
|
})
|
|
this.$store.commit("mou/update_current_page", 1)
|
|
},
|
|
selectMe(doc) {
|
|
if (this.$store.state.mou.no_save == 0) {
|
|
this.$store.commit("mou/update_selected_mou", doc)
|
|
this.$store.commit("mou/update_preffix", doc.M_MouPrefix)
|
|
this.$store.commit("mou/update_mou_name", doc.M_MouName)
|
|
this.$store.commit("mou/update_suffix", doc.M_MouSufix)
|
|
this.$store.commit("mou/update_selected_sex", {
|
|
M_SexID: doc.M_MouM_SexID,
|
|
m_sexname: doc.M_SexName
|
|
})
|
|
this.$store.commit("mou/update_selected_company", {
|
|
M_CompanyID: doc.M_CompanyID,
|
|
M_CompanyName: doc.M_CompanyName
|
|
})
|
|
this.$store.commit("mou/update_companys", [{
|
|
Nat_StaffID: doc.Nat_StaffID,
|
|
M_CompanyID: doc.M_CompanyID,
|
|
M_CompanyName: doc.M_CompanyName
|
|
}])
|
|
this.$store.commit("mou/update_company", {
|
|
Nat_StaffID: doc.Nat_StaffID,
|
|
M_CompanyID: doc.M_CompanyID,
|
|
M_CompanyName: doc.M_CompanyName
|
|
})
|
|
this.$store.commit("mou/update_selected_religion", {
|
|
M_ReligionID: doc.M_MouM_ReligionID,
|
|
M_ReligionName: doc.M_ReligionName
|
|
})
|
|
this.$store.commit("mou/update_phone", doc.M_MouPhone)
|
|
this.$store.commit("mou/update_email", doc.M_MouEmail)
|
|
this.$store.commit("mou/update_hp", doc.M_MouHP)
|
|
this.$store.commit("mou/update_note", doc.M_MouNote)
|
|
this.$store.commit("mou/update_pj", doc.M_MouIsPJ)
|
|
this.$store.commit("mou/update_pjmcu", doc.M_MouIsDefaultMcu)
|
|
this.$store.commit("mou/update_dpj", doc.M_MouIsDefaultPJ)
|
|
this.$store.commit("mou/update_clinic", doc.M_MouIsClinic)
|
|
this.$store.commit("mou/update_marketing_confirm", doc.M_MouIsMarketingConfirm)
|
|
this.$store.commit("mou/update_is_default", doc.M_MouIsDefault)
|
|
this.$store.commit("mou/update_is_default_email", doc.M_MouEmailIsDefault)
|
|
|
|
|
|
|
|
this.$store.commit("mou/update_act", 'edit')
|
|
} else {
|
|
this.$store.commit("mou/update_open_alert_confirmation", true)
|
|
}
|
|
|
|
},
|
|
closeAlertConfirmation() {
|
|
this.$store.commit("mou/update_open_alert_confirmation", false)
|
|
},
|
|
forgetAlertConfirmation() {
|
|
this.$store.commit("mou/update_no_save", 0)
|
|
this.$store.commit("mou/update_open_alert_confirmation", false)
|
|
},
|
|
updateAlert_success(val) {
|
|
this.$store.commit("mou/update_alert_success", val)
|
|
},
|
|
setNewMou() {
|
|
this.$store.commit("mou/update_selected_mou", {})
|
|
this.$store.commit("mou/update_preffix", '')
|
|
this.$store.commit("mou/update_mou_name", '')
|
|
this.$store.commit("mou/update_suffix", '')
|
|
this.$store.commit("mou/update_selected_sex", {})
|
|
this.$store.commit("mou/update_selected_religion", {})
|
|
this.$store.commit("mou/update_phone", '')
|
|
this.$store.commit("mou/update_email", '')
|
|
this.$store.commit("mou/update_hp", '')
|
|
this.$store.commit("mou/update_note", '')
|
|
this.$store.commit("mou/update_pj", 'N')
|
|
this.$store.commit("mou/update_dpj", 'N')
|
|
this.$store.commit("mou/update_clinic", 'N')
|
|
this.$store.commit("mou/update_marketing_confirm", 'N')
|
|
this.$store.commit("mou/update_is_default", 'N')
|
|
this.$store.commit("mou/update_addresses", [])
|
|
|
|
this.$store.commit("mou/update_act", 'new')
|
|
},
|
|
closeDialogSuccess() {
|
|
let arrmou = this.$store.state.mou.mous
|
|
var idx = _.findIndex(arrmou, item => item.M_MouID === this.$store.state.mou.last_id)
|
|
console.log(idx)
|
|
this.$store.dispatch("mou/search", {
|
|
status: this.xselectedstatus.value,
|
|
company: this.selected_filter_company.M_CompanyID,
|
|
current_page: this.curr_page,
|
|
lastid: idx
|
|
})
|
|
this.$store.commit("mou/update_dialog_success", false)
|
|
},
|
|
editFormMou(val) {
|
|
this.xid = val.id
|
|
this.name = val.name
|
|
this.number = val.number
|
|
this.xstartdate = val.startdate
|
|
this.xenddate = val.enddate
|
|
this.$store.commit("mou/update_dialog_form_mou", true)
|
|
},
|
|
saveFormMou() {
|
|
this.$store.dispatch("mou/extendmou", {
|
|
id: this.xid,
|
|
name: this.name,
|
|
startdate: moment(this.xstartdate, 'DDMMYYYY').format('DD-MM-YYYY'),
|
|
enddate: moment(this.xenddate, 'DDMMYYYY').format('DD-MM-YYYY')
|
|
})
|
|
},
|
|
close_alert_verif() {
|
|
this.$store.commit("mou/update_dialog_alert_verif", false)
|
|
},
|
|
|
|
updateDialogFormMou() {
|
|
this.$store.commit("mou/update_dialog_form_mou", false)
|
|
}
|
|
},
|
|
computed: {
|
|
dialogmou() {
|
|
return this.$store.state.mou.dialog_form_mou
|
|
},
|
|
dialog_alert_verif() {
|
|
return this.$store.state.mou.dialog_alert_verif
|
|
},
|
|
msgalertverif() {
|
|
return this.$store.state.mou.msgalertverif
|
|
},
|
|
selected_filter_company: {
|
|
get() {
|
|
return this.$store.state.mou.selected_filter_company
|
|
},
|
|
set(val) {
|
|
this.$store.commit("mou/update_selected_filter_company", val)
|
|
this.searchMou()
|
|
}
|
|
},
|
|
companys: {
|
|
get() {
|
|
return this.$store.state.mou.fcompanys
|
|
},
|
|
set(val) {
|
|
this.$store.commit("mou/update_fcompanys", val)
|
|
}
|
|
},
|
|
dialogsuccess: {
|
|
get() {
|
|
return this.$store.state.mou.dialog_success
|
|
},
|
|
set(val) {
|
|
this.$store.commit("mou/update_dialog_success", val)
|
|
}
|
|
},
|
|
msgsuccess() {
|
|
return this.$store.state.mou.msg_success
|
|
},
|
|
snackbar: {
|
|
get() {
|
|
return this.$store.state.mou.alert_success
|
|
},
|
|
set(val) {
|
|
this.$store.commit("mou/update_alert_success", val)
|
|
}
|
|
},
|
|
isLoading() {
|
|
return this.$store.state.mou.search_status == 1
|
|
},
|
|
xstatuses() {
|
|
return this.$store.state.mou.statuses
|
|
},
|
|
xselectedstatus: {
|
|
get() {
|
|
return this.$store.state.mou.selected_status
|
|
},
|
|
set(val) {
|
|
this.$store.commit("mou/update_selected_status", val)
|
|
this.searchMou()
|
|
}
|
|
},
|
|
mous() {
|
|
return this.$store.state.mou.mous
|
|
},
|
|
openalertconfirmation: {
|
|
get() {
|
|
return this.$store.state.mou.open_alert_confirmation
|
|
},
|
|
set(val) {
|
|
this.$store.commit("mou/update_open_alert_confirmation", val)
|
|
}
|
|
},
|
|
totalmou() {
|
|
return this.$store.state.mou.total_mou
|
|
},
|
|
curr_page: {
|
|
get() {
|
|
return this.$store.state.mou.current_page
|
|
},
|
|
set(val) {
|
|
this.$store.commit("mou/update_current_page", val)
|
|
this.$store.dispatch("mou/search", {
|
|
status: this.xselectedstatus.value,
|
|
company: this.selected_filter_company.M_CompanyID,
|
|
current_page: val,
|
|
lastid: -1
|
|
})
|
|
}
|
|
},
|
|
xtotal_page: {
|
|
get() {
|
|
return this.$store.state.mou.total_mou
|
|
},
|
|
set(val) {
|
|
this.$store.commit("mou/update_total_mou", val)
|
|
}
|
|
},
|
|
opendialoginfo: {
|
|
get() {
|
|
return this.$store.state.mou.open_dialog_info
|
|
},
|
|
set(val) {
|
|
this.$store.commit("mou/update_open_dialog_info", val)
|
|
}
|
|
},
|
|
msginfo() {
|
|
return this.$store.state.mou.msg_info
|
|
},
|
|
xstartdate: {
|
|
get() {
|
|
return this.$store.state.mou.startdate
|
|
},
|
|
set(val) {
|
|
this.$store.commit("mou/update_startdate", val)
|
|
}
|
|
},
|
|
xenddate: {
|
|
get() {
|
|
return this.$store.state.mou.enddate
|
|
},
|
|
set(val) {
|
|
this.$store.commit("mou/update_enddate", val)
|
|
}
|
|
},
|
|
},
|
|
data() {
|
|
return {
|
|
msgalertconfirmation: "Perubahan yang telah dilakukan belum disimpan dong !",
|
|
items: [],
|
|
page: 1,
|
|
total_pages: 5,
|
|
searchxCompany: '',
|
|
validmou: false,
|
|
xid: 0,
|
|
name: "",
|
|
number: "",
|
|
headers: [{
|
|
text: "KEL. PELANGGAN",
|
|
align: "left",
|
|
sortable: false,
|
|
value: "mr",
|
|
width: "20%",
|
|
class: "pa-2 blue lighten-3 white--text"
|
|
},
|
|
{
|
|
text: "NO.",
|
|
align: "Center",
|
|
sortable: false,
|
|
value: "lab",
|
|
width: "18%",
|
|
class: "pa-2 blue lighten-3 white--text"
|
|
},
|
|
{
|
|
text: "NAMA",
|
|
align: "Center",
|
|
sortable: false,
|
|
value: "name",
|
|
width: "25%",
|
|
class: "pa-2 blue lighten-3 white--text"
|
|
},
|
|
{
|
|
text: "PERIODE",
|
|
align: "Center",
|
|
sortable: false,
|
|
value: "name",
|
|
width: "20%",
|
|
class: "pa-2 blue lighten-3 white--text"
|
|
},
|
|
{
|
|
text: "TIPE",
|
|
align: "Center",
|
|
sortable: false,
|
|
value: "name",
|
|
width: "10%",
|
|
class: "pa-2 blue lighten-3 white--text"
|
|
},
|
|
{
|
|
text: "AKSI",
|
|
align: "Center",
|
|
sortable: false,
|
|
value: "name",
|
|
width: "10%",
|
|
class: "pa-2 blue lighten-3 white--text"
|
|
}
|
|
],
|
|
pagination: {
|
|
descending: false,
|
|
page: 1,
|
|
rowsPerPage: 5,
|
|
sortBy: 'M_MouName',
|
|
totalItems: this.$store.state.mou.total_mou
|
|
}
|
|
};
|
|
}
|
|
}
|
|
</script> |