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,175 @@
const URL = "/one-api/mockup/masterdata/accounting/itemregional";
export async function getItem(prm) {
try {
var resp = await axios.post(URL + '/getItem', 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 getRegional(prm) {
try {
var resp = await axios.post(URL + '/getRegional', 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 getUnit(prm) {
try {
var resp = await axios.post(URL + '/getUnit', 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 getDepartment(prm) {
try {
var resp = await axios.post(URL + '/getDepartment', 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,900 @@
<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">ITEM (REGIONAL)</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)">
{{ props.item.S_RegionalName }}
</td>
<td class="text-xs-left pa-2" v-bind:class="{ 'amber lighten-4': isSelected(props.item) }"
@click="selectMe(props.item)">
<div class="date-type-table">
<span>{{props.item.M_ItemDesc}}
</span>
<p>{{props.item.M_ItemCode}}
</p>
</div>
</td>
<td class="text-xs-right pa-2" v-bind:class="{ 'amber lighten-4': isSelected(props.item) }"
@click="selectMe(props.item)">
{{ props.item.M_ItemRegionalMinQty }}
<p>{{props.item.ItemUnitName}}
</p>
</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">ITEM (REGIONAL)</v-toolbar-title>
<v-spacer></v-spacer>
</v-toolbar>
<v-card>
<v-card-text class="pt-4 pb-2">
<v-form ref="formRequest" v-model="validationForm" lazy-validtion>
<v-layout wrap>
<v-flex xs12>
<v-autocomplete class="mt-3" label="Regional" :items="a_regional_list" v-model="a_regional"
:search-input.sync="a_regional_search" hide-details auto-select-first no-filter
item-text="S_RegionalName" outline return-object no-data-text="Cari Regional">
<template slot="item" slot-scope="{ item }">
<v-list-tile-content>
<v-list-tile-title v-text="item.S_RegionalName"></v-list-tile-title>
</v-list-tile-content>
</template>
</v-autocomplete>
<p v-if="checkErrorForm('requireRegional')" class="error pl-2 pr-2" style="color:#fff">Regional harus dipilih</p>
<v-autocomplete class="mt-3" label="Item" :items="a_item_list" v-model="a_item"
:search-input.sync="a_item_search" hide-details auto-select-first no-filter
item-text="M_ItemDesc" outline return-object no-data-text="Cari Item">
<template slot="item" slot-scope="{ item }">
<v-list-tile-content>
<v-list-tile-title v-text="item.M_ItemDesc"></v-list-tile-title>
<v-list-tile-sub-title
v-text="item.M_ItemCode"></v-list-tile-sub-title>
</v-list-tile-content>
</template>
</v-autocomplete>
<p v-if="checkErrorForm('requireItem')" class="error pl-2 pr-2" style="color:#fff">Item harus dipilih</p>
<v-text-field class="mt-3" label="Min Qty" type="number" v-model="a_qty" hide-details
outline></v-text-field>
<p v-if="checkErrorForm('requireQty')" class="error pl-2 pr-2" style="color:#fff">Min Qty harus diisi</p>
<v-autocomplete class="mt-3" label="Unit" :items="a_unit_list" v-model="a_unit"
:search-input.sync="a_unit_search" hide-details auto-select-first no-filter
item-text="ItemUnitName" outline return-object no-data-text="Cari Satuan">
<template slot="item" slot-scope="{ item }">
<v-list-tile-content>
<v-list-tile-title v-text="item.ItemUnitName"></v-list-tile-title>
<v-list-tile-sub-title
v-text="item.ItemUnitCode"></v-list-tile-sub-title>
</v-list-tile-content>
</template>
</v-autocomplete>
<p v-if="checkErrorForm('requireUnit')" class="error pl-2 pr-2" style="color:#fff">Satuan harus dipilih</p>
</v-flex>
</v-layout>
</v-form>
</v-card-text>
<v-card-text>
<v-layout>
</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" v-if="this.xid == 0" @click="saveFormAdd()">SIMPAN</v-btn>
<v-btn color="primary" v-if="this.xid !== 0" @click="saveFormEdit()">SIMPAN PERUBAHAN</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 -->
<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 {
a_noteRules: [(v) => !!v || "Catatan harus diisi"],
a_itemRules: [(v) => !!v || "Item harus dipilih"],
a_regionalRules: [(v) => !!v || "Regional harus dipilih"],
a_unitRules: [(v) => !!v || "Satuan harus dipilih"],
a_qtyRules: [(v) => !!v || "Jumlah harus diisi"],
a_acquisition_priceRules: [(v) => !!v || "Harga perolehan harus diisi"],
a_coaRules: [(v) => !!v || "Account harus dipilih"],
validationForm: false,
formatreport: "pdf",
urlprint: "",
printtitle: "",
printwidth: "100%",
page: 1,
M_ItemRegionalID: 0,
Fa_ClassName: "",
headers: [
{
text: "REGIONAL",
align: "center",
sortable: false,
value: "jurnal",
width: "30%",
class: "blue lighten-3 white--text",
},
{
text: "ITEM",
align: "right",
sortable: false,
value: "location",
width: "30%",
class: "blue lighten-3 white--text",
},
{
text: "MIN QTY (UNIT)",
align: "center",
sortable: false,
value: "info",
width: "30%",
class: "blue lighten-3 white--text",
},
{
text: "AKSI",
align: "center",
sortable: false,
value: "status",
width: "10%",
class: "blue lighten-3 white--text",
},
],
dialogdeletealecoa: false,
msgalertcoa: "",
e_coa_search: '',
e_coa_search_accum_depre: ''
}
},
mounted() {
this.$store.dispatch("itemregional/search", {
current_page: this.$store.state.itemregional.a_current_page,
search: this.$store.state.itemregional.a_x_search,
last_id: -1,
});
},
computed: {
opendialoginfo: {
get() {
return this.$store.state.itemregional.a_open_dialog_info;
},
set(val) {
this.$store.commit("itemregional/update_a_open_dialog_info", false);
},
},
msginfo: {
get() {
return this.$store.state.itemregional.a_msg_info;
},
set(val) {
this.$store.commit("itemregional/update_a_msg_info", false);
},
},
snackbar: {
get() {
return this.$store.state.itemregional.a_alert_success;
},
set(val) {
this.$store.commit("itemregional/update_a_alert_success", val);
},
},
msgSnackbar() {
return this.$store.state.itemregional.a_msg_success;
},
dialog_error: {
get() {
return this.$store.state.itemregional.a_alert_error;
},
set(val) {
this.$store.commit("itemregional/update_a_alert_error", val);
},
},
msgError() {
return this.$store.state.itemregional.a_save_error_message;
},
// search table start
xcoas() {
return this.$store.state.itemregional.a_coas;
},
isLoading() {
return this.$store.state.itemregional.a_search_status === 1;
},
xsearch: {
get() {
return this.$store.state.itemregional.a_x_search;
},
set(val) {
this.$store.commit("itemregional/update_a_x_search", val);
},
},
curr_page: {
get() {
return this.$store.state.itemregional.a_current_page;
},
set(val) {
this.$store.commit("itemregional/update_a_current_page", val);
this.$store.commit("itemregional/update_a_last_id", -1);
this.searchCoa();
},
},
xtotal_page: {
get() {
return this.$store.state.itemregional.a_total_coa;
},
set(val) {
this.$store.commit("itemregional/update_a_total_coa", val);
},
},
// search table end
// dialog add
dialog_add_coa: {
get() {
return this.$store.state.itemregional.dialog_add_coa;
},
set(val) {
this.$store.commit("itemregional/update_dialog_add_coa", val);
},
},
dialog_edit_coa: {
get() {
return this.$store.state.itemregional.dialog_edit_coa;
},
set(val) {
this.$store.commit("itemregional/update_dialog_edit_coa", val);
},
},
xid: {
get() {
return this.$store.state.itemregional.xid;
},
set(val) {
this.$store.commit("itemregional/update_xid", val);
},
},
xnumber: {
get() {
return this.$store.state.itemregional.xnumber;
},
set(val) {
this.$store.commit("itemregional/update_xnumber", val);
},
},
// text classname
a_faname: {
get() {
return this.$store.state.itemregional.a_faname;
},
set(val) {
this.$store.commit("itemregional/update_a_faname", val);
},
},
e_classname: {
get() {
return this.$store.state.itemregional.e_classname;
},
set(val) {
this.$store.commit("itemregional/update_e_classname", val);
},
},
// ac coa start
a_coa_list() {
return this.$store.state.itemregional.a_coa_list;
},
a_coa: {
get() {
return this.$store.state.itemregional.a_coa;
},
set(val) {
this.$store.commit("itemregional/update_a_coa", val);
},
},
a_loading_coa: {
get() {
return this.$store.state.itemregional.a_loading_coa;
},
set(val) {
this.$store.commit("itemregional/update_a_loading_coa", val);
},
},
a_coa_search: {
get() {
return this.$store.state.itemregional.a_coa_search
},
set(val) {
this.$store.commit("itemregional/update_a_coa_search", val);
//this.aSearchAcCoa(val)
}
},
// ac item start
a_item_list() {
return this.$store.state.itemregional.a_item_list;
},
a_item: {
get() {
return this.$store.state.itemregional.a_item;
},
set(val) {
this.$store.commit("itemregional/update_a_item", val);
},
},
a_loading_item: {
get() {
return this.$store.state.itemregional.a_loading_item;
},
set(val) {
this.$store.commit("itemregional/update_a_loading_item", val);
},
},
a_item_search: {
get() {
return this.$store.state.itemregional.a_item_search
},
set(val) {
this.$store.commit("itemregional/update_a_item_search", val);
// this.aSearchItem(val)
}
},
a_regional_list() {
return this.$store.state.itemregional.a_regional_list;
},
a_regional: {
get() {
return this.$store.state.itemregional.a_regional;
},
set(val) {
this.$store.commit("itemregional/update_a_regional", val);
},
},
a_loading_regional: {
get() {
return this.$store.state.itemregional.a_loading_regional;
},
set(val) {
this.$store.commit("itemregional/update_a_loading_regional", val);
},
},
a_regional_search: {
get() {
return this.$store.state.itemregional.a_regional_search
},
set(val) {
this.$store.commit("itemregional/update_a_regional_search", val);
// this.aSearchItem(val)
}
},
a_unit_list() {
return this.$store.state.itemregional.a_unit_list;
},
a_unit: {
get() {
return this.$store.state.itemregional.a_unit;
},
set(val) {
this.$store.commit("itemregional/update_a_unit", val);
},
},
a_loading_unit: {
get() {
return this.$store.state.itemregional.a_loading_unit;
},
set(val) {
this.$store.commit("itemregional/update_a_loading_unit", val);
},
},
a_unit_search: {
get() {
return this.$store.state.itemregional.a_unit_search
},
set(val) {
this.$store.commit("itemregional/update_a_unit_search", val);
// this.aSearchItem(val)
}
},
// ac department start
a_department_list() {
return this.$store.state.itemregional.a_department_list;
},
a_department: {
get() {
return this.$store.state.itemregional.a_department;
},
set(val) {
this.$store.commit("itemregional/update_a_department", val);
},
},
a_loading_department: {
get() {
return this.$store.state.itemregional.a_loading_department;
},
set(val) {
this.$store.commit("itemregional/update_a_loading_department", val);
},
},
a_department_search: {
get() {
return this.$store.state.itemregional.a_department_search
},
set(val) {
this.$store.commit("itemregional/update_a_department_search", val);
//this.aSearchDepartment(val)
}
},
a_qty: {
get() {
return this.$store.state.itemregional.a_qty;
},
set(val) {
this.$store.commit("itemregional/update_a_qty", val);
},
},
a_acquisition_price: {
get() {
return this.$store.state.itemregional.a_acquisition_price;
},
set(val) {
this.$store.commit("itemregional/update_a_acquisition_price", val);
},
},
a_inventaris: {
get() {
return this.$store.state.itemregional.a_inventaris;
},
set(val) {
this.$store.commit("itemregional/update_a_inventaris", val);
},
},
a_note: {
get() {
return this.$store.state.itemregional.a_note;
},
set(val) {
this.$store.commit("itemregional/update_a_note", val);
},
},
a_fa_account_id: {
get() {
return this.$store.state.itemregional.a_fa_account_id;
},
set(val) {
this.$store.commit("itemregional/update_a_fa_account_id", val);
},
},
a_fa_account_name: {
get() {
return this.$store.state.itemregional.a_fa_account_name;
},
set(val) {
this.$store.commit("itemregional/update_a_fa_account_name", val);
},
},
a_accum_depre_account_id: {
get() {
return this.$store.state.itemregional.a_accum_depre_account_id;
},
set(val) {
this.$store.commit("itemregional/update_a_accum_depre_account_id", val);
},
},
a_accum_depre_account_name: {
get() {
return this.$store.state.itemregional.a_accum_depre_account_name;
},
set(val) {
this.$store.commit("itemregional/update_a_accum_depre_account_name", val);
},
},
a_depre_account_id: {
get() {
return this.$store.state.itemregional.a_depre_account_id;
},
set(val) {
this.$store.commit("itemregional/update_a_depre_account_id", val);
},
},
a_depre_account_name: {
get() {
return this.$store.state.itemregional.a_depre_account_name;
},
set(val) {
this.$store.commit("itemregional/update_a_depre_account_name", val);
},
}
},
methods: {
searchCoa() {
this.$store.dispatch("itemregional/search", {
current_page: this.$store.state.itemregional.a_current_page,
search: this.$store.state.itemregional.a_x_search,
last_id: -1,
});
},
checkErrorForm(val) {
let errors = this.$store.state.itemregional.errors;
if (errors.includes(val)) {
return true;
} else {
return false;
}
},
isSelected(p) {
return p.M_ItemRegionalID == this.$store.state.itemregional.a_selected_a_coa.M_ItemRegionalID;
},
selectMe(sc) {
this.$store.commit("itemregional/update_a_selected_a_coa", sc);
},
closeDialogAddCoa() {
this.$store.commit("itemregional/update_dialog_add_coa", false);
},
async aSearchAcCoa(query) {
if (!query) return;
this.a_loading_coa = true;
await this.$store.dispatch("itemregional/open_add_coa", { search: query });
this.a_loading_coa = false;
},
async aSearchItem(query) {
if (!query) return;
this.a_loading_item = true;
await this.$store.dispatch("itemregional/open_add_item", { search: query });
this.a_loading_item = false;
},
async aSearchRegional(query) {
if (!query) return;
this.a_loading_regional = true;
await this.$store.dispatch("itemregional/open_add_regional", { search: query });
this.a_loading_regional = false;
},
async aSearchUnit(query) {
if (!query) return;
this.a_loading_unit = true;
await this.$store.dispatch("itemregional/open_add_unit", { search: query });
this.a_loading_unit = false;
},
async aSearchDepartment(query) {
if (!query) return;
this.a_loading_department = true;
await this.$store.dispatch("itemregional/open_add_department", { search: query });
this.a_loading_department = false;
},
// add data
openDialogAdd() {
this.$refs.formRequest.resetValidation();
this.$store.commit("itemregional/update_xid", 0);
this.$store.commit("itemregional/update_dialog_add_coa", true);
this.$store.commit("itemregional/update_a_item", {});
this.$store.commit("itemregional/update_a_item_list", {});
this.$store.commit("itemregional/update_a_regional", {});
this.$store.commit("itemregional/update_a_regional_list", {});
this.$store.commit("itemregional/update_a_unit", {});
this.$store.commit("itemregional/update_a_unit_list", {});
this.$store.commit("itemregional/update_a_qty", 0);
},
saveFormAdd() {
var paramAdd = {
M_ItemRegionalM_ItemID : this.a_item.M_ItemID,
M_ItemRegionalS_RegionalID : this.a_regional.S_RegionalID,
M_ItemRegionalItemUnitID : this.a_unit.ItemUnitID,
M_ItemRegionalQty : this.a_qty};
console.log('param add', paramAdd);
this.$store.commit("itemregional/update_errors", []);
var errors = this.$store.state.itemregional.errors;
if (_.isEmpty(this.a_item)) {
errors.push("requireItem");
}
if (_.isEmpty(this.a_regional)) {
errors.push("requireRegional");
}
if (_.isEmpty(this.a_unit)) {
errors.push("requireUnit");
}
if (_.isEmpty(this.a_qty)) {
errors.push("requireQty");
}
if (errors.length === 0) {
this.$store.dispatch("itemregional/add_data", paramAdd);
}
},
// edit
closeDialogEditCoa() {
this.e_coa_search = ""
this.e_coa_search_accum_depre = ""
this.$store.commit("itemregional/update_dialog_edit_coa", false);
this.$store.commit("itemregional/update_e_classname", "");
this.$store.commit("itemregional/update_e_coa", {});
this.$store.commit("itemregional/update_e_deprecorp", "");
this.$store.commit("itemregional/update_e_coa_accum_depre", {});
this.$store.commit("itemregional/update_e_note", "");
},
saveFormEdit() {
var paramEdit = {
M_ItemRegionalID: this.xid,
M_ItemRegionalM_DepartmentID : this.a_department.M_DepartmentID,
M_ItemRegionalM_ItemID : this.a_item.M_ItemID,
M_ItemRegionalS_RegionalID : this.a_regional.S_RegionalID ,
M_ItemRegionalItemUnitID : this.a_unit.ItemUnitID,
M_ItemRegionalQty : this.a_qty
};
console.log('paramEdit', paramEdit);
if (this.$refs.formRequest.validate()) {
this.$store.dispatch("itemregional/edit_data", paramEdit);
}
},
// delete data
openDeleteCoa(val) {
console.log(val);
this.M_ItemRegionalID = val.M_ItemRegionalID;
this.msgalertcoa =
"Yakin, mau hapus data " + val.S_RegionalName+ " [" +
val.M_ItemDesc +
"] ?";
this.dialogdeletealecoa = true;
},
closeDeleteAlertCoa() {
let prm = {
M_ItemRegionalID: this.M_ItemRegionalID,
M_ItemDesc: this.M_ItemDesc,
current_page: this.$store.state.itemregional.a_current_page,
search: this.$store.state.itemregional.a_x_search,
last_id: -1,
};
this.dialogdeletealecoa = false;
this.$store.dispatch("itemregional/delete_data", prm);
},
// edit data
openEditFormCoa(val) {
this.$store.dispatch("itemregional/get_by_id", val);
this.$store.commit("itemregional/update_xid", val.M_ItemRegionalID);
this.$store.commit("itemregional/update_a_item", {M_ItemID : val.M_ItemID,
M_ItemCode : val.M_ItemCode, M_ItemDesc : val.M_ItemDesc});
this.$store.commit("itemregional/update_a_item_list", {M_ItemID : val.M_ItemID,
M_ItemCode : val.M_ItemCode, M_ItemDesc : val.M_ItemDesc});
this.$store.commit("itemregional/update_a_regional", {S_RegionalID : val.S_RegionalID,S_RegionalName : val.S_RegionalName});
this.$store.commit("itemregional/update_a_regional_list", {S_RegionalID : val.S_RegionalID, S_RegionalName : val.S_RegionalName});
this.$store.commit("itemregional/update_a_unit", {ItemUnitID : val.ItemUnitID,ItemUnitCode : val.ItemUnitCode, ItemUnitName : val.ItemUnitName});
this.$store.commit("itemregional/update_a_unit_list", {ItemUnitID : val.ItemUnitID, ItemUnitCode : val.ItemUnitCode, ItemUnitName : val.ItemUnitName});
this.a_loading_item = false;
this.a_loading_regional = false;
this.a_loading_unit = false;
this.$store.commit("itemregional/update_a_qty", val.M_ItemRegionalMinQty);
this.$store.commit("itemregional/update_dialog_add_coa", true);
},
},
watch: {
a_item_search(val) {
this.aSearchItem(val)
},
a_regional_search(val) {
this.aSearchRegional(val)
},
a_unit_search(val) {
this.aSearchUnit(val)
},
a_coa_search(val) {
this.aSearchAcCoa(val)
},
a_department_search(val) {
this.aSearchDepartment(val)
},
e_coa_search_accum_depre(val) {
this.eSearchAcCoaAccumDepre(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-itemregional-list></one-itemregional-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-itemregional-list': httpVueLoader('./components/ItemRegional.vue')
}
})
</script>
<style>
[v-cloak] {
display: none;
}
</style>
</body>
</html>

View File

@@ -0,0 +1,626 @@
import * as api from "../api/itemregional.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_faname: '',
e_classname: '',
// ac coa
a_loading_coa: false,
a_coa_list: [],
a_coa: {},
a_coa_search: '',
// ac item
a_loading_item: false,
a_item_list: [],
a_item: {},
a_item_search: '',
// ac regional
a_loading_regional: false,
a_regional_list: [],
a_regional: {},
a_regional_search: '',
// ac unit
a_loading_unit: false,
a_unit_list: [],
a_unit: {},
a_unit_search: '',
// ac department
a_loading_department: false,
a_department_list: [],
a_department: {},
a_department_search: '',
a_inventaris : '',
a_note : '',
a_fa_account_id: 0,
a_fa_account_name: '',
a_accum_depre_account_id: 0,
a_accum_depre_account_name: '',
a_depre_account_id: 0,
a_depre_account_name: '',
a_qty: 0,
a_acquisition_price: 0,
// text note
a_note: '',
e_note: '',
a_errors_save: [],
Fa_ClassID: 0,
a_errors_save_coa: [],
xid: 0,
xnumber: '',
errors: []
},
mutations: {
update_errors(state, val) {
state.errors = val;
},
update_xid(state, val) {
state.xid = val
},
update_xnumber(state, val) {
state.xnumber = val
},
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_faname(state, val) {
state.a_faname = 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
},
// ac item
update_a_loading_item(state, val) {
state.a_loading_item = val
},
update_a_item_list(state, val) {
state.a_item_list = val
},
update_a_item(state, val) {
state.a_item = val
},
update_a_item_search(state, val) {
state.a_item_search = val
},
// ac regional
update_a_loading_regional(state, val) {
state.a_regional_item = val
},
update_a_regional_list(state, val) {
state.a_regional_list = val
},
update_a_regional(state, val) {
state.a_regional = val
},
update_a_regional_search(state, val) {
state.a_regional_search = val
},
// ac unit
update_a_loading_unit(state, val) {
state.a_loading_unit = val
},
update_a_unit_list(state, val) {
state.a_unit_list = val
},
update_a_unit(state, val) {
state.a_unit = val
},
update_a_unit_search(state, val) {
state.a_unit_search = val
},
// ac department
update_a_loading_department(state, val) {
state.a_loading_department = val
},
update_a_department_list(state, val) {
state.a_department_list = val
},
update_a_department(state, val) {
state.a_department = val
},
update_a_department_search(state, val) {
state.a_department_search = val
},
update_a_inventaris(state, val) {
state.a_inventaris = val
},
update_a_note(state, val) {
state.a_note = val
},
update_a_fa_account_id(state, val) {
state.a_fa_account_id = val
},
update_a_fa_account_name(state, val) {
state.a_fa_account_name = val
},
update_a_accum_depre_account_id(state, val) {
state.a_accum_depre_account_id = val
},
update_a_accum_depre_account_name(state, val) {
state.a_accum_depre_account_name = val
},
update_a_depre_account_id(state, val) {
state.a_depre_account_id = val
},
update_a_depre_account_name(state, val) {
state.a_depre_account_name = val
},
update_a_qty(state, val) {
state.a_qty = val
},
update_a_acquisition_price(state, val) {
state.a_acquisition_price = 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)
}
},
async open_add_item(context, payload) {
context.commit("update_a_loading_item", true)
try {
let prm = {};
prm.token = one_token()
prm.search = payload.search
let resp = await api.getItem(prm)
// console.log('data nat_group ',resp)
if (resp.status != "OK") {
context.commit("update_a_loading_item", false)
} else {
// console.log('data nat_group ',resp.data)
context.commit("update_a_loading_item", false)
context.commit("update_a_item_list", resp.data)
}
} catch (e) {
context.commit("update_a_loading_item", false)
}
},
async open_add_regional(context, payload) {
context.commit("update_a_loading_regional", true)
try {
let prm = {};
prm.token = one_token()
prm.search = payload.search
let resp = await api.getRegional(prm)
// console.log('data nat_group ',resp)
if (resp.status != "OK") {
context.commit("update_a_loading_regional", false)
} else {
// console.log('data nat_group ',resp.data)
context.commit("update_a_loading_regional", false)
context.commit("update_a_regional_list", resp.data)
console.log('regional')
console.log(resp.data)
}
} catch (e) {
context.commit("update_a_loading_regional", false)
}
},
async open_add_unit(context, payload) {
context.commit("update_a_loading_unit", true)
try {
let prm = {};
prm.token = one_token()
prm.search = payload.search
let resp = await api.getUnit(prm)
// console.log('data nat_group ',resp)
if (resp.status != "OK") {
context.commit("update_a_loading_unit", false)
} else {
// console.log('data nat_group ',resp.data)
context.commit("update_a_loading_unit", false)
context.commit("update_a_unit_list", resp.data)
}
} catch (e) {
context.commit("update_a_loading_unit", false)
}
},
async open_add_department(context, payload) {
context.commit("update_a_loading_department", true)
try {
let prm = {};
prm.token = one_token()
prm.search = payload.search
let resp = await api.getDepartment(prm)
// console.log('data nat_group ',resp)
if (resp.status != "OK") {
context.commit("update_a_loading_department", false)
} else {
// console.log('data nat_group ',resp.data)
context.commit("update_a_loading_department", false)
context.commit("update_a_department_list", resp.data)
}
} catch (e) {
context.commit("update_a_loading_department", false)
}
},
// add data
async add_data(context, prm) {
context.commit("update_a_save_status", 1)
try {
prm.token = one_token()
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("itemregional/update_dialog_add_coa", false);
context.commit("itemregional/update_a_faname", "");
context.commit("itemregional/update_a_coa", {});
context.commit("itemregional/update_a_deprecorp", "");
context.commit("itemregional/update_a_coa_accum_depre", {});
context.commit("itemregional/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
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
})
// 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_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)
}
},
// edit data
async edit_data(context, prm) {
context.commit("update_a_save_status", 1)
try {
prm.token = one_token()
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_add_coa', false)
context.dispatch("search", {
current_page: context.state.a_current_page,
search: context.state.a_x_search,
last_id: -1
})
context.commit("itemregional/update_dialog_add_coa", false);
context.commit("itemregional/update_a_faname", "");
context.commit("itemregional/update_a_coa", {});
context.commit("itemregional/update_a_deprecorp", "");
context.commit("itemregional/update_a_coa_accum_depre", {});
context.commit("itemregional/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)
}
},
// 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.delete_data + " 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 itemregional from "./modules/itemregional.js";
export const store = new Vuex.Store({
modules: {
system: system,
itemregional:itemregional,
},
state: {},
mutations: {},
actions: {},
});