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,39 @@
const URL = "/one-api/mockup/approvalall/Approvalallrequest/";
export async function listApprove(prm) {
try {
var resp = await axios.post(URL + 'listApprove', 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
};
}
}

View File

@@ -0,0 +1,190 @@
<template>
<v-layout>
<v-flex xs12>
<v-card class="scroll-container" style="/*max-height:645px;overflow: auto;*/">
<v-toolbar color="blue lighten-3" dark height="50px">
<v-toolbar-title>DAFTAR MENU APPROVE</v-toolbar-title>
<v-spacer></v-spacer>
</v-toolbar>
<div v-for="(vs, index) in approvelist">
<v-layout pa-2 v-if="isSelected(vs)" row>
<v-flex xs12 @click="selectMe(vs)">
<v-layout row>
<v-flex class="boxsolid" xs12>
<v-tooltip right>
<template v-slot:activator="{ on }">
<span v-html="subname(vs.menuname)" v-on="on"></span>
</template>
<span>{{ vs.name }}</span>
</v-tooltip>
</v-flex>
</v-layout>
</v-flex>
</v-layout>
<v-layout pa-2 v-if="!isSelected(vs)" row>
<v-flex xs12 @click="selectMe(vs)">
<v-layout row>
<v-flex class="boxoutline" xs12>
<v-tooltip right>
<template v-slot:activator="{ on }">
<span v-html="subname(vs.menuname)" v-on="on"></span>
</template>
<span>{{ vs.name }}</span>
</v-tooltip>
</v-flex>
</v-layout>
</v-flex>
</v-layout>
<v-divider></v-divider>
</div>
</v-card>
</v-flex>
</v-layout>
</template>
<style scoped>
.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;
}
.boxoutline {
color: red;
border: 1px solid red;
justify-content: center;
height: 45px;
line-height: 45px;
padding-left: 10px;
background: #ffffff;
font-size: 14px;
font-weight: 500;
border-radius: 1px
}
.boxoutline:hover {
background: rgba(0, 0, 0, 0.07) !important;
font-size: 15px;
font-weight: 700;
}
.boxsolid {
color: #ffffff;
border: 1px solid #ffffff;
justify-content: center;
height: 45px;
line-height: 45px;
padding-left: 10px;
background: #f44336;
font-size: 14px;
font-weight: 500;
border-radius: 1px
}
.boxsolid:hover {
background: #f44336de;
font-size: 15px;
font-weight: 700;
}
.scroll-container {
scroll-padding: 50px 0 0 50px;
}
::-webkit-scrollbar {
width: 7px;
}
/* this targets the default scrollbar (compulsory) */
::-webkit-scrollbar-track {
background-color: #73baf3;
}
/* the new scrollbar will have a flat appearance with the set background color */
::-webkit-scrollbar-thumb {
background-color: #2196f3;
}
/* this will style the thumb, ignoring the track */
::-webkit-scrollbar-button {
background-color: #0079da;
}
/* optionally, you can style the top and the bottom buttons (left and right for horizontal bars) */
::-webkit-scrollbar-corner {
background-color: black;
}
/* if both the vertical and the horizontal bars appear, then perhaps the right bottom corner also needs to be styled */
</style>
<script>
module.exports = {
data: () => ({
}),
mounted() {
this.$store.dispatch("approve/listApprove")
},
computed: {
approvelist() {
return this.$store.state.approve.approvelist
}
},
methods: {
isSelected(p) {
return p.S_MenuID == this.$store.state.approve.selected_menu.S_MenuID
},
selectMe(sc) {
this.$store.commit("approve/update_selected_menu", sc)
let url = '/' + sc.S_MenuUrl.replace(/^\/+/, '');
window.open(url, '_blank')
},
subname(name) {
var xname = name
if (xname.length > 18) {
xname = xname.substring(0, 18) + '...'
}
return xname
},
},
watch: {
}
}
</script>

View File

@@ -0,0 +1,204 @@
<template>
<div>
<!-- main layout -->
<v-toolbar color="primary" dark>
<v-toolbar-title class="white--text"
> {{ user.M_UserM_ApproveLevelID == '1' ? 'DAFTAR PENDING VERIFIKASI' : 'DAFTAR PENDING APPROVE'}} </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">{{ user.M_UserM_ApproveLevelID == '1' ? 'Jumlah pending verifikasi : ' : 'Jumlah pending approve : '}}<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 v-if="user.M_UserM_ApproveLevelID == '1'" color="blue" @click="openApprove(props.item)" title="Menuju ke halaman verifikasi" dark>Verifikasi
<v-icon dark right>forward</v-icon>
</v-btn>
<v-btn v-else-if="user.M_UserM_ApproveLevelID == '2'" color="blue" @click="openApprove(props.item)" title="Menuju ke halaman approve" dark>Approve
<v-icon dark right>forward</v-icon>
</v-btn>
<v-btn v-else color="blue" @click="openApprove(props.item)" title="Menuju ke halaman approve" dark>Button
<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: "NAMA MENU",
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 AWAL",
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: {
user() {
return this.$store.state.approve.user;
},
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")}`;
},
openApprove(val) {
let status = val.status;
let date = val.date
if (val.flag === 'p') {
location.href = "/one-ui/test/vuex/accone-purchase-request-kacab/" + "?flag=G&status=" + status + "&startdate=" + date
} else if (val.flag === 'np') {
location.href = "/one-ui/test/vuex/acc-one-purchase-request-po-np-approved/" + "?flag=G&status=" + status + "&startdate=" + date
} else if (val.flag === 'po') {
location.href = "/one-ui/test/vuex/acc-one-approve-po/" + "?flag=G&status=" + status + "&startdate=" + date
} else if (val.flag === 'r') {
location.href = "/one-ui/test/vuex/acc-one-cashier-v2/" + "?status=" + status + "&startdate=" + date
} else if (val.flag === 'pa') {
location.href = "/one-ui/test/vuex/acc-one-supplier-payment-approved-v3/" + "?flag=G&status=" + status + "&startdate=" + date
} else if (val.flag === 'prd') {
location.href = "/one-ui/test/vuex/acc-one-purchase-request-direct-approved/" + "?flag=G&status=" + status + "&startdate=" + date
} else if (val.flag === 'rio') {
location.href = "/one-ui/test/vuex/acc-one-request-item-out/" + "?flag=G&status=" + status + "&startdate=" + date
}
}
},
watch: {
},
};
</script>

View 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>

View File

@@ -0,0 +1,107 @@
// 1 => LOADING
// 2 => DONE
// 3 => ERROR
import { update } from "../../acc-one-md-supplier/api/supplier.js"
import * as api from "../api/approve.js"
export default {
namespaced: true,
state: {
lookup_search: 0,
lookup_error_message: "",
approvelist: [],
selected_menu: {},
listdata: [],
selected_data: {},
loading: false,
total_page: 0,
current_page: 1,
xsearch: "",
user: one_user()
},
mutations: {
update_lookup_search(state, val) {
state.lookup_search = val
},
update_lookup_error_message(state, val) {
state.lookup_error_message = val
},
update_approvelist(state, val) {
state.approvelist = val
},
update_selected_menu(state, val) {
state.selected_menu = 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
},
update_user(state, val) {
state.user = val
}
},
actions: {
async listApprove(context, prm) {
context.commit("update_lookup_search", 1)
try {
let prm = {}
prm.token = one_token()
let resp = await api.listApprove(prm)
if (resp.status != "OK") {
context.commit("update_lookup_search", 3)
context.commit("update_lookup_error_message", resp.message)
} else {
context.commit("update_lookup_search", 2)
context.commit("update_lookup_error_message", "")
let data = {
records: resp.data.records
}
context.commit("update_approvelist", data.records)
}
} catch (e) {
context.commit("update_lookup_search", 3)
context.commit("update_lookup_error_message", e.message)
}
},
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)
}
}
}
}

View 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: {
}
});