feature: po pay downpayment
This commit is contained in:
62
test/vuex/acc-one-map-inventaris-coa/api/api.js
Normal file
62
test/vuex/acc-one-map-inventaris-coa/api/api.js
Normal file
@@ -0,0 +1,62 @@
|
||||
const URL = "/one-api/map/InventarisCoaMapping";
|
||||
|
||||
async function request(endpoint, params) {
|
||||
try {
|
||||
const resp = await axios.post(URL + endpoint, params)
|
||||
if (resp.status !== 200) {
|
||||
throw new Error(resp.statusText);
|
||||
}
|
||||
return resp.data;
|
||||
} catch (error) {
|
||||
return {
|
||||
status: "ERR",
|
||||
message: error.message
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export async function getListCoa(params) {
|
||||
return request("/getListCoa", params);
|
||||
}
|
||||
|
||||
export async function getListingInventarisGol(params) {
|
||||
return request("/getListInventarisGol", params);
|
||||
}
|
||||
|
||||
export async function getListItemInventaris(params) {
|
||||
return request("/getListItemInventaris", params);
|
||||
}
|
||||
|
||||
export async function getListInventorygolMapping(params) {
|
||||
return request("/getListInventorygolMapping", params);
|
||||
}
|
||||
|
||||
export async function getInvCoaMappingDetail(params) {
|
||||
return request("/getInvCoaMappingDetail", params);
|
||||
}
|
||||
|
||||
export async function createInvCoaMapping(params) {
|
||||
return request("/createInvCoaMapping", params);
|
||||
}
|
||||
|
||||
export async function editInvCoaMapping(params) {
|
||||
return request("/editInvCoaMapping", params);
|
||||
}
|
||||
|
||||
export async function deleteInvCoaMapping(params) {
|
||||
return request("/deleteInvCoaMapping", params);
|
||||
}
|
||||
|
||||
|
||||
/* item inventory */
|
||||
export async function createInvItemCoaMapping(params) {
|
||||
return request("/createInvItemCoaMapping", params);
|
||||
}
|
||||
|
||||
export async function editInvItemCoaMapping(params) {
|
||||
return request("/editInvItemCoaMapping", params);
|
||||
}
|
||||
|
||||
export async function deleteInvItemCoaMapping(params) {
|
||||
return request("/deleteInvItemCoaMapping", params);
|
||||
}
|
||||
@@ -0,0 +1,248 @@
|
||||
<template>
|
||||
<v-dialog v-model="dialog_add_mapping_default" persistent width="40vw">
|
||||
<v-card>
|
||||
<v-card-title class="headline grey lighten-2">Add Form</v-card-title>
|
||||
<v-card-text>
|
||||
<v-layout row wrap>
|
||||
<v-flex xs12 pa-1>
|
||||
<v-autocomplete :items="list_gol_inventaris.records" hide-details outline
|
||||
label="Golongan Inventaris" item-text="M_InventarisGolName" item-value="M_InventarisGolID"
|
||||
v-model="form.golID"></v-autocomplete>
|
||||
</v-flex>
|
||||
<v-flex xs12 pa-1>
|
||||
<v-autocomplete :items="invCoa" hide-details outline label="Account Inventaris"
|
||||
v-model="form.invCoaID" item-text="coaDescription" item-value="coaID"
|
||||
:search-input.sync="searchInv" no-filter clearable>
|
||||
<template slot="item" slot-scope="data">
|
||||
<v-list-tile-content>
|
||||
<v-list-tile-title v-html="data.item.coaAccountNo"></v-list-tile-title>
|
||||
<v-list-tile-sub-title v-html="data.item.coaDescription"></v-list-tile-sub-title>
|
||||
</v-list-tile-content>
|
||||
</template>
|
||||
</v-autocomplete>
|
||||
</v-flex>
|
||||
<v-flex xs12 pa-1>
|
||||
<v-autocomplete :items="debtCoa" hide-details outline label="Account Hutang Inventaris"
|
||||
v-model="form.debtCoaID" item-text="coaDescription" item-value="coaID"
|
||||
:search-input.sync="searchDebt" no-filter clearable>
|
||||
<template slot="item" slot-scope="data">
|
||||
<v-list-tile-content>
|
||||
<v-list-tile-title v-html="data.item.coaAccountNo"></v-list-tile-title>
|
||||
<v-list-tile-sub-title v-html="data.item.coaDescription"></v-list-tile-sub-title>
|
||||
</v-list-tile-content>
|
||||
</template>
|
||||
</v-autocomplete>
|
||||
</v-flex>
|
||||
<v-flex xs12 pa-1>
|
||||
<v-autocomplete :items="bebanCoa" hide-details outline item-value="coaID"
|
||||
label="Account Beban Penyusutan Inventaris" item-text="coaDescription"
|
||||
v-model="form.bebanCoaID" :search-input.sync="searchBeban" no-filter clearable>
|
||||
<template slot="item" slot-scope="data">
|
||||
<v-list-tile-content>
|
||||
<v-list-tile-title v-html="data.item.coaAccountNo"></v-list-tile-title>
|
||||
<v-list-tile-sub-title v-html="data.item.coaDescription"></v-list-tile-sub-title>
|
||||
</v-list-tile-content>
|
||||
</template>
|
||||
</v-autocomplete>
|
||||
</v-flex>
|
||||
<v-flex xs12 pa-1>
|
||||
<v-autocomplete :items="accumCoa" hide-details outline item-value="coaID"
|
||||
label="Account Akumulasi Penyusutan Inventaris" item-text="coaDescription"
|
||||
v-model="form.accumCoaID" :search-input.sync="searchAccum" no-filter clearable>
|
||||
<template slot="item" slot-scope="data">
|
||||
<v-list-tile-content>
|
||||
<v-list-tile-title v-html="data.item.coaAccountNo"></v-list-tile-title>
|
||||
<v-list-tile-sub-title v-html="data.item.coaDescription"></v-list-tile-sub-title>
|
||||
</v-list-tile-content>
|
||||
</template>
|
||||
</v-autocomplete>
|
||||
</v-flex>
|
||||
<v-flex xs12 pa-1>
|
||||
<v-autocomplete :items="labaCoa" hide-details outline item-value="coaID"
|
||||
label="Account Laba Pelepasan Inventaris" item-text="coaDescription"
|
||||
v-model="form.labaCoaID" :search-input.sync="searchLaba" no-filter clearable>
|
||||
<template slot="item" slot-scope="data">
|
||||
<v-list-tile-content>
|
||||
<v-list-tile-title v-html="data.item.coaAccountNo"></v-list-tile-title>
|
||||
<v-list-tile-sub-title v-html="data.item.coaDescription"></v-list-tile-sub-title>
|
||||
</v-list-tile-content>
|
||||
</template>
|
||||
</v-autocomplete>
|
||||
</v-flex>
|
||||
<v-flex xs12 pa-1>
|
||||
<v-autocomplete :items="rugiCoa" hide-details outline item-value="coaID"
|
||||
label="Account Rugi Pelepasan Inventaris" item-text="coaDescription"
|
||||
v-model="form.rugiCoaID" :search-input.sync="searchRugi" no-filter clearable>
|
||||
<template slot="item" slot-scope="data">
|
||||
<v-list-tile-content>
|
||||
<v-list-tile-title v-html="data.item.coaAccountNo"></v-list-tile-title>
|
||||
<v-list-tile-sub-title v-html="data.item.coaDescription"></v-list-tile-sub-title>
|
||||
</v-list-tile-content>
|
||||
</template>
|
||||
</v-autocomplete>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn @click="batalForm()" color="error" class="white--text">Batal</v-btn>
|
||||
<v-btn @click="simpanForm()" color="primary" class="white--text">Simpan</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
data() {
|
||||
return {
|
||||
searchInv: null,
|
||||
searchDebt: null,
|
||||
searchBeban: null,
|
||||
searchAccum: null,
|
||||
searchLaba: null,
|
||||
searchRugi: null,
|
||||
debounceTimeout: null
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
dialog_add_mapping_default: {
|
||||
get() {
|
||||
return this.$store.state.invMap.dialog_add_mapping_default;
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("invMap/update_dialog_add_mapping_default", val);
|
||||
}
|
||||
},
|
||||
form: {
|
||||
get() {
|
||||
return this.$store.state.invMap.form_gol;
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("invMap/update_form_gol", val);
|
||||
}
|
||||
},
|
||||
list_gol_inventaris: {
|
||||
get() {
|
||||
return this.$store.state.invMap.list_gol_inventaris;
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("invMap/update_list_gol_inventaris", val);
|
||||
}
|
||||
},
|
||||
loading_process() {
|
||||
return this.$store.state.datacoa.loading_process;
|
||||
},
|
||||
invCoa() {
|
||||
return this.$store.state.datacoa.invCoa;
|
||||
},
|
||||
debtCoa() {
|
||||
return this.$store.state.datacoa.debtCoa;
|
||||
},
|
||||
bebanCoa() {
|
||||
return this.$store.state.datacoa.bebanCoa;
|
||||
},
|
||||
accumCoa() {
|
||||
return this.$store.state.datacoa.accumCoa;
|
||||
},
|
||||
labaCoa() {
|
||||
return this.$store.state.datacoa.labaCoa;
|
||||
},
|
||||
rugiCoa() {
|
||||
return this.$store.state.datacoa.rugiCoa;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
fetchCoa(keyword, key) {
|
||||
this.$store.dispatch("datacoa/getListCoa", { keyword: keyword, key: key });
|
||||
},
|
||||
batalForm() {
|
||||
this.form = {
|
||||
golID: 0,
|
||||
invCoaID: 0,
|
||||
debtCoaID: 0,
|
||||
bebanCoaID: 0,
|
||||
accumCoaID: 0,
|
||||
labaCoaID: 0,
|
||||
rugiCoaID: 0
|
||||
}
|
||||
this.dialog_add_mapping_default = false;
|
||||
},
|
||||
simpanForm() {
|
||||
if (!this.loading_process) {
|
||||
const form = this.form;
|
||||
const param = {
|
||||
M_InventarisGolID: form.golID,
|
||||
CoaInventarisID: form.invCoaID,
|
||||
CoaHutangID: form.debtCoaID,
|
||||
CoaPembelianID: form.invCoaID,
|
||||
CoaBebanPenyusutanID: form.bebanCoaID,
|
||||
CoaAkumulasiPenyusutanID: form.accumCoaID,
|
||||
CoaLabaPelepasanID: form.labaCoaID,
|
||||
CoaRugiPelepasanID: form.rugiCoa
|
||||
}
|
||||
|
||||
if (form.M_InventarisCoaMappingID) {
|
||||
param.M_InventarisCoaMappingID = form.M_InventarisCoaMappingID;
|
||||
this.$store.dispatch("invMap/editInventarisGolMapping", param);
|
||||
} else {
|
||||
this.$store.dispatch("invMap/createInventarisGolMapping", param);
|
||||
}
|
||||
} else {
|
||||
const snac = { state: true, msg: "terdapat ongoing proses", color: "warning" };
|
||||
this.$store.commit('update_snackbar', snac);
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
searchInv(val) {
|
||||
if (!val) return;
|
||||
|
||||
clearTimeout(this.debounceTimeout);
|
||||
this.debounceTimeout = setTimeout(() => {
|
||||
this.fetchCoa(val, 'invCoa');
|
||||
}, 500)
|
||||
},
|
||||
searchDebt(val) {
|
||||
if (!val) return;
|
||||
|
||||
clearTimeout(this.debounceTimeout);
|
||||
this.debounceTimeout = setTimeout(() => {
|
||||
this.fetchCoa(val, 'debtCoa');
|
||||
}, 500)
|
||||
},
|
||||
searchBeban(val) {
|
||||
if (!val) return;
|
||||
|
||||
clearTimeout(this.debounceTimeout);
|
||||
this.debounceTimeout = setTimeout(() => {
|
||||
this.fetchCoa(val, 'bebanCoa');
|
||||
}, 500)
|
||||
},
|
||||
searchAccum(val) {
|
||||
if (!val) return;
|
||||
|
||||
clearTimeout(this.debounceTimeout);
|
||||
this.debounceTimeout = setTimeout(() => {
|
||||
this.fetchCoa(val, 'accumCoa');
|
||||
}, 500)
|
||||
},
|
||||
searchLaba(val) {
|
||||
if (!val) return;
|
||||
|
||||
clearTimeout(this.debounceTimeout);
|
||||
this.debounceTimeout = setTimeout(() => {
|
||||
this.fetchCoa(val, 'labaCoa');
|
||||
}, 500)
|
||||
},
|
||||
searchRugi(val) {
|
||||
if (!val) return;
|
||||
|
||||
clearTimeout(this.debounceTimeout);
|
||||
this.debounceTimeout = setTimeout(() => {
|
||||
this.fetchCoa(val, 'rugiCoa');
|
||||
}, 500)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,251 @@
|
||||
<template>
|
||||
<v-dialog v-model="dialog_add_mapping_item" persistent width="40vw">
|
||||
<v-card>
|
||||
<v-card-title class="headline grey lighten-2">
|
||||
{{ selected_inventaris_item.itemCoaMapID > 0
|
||||
? "Edit Account Item"
|
||||
: "Add Account Item"
|
||||
}} {{ selected_inventaris_item.M_ItemDesc }}
|
||||
</v-card-title>
|
||||
<v-card-text>
|
||||
<v-layout row wrap>
|
||||
<v-flex xs12 pa-1>
|
||||
<v-autocomplete :items="invCoa" hide-details outline label="Account Inventaris"
|
||||
v-model="form.invCoaID" item-text="coaDescription" item-value="coaID"
|
||||
:search-input.sync="searchInv" no-filter clearable>
|
||||
<template slot="item" slot-scope="data">
|
||||
<v-list-tile-content>
|
||||
<v-list-tile-title v-html="data.item.coaAccountNo"></v-list-tile-title>
|
||||
<v-list-tile-sub-title v-html="data.item.coaDescription"></v-list-tile-sub-title>
|
||||
</v-list-tile-content>
|
||||
</template>
|
||||
</v-autocomplete>
|
||||
</v-flex>
|
||||
<v-flex xs12 pa-1>
|
||||
<v-autocomplete :items="debtCoa" hide-details outline label="Account Hutang Inventaris"
|
||||
v-model="form.debtCoaID" item-text="coaDescription" item-value="coaID"
|
||||
:search-input.sync="searchDebt" no-filter clearable>
|
||||
<template slot="item" slot-scope="data">
|
||||
<v-list-tile-content>
|
||||
<v-list-tile-title v-html="data.item.coaAccountNo"></v-list-tile-title>
|
||||
<v-list-tile-sub-title v-html="data.item.coaDescription"></v-list-tile-sub-title>
|
||||
</v-list-tile-content>
|
||||
</template>
|
||||
</v-autocomplete>
|
||||
</v-flex>
|
||||
<v-flex xs12 pa-1>
|
||||
<v-autocomplete :items="bebanCoa" hide-details outline item-value="coaID"
|
||||
label="Account Beban Penyusutan Inventaris" item-text="coaDescription"
|
||||
v-model="form.bebanCoaID" :search-input.sync="searchBeban" no-filter clearable>
|
||||
<template slot="item" slot-scope="data">
|
||||
<v-list-tile-content>
|
||||
<v-list-tile-title v-html="data.item.coaAccountNo"></v-list-tile-title>
|
||||
<v-list-tile-sub-title v-html="data.item.coaDescription"></v-list-tile-sub-title>
|
||||
</v-list-tile-content>
|
||||
</template>
|
||||
</v-autocomplete>
|
||||
</v-flex>
|
||||
<v-flex xs12 pa-1>
|
||||
<v-autocomplete :items="accumCoa" hide-details outline item-value="coaID"
|
||||
label="Account Akumulasi Penyusutan Inventaris" item-text="coaDescription"
|
||||
v-model="form.accumCoaID" :search-input.sync="searchAccum" no-filter clearable>
|
||||
<template slot="item" slot-scope="data">
|
||||
<v-list-tile-content>
|
||||
<v-list-tile-title v-html="data.item.coaAccountNo"></v-list-tile-title>
|
||||
<v-list-tile-sub-title v-html="data.item.coaDescription"></v-list-tile-sub-title>
|
||||
</v-list-tile-content>
|
||||
</template>
|
||||
</v-autocomplete>
|
||||
</v-flex>
|
||||
<v-flex xs12 pa-1>
|
||||
<v-autocomplete :items="labaCoa" hide-details outline item-value="coaID"
|
||||
label="Account Laba Pelepasan Inventaris" item-text="coaDescription"
|
||||
v-model="form.labaCoaID" :search-input.sync="searchLaba" no-filter clearable>
|
||||
<template slot="item" slot-scope="data">
|
||||
<v-list-tile-content>
|
||||
<v-list-tile-title v-html="data.item.coaAccountNo"></v-list-tile-title>
|
||||
<v-list-tile-sub-title v-html="data.item.coaDescription"></v-list-tile-sub-title>
|
||||
</v-list-tile-content>
|
||||
</template>
|
||||
</v-autocomplete>
|
||||
</v-flex>
|
||||
<v-flex xs12 pa-1>
|
||||
<v-autocomplete :items="rugiCoa" hide-details outline item-value="coaID"
|
||||
label="Account Rugi Pelepasan Inventaris" item-text="coaDescription"
|
||||
v-model="form.rugiCoaID" :search-input.sync="searchRugi" no-filter clearable>
|
||||
<template slot="item" slot-scope="data">
|
||||
<v-list-tile-content>
|
||||
<v-list-tile-title v-html="data.item.coaAccountNo"></v-list-tile-title>
|
||||
<v-list-tile-sub-title v-html="data.item.coaDescription"></v-list-tile-sub-title>
|
||||
</v-list-tile-content>
|
||||
</template>
|
||||
</v-autocomplete>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn @click="batalForm()" color="error" class="white--text">Batal</v-btn>
|
||||
<v-btn @click="simpanForm()" color="primary" class="white--text">Simpan</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
data() {
|
||||
return {
|
||||
searchInv: null,
|
||||
searchDebt: null,
|
||||
searchBeban: null,
|
||||
searchAccum: null,
|
||||
searchLaba: null,
|
||||
searchRugi: null,
|
||||
debounceTimeout: null
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
dialog_add_mapping_item: {
|
||||
get() {
|
||||
return this.$store.state.invItemMap.dialog_add_mapping_item;
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("invItemMap/update_dialog_add_mapping_item", val);
|
||||
}
|
||||
},
|
||||
list_gol_inventaris: {
|
||||
get() {
|
||||
return this.$store.state.invMap.list_gol_inventaris;
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("invMap/update_list_gol_inventaris", val);
|
||||
}
|
||||
},
|
||||
form: {
|
||||
get() {
|
||||
return this.$store.state.invItemMap.form;
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("invItemMap/update_form", val);
|
||||
}
|
||||
},
|
||||
selected_inventaris_item() {
|
||||
return this.$store.state.invItemMap.selected_inventaris_item;
|
||||
},
|
||||
loading_process() {
|
||||
return this.$store.state.datacoa.loading_process;
|
||||
},
|
||||
invCoa() {
|
||||
return this.$store.state.datacoa.invCoa;
|
||||
},
|
||||
debtCoa() {
|
||||
return this.$store.state.datacoa.debtCoa;
|
||||
},
|
||||
bebanCoa() {
|
||||
return this.$store.state.datacoa.bebanCoa;
|
||||
},
|
||||
accumCoa() {
|
||||
return this.$store.state.datacoa.accumCoa;
|
||||
},
|
||||
labaCoa() {
|
||||
return this.$store.state.datacoa.labaCoa;
|
||||
},
|
||||
rugiCoa() {
|
||||
return this.$store.state.datacoa.rugiCoa;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
fetchCoa(keyword, key) {
|
||||
this.$store.dispatch("datacoa/getListCoa", { keyword: keyword, key: key });
|
||||
},
|
||||
batalForm() {
|
||||
this.form = {
|
||||
invCoaID: 0,
|
||||
debtCoaID: 0,
|
||||
bebanCoaID: 0,
|
||||
accumCoaID: 0,
|
||||
labaCoaID: 0,
|
||||
rugiCoaID: 0
|
||||
}
|
||||
this.dialog_add_mapping_item = false;
|
||||
},
|
||||
simpanForm() {
|
||||
if (!this.loading_process) {
|
||||
const form = this.form;
|
||||
const selected = this.selected_inventaris_item
|
||||
const param = {
|
||||
M_ItemID: selected.M_ItemID,
|
||||
M_InventarisItemCoaMappingID: selected.itemCoaMapID,
|
||||
CoaInventarisID: form.invCoaID,
|
||||
CoaHutangID: form.debtCoaID,
|
||||
CoaPembelianID: form.invCoaID,
|
||||
CoaBebanPenyusutanID: form.bebanCoaID,
|
||||
CoaAkumulasiPenyusutanID: form.accumCoaID,
|
||||
CoaLabaPelepasanID: form.labaCoaID,
|
||||
CoaRugiPelepasanID: form.rugiCoaID
|
||||
}
|
||||
|
||||
if (selected.itemCoaMapID > 0) {
|
||||
this.$store.dispatch("invItemMap/editInvItemCoaMapping", param);
|
||||
} else {
|
||||
this.$store.dispatch("invItemMap/createInvItemCoaMapping", param);
|
||||
}
|
||||
} else {
|
||||
const snac = { state: true, msg: "terdapat ongoing proses", color: "warning" };
|
||||
this.$store.commit('update_snackbar', snac);
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
searchInv(val) {
|
||||
if (!val) return;
|
||||
|
||||
clearTimeout(this.debounceTimeout);
|
||||
this.debounceTimeout = setTimeout(() => {
|
||||
this.fetchCoa(val, 'invCoa');
|
||||
}, 500)
|
||||
},
|
||||
searchDebt(val) {
|
||||
if (!val) return;
|
||||
|
||||
clearTimeout(this.debounceTimeout);
|
||||
this.debounceTimeout = setTimeout(() => {
|
||||
this.fetchCoa(val, 'debtCoa');
|
||||
}, 500)
|
||||
},
|
||||
searchBeban(val) {
|
||||
if (!val) return;
|
||||
|
||||
clearTimeout(this.debounceTimeout);
|
||||
this.debounceTimeout = setTimeout(() => {
|
||||
this.fetchCoa(val, 'bebanCoa');
|
||||
}, 500)
|
||||
},
|
||||
searchAccum(val) {
|
||||
if (!val) return;
|
||||
|
||||
clearTimeout(this.debounceTimeout);
|
||||
this.debounceTimeout = setTimeout(() => {
|
||||
this.fetchCoa(val, 'accumCoa');
|
||||
}, 500)
|
||||
},
|
||||
searchLaba(val) {
|
||||
if (!val) return;
|
||||
|
||||
clearTimeout(this.debounceTimeout);
|
||||
this.debounceTimeout = setTimeout(() => {
|
||||
this.fetchCoa(val, 'labaCoa');
|
||||
}, 500)
|
||||
},
|
||||
searchRugi(val) {
|
||||
if (!val) return;
|
||||
|
||||
clearTimeout(this.debounceTimeout);
|
||||
this.debounceTimeout = setTimeout(() => {
|
||||
this.fetchCoa(val, 'rugiCoa');
|
||||
}, 500)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,41 @@
|
||||
<template>
|
||||
<v-dialog v-model="dialog_add_mapping" persistent width="50vw">
|
||||
<v-card>
|
||||
<v-card-title class="headline grey lighten-2">Add Form</v-card-title>
|
||||
<v-card-text>
|
||||
<v-layout></v-layout>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn @click="batalForm()" color="error" class="white--text">Batal</v-btn>
|
||||
<v-btn @click="simpanForm()" color="primary" class="white--text">Simpan</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
data() {
|
||||
return {}
|
||||
},
|
||||
computed: {
|
||||
dialog_add_mapping: {
|
||||
get() {
|
||||
return this.$store.state.invMap.dialog_add_mapping;
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("invMap/update_dialog_add_mapping", val);
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
batalForm() {
|
||||
|
||||
},
|
||||
simpanForm() {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,72 @@
|
||||
<template>
|
||||
<v-dialog v-model="dialog_confirm_item" persistent width="40vw">
|
||||
<v-card>
|
||||
<v-card-title class="headline grey lighten-2">Konfirmasi Hapus</v-card-title>
|
||||
<v-card-text>
|
||||
<v-layout row wrap>
|
||||
<v-flex xs12>
|
||||
<p>
|
||||
Apakah anda yakin akan menghapus data mapping item coa inventaris golongan
|
||||
: <strong>{{ selected_inventaris_item.M_ItemDesc }}</strong> ?
|
||||
</p>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn @click="batal()" color="error" class="white--text">Batal</v-btn>
|
||||
<v-btn @click="konfirmasi()" color="primary" class="white--text">Konfirmasi</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
data() {
|
||||
return {}
|
||||
},
|
||||
computed: {
|
||||
dialog_confirm_item: {
|
||||
get() {
|
||||
return this.$store.state.invItemMap.dialog_confirm_item;
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("invItemMap/update_dialog_confirm_item", val);
|
||||
}
|
||||
},
|
||||
selected_inventaris_item: {
|
||||
get() {
|
||||
return this.$store.state.invItemMap.selected_inventaris_item;
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("invItemMap/update_selected_inventaris_item", val);
|
||||
}
|
||||
},
|
||||
loading_process() {
|
||||
return this.$store.state.invMap.loading_process;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
checkEmpty(obj) {
|
||||
return obj && Object.keys(obj).length === 0 && obj.constructor === Object;
|
||||
},
|
||||
batal() {
|
||||
this.selected_inventaris_item = {};
|
||||
this.dialog_confirm_item = false;
|
||||
},
|
||||
konfirmasi() {
|
||||
if (!this.loading_process) {
|
||||
const itm = this.selected_inventaris_item;
|
||||
|
||||
this.$store.dispatch("invItemMap/deleteInvItemCoaMapping", {
|
||||
M_InventarisItemCoaMappingID: itm.itemCoaMapID
|
||||
})
|
||||
} else {
|
||||
const snac = { state: true, msg: "terdapat proses masih berjalan", color: "warning" };
|
||||
this.$store.commit('invMap/update_snackbar', snac);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,69 @@
|
||||
<template>
|
||||
<v-dialog v-model="dialog_confirm" persistent width="40vw">
|
||||
<v-card>
|
||||
<v-card-title class="headline grey lighten-2">Konfirmasi Hapus</v-card-title>
|
||||
<v-card-text>
|
||||
<v-layout row wrap>
|
||||
<v-flex xs12>
|
||||
<p>
|
||||
Apakah anda yakin akan menghapus data mapping coa inventaris golongan
|
||||
: <strong>{{ selected_inventaris_gol.M_InventarisGolName }}</strong> ?
|
||||
</p>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn @click="batal()" color="error" class="white--text">Batal</v-btn>
|
||||
<v-btn @click="konfirmasi()" color="primary" class="white--text">Konfirmasi</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
data() {
|
||||
return {}
|
||||
},
|
||||
computed: {
|
||||
dialog_confirm: {
|
||||
get() {
|
||||
return this.$store.state.invMap.dialog_confirm;
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("invMap/update_dialog_confirm", val);
|
||||
}
|
||||
},
|
||||
selected_inventaris_gol: {
|
||||
get() {
|
||||
return this.$store.state.invMap.selected_inventaris_gol;
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("invMap/update_selected_inventaris_gol", val);
|
||||
}
|
||||
},
|
||||
loading_process() {
|
||||
return this.$store.state.invMap.loading_process;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
checkEmpty(obj) {
|
||||
return obj && Object.keys(obj).length === 0 && obj.constructor === Object;
|
||||
},
|
||||
batal() {
|
||||
this.selected_inventaris_gol = {};
|
||||
this.dialog_confirm = false;
|
||||
},
|
||||
konfirmasi() {
|
||||
if (!this.loading_process) {
|
||||
const inv = this.selected_inventaris_gol;
|
||||
this.$store.dispatch("invMap/deleteInventarisGolMapping", inv.M_InventarisCoaMappingID);
|
||||
} else {
|
||||
const snac = { state: true, msg: "terdapat proses masih berjalan", color: "warning" };
|
||||
this.$store.commit('invMap/update_snackbar', snac);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
192
test/vuex/acc-one-map-inventaris-coa/components/left-layout.vue
Normal file
192
test/vuex/acc-one-map-inventaris-coa/components/left-layout.vue
Normal file
@@ -0,0 +1,192 @@
|
||||
<template>
|
||||
<div>
|
||||
<v-toolbar color="primary" dark>
|
||||
<v-toolbar-title class="white--text">Inventaris Category</v-toolbar-title>
|
||||
<v-spacer></v-spacer>
|
||||
<v-btn icon @click="openDialogAdd()">
|
||||
<v-icon large>add_box</v-icon>
|
||||
</v-btn>
|
||||
</v-toolbar>
|
||||
<v-card class="pa-2">
|
||||
<v-layout row wrap>
|
||||
<v-flex xs4 pa-1>
|
||||
<v-text-field v-model="keyword" hide-details outline
|
||||
label="Cari" placeholder="Cari"></v-text-field>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card>
|
||||
|
||||
<v-card class="pa-2 mt-2">
|
||||
<v-data-table :headers="headers" :items="list_inventarisMapping.records" hide-actions class="elevation-1">
|
||||
<template v-slot:items="props">
|
||||
<tr @click="selected(props.item)" :class="{ 'amber lighten-4': isSelected(props.item) }">
|
||||
<td class="text-xs-center pa-2">
|
||||
{{ props.index + 1 }}
|
||||
</td>
|
||||
<td class="text-xs-left pa-2">
|
||||
{{ props.item.M_InventarisGolName }}
|
||||
</td>
|
||||
<td class="text-xs-center pa-2">
|
||||
<v-tooltip bottom>
|
||||
<template v-slot:activator="{ on }">
|
||||
<v-btn color="info" dark v-on="on" @click="openDialogEdit(props.item)"
|
||||
small style="min-width: 40px; margin: 0;">
|
||||
<v-icon small>edit</v-icon>
|
||||
</v-btn>
|
||||
</template>
|
||||
<span>Edit</span>
|
||||
</v-tooltip>
|
||||
<v-tooltip bottom>
|
||||
<template v-slot:activator="{ on }">
|
||||
<v-btn color="error" dark v-on="on" @click="openDialogDelete(props.item)"
|
||||
small style="min-width: 40px; margin: 0;">
|
||||
<v-icon small>delete</v-icon>
|
||||
</v-btn>
|
||||
</template>
|
||||
<span>Delete</span>
|
||||
</v-tooltip>
|
||||
</td>
|
||||
</tr>
|
||||
</template>
|
||||
</v-data-table>
|
||||
</v-card>
|
||||
|
||||
<v-snackbar v-model="snackbar.state" multi-line top :timeout="3000" :color="snackbar.color">
|
||||
{{ snackbar.msg }}
|
||||
<v-btn class="ml-2" round flat @click="snackbar.state = false">Tutup</v-btn>
|
||||
</v-snackbar>
|
||||
|
||||
<dialog-add-form></dialog-add-form>
|
||||
<dialog-add-form-item></dialog-add-form-item>
|
||||
<dialog-confirm></dialog-confirm>
|
||||
<dialog-confirm-item></dialog-confirm-item>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
components: {
|
||||
'dialog-add-form': httpVueLoader('./dialog-add-mapping-def.vue'),
|
||||
'dialog-add-form-item': httpVueLoader('./dialog-add-mapping-item.vue'),
|
||||
'dialog-confirm': httpVueLoader('./dialog-confirm.vue'),
|
||||
'dialog-confirm-item': httpVueLoader('./dialog-confirm-item.vue'),
|
||||
},
|
||||
mounted() {
|
||||
this.$store.dispatch("invMap/getListingInventarisGol");
|
||||
this.$store.dispatch("invMap/getListInventorygolMapping", "");
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
keyword: "",
|
||||
headers: [
|
||||
{
|
||||
text: "NO", align: "center", sortable: false, value: "nomor",
|
||||
width: "10%", class: "pa-1 blue lighten-3 white--text",
|
||||
},
|
||||
{
|
||||
text: "GOLONGAN INVENTARIS", align: "center", sortable: false, value: "nomor",
|
||||
width: "60%", class: "pa-1 blue lighten-3 white--text",
|
||||
},
|
||||
{
|
||||
text: "AKSI", align: "center", sortable: false, value: "nomor",
|
||||
width: "30%", class: "pa-1 blue lighten-3 white--text",
|
||||
},
|
||||
]
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
snackbar: {
|
||||
get() {
|
||||
return this.$store.state.invMap.snackbar;
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("invMap/update_snackbar", val);
|
||||
}
|
||||
},
|
||||
selected_inventaris_gol: {
|
||||
get() {
|
||||
return this.$store.state.invMap.selected_inventaris_gol;
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("invMap/update_selected_inventaris_gol", val);
|
||||
}
|
||||
},
|
||||
list_inventarisMapping: {
|
||||
get() {
|
||||
return this.$store.state.invMap.list_inventarisMapping;
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("invMap/update_list_inventarisMapping;", val);
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
cariGolMapInventaris(keyword) {
|
||||
setTimeout(() => {
|
||||
this.$store.dispatch("invMap/getListInventorygolMapping", keyword);
|
||||
}, 500);
|
||||
},
|
||||
openDialogAdd() {
|
||||
this.hidrateCoaAutocomplete({});
|
||||
this.$store.commit("invMap/update_dialog_add_mapping_default", true);
|
||||
},
|
||||
selected(item) {
|
||||
this.$store.dispatch("invMap/getListItemInventaris", item.M_InventarisGolID);
|
||||
this.selected_inventaris_gol = item;
|
||||
},
|
||||
isSelected(item) {
|
||||
return item.M_InventarisGolID == this.selected_inventaris_gol.M_InventarisGolID
|
||||
},
|
||||
openDialogEdit(item) {
|
||||
this.hidrateCoaAutocomplete(item);
|
||||
this.selected_inventaris_gol = item;
|
||||
|
||||
const form = {
|
||||
golID: item.M_InventarisGolID,
|
||||
invCoaID: item.M_InventarisCoaMappingCoaInventarisID,
|
||||
debtCoaID: item.M_InventarisCoaMappingCoaHutangID,
|
||||
bebanCoaID: item.M_InventarisCoaMappingCoaBebanPenyusutanID,
|
||||
accumCoaID: item.M_InventarisCoaMappingCoaAkumulasiPenyusutanID,
|
||||
labaCoaID: item.M_InventarisCoaMappingCoaLabaPelepasanID,
|
||||
rugiCoaID: item.M_InventarisCoaMappingCoaRugiPelepasanID,
|
||||
M_InventarisCoaMappingID: item.M_InventarisCoaMappingID
|
||||
}
|
||||
|
||||
this.$store.commit("invMap/update_form_gol", form);
|
||||
this.$store.commit("invMap/update_dialog_add_mapping_default", true);
|
||||
},
|
||||
openDialogDelete(item) {
|
||||
this.selected_inventaris_gol = item;
|
||||
this.$store.commit("invMap/update_dialog_confirm", true);
|
||||
},
|
||||
hidrateCoaAutocomplete(item) {
|
||||
this.$store.dispatch("datacoa/getListCoa", {
|
||||
keyword: item.CoaInventarisAccountNo ?? "", key: "invCoa"
|
||||
});
|
||||
this.$store.dispatch("datacoa/getListCoa", {
|
||||
keyword: item.CoaHutangAccountNo ?? "", key: "debtCoa"
|
||||
});
|
||||
this.$store.dispatch("datacoa/getListCoa", {
|
||||
keyword: item.CoaBebanPenyusutanAccountNo ?? "", key: "bebanCoa"
|
||||
});
|
||||
this.$store.dispatch("datacoa/getListCoa", {
|
||||
keyword: item.CoaAkumulasiPenyusutanAccountNo ?? "", key: "accumCoa"
|
||||
});
|
||||
this.$store.dispatch("datacoa/getListCoa", {
|
||||
keyword: item.CoaLabaPelepasanAccountNo ?? "", key: "labaCoa"
|
||||
});
|
||||
this.$store.dispatch("datacoa/getListCoa", {
|
||||
keyword: item.CoaRugiPelepasanAccountNo ?? "", key: "rugiCoa"
|
||||
});
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
keyword(newval, oldval) {
|
||||
if (newval == oldval) return;
|
||||
if (!newval) return;
|
||||
if (newval.lenght < 1) return;
|
||||
this.cariGolMapInventaris(newval);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
227
test/vuex/acc-one-map-inventaris-coa/components/right-layout.vue
Normal file
227
test/vuex/acc-one-map-inventaris-coa/components/right-layout.vue
Normal file
@@ -0,0 +1,227 @@
|
||||
<template>
|
||||
<div class="right-layout-container">
|
||||
<v-toolbar color="primary" dark>
|
||||
<v-toolbar-title class="white--text">Inventaris Item</v-toolbar-title>
|
||||
<v-spacer></v-spacer>
|
||||
</v-toolbar>
|
||||
|
||||
<v-card class="pa-2">
|
||||
<v-layout row wrap>
|
||||
<v-flex xs12 pa-1>
|
||||
<h2>Setting Default Akun Inventaris</h2>
|
||||
</v-flex>
|
||||
<v-flex xs4 pa-1>
|
||||
<strong>Akun Inventaris: </strong> <br>
|
||||
{{ selected_inventaris_gol.CoaInventarisAccountNo }} <br>
|
||||
{{ selected_inventaris_gol.CoaInventarisDescription }} <br>
|
||||
</v-flex>
|
||||
<v-flex xs4 pa-1>
|
||||
<strong>Akun Inventaris Hutang: </strong> <br>
|
||||
{{ selected_inventaris_gol.CoaHutangAccountNo }} <br>
|
||||
{{ selected_inventaris_gol.CoaHutangDescription }} <br>
|
||||
</v-flex>
|
||||
<v-flex xs4 pa-1>
|
||||
<strong>Akun Inventaris Beban Depresiasi: </strong> <br>
|
||||
{{ selected_inventaris_gol.CoaBebanPenyusutanAccountNo }} <br>
|
||||
{{ selected_inventaris_gol.CoaBebanPenyusutanDescription }} <br>
|
||||
</v-flex>
|
||||
<v-flex xs4 pa-1>
|
||||
<strong>Akun Inventaris Akumulasi Depresiasi: </strong> <br>
|
||||
{{ selected_inventaris_gol.CoaAkumulasiPenyusutanAccountNo }} <br>
|
||||
{{ selected_inventaris_gol.CoaAkumulasiPenyusutanDescription }} <br>
|
||||
</v-flex>
|
||||
<v-flex xs4 pa-1>
|
||||
<strong>Akun Inventaris Laba Pelepasan: </strong> <br>
|
||||
{{ selected_inventaris_gol.CoaLabaPelepasanAccountNo }} <br>
|
||||
{{ selected_inventaris_gol.CoaLabaPelepasanDescription }} <br>
|
||||
</v-flex>
|
||||
<v-flex xs4 pa-1>
|
||||
<strong>Akun Inventaris Rugi Pelepasan: </strong> <br>
|
||||
{{ selected_inventaris_gol.CoaRugiPelepasanAccountNo }} <br>
|
||||
{{ selected_inventaris_gol.CoaRugiPelepasanDescription }} <br>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</v-card>
|
||||
|
||||
<v-card class="pa-2 table-card mt-2">
|
||||
<v-layout row wrap>
|
||||
<v-flex xs3 pa-1>
|
||||
<v-text-field hide-details outline label="Cari" placeholder="Cari"></v-text-field>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
<div class="table-scroll-wrapper">
|
||||
<v-data-table :headers="headers" :items="list_item_inventaris.records" :pagination.sync="pagination"
|
||||
:rows-per-page-items="[5, 10, 25]" class="elevation-1">
|
||||
<template v-slot:items="props">
|
||||
<tr>
|
||||
<td class="text-xs-center pa-1">
|
||||
{{ props.index + 1 }}
|
||||
</td>
|
||||
<td class="text-xs-left pa-1">
|
||||
{{ props.item.M_ItemDesc }}
|
||||
</td>
|
||||
<td class="text-xs-left pa-1">
|
||||
<v-layout row wrap>
|
||||
<v-flex xs4 pa-1>
|
||||
<strong>Akun Inventaris: </strong> <br>
|
||||
{{ props.item.CoaInventarisAccountNo }} <br>
|
||||
{{ props.item.CoaInventarisDescription }} <br>
|
||||
</v-flex>
|
||||
<v-flex xs4 pa-1>
|
||||
<strong>Akun Inventaris Hutang: </strong> <br>
|
||||
{{ props.item.CoaHutangAccountNo }} <br>
|
||||
{{ props.item.CoaHutangDescription }} <br>
|
||||
</v-flex>
|
||||
<v-flex xs4 pa-1>
|
||||
<strong>Akun Inventaris Beban Depresiasi: </strong> <br>
|
||||
{{ props.item.CoaBebanPenyusutanAccountNo }} <br>
|
||||
{{ props.item.CoaBebanPenyusutanDescription }} <br>
|
||||
</v-flex>
|
||||
<v-flex xs4 pa-1>
|
||||
<strong>Akun Inventaris Akumulasi Depresiasi: </strong> <br>
|
||||
{{ props.item.CoaAkumulasiPenyusutanAccountNo }} <br>
|
||||
{{ props.item.CoaAkumulasiPenyusutanDescription }} <br>
|
||||
</v-flex>
|
||||
<v-flex xs4 pa-1>
|
||||
<strong>Akun Inventaris Laba Pelepasan: </strong> <br>
|
||||
{{ props.item.CoaLabaPelepasanAccountNo }} <br>
|
||||
{{ props.item.CoaLabaPelepasanDescription }} <br>
|
||||
</v-flex>
|
||||
<v-flex xs4 pa-1>
|
||||
<strong>Akun Inventaris Rugi Pelepasan: </strong> <br>
|
||||
{{ props.item.CoaRugiPelepasanAccountNo }} <br>
|
||||
{{ props.item.CoaRugiPelepasanDescription }} <br>
|
||||
</v-flex>
|
||||
</v-layout>
|
||||
</td>
|
||||
<td class="text-xs-center pa-1">
|
||||
<v-tooltip bottom>
|
||||
<template v-slot:activator="{ on }">
|
||||
<v-btn color="info" dark v-on="on"
|
||||
@click="editAcc(props.item)" small
|
||||
style="min-width: 40px; margin: 0;"
|
||||
>
|
||||
<v-icon small>edit</v-icon>
|
||||
</v-btn>
|
||||
</template>
|
||||
<span>Edit</span>
|
||||
</v-tooltip>
|
||||
<v-tooltip bottom>
|
||||
<template v-slot:activator="{ on }">
|
||||
<v-btn color="error" dark v-on="on"
|
||||
@click="deleteAcc(props.item)" small
|
||||
style="min-width: 40px; margin: 0;"
|
||||
>
|
||||
<v-icon small>delete</v-icon>
|
||||
</v-btn>
|
||||
</template>
|
||||
<span>Delete</span>
|
||||
</v-tooltip>
|
||||
</td>
|
||||
</tr>
|
||||
</template>
|
||||
</v-data-table>
|
||||
</div>
|
||||
</v-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.right-layout-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.table-card {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
components: {
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
pagination: {},
|
||||
headers: [
|
||||
{
|
||||
text: "NO", align: "center", sortable: false, value: "nomor",
|
||||
width: "5%", class: "pa-1 blue lighten-3 white--text",
|
||||
},
|
||||
{
|
||||
text: "ITEM INVENTARIS", align: "center", sortable: false, value: "nomor",
|
||||
width: "25%", class: "pa-1 blue lighten-3 white--text",
|
||||
},
|
||||
{
|
||||
text: "ACCOUNT KHUSUS", align: "center", sortable: false, value: "nomor",
|
||||
width: "60%", class: "pa-1 blue lighten-3 white--text",
|
||||
},
|
||||
{
|
||||
text: "AKSI", align: "center", sortable: false, value: "nomor",
|
||||
width: "10%", class: "pa-1 blue lighten-3 white--text",
|
||||
},
|
||||
]
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
list_item_inventaris: {
|
||||
get() {
|
||||
return this.$store.state.invItemMap.list_item_inventaris
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("invItemMap/update_list_item_inventaris", val)
|
||||
}
|
||||
},
|
||||
selected_inventaris_gol() {
|
||||
return this.$store.state.invMap.selected_inventaris_gol;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
editAcc(item) {
|
||||
this.hidrateCoaAutocomplete(item);
|
||||
const form = {
|
||||
invCoaID: item.M_InventarisItemCoaMappingCoaInventarisID,
|
||||
debtCoaID: item.M_InventarisItemCoaMappingCoaHutangID,
|
||||
bebanCoaID: item.M_InventarisItemCoaMappingCoaBebanPenyusutanID,
|
||||
accumCoaID: item.M_InventarisItemCoaMappingCoaAkumulasiPenyusutanID,
|
||||
labaCoaID: item.M_InventarisItemCoaMappingCoaLabaPelepasanID,
|
||||
rugiCoaID: item.M_InventarisItemCoaMappingCoaRugiPelepasanID
|
||||
}
|
||||
|
||||
this.$store.commit("invItemMap/update_form", form);
|
||||
this.$store.commit("invItemMap/update_selected_inventaris_item", item)
|
||||
this.$store.commit("invItemMap/update_dialog_add_mapping_item", true)
|
||||
},
|
||||
deleteAcc(item) {
|
||||
this.$store.commit("invItemMap/update_selected_inventaris_item", item);
|
||||
this.$store.commit("invItemMap/update_dialog_confirm_item", true);
|
||||
},
|
||||
hidrateCoaAutocomplete(item) {
|
||||
this.$store.dispatch("datacoa/getListCoa", {
|
||||
keyword: item.CoaInventarisAccountNo ?? "", key: "invCoa"
|
||||
});
|
||||
this.$store.dispatch("datacoa/getListCoa", {
|
||||
keyword: item.CoaHutangAccountNo ?? "", key: "debtCoa"
|
||||
});
|
||||
this.$store.dispatch("datacoa/getListCoa", {
|
||||
keyword: item.CoaBebanPenyusutanAccountNo ?? "", key: "bebanCoa"
|
||||
});
|
||||
this.$store.dispatch("datacoa/getListCoa", {
|
||||
keyword: item.CoaAkumulasiPenyusutanAccountNo ?? "", key: "accumCoa"
|
||||
});
|
||||
this.$store.dispatch("datacoa/getListCoa", {
|
||||
keyword: item.CoaLabaPelepasanAccountNo ?? "", key: "labaCoa"
|
||||
});
|
||||
this.$store.dispatch("datacoa/getListCoa", {
|
||||
keyword: item.CoaRugiPelepasanAccountNo ?? "", key: "rugiCoa"
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
64
test/vuex/acc-one-map-inventaris-coa/index.php
Normal file
64
test/vuex/acc-one-map-inventaris-coa/index.php
Normal file
@@ -0,0 +1,64 @@
|
||||
<!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="px-1 py-2">
|
||||
<v-flex xs4 class="left" fill-height pa-1>
|
||||
<one-left></one-left>
|
||||
</v-flex>
|
||||
<v-flex xs8 class="right" fill-height pa-1>
|
||||
<one-right></one-right>
|
||||
</v-flex>
|
||||
</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-left': httpVueLoader('./components/left-layout.vue'),
|
||||
'one-right': httpVueLoader('./components/right-layout.vue'),
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<style>
|
||||
[v-cloak] {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
</body>
|
||||
</html>
|
||||
53
test/vuex/acc-one-map-inventaris-coa/modules/datacoa.js
Normal file
53
test/vuex/acc-one-map-inventaris-coa/modules/datacoa.js
Normal file
@@ -0,0 +1,53 @@
|
||||
import * as api from "../api/api.js";
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
invCoa: [],
|
||||
debtCoa: [],
|
||||
bebanCoa: [],
|
||||
accumCoa: [],
|
||||
labaCoa: [],
|
||||
rugiCoa: []
|
||||
},
|
||||
mutations: {
|
||||
update_invCoa(state, val) {
|
||||
state.invCoa = val
|
||||
},
|
||||
update_debtCoa(state, val) {
|
||||
state.debtCoa = val
|
||||
},
|
||||
update_bebanCoa(state, val) {
|
||||
state.bebanCoa = val
|
||||
},
|
||||
update_accumCoa(state, val) {
|
||||
state.accumCoa = val
|
||||
},
|
||||
update_labaCoa(state, val) {
|
||||
state.labaCoa = val
|
||||
},
|
||||
update_rugiCoa(state, val) {
|
||||
state.rugiCoa = val
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
async getListCoa(context, param) {
|
||||
try {
|
||||
let params = {
|
||||
token: one_token(),
|
||||
keyword: param.keyword
|
||||
}
|
||||
const resp = await api.getListCoa(params);
|
||||
if (resp.status != 'OK') {
|
||||
throw new Error(resp.message);
|
||||
}
|
||||
|
||||
let update = "update_" + param.key;
|
||||
context.commit(update, resp.data);
|
||||
} catch (e) {
|
||||
const snac = { state: true, msg: e.message, color: "error" };
|
||||
context.commit('invMap/update_snackbar', snac, { root: true });
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
113
test/vuex/acc-one-map-inventaris-coa/modules/invItemMap.js
Normal file
113
test/vuex/acc-one-map-inventaris-coa/modules/invItemMap.js
Normal file
@@ -0,0 +1,113 @@
|
||||
import * as api from "../api/api.js";
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
list_item_inventaris: {
|
||||
records: [],
|
||||
total: 0
|
||||
},
|
||||
dialog_add_mapping_item: false,
|
||||
selected_inventaris_item: {},
|
||||
form: {
|
||||
invCoaID: 0,
|
||||
debtCoaID: 0,
|
||||
bebanCoaID: 0,
|
||||
accumCoaID: 0,
|
||||
labaCoaID: 0,
|
||||
rugiCoaID: 0
|
||||
},
|
||||
dialog_confirm_item: false
|
||||
},
|
||||
mutations: {
|
||||
update_dialog_add_mapping_item(state, val) {
|
||||
state.dialog_add_mapping_item = val
|
||||
},
|
||||
update_selected_inventaris_item(state, val) {
|
||||
state.selected_inventaris_item = val
|
||||
},
|
||||
update_list_item_inventaris(state, val) {
|
||||
state.list_item_inventaris = val;
|
||||
},
|
||||
update_form(state, val) {
|
||||
state.form = val
|
||||
},
|
||||
update_dialog_confirm_item(state, val) {
|
||||
state.dialog_confirm_item = val
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
async createInvItemCoaMapping(context, params) {
|
||||
try {
|
||||
context.commit("invMap/update_loading_process", true, {root: true});
|
||||
params.token = one_token();
|
||||
const resp = await api.createInvItemCoaMapping(params);
|
||||
if (resp.status != 'OK') {
|
||||
throw new Error(resp.message);
|
||||
}
|
||||
|
||||
const snac = { state: true, msg: resp.data, color: "success" };
|
||||
context.commit('invMap/update_snackbar', snac, {root: true});
|
||||
|
||||
const golID = context.state.selected_inventaris_item.itemGolID;
|
||||
context.dispatch("invMap/getListItemInventaris", golID, {root: true});
|
||||
|
||||
context.commit("update_selected_inventaris_item", {});
|
||||
context.commit("invMap/update_loading_process", false, {root: true});
|
||||
context.commit('update_dialog_add_mapping_item', false);
|
||||
} catch (error) {
|
||||
context.commit("invMap/update_loading_process", false, {root: true});
|
||||
const snac = { state: true, msg: error.message, color: "error" };
|
||||
context.commit('invMap/update_snackbar', snac, {root: true});
|
||||
}
|
||||
},
|
||||
async editInvItemCoaMapping(context, params) {
|
||||
try {
|
||||
context.commit("invMap/update_loading_process", true, {root: true});
|
||||
params.token = one_token();
|
||||
const resp = await api.editInvItemCoaMapping(params);
|
||||
if (resp.status != 'OK') {
|
||||
throw new Error(resp.message);
|
||||
}
|
||||
|
||||
const snac = { state: true, msg: resp.data, color: "success" };
|
||||
context.commit('invMap/update_snackbar', snac, {root: true});
|
||||
|
||||
const golID = context.state.selected_inventaris_item.itemGolID;
|
||||
context.dispatch("invMap/getListItemInventaris", golID, {root: true});
|
||||
|
||||
context.commit("update_selected_inventaris_item", {});
|
||||
context.commit("invMap/update_loading_process", false, {root: true});
|
||||
context.commit('update_dialog_add_mapping_item', false);
|
||||
} catch (error) {
|
||||
context.commit("invMap/update_loading_process", false, {root: true});
|
||||
const snac = { state: true, msg: error.message, color: "error" };
|
||||
context.commit('invMap/update_snackbar', snac, {root: true});
|
||||
}
|
||||
},
|
||||
async deleteInvItemCoaMapping(context, params) {
|
||||
try {
|
||||
context.commit("invMap/update_loading_process", true, {root: true});
|
||||
params.token = one_token();
|
||||
const resp = await api.deleteInvItemCoaMapping(params);
|
||||
if (resp.status != 'OK') {
|
||||
throw new Error(resp.message);
|
||||
}
|
||||
|
||||
const snac = { state: true, msg: resp.data, color: "success" };
|
||||
context.commit('invMap/update_snackbar', snac, {root: true});
|
||||
|
||||
const golID = context.state.selected_inventaris_item.itemGolID;
|
||||
context.dispatch("invMap/getListItemInventaris", golID, {root: true});
|
||||
|
||||
context.commit("update_selected_inventaris_item", {});
|
||||
context.commit("invMap/update_loading_process", false, {root: true});
|
||||
context.commit("update_dialog_confirm_item", false);
|
||||
} catch (error) {
|
||||
context.commit("invMap/update_loading_process", false, {root: true});
|
||||
const snac = { state: true, msg: error.message, color: "error" };
|
||||
context.commit('invMap/update_snackbar', snac, {root: true});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
179
test/vuex/acc-one-map-inventaris-coa/modules/invMap.js
Normal file
179
test/vuex/acc-one-map-inventaris-coa/modules/invMap.js
Normal file
@@ -0,0 +1,179 @@
|
||||
import * as api from "../api/api.js";
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
snackbar: {
|
||||
state: false,
|
||||
msg: "",
|
||||
color: "error"
|
||||
},
|
||||
loading_process: false,
|
||||
list_inventarisMapping: {
|
||||
records: [],
|
||||
total: 0
|
||||
},
|
||||
selected_inventaris_gol: {},
|
||||
|
||||
/* dialog inventaris gol for default */
|
||||
dialog_add_mapping_default: false,
|
||||
form_gol: {
|
||||
golID: 0,
|
||||
invCoaID: 0,
|
||||
debtCoaID: 0,
|
||||
bebanCoaID: 0,
|
||||
accumCoaID: 0,
|
||||
labaCoaID: 0,
|
||||
rugiCoaID: 0
|
||||
},
|
||||
list_gol_inventaris: {
|
||||
records: [],
|
||||
total: 0
|
||||
},
|
||||
|
||||
dialog_confirm: false
|
||||
},
|
||||
mutations: {
|
||||
update_snackbar(state, val) {
|
||||
state.snackbar = val;
|
||||
},
|
||||
update_loading_process(state, val) {
|
||||
state.loading_process = val;
|
||||
},
|
||||
update_list_inventarisMapping(state, val) {
|
||||
state.list_inventarisMapping = val
|
||||
},
|
||||
update_selected_inventaris_gol(state, val) {
|
||||
state.selected_inventaris_gol = val
|
||||
},
|
||||
|
||||
/* dialog invetaris gol for default */
|
||||
update_dialog_add_mapping_default(state, val) {
|
||||
state.dialog_add_mapping_default = val
|
||||
},
|
||||
update_form_gol(state, val) {
|
||||
state.form_gol = val
|
||||
},
|
||||
update_list_gol_inventaris(state, val) {
|
||||
state.list_gol_inventaris = val;
|
||||
},
|
||||
update_dialog_confirm(state, val) {
|
||||
state.dialog_confirm = val
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
async getListingInventarisGol(context) {
|
||||
try {
|
||||
let params = { token: one_token() }
|
||||
const resp = await api.getListingInventarisGol(params);
|
||||
if (resp.status != 'OK') {
|
||||
throw new Error(resp.message);
|
||||
}
|
||||
|
||||
context.commit('update_list_gol_inventaris', resp.data);
|
||||
} catch (e) {
|
||||
const snac = { state: true, msg: e.message, color: "error" };
|
||||
context.commit('update_snackbar', snac);
|
||||
}
|
||||
},
|
||||
async getListItemInventaris(context, id) {
|
||||
try {
|
||||
let params = {
|
||||
token: one_token(),
|
||||
golID: id
|
||||
}
|
||||
const resp = await api.getListItemInventaris(params);
|
||||
if (resp.status != 'OK') {
|
||||
throw new Error(resp.message);
|
||||
}
|
||||
|
||||
context.commit('invItemMap/update_list_item_inventaris', resp.data, {root: true});
|
||||
} catch (e) {
|
||||
const snac = { state: true, msg: e.message, color: "error" };
|
||||
context.commit('update_snackbar', snac);
|
||||
}
|
||||
},
|
||||
async getListInventorygolMapping(context, keyword) {
|
||||
try {
|
||||
let params = {
|
||||
token: one_token(),
|
||||
keyword: keyword,
|
||||
currpage: 1
|
||||
}
|
||||
const resp = await api.getListInventorygolMapping(params);
|
||||
if (resp.status != 'OK') {
|
||||
throw new Error(resp.message);
|
||||
}
|
||||
|
||||
context.commit("update_list_inventarisMapping", resp.data);
|
||||
} catch (e) {
|
||||
const snac = { state: true, msg: e.message, color: "error" };
|
||||
context.commit('update_snackbar', snac);
|
||||
}
|
||||
},
|
||||
async createInventarisGolMapping(context, params) {
|
||||
try {
|
||||
context.state.loading_process = true;
|
||||
params.token = one_token();
|
||||
const resp = await api.createInvCoaMapping(params);
|
||||
if (resp.status != 'OK') {
|
||||
throw new Error(resp.message);
|
||||
}
|
||||
|
||||
const snac = { state: true, msg: resp.data, color: "success" };
|
||||
context.commit('update_snackbar', snac);
|
||||
context.dispatch("getListInventorygolMapping");
|
||||
|
||||
context.state.loading_process = false;
|
||||
context.state.dialog_add_mapping_default = false;
|
||||
} catch (e) {
|
||||
context.state.loading_process = false;
|
||||
const snac = { state: true, msg: e.message, color: "error" };
|
||||
context.commit('update_snackbar', snac);
|
||||
}
|
||||
},
|
||||
async editInventarisGolMapping(context, params) {
|
||||
try {
|
||||
context.state.loading_process = true;
|
||||
params.token = one_token();
|
||||
const resp = await api.editInvCoaMapping(params);
|
||||
if (resp.status != 'OK') {
|
||||
throw new Error(resp.message);
|
||||
}
|
||||
|
||||
const snac = { state: true, msg: resp.data, color: "success" };
|
||||
context.commit('update_snackbar', snac);
|
||||
|
||||
context.state.loading_process = false;
|
||||
context.state.dialog_add_mapping_default = false;
|
||||
} catch (e) {
|
||||
context.state.loading_process = false;
|
||||
const snac = { state: true, msg: e.message, color: "error" };
|
||||
context.commit('update_snackbar', snac);
|
||||
}
|
||||
},
|
||||
async deleteInventarisGolMapping(context, id) {
|
||||
try {
|
||||
context.state.loading_process = true;
|
||||
params = {
|
||||
token: one_token(),
|
||||
M_InventarisCoaMappingID: id
|
||||
};
|
||||
const resp = await api.deleteInvCoaMapping(params);
|
||||
if (resp.status != 'OK') {
|
||||
throw new Error(resp.message);
|
||||
}
|
||||
|
||||
const snac = { state: true, msg: resp.data, color: "success" };
|
||||
context.commit('update_snackbar', snac);
|
||||
|
||||
context.state.loading_process = false;
|
||||
context.state.dialog_add_mapping_default = false;
|
||||
} catch (e) {
|
||||
context.state.loading_process = false;
|
||||
const snac = { state: true, msg: e.message, color: "error" };
|
||||
context.commit('update_snackbar', snac);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
16
test/vuex/acc-one-map-inventaris-coa/store.js
Normal file
16
test/vuex/acc-one-map-inventaris-coa/store.js
Normal file
@@ -0,0 +1,16 @@
|
||||
import system from "../../../apps/modules/system/system.js";
|
||||
import datacoa from "./modules/datacoa.js";
|
||||
import invItemMap from "./modules/invItemMap.js";
|
||||
import invMap from "./modules/invMap.js";
|
||||
|
||||
export const store = new Vuex.Store({
|
||||
modules: {
|
||||
system: system,
|
||||
invMap: invMap,
|
||||
datacoa: datacoa,
|
||||
invItemMap: invItemMap
|
||||
},
|
||||
state: {},
|
||||
mutations: {},
|
||||
actions: {}
|
||||
})
|
||||
Reference in New Issue
Block a user