2126 lines
117 KiB
Plaintext
2126 lines
117 KiB
Plaintext
|
|
<!DOCTYPE html>
|
|
<html dir="ltr" lang="en">
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
|
<!-- Tell the browser to be responsive to screen width -->
|
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
<meta name="keywords"
|
|
content="wrappixel, admin dashboard, html css dashboard, web dashboard, bootstrap 5 admin, bootstrap 5, css3 dashboard, bootstrap 5 dashboard, Matrix lite admin bootstrap 5 dashboard, frontend, responsive bootstrap 5 admin template, Matrix admin lite design, Matrix admin lite dashboard bootstrap 5 dashboard template" />
|
|
<meta name="description"
|
|
content="Matrix Admin Lite Free Version is powerful and clean admin dashboard template, inpired from Bootstrap Framework" />
|
|
<meta name="robots" content="noindex,nofollow" />
|
|
<title>PSTW Centralize Web System</title>
|
|
<!-- Favicon icon -->
|
|
<link rel="icon"
|
|
type="image/png"
|
|
sizes="16x16"
|
|
href="/assets/images/favicon.png" />
|
|
|
|
|
|
<!-- Custom CSS -->
|
|
<link rel="stylesheet" href="/assets/libs/select2/dist/css/select2.min.css" />
|
|
<link rel="stylesheet" href="/assets/libs/jquery-minicolors/jquery.minicolors.css" />
|
|
<link rel="stylesheet" href="/assets/libs/bootstrap-datepicker/dist/css/bootstrap-datepicker.min.css" />
|
|
<link rel="stylesheet" href="/assets/libs/quill/dist/quill.snow.css" />
|
|
<link href="/dist/css/style.min.css" rel="stylesheet" />
|
|
<link href="/lib/printjs/print.min.css" rel="stylesheet" />
|
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.5/font/bootstrap-icons.css">
|
|
<!-- DataTables CSS-->
|
|
<link href="/lib/datatables/datatables.css" rel="stylesheet" />
|
|
<!-- Vue Js -->
|
|
<script src="/js/vue.global.js"></script>
|
|
<!-- QR Js -->
|
|
<script src="/lib/qrcode/qrcode.min.js"></script>
|
|
|
|
|
|
|
|
|
|
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
|
|
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
|
|
<!--[if lt IE 9]>
|
|
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
|
|
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
|
|
<![endif]-->
|
|
</head>
|
|
<body>
|
|
<style>
|
|
|
|
.btn-teal {
|
|
background-color: #20c997; /* Teal color */
|
|
color: #ffffff; /* White text */
|
|
border: none; /* Remove border */
|
|
}
|
|
|
|
.btn-teal:hover {
|
|
background-color: #17a589; /* Darker teal on hover */
|
|
color: #ffffff;
|
|
}
|
|
|
|
.btn-teal:focus,
|
|
.btn-teal.focus {
|
|
box-shadow: 0 0 0 0.2rem rgba(32, 201, 151, 0.5); /* Teal shadow on focus */
|
|
}
|
|
</style>
|
|
<!-- ============================================================== -->
|
|
<!-- Preloader - style you can find in spinners.css -->
|
|
<!-- ============================================================== -->
|
|
<div b-lhtx71ohus id="preloader" class="preloader">
|
|
<div b-lhtx71ohus class="lds-ripple">
|
|
<div b-lhtx71ohus class="lds-pos"></div>
|
|
<div b-lhtx71ohus class="lds-pos"></div>
|
|
</div>
|
|
</div>
|
|
<div b-lhtx71ohus class="modal fade" id="loadingModal" data-bs-backdrop="static" tabindex="-1" aria-hidden="true" style="z-index: 1051;">
|
|
<div b-lhtx71ohus class="modal-dialog modal-dialog-centered">
|
|
<div b-lhtx71ohus class="modal-content">
|
|
<div b-lhtx71ohus class="modal-header">
|
|
<button b-lhtx71ohus type="button" class="closeModal" data-dismiss="modal" aria-label="Close">
|
|
<span b-lhtx71ohus aria-hidden="true">×</span>
|
|
</button>
|
|
</div>
|
|
<div b-lhtx71ohus class="modal-body text-center">
|
|
<div b-lhtx71ohus class="spinner-border text-primary" role="status">
|
|
<span b-lhtx71ohus class="visually-hidden">Loading...</span>
|
|
</div>
|
|
<p b-lhtx71ohus class="mt-3">Please wait while we process your request...</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- ============================================================== -->
|
|
<!-- Main wrapper - style you can find in pages.scss -->
|
|
<!-- ============================================================== -->
|
|
<div b-lhtx71ohus id="main-wrapper"
|
|
data-layout="vertical"
|
|
data-navbarbg="skin5"
|
|
data-sidebartype="full"
|
|
data-sidebar-position="absolute"
|
|
data-header-position="absolute"
|
|
data-boxed-layout="full">
|
|
<!-- ============================================================== -->
|
|
<!-- Topbar header - style you can find in pages.scss -->
|
|
<!-- ============================================================== -->
|
|
<header b-lhtx71ohus class="topbar" data-navbarbg="skin5">
|
|
<nav b-lhtx71ohus class="navbar top-navbar navbar-expand-md navbar-dark">
|
|
<div b-lhtx71ohus class="navbar-header" data-logobg="skin5">
|
|
<!-- ============================================================== -->
|
|
<!-- Logo -->
|
|
<!-- ============================================================== -->
|
|
<a class="navbar-brand" href="/">
|
|
<!-- Logo icon -->
|
|
<b b-lhtx71ohus class="logo-icon ps-2">
|
|
<!--You can put here icon as well // <i class="wi wi-sunset"></i> //-->
|
|
<!-- Dark Logo icon -->
|
|
<img b-lhtx71ohus src="/assets/images/logo-icon.png"
|
|
alt="homepage"
|
|
class="light-logo"
|
|
width="25" />
|
|
</b>
|
|
<!--End Logo icon -->
|
|
<!-- Logo text -->
|
|
<span b-lhtx71ohus class="logo-text ms-2">
|
|
<!-- dark Logo text -->
|
|
<img b-lhtx71ohus src="/assets/images/logo-text.png"
|
|
alt="homepage"
|
|
class="light-logo" />
|
|
</span>
|
|
<!-- Logo icon -->
|
|
<!-- <b class="logo-icon"> -->
|
|
<!--You can put here icon as well // <i class="wi wi-sunset"></i> //-->
|
|
<!-- Dark Logo icon -->
|
|
<!-- <img src="/assets/images/logo-text.png" alt="homepage" class="light-logo" /> -->
|
|
<!-- </b> -->
|
|
<!--End Logo icon -->
|
|
</a>
|
|
<!-- ============================================================== -->
|
|
<!-- End Logo -->
|
|
<!-- ============================================================== -->
|
|
<!-- ============================================================== -->
|
|
<!-- Toggle which is visible on mobile only -->
|
|
<!-- ============================================================== -->
|
|
<a b-lhtx71ohus class="nav-toggler waves-effect waves-light d-block d-md-none"
|
|
href="javascript:void(0)">
|
|
<i b-lhtx71ohus class="ti-menu ti-close"></i>
|
|
</a>
|
|
</div>
|
|
<!-- ============================================================== -->
|
|
<!-- End Logo -->
|
|
<!-- ============================================================== -->
|
|
<div b-lhtx71ohus class="navbar-collapse collapse"
|
|
id="navbarSupportedContent"
|
|
data-navbarbg="skin5">
|
|
<!-- ============================================================== -->
|
|
<!-- toggle and nav items -->
|
|
<!-- ============================================================== -->
|
|
<ul b-lhtx71ohus class="navbar-nav float-start me-auto">
|
|
<li b-lhtx71ohus class="nav-item d-none d-lg-block">
|
|
<a b-lhtx71ohus class="nav-link sidebartoggler waves-effect waves-light"
|
|
href="javascript:void(0)"
|
|
data-sidebartype="mini-sidebar">
|
|
<i b-lhtx71ohus class="mdi mdi-menu font-24"></i>
|
|
</a>
|
|
</li>
|
|
<li b-lhtx71ohus class="nav-item">
|
|
<a class="nav-link" href="/">Home</a>
|
|
</li>
|
|
<li b-lhtx71ohus class="nav-item">
|
|
<a class="nav-link" href="/Home/Privacy">Privacy</a>
|
|
</li>
|
|
<!-- ============================================================== -->
|
|
<!-- create new -->
|
|
<!-- ============================================================== -->
|
|
<!--<li class="nav-item dropdown">
|
|
<a class="nav-link dropdown-toggle"
|
|
href="#"
|
|
id="navbarDropdown"
|
|
role="button"
|
|
data-bs-toggle="dropdown"
|
|
aria-expanded="false">
|
|
<span class="d-none d-md-block">
|
|
Create New <i class="fa fa-angle-down"></i>
|
|
</span>
|
|
<span class="d-block d-md-none">
|
|
<i class="fa fa-plus"></i>
|
|
</span>
|
|
</a>
|
|
<ul class="dropdown-menu" aria-labelledby="navbarDropdown">
|
|
<li><a class="dropdown-item" href="#">Action</a></li>
|
|
<li><a class="dropdown-item" href="#">Another action</a></li>
|
|
<li><hr class="dropdown-divider" /></li>
|
|
<li>
|
|
<a class="dropdown-item" href="#">Something else here</a>
|
|
</li>
|
|
</ul>
|
|
</li> b-lhtx71ohus-->
|
|
<!-- ============================================================== -->
|
|
<!-- Search -->
|
|
<!-- ============================================================== -->
|
|
<!--<li class="nav-item search-box">
|
|
<a class="nav-link waves-effect waves-dark"
|
|
href="javascript:void(0)">
|
|
<i class="mdi mdi-magnify fs-4"></i>
|
|
</a>
|
|
<form class="app-search position-absolute">
|
|
<input type="text"
|
|
class="form-control"
|
|
placeholder="Search & enter" />
|
|
<a class="srh-btn"><i class="mdi mdi-window-close"></i></a>
|
|
</form>
|
|
</li> b-lhtx71ohus-->
|
|
</ul>
|
|
<!-- ============================================================== -->
|
|
<!-- Right side toggle and nav items -->
|
|
<!-- ============================================================== -->
|
|
<ul b-lhtx71ohus class="navbar-nav float-end">
|
|
<!-- ============================================================== -->
|
|
<!-- Comment -->
|
|
<!-- ============================================================== -->
|
|
|
|
|
|
<li class="nav-item d-inline">
|
|
<a id="manage" class="nav-link" title="Manage" href="/Identity/Account/Manage">
|
|
Hello alim.aidrus@pstw.com.my!
|
|
</a>
|
|
</li>
|
|
<li class="nav-item d-inline">
|
|
<a id="logout" class="nav-link" href="javascript:void(0);" onclick="logout()">Logout</a>
|
|
</li>
|
|
<input name="__RequestVerificationToken" type="hidden" value="CfDJ8N0yQF8b8n9Ln4B-pzXVXnJKB9yp33d_c6c3bVZinufFmI2IzZDxwSGD_a5ABdmskLv-qIINDp_a8FgFS_tE6_RN1s9s6KQyhkFvDHutm72cl8JQvnIns28vovUJTdLNXHIOop0UtAAZUkOIXwjawupO9xU6zLHVYFqIh2fJ1ifg4rCRlcJecmXpFYFok9W73A" /> <script>
|
|
function logout() {
|
|
const returnUrl = '/';
|
|
fetch('/Identity/Account/Logout', {
|
|
method: 'POST',
|
|
headers: {
|
|
'Content-Type': 'application/x-www-form-urlencoded',
|
|
},
|
|
body: `__RequestVerificationToken=${document.querySelector('input[name="__RequestVerificationToken"]').value}&returnUrl=${encodeURIComponent(returnUrl)}`
|
|
}).then(response => {
|
|
if (response.ok) {
|
|
window.location.href = returnUrl;
|
|
} else {
|
|
alert('Logout failed.');
|
|
}
|
|
}).catch(error => {
|
|
console.error('Logout error:', error);
|
|
});
|
|
}
|
|
</script>
|
|
|
|
<!-- ============================================================== -->
|
|
<!-- End Comment -->
|
|
<!-- ============================================================== -->
|
|
<!-- ============================================================== -->
|
|
<!-- Messages -->
|
|
<!-- ============================================================== -->
|
|
<!-- ============================================================== -->
|
|
<!-- End Messages -->
|
|
<!-- ============================================================== -->
|
|
<!-- ============================================================== -->
|
|
<!-- User profile and search -->
|
|
<!-- ============================================================== -->
|
|
<!-- ============================================================== -->
|
|
<!-- User profile and search -->
|
|
<!-- ============================================================== -->
|
|
</ul>
|
|
</div>
|
|
</nav>
|
|
</header>
|
|
<!-- ============================================================== -->
|
|
<!-- End Topbar header -->
|
|
<!-- ============================================================== -->
|
|
<!-- ============================================================== -->
|
|
<!-- Left Sidebar - style you can find in sidebar.scss -->
|
|
<!-- ============================================================== -->
|
|
<aside b-lhtx71ohus class="left-sidebar" data-sidebarbg="skin5">
|
|
<!-- Sidebar scroll-->
|
|
<div b-lhtx71ohus class="scroll-sidebar">
|
|
<!-- Sidebar navigation-->
|
|
<nav b-lhtx71ohus class="sidebar-nav">
|
|
<ul b-lhtx71ohus id="sidebarnav" class="pt-4">
|
|
<li b-lhtx71ohus class="sidebar-item">
|
|
<a b-lhtx71ohus class="sidebar-link has-arrow waves-effect waves-dark"
|
|
href="javascript:void(0)"
|
|
aria-expanded="false">
|
|
<i b-lhtx71ohus class="mdi mdi-receipt"></i><span b-lhtx71ohus class="hide-menu">Administrator </span>
|
|
</a>
|
|
<ul b-lhtx71ohus aria-expanded="false" class="collapse first-level">
|
|
<li b-lhtx71ohus class="sidebar-item">
|
|
<a class="sidebar-link waves-effect waves-dark sidebar-link" aria-expanded="false" href="/Admin">
|
|
<i b-lhtx71ohus class="mdi mdi-view-dashboard"></i><span b-lhtx71ohus class="hide-menu">Admin Dashboard</span>
|
|
</a>
|
|
</li>
|
|
<li b-lhtx71ohus class="sidebar-item">
|
|
<a class="sidebar-link waves-effect waves-dark sidebar-link" aria-expanded="false" href="/Admin/ModuleAdmin">
|
|
<i b-lhtx71ohus class="mdi mdi-view-dashboard"></i><span b-lhtx71ohus class="hide-menu">Module Administration</span>
|
|
</a>
|
|
</li>
|
|
|
|
</ul>
|
|
</li>
|
|
<li b-lhtx71ohus class="sidebar-item">
|
|
<a b-lhtx71ohus class="sidebar-link waves-effect waves-dark sidebar-link"
|
|
href="#"
|
|
aria-expanded="false">
|
|
<i b-lhtx71ohus class="mdi mdi-view-dashboard"></i><span b-lhtx71ohus class="hide-menu">Dashboard</span>
|
|
</a>
|
|
</li>
|
|
<li b-lhtx71ohus class="sidebar-item">
|
|
<a b-lhtx71ohus class="sidebar-link has-arrow waves-effect waves-dark"
|
|
href="javascript:void(0)"
|
|
aria-expanded="false">
|
|
<i b-lhtx71ohus class="mdi mdi-receipt"></i><span b-lhtx71ohus class="hide-menu">Inventory </span>
|
|
</a>
|
|
<ul b-lhtx71ohus aria-expanded="false" class="collapse first-level">
|
|
<li b-lhtx71ohus class="sidebar-item">
|
|
<a class="sidebar-link waves-effect waves-dark sidebar-link" aria-expanded="false" href="/Inventory/InventoryMaster/AdminDashboard">
|
|
<i b-lhtx71ohus class="mdi mdi-view-dashboard"></i><span b-lhtx71ohus class="hide-menu">Admin Dashboard</span>
|
|
</a>
|
|
</li>
|
|
<li b-lhtx71ohus class="sidebar-item">
|
|
<a class="sidebar-link waves-effect waves-dark sidebar-link" aria-expanded="false" href="/Inventory/InventoryMaster/ProductRegistration">
|
|
<i b-lhtx71ohus class="mdi mdi-view-dashboard"></i><span b-lhtx71ohus class="hide-menu">Product Registration</span>
|
|
</a>
|
|
</li>
|
|
<li b-lhtx71ohus class="sidebar-item">
|
|
<a class="sidebar-link waves-effect waves-dark sidebar-link" aria-expanded="false" href="/Inventory/InventoryMaster/ItemRegistration">
|
|
<i b-lhtx71ohus class="mdi mdi-view-dashboard"></i><span b-lhtx71ohus class="hide-menu">Item Registration</span>
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
|
|
<li b-lhtx71ohus class="sidebar-item">
|
|
<a b-lhtx71ohus class="sidebar-link has-arrow waves-effect waves-dark"
|
|
href="javascript:void(0)"
|
|
aria-expanded="false">
|
|
<i b-lhtx71ohus class="mdi mdi-receipt"></i><span b-lhtx71ohus class="hide-menu">Report</span>
|
|
</a>
|
|
<ul b-lhtx71ohus aria-expanded="false" class="collapse first-level">
|
|
<li b-lhtx71ohus class="sidebar-item">
|
|
<a class="sidebar-link waves-effect waves-dark sidebar-link" aria-expanded="false" href="/Report/Reporting">
|
|
<i b-lhtx71ohus class="mdi mdi-view-dashboard"></i><span b-lhtx71ohus class="hide-menu">Admin Dashboard</span>
|
|
</a>
|
|
</li>
|
|
<li b-lhtx71ohus class="sidebar-item">
|
|
<a class="sidebar-link waves-effect waves-dark sidebar-link" aria-expanded="false" href="/Report/Reporting/InventoryReport">
|
|
<i b-lhtx71ohus class="mdi mdi-view-dashboard"></i><span b-lhtx71ohus class="hide-menu">Inventory Report</span>
|
|
</a>
|
|
</li>
|
|
<!--MMS-->
|
|
<li b-lhtx71ohus class="sidebar-item">
|
|
<a b-lhtx71ohus class="sidebar-link has-arrow waves-effect waves-dark"
|
|
href="javascript:void(0)" aria-expanded="false">
|
|
<i b-lhtx71ohus class="mdi mdi-view-dashboard"></i><span b-lhtx71ohus class="hide-menu">MMS</span>
|
|
</a>
|
|
<ul b-lhtx71ohus aria-expanded="false" class="collapse first-level">
|
|
<!-- Marine subsection -->
|
|
<li b-lhtx71ohus class="sidebar-item">
|
|
<a b-lhtx71ohus class="sidebar-link has-arrow waves-effect waves-dark"
|
|
href="javascript:void(0)" aria-expanded="false">
|
|
<i b-lhtx71ohus class="mdi mdi-view-dashboard"></i><span b-lhtx71ohus class="hide-menu">Marine</span>
|
|
</a>
|
|
<ul b-lhtx71ohus aria-expanded="false" class="collapse second-level">
|
|
<!-- Tar Ball Sampling Form link -->
|
|
<li b-lhtx71ohus class="sidebar-item">
|
|
<a class="sidebar-link waves-effect waves-dark" aria-expanded="false" href="/MMS/Marine/TarBallForm">
|
|
<i b-lhtx71ohus class="mdi mdi-view-dashboard"></i><span b-lhtx71ohus class="hide-menu">Tarball Report</span>
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
|
|
<li b-lhtx71ohus class="sidebar-item">
|
|
<a b-lhtx71ohus class="sidebar-link has-arrow waves-effect waves-dark"
|
|
href="javascript:void(0)"
|
|
aria-expanded="false">
|
|
<i b-lhtx71ohus class="mdi mdi-receipt"></i><span b-lhtx71ohus class="hide-menu">User Overtime</span>
|
|
</a>
|
|
<ul b-lhtx71ohus aria-expanded="false" class="collapse first-level">
|
|
<li b-lhtx71ohus class="sidebar-item">
|
|
<a class="sidebar-link waves-effect waves-dark sidebar-link" aria-expanded="false" href="/OTcalculate/Overtime/OtRegister">
|
|
<i b-lhtx71ohus class="mdi mdi-view-dashboard"></i><span b-lhtx71ohus class="hide-menu">OT Register</span>
|
|
</a>
|
|
</li>
|
|
<li b-lhtx71ohus class="sidebar-item">
|
|
<a class="sidebar-link waves-effect waves-dark sidebar-link" aria-expanded="false" href="/OTcalculate/Overtime/OtRecords">
|
|
<i b-lhtx71ohus class="mdi mdi-view-dashboard"></i><span b-lhtx71ohus class="hide-menu">OT Records</span>
|
|
</a>
|
|
</li>
|
|
<li b-lhtx71ohus class="sidebar-item">
|
|
<a class="sidebar-link waves-effect waves-dark sidebar-link" aria-expanded="false" href="/OTcalculate/Overtime/OtStatus">
|
|
<i b-lhtx71ohus class="mdi mdi-view-dashboard"></i><span b-lhtx71ohus class="hide-menu">OT Status</span>
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
|
|
<li b-lhtx71ohus class="sidebar-item">
|
|
<a b-lhtx71ohus class="sidebar-link has-arrow waves-effect waves-dark"
|
|
href="javascript:void(0)"
|
|
aria-expanded="false">
|
|
<i b-lhtx71ohus class="mdi mdi-receipt"></i><span b-lhtx71ohus class="hide-menu">Overtime Approval</span>
|
|
</a>
|
|
<ul b-lhtx71ohus aria-expanded="false" class="collapse first-level">
|
|
<li b-lhtx71ohus class="sidebar-item">
|
|
<a class="sidebar-link waves-effect waves-dark sidebar-link" aria-expanded="false" href="/OTcalculate/ApprovalDashboard/Approval">
|
|
<i b-lhtx71ohus class="mdi mdi-view-dashboard"></i><span b-lhtx71ohus class="hide-menu">Pending Approval</span>
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
|
|
<li b-lhtx71ohus class="sidebar-item">
|
|
<a b-lhtx71ohus class="sidebar-link has-arrow waves-effect waves-dark"
|
|
href="javascript:void(0)"
|
|
aria-expanded="false">
|
|
<i b-lhtx71ohus class="mdi mdi-receipt"></i><span b-lhtx71ohus class="hide-menu">HR Dashboard</span>
|
|
</a>
|
|
<ul b-lhtx71ohus aria-expanded="false" class="collapse first-level">
|
|
<li b-lhtx71ohus class="sidebar-item">
|
|
<a class="sidebar-link waves-effect waves-dark sidebar-link" aria-expanded="false" href="/OTcalculate/HrDashboard/Settings">
|
|
<i b-lhtx71ohus class="mdi mdi-view-dashboard"></i><span b-lhtx71ohus class="hide-menu">Settings</span>
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
|
|
<li b-lhtx71ohus class="sidebar-item">
|
|
<a b-lhtx71ohus class="sidebar-link has-arrow waves-effect waves-dark"
|
|
href="javascript:void(0)"
|
|
aria-expanded="false">
|
|
<i b-lhtx71ohus class="mdi mdi-receipt"></i><span b-lhtx71ohus class="hide-menu">Rooms Booking</span>
|
|
</a>
|
|
<ul b-lhtx71ohus aria-expanded="false" class="collapse first-level">
|
|
<li b-lhtx71ohus class="sidebar-item">
|
|
<a class="sidebar-link waves-effect waves-dark sidebar-link" aria-expanded="false" href="/Bookings/Bookings/Managers">
|
|
<i b-lhtx71ohus class="mdi mdi-view-dashboard"></i><span b-lhtx71ohus class="hide-menu">Assign</span>
|
|
</a>
|
|
</li>
|
|
<li b-lhtx71ohus class="sidebar-item">
|
|
<a class="sidebar-link waves-effect waves-dark sidebar-link" aria-expanded="false" href="/Bookings/Bookings">
|
|
<i b-lhtx71ohus class="mdi mdi-view-dashboard"></i><span b-lhtx71ohus class="hide-menu">List</span>
|
|
</a>
|
|
</li>
|
|
<li b-lhtx71ohus class="sidebar-item">
|
|
<a class="sidebar-link waves-effect waves-dark sidebar-link" aria-expanded="false" href="/Bookings/Bookings/Calendar">
|
|
<i b-lhtx71ohus class="mdi mdi-view-dashboard"></i><span b-lhtx71ohus class="hide-menu">Calendar</span>
|
|
</a>
|
|
</li>
|
|
<li b-lhtx71ohus class="sidebar-item">
|
|
<a class="sidebar-link waves-effect waves-dark sidebar-link" aria-expanded="false" href="/Bookings/Bookings/Room">
|
|
<i b-lhtx71ohus class="mdi mdi-view-dashboard"></i><span b-lhtx71ohus class="hide-menu">Rooms</span>
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
<li b-lhtx71ohus class="sidebar-item">
|
|
<a b-lhtx71ohus class="sidebar-link has-arrow waves-effect waves-dark"
|
|
href="javascript:void(0)"
|
|
aria-expanded="false">
|
|
<i b-lhtx71ohus class="mdi mdi-receipt"></i><span b-lhtx71ohus class="hide-menu">IT Request Form</span>
|
|
</a>
|
|
<ul b-lhtx71ohus aria-expanded="false" class="collapse first-level">
|
|
<li b-lhtx71ohus class="sidebar-item">
|
|
<a class="sidebar-link waves-effect waves-dark sidebar-link" aria-expanded="false" href="/IT/ApprovalDashboard/Admin">
|
|
<i b-lhtx71ohus class="mdi mdi-view-dashboard"></i><span b-lhtx71ohus class="hide-menu">Assignings</span>
|
|
</a>
|
|
</li>
|
|
<li b-lhtx71ohus class="sidebar-item">
|
|
<a class="sidebar-link waves-effect waves-dark sidebar-link" aria-expanded="false" href="/IT/ApprovalDashboard/Create">
|
|
<i b-lhtx71ohus class="mdi mdi-view-dashboard"></i><span b-lhtx71ohus class="hide-menu">Registeration</span>
|
|
</a>
|
|
</li>
|
|
<li b-lhtx71ohus class="sidebar-item">
|
|
<a class="sidebar-link waves-effect waves-dark sidebar-link" aria-expanded="false" href="/IT/ApprovalDashboard/MyRequests">
|
|
<i b-lhtx71ohus class="mdi mdi-view-dashboard"></i><span b-lhtx71ohus class="hide-menu">My Requests</span>
|
|
</a>
|
|
</li>
|
|
<li b-lhtx71ohus class="sidebar-item">
|
|
<a class="sidebar-link waves-effect waves-dark sidebar-link" aria-expanded="false" href="/IT/ApprovalDashboard/Approval">
|
|
<i b-lhtx71ohus class="mdi mdi-view-dashboard"></i><span b-lhtx71ohus class="hide-menu">Approval</span>
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
<!-- <li class="sidebar-item">
|
|
<a class="sidebar-link waves-effect waves-dark sidebar-link"
|
|
href="charts.html"
|
|
aria-expanded="false">
|
|
<i class="mdi mdi-chart-bar"></i><span class="hide-menu">Charts</span>
|
|
</a>
|
|
</li>
|
|
<li class="sidebar-item">
|
|
<a class="sidebar-link waves-effect waves-dark sidebar-link"
|
|
href="widgets.html"
|
|
aria-expanded="false">
|
|
<i class="mdi mdi-chart-bubble"></i><span class="hide-menu">Widgets</span>
|
|
</a>
|
|
</li>
|
|
<li class="sidebar-item">
|
|
<a class="sidebar-link waves-effect waves-dark sidebar-link"
|
|
href="tables.html"
|
|
aria-expanded="false">
|
|
<i class="mdi mdi-border-inside"></i><span class="hide-menu">Tables</span>
|
|
</a>
|
|
</li>
|
|
<li class="sidebar-item">
|
|
<a class="sidebar-link waves-effect waves-dark sidebar-link"
|
|
href="grid.html"
|
|
aria-expanded="false">
|
|
<i class="mdi mdi-blur-linear"></i><span class="hide-menu">Full Width</span>
|
|
</a>
|
|
</li>
|
|
<li class="sidebar-item">
|
|
<a class="sidebar-link has-arrow waves-effect waves-dark"
|
|
href="javascript:void(0)"
|
|
aria-expanded="false">
|
|
<i class="mdi mdi-receipt"></i><span class="hide-menu">Forms </span>
|
|
</a>
|
|
<ul aria-expanded="false" class="collapse first-level">
|
|
<li class="sidebar-item">
|
|
<a href="form-basic.html" class="sidebar-link">
|
|
<i class="mdi mdi-note-outline"></i><span class="hide-menu"> Form Basic </span>
|
|
</a>
|
|
</li>
|
|
<li class="sidebar-item">
|
|
<a href="form-wizard.html" class="sidebar-link">
|
|
<i class="mdi mdi-note-plus"></i><span class="hide-menu"> Form Wizard </span>
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
<li class="sidebar-item">
|
|
<a class="sidebar-link waves-effect waves-dark sidebar-link"
|
|
href="pages-buttons.html"
|
|
aria-expanded="false">
|
|
<i class="mdi mdi-relative-scale"></i><span class="hide-menu">Buttons</span>
|
|
</a>
|
|
</li>
|
|
<li class="sidebar-item">
|
|
<a class="sidebar-link has-arrow waves-effect waves-dark"
|
|
href="javascript:void(0)"
|
|
aria-expanded="false">
|
|
<i class="mdi mdi-face"></i><span class="hide-menu">Icons </span>
|
|
</a>
|
|
<ul aria-expanded="false" class="collapse first-level">
|
|
<li class="sidebar-item">
|
|
<a href="icon-material.html" class="sidebar-link">
|
|
<i class="mdi mdi-emoticon"></i><span class="hide-menu"> Material Icons </span>
|
|
</a>
|
|
</li>
|
|
<li class="sidebar-item">
|
|
<a href="icon-fontawesome.html" class="sidebar-link">
|
|
<i class="mdi mdi-emoticon-cool"></i><span class="hide-menu"> Font Awesome Icons </span>
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
<li class="sidebar-item">
|
|
<a class="sidebar-link waves-effect waves-dark sidebar-link"
|
|
href="pages-elements.html"
|
|
aria-expanded="false">
|
|
<i class="mdi mdi-pencil"></i><span class="hide-menu">Elements</span>
|
|
</a>
|
|
</li>
|
|
<li class="sidebar-item">
|
|
<a class="sidebar-link has-arrow waves-effect waves-dark"
|
|
href="javascript:void(0)"
|
|
aria-expanded="false">
|
|
<i class="mdi mdi-move-resize-variant"></i><span class="hide-menu">Addons </span>
|
|
</a>
|
|
<ul aria-expanded="false" class="collapse first-level">
|
|
<li class="sidebar-item">
|
|
<a href="index2.html" class="sidebar-link">
|
|
<i class="mdi mdi-view-dashboard"></i><span class="hide-menu"> Dashboard-2 </span>
|
|
</a>
|
|
</li>
|
|
<li class="sidebar-item">
|
|
<a href="pages-gallery.html" class="sidebar-link">
|
|
<i class="mdi mdi-multiplication-box"></i><span class="hide-menu"> Gallery </span>
|
|
</a>
|
|
</li>
|
|
<li class="sidebar-item">
|
|
<a href="pages-calendar.html" class="sidebar-link">
|
|
<i class="mdi mdi-calendar-check"></i><span class="hide-menu"> Calendar </span>
|
|
</a>
|
|
</li>
|
|
<li class="sidebar-item">
|
|
<a href="pages-invoice.html" class="sidebar-link">
|
|
<i class="mdi mdi-bulletin-board"></i><span class="hide-menu"> Invoice </span>
|
|
</a>
|
|
</li>
|
|
<li class="sidebar-item">
|
|
<a href="pages-chat.html" class="sidebar-link">
|
|
<i class="mdi mdi-message-outline"></i><span class="hide-menu"> Chat Option </span>
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
<li class="sidebar-item">
|
|
<a class="sidebar-link has-arrow waves-effect waves-dark"
|
|
href="javascript:void(0)"
|
|
aria-expanded="false">
|
|
<i class="mdi mdi-account-key"></i><span class="hide-menu">Authentication </span>
|
|
</a>
|
|
<ul aria-expanded="false" class="collapse first-level">
|
|
<li class="sidebar-item">
|
|
<a href="authentication-login.html" class="sidebar-link">
|
|
<i class="mdi mdi-all-inclusive"></i><span class="hide-menu"> Login </span>
|
|
</a>
|
|
</li>
|
|
<li class="sidebar-item">
|
|
<a href="authentication-register.html" class="sidebar-link">
|
|
<i class="mdi mdi-all-inclusive"></i><span class="hide-menu"> Register </span>
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
<li class="sidebar-item">
|
|
<a class="sidebar-link has-arrow waves-effect waves-dark"
|
|
href="javascript:void(0)"
|
|
aria-expanded="false">
|
|
<i class="mdi mdi-alert"></i><span class="hide-menu">Errors </span>
|
|
</a>
|
|
<ul aria-expanded="false" class="collapse first-level">
|
|
<li class="sidebar-item">
|
|
<a href="error-403.html" class="sidebar-link">
|
|
<i class="mdi mdi-alert-octagon"></i><span class="hide-menu"> Error 403 </span>
|
|
</a>
|
|
</li>
|
|
<li class="sidebar-item">
|
|
<a href="error-404.html" class="sidebar-link">
|
|
<i class="mdi mdi-alert-octagon"></i><span class="hide-menu"> Error 404 </span>
|
|
</a>
|
|
</li>
|
|
<li class="sidebar-item">
|
|
<a href="error-405.html" class="sidebar-link">
|
|
<i class="mdi mdi-alert-octagon"></i><span class="hide-menu"> Error 405 </span>
|
|
</a>
|
|
</li>
|
|
<li class="sidebar-item">
|
|
<a href="error-500.html" class="sidebar-link">
|
|
<i class="mdi mdi-alert-octagon"></i><span class="hide-menu"> Error 500 </span>
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
<li class="sidebar-item p-3">
|
|
<a href="https://github.com/wrappixel/matrix-admin-bt5"
|
|
target="_blank"
|
|
class="
|
|
w-100
|
|
btn btn-cyan
|
|
d-flex
|
|
align-items-center
|
|
text-white
|
|
">
|
|
<i class="mdi mdi-cloud-download font-20 me-2"></i>Download
|
|
Free
|
|
</a>
|
|
</li> -->
|
|
</ul>
|
|
</nav>
|
|
<!-- End Sidebar navigation -->
|
|
</div>
|
|
<!-- End Sidebar scroll-->
|
|
</aside>
|
|
<!-- ============================================================== -->
|
|
<!-- End Left Sidebar - style you can find in sidebar.scss -->
|
|
<!-- ============================================================== -->
|
|
<!-- ============================================================== -->
|
|
<!-- Page wrapper -->
|
|
<!-- ============================================================== -->
|
|
<div b-lhtx71ohus class="page-wrapper">
|
|
<!-- ============================================================== -->
|
|
<!-- Bread crumb and right sidebar toggle -->
|
|
<!-- ============================================================== -->
|
|
<div b-lhtx71ohus class="page-breadcrumb">
|
|
<div b-lhtx71ohus class="row">
|
|
<div b-lhtx71ohus class="col-12 d-flex no-block align-items-center">
|
|
<h1 b-lhtx71ohus class="m-0 page-title">Product Request</h1>
|
|
<div b-lhtx71ohus class="ms-auto text-end">
|
|
<nav b-lhtx71ohus aria-label="breadcrumb">
|
|
<ol b-lhtx71ohus class="breadcrumb">
|
|
<li b-lhtx71ohus class="breadcrumb-item"><a b-lhtx71ohus href="#">Home</a></li>
|
|
<li b-lhtx71ohus class="breadcrumb-item active" aria-current="page">
|
|
Library
|
|
</li>
|
|
</ol>
|
|
</nav>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- ============================================================== -->
|
|
<!-- End Bread crumb and right sidebar toggle -->
|
|
<!-- ============================================================== -->
|
|
<!-- ============================================================== -->
|
|
<!-- Container fluid -->
|
|
<!-- ============================================================== -->
|
|
<div b-lhtx71ohus class="container-fluid">
|
|
<!-- ============================================================== -->
|
|
<!-- Start Page Content -->
|
|
<!-- ============================================================== -->
|
|
<div b-lhtx71ohus class="row my-1">
|
|
<div class="row">
|
|
<div class="col-6 col-md-6 col-lg-3">
|
|
<div class="card card-hover">
|
|
<a href="/Inventory/InventoryMaster/SupplierRegistration">
|
|
<div class="box bg-info text-center">
|
|
<h1 class="font-light text-white">
|
|
<i class="mdi mdi-truck"></i>
|
|
</h1>
|
|
<h6 class="text-white">Supplier</h6>
|
|
</div>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
<div class="col-6 col-md-6 col-lg-3">
|
|
<div class="card card-hover">
|
|
<a href="/Inventory/InventoryMaster/ManifacturerRegistration">
|
|
<div class="box bg-warning text-center">
|
|
<h1 class="font-light text-white">
|
|
<i class="mdi mdi-factory"></i>
|
|
</h1>
|
|
<h6 class="text-white">Manufacturer</h6>
|
|
</div>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
<div class="col-6 col-md-6 col-lg-3">
|
|
<a href="/Inventory/InventoryMaster/ProductRegistration">
|
|
<div class="card card-hover">
|
|
<div class="box bg-cyan text-center">
|
|
<h1 class="font-light text-white">
|
|
<i class="mdi mdi-checkbox-multiple-blank"></i>
|
|
</h1>
|
|
<h6 class="text-white">Product</h6>
|
|
</div>
|
|
</div>
|
|
</a>
|
|
</div>
|
|
<div class="col-6 col-md-6 col-lg-3">
|
|
<div class="card card-hover">
|
|
<a href="/Inventory/InventoryMaster/ItemRegistration">
|
|
<div class="box bg-success text-center">
|
|
<h1 class="font-light text-white">
|
|
<i class="mdi mdi-checkbox-multiple-blank-circle"></i>
|
|
</h1>
|
|
<h6 class="text-white">Item</h6>
|
|
</div>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
<div class="col-6 col-md-6 col-lg-3">
|
|
<div class="card card-hover">
|
|
<a href="/Inventory/InventoryMaster/StationRegistration">
|
|
<div class="box bg-warning text-center">
|
|
<h1 class="font-light text-white">
|
|
<i class="mdi mdi-truck"></i>
|
|
</h1>
|
|
<h6 class="text-white">Station</h6>
|
|
</div>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-6 col-md-6 col-lg-3">
|
|
<div class="card card-hover">
|
|
<a href="/Inventory/InventoryMaster/ItemMovement">
|
|
<div class="box bg-cyan text-center">
|
|
<h1 class="font-light text-white">
|
|
<i class="mdi mdi-factory"></i>
|
|
</h1>
|
|
<h6 class="text-white">Item Movement</h6>
|
|
</div>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-6 col-md-6 col-lg-3">
|
|
<div class="card card-hover">
|
|
<a href="/Inventory/InventoryMaster/ItemRequestMaster">
|
|
<div class="box bg-info text-center">
|
|
<h1 class="font-light text-white">
|
|
<i class="mdi mdi-checkbox-multiple-blank"></i>
|
|
</h1>
|
|
<h6 class="text-white">Product Request</h6>
|
|
</div>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-6 col-md-6 col-lg-3">
|
|
<div class="card card-hover">
|
|
<a href="/Inventory/InventoryMaster/QrMaster">
|
|
<div class="box bg-success text-center">
|
|
<h1 class="font-light text-white">
|
|
<i class="mdi mdi-checkbox-multiple-blank-circle"></i>
|
|
</h1>
|
|
<h6 class="text-white">Scan Items</h6>
|
|
</div>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<style>
|
|
.dropdown {
|
|
position: relative;
|
|
width: 100%;
|
|
}
|
|
|
|
.dropdown-toggle-box {
|
|
display: flex;
|
|
align-items: center;
|
|
border: 1px solid #ddd;
|
|
border-radius: 5px;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.dropdown-toggle-box input {
|
|
flex: 1;
|
|
border: none;
|
|
padding: 8px;
|
|
}
|
|
|
|
.dropdown-btn {
|
|
border: none;
|
|
background-color: #007bff;
|
|
color: white;
|
|
padding: 8px 12px;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.dropdown-content {
|
|
position: absolute;
|
|
width: 100%;
|
|
max-height: 200px;
|
|
overflow-y: auto;
|
|
background: #fff;
|
|
border: 1px solid #ddd;
|
|
z-index: 10;
|
|
}
|
|
|
|
.dropdown-content option {
|
|
padding: 10px;
|
|
cursor: pointer;
|
|
display: block;
|
|
}
|
|
|
|
.dropdown-content option:hover {
|
|
background-color: #f1f1f1;
|
|
}
|
|
|
|
.modal-body img {
|
|
max-width: 100%; /* Ensure it fits the modal */
|
|
max-height: 150px; /* Adjust max height */
|
|
display: block;
|
|
margin: auto;
|
|
}
|
|
|
|
</style>
|
|
<div id="requestProduct" class="row">
|
|
<div class="row mb-3">
|
|
<h2 for="sortSelect" class="col-sm-1 col-form-h2" style="min-width:150px;">Sort by:</h2>
|
|
<div class="col-sm-4">
|
|
<select id="sortSelect" class="form-control" v-model="sortBy" v-on:change="handleSorting">
|
|
<option value="tech">Technician -> Inventory Master</option>
|
|
<option value="master">Inventory Master -> Inventory Master</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
<div v-show="sortBy === 'master'">
|
|
<div class="row card">
|
|
<div class="card-header">
|
|
<h2>Outgoing Requests to Other Stores</h2>
|
|
<button id="addRequestBtn" class="btn btn-success col-md-3 col-lg-3 m-1 col-12"
|
|
v-on:click="showRequestModal = true">
|
|
<i class="fa fa-plus"></i> Add Request
|
|
</button>
|
|
|
|
</div>
|
|
<div class="card-body">
|
|
<table class="table table-bordered table-hover table-striped no-wrap" id="requestMasterDatatable" style=" width:100%;border-style: solid; border-width: 1px"></table>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row card">
|
|
<div class="card-header">
|
|
<h2>Incoming Requests from Other Inventory Masters</h2>
|
|
</div>
|
|
<div class="card-body">
|
|
<table class="table table-bordered table-hover table-striped no-wrap" id="requestOtherMasterDatatable" style=" width:100%;border-style: solid; border-width: 1px"></table>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row card">
|
|
<div class="card-header">
|
|
<h2>Complete Request Master</h2>
|
|
</div>
|
|
<div class="card-body">
|
|
<table class="table table-bordered table-hover table-striped no-wrap" id="settledrequestMasterDatatable" style=" width:100%;border-style: solid; border-width: 1px"></table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div v-show="sortBy === 'tech'">
|
|
<div class="row card">
|
|
<div class="card-header">
|
|
<h2>Pending Request</h2>
|
|
</div>
|
|
<div class="card-body">
|
|
<table class="table table-bordered table-hover table-striped no-wrap" id="requestDatatable" style=" width:100%;border-style: solid; border-width: 1px"></table>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row card">
|
|
<div class="card-header">
|
|
<h2>Complete Request</h2>
|
|
</div>
|
|
<div class="card-body">
|
|
<table class="table table-bordered table-hover table-striped no-wrap" id="settledrequestDatatable" style=" width:100%;border-style: solid; border-width: 1px"></table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="modal fade" id="rejectModal" tabindex="-1" role="dialog" aria-labelledby="rejectRequestModalLabel" aria-hidden="true">
|
|
<div class="modal-dialog modal-dialog-centered modal-xl" role="document">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h5 class="modal-title" id="rejectRequestModalLabel">Reject Request</h5>
|
|
<button type="button" class="closeModal" data-dismiss="modal" aria-label="Close" v-on:click="showRequestModal=false">
|
|
<span aria-hidden="true">×</span>
|
|
</button>
|
|
</div>
|
|
<div class="modal-body">
|
|
<div class="container-fluid">
|
|
<form v-on:submit.prevent="rejectRequest" data-aos="fade-right">
|
|
<div data-aos="fade-right">
|
|
<div class="row" data-aos="fade-right">
|
|
|
|
<div class="col-md-12">
|
|
<div class="tab-content" id="myTabContent">
|
|
<div class="tab-pane fade show active" id="home" role="tabpanel" aria-labelledby="home-tab">
|
|
<h3 class="register-heading">REJECT REQUEST</h3>
|
|
<div class="row register-form">
|
|
<div class="col-md-12">
|
|
|
|
<div class="form-group row">
|
|
<div class="col-sm-8">
|
|
<div class="dropdown">
|
|
<input type="text" id="currentrequestID" name="currentrequestID" v-model="currentrequestID" class="form-control" hidden />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group row">
|
|
<label class="col-sm-4 col-form-label">Remark</label>
|
|
<div class="col-sm-8">
|
|
<div class="dropdown">
|
|
<input type="text" id="rejectremark" name="rejectremark" v-model="rejectremark" class="form-control" required />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group row">
|
|
<div class="col-sm-8 offset-sm-3">
|
|
<button type="button" v-on:click="resetForm" class="btn btn-secondary m-1">Reset</button>
|
|
<button type="submit" class="btn btn-primary m-1 submit-button">Submit</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="modal fade" id="approveModal" tabindex="-1" role="dialog" aria-labelledby="approveRequestModalLabel" aria-hidden="true">
|
|
<div class="modal-dialog modal-dialog-centered modal-xl" role="document">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h5 class="modal-title" id="approveRequestModalLabel">Approve Request</h5>
|
|
<button type="button" class="closeModal" data-dismiss="modal" aria-label="Close" v-on:click="showRequestModal=false">
|
|
<span aria-hidden="true">×</span>
|
|
</button>
|
|
</div>
|
|
<div class="modal-body">
|
|
<div class="container-fluid">
|
|
<form v-on:submit.prevent="approveRequest" data-aos="fade-right">
|
|
<div data-aos="fade-right">
|
|
<div class="row" data-aos="fade-right">
|
|
|
|
<div class="col-md-12">
|
|
<div class="tab-content" id="myTabContent">
|
|
<div class="tab-pane fade show active" id="home" role="tabpanel" aria-labelledby="home-tab">
|
|
<h3 class="register-heading">APPROVE REQUEST</h3>
|
|
<div class="row register-form">
|
|
<div class="col-md-12">
|
|
|
|
<div class="form-group row">
|
|
<div class="col-sm-8">
|
|
<div class="dropdown">
|
|
<input type="text" id="currentrequestID" name="currentrequestID" v-model="currentrequestID" class="form-control" hidden />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group row">
|
|
<label class="col-sm-4 col-form-label">Remark</label>
|
|
<div class="col-sm-8">
|
|
<div class="dropdown">
|
|
<input type="text" id="approveremark" name="approveremark" v-model="approveremark" class="form-control" required />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group row">
|
|
<div class="col-sm-8 offset-sm-3">
|
|
<button type="button" v-on:click="resetForm" class="btn btn-secondary m-1">Reset</button>
|
|
<button type="submit" class="btn btn-primary m-1 submit-button">Submit</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="modal fade" id="requestModal" tabindex="-1" role="dialog" aria-labelledby="addRequestModalLabel" aria-hidden="true">
|
|
<div class="modal-dialog modal-dialog-centered modal-xl" role="document">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h5 class="modal-title" id="addRequestModalLabel">Add Request</h5>
|
|
<button type="button" class="closeModal" data-dismiss="modal" aria-label="Close" v-on:click="showRequestModal=false">
|
|
<span aria-hidden="true">×</span>
|
|
</button>
|
|
</div>
|
|
<div class="modal-body">
|
|
<div class="container-fluid">
|
|
<form v-on:submit.prevent="addRequestMaster" data-aos="fade-right">
|
|
<div class="register" data-aos="fade-right">
|
|
<div class="row" data-aos="fade-right">
|
|
|
|
<div class="col-md-12">
|
|
<div class="tab-content" id="myTabContent">
|
|
<div class="tab-pane fade show active" id="home" role="tabpanel" aria-labelledby="home-tab">
|
|
<h3 class="register-heading">PRODUCT REQUEST</h3>
|
|
<div class="row register-form">
|
|
<div class="col-md-13">
|
|
|
|
<!-- Product Name -->
|
|
<div class="form-group row">
|
|
<label class="col-sm-2 col-form-label">Product</label>
|
|
<div class="col-sm-8">
|
|
<div class="dropdown" v-click-outside="closeDropdown">
|
|
<!-- Button + Input dalam satu box -->
|
|
<div class="dropdown-toggle-box" v-on:click="dropdownOpen = !dropdownOpen">
|
|
<input type="text" class="form-control" v-model="searchQuery"
|
|
placeholder="Search product..." v-on:focus="dropdownOpen = true" v-on:click.stop />
|
|
<button type="button" class="btn btn-primary dropdown-btn" v-on:click.stop="dropdownOpen = !dropdownOpen">
|
|
▼
|
|
</button>
|
|
</div>
|
|
|
|
<!-- Dropdown list -->
|
|
<div v-if="dropdownOpen" class="dropdown-content" v-on:click.stop>
|
|
<div v-for="(item, index) in filteredProducts"
|
|
:key="index" class="dropdown-item" v-on:mousedown.prevent="selectProduct(item)">
|
|
{{ item.productName + ' (' + item.modelNo + ')' }}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Category Dropdown -->
|
|
<div class="form-group row">
|
|
<label class="col-sm-2 col-form-label">Category:</label>
|
|
<div class="col-sm-8">
|
|
<input type="text" id="category" name="category" v-model="showProduct.category" class="form-control" readonly />
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Image Product Dropdown-->
|
|
<div class="form-group row align-items-center">
|
|
<label for="imageProduct" class="col-sm-2 col-form-label">Product Image: </label>
|
|
<div class="col-sm-8">
|
|
<img v-if="showProduct.imageProduct" :src="showProduct.imageProduct" alt="Product Image" class="img-fluid" data-toggle="modal" data-target="#imageModal" />
|
|
<input type="hidden" id="imageProduct" name="imageProduct" v-model="showProduct">
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Modal -->
|
|
<div class="modal fade" id="imageModal" tabindex="-1" role="dialog" aria-labelledby="imageModalLabel" aria-hidden="true">
|
|
<div class="modal-dialog modal-lg" role="document">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h5 class="modal-title" id="imageModalLabel">Product Image</h5>
|
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
|
<span aria-hidden="true">×</span>
|
|
</button>
|
|
</div>
|
|
<div class="modal-body">
|
|
<img :src="showProduct.imageProduct" alt="Product Image" class="img-fluid">
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Quantity Input -->
|
|
<div class="form-group row d-flex align-items-center">
|
|
<label class="col-sm-2 col-form-label">Quantity:</label>
|
|
<div class="col-sm-8">
|
|
<input type="number" class="form-control" v-model="quantity" required />
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group row">
|
|
<label class="col-sm-2 col-form-label">Request From Store : </label>
|
|
<div class="col-sm-8">
|
|
<div class="dropdown">
|
|
<select class="btn btn-primary dropdown-toggle col-md-12" v-model="fromStoreItem" required>
|
|
<option class="btn-light" value="" selected disabled>Select Store</option>
|
|
<option class="btn-light" v-for="(item, index) in stores" :key="item" :value="item.id">{{ item.storeName ?? 'Select Store' }}</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Give Item to where store -->
|
|
<div class="form-group row">
|
|
<label class="col-sm-2 col-form-label">Send To Store : </label>
|
|
<div class="col-sm-8">
|
|
<div class="dropdown">
|
|
<select class="btn btn-primary dropdown-toggle col-md-12" data-toggle="dropdown" aria-expanded="false" v-model="assignStoreItem" required>
|
|
<option class="btn-light" value="" disabled selected>Select Store</option>
|
|
<option v-if="storeUser.length === 0" class="btn-light" disabled>No Store Assigned to You</option>
|
|
<option class="btn-light" v-for="(item, index) in storeUser" :key="index" :value="item.id">
|
|
{{ item.storeName }}
|
|
</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Remark Input (Wider) -->
|
|
<div class="form-group row d-flex align-items-center">
|
|
<label class="col-sm-2 col-form-label">Remark:</label>
|
|
<div class="col-sm-8">
|
|
<input type="text" class="form-control col-md-10" v-model="remark" />
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Document/Picture Input -->
|
|
<div class="form-group row d-flex align-items-center">
|
|
<label class="col-sm-2 col-form-label">Document/Picture:</label>
|
|
<div class="col-sm-8">
|
|
<input type="file" id="document" name="document" class="form-control-file" v-on:change="handleFileUpload" accept="image/png, image/jpeg, application/pdf" />
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="form-group row">
|
|
<div class="col-sm-8 offset-sm-3">
|
|
<button type="button" v-on:click="resetForm" class="btn btn-secondary m-1">Reset</button>
|
|
<button type="submit" class="btn btn-primary m-1">Submit</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
<!-- ============================================================== -->
|
|
<!-- End PAge Content -->
|
|
<!-- ============================================================== -->
|
|
<!-- ============================================================== -->
|
|
<!-- Right sidebar -->
|
|
<!-- ============================================================== -->
|
|
<!-- .right-sidebar -->
|
|
<!-- ============================================================== -->
|
|
<!-- End Right sidebar -->
|
|
<!-- ============================================================== -->
|
|
</div>
|
|
<!-- ============================================================== -->
|
|
<!-- End Container fluid -->
|
|
<!-- ============================================================== -->
|
|
<!-- ============================================================== -->
|
|
<!-- footer -->
|
|
<!-- ============================================================== -->
|
|
<footer b-lhtx71ohus class="footer text-center">
|
|
All Rights Reserved by PSTW. Designed and Developed by
|
|
<a b-lhtx71ohus href="https://www.wrappixel.com">WrapPixel</a>.
|
|
</footer>
|
|
<!-- ============================================================== -->
|
|
<!-- End footer -->
|
|
<!-- ============================================================== -->
|
|
</div>
|
|
<!-- ============================================================== -->
|
|
<!-- End Page wrapper -->
|
|
<!-- ============================================================== -->
|
|
</div>
|
|
<!-- ============================================================== -->
|
|
<!-- End Wrapper -->
|
|
<!-- ============================================================== -->
|
|
<!-- ============================================================== -->
|
|
<!-- All Jquery -->
|
|
<!-- ============================================================== -->
|
|
|
|
<script src="/assets/libs/jquery/dist/jquery.min.js"></script>
|
|
<script src="/dist/js/jquery-ui.min.js"></script>
|
|
<!-- VUE Multiselect-->
|
|
<script src="/lib/vue-multiselect/vue-multiselect.js"></script>
|
|
<link href="/lib/vue-multiselect/vue-multiselect.min.css" rel="stylesheet" />
|
|
<!-- VUE Date Picker-->
|
|
<link href="/lib/vue-datepicker/mainvuedate.css" rel="stylesheet" />
|
|
<script src="/lib/vue-datepicker/vue-datepicker.iife.js"></script>
|
|
<!-- Bootstrap tether Core JavaScript -->
|
|
<script src="/assets/libs/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
|
|
<!-- slimscrollbar scrollbar JavaScript -->
|
|
<script src="/assets/libs/perfect-scrollbar/dist/perfect-scrollbar.jquery.min.js"></script>
|
|
<script src="/assets/extra-libs/sparkline/sparkline.js"></script>
|
|
<!--Wave Effects -->
|
|
<script src="/dist/js/waves.js"></script>
|
|
<!--Menu sidebar -->
|
|
<script src="/dist/js/sidebarmenu.js"></script>
|
|
<!--Custom JavaScript -->
|
|
<script src="/dist/js/custom.min.js"></script>
|
|
<!--Form JS-->
|
|
<script src="/assets/libs/inputmask/dist/min/jquery.inputmask.bundle.min.js"></script>
|
|
<script src="/dist/js/pages/mask/mask.init.js"></script>
|
|
<script src="/assets/libs/select2/dist/js/select2.full.min.js"></script>
|
|
<script src="/assets/libs/jquery-asColor/dist/jquery-asColor.min.js"></script>
|
|
<script src="/assets/libs/jquery-asGradient/dist/jquery-asGradient.js"></script>
|
|
<script src="/assets/libs/jquery-asColorPicker/dist/jquery-asColorPicker.min.js"></script>
|
|
<script src="/assets/libs/jquery-minicolors/jquery.minicolors.min.js"></script>
|
|
<script src="/assets/libs/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js"></script>
|
|
<script src="/assets/libs/quill/dist/quill.min.js"></script>
|
|
<script src="/lib/printjs/print.min.js"></script>
|
|
<script src="/lib/html2canvas/html2canvas.min.js"></script>
|
|
<script src="/lib/html2canvas/dom-to-image.min.js"></script>
|
|
<!-- Datatables JS-->
|
|
<script src="/lib/datatables/datatables.js"></script>
|
|
|
|
<script src="/lib/jquery-validation/dist/jquery.validate.min.js"></script>
|
|
<script src="/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js"></script>
|
|
<script>
|
|
$(function () {
|
|
app.mount('#requestProduct');
|
|
|
|
// Attach a click event listener to elements with the class 'btn-success'.
|
|
$('#addRequestBtn').on('click', function () {
|
|
// Show the modal
|
|
$('#requestModal').modal('show');
|
|
});
|
|
$('.closeModal').on('click', function () {
|
|
// Show the modal
|
|
$('.modal').modal('hide');
|
|
});
|
|
$('.submit-button').on('click', function () {
|
|
// Show the modal
|
|
$('#rejectModal').modal('hide');
|
|
$('#approveModal').modal('hide');
|
|
});
|
|
});
|
|
const app = Vue.createApp({
|
|
data() {
|
|
return {
|
|
requestID : null,
|
|
userId : null,
|
|
stationId : null,
|
|
productId : null,
|
|
remark: "",
|
|
document: null,
|
|
quantity: 0,
|
|
status: "",
|
|
requestDate : null,
|
|
approvalDate : null,
|
|
productCategory: "",
|
|
fromStoreItem : "",
|
|
assignStoreItem : "",
|
|
stores: null,
|
|
sortBy: "tech",
|
|
productName: null,
|
|
productCategory: null,
|
|
stations: [],
|
|
selectedProduct: "",
|
|
selectedStation: "",
|
|
selectedCategory: "",
|
|
selectedStore: "",
|
|
showRequestModal: false,
|
|
showRejectModal: false,
|
|
showApproveModal: false,
|
|
loading: false,
|
|
request: [],
|
|
currentUser: null,
|
|
currentUserId: null,
|
|
currentrequestID: "",
|
|
rejectremark: "",
|
|
approveremark: "",
|
|
storeUser: "",
|
|
searchQuery: "",
|
|
dropdownOpen: false,
|
|
showRequestModal: false,
|
|
}
|
|
},
|
|
async mounted() {
|
|
this.fetchProducts();
|
|
this.fetchStation();
|
|
await this.fetchUser();
|
|
|
|
// Wait for fetchStoreSpecific to complete before calling fetchStore
|
|
await this.fetchStoreSpecific(this.currentUserId);
|
|
await Promise.all([
|
|
await this.fetchRequest(),
|
|
await this.fetchStore(),
|
|
]);
|
|
},
|
|
watch: {
|
|
showRequestModal(newVal) {
|
|
if (newVal) {
|
|
$('#requestModal').modal('show');
|
|
} else {
|
|
$('#requestModal').modal('hide');
|
|
}
|
|
}
|
|
},
|
|
computed: {
|
|
showProduct() {
|
|
if (!this.productId) {
|
|
return []; // No company selected, return empty list
|
|
}
|
|
const product = this.products.find(c => c.productId === this.productId);
|
|
|
|
this.productCategory = product.category;
|
|
|
|
return product ? product : {};
|
|
},
|
|
filteredProducts() {
|
|
return this.products.filter(item =>
|
|
item.productName.toLowerCase().includes(this.searchQuery.toLowerCase()) ||
|
|
item.modelNo.toLowerCase().includes(this.searchQuery.toLowerCase())
|
|
);
|
|
}
|
|
},
|
|
methods: {
|
|
|
|
async addRequestMaster() {
|
|
try {
|
|
const requiredFields = ['productId', 'quantity', 'fromStoreItem', 'assignStoreItem'];
|
|
|
|
// Loop through required fields and check if any are null or empty
|
|
for (let field of requiredFields) {
|
|
if (this[field] === null || this[field] === '') {
|
|
alert('Request Error', `Please fill in required fields: ${field}.`, 'warning');
|
|
return; // Exit early if validation fails
|
|
}
|
|
}
|
|
|
|
this.userId = this.currentUser.id;
|
|
this.status = "Requested";
|
|
|
|
const now = new Date();
|
|
this.requestDate = new Date(now.getTime() + 8 * 60 * 60 * 1000).toISOString();
|
|
|
|
|
|
// Prepare data as JSON (No file upload)
|
|
const requestDatas = {
|
|
ProductId: this.productId,
|
|
StationId: this.stationId,
|
|
UserId: this.userId,
|
|
ProductCategory: this.productCategory,
|
|
RequestQuantity: this.quantity,
|
|
remarkUser: this.remark || '',
|
|
remarkMasterInv: '',
|
|
status: this.status,
|
|
requestDate: this.requestDate,
|
|
approvalDate: null,
|
|
fromStoreItem: this.fromStoreItem,
|
|
assignStoreItem: this.assignStoreItem,
|
|
Document: this.document
|
|
};
|
|
|
|
$('.modal').modal('hide');
|
|
|
|
// Proceed to send the data to the API
|
|
const response = await fetch('/InvMainAPI/AddRequestMaster', {
|
|
method: 'POST',
|
|
headers: {
|
|
'Content-Type': 'application/json',
|
|
// 'Authorization': `Bearer ${this.token}`
|
|
},
|
|
body: JSON.stringify(requestDatas)
|
|
});
|
|
if (response.ok) {
|
|
// If the form submission was successful, display a success message
|
|
alert('Success!', 'Request form has been successfully submitted.', 'success');
|
|
const requestItem = await response.json();
|
|
this.items.push(requestItem);
|
|
this.resetForm();
|
|
this.fetchRequest();
|
|
|
|
} else {
|
|
throw new Error('Failed to submit form.');
|
|
}
|
|
|
|
} catch (error) {
|
|
console.error('Error:', error);
|
|
|
|
// Displaying error message
|
|
alert('Inventory PSTW Error', `An error occurred: ${error.message}`, 'error');
|
|
}
|
|
},
|
|
|
|
async addRequest() {
|
|
try {
|
|
const requiredFields = ['stationId', 'productId', 'quantity', 'productCategory'];
|
|
|
|
// Loop through required fields and check if any are null or empty
|
|
for (let field of requiredFields) {
|
|
if (this[field] === null || this[field] === '') {
|
|
alert('Request Error', `Please fill in required fields: ${field}.`, 'warning');
|
|
return; // Exit early if validation fails
|
|
}
|
|
}
|
|
|
|
// Proceed to send the data to the API
|
|
const response = await fetch('/InvMainAPI/AddRequest', {
|
|
method: 'POST',
|
|
headers: {
|
|
'Content-Type': 'application/json',
|
|
// 'Authorization': `Bearer ${this.token}`
|
|
},
|
|
body: JSON.stringify(formData)
|
|
});
|
|
if (response.ok) {
|
|
// If the form submission was successful, display a success message
|
|
alert('Success!', 'Request form has been successfully submitted.', 'success');
|
|
const requestItem = await response.json();
|
|
this.items.push(requestItem);
|
|
|
|
this.fetchRequest();
|
|
|
|
} else {
|
|
throw new Error('Failed to submit form.');
|
|
}
|
|
|
|
} catch (error) {
|
|
console.error('Error:', error);
|
|
|
|
// Displaying error message
|
|
alert('Inventory PSTW Error', `An error occurred: ${error.message}`, 'error');
|
|
}
|
|
|
|
},
|
|
|
|
initiateTable() {
|
|
self = this;
|
|
|
|
function formatDateTime(dateString) {
|
|
if (!dateString) {
|
|
return ""; // Return empty string if date is null or undefined
|
|
}
|
|
const date = new Date(dateString);
|
|
// Add 8 hours for GMT+8, as DateTime.UtcNow is used on the backend.
|
|
// If the backend stores dates in a specific timezone and you want to display them
|
|
// in the client's local timezone, you might need a different approach or
|
|
// ensure the backend sends timezone information.
|
|
// For now, assuming backend's UtcNow and client display in GMT+8.
|
|
date.setHours(date.getHours()); // Adjust for local time if needed.
|
|
const year = date.getFullYear();
|
|
const month = String(date.getMonth() + 1).padStart(2, '0');
|
|
const day = String(date.getDate()).padStart(2, '0');
|
|
const hours = String(date.getHours()).padStart(2, '0');
|
|
const minutes = String(date.getMinutes()).padStart(2, '0');
|
|
const seconds = String(date.getSeconds()).padStart(2, '0');
|
|
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
|
|
}
|
|
function renderActionButtons(data, type, row) {
|
|
var actiontButtons = `<div class="row" style="padding: 5px;"> <button type="button" class="btn btn-success approve-btn" data-id="${data}">Approve</button></div> <div class="row" style="padding: 5px;"><button type="button" class="btn btn-danger reject-btn" data-id="${data}">Reject</button></div>`;
|
|
return actiontButtons;
|
|
}
|
|
function renderDocument(data, type, full, meta) {
|
|
if (!data) {
|
|
return "No Document";
|
|
}
|
|
|
|
var imageSrc = full.productImage;
|
|
// Check if the document is an image based on file extension
|
|
var isImage = /\.(jpeg|jpg|png|gif)$/i.test(imageSrc);
|
|
var isPdf = /\.pdf$/i.test(imageSrc);
|
|
// var imageSrc = full.productImage; Fallback to data if imgsrc is unavailable
|
|
|
|
if (isImage) {
|
|
return ` <div class="row"><td>${data}</td></div>
|
|
<a href="${imageSrc}" target="_blank" data-lightbox="image-1">
|
|
<img src="${imageSrc}" alt="Image" class="img-thumbnail" style="width: 100px; height: 100px;" />
|
|
</a>`;
|
|
}
|
|
else if (isPdf) {
|
|
return `<div class="row"><td>${data}</td></div>
|
|
<a href="${imageSrc}" target="_blank">
|
|
<img src="https://upload.wikimedia.org/wikipedia/commons/8/87/PDF_file_icon.svg"
|
|
alt="PDF Document" class="img-thumbnail"
|
|
style="width: 50px; height: 50px;" />
|
|
<br>View PDF
|
|
</a>`;
|
|
}
|
|
}
|
|
|
|
this.requestDatatable = $('#requestDatatable').DataTable({
|
|
"data": this.items.filter(item => item.status === "Requested" && item.assignStoreItem == null),
|
|
"columns": [
|
|
{ "title": "Request ID", "data": "requestID" },
|
|
{ "title": "Action", "data": "requestID", "render": renderActionButtons, "className": "align-middle" },
|
|
{ "title": "Product", "data": "productName", "render": renderDocument },
|
|
{ "title": "Requested by User", "data": "userName" },
|
|
{ "title": "Requested by Station", "data": "stationName" },
|
|
{ "title": "Product Category", "data": "productCategory" },
|
|
{ "title": "Request Quantity", "data": "requestQuantity" },
|
|
{ "title": "Document/Picture", "data": "document", "render": renderDocument },
|
|
{ "title": "User Remark", "data": "remarkUser" },
|
|
{ "title": "Status", "data": "status" },
|
|
{ "title": "Request Date", "data": "requestDate", "render": formatDateTime }, // Apply formatDateTime
|
|
{ "title": "Approval Date", "data": "approvalDate", "render": formatDateTime } // Apply formatDateTime
|
|
],
|
|
responsive: true,
|
|
drawCallback: function (settings) { }
|
|
});
|
|
|
|
this.settledrequestDatatable = $('#settledrequestDatatable').DataTable({
|
|
"data": this.items.filter(item => item.status !== "Requested" && item.assignStoreItem == null),
|
|
"columns": [
|
|
{ "title": "Request ID", "data": "requestID" },
|
|
{ "title": "Product", "data": "productName", "render": renderDocument },
|
|
{ "title": "Requested by User", "data": "userName" },
|
|
{ "title": "Requested by Station", "data": "stationName" },
|
|
{ "title": "Product Category", "data": "productCategory" },
|
|
{ "title": "Request Quantity", "data": "requestQuantity" },
|
|
{ "title": "Document/Picture", "data": "document", "render": renderDocument },
|
|
{ "title": "User Remark", "data": "remarkUser" },
|
|
{ "title": "InvMaster Remark", "data": "remarkMasterInv" },
|
|
{ "title": "Status", "data": "status" },
|
|
{ "title": "Request Date", "data": "requestDate", "render": formatDateTime }, // Apply formatDateTime
|
|
{ "title": "Approval Date", "data": "approvalDate", "render": formatDateTime } // Apply formatDateTime
|
|
],
|
|
responsive: true
|
|
});
|
|
this.requestMasterDatatable = $('#requestMasterDatatable').DataTable({
|
|
"data": this.items.filter(item => item.assignStoreItem != null && item.status == "Requested" && item.userId == this.currentUserId),
|
|
"columns": [
|
|
{ "title": "Request ID", "data": "requestID" },
|
|
{ "title": "Product", "data": "productName", "render": renderDocument },
|
|
{ "title": "From Store", "data": "fromStoreItem" },
|
|
{ "title": "Assign Store", "data": "assignStoreItem" },
|
|
{ "title": "Product Category", "data": "productCategory" },
|
|
{ "title": "Request Quantity", "data": "requestQuantity" },
|
|
{ "title": "Document/Picture", "data": "document", "render": renderDocument },
|
|
{ "title": "Remark", "data": "remarkUser" },
|
|
{ "title": "Status", "data": "status" },
|
|
{ "title": "Request Date", "data": "requestDate", "render": formatDateTime }, // Apply formatDateTime
|
|
{ "title": "Approval Date", "data": "approvalDate", "render": formatDateTime }, // Apply formatDateTime
|
|
{
|
|
"title": "Delete", "data": "requestID",
|
|
"render": function (data) {
|
|
var deleteButton = `<button type="button" class="btn btn-danger delete-btn" data-id="${data}">Delete</button>`;
|
|
return deleteButton;
|
|
},
|
|
"className": "align-middle",
|
|
}
|
|
],
|
|
responsive: true,
|
|
drawCallback: function (settings) { }
|
|
});
|
|
this.requestOtherMasterDatatable = $('#requestOtherMasterDatatable').DataTable({
|
|
"data": this.items.filter(item => item.status == "Requested" && this.storeUser.some(store => store.id === item.fromStoreItem)),
|
|
"columns": [
|
|
{ "title": "Request ID", "data": "requestID" },
|
|
{ "title": "Action", "data": "requestID", "render": renderActionButtons, "className": "align-middle" },
|
|
{ "title": "Product", "data": "productName", "render": renderDocument },
|
|
{ "title": "Requested by User", "data": "userName" },
|
|
{ "title": "From Store", "data": "fromStoreItem" },
|
|
{ "title": "Assign Store", "data": "assignStoreItem" },
|
|
{ "title": "Product Category", "data": "productCategory" },
|
|
{ "title": "Request Quantity", "data": "requestQuantity" },
|
|
{ "title": "Document/Picture", "data": "document", "render": renderDocument },
|
|
{ "title": "User Remark", "data": "remarkUser" },
|
|
{ "title": "Status", "data": "status" },
|
|
{ "title": "Request Date", "data": "requestDate", "render": formatDateTime }, // Apply formatDateTime
|
|
{ "title": "Approval Date", "data": "approvalDate", "render": formatDateTime } // Apply formatDateTime
|
|
],
|
|
responsive: true
|
|
});
|
|
this.settledrequestMasterDatatable = $('#settledrequestMasterDatatable').DataTable({
|
|
"data": this.items.filter(item => item.status != "Requested" && item.assignStoreItem != null),
|
|
"columns": [
|
|
{ "title": "Request ID", "data": "requestID" },
|
|
{ "title": "Product", "data": "productName", "render": renderDocument },
|
|
{ "title": "Requested by User", "data": "userName" },
|
|
{ "title": "From Store", "data": "fromStoreItem" },
|
|
{ "title": "Assign Store", "data": "assignStoreItem" },
|
|
{ "title": "Product Category", "data": "productCategory" },
|
|
{ "title": "Request Quantity", "data": "requestQuantity" },
|
|
{ "title": "Document/Picture", "data": "document", "render": renderDocument },
|
|
{ "title": "User Remark", "data": "remarkUser" },
|
|
{ "title": "Status", "data": "status" },
|
|
{ "title": "Request Date", "data": "requestDate", "render": formatDateTime }, // Apply formatDateTime
|
|
{ "title": "Approval Date", "data": "approvalDate", "render": formatDateTime } // Apply formatDateTime
|
|
],
|
|
responsive: true
|
|
});
|
|
|
|
// Attach event listeners
|
|
$('#requestDatatable tbody').on('click', '.reject-btn', function () {
|
|
const requestID = $(this).data('id');
|
|
self.rejectRequestModal(requestID);
|
|
});
|
|
|
|
$('#requestDatatable tbody').on('click', '.approve-btn', function () {
|
|
const requestID = $(this).data('id');
|
|
self.approveRequestModal(requestID);
|
|
});
|
|
|
|
// Attach event listeners
|
|
$('#requestOtherMasterDatatable tbody').on('click', '.reject-btn', function () {
|
|
const requestID = $(this).data('id');
|
|
self.rejectRequestModal(requestID);
|
|
});
|
|
|
|
$('#requestOtherMasterDatatable tbody').on('click', '.approve-btn', function () {
|
|
const requestID = $(this).data('id');
|
|
self.approveRequestModal(requestID);
|
|
});
|
|
|
|
$('#requestMasterDatatable tbody').off('click', '.delete-btn');
|
|
|
|
$('#requestMasterDatatable tbody').on('click', '.delete-btn', function () {
|
|
const requestID = $(this).data('id');
|
|
self.deleteRequestItem(requestID);
|
|
});
|
|
|
|
this.loading = false;
|
|
|
|
},
|
|
|
|
async fetchRequest() {
|
|
try {
|
|
const response = await fetch('/InvMainAPI/ItemRequestList', {
|
|
method: 'GET', // Specify the HTTP method
|
|
headers: {
|
|
'Content-Type': 'application/json', // Set content type
|
|
}
|
|
});
|
|
|
|
if (!response.ok) {
|
|
throw new Error('Failed to fetch item');
|
|
}
|
|
this.items = await response.json();
|
|
|
|
if (this.requestDatatable) {
|
|
this.requestDatatable.clear().destroy();
|
|
}
|
|
if (this.settledrequestDatatable) {
|
|
this.settledrequestDatatable.clear().destroy();
|
|
}
|
|
if (this.requestMasterDatatable) {
|
|
this.requestMasterDatatable.clear().destroy();
|
|
}
|
|
if (this.requestOtherMasterDatatable) {
|
|
this.requestOtherMasterDatatable.clear().destroy();
|
|
}
|
|
if (this.settledrequestMasterDatatable) {
|
|
this.settledrequestMasterDatatable.clear().destroy();
|
|
}
|
|
this.initiateTable();
|
|
}
|
|
catch (error) {
|
|
console.error('Error fetching item:', error);
|
|
}
|
|
},
|
|
|
|
async fetchProducts() {
|
|
try {
|
|
// const token = localStorage.getItem('token'); // Get the token from localStorage
|
|
const response = await fetch('/InvMainAPI/ProductList', {
|
|
method: 'POST', // Specify the HTTP method
|
|
headers: {
|
|
'Content-Type': 'application/json', // Set content type
|
|
// 'Authorization': `Bearer ${token}` // Include the token in the headers
|
|
}
|
|
});
|
|
|
|
if (!response.ok) {
|
|
throw new Error('Failed to fetch products');
|
|
}
|
|
|
|
this.products = await response.json();
|
|
}
|
|
catch (error) {
|
|
console.error('Error fetching products:', error);
|
|
}
|
|
},
|
|
|
|
async fetchStation() {
|
|
try {
|
|
const response = await fetch('/InvMainAPI/StationList', {
|
|
method: 'POST', // Specify the HTTP method
|
|
headers: {
|
|
'Content-Type': 'application/json'
|
|
}
|
|
});
|
|
if (!response.ok) {
|
|
throw new Error('Failed to fetch suppliers');
|
|
}
|
|
this.stations = await response.json(); // Get the full response object
|
|
|
|
} catch (error) {
|
|
console.error('Error fetching suppliers:', error);
|
|
}
|
|
},
|
|
async fetchStore() {
|
|
try {
|
|
const response = await fetch('/InvMainAPI/StoreList/', {
|
|
method: 'POST', // Specify the HTTP method
|
|
headers: {
|
|
'Content-Type': 'application/json'
|
|
}
|
|
});
|
|
if (!response.ok) {
|
|
throw new Error('Failed to fetch suppliers');
|
|
}
|
|
|
|
const data = await response.json();
|
|
this.stores = data.filter(store =>
|
|
!this.storeUser.some(userStore => userStore.id === store.id)
|
|
);
|
|
|
|
|
|
} catch (error) {
|
|
console.error('Error fetching suppliers:', error);
|
|
}
|
|
},
|
|
async fetchStoreSpecific(currentUserId) {
|
|
try {
|
|
const response = await fetch('/InvMainAPI/StoreSpecificMasterList/' + currentUserId, {
|
|
method: 'POST', // Specify the HTTP method
|
|
headers: {
|
|
'Content-Type': 'application/json'
|
|
}
|
|
});
|
|
if (!response.ok) {
|
|
throw new Error('Failed to fetch store');
|
|
}
|
|
this.storeUser = await response.json(); // Get the full response object
|
|
|
|
} catch (error) {
|
|
console.error('Error fetching suppliers:', error);
|
|
}
|
|
},
|
|
async fetchUsers() {
|
|
try {
|
|
const response = await fetch('/InvMainAPI/UserList', {
|
|
method: 'POST', // Specify the HTTP method
|
|
headers: {
|
|
'Content-Type': 'application/json'
|
|
}
|
|
});
|
|
if (!response.ok) {
|
|
throw new Error('Failed to fetch suppliers');
|
|
}
|
|
this.users = await response.json(); // Get the full response object
|
|
|
|
} catch (error) {
|
|
console.error('Error fetching suppliers:', error);
|
|
}
|
|
},
|
|
|
|
|
|
// FRONT END FUNCTIONS
|
|
//----------------------//
|
|
//Calculate Total Price
|
|
convertCurrency() {
|
|
const total = this.DefaultPrice * this.currencyRate;
|
|
this.convertPrice = total.toFixed(2);
|
|
this.DefaultPrice = this.DefaultPrice
|
|
// .replace(/[^0-9.]/g, '') // Remove non-numeric characters except decimal points
|
|
// .replace(/(\..*)\..*/g, '$1') // Allow only one decimal point
|
|
// .replace(/^(\d*\.\d{0,2})\d*$/, '$1'); // Limit to two decimal places
|
|
|
|
},
|
|
calculateWarrantyEndDate() {
|
|
// Check if DODate and warranty are valid
|
|
if (!this.DODate || isNaN(Date.parse(this.DODate))) {
|
|
this.EndWDate = null;
|
|
return;
|
|
}
|
|
|
|
const DODates = new Date(this.DODate);
|
|
const warrantyMonth = parseInt(this.warranty);
|
|
|
|
// Ensure warranty is a valid number
|
|
if (!isNaN(warrantyMonth)) {
|
|
DODates.setMonth(DODates.getMonth() + warrantyMonth);
|
|
this.EndWDate = DODates.toISOString().split('T')[0];
|
|
} else {
|
|
this.EndWDate = null;
|
|
}
|
|
},
|
|
async approveRequest() {
|
|
// if (!confirm("Are you sure you want to approve this request?")) {
|
|
// return;
|
|
// }
|
|
|
|
const formData = {
|
|
RemarkMasterInv: this.rejectremark,
|
|
|
|
};
|
|
|
|
let requestID = this.currentrequestID;
|
|
try {
|
|
const response = await fetch(`/InvMainAPI/ApproveRequest/${requestID}`, {
|
|
method: 'POST',
|
|
headers: {
|
|
'Content-Type': 'application/json',
|
|
},
|
|
body: JSON.stringify(formData)
|
|
|
|
});
|
|
const result = await response.json();
|
|
|
|
if (result.success) {
|
|
alert(result.message);
|
|
|
|
//static update
|
|
const row = $(`.approve-btn[data-id="${requestID}"]`).closest('tr');
|
|
let rowData = this.requestDatatable.row(row).data();
|
|
|
|
// Update the status and remark
|
|
rowData.status = "Approved";
|
|
|
|
// Remove row from requestDatatable
|
|
this.requestDatatable.row(row).remove().draw();
|
|
|
|
// Add updated row to settledrequestDatatable
|
|
this.settledrequestDatatable.row.add(rowData).draw();
|
|
|
|
|
|
} else {
|
|
alert(result.message);
|
|
}
|
|
}
|
|
catch (error) {
|
|
console.error("Error approving request:", error);
|
|
// alert("An error occurred while approving the request.");
|
|
}
|
|
finally {
|
|
this.loading = false;
|
|
}
|
|
},
|
|
|
|
async rejectRequest() {
|
|
|
|
const formData = {
|
|
RemarkMasterInv: this.rejectremark,
|
|
|
|
};
|
|
|
|
let requestID = this.currentrequestID;
|
|
|
|
try {
|
|
|
|
const response = await fetch(`/InvMainAPI/RejectRequest/${requestID}`, {
|
|
method: 'POST',
|
|
headers: {
|
|
'Content-Type': 'application/json',
|
|
// 'Authorization': `Bearer ${this.token}`
|
|
},
|
|
body: JSON.stringify(formData)
|
|
|
|
});
|
|
if (response.ok) {
|
|
// If the form submission was successful, display a success message
|
|
// alert('Success!', 'Request has been Rejected.', 'success');
|
|
|
|
const row = $(`.approve-btn[data-id="${requestID}"]`).closest('tr');
|
|
let rowData = this.requestDatatable.row(row).data();
|
|
|
|
// Update the status and remark
|
|
rowData.status = "Rejected";
|
|
rowData.remarkMasterInv = this.rejectremark;
|
|
|
|
// Remove row from requestDatatable
|
|
this.requestDatatable.row(row).remove().draw();
|
|
|
|
// Add updated row to settledrequestDatatable
|
|
this.settledrequestDatatable.row.add(rowData).draw();
|
|
|
|
|
|
} else {
|
|
throw new Error('Failed to submit form.');
|
|
}
|
|
|
|
} catch (error) {
|
|
console.error('Error:', error);
|
|
|
|
// Displaying error message
|
|
alert('Inventory PSTW Error', `An error occurred: ${error.message}`, 'error');
|
|
}
|
|
finally {
|
|
this.loading = false;
|
|
}
|
|
},
|
|
async rejectRequestModal(requestID, remark) {
|
|
|
|
this.currentrequestID = requestID;
|
|
this.rejectremark = remark;
|
|
|
|
|
|
$(`#rejectModal`).modal('show');
|
|
|
|
|
|
},
|
|
async approveRequestModal(requestID, remark) {
|
|
|
|
this.currentrequestID = requestID;
|
|
this.approveremark = remark;
|
|
|
|
|
|
$(`#approveModal`).modal('show');
|
|
|
|
|
|
},
|
|
async fetchUser() {
|
|
try {
|
|
const response = await fetch(`/IdentityAPI/GetUserInformation/`, {
|
|
method: 'POST',
|
|
});
|
|
if (response.ok) {
|
|
const data = await response.json();
|
|
this.currentUser = data?.userInfo || null;
|
|
const companyDeptData = await this.currentUser.department;
|
|
this.currentUserCompanyDept = companyDeptData;
|
|
this.selectedCompany = companyDeptData?.companyId || "";
|
|
this.selectedDepartment = companyDeptData?.departmentId || "";
|
|
this.currentUserId = this.currentUser.id;
|
|
}
|
|
else {
|
|
console.error(`Failed to fetch user: ${response.statusText}`);
|
|
}
|
|
}
|
|
catch (error) {
|
|
console.error('There was a problem with the fetch operation:', error);
|
|
}
|
|
},
|
|
|
|
closeDropdown() {
|
|
this.dropdownOpen = false; // Tutup dropdown
|
|
},
|
|
|
|
selectProduct(item) {
|
|
this.selectedProduct = item;
|
|
this.productId = item.productId;
|
|
this.searchQuery = item.productName + " (" + item.modelNo + ")";
|
|
this.dropdownOpen = false;
|
|
},
|
|
|
|
closeModal() {
|
|
this.showRequestModal = false;
|
|
},
|
|
|
|
handleFileUpload(event) {
|
|
const file = event.target.files[0];
|
|
|
|
if (file) {
|
|
const reader = new FileReader();
|
|
reader.onload = (e) => {
|
|
this.document = e.target.result.split(',')[1]; // Get Base64 string (remove metadata)
|
|
};
|
|
reader.readAsDataURL(file);
|
|
} else {
|
|
this.document = null;
|
|
}
|
|
},
|
|
|
|
resetForm() {
|
|
this.searchQuery = "";
|
|
this.stationId = "";
|
|
this.productId = "";
|
|
this.remark = "";
|
|
this.document = null;
|
|
this.quantity = 0;
|
|
this.status = "";
|
|
this.requestDate = null;
|
|
this.approvalDate = null;
|
|
this.productCategory = "";
|
|
this.fromStoreItem = "",
|
|
this.assignStoreItem = "",
|
|
|
|
this.productName = null;
|
|
this.selectedProduct = "";
|
|
this.selectedStation = "";
|
|
this.selectedCategory = "";
|
|
this.loading = false;
|
|
this.rejectremark = "";
|
|
},
|
|
|
|
async deleteRequestItem(requestID) {
|
|
if (!confirm("Are you sure you want to delete this request?")) {
|
|
return false;
|
|
}
|
|
try {
|
|
const response = await fetch(`/InvMainAPI/DeleteRequest/${requestID}`, {
|
|
method: 'DELETE',
|
|
headers: {
|
|
'Content-Type': 'application/json',
|
|
},
|
|
});
|
|
const result = await response.json();
|
|
|
|
if (result.success) {
|
|
alert(result.message);
|
|
|
|
if ($.fn.dataTable.isDataTable('#requestMasterDatatable')) {
|
|
const table = $('#requestMasterDatatable').DataTable();
|
|
table.row($(`.delete-btn[data-id="${requestID}"]`).closest('tr')).remove().draw();
|
|
}
|
|
|
|
this.request = this.request.filter(req => req.requestID !== requestID);
|
|
} else {
|
|
alert(result.message);
|
|
}
|
|
}
|
|
catch (error) {
|
|
console.error("Error deleting item:", error);
|
|
alert("An error occurred while deleting the item.");
|
|
}
|
|
finally {
|
|
this.loading = false;
|
|
}
|
|
},
|
|
|
|
handleSorting() {
|
|
if (this.requestDatatable) {
|
|
this.requestDatatable.clear().destroy();
|
|
}
|
|
if (this.settledrequestDatatable) {
|
|
this.settledrequestDatatable.clear().destroy();
|
|
}
|
|
if (this.requestMasterDatatable) {
|
|
this.requestMasterDatatable.clear().destroy();
|
|
}
|
|
if (this.requestOtherMasterDatatable) {
|
|
this.requestOtherMasterDatatable.clear().destroy();
|
|
}
|
|
if (this.settledrequestMasterDatatable) {
|
|
this.settledrequestMasterDatatable.clear().destroy();
|
|
}
|
|
this.initiateTable();
|
|
},
|
|
},
|
|
directives: {
|
|
clickOutside: {
|
|
beforeMount(el, binding) {
|
|
el.clickOutsideEvent = (event) => {
|
|
// Make sure the click is outside the element
|
|
if (!el.contains(event.target) && el !== event.target) {
|
|
binding.value?.(); // Call the function to close the modal
|
|
}
|
|
};
|
|
setTimeout(() => {
|
|
document.body.addEventListener("click", el.clickOutsideEvent);
|
|
}, 0); // Delay to avoid triggering immediately when opening
|
|
},
|
|
beforeUnmount(el) {
|
|
document.body.removeEventListener("click", el.clickOutsideEvent);
|
|
}
|
|
}
|
|
}
|
|
|
|
});
|
|
</script>
|
|
|
|
|
|
</body>
|
|
</html>
|
|
|
|
|