add modules folder based on s_menu

This commit is contained in:
2026-06-30 10:16:11 +07:00
parent 315b657ee3
commit a1aab09ac9
625 changed files with 192283 additions and 794 deletions

View File

@@ -0,0 +1,152 @@
const URL = "/one-api/map/Faclassv2";
export async function getAcAccumDepre(prm) {
try {
var resp = await axios.post(URL + '/getAcAccumDepre', 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 getAcDepreCost(prm) {
try {
var resp = await axios.post(URL + '/getAcDepreCost', 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 getAcCoa(prm) {
try {
var resp = await axios.post(URL + '/getAcCoa', 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 search(prm) {
try {
var resp = await axios.post(URL + "/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 addData(prm) {
try {
var resp = await axios.post(URL + '/addData', 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 getByID(prm) {
try {
var resp = await axios.post(URL + '/get_by_id', 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 editData(prm) {
try {
var resp = await axios.post(URL + '/editData', 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 deleteData(prm) {
try {
var resp = await axios.post(URL + '/deleteData', 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,945 @@
<template>
<div style="width: 100%;">
<!-- SNACKBAR -->
<v-snackbar v-model="snackbar" :timeout="5000" :multi-line="false" :vertical="false" :top="true">
{{ msgSnackbar }}
<v-btn flat @click="updateAlertSuccess(false)"> Tutup </v-btn>
</v-snackbar>
<!-- ERROR DIALOG -->
<v-dialog v-model="dialog_error" max-width="500px">
<v-card>
<v-card-title>
<span>ERROR !</span>
<v-spacer></v-spacer>
</v-card-title>
<v-divider></v-divider>
<div class="ma-3 red--text">{{ msgError }}</div>
<v-divider></v-divider>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="primary" flat @click="dialog_error = false">Tutup</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
<!-- END ERROR DIALOG -->
<!-- table list start -->
<v-toolbar color="primary" dark>
<v-toolbar-title class="white--text">FA CLASS</v-toolbar-title>
<v-spacer></v-spacer>
<v-btn icon @click="openDialogAdd()">
<v-icon>add_box</v-icon>
</v-btn>
</v-toolbar>
<v-card class="pa-2">
<v-layout row>
<v-flex xs2 pl-2>
<v-text-field v-model="xsearch" label="Cari" outline hide-details></v-text-field>
</v-flex>
<v-flex pl-2>
<v-btn class="ml-2" dark color="primary" style="min-width: 50px; height: 50px; margin: 0;"
@click="searchCoa()">
<v-icon>search</v-icon>
</v-btn>
</v-flex>
</v-layout>
</v-card>
<v-card class="pa-2 mt-2">
<v-layout row wrap class="scroll-container" style="max-height: 600px; overflow: auto;">
<v-flex xs12 pl-2 pr-2 pt-2 pb-2>
<v-data-table :headers="headers" :items="xcoas" :loading="isLoading" hide-actions
class="elevation-1">
<template slot="items" slot-scope="props">
<td class="text-xs-left pa-2" v-bind:class="{ 'amber lighten-4': isSelected(props.item) }"
@click="selectMe(props.item)">
<!-- <span class="font-weight-bold">
{{ props.item.Nat_GroupCode }}
</span>
<br /> -->
{{ props.item.Fa_ClassName }}
</td>
<td class="text-xs-left pa-2" v-bind:class="{ 'amber lighten-4': isSelected(props.item) }"
@click="selectMe(props.item)">
<span class="font-weight-bold">
{{ props.item.Fa_ClassCoaAccountNo }}
</span>
<br />
{{ props.item.Fa_ClassCoaDesc }}
</td>
<td class="text-xs-right pa-2" v-bind:class="{ 'amber lighten-4': isSelected(props.item) }"
@click="selectMe(props.item)">
<!-- <span class="font-weight-bold">
{{ props.item.Nat_GroupCode }}
</span>
<br /> -->
{{ props.item.Fa_ClassDepreCorp }}
</td>
<td class="text-xs-left pa-2" v-bind:class="{ 'amber lighten-4': isSelected(props.item) }"
@click="selectMe(props.item)">
<span class="font-weight-bold">
{{ props.item.Fa_ClassAccumDepreCoaAccountNo }}
</span>
<br />
{{ props.item.Fa_ClassAccumDepreCoaDesc }}
</td>
<td class="text-xs-left pa-2" v-bind:class="{ 'amber lighten-4': isSelected(props.item) }"
@click="selectMe(props.item)">
<!-- <span class="font-weight-bold">
{{ props.item.Nat_GroupCode }}
</span>
<br /> -->
{{ props.item.Fa_ClassAccumNote }}
</td>
<td class="text-xs-right pa-2" v-bind:class="{ 'amber lighten-4': isSelected(props.item) }"
@click="selectMe(props.item)">
<v-tooltip bottom>
<template v-slot:activator="{ on, attrs }">
<v-icon v-bind="attrs" v-on="on" small
@click="openDeleteCoa(props.item)">delete</v-icon>
</template>
<span>Hapus</span>
</v-tooltip>
<v-tooltip bottom>
<template v-slot:activator="{ on, attrs }">
<v-icon v-bind="attrs" v-on="on" small
@click="openEditFormCoa(props.item)">edit</v-icon>
</template>
<span>Edit</span>
</v-tooltip>
<!-- <v-tooltip bottom>
<template v-slot:activator="{ on, attrs }">
<v-icon v-bind="attrs" v-on="on" color="red" small
@click="doPrintVoucher(props.item)">picture_as_pdf</v-icon>
</template>
<span>Voucher</span>
</v-tooltip> -->
</td>
</template>
</v-data-table>
</v-flex>
</v-layout>
<v-divider></v-divider>
<v-pagination style="margin-top: 10px; margin-bottom: 10px;" v-model="curr_page"
:length="xtotal_page"></v-pagination>
</v-card>
<!-- table list end -->
<!-- add form dialog start -->
<template>
<v-layout row justify-center>
<v-dialog v-model="dialog_add_coa" persistent max-width="550px">
<v-toolbar dark class="blue lighten-3 white--text">
<v-toolbar-title class="white--text">ADD FORM</v-toolbar-title>
<v-spacer></v-spacer>
</v-toolbar>
<v-card>
<v-card-text class="pt-4 pb-2">
<v-layout wrap>
<v-flex xs12>
<!-- Class Name -->
<v-text-field label="CLASS NAME" v-model="a_classname" hide-details
outline></v-text-field>
<!-- Ac coa -->
<v-autocomplete class="mt-3" label="Acc Coa" :items="a_coa_list" v-model="a_coa"
:search-input.sync="a_coa_search" hide-details auto-select-first no-filter
item-text="coaDescription" outline return-object no-data-text="Pilih Acc Coa">
<template slot="item" slot-scope="{ item }">
<v-list-tile-content>
<v-list-tile-title v-text="item.coaDescription"></v-list-tile-title>
<v-list-tile-sub-title
v-text="item.coaAccountNo"></v-list-tile-sub-title>
</v-list-tile-content>
</template>
</v-autocomplete>
<!-- Ac coa -->
<!-- depre corpd -->
<v-text-field class="mt-3" label="DEPRE CORP" v-model="a_deprecorp" hide-details
outline></v-text-field>
<!-- Ac accum depre -->
<v-autocomplete class="mt-3" label="Acc Accum Depre" :items="a_coa_accum_depre_list"
v-model="a_coa_accum_depre" :search-input.sync="a_coa_search_accum_depre"
hide-details auto-select-first no-filter item-text="coaDescription" outline
return-object no-data-text="Pilih Acc Accum Depre">
<template slot="item" slot-scope="{ item }">
<v-list-tile-content>
<v-list-tile-title v-text="item.coaDescription"></v-list-tile-title>
<v-list-tile-sub-title
v-text="item.coaAccountNo"></v-list-tile-sub-title>
</v-list-tile-content>
</template>
</v-autocomplete>
<!-- Ac accum depre -->
<!-- Accum Note -->
<v-text-field class="mt-3" label="UMUR ASET (BULAN)" v-model="a_age" hide-details
outline></v-text-field>
<v-autocomplete class="mt-3" label="Accum Biaya Depre" :items="a_coa_depre_cost_list"
v-model="a_coa_depre_cost" :search-input.sync="a_coa_search_depre_cost"
hide-details auto-select-first no-filter item-text="coaDescription" outline
return-object no-data-text="Pilih Acc Accum Depre">
<template slot="item" slot-scope="{ item }">
<v-list-tile-content>
<v-list-tile-title v-text="item.coaDescription"></v-list-tile-title>
<v-list-tile-sub-title
v-text="item.coaAccountNo"></v-list-tile-sub-title>
</v-list-tile-content>
</template>
</v-autocomplete>
<v-textarea class="mt-3" label="NOTE" v-model="a_note" hide-details rows="3"
outline></v-textarea>
</v-flex>
</v-layout>
</v-card-text>
<v-card-actions class="pr-3">
<v-spacer></v-spacer>
<v-btn color="error" flat @click="closeDialogAddCoa()">TUTUP</v-btn>
<v-btn color="primary" @click="saveFormAdd()">SIMPAN</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</v-layout>
</template>
<!-- add form dialog end -->
<!-- dialog delete start -->
<template>
<v-dialog v-model="dialogdeletealecoa" max-width="30%">
<v-card>
<v-card-title class="headline grey 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>
{{ msgalertcoa }}
</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="error" flat @click="dialogdeletealecoa = false">
Tutup
</v-btn>
<v-btn color="primary" @click="closeDeleteAlertCoa()">
Ya
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</template>
<!-- dialog delete end -->
<!-- edit form dialog start -->
<template>
<v-layout row justify-center>
<v-dialog v-model="dialog_edit_coa" persistent max-width="550px">
<v-toolbar dark class="blue lighten-3 white--text">
<v-toolbar-title class="white--text">EDIT FORM</v-toolbar-title>
<v-spacer></v-spacer>
</v-toolbar>
<v-card>
<v-card-text class="pt-4 pb-2">
<v-layout wrap>
<v-flex xs12>
<!-- Class Name -->
<v-text-field label="CLASS NAME" v-model="e_classname" hide-details
outline></v-text-field>
<!-- Ac coa -->
<v-autocomplete class="mt-3" label="Acc Coa" :items="e_coa_list" v-model="e_coa"
:search-input.sync="e_coa_search" hide-details auto-select-first no-filter
item-text="coaDescription" outline return-object no-data-text="Pilih Acc Coa">
<template slot="item" slot-scope="{ item }">
<v-list-tile-content>
<v-list-tile-title v-text="item.coaDescription"></v-list-tile-title>
<v-list-tile-sub-title
v-text="item.coaAccountNo"></v-list-tile-sub-title>
</v-list-tile-content>
</template>
</v-autocomplete>
<!-- Ac coa -->
<!-- depre corpd -->
<v-text-field class="mt-3" label="DEPRE CORP" v-model="e_deprecorp" hide-details
outline></v-text-field>
<!-- Ac accum depre -->
<v-autocomplete class="mt-3" label="Acc Accum Depre" :items="e_coa_accum_depre_list"
v-model="e_coa_accum_depre" :search-input.sync="e_coa_search_accum_depre"
hide-details auto-select-first no-filter item-text="coaDescription" outline
return-object no-data-text="Pilih Acc Accum Depre">
<template slot="item" slot-scope="{ item }">
<v-list-tile-content>
<v-list-tile-title v-text="item.coaDescription"></v-list-tile-title>
<v-list-tile-sub-title
v-text="item.coaAccountNo"></v-list-tile-sub-title>
</v-list-tile-content>
</template>
</v-autocomplete>
<!-- Ac accum depre -->
<!-- Accum Note -->
<v-text-field class="mt-3" label="UMUR ASET (BULAN)" v-model="e_age" hide-details
outline></v-text-field>
<v-autocomplete class="mt-3" label="Accum Biaya Depre" :items="e_coa_depre_cost_list"
v-model="e_coa_depre_cost" :search-input.sync="e_coa_search_depre_cost"
hide-details auto-select-first no-filter item-text="coaDescription" outline
return-object no-data-text="Pilih Acc Accum Depre">
<template slot="item" slot-scope="{ item }">
<v-list-tile-content>
<v-list-tile-title v-text="item.coaDescription"></v-list-tile-title>
<v-list-tile-sub-title
v-text="item.coaAccountNo"></v-list-tile-sub-title>
</v-list-tile-content>
</template>
</v-autocomplete>
<v-textarea class="mt-3" label="NOTE" v-model="e_note" hide-details rows="3"
outline></v-textarea>
</v-flex>
</v-layout>
</v-card-text>
<v-card-actions class="pr-3">
<v-spacer></v-spacer>
<v-btn color="error" flat @click="closeDialogEditCoa()">TUTUP</v-btn>
<v-btn color="primary" @click="saveFormEdit()">SIMPAN</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</v-layout>
</template>
<!-- edit form dialog end -->
<template>
<one-dialog-info :status="opendialoginfo" :msg="msginfo"
@close-dialog-info="opendialoginfo = false"></one-dialog-info>
</template>
</div>
</template>
<style scoped>
table.v-table tbody td,
table.v-table tbody th {
height: 40px;
}
table.v-table thead tr {
height: 40px;
}
.textinput {
-webkit-transition: width 0.4s ease-in-out;
transition: width 0.4s ease-in-out;
background-color: white;
background-position: 10px 10px;
background-repeat: no-repeat;
padding-left: 40px;
width: 100%;
padding: 8px 10px;
margin-bottom: 5px;
box-sizing: border-box;
border: 1px solid #607d8b;
}
.textinput:focus {
width: 100%;
}
.textinput:focus::-webkit-input-placeholder {
color: transparent;
}
.textinput:focus::-moz-placeholder {
color: transparent;
}
.textinput:-moz-placeholder {
color: transparent;
}
.scroll-container {
scroll-padding: 50px 0 0 50px;
}
</style>
<script>
module.exports = {
components: {
"one-dialog-info": httpVueLoader("../../common/oneDialogInfo.vue"),
"one-dialog-alert": httpVueLoader("../../common/oneDialogAlert.vue"),
"one-dialog-error": httpVueLoader("../../common/oneDialogError.vue"),
"one-dialog-print": httpVueLoader("../../common/oneDialogPrintX.vue"),
},
data() {
return {
formatreport: "pdf",
urlprint: "",
printtitle: "",
printwidth: "100%",
page: 1,
Fa_ClassID: 0,
Fa_ClassName: "",
headers: [
{
text: "CLASS NAME",
align: "center",
sortable: false,
value: "date",
width: "10%",
class: "blue lighten-3 white--text",
},
{
text: "ACC COA",
align: "center",
sortable: false,
value: "jurnal",
width: "20%",
class: "blue lighten-3 white--text",
},
{
text: "DEPRE CORP",
align: "right",
sortable: false,
value: "location",
width: "10%",
class: "blue lighten-3 white--text",
},
{
text: "ACC DEPRE ACCUM",
align: "center",
sortable: false,
value: "info",
width: "20%",
class: "blue lighten-3 white--text",
},
{
text: "NOTE",
align: "left",
sortable: false,
value: "info",
width: "20%",
class: "blue lighten-3 white--text",
},
{
text: "AKSI",
align: "center",
sortable: false,
value: "status",
width: "5%",
class: "blue lighten-3 white--text",
},
],
dialogdeletealecoa: false,
msgalertcoa: "",
e_coa_search: '',
e_coa_search_accum_depre: '',
e_coa_search_depre_cost: ''
}
},
mounted() {
this.$store.dispatch("faclass/search", {
current_page: this.$store.state.faclass.a_current_page,
search: this.$store.state.faclass.a_x_search,
last_id: -1,
});
},
computed: {
opendialoginfo: {
get() {
return this.$store.state.faclass.a_open_dialog_info;
},
set(val) {
this.$store.commit("faclass/update_a_open_dialog_info", false);
},
},
msginfo: {
get() {
return this.$store.state.faclass.a_msg_info;
},
set(val) {
this.$store.commit("faclass/update_a_msg_info", false);
},
},
snackbar: {
get() {
return this.$store.state.faclass.a_alert_success;
},
set(val) {
this.$store.commit("faclass/update_a_alert_success", val);
},
},
msgSnackbar() {
return this.$store.state.faclass.a_msg_success;
},
dialog_error: {
get() {
return this.$store.state.faclass.a_alert_error;
},
set(val) {
this.$store.commit("faclass/update_a_alert_error", val);
},
},
msgError() {
return this.$store.state.faclass.a_save_error_message;
},
// search table start
xcoas() {
return this.$store.state.faclass.a_coas;
},
isLoading() {
return this.$store.state.faclass.a_search_status === 1;
},
xsearch: {
get() {
return this.$store.state.faclass.a_x_search;
},
set(val) {
this.$store.commit("faclass/update_a_x_search", val);
},
},
curr_page: {
get() {
return this.$store.state.faclass.a_current_page;
},
set(val) {
this.$store.commit("faclass/update_a_current_page", val);
this.$store.commit("faclass/update_a_last_id", -1);
this.searchCoa();
},
},
xtotal_page: {
get() {
return this.$store.state.faclass.a_total_coa;
},
set(val) {
this.$store.commit("faclass/update_a_total_coa", val);
},
},
// search table end
// dialog add
dialog_add_coa: {
get() {
return this.$store.state.faclass.dialog_add_coa;
},
set(val) {
this.$store.commit("faclass/update_dialog_add_coa", val);
},
},
dialog_edit_coa: {
get() {
return this.$store.state.faclass.dialog_edit_coa;
},
set(val) {
this.$store.commit("faclass/update_dialog_edit_coa", val);
},
},
// text classname
a_classname: {
get() {
return this.$store.state.faclass.a_classname;
},
set(val) {
this.$store.commit("faclass/update_a_classname", val);
},
},
e_classname: {
get() {
return this.$store.state.faclass.e_classname;
},
set(val) {
this.$store.commit("faclass/update_e_classname", val);
},
},
// ac coa start
a_coa_list() {
return this.$store.state.faclass.a_coa_list;
},
a_coa: {
get() {
return this.$store.state.faclass.a_coa;
},
set(val) {
this.$store.commit("faclass/update_a_coa", val);
},
},
a_loading_coa: {
get() {
return this.$store.state.faclass.a_loading_coa;
},
set(val) {
this.$store.commit("faclass/update_a_loading_coa", val);
},
},
a_coa_search: {
get() {
return this.$store.state.faclass.a_coa_search
},
set(val) {
this.$store.commit("faclass/update_a_coa_search", val);
this.aSearchAcCoa(val)
}
},
e_coa_list() {
return this.$store.state.faclass.e_coa_list;
},
e_coa: {
get() {
return this.$store.state.faclass.e_coa;
},
set(val) {
this.$store.commit("faclass/update_e_coa", val);
},
},
e_loading_coa: {
get() {
return this.$store.state.faclass.e_loading_coa;
},
set(val) {
this.$store.commit("faclass/update_e_loading_coa", val);
},
},
// text accum depre
a_deprecorp: {
get() {
return this.$store.state.faclass.a_deprecorp;
},
set(val) {
this.$store.commit("faclass/update_a_deprecorp", val);
},
},
a_age: {
get() {
return this.$store.state.faclass.a_age;
},
set(val) {
this.$store.commit("faclass/update_a_age", val);
},
},
e_age: {
get() {
return this.$store.state.faclass.e_age;
},
set(val) {
this.$store.commit("faclass/update_e_age", val);
},
},
e_deprecorp: {
get() {
return this.$store.state.faclass.e_deprecorp;
},
set(val) {
this.$store.commit("faclass/update_e_deprecorp", val);
},
},
// ac coa accum depre
a_coa_accum_depre_list() {
return this.$store.state.faclass.a_coa_accum_depre_list;
},
a_coa_accum_depre: {
get() {
return this.$store.state.faclass.a_coa_accum_depre;
},
set(val) {
this.$store.commit("faclass/update_a_coa_accum_depre", val);
},
},
a_loading_coa_accum_depre: {
get() {
return this.$store.state.faclass.a_loading_coa_accum_depre;
},
set(val) {
this.$store.commit("faclass/update_a_loading_coa_accum_depre", val);
},
},
a_coa_search_accum_depre: {
get() {
return this.$store.state.faclass.a_coa_search_accum_depre
},
set(val) {
this.$store.commit("faclass/update_a_coa_search_accum_depre", val);
this.aSearchAcCoaAccumDepre(val)
}
},
a_coa_depre_cost_list() {
return this.$store.state.faclass.a_coa_depre_cost_list;
},
a_coa_depre_cost: {
get() {
return this.$store.state.faclass.a_coa_depre_cost;
},
set(val) {
this.$store.commit("faclass/update_a_coa_depre_cost", val);
},
},
a_loading_coa_depre_cost: {
get() {
return this.$store.state.faclass.a_loading_coa_depre_cost;
},
set(val) {
this.$store.commit("faclass/update_a_loading_coa_depre_cost", val);
},
},
a_coa_search_depre_cost: {
get() {
return this.$store.state.faclass.a_coa_search_depre_cost
},
set(val) {
this.$store.commit("faclass/update_a_coa_search_depre_cost", val);
this.aSearchAcCoaDepreCost(val)
}
},
e_coa_depre_cost_list() {
return this.$store.state.faclass.e_coa_depre_cost_list;
},
e_coa_depre_cost: {
get() {
return this.$store.state.faclass.e_coa_depre_cost;
},
set(val) {
this.$store.commit("faclass/update_e_coa_depre_cost", val);
},
},
e_loading_coa_depre_cost: {
get() {
return this.$store.state.faclass.e_loading_coa_depre_cost;
},
set(val) {
this.$store.commit("faclass/update_e_loading_coa_depre_cost", val);
},
},
e_coa_search_depre_cost: {
get() {
return this.$store.state.faclass.e_coa_search_depre_cost
},
set(val) {
this.$store.commit("faclass/update_e_coa_search_depre_cost", val);
this.eSearchAcCoaDepreCost(val)
}
},
e_coa_accum_depre_list() {
return this.$store.state.faclass.e_coa_accum_depre_list;
},
e_coa_accum_depre: {
get() {
return this.$store.state.faclass.e_coa_accum_depre;
},
set(val) {
this.$store.commit("faclass/update_e_coa_accum_depre", val);
},
},
e_loading_coa_accum_depre: {
get() {
return this.$store.state.faclass.e_loading_coa_accum_depre;
},
set(val) {
this.$store.commit("faclass/update_e_loading_coa_accum_depre", val);
},
},
e_coa_depre_cost_list() {
return this.$store.state.faclass.e_coa_depre_cost_list;
},
e_coa_depre_cost: {
get() {
return this.$store.state.faclass.e_coa_depre_cost;
},
set(val) {
this.$store.commit("faclass/update_e_coa_depre_cost", val);
},
},
e_loading_coa_depre_cost: {
get() {
return this.$store.state.faclass.e_loading_coa_depre_cost;
},
set(val) {
this.$store.commit("faclass/update_e_loading_coa_depre_cost", val);
},
},
// text note
a_note: {
get() {
return this.$store.state.faclass.a_note;
},
set(val) {
this.$store.commit("faclass/update_a_note", val);
},
},
e_note: {
get() {
return this.$store.state.faclass.e_note;
},
set(val) {
this.$store.commit("faclass/update_e_note", val);
},
},
},
methods: {
searchCoa() {
this.$store.dispatch("faclass/search", {
current_page: this.$store.state.faclass.a_current_page,
search: this.$store.state.faclass.a_x_search,
last_id: -1,
});
},
isSelected(p) {
return p.Fa_ClassID == this.$store.state.faclass.a_selected_a_coa.Fa_ClassID;
},
selectMe(sc) {
this.$store.commit("faclass/update_a_selected_a_coa", sc);
},
closeDialogAddCoa() {
this.$store.commit("faclass/update_dialog_add_coa", false);
this.$store.commit("faclass/update_a_classname", "");
this.$store.commit("faclass/update_a_coa", {});
this.$store.commit("faclass/update_a_deprecorp", "");
this.$store.commit("faclass/update_a_age", "");
this.$store.commit("faclass/update_a_coa_accum_depre", {});
this.$store.commit("faclass/update_a_coa_depre_cost", {});
this.$store.commit("faclass/update_a_note", "");
},
async aSearchAcCoa(query) {
if (!query) return;
this.a_loading_coa = true;
await this.$store.dispatch("faclass/open_add_coa", { search: query });
this.a_loading_coa = false;
},
async eSearchAcCoa(query) {
if (!query) return;
this.e_loading_coa = true;
await this.$store.dispatch("faclass/open_edit_coa", { search: query });
this.e_loading_coa = false;
},
async aSearchAcCoaAccumDepre(query) {
if (!query) return;
this.a_loading_coa_accum_depre = true;
await this.$store.dispatch("faclass/open_add_coa_accum_depre", { search: query });
this.a_loading_coa_accum_depre = false;
},
async eSearchAcCoaAccumDepre(query) {
if (!query) return;
this.e_loading_coa_accum_depre = true;
await this.$store.dispatch("faclass/open_edit_coa_accum_depre", { search: query });
this.e_loading_coa_accum_depre = false;
},
async aSearchAcCoaDepreCost(query) {
if (!query) return;
this.a_loading_coa_depre_cost = true;
await this.$store.dispatch("faclass/open_add_coa_depre_cost", { search: query });
this.a_loading_coa_depre_cost = false;
},
async eSearchAcCoaDepreCost(query) {
if (!query) return;
this.e_loading_coa_depre_cost = true;
await this.$store.dispatch("faclass/open_edit_coa_depre_cost", { search: query });
this.e_loading_coa_depre_cost = false;
},
// add data
openDialogAdd() {
this.$store.commit("faclass/update_dialog_add_coa", true);
},
saveFormAdd() {
var paramAdd = {
a_classname_param: this.a_classname,
a_coa_param: this.a_coa,
a_deprecorp_param: this.a_deprecorp,
a_age_param: this.a_age,
a_coa_accum_depre_param: this.a_coa_accum_depre,
a_coa_depre_cost_param: this.a_coa_depre_cost,
a_note_param: this.a_note,
};
console.log('param add', paramAdd);
this.$store.dispatch("faclass/add_data", paramAdd);
},
// edit
closeDialogEditCoa() {
this.e_coa_search = ""
this.e_coa_search_accum_depre = ""
this.e_coa_search_depre_cost = ""
this.$store.commit("faclass/update_dialog_edit_coa", false);
this.$store.commit("faclass/update_e_classname", "");
this.$store.commit("faclass/update_e_coa", {});
this.$store.commit("faclass/update_e_deprecorp", "");
this.$store.commit("faclass/update_e_coa_accum_depre", {});
this.$store.commit("faclass/update_e_coa_depre_cost", {});
this.$store.commit("faclass/update_e_note", "");
this.$store.commit("faclass/update_e_age", "");
},
saveFormEdit() {
var paramEdit = {
Fa_ClassID: this.$store.state.faclass.Fa_ClassID,
e_classname_param: this.e_classname,
e_coa_param: this.e_coa,
e_deprecorp_param: this.e_deprecorp,
e_coa_accum_depre_param: this.e_coa_accum_depre,
e_coa_depre_cost_param: this.e_coa_depre_cost,
e_note_param: this.e_note,
e_age_param: this.e_age
};
console.log('paramEdit', paramEdit);
this.$store.dispatch("faclass/edit_data", paramEdit);
},
// delete data
openDeleteCoa(val) {
console.log(val);
this.Fa_ClassID = val.Fa_ClassID;
this.Fa_ClassName = val.Fa_ClassName;
this.msgalertcoa =
"Yakin, mau hapus data [" +
val.Fa_ClassName +
"] ?";
this.dialogdeletealecoa = true;
},
closeDeleteAlertCoa() {
let prm = {
Fa_ClassID: this.Fa_ClassID,
Fa_ClassName: this.Fa_ClassName,
current_page: this.$store.state.faclass.a_current_page,
search: this.$store.state.faclass.a_x_search,
last_id: -1,
};
this.dialogdeletealecoa = false;
this.$store.dispatch("faclass/delete_data", prm);
},
// edit data
openEditFormCoa(val) {
this.$store.dispatch("faclass/get_by_id", val);
},
},
watch: {
e_coa_search(val) {
this.eSearchAcCoa(val)
},
e_coa_search_accum_depre(val) {
this.eSearchAcCoaAccumDepre(val)
},
e_coa_search_depre_cost(val) {
this.eSearchAcCoaDepreCost(val)
},
},
};
</script>

View File

@@ -0,0 +1,69 @@
<!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">
<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">
<title>One</title>
</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-faclass-list></one-faclass-list>
</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 -->
<script type="module">
import {
store
} from './store.js';
window.store = store;
new Vue({
store,
el: '#app',
methods: {
},
components: {
'one-navbar': httpVueLoader('../../../apps/components/oneNavbarComponent.vue'),
'one-footer': httpVueLoader('../../../apps/components/oneFooter.vue'),
'one-faclass-list': httpVueLoader('./components/faclass.vue')
}
})
</script>
<style>
[v-cloak] {
display: none;
}
</style>
</body>
</html>

View File

@@ -0,0 +1,640 @@
import * as api from "../api/faclass.js"
export default {
namespaced: true,
state: {
Fa_ClassID: 0,
a_coas: [],
a_msg_info: '',
a_open_dialog_info: false,
a_save_status: 0,
// search table
a_x_search: '',
a_current_page: 1,
a_last_id: -1,
a_total_coa: 0,
// search table
a_selected_a_coa: {},
a_search_status: 0,
a_alert_success: false,
a_msg_success: '',
a_alert_error: false,
a_save_error_message: '',
dialog_add_coa: false,
dialog_edit_coa: false,
e_loading_nat_group: false,
// text classname
a_classname: '',
e_classname: '',
// ac coa
a_loading_coa: false,
e_loading_coa: false,
a_coa_list: [],
a_coa: {},
a_coa_search: '',
e_coa_list: [],
e_coa: {},
e_coa_search: '',
// text deprecorp
a_deprecorp: '',
a_age: 0,
e_age: 0,
e_deprecorp: '',
// ac coa accum depre
a_loading_coa_accum_depre: false,
e_loading_coa_accum_depre: false,
a_coa_accum_depre_list: [],
a_coa_accum_depre: {},
a_coa_search_accum_depre: '',
e_coa_accum_depre_list: [],
e_coa_accum_depre: {},
e_coa_accum_depre_search: '',
a_loading_coa_depre_cost: false,
e_loading_coa_depre_cost: false,
a_coa_depre_cost_list: [],
a_coa_depre_cost: {},
a_coa_search_depre_cost: '',
e_coa_depre_cost_list: [],
e_coa_depre_cost: {},
e_coa_depre_cost_search: '',
// text note
a_note: '',
e_note: '',
a_errors_save: [],
Fa_ClassID: 0,
a_errors_save_coa: [],
},
mutations: {
update_a_errors_save_coa(state, val) {
state.a_errors_save_coa = val
},
update_a_selected_a_coa(state, val) {
state.a_selected_a_coa = val
},
update_e_loading_nat_group(state, val) {
state.e_loading_nat_group = val
},
update_a_errors_save(state, val) {
state.a_errors_save = val
},
update_a_save_error_message(state, val) {
state.a_save_error_message = val
},
update_a_alert_error(state, val) {
state.a_alert_error = val
},
update_a_msg_success(state, val) {
state.a_msg_success = val
},
update_a_msg_info(state, val) {
state.a_msg_info = val
},
update_a_open_dialog_info(state, val) {
state.a_open_dialog_info = val
},
update_a_alert_success(state, val) {
state.a_alert_success = val
},
update_dialog_add_coa(state, val) {
state.dialog_add_coa = val
},
//table
update_a_search_error_message(state, val) {
state.a_search_error_message = val
},
update_a_search_status(state, val) {
state.a_search_status = val
},
update_a_x_search(state, val) {
state.a_x_search = val
},
update_a_current_page(state, val) {
state.a_current_page = val
},
update_a_last_id(state, val) {
state.a_last_id = val
},
update_a_total_coa(state, val) {
state.a_total_coa = val
},
update_a_a_coas(state, val) {
state.a_coas = val
},
// text classname
update_a_classname(state, val) {
state.a_classname = val
},
update_e_classname(state, val) {
state.e_classname = val
},
// ac coa
update_a_loading_coa(state, val) {
state.a_loading_coa = val
},
update_e_loading_coa(state, val) {
state.e_loading_coa = val
},
update_a_coa_list(state, val) {
state.a_coa_list = val
},
update_e_coa_list(state, val) {
state.e_coa_list = val
},
update_a_coa(state, val) {
state.a_coa = val
},
update_e_coa(state, val) {
state.e_coa = val
},
update_a_coa_search(state, val) {
state.a_coa_search = val
},
update_e_coa_search(state, val) {
state.e_coa_search = val
},
// text depre corp
update_a_deprecorp(state, val) {
state.a_deprecorp = val
},
update_a_age(state, val) {
state.a_age = val
},
update_e_age(state, val) {
state.e_age = val
},
update_e_deprecorp(state, val) {
state.e_deprecorp = val
},
// ac coa accum depre
update_a_loading_coa_accum_depre(state, val) {
state.a_loading_coa_accum_depre = val
},
update_e_loading_coa_accum_depre(state, val) {
state.e_loading_coa_accum_depre = val
},
update_a_coa_accum_depre_list(state, val) {
state.a_coa_accum_depre_list = val
},
update_e_coa_accum_depre_list(state, val) {
state.e_coa_accum_depre_list = val
},
update_a_coa_accum_depre(state, val) {
state.a_coa_accum_depre = val
},
update_e_coa_accum_depre(state, val) {
state.e_coa_accum_depre = val
},
update_a_coa_search_accum_depre(state, val) {
state.a_coa_search_accum_depre = val
},
update_e_coa_accum_depre_search(state, val) {
state.e_coa_accum_depre_search = val
},
update_a_loading_coa_depre_cost(state, val) {
state.a_loading_coa_depre_cost = val
},
update_e_loading_coa_depre_cost(state, val) {
state.e_loading_coa_depre_cost = val
},
update_a_coa_depre_cost_list(state, val) {
state.a_coa_depre_cost_list = val
},
update_e_coa_depre_cost_list(state, val) {
state.e_coa_depre_cost_list = val
},
update_a_coa_depre_cost(state, val) {
state.a_coa_depre_cost = val
},
update_e_coa_depre_cost(state, val) {
state.e_coa_depre_cost = val
},
update_a_coa_search_depre_cost(state, val) {
state.a_coa_search_depre_cost = val
},
update_e_coa_depre_cost_search(state, val) {
state.e_coa_depre_cost_search = val
},
// text note
update_a_note(state, val) {
state.a_note = val
},
update_e_note(state, val) {
state.e_note = val
},
update_dialog_add_coa(state, val) {
state.dialog_add_coa = val
},
update_dialog_edit_coa(state, val) {
state.dialog_edit_coa = val
},
update_Fa_ClassID(state, val) {
state.Fa_ClassID = val
},
update_a_save_status(state, val) {
state.a_save_status = val
},
},
actions: {
// search
async search(context, prm) {
context.commit("update_a_search_status", 1)
try {
prm.token = one_token()
let resp = await api.search(prm)
if (resp.status != "OK") {
context.commit("update_a_search_status", 3)
context.commit("update_a_search_error_message", resp.message)
context.commit("update_a_msg_info", resp.message)
context.commit("update_a_open_dialog_info", true)
} else {
context.commit("update_a_search_status", 2)
context.commit("update_a_search_error_message", "")
context.commit("update_a_msg_info", resp.message)
let data = {
records: resp.data.records,
total: resp.data.total
}
context.commit("update_a_a_coas", data.records)
context.commit("update_a_total_coa", data.total)
}
} catch (e) {
context.commit("update_a_search_status", 3)
context.commit("update_a_search_error_message", e.message)
context.commit("update_a_msg_info", e.message)
context.commit("update_a_open_dialog_info", true)
}
},
// get ac coa from api
async open_add_coa(context, payload) {
context.commit("update_a_loading_coa", true)
try {
let prm = {};
prm.token = one_token()
prm.search = payload.search
let resp = await api.getAcCoa(prm)
// console.log('data nat_group ',resp)
if (resp.status != "OK") {
context.commit("update_a_loading_coa", false)
} else {
// console.log('data nat_group ',resp.data)
context.commit("update_a_loading_coa", false)
context.commit("update_a_coa_list", resp.data)
}
} catch (e) {
context.commit("update_a_loading_coa", false)
}
},
// get ac coa accum depre from api
async open_add_coa_accum_depre(context, payload) {
context.commit("update_a_loading_coa_accum_depre", true)
try {
let prm = {};
prm.token = one_token()
prm.search = payload.search
let resp = await api.getAcAccumDepre(prm)
// console.log('data nat_group ',resp)
if (resp.status != "OK") {
context.commit("update_a_loading_coa_accum_depre", false)
} else {
// console.log('data nat_group ',resp.data)
context.commit("update_a_loading_coa_accum_depre", false)
context.commit("update_a_coa_accum_depre_list", resp.data)
}
} catch (e) {
context.commit("update_a_loading_coa_accum_depre", false)
}
},
async open_add_coa_depre_cost(context, payload) {
context.commit("update_a_loading_coa_depre_cost", true)
try {
let prm = {};
prm.token = one_token()
prm.search = payload.search
let resp = await api.getAcDepreCost(prm)
// console.log('data nat_group ',resp)
if (resp.status != "OK") {
context.commit("update_a_loading_coa_depre_cost", false)
} else {
// console.log('data nat_group ',resp.data)
context.commit("update_a_loading_coa_depre_cost", false)
context.commit("update_a_coa_depre_cost_list", resp.data)
}
} catch (e) {
context.commit("update_a_loading_coa_depre_cost", false)
}
},
// add data
async add_data(context, payload) {
context.commit("update_a_save_status", 1)
try {
let prm = {};
prm.token = one_token()
prm.a_classname = payload.a_classname_param
prm.a_coa = payload.a_coa_param
prm.a_deprecorp = payload.a_deprecorp_param
prm.a_age = payload.a_age_param
prm.a_coa_accum_depre = payload.a_coa_accum_depre_param
prm.a_coa_depre_cost = payload.a_coa_depre_cost_param
prm.a_note = payload.a_note_param
let resp = await api.addData(prm)
// console.log('data nat_group ',resp)
if (resp.status != "OK") {
context.commit("update_a_save_status", 3)
context.commit("update_a_save_error_message", resp.message)
context.commit("update_a_alert_error", true)
} else {
context.commit("update_a_save_status", 2)
context.commit("update_a_save_error_message", resp.message)
let data = {
total: resp.data.total
}
if (data.total !== -1) {
context.commit("update_a_alert_success", true)
var msg = " Add Data Sukses"
context.commit("update_a_msg_success", msg)
context.commit('update_dialog_add_coa', false)
context.dispatch("search", {
current_page: context.state.a_current_page,
search: context.state.a_x_search,
last_id: -1
})
context.commit("faclass/update_dialog_add_coa", false);
context.commit("faclass/update_a_classname", "");
context.commit("faclass/update_a_coa", {});
context.commit("faclass/update_a_deprecorp", "");
context.commit("faclass/update_a_age", 0);
context.commit("faclass/update_a_coa_accum_depre", {});
context.commit("faclass/update_a_coa_depre_cost", {});
context.commit("faclass/update_a_note", "");
} else {
context.commit("update_a_errors_save", [])
}
}
} catch (e) {
context.commit("update_a_save_status", 3)
context.commit("update_a_save_error_message", e.message)
context.commit("update_a_alert_error", true)
}
},
// get_by_id
async get_by_id(context, payload) {
context.commit("update_e_loading_nat_group", true)
try {
let prm = {};
prm.token = one_token()
// fa_class
prm.Fa_ClassID = payload.Fa_ClassID
// coa
prm.Fa_ClassCoaID = payload.Fa_ClassCoaID
// accum depre
prm.Fa_ClassAccumDepreCoaID = payload.Fa_ClassAccumDepreCoaID
prm.Fa_ClassAccumDepreCostCoaID = payload.DepreCostCoaID
let resp = await api.getByID(prm)
// console.log('data nat_group ',resp)
if (resp.status != "OK") {
context.commit("update_e_loading_nat_group", false)
} else {
// console.log('data nat_group ',resp.data)
context.commit("update_e_loading_nat_group", true)
// MapNatGroup_ID
context.commit("update_Fa_ClassID", resp.data.record_fa_class[0].Fa_ClassID)
// coa
context.commit("update_e_coa_list", resp.data.records_coa)
context.commit("update_e_coa", {
coaID: resp.data.records_coa[0].coaID,
coaAccountNo: resp.data.records_coa[0].coaAccountNo,
coaDescription: resp.data.records_coa[0].coaDescription,
coaSubDescription: resp.data.records_coa[0].coaSubDescription,
coaAccountType: resp.data.records_coa[0].coaAccountType,
coaSpecialAccountType: resp.data.records_coa[0].coaSpecialAccountType,
coaIsInput: resp.data.records_coa[0].coaIsInput,
coaReportSchedule: resp.data.records_coa[0].coaReportSchedule,
coaCurrencyCode: resp.data.records_coa[0].coaCurrencyCode,
coaCashFlowCategory: resp.data.records_coa[0].coaCashFlowCategory,
coaCreated: resp.data.records_coa[0].coaCreated,
coaLastUpdated: resp.data.records_coa[0].coaLastUpdated,
coaIsActive: resp.data.records_coa[0].coaIsActive,
coaLevel: resp.data.records_coa[0].coaLevel
})
// accum depre
context.commit("update_e_coa_accum_depre_list", resp.data.records_accum_depre)
context.commit("update_e_coa_accum_depre", {
coaID: resp.data.records_accum_depre[0].coaID,
coaAccountNo: resp.data.records_accum_depre[0].coaAccountNo,
coaDescription: resp.data.records_accum_depre[0].coaDescription,
coaSubDescription: resp.data.records_accum_depre[0].coaSubDescription,
coaAccountType: resp.data.records_accum_depre[0].coaAccountType,
coaSpecialAccountType: resp.data.records_accum_depre[0].coaSpecialAccountType,
coaIsInput: resp.data.records_accum_depre[0].coaIsInput,
coaReportSchedule: resp.data.records_accum_depre[0].coaReportSchedule,
coaCurrencyCode: resp.data.records_accum_depre[0].coaCurrencyCode,
coaCashFlowCategory: resp.data.records_accum_depre[0].coaCashFlowCategory,
coaCreated: resp.data.records_accum_depre[0].coaCreated,
coaLastUpdated: resp.data.records_accum_depre[0].coaLastUpdated,
coaIsActive: resp.data.records_accum_depre[0].coaIsActive,
coaLevel: resp.data.records_accum_depre[0].coaLevel
})
context.commit("update_e_coa_depre_cost_list", resp.data.records_depre_cost)
context.commit("update_e_coa_depre_cost", {
coaID: resp.data.records_depre_cost[0].coaID,
coaAccountNo: resp.data.records_depre_cost[0].coaAccountNo,
coaDescription: resp.data.records_depre_cost[0].coaDescription,
coaSubDescription: resp.data.records_depre_cost[0].coaSubDescription,
coaAccountType: resp.data.records_depre_cost[0].coaAccountType,
coaSpecialAccountType: resp.data.records_depre_cost[0].coaSpecialAccountType,
coaIsInput: resp.data.records_depre_cost[0].coaIsInput,
coaReportSchedule: resp.data.records_depre_cost[0].coaReportSchedule,
coaCurrencyCode: resp.data.records_depre_cost[0].coaCurrencyCode,
coaCashFlowCategory: resp.data.records_depre_cost[0].coaCashFlowCategory,
coaCreated: resp.data.records_depre_cost[0].coaCreated,
coaLastUpdated: resp.data.records_depre_cost[0].coaLastUpdated,
coaIsActive: resp.data.records_depre_cost[0].coaIsActive,
coaLevel: resp.data.records_depre_cost[0].coaLevel
})
// fa classname
context.commit("update_e_classname", resp.data.record_fa_class[0].Fa_ClassName)
// note
context.commit("update_e_note", resp.data.record_fa_class[0].Fa_ClassAccumNote)
// depre corp
context.commit("update_e_deprecorp", resp.data.record_fa_class[0].Fa_ClassDepreCorp)
context.commit("update_e_age", resp.data.record_fa_class[0].Fa_ClassAgeAsset)
context.commit("update_dialog_edit_coa", true)
}
} catch (e) {
context.commit("update_e_loading_nat_group", false)
}
},
// get ac coa from api
async open_edit_coa(context, payload) {
context.commit("update_e_loading_coa", true)
try {
let prm = {};
prm.token = one_token()
prm.search = payload.search
let resp = await api.getAcCoa(prm)
// console.log('data nat_group ',resp)
if (resp.status != "OK") {
context.commit("update_e_loading_coa", false)
} else {
// console.log('data nat_group ',resp.data)
context.commit("update_e_loading_coa", false)
context.commit("update_e_coa_list", resp.data)
}
} catch (e) {
context.commit("update_e_loading_coa", false)
}
},
// get ac coa accum depre from api
async open_edit_coa_accum_depre(context, payload) {
context.commit("update_e_loading_coa_accum_depre", true)
try {
let prm = {};
prm.token = one_token()
prm.search = payload.search
let resp = await api.getAcAccumDepre(prm)
// console.log('data nat_group ',resp)
if (resp.status != "OK") {
context.commit("update_e_loading_coa_accum_depre", false)
} else {
// console.log('data nat_group ',resp.data)
context.commit("update_e_loading_coa_accum_depre", false)
context.commit("update_e_coa_accum_depre_list", resp.data)
}
} catch (e) {
context.commit("update_e_loading_coa_accum_depre", false)
}
},
async open_edit_coa_depre_cost(context, payload) {
context.commit("update_e_loading_coa_depre_cost", true)
try {
let prm = {};
prm.token = one_token()
prm.search = payload.search
let resp = await api.getAcAccumDepre(prm)
// console.log('data nat_group ',resp)
if (resp.status != "OK") {
context.commit("update_e_loading_coa_depre_cost", false)
} else {
// console.log('data nat_group ',resp.data)
context.commit("update_e_loading_coa_depre_cost", false)
context.commit("update_e_coa_depre_cost_list", resp.data)
}
} catch (e) {
context.commit("update_e_loading_coa_depre_cost", false)
}
},
// edit data
async edit_data(context, payload) {
context.commit("update_a_save_status", 1)
try {
let prm = {};
prm.token = one_token()
prm.Fa_ClassID = payload.Fa_ClassID
prm.e_classname = payload.e_classname_param
prm.e_coa = payload.e_coa_param
prm.e_deprecorp = payload.e_deprecorp_param
prm.e_coa_accum_depre = payload.e_coa_accum_depre_param
prm.e_coa_depre_cost = payload.e_coa_depre_cost_param
prm.e_note = payload.e_note_param
prm.e_age = payload.e_age_param
let resp = await api.editData(prm)
// console.log('data nat_group ',resp)
if (resp.status != "OK") {
context.commit("update_a_save_status", 3)
context.commit("update_a_save_error_message", resp.message)
context.commit("update_a_alert_error", true)
} else {
context.commit("update_a_save_status", 2)
context.commit("update_a_save_error_message", resp.message)
let data = {
total: resp.data.total
}
if (data.total !== -1) {
context.commit("update_a_alert_success", true)
var msg = " Edit Data Sukses"
context.commit("update_a_msg_success", msg)
context.commit('update_dialog_edit_coa', false)
context.dispatch("search", {
current_page: context.state.a_current_page,
search: context.state.a_x_search,
last_id: -1
})
} else {
context.commit("update_a_errors_save_coa", [])
}
}
} catch (e) {
context.commit("update_a_save_status", 3)
context.commit("update_a_save_error_message", e.message)
context.commit("update_a_alert_error", true)
}
},
// delete data
async delete_data(context, prm) {
context.commit("update_a_save_status", 1)
try {
prm.token = one_token()
let resp = await api.deleteData(prm)
if (resp.status != "OK") {
context.commit("update_a_save_status", 3)
context.commit("update_a_save_error_message", resp.message)
context.commit("update_a_alert_error", true)
} else {
context.commit("update_a_save_status", 2)
context.commit("update_a_save_error_message", resp.message)
let data = {
total: resp.data.total
}
if (data.total !== -1) {
context.commit("update_a_alert_success", true)
var msg = " Coa " + prm.Fa_ClassName + " berhasil dihapus"
context.commit("update_a_msg_success", msg)
context.dispatch("search", {
current_page: context.state.a_current_page,
search: context.state.a_x_search,
last_id: -1
})
} else {
context.commit("update_a_errors_save_coa", [])
}
}
} catch (e) {
context.commit("update_a_save_status", 3)
context.commit("update_a_save_error_message", e.message)
context.commit("update_a_alert_error", true)
}
},
},
}

View File

@@ -0,0 +1,12 @@
import system from "../../../apps/modules/system/system.js";
import faclass from "./modules/faclass.js";
export const store = new Vuex.Store({
modules: {
system: system,
faclass:faclass,
},
state: {},
mutations: {},
actions: {},
});