add modules folder based on s_menu
This commit is contained in:
190
test/vuex/one-accone-approve-all/components/oneApproveList.vue
Normal file
190
test/vuex/one-accone-approve-all/components/oneApproveList.vue
Normal 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>
|
||||
@@ -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>
|
||||
Reference in New Issue
Block a user