add modules folder based on s_menu
This commit is contained in:
20
test/vuex/one-accone-list-task/api/approve.js
Normal file
20
test/vuex/one-accone-list-task/api/approve.js
Normal file
@@ -0,0 +1,20 @@
|
||||
const URL = "/one-api/mockup/approvalall/Tasklist/";
|
||||
|
||||
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
|
||||
};
|
||||
}
|
||||
}
|
||||
185
test/vuex/one-accone-list-task/components/oneApproveListData.vue
Normal file
185
test/vuex/one-accone-list-task/components/oneApproveListData.vue
Normal file
@@ -0,0 +1,185 @@
|
||||
<template>
|
||||
<div>
|
||||
<!-- main layout -->
|
||||
<v-toolbar color="primary" dark>
|
||||
<v-toolbar-title class="white--text"
|
||||
>DAFTAR TUGAS KEUANGAN</v-toolbar-title
|
||||
>
|
||||
<v-spacer></v-spacer>
|
||||
</v-toolbar>
|
||||
<v-card class="pa-2 mt-2">
|
||||
<div>
|
||||
<v-data-table
|
||||
:headers="headers"
|
||||
:items="listdata"
|
||||
:loading="loading"
|
||||
hide-actions
|
||||
class="elevation-1"
|
||||
>
|
||||
<template v-slot:items="props">
|
||||
<td class="text-xs-center">{{ props.item.type }}</td>
|
||||
<td class="text-xs-center">Jumlah pending bayar : <span class="font-weight-bold">{{ props.item.total }}</span></td>
|
||||
<td class="text-xs-center">{{ props.item.number }}</td>
|
||||
<td class="text-xs-center">{{ deFormatedDate(props.item.date) }}</td>
|
||||
<td class="text-xs-center">
|
||||
<v-btn color="blue" @click="openPaid(props.item)" title="Menuju ke halaman bayar" dark>Bayar
|
||||
<v-icon dark right>forward</v-icon>
|
||||
</v-btn>
|
||||
</td>
|
||||
</template>
|
||||
</v-data-table>
|
||||
</div>
|
||||
</v-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.date-type-table {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
.flex-items-center {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.25rem;
|
||||
}
|
||||
|
||||
.table.v-table tbody td,
|
||||
.table.v-table tbody tr {
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
.table.v-table thead tr {
|
||||
height: 40px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
menuSelectedDate: false,
|
||||
menuSelectedEndDate: false,
|
||||
headers: [
|
||||
{
|
||||
text: "TIPE",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
value: "no",
|
||||
width: "20%",
|
||||
class: "blue lighten-3 white--text",
|
||||
},
|
||||
{
|
||||
text: "JUMLAH TRANSAKSI",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
value: "no",
|
||||
width: "20%",
|
||||
class: "blue lighten-3 white--text",
|
||||
},
|
||||
{
|
||||
text: "INFO NUMBER",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
value: "no",
|
||||
width: "30%",
|
||||
class: "blue lighten-3 white--text",
|
||||
},
|
||||
{
|
||||
text: "TANGGAL",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
value: "no",
|
||||
width: "15%",
|
||||
class: "blue lighten-3 white--text",
|
||||
},
|
||||
{
|
||||
text: "AKSI",
|
||||
align: "center",
|
||||
sortable: false,
|
||||
value: "action",
|
||||
width: "15%",
|
||||
class: "blue lighten-3 white--text",
|
||||
},
|
||||
]
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.$store.dispatch("approve/search")
|
||||
},
|
||||
computed: {
|
||||
listdata() {
|
||||
return this.$store.state.approve.listdata;
|
||||
},
|
||||
loading: {
|
||||
get() {
|
||||
return this.$store.state.approve.loading;
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("approve/update_loading", val);
|
||||
},
|
||||
},
|
||||
current_page: {
|
||||
get() {
|
||||
return this.$store.state.approve.current_page;
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("approve/update_current_page", val);
|
||||
},
|
||||
},
|
||||
total_page: {
|
||||
get() {
|
||||
return this.$store.state.approve.total_page;
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("approve/update_total_page", val);
|
||||
},
|
||||
},
|
||||
xsearch: {
|
||||
get() {
|
||||
return this.$store.state.approve.xsearch;
|
||||
},
|
||||
set(val) {
|
||||
this.$store.commit("approve/update_xsearch", val);
|
||||
},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// isSelected(p) {
|
||||
// return (
|
||||
// p.PurchaseRequestDirectNumber ==
|
||||
// this.$store.state.prkacab.selectedMainTable
|
||||
// .PurchaseRequestDirectNumber
|
||||
// );
|
||||
// },
|
||||
formatDate(date) {
|
||||
if (!date) return null;
|
||||
|
||||
const [year, month, day] = date.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")}`;
|
||||
},
|
||||
openPaid(val) {
|
||||
let status = val.status;
|
||||
let date = val.date
|
||||
|
||||
if (val.flag === 'p') {
|
||||
location.href = "/one-ui/test/vuex/acc-one-cashier-v2/" + "?status=" + status + "&startdate=" + date
|
||||
} else if (val.flag === 'pc') {
|
||||
location.href = "/one-ui/test/vuex/acc-one-supplier-payment-cashier-v3/" + "?status=" + status + "&startdate=" + date
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
||||
},
|
||||
};
|
||||
</script>
|
||||
73
test/vuex/one-accone-list-task/index.php
Normal file
73
test/vuex/one-accone-list-task/index.php
Normal file
@@ -0,0 +1,73 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<title>One</title>
|
||||
<link rel="stylesheet" href="../../../libs/vendor/css/google-fonts.css">
|
||||
<link rel="stylesheet" href="../../../libs/vendor/css/vuetify.min.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div v-cloak id="app">
|
||||
<v-app id="smartApp">
|
||||
<one-navbar></one-navbar>
|
||||
<v-content class="blue lighten-5">
|
||||
<v-container fluid fill-height class="pl-1 pr-1 pt-2 pb-2">
|
||||
<v-layout row wrap>
|
||||
<v-flex xs12 class="center" fill-height pa-1>
|
||||
<!-- komponen kiri -->
|
||||
<one-approve-list></one-approve-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 -->
|
||||
<?php
|
||||
$ts = "?ts=" . Date("ymdhis");
|
||||
?>
|
||||
<script type="module">
|
||||
import {
|
||||
store
|
||||
} from './store.js<?php echo $ts ?>';
|
||||
//for testing
|
||||
window.store = store;
|
||||
new Vue({
|
||||
store,
|
||||
el: '#app',
|
||||
components: {
|
||||
'one-navbar': httpVueLoader('../../../apps/components/oneNavbarComponent.vue'),
|
||||
'one-footer': httpVueLoader('../../../apps/components/oneFooter.vue'),
|
||||
'one-approve-list': httpVueLoader('./components/oneApproveListData.vue')
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<style>
|
||||
[v-cloak] {
|
||||
display: none
|
||||
}
|
||||
|
||||
.left {}
|
||||
|
||||
.right {}
|
||||
</style>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
71
test/vuex/one-accone-list-task/modules/approve.js
Normal file
71
test/vuex/one-accone-list-task/modules/approve.js
Normal file
@@ -0,0 +1,71 @@
|
||||
// 1 => LOADING
|
||||
// 2 => DONE
|
||||
// 3 => ERROR
|
||||
import * as api from "../api/approve.js"
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
state: {
|
||||
lookup_search: 0,
|
||||
lookup_error_message: "",
|
||||
|
||||
listdata: [],
|
||||
selected_data: {},
|
||||
loading: false,
|
||||
total_page: 0,
|
||||
current_page: 1,
|
||||
xsearch: ""
|
||||
},
|
||||
mutations: {
|
||||
update_lookup_search(state, val) {
|
||||
state.lookup_search = val
|
||||
},
|
||||
update_lookup_error_message(state, val) {
|
||||
state.lookup_error_message = val
|
||||
},
|
||||
update_listdata(state, val) {
|
||||
state.listdata = val
|
||||
},
|
||||
update_selected_data(state, val) {
|
||||
state.selected_data = val
|
||||
},
|
||||
update_loading(state, val) {
|
||||
state.loading = val
|
||||
},
|
||||
update_total_page(state, val) {
|
||||
state.total_page = val
|
||||
},
|
||||
update_current_page(state, val) {
|
||||
state.current_page = val
|
||||
},
|
||||
update_xsearch(state, val) {
|
||||
state.xsearch = val
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
async search(context) {
|
||||
context.commit("update_loading", true);
|
||||
try {
|
||||
let prm = {
|
||||
token: one_token()
|
||||
}
|
||||
let resp = await api.search(prm)
|
||||
if (resp.status != "OK") {
|
||||
context.commit("update_lookup_search", 3)
|
||||
context.commit("update_lookup_error_message", resp.message)
|
||||
} else {
|
||||
context.commit("update_lookup_error_message", "")
|
||||
let data = {
|
||||
records: resp.data.records
|
||||
}
|
||||
context.commit("update_listdata", data.records)
|
||||
|
||||
context.commit("update_loading", false);
|
||||
}
|
||||
} catch (e) {
|
||||
context.commit("update_loading", false);
|
||||
context.commit("update_lookup_error_message", e.message)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
23
test/vuex/one-accone-list-task/store.js
Normal file
23
test/vuex/one-accone-list-task/store.js
Normal file
@@ -0,0 +1,23 @@
|
||||
// State
|
||||
// data ...
|
||||
// Mutations
|
||||
//
|
||||
//
|
||||
// Actions
|
||||
import approve from "./modules/approve.js";
|
||||
import system from "../../../apps/modules/system/system.js";
|
||||
export const store = new Vuex.Store({
|
||||
modules: {
|
||||
approve: approve,
|
||||
system:system
|
||||
},
|
||||
state: {
|
||||
|
||||
},
|
||||
mutations: {
|
||||
|
||||
},
|
||||
actions: {
|
||||
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user