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,101 @@
<template>
<v-dialog v-model="dialog_account_item" persistent width="40vw">
<v-card>
<v-card-title class="headline grey lighten-2">PILIH ACCOUNT BIAYA</v-card-title>
<v-card-text>
<v-layout row wrap v-for="(item, index) in list_voucher_detail" :key="index" class="mt-2">
<v-flex xs3 class="pr-1">
<div class="text-xs-left">
<p class="mb-0">{{ item.PurchaseRequestDirectDescription }}</p>
<p class="mb-0 font-weight-bold" style="color:#000000">Kategori: {{ item.PurchaseDirectCategoryName }}</p>
</div>
</v-flex>
<v-flex xs3 class="px-1">
<div class="text-xs-left">
<p class="mb-0">Jumlah: </p>
<p class="mb-0 font-weight-bold" style="color:#000000">Rp. {{ item.PurchaseRequestDirectDetailTotalEstimationPrice }}</p>
</div>
</v-flex>
<v-flex xs6 class="pl-1">
<v-autocomplete
label="Account Biaya" hide-details outline
v-model="item.account_number" :items="list_accitem"
item-text="coaDescription" item-value="coaAccountNo"
></v-autocomplete>
<p v-show="item.err_message.length > 0" class="mb-0 text-red-600">{{ item.err_message }}</p>
</v-flex>
<v-flex xs12>
<v-divider class="mt-2" v-if="index + 1 < list_voucher_detail.length" :key="`divider-${index}`"></v-divider>
</v-flex>
</v-layout>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="error" @click="batalAcc()">BATAL</v-btn>
<v-btn color="primary" @click="simpanAcc()">SIMPAN</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</template>
<script>
module.exports = {
data() {
return {
search_accitem: ''
}
},
computed: {
dialog_account_item: {
get() {
return this.$store.state.voucher.dialog_account_item;
},
set(val) {
this.$store.commit("voucher/update_dialog_account_item", val)
}
},
list_voucher_detail: {
get() {
return this.$store.state.voucher.list_voucher_detail;
},
set(val) {
this.$store.commit("voucher/update_list_voucher_detail", val)
}
},
list_accitem() {
return this.$store.state.voucher.list_accitem;
}
},
methods: {
simpanAcc() {
let data = this.list_voucher_detail
let headerID = 0;
let isEmpty = false
data.forEach(elem => {
if (elem.account_number == '') {
elem.err_message = 'account harus diisi'
isEmpty = true
} else {
elem.err_message = ''
}
headerID = elem.PurchaseRequestDirectDetailPurchaseRequestDirectID
});
if (isEmpty) {
return
}
this.$store.dispatch("voucher/saveAccountItem", headerID)
},
batalAcc() {
this.list_voucher_detail = []
this.dialog_account_item = false
}
},
watch: {
},
}
</script>

View File

@@ -0,0 +1,524 @@
<template>
<v-layout row justify-center>
<v-dialog v-model="dialogVoucher" persistent max-width="50vw">
<v-card>
<v-card-title class="headline grey lighten-2" primary-title>
FORM VOUCHER
</v-card-title>
<v-card-text class="pt-2 pb-0">
<v-layout wrap>
<v-flex xs12 mb-2>
<v-autocomplete label="Cabang"
:items="branchList" v-model="selectedBranch"
:search-input.sync="search_branch"
auto-select-first no-filter item-text="M_BranchName" return-object
no-data-text="Pilih Cabang"
:disabled="xact === 'edit'"
hide-details>
<template slot="item" slot-scope="{ item }">
<v-list-tile-content>
<v-list-tile-title v-text="item.M_BranchName"></v-list-tile-title>
</v-list-tile-content>
</template>
</v-autocomplete>
<p v-if="checkErrorForm('requireBranch')" class="error pl-2 pr-2" style="color:#fff">Cabang harus diisi</p>
</v-flex>
<v-flex xs12 mb-2>
<v-autocomplete label="Account Sumber Dana"
:items="accountDanaList" v-model="selectedAccountDana"
:search-input.sync="search_accountDana"
auto-select-first no-filter item-text="coaDescription" return-object
no-data-text="Pilih Account Sumber Dana"
hide-details>
<template slot="item" slot-scope="{ item }">
<v-list-tile-content>
<v-list-tile-title v-text="item.coaDescription"></v-list-tile-title>
<v-list-tile-sub-title
v-text="item.coaAccountNo"
></v-list-tile-sub-title>
</v-list-tile-content>
</template>
</v-autocomplete>
<p v-if="checkErrorForm('requireAccountDana')" class="error pl-2 pr-2" style="color:#fff">Account sumber dana harus diisi</p>
</v-flex>
<!-- <v-flex xs12 mb-2>
<v-autocomplete label="Account Biaya"
:items="accountBiayaList" v-model="selectedAccountBiaya"
:search-input.sync="search_accountBiaya"
auto-select-first no-filter item-text="coaDescription" return-object
no-data-text="Pilih Account Biaya"
hide-details>
<template slot="item" slot-scope="{ item }">
<v-list-tile-content>
<v-list-tile-title v-text="item.coaDescription"></v-list-tile-title>
<v-list-tile-sub-title
v-text="item.coaAccountNo"
></v-list-tile-sub-title>
</v-list-tile-content>
</template>
</v-autocomplete>
<p v-if="checkErrorForm('requireAccountBiaya')" class="error pl-2 pr-2" style="color:#fff">Account biaya harus diisi</p>
</v-flex> -->
<v-flex xs12 mb-2>
<v-autocomplete label="Account Tampungan Sementara"
:items="accountTempList" v-model="selectedAccountTemp"
:search-input.sync="search_accountTemp"
auto-select-first no-filter item-text="coaDescription" return-object
no-data-text="Pilih Account"
hide-details>
<template slot="item" slot-scope="{ item }">
<v-list-tile-content>
<v-list-tile-title v-text="item.coaDescription"></v-list-tile-title>
<v-list-tile-sub-title
v-text="item.coaAccountNo"
></v-list-tile-sub-title>
</v-list-tile-content>
</template>
</v-autocomplete>
<p v-if="checkErrorForm('requireAccountTemp')" class="error pl-2 pr-2" style="color:#fff">Account tampungan sementara harus diisi</p>
</v-flex>
<!-- listing -->
<v-flex xs12 mt-2>
<v-layout row>
<v-flex xs12 pt-2 pb-2>
<v-card color="cyan ">
<v-layout align-center row>
<h4 class="subheader pl-3 pt-2 pb-2">DAFTAR REQUEST</h4>
</v-layout>
<v-divider></v-divider>
</v-card>
</v-flex>
</v-layout>
<v-layout row>
<v-flex xs12 pt-1 pb-2>
<v-data-table
class="v-table elevation-1 with-vertical-lines"
hide-actions
:items="purchaseList"
:headers="headers"
>
<template v-slot:items="props">
<td class="table-cell text-xs-left"style="height: 42px">
{{ props.item.PurchaseRequestDirectNumber }}
</td>
<td class="table-cell text-xs-left"
style="height: 42px"
>
{{ props.item.user_request }}
</td>
<td class="table-cell text-xs-left"
style="height: 42px"
>
{{ props.item.PurchaseRequestDirectDescription }}
</td>
<td class="table-cell text-xs-left"
style="height: 42px"
>
Rp {{ props.item.PurchaseRequestDirectTotalRealitation.toString().replace(
/\B(?=(\d{3})+(?!\d))/g,
"."
) }}
</td>
<td class="table-cell text-xs-center" style="height: 42px">
<v-btn
dark
@click="addPurchase(props.item)"
v-if="purchaseExist(props.item)"
style="min-width: 25px; height: 30px"
small
color="info"
>
<v-icon style="cursor: pointer; font-size: 18px">
add_box
</v-icon>
</v-btn>
<v-btn
dark
v-if="!purchaseExist(props.item)"
@click="removePurchase(props.item)"
style="min-width: 25px; height: 30px"
small
color="red"
>
<v-icon style="cursor: pointer; font-size: 18px">
delete
</v-icon>
</v-btn>
</td>
</template>
<template v-slot:footer>
<tr>
<td colspan="3" class="font-weight-bold pa-2">TOTAL</td>
<td class="text-xs-right pa-2 font-weight-bold">
Rp {{ resume.totalRealitation.toString().replace(
/\B(?=(\d{3})+(?!\d))/g,
"."
) }}
</td>
</tr>
</template>
</v-data-table>
</v-flex>
</v-layout>
</v-flex>
<!-- end listing -->
</v-layout>
</v-card-text>
<v-divider></v-divider>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="error" flat @click="closeDiallogVoucher()"> Tutup </v-btn>
<v-btn v-if="xact === 'new'" color="primary" dark @click="saveVoucher()">Simpan</v-btn>
<v-btn v-if="xact === 'edit'" color="primary" dark @click="updateVoucher()">Simpan Perubahan</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</v-layout>
</template>
<script>
module.exports = {
name: "DialogFormVoucher",
data() {
return {
headers: [
{
text: "NO",
align: "left",
sortable: false,
value: "no",
width: "10%",
class: "blue lighten-3 white--text",
},
{
text: "USER REQUEST",
align: "left",
sortable: false,
value: "user",
width: "15%",
class: "blue lighten-3 white--text",
},
{
text: "DESKRIPSI",
align: "left",
sortable: false,
value: "date",
width: "35%",
class: "blue lighten-3 white--text",
},
{
text: "TOTAL REALISASI",
align: "left",
sortable: false,
value: "supplier",
width: "25%",
class: "blue lighten-3 white--text",
},
{
text: "AKSI",
align: "left",
sortable: false,
value: "status",
width: "15%",
class: "blue lighten-3 white--text",
},
],
};
},
mounted() {
this.$store.dispatch("voucher/searchBranch", this.search_branch);
this.$store.dispatch("voucher/searchAccDana", this.search_accountDana);
this.$store.dispatch("voucher/searchAccBiaya", this.search_accountBiaya);
this.$store.dispatch("voucher/searchAccTemp", this.search_accountTemp);
},
computed: {
dialogVoucher: {
get() {
return this.$store.state.voucher.dialog_voucher;
},
set(val) {
this.$store.commit("voucher/update_dialog_voucher", val);
},
},
branchList() {
return this.$store.state.voucher.branchList;
},
selectedBranch: {
get() {
return this.$store.state.voucher.selected_branch;
},
set(val) {
this.$store.commit("voucher/update_selected_branch", val);
this.getPurchaseReq();
},
},
search_branch: {
get() {
return this.$store.state.voucher.search_branch;
},
set(val) {
this.$store.commit("voucher/update_search_branch", val);
},
},
accountDanaList() {
return this.$store.state.voucher.accountDanaList;
},
selectedAccountDana: {
get() {
return this.$store.state.voucher.selected_accountDana;
},
set(val) {
this.$store.commit("voucher/update_selected_accountDana", val);
},
},
search_accountDana: {
get() {
return this.$store.state.voucher.search_accountDana;
},
set(val) {
this.$store.commit("voucher/update_search_accountDana", val);
},
},
accountBiayaList() {
return this.$store.state.voucher.accountBiayaList;
},
selectedAccountBiaya: {
get() {
return this.$store.state.voucher.selected_accountBiaya;
},
set(val) {
this.$store.commit("voucher/update_selected_accountBiaya", val);
},
},
search_accountBiaya: {
get() {
return this.$store.state.voucher.search_accountBiaya;
},
set(val) {
this.$store.commit("voucher/update_search_accountBiaya", val);
},
},
accountTempList() {
return this.$store.state.voucher.accountTempList;
},
selectedAccountTemp: {
get() {
return this.$store.state.voucher.selected_accountTemp;
},
set(val) {
this.$store.commit("voucher/update_selected_accountTemp", val);
},
},
search_accountTemp: {
get() {
return this.$store.state.voucher.search_accountTemp;
},
set(val) {
this.$store.commit("voucher/update_search_accountTemp", val);
},
},
purchaseList() {
return this.$store.state.voucher.purchaseList;
},
selected_purchase: {
get() {
return this.$store.state.voucher.selected_purchase;
},
set(val) {
this.$store.commit("voucher/update_selected_purchase", val);
},
},
resume() {
return this.$store.state.voucher.resume_total;
},
xact: {
get() {
return this.$store.state.voucher.act;
},
set(val) {
this.$store.commit("voucher/update_act", val);
},
},
},
methods: {
convertMoney(money){
return one_money(money)
},
thr_search_branch: _.debounce(function() {
this.$store.dispatch("voucher/searchBranch", this.search_branch);
}, 500),
thr_search_accountDana: _.debounce(function() {
this.$store.dispatch("voucher/searchAccDana", this.search_accountDana);
}, 500),
thr_search_accountBiaya: _.debounce(function() {
this.$store.dispatch("voucher/searchAccBiaya", this.search_accountBiaya);
}, 500),
thr_search_accountTemp: _.debounce(function() {
this.$store.dispatch("voucher/searchAccTemp", this.search_accountTemp);
}, 500),
getPurchaseReq() {
this.$store.dispatch("voucher/getPurchase", this.selectedBranch === undefined ? "" : this.selectedBranch.M_BranchCode);
},
formatCurrency(val) {
// Format the price above to USD using the locale, style, and currency.
let price = parseFloat(val);
let USDollar = new Intl.NumberFormat("id-ID", {
style: "currency",
currency: "IDR",
});
// console.log(
// `The formated version of ${price} is ${USDollar.format(price)}`
// );
return `${USDollar.format(price)}`;
},
addPurchase(item) {
let selected_purchase = this.$store.state.voucher.selected_purchase;
selected_purchase.push(item);
let totalRealitation = 0;
for (let i = 0; i < selected_purchase.length; i++) {
const e = selected_purchase[i];
totalRealitation += parseFloat(e.PurchaseRequestDirectTotalRealitation);
}
let xresume = {
"totalRealitation": totalRealitation,
};
this.$store.commit("voucher/update_resume_total", xresume);
},
purchaseExist(item) {
let selected_purchase = this.$store.state.voucher.selected_purchase;
let found = selected_purchase.find((el) => el.PurchaseRequestDirectID === item.PurchaseRequestDirectID);
if (found) {
return false;
}
return true;
},
removePurchase(item) {
let selected_purchase = this.$store.state.voucher.selected_purchase;
let found = selected_purchase.find((el) => el.PurchaseRequestDirectID === item.PurchaseRequestDirectID);
if (found) {
let index = selected_purchase.indexOf(found);
selected_purchase.splice(index, 1);
}
let totalRealitation = 0;
for (let i = 0; i < selected_purchase.length; i++) {
const e = selected_purchase[i];
totalRealitation += parseFloat(e.PurchaseRequestDirectTotalRealitation);
}
let xresume = {
"totalRealitation": totalRealitation,
};
this.$store.commit("voucher/update_resume_total", xresume);
},
checkErrorForm(val) {
let errors = this.$store.state.voucher.errors;
if (errors.includes(val)) {
return true;
} else {
return false;
}
},
closeDiallogVoucher() {
this.dialogVoucher = false;
this.$store.commit("voucher/update_selected_branch", {});
this.$store.commit("voucher/update_selected_accountDana", {});
this.$store.commit("voucher/update_selected_accountBiaya", {});
this.$store.commit("voucher/update_selected_accountTemp", {});
this.$store.commit("voucher/update_selected_purchase", []);
this.$store.commit("voucher/update_purchaseList", []);
this.$store.commit("voucher/update_resume_total", {"totalRealitation": 0});
this.$store.commit("voucher/update_errors", []);
},
saveVoucher() {
this.$store.commit("voucher/update_errors", []);
var errors = this.$store.state.voucher.errors;
if (_.isEmpty(this.selectedBranch)) {
errors.push("requireBranch");
}
if (_.isEmpty(this.selectedAccountDana)) {
errors.push("requireAccountDana");
}
// if (_.isEmpty(this.selectedAccountBiaya)) {
// errors.push("requireAccountBiaya");
// }
if (_.isEmpty(this.selectedAccountTemp)) {
errors.push("requireAccountTemp");
}
if (errors.length === 0) {
let prm = {
"branch": this.selectedBranch.M_BranchCode,
"accountDana": this.selectedAccountDana.coaID,
"accountBiaya": this.selectedAccountBiaya.coaID,
"accountTemp": this.selectedAccountTemp.coaID,
"total": this.$store.state.voucher.resume_total.totalRealitation,
"details": this.$store.state.voucher.selected_purchase,
};
this.$store.dispatch("voucher/save", prm);
}
},
updateVoucher() {
this.$store.commit("voucher/update_errors", []);
var errors = this.$store.state.voucher.errors;
if (_.isEmpty(this.selectedBranch)) {
errors.push("requireBranch");
}
if (_.isEmpty(this.selectedAccountDana)) {
errors.push("requireAccountDana");
}
// if (_.isEmpty(this.selectedAccountBiaya)) {
// errors.push("requireAccountBiaya");
// }
if (_.isEmpty(this.selectedAccountTemp)) {
errors.push("requireAccountTemp");
}
if (errors.length === 0) {
let prm = {
"voucherID": this.$store.state.voucher.selected_voucher.PaymentVoucherID,
"branch": this.selectedBranch.M_BranchCode,
"accountDana": this.selectedAccountDana.coaID,
"accountBiaya": this.selectedAccountBiaya.coaID,
"accountTemp": this.selectedAccountTemp.coaID,
"total": this.$store.state.voucher.resume_total.totalRealitation,
"details": this.$store.state.voucher.selected_purchase,
};
this.$store.dispatch("voucher/update", prm);
}
},
},
watch: {
search_branch(val, old) {
if (val == old) return;
if (!val) return;
if (val.length < 1) return;
if (this.$store.state.voucher.load_status_branch == 1) return;
this.thr_search_branch();
},
search_accountDana(val, old) {
if (val == old) return;
if (!val) return;
if (val.length < 1) return;
if (this.$store.state.voucher.load_status_accDana == 1) return;
this.thr_search_accountDana();
},
search_accountBiaya(val, old) {
if (val == old) return;
if (!val) return;
if (val.length < 1) return;
if (this.$store.state.voucher.load_status_accBiaya == 1) return;
this.thr_search_accountBiaya();
},
search_accountTemp(val, old) {
if (val == old) return;
if (!val) return;
if (val.length < 1) return;
if (this.$store.state.voucher.load_status_accTemp == 1) return;
this.thr_search_accountTemp();
},
},
}
</script>

View File

@@ -0,0 +1,590 @@
<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 -->
<v-layout row wrap>
<v-flex xs12 fill-height pa-1>
<v-toolbar color="primary" dark>
<v-toolbar-title class="white--text"
>PAYMENT VOUCHER</v-toolbar-title
>
<v-spacer></v-spacer>
<v-btn icon @click="openDialogVoucher()">
<v-icon>add_box</v-icon>
</v-btn>
</v-toolbar>
<v-card class="pa-2">
<v-layout>
<v-flex xs6 pl-2>
<v-menu
v-model="menuStartDate"
:close-on-content-click="false"
transition="scale-transition"
:nudge-right="40"
lazy
offset-y
max-width="290px"
min-width="290px"
>
<template v-slot:activator="{ on }">
<v-text-field
v-model="startDateFormatted"
label="Tanggal Awal"
readonly
style="max-width: 250px"
outline
hide-details
v-on="on"
@blur="dStartDate = deFormatedDate(startDateFormatted)"
></v-text-field>
</template>
<v-date-picker
no-title
v-model="xStartDate"
@input="menuStartDate = false"
></v-date-picker>
</v-menu>
</v-flex>
<v-flex xs6 pl-2>
<v-menu
v-model="menuEndDate"
:close-on-content-click="false"
transition="scale-transition"
:nudge-right="40"
lazy
offset-y
max-width="290px"
min-width="290px"
>
<template v-slot:activator="{ on }">
<v-text-field
v-model="endDateFormatted"
label="Tanggal Akhir"
readonly
style="max-width: 250px"
outline
hide-details
v-on="on"
@blur="dEndDate = deFormatedDate(endDateFormatted)"
></v-text-field>
</template>
<v-date-picker
no-title
v-model="xEndDate"
@input="menuEndDate = false"
></v-date-picker>
</v-menu>
</v-flex>
<v-flex xs6 pl-2>
<v-autocomplete
return-object
item-text="text"
label="Status"
:items="statusOptions"
v-model="selected_status"
outline
hide-details
></v-autocomplete>
</v-flex>
<v-flex xs6 pl-2>
<v-text-field
label="Cari..."
placeholder="NO."
outline
hide-details
v-model="xsearch"
></v-text-field>
</v-flex>
<v-flex pl-2 pr-2>
<v-btn
dark
color="primary"
style="min-width: 50px; height: 50px; margin: 0"
@click="mainTableSearch()"
>
<v-icon>search</v-icon>
</v-btn>
</v-flex>
</v-layout>
</v-card>
<v-card class="pa-2 mt-2">
<v-layout row wrap>
<v-flex xs12 pl-2>
<div>
<span>Ada approved : </span>
<span>{{ totalApproved }}</span>
</div>
</v-flex>
</v-layout>
<v-layout row style="max-height: 600px; overflow: auto">
<v-flex xs12 pl-2 pr-2 pt-2 pb-2>
<v-data-table
:items="xvoucehrList"
:headers="headers"
: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)"
>
<p class="mb-0 font-weight-bold" style="color:#000000">{{ props.item.PaymentVoucherNumber }}</p>
<p class="mb-0 info--text mono font-weight-bold caption">{{ formatDateHeader(props.item.PaymentVoucherDate) }}</p>
</td>
<td
class="text-xs-left pa-2"
v-bind:class="{ 'amber lighten-4': isSelected(props.item) }"
@click="selectMe(props.item)"
>
<p class="mb-0">{{ props.item.M_BranchName }}</p>
<p class="mb-0 font-weight-bold" style="color:#000000">Total : Rp {{ props.item.PaymentVoucherTotal.toString().replace(
/\B(?=(\d{3})+(?!\d))/g,
"."
) }}</p>
</td>
<td
class="text-xs-left pa-2"
v-bind:class="{ 'amber lighten-4': isSelected(props.item) }"
@click="selectMe(props.item)"
>{{ formatDateHeader(props.item.PaymentVoucherRealitationDate) }}</td>
<td
class="text-xs-center pa-2"
v-bind:class="{ 'amber lighten-4': isSelected(props.item) }"
@click="selectMe(props.item)"
>
<!-- :text-color="props.item.PaymentVoucherStatus === 'Draft' ? 'black' : 'white'" -->
<v-chip
small
:color="getChipStatusColor(props.item.PaymentVoucherStatus)">
{{ props.item.PaymentVoucherStatus }}
</v-chip>
</td>
<template v-if="props.item.PaymentVoucherStatus == 'Draft'">
<td class="text-xs-center pa-2"
v-bind:class="{ 'amber lighten-4': isSelected(props.item) }"
@click="selectMe(props.item)"
>
<v-icon small @click="openUpdateVoucher(props.item)"
>edit</v-icon
>
<v-icon small @click="deleteVoucher(props.item)"
>delete</v-icon
>
</td>
</template>
<template v-else>
<td
class="text-xs-center pa-2"
v-bind:class="{
'amber lighten-4': isSelected(props.item),
}"
></td>
</template>
</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>
</v-flex>
</v-layout>
<dialog-form-voucher></dialog-form-voucher>
<one-dialog-alert
:status="dialogAlertDelete"
:msg="msgAlertDelete"
@forget-dialog-alert="dialogAlertDelete = false"
@close-dialog-alert="closeAndDelete()"
></one-dialog-alert>
</div>
</template>
<style scoped>
.date-type-table {
display: flex;
flex-direction: column;
gap: 0.5rem;
}
.table.v-table tbody td,
table.v-table tbody th {
height: 40px;
}
.table.v-table thead tr {
height: 40px;
}
.scroll-container {
scroll-padding: 50px 0 0 50px;
}
</style>
<script>
module.exports = {
components: {
"dialog-form-voucher": httpVueLoader("./dialogFormVoucher.vue"),
"one-dialog-alert": httpVueLoader("../../common/oneDialogAlert.vue"),
"one-dialog-error": httpVueLoader("../../common/oneDialogError.vue")
},
data() {
return {
msgAlertDelete: "",
dialogAlertDelete: false,
xPVID: 0,
xPVNumber: "",
headers: [
{
text: "NO / TANGGAL",
align: "left",
sortable: false,
value: "no",
width: "25%",
class: "blue lighten-3 white--text",
},
{
text: "PENERIMA",
align: "left",
sortable: false,
value: "supplier",
width: "30%",
class: "blue lighten-3 white--text",
},
{
text: "TANGGAL REALISASI",
align: "left",
sortable: false,
value: "total",
width: "15%",
class: "blue lighten-3 white--text",
},
{
text: "STATUS",
align: "left",
sortable: false,
value: "status",
width: "15%",
class: "blue lighten-3 white--text",
},
{
text: "AKSI",
align: "left",
sortable: false,
value: "status",
width: "15%",
class: "blue lighten-3 white--text",
},
],
}
},
mounted() {
this.$store.dispatch("voucher/search");
this.$store.dispatch("voucher/getTotalApproved");
},
computed: {
statusOptions() {
return this.$store.state.voucher.status_options;
},
selected_status: {
get() {
return this.$store.state.voucher.selected_status;
},
set(val) {
this.$store.commit("voucher/update_selected_status", val);
this.mainTableSearch();
},
},
menuStartDate: {
get() {
return this.$store.state.voucher.menuStartDate;
},
set(val) {
this.$store.commit("voucher/update_menuStartDate", val);
},
},
menuEndDate: {
get() {
return this.$store.state.voucher.menuEndDate;
},
set(val) {
this.$store.commit("voucher/update_menuEndDate", val);
},
},
startDateFormatted() {
return this.formatDate(this.xStartDate);
},
endDateFormatted() {
return this.formatDate(this.xEndDate);
},
xStartDate: {
get() {
return this.$store.state.voucher.xStartDate;
},
set(val) {
this.$store.commit("voucher/update_xStartDate", val);
},
},
xEndDate: {
get() {
return this.$store.state.voucher.xEndDate;
},
set(val) {
this.$store.commit("voucher/update_xEndDate", val);
},
},
dEndDate: {
get() {
return this.$store.state.voucher.dEndDate;
},
set(val) {
this.$store.commit("voucher/update_dEndDate", val);
},
},
dStartDate: {
get() {
return this.$store.state.voucher.dStartDate;
},
set(val) {
this.$store.commit("voucher/update_dStartDate", val);
},
},
xvoucehrList() {
return this.$store.state.voucher.voucherList;
},
curr_page: {
get() {
return this.$store.state.voucher.currentPage;
},
set(val) {
this.$store.commit("voucher/update_currentPage", val);
this.mainTableSearch();
},
},
xtotal_page: {
get() {
return this.$store.state.voucher.total_page_voucher;
},
set(val) {
this.$store.commit("voucher/update_total_page_voucher", val);
},
},
xsearch: {
get() {
return this.$store.state.voucher.xsearch;
},
set(val) {
this.$store.commit("voucher/update_xsearch", val);
},
},
isLoading() {
return this.$store.state.voucher.search_status === 1;
},
msgSnackbar() {
return this.$store.state.voucher.success_message;
},
snackbar: {
get() {
return this.$store.state.voucher.alert_success;
},
set(val) {
this.$store.commit("voucher/update_alert_success", val);
},
},
dialog_error: {
get() {
return this.$store.state.voucher.alert_error;
},
set(val) {
this.$store.commit("voucher/update_alert_error", val);
},
},
msgError() {
return this.$store.state.voucher.error_message;
},
totalApproved() {
return this.$store.state.voucher.totalApproved
}
},
methods: {
convertMoney(money){
return one_money(money)
},
isSelected(o) {
return o.PaymentVoucherID == this.$store.state.voucher.selected_voucher.PaymentVoucherID;
},
selectMe(sc) {
this.$store.commit("voucher/update_selected_voucher", sc);
this.$store.dispatch("voucher/searchdetail", sc.PaymentVoucherID)
},
openDialogVoucher() {
this.$store.commit("voucher/update_dialog_voucher", true);
this.$store.commit("voucher/update_act", "new");
this.$store.commit("voucher/update_selected_branch", {});
this.$store.commit("voucher/update_branchList", []);
this.$store.commit("voucher/update_selected_accountDana", {});
this.$store.commit("voucher/update_accountDanaList", []);
this.$store.commit("voucher/update_selected_accountBiaya", {});
this.$store.commit("voucher/update_accountBiayaList", []);
this.$store.commit("voucher/update_selected_accountTemp", {});
this.$store.commit("voucher/update_accountTempList", []);
this.$store.commit("voucher/update_selected_purchase", []);
this.$store.commit("voucher/update_purchaseList", []);
this.$store.commit("voucher/update_resume_total", {"totalRealitation": 0});
},
formatDate(date) {
if (!date) return null;
const [year, month, day] = date.split("-");
return `${day}-${month}-${year}`;
},
formatDateHeader(date) {
if (!date) return null;
const cleanDate = date.split(" ")[0];
const [year, month, day] = cleanDate.split("-");
return `${day}-${month}-${year}`;
},
deFormatedDate(date) {
if (!date) return null;
const [day, month, year] = date.split("-");
return `${year}-${month.padStart(2, "0")}-${day.padStart(2, "0")}`;
},
getChipStatusColor(status) {
switch (status) {
case "Realitation":
return "warning";
case "Paid":
return "success";
case "Partial":
return "warning";
case "Completed":
return "success";
default:
return "";
}
},
mainTableSearch() {
this.$store.dispatch("voucher/search");
},
thr_searchDate: _.debounce(function () {
this.$store.dispatch("voucher/search")
}, 1000),
thr_search: _.debounce(function () {
this.$store.dispatch("voucher/search")
}, 1000),
deleteVoucher(data) {
this.xPVID = data.PaymentVoucherID;
this.xPVNumber = data.PaymentVoucherNumber;
this.msgAlertDelete = `Yakin, mau hapus Payment Voucher [${data.PaymentVoucherNumber}] ?`;
this.dialogAlertDelete = true;
},
closeAndDelete() {
this.$store.dispatch("voucher/delete", {
PVID: this.xPVID,
PVNumber: this.xPVNumber
});
this.dialogAlertDelete = false
},
openUpdateVoucher(data) {
this.$store.commit("voucher/update_act", "edit");
this.$store.commit("voucher/update_dialog_voucher", true);
this.$store.commit("voucher/update_branchList", [{
M_BranchCode: data.M_BranchCode,
M_BranchName: data.M_BranchName
}])
this.$store.commit("voucher/update_selected_branch", {
M_BranchCode: data.M_BranchCode,
M_BranchName: data.M_BranchName
})
// source
this.$store.commit("voucher/update_accountDanaList", [{
coaID: data.PaymentVoucherCoaSourceID,
coaDescription: data.coaDescriptionSource
}])
this.$store.commit("voucher/update_selected_accountDana", {
coaID: data.PaymentVoucherCoaSourceID,
coaDescription: data.coaDescriptionSource
})
// expense
this.$store.commit("voucher/update_accountBiayaList", [{
coaID: data.PaymentVoucherCoaSourceID,
coaDescription: data.coaDescriptionExpense
}])
this.$store.commit("voucher/update_selected_accountBiaya", {
coaID: data.PaymentVoucherCoaSourceID,
coaDescription: data.coaDescriptionExpense
})
//
this.$store.commit("voucher/update_accountTempList", [{
coaID: data.PaymentVoucherCoaTemporaryID,
coaDescription: data.coaDescriptionTemporary
}])
this.$store.commit("voucher/update_selected_accountTemp", {
coaID: data.PaymentVoucherCoaTemporaryID,
coaDescription: data.coaDescriptionTemporary
})
this.$store.dispatch("voucher/getPurchaseUpdateNew", {"branchcode": this.$store.state.voucher.selected_branch.M_BranchCode, "voucherID": data.PaymentVoucherID});
this.$store.commit("voucher/update_selected_purchase", this.$store.state.voucher.details);
this.$store.commit("voucher/update_resume_total", {"totalRealitation": data.PaymentVoucherTotal} );
}
},
watch: {
xStartDate(val, old) {
this.xStartDate = val;
this.thr_searchDate();
},
xEndDate(val, old) {
this.xEndDate = val;
this.thr_searchDate();
},
xsearch(val, old) {
this.xsearch = val;
this.thr_search();
},
}
}
</script>

View File

@@ -0,0 +1,259 @@
<template>
<div style="width: 100%;">
<v-layout row wrap>
<v-flex xs12 fill-height pa-1>
<v-card>
<v-card-text>
<v-layout row wrap>
<v-flex xs12>
<v-layout row wrap>
<v-flex xs11>
<v-layout row wrap>
<v-flex xs12>
<div>
<span>No : </span>
<span>{{
selected_voucher.PaymentVoucherNumber
}}</span>
</div>
</v-flex>
<v-flex xs12>
<div>
<span>Sumber Dana : </span>
<span>{{
selected_voucher.coaDescriptionSource
}}</span>
</div>
</v-flex>
<!-- <v-flex xs12>
<div>
<span>Biaya : </span>
<span>{{
selected_voucher.coaDescriptionExpense
}}</span>
</div>
</v-flex> -->
<v-flex xs12>
<div>
<span>Tampungan Sementara : </span>
<span>{{
selected_voucher.coaDescriptionTemporary
}}</span>
</div>
</v-flex>
</v-layout>
</v-flex>
<!-- <v-flex xs1>
<v-btn
color="primary"
flat
icon
@click="openDialogDetail()"
>
<v-icon>add_box</v-icon>
</v-btn>
</v-flex> -->
</v-layout>
</v-flex>
<v-flex xs12 pt-2 pb-2>
<v-layout row wrap>
<v-flex xs12>
<v-data-table
:headers="headers"
:items="xdetails"
:loading="isLoading"
hide-actions
class="elevation-1"
>
<template slot="items" slot-scope="props">
<td class="text-xs-center pa-2">
{{ props.item.RowNumber }}
</td>
<td class="text-xs-left pa-2">
{{ props.item.PurchaseRequestDirectNumber }}
</td>
<td class="text-xs-left pa-2">
Rp
{{
props.item.PaymentVoucherDetailTotal.toString().replace(
/\B(?=(\d{3})+(?!\d))/g,
"."
)
}}
</td>
<td>
<v-btn
style="min-width: 25px; height: 25px; margin: 0;" outline
small @click="openAccountDialog(props.item)" color="blue lighten-2"
>
<v-icon small color="blue">edit</v-icon>
</v-btn>
</td>
</template>
</v-data-table>
</v-flex>
</v-layout>
</v-flex>
<!-- <v-flex xs12 v-show="xdetails.length > 0">
<v-btn
@click="simpanKasir()"
>
Simpan
</v-btn>
</v-flex> -->
</v-layout>
</v-card-text>
</v-card>
</v-flex>
</v-layout>
<dialog-account-item></dialog-account-item>
</div>
</template>
<style scoped>
.date-type-table {
display: flex;
flex-direction: column;
gap: 0.5rem;
}
.table.v-table tbody td,
table.v-table tbody th {
height: 40px;
}
.table.v-table thead tr {
height: 40px;
}
.scroll-container {
scroll-padding: 50px 0 0 50px;
}
</style>
<script>
module.exports = {
components: {
'dialog-account-item': httpVueLoader('./dialogAccountItem.vue')
},
data() {
return {
headers: [
{
text: "NO",
align: "left",
sortable: false,
value: "no",
width: "10%",
class: "blue lighten-3 white--text",
},
{
text: "NO REQUEST",
align: "left",
sortable: false,
value: "request",
width: "45%",
class: "blue lighten-3 white--text",
},
{
text: "TOTAL",
align: "left",
sortable: false,
value: "total",
width: "40%",
class: "blue lighten-3 white--text",
},
{
text: "AKSI",
align: "left",
sortable: false,
value: "total",
width: "5%",
class: "blue lighten-3 white--text",
},
],
}
},
mounted() {
},
computed: {
xdetails() {
return this.$store.state.voucher.details;
},
isLoading() {
return this.$store.state.voucher.search_status_detail === 1;
},
selected_voucher: {
get() {
return this.$store.state.voucher.selected_voucher;
},
set(val) {
this.$store.commit("voucher/update_selected_voucher", val);
},
},
dialog_account_item: {
get() {
return this.$store.state.voucher.dialog_account_item;
},
set(val) {
this.$store.commit("voucher/update_dialog_account_item", val)
}
},
list_voucher_detail: {
get() {
return this.$store.state.voucher.list_voucher_detail;
},
set(val) {
this.$store.commit("voucher/update_list_voucher_detail", val)
}
},
list_accitem: {
get() {
return this.$store.state.voucher.list_accitem;
},
set(val) {
this.$store.commit("voucher/update_list_accitem", val)
}
}
},
methods: {
convertMoney(money){
return one_money(money)
},
async openAccountDialog(data) {
await this.$store.dispatch("voucher/getVoucherDetailItem", {
PRDirectID: data.PaymentVoucherDetailPurchaseRequestDirectID
})
this.$store.dispatch("voucher/searchAccountItem", {search: ''})
this.dialog_account_item = true
},
simpanKasir() {
let details = this.xdetails
let isIncomplete = false
let message = 'Acoount item belum terisi pada : '
details.forEach(element => {
if (element.PurchaseRequestDirectAccountFilled == 'N') {
message = message + element.PurchaseRequestDirectNumber
isIncomplete = true
}
});
if (isIncomplete) {
this.$store.commit("voucher/update_alert_error", true);
this.$store.commit("voucher/update_error_message", message);
return
}
this.$store.dispatch("voucher/moveTokasir")
}
},
watch: {
}
}
</script>