Initial import

This commit is contained in:
sas.fajri
2026-05-25 20:01:37 +07:00
commit 710d7c1b97
10371 changed files with 2381698 additions and 0 deletions

View File

@@ -0,0 +1,284 @@
const URL = "/one-api/v1/masterdata/";
export async function search(prm) {
try {
var resp = await axios.post(URL + 'mouexpiredv2/search', prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function getsexreg(token) {
try {
var resp = await axios.post(URL + 'mouexpiredv2/getsexreg',{token:token});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function save(prm) {
try {
var resp = await axios.post(URL + 'mouexpiredv2/save',prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function extendmou(prm) {
try {
var resp = await axios.post(URL + 'mouexpiredv2/extendmou',prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function newmou(prm) {
try {
var resp = await axios.post(URL + 'mouexpiredv2/newmou',prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function xdelete(prm) {
try {
var resp = await axios.post(URL + 'mouexpiredv2/deletemou',prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function getaddress(prm) {
try {
var resp = await axios.post(URL + 'mouexpiredv2/getaddress',prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function searchcity(token,prm) {
try {
var resp = await axios.post(URL + 'mouexpiredv2/searchcity',{token:token,search:prm});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function searchcompany(token,prm) {
try {
var resp = await axios.post(URL + 'mouexpiredv2/searchcompany',{token:token,name:prm});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function getdistrict(token,prm) {
try {
var resp = await axios.post(URL + 'mouexpiredv2/getdistrict',{id:prm.M_CityID,token:token});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function getkelurahan(token,prm) {
try {
var resp = await axios.post(URL + 'mouexpiredv2/getkelurahan',{token:token,id:prm.M_DistrictID});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function getjpa(token) {
try {
var resp = await axios.post(URL + 'mouexpiredv2/getjpa',{token:token});
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch(e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function savenewaddress(prm) {
try {
var resp = await axios.post(URL + 'mouexpiredv2/savenewaddress',prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function saveeditaddress(prm) {
try {
var resp = await axios.post(URL + 'mouexpiredv2/saveeditaddress',prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function deleteaddress(prm) {
try {
var resp = await axios.post(URL + 'mouexpiredv2/deleteaddress',prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}

View File

@@ -0,0 +1,492 @@
<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> &nbsp;[ <span style="color:#2196F3;font-weight: 900;">{{number}} </span> &nbsp;]
</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>

View File

@@ -0,0 +1,90 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>One</title>
<link rel="stylesheet" href="../../libs/vendor/css/google-fonts.css">
<link rel="stylesheet" href="../../libs/vendor/css/icomoon-fonts.css">
<link rel="stylesheet" href="../../libs/vendor/css/vuetify.min.css">
</head>
<body>
<div v-cloak id="app">
<v-app id="smartApp" >
<one-navbar></one-navbar>
<v-content style="background:#F5E8DF!important" >
<v-container fluid fill-height class="pl-1 pr-1 pt-2 pb-2">
<v-layout row wrap >
<v-flex xs12 class="left" fill-height pa-1>
<one-mou-expired-list></one-mou-expired-list>
</v-flex>
</v-flex>
</v-layout>
</v-container>
</v-content>
<one-footer> </one-footer>
</v-app>
</div>
<!-- Vendor -->
<script src="../../libs/vendor/moment.min.js"></script>
<script src="../../libs/vendor/numeral.min.js"></script>
<script src="../../libs/vendor/moment-locale-id.js"></script>
<script src="../../libs/vendor/lodash.js"></script>
<script src="../../libs/vendor/axios.min.js"></script>
<script src="../../libs/vendor/vue.js"></script>
<script src="../../libs/vendor/vuex.js"></script>
<script src="../../libs/vendor/vuetify.js"></script>
<script src="../../libs/vendor/httpVueLoader.js"></script>
<script src="../../libs/one_global.js"></script>
<!-- App Script -->
<?php
$ts = "?ts=" . Date("ymdhis");
?>
<script type="module">
window.calculate_age = function (inp_dob) {
var now = moment(new Date())
var dob = moment(new Date(inp_dob))
var year = now.diff(dob,'years')
dob.add(year,'years')
var month = now.diff(dob,'months')
dob.add(month,'months')
var day = now.diff(dob,'days')
if (isNaN(year)) return ''
return `${year} tahun ${month} bulan ${day} hari`
}
import { store } from './store.js<?php echo $ts ?>';
//for testing
window.store = store;
new Vue({
store,
el: '#app',
methods: {
tab_selected : function(tab) {
return this.$store.state.tab_selected == tab
}
},
components: {
'one-navbar': httpVueLoader('../../apps/components/oneNavbarComponent.vue'),
'one-footer': httpVueLoader('../../apps/components/oneFooter.vue'),
'one-mou-expired-list': httpVueLoader('./components/oneMouExpiredList.vue')
}
})
</script>
<style>
[v-cloak] {
display: none
}
.left {
}
.right {
}
</style>
</body>
</html>

View File

@@ -0,0 +1,701 @@
// 1 => LOADING
// 2 => DONE
// 3 => ERROR
import * as api from "../api/mou.js"
export default {
namespaced: true,
state: {
last_id:-1,
last_saved_id:-1,
x_addr_id:0,
act:'edit',
act_addr:'new',
get_data_status:0,
search_mou: 0,
search_status: 0,
search_error_message: '',
statuses:[{label:'Semua', value:'A'},{label:'Expired', value:'Y'},{label:'Coming soon (kurang sebulan)', value:'C'},{label:'Belum Expired', value:'N'}],
selected_status:{label:'Semua', value:'A'},
preffix:'',
preffix2:'',
mou_name:'',
suffix:'',
suffix2:'',
suffix3:'',
mous: [],
total_mous:0,
mou_address: [],
sexes:[],
selected_sex:{},
religions:[],
selected_religion:{},
companys:[],
company:{},
fcompanys:[],
selected_company:{},
phone:'',
hp:'',
note:'',
email:'',
is_default_email:'',
pj:'N',
pjmcu:'N',
dpj:'N',
clinic:'N',
is_default:'N',
marketing_confirm:'N',
total_mou: 0,
selected_mou: {},
save_status: 0,
btn_save_seen: true,
pgrs_save: false,
save_error_message: '',
no_save: 0,
open_alert_confirmation:false,
alert_success: false,
msg_success: "",
dialog_success: false,
dialog_confirmation_delete: false,
msg_confirmation_delete: "",
dialog_confirmation_delete_addr: false,
msg_confirmation_delete_addr: "",
autocomplete_status:0,
dialog_form_address: false,
label_address:'',
addresses:[],
cities:[],
city_address:{},
districts:[],
district_address:{},
kelurahans:[],
kelurahan_address:{},
jpas:[],
jpa_address:{},
description_address:'',
errors:[],
current_page:1,
open_dialog_info:false,
msg_info:'',
selected_filter_company:{},
startdate: moment(new Date()).format('DD-MM-YYYY'),
enddate: moment(new Date()).format('DD-MM-YYYY'),
dialog_form_mou: false,
dialog_alert_verif: false,
msgalertverif: ''
},
mutations: {
update_dialog_alert_verif(state, val) {
state.dialog_alert_verif = val
},
update_msgalertverif(state, val) {
state.msgalertverif = val
},
update_startdate(state, val) {
state.startdate = val
},
update_enddate(state, val) {
state.enddate = val
},
update_dialog_form_mou(state, val) {
state.dialog_form_mou = val
},
update_selected_filter_company(state, val) {
state.selected_filter_company = val
},
update_msg_info(state, val) {
state.msg_info = val
},
update_open_dialog_info(state, val) {
state.open_dialog_info = val
},
update_x_addr_id(state, val) {
state.x_addr_id = val
},
update_last_id(state, val) {
state.last_id = val
},
update_last_saved_id(state, val) {
state.last_saved_id = val
},
update_act(state, val) {
state.act = val
},
update_act_addr(state, val) {
state.act_addr = val
},
update_get_data_status(state, val) {
state.get_data_status = val
},
update_search_error_message(state, patient) {
state.search_error_message = patient
},
update_search_mou(state, mou) {
state.search_mou = mou
},
update_preffix(state, val) {
state.preffix = val
},
update_preffix2(state, val) {
state.preffix2 = val
},
update_mou_name(state, val) {
state.mou_name = val
},
update_suffix(state, val) {
state.suffix = val
},
update_suffix2(state, val) {
state.suffix2 = val
},
update_suffix3(state, val) {
state.suffix3 = val
},
update_mous(state, data) {
state.mous = data
},
update_selected_status(state, val) {
state.selected_status = val
},
update_selected_mou(state, val) {
state.selected_mou = val
},
update_sexes(state, val) {
state.sexes = val
},
update_selected_sex(state, val) {
state.selected_sex = val
},
update_religions(state, val) {
state.religions = val
},
update_selected_religion(state, val) {
state.selected_religion = val
},
update_companys(state, val) {
state.companys = val
},
update_company(state, val) {
state.company = val
},
update_fcompanys(state, val) {
state.fcompanys = val
},
update_selected_company(state, val) {
state.selected_company = val
},
update_phone(state, val) {
state.phone = val
},
update_is_default_email(state, val) {
state.is_default_email = val
},
update_email(state, val) {
state.email = val
},
update_hp(state, val) {
state.hp = val
},
update_note(state, val) {
state.note = val
},
update_pj(state, val) {
state.pj = val
},
update_pjmcu(state, val) {
state.pjmcu = val
},
update_dpj(state, val) {
state.dpj = val
},
update_clinic(state, val) {
state.clinic = val
},
update_marketing_confirm(state, val) {
state.marketing_confirm = val
},
update_is_default(state, val) {
state.is_default = val
},
update_save_status(state, val) {
state.save_status = val
},
update_btn_save_seen(state, val) {
state.btn_save_seen = val
},
update_pgrs_save(state, val) {
state.pgrs_save = val
},
update_save_error_message(state, msg) {
state.save_error_message = ''
},
update_no_save(state, val) {
state.no_save = val
},
update_open_alert_confirmation(state, val) {
state.open_alert_confirmation = val
},
update_alert_success(state, val) {
state.alert_success = val
},
update_msg_success(state, val) {
state.msg_success = val
},
update_dialog_success(state, val) {
state.dialog_success = val
},
update_dialog_confirmation_delete(state, val) {
state.dialog_confirmation_delete = val
},
update_msg_confirmation_delete(state, val) {
state.msg_confirmation_delete = val
},
update_dialog_confirmation_delete_addr(state, val) {
state.dialog_confirmation_delete_addr = val
},
update_msg_confirmation_delete_addr(state, val) {
state.msg_confirmation_delete_addr = val
},
update_addresses(state, val) {
state.addresses = val
},
update_autocomplete_status(state,val){
state.autocomplete_status = val
},
update_dialog_form_address(state, val) {
state.dialog_form_address = val
},
update_label_address(state, val) {
state.label_address = val
},
update_cities(state, val) {
state.cities = val
},
update_city_address(state, val) {
state.city_address = val
},
update_districts(state, val) {
state.districts = val
},
update_district_address(state, val) {
state.district_address = val
},
update_kelurahans(state, val) {
state.kelurahans = val
},
update_kelurahan_address(state, val) {
state.kelurahan_address = val
},
update_jpas(state, val) {
state.jpas = val
},
update_jpa_address(state, val) {
state.jpa_address = val
},
update_description_address(state, val) {
state.description_address = val
},
update_search_status(state, val) {
state.search_status = val
},
update_errors(state, val) {
state.errors = val
},
update_total_mou(state, val) {
state.total_mou = val
},
update_current_page(state, val) {
state.current_page = val
},
},
actions: {
async search(context, prm) {
context.commit("update_search_mou", 1)
try {
prm.token = one_token()
let resp = await api.search(prm)
if (resp.status != "OK") {
context.commit("update_search_mou", 3)
context.commit("update_search_error_message", resp.message)
} else {
context.commit("update_search_mou", 2)
context.commit("update_search_error_message", "")
let data = {
records: resp.data.records,
total: resp.data.total
}
context.commit("update_mous", data.records)
console.log(data.total)
context.commit("update_total_mou", data.total)
context.commit("update_no_save", 0)
//context.commit("update_selected_mou",{})
if(data.records.length > 0){
var doc = {}
if(prm.lastid === -1){
console.log("minsatu")
context.commit("update_selected_mou", data.records[0])
doc = data.records[0]
}
else{
context.commit("update_selected_mou", data.records[prm.lastid])
doc = data.records[prm.lastid]
}
context.commit("update_preffix",doc.M_DoctorPrefix)
context.commit("update_preffix2",doc.M_DoctorPrefix2)
context.commit("update_mou_name",doc.M_DoctorName)
context.commit("update_suffix",doc.M_DoctorSufix)
context.commit("update_suffix2",doc.M_DoctorSufix2)
context.commit("update_suffix3",doc.M_DoctorSufix3)
context.commit("update_selected_sex",{M_SexID:doc.M_DoctorM_SexID,m_sexname:doc.M_SexName})
context.commit("update_selected_company",{Nat_StaffID:doc.Nat_StaffID,Nat_StaffNIK:doc.Nat_StaffNIK,Nat_StaffName:doc.Nat_StaffName})
context.commit("update_companys",[{Nat_StaffID:doc.Nat_StaffID,Nat_StaffNIK:doc.Nat_StaffNIK,Nat_StaffName:doc.Nat_StaffName}])
context.commit("update_company",{Nat_StaffID:doc.Nat_StaffID,Nat_StaffNIK:doc.Nat_StaffNIK,Nat_StaffName:doc.Nat_StaffName})
context.commit("update_selected_religion",{M_ReligionID:doc.M_DoctorM_ReligionID,M_ReligionName:doc.M_ReligionName})
context.commit("update_phone",doc.M_DoctorPhone)
context.commit("update_email",doc.M_DoctorEmail)
context.commit("update_hp",doc.M_DoctorHP)
context.commit("update_pj",doc.M_DoctorIsPJ)
context.commit("update_pjmcu",doc.M_DoctorIsDefaultMcu)
context.commit("update_dpj",doc.M_DoctorIsDefaultPJ)
context.commit("update_clinic",doc.M_DoctorIsClinic)
context.commit("update_marketing_confirm",doc.M_DoctorIsMarketingConfirm)
context.commit("update_is_default",doc.M_DoctorIsDefault)
}else{
context.commit("update_preffix",'')
context.commit("update_preffix2",'')
context.commit("update_mou_name",'')
context.commit("update_suffix",'')
context.commit("update_suffix2",'')
context.commit("update_suffix3",'')
context.commit("update_selected_sex",{})
context.commit("update_selected_company",{})
context.commit("update_company",{})
context.commit("update_selected_religion",{})
context.commit("update_phone",'')
context.commit("update_email",'')
context.commit("update_hp",'')
context.commit("update_pj",'N')
context.commit("update_pjmcu",'N')
context.commit("update_dpj",'N')
context.commit("update_clinic",'N')
context.commit("update_marketing_confirm",'N')
context.commit("update_is_default",'')
context.commit("update_addresses",[])
//context.dispatch("getaddress",{id:doc.M_DoctorID})
}
}
} catch (e) {
context.commit("update_search_mou", 3)
context.commit("update_search_error_message", e.message)
console.log(e)
}
},
async getsexreg(context,prm) {
context.commit("update_get_data_status",1)
try {
let resp= await api.getsexreg(one_token())
if (resp.status != "OK") {
context.commit("update_get_data_status",3)
} else {
context.commit("update_get_data_status",2)
let data = {
records : resp.data.records,
total: resp.data.total
}
context.commit("update_sexes",data.records.sexes)
context.commit("update_religions",data.records.religions)
context.commit("update_fcompanys",data.records.companys)
context.commit("update_selected_filter_company",data.records.companys[0])
context.commit("update_jpas",data.records.jpas)
prm.company = data.records.companys[0].Nat_StaffNIK
context.dispatch("search",prm)
}
} catch(e) {
context.commit("update_get_data_status",3)
}
},
async save(context,prm) {
context.commit("update_save_status",1)
try {
prm.token = one_token()
let resp= await api.save(prm)
if (resp.status != "OK") {
context.commit("update_save_status",3)
} else {
context.commit("update_save_status",2)
context.commit("update_last_id", prm.M_DoctorID)
context.commit("update_dialog_success", true)
var msg = "Data dokter " + prm.M_DoctorName + " sudah terupdate dong ..."
context.commit("update_msg_success", msg)
}
} catch(e) {
context.commit("update_save_status",3)
}
},
async extendmou(context,prm) {
context.commit("update_save_status",1)
try {
prm.token = one_token()
let resp= await api.extendmou(prm)
if (resp.status != "OK") {
context.commit("update_save_status",3)
var msg = resp.message
var str = msg[1].split('[message] =>').splice(1).join('[message] =>')
var note = str.replace('\\n)\\n\"}"', '')
console.log(note)
context.commit("update_msgalertverif", note)
context.commit("update_dialog_alert_verif", true)
} else {
context.commit("update_save_status",2)
context.commit("update_last_id", prm.M_DoctorID)
context.commit("update_dialog_success", true)
var msg = "Periode agremeent " + prm.name + " sudah diubah dong ..."
context.commit("update_msg_success", msg)
context.commit("update_dialog_form_mou", false)
}
} catch(e) {
context.commit("update_save_status",3)
}
},
async newmou(context,prm) {
context.commit("update_save_status",1)
try {
prm.token = one_token()
let resp= await api.newmou(prm)
if (resp.status != "OK") {
context.commit("update_save_status",3)
} else {
context.commit("update_save_status",2)
console.log(resp.data.id)
context.commit("update_last_id", resp.data.id)
context.commit("update_dialog_success", true)
var msg = "Data dokter " + prm.M_DoctorName + " sudah tersimpan dong ..."
context.commit("update_msg_success", msg)
}
} catch(e) {
context.commit("update_save_status",3)
}
},
async delete(context,prm) {
context.commit("update_save_status",1)
try {
prm.token = one_token()
let resp= await api.xdelete(prm)
if (resp.status != "OK") {
context.commit("update_save_status",3)
} else {
context.commit("update_save_status",2)
context.commit("update_last_id", 0)
context.commit("update_dialog_confirmation_delete",false)
context.commit("update_dialog_success", true)
var msg = "Data dokter " + prm.M_DoctorName + " sudah dihapus dong ..."
context.commit("update_msg_success", msg)
context.commit("update_preffix",'')
context.commit("update_preffix2",'')
context.commit("update_mou_name",'')
context.commit("update_suffix",'')
context.commit("update_suffix2",'')
context.commit("update_suffix3",'')
context.commit("update_selected_sex",{})
context.commit("update_selected_religion",{})
context.commit("update_selected_company",{})
context.commit("update_phone",'')
context.commit("update_email",'')
context.commit("update_hp",'')
context.commit("update_note",'')
context.commit("update_pj",'N')
context.commit("update_dpj",'N')
context.commit("update_clinic",'N')
context.commit("update_marketing_confirm",'N')
context.commit("update_is_default",'N')
}
} catch(e) {
context.commit("update_save_status",3)
}
},
async getaddress(context,prm) {
context.commit("update_save_status",1)
try {
prm.token = one_token()
let resp= await api.getaddress(prm)
if (resp.status != "OK") {
context.commit("update_save_status",3)
} else {
context.commit("update_save_status",2)
let data = {
records : resp.data.records,
total: resp.data.total
}
context.commit("update_addresses",data.records)
}
} catch(e) {
context.commit("update_save_status",3)
}
},
async searchcompany(context, prm) {
context.commit("update_autocomplete_status", 1)
try {
let resp = await api.searchcompany(one_token(), prm)
if (resp.status != "OK") {
context.commit("update_autocomplete_status", 3)
} else {
context.commit("update_autocomplete_status", 2)
let data = {
records: resp.data.records,
total: resp.data.total
}
context.commit("update_companys", resp.data.records)
}
} catch (e) {
context.commit("update_autocomplete_status", 3)
}
},
async searchcity(context,prm) {
context.commit("update_autocomplete_status",1)
try {
let resp= await api.searchcity(one_token(),prm)
if (resp.status != "OK") {
context.commit("update_autocomplete_status",3)
} else {
context.commit("update_autocomplete_status",2)
let data = {
records : resp.data.records,
total: resp.data.total
}
context.commit("update_cities",resp.data.records)
}
} catch(e) {
context.commit("update_autocomplete_status",3)
}
},
async getdistrict(context,prm) {
context.commit("update_get_data_status",1)
try {
let resp= await api.getdistrict(one_token(),prm)
if (resp.status != "OK") {
context.commit("update_get_data_status",3)
} else {
context.commit("update_get_data_status",2)
let data = {
records : resp.data.records,
total: resp.data.total
}
context.commit("update_districts",resp.data.records)
}
} catch(e) {
context.commit("update_get_data_status",3)
}
},
async getkelurahan(context,prm) {
context.commit("update_get_data_status",1)
try {
let resp= await api.getkelurahan(one_token(),prm)
if (resp.status != "OK") {
context.commit("update_get_data_status",3)
} else {
context.commit("update_get_data_status",2)
let data = {
records : resp.data.records,
total: resp.data.total
}
context.commit("update_kelurahans",resp.data.records)
}
} catch(e) {
context.commit("update_get_data_status",3)
}
},
async getjpa(context) {
context.commit("update_get_data_status",1)
try {
let resp= await api.getjpa(one_token())
if (resp.status != "OK") {
context.commit("update_get_data_status",3)
} else {
context.commit("update_get_data_status",2)
let data = {
records : resp.data.records,
total: resp.data.total
}
context.commit("update_jpas",resp.data.records)
}
} catch(e) {
context.commit("update_get_data_status",3)
}
},
async savenewaddress(context,prm) {
context.commit("update_save_status",1)
try {
prm.token = one_token()
let resp= await api.savenewaddress(prm)
if (resp.status != "OK") {
context.commit("update_save_status",3)
} else {
context.commit("update_save_status",2)
context.commit("update_dialog_form_address",false)
context.commit("update_last_id", prm.M_DoctorAddressM_DoctorID)
context.commit("update_dialog_success", true)
var msg = "Penambahan data alamat dokter " + prm.M_DoctorName + " sudah berhasil dong ..."
context.commit("update_msg_success", msg)
}
} catch(e) {
context.commit("update_save_status",3)
}
},
async saveeditaddress(context,prm) {
context.commit("update_save_status",1)
try {
prm.token = one_token()
let resp= await api.saveeditaddress(prm)
if (resp.status != "OK") {
context.commit("update_save_status",3)
} else {
context.commit("update_save_status",2)
context.commit("update_dialog_form_address",false)
context.commit("update_last_id", prm.M_DoctorAddressM_DoctorID)
context.commit("update_dialog_success", true)
var msg = "Perubahan data alamat dokter " + prm.M_DoctorName + " sudah berhasil dong ..."
context.commit("update_msg_success", msg)
}
} catch(e) {
context.commit("update_save_status",3)
}
},
async deleteaddress(context,prm) {
context.commit("update_save_status",1)
try {
prm.token = one_token()
let resp= await api.deleteaddress(prm)
if (resp.status != "OK") {
context.commit("update_save_status",3)
} else {
context.commit("update_save_status",2)
context.commit("update_dialog_confirmation_delete_addr",false)
context.commit("update_last_id", prm.M_DoctorAddressM_DoctorID)
context.commit("update_dialog_success", true)
var msg = "Penghapusan data alamat "+prm.M_DoctorAddressNote+" dari dokter " + prm.M_DoctorName + " sudah berhasil dong ..."
context.commit("update_msg_success", msg)
}
} catch(e) {
context.commit("update_save_status",3)
}
}
}
}

View File

@@ -0,0 +1,27 @@
// State
// data ...
// Mutations
//
//
// Actions
import mou from "./modules/mou.js";
import system from "../../apps/modules/system/system.js";
export const store = new Vuex.Store({
modules: {
mou: mou,
system: system
},
state: {
tab_selected: 'pasien-dokter'
},
mutations: {
change_tab(state, ntab) {
state.tab_selected = ntab
}
},
actions: {
change_tab(context, ntab) {
context.commit('change_tab', ntab)
}
}
});