diff --git a/Areas/Identity/Pages/Account/ForgotPassword.cshtml b/Areas/Identity/Pages/Account/ForgotPassword.cshtml index 106b8d1..a2c92c4 100644 --- a/Areas/Identity/Pages/Account/ForgotPassword.cshtml +++ b/Areas/Identity/Pages/Account/ForgotPassword.cshtml @@ -4,7 +4,6 @@ ViewData["Title"] = "Forgot your password?"; } -

@ViewData["Title"]

Enter your email.


diff --git a/Areas/Identity/Pages/Account/ForgotPasswordConfirmation.cshtml b/Areas/Identity/Pages/Account/ForgotPasswordConfirmation.cshtml index 4f5ae99..a9c6d11 100644 --- a/Areas/Identity/Pages/Account/ForgotPasswordConfirmation.cshtml +++ b/Areas/Identity/Pages/Account/ForgotPasswordConfirmation.cshtml @@ -4,7 +4,6 @@ ViewData["Title"] = "Forgot password confirmation"; } -

@ViewData["Title"]

Please check your email to reset your password.

diff --git a/Areas/Inventory/Views/InventoryMaster/ItemMovement.cshtml b/Areas/Inventory/Views/InventoryMaster/ItemMovement.cshtml index 6f0a0b3..870299c 100644 --- a/Areas/Inventory/Views/InventoryMaster/ItemMovement.cshtml +++ b/Areas/Inventory/Views/InventoryMaster/ItemMovement.cshtml @@ -44,10 +44,57 @@ color: purple; } - .ms-auto { margin-left: auto !important; /* Push Complete/Incomplete to right */ } + + .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; + } + @await Html.PartialAsync("~/Areas/Inventory/Views/_InventoryPartial.cshtml")
@@ -73,14 +120,31 @@

Search Station:

- +
-

Pending Item Movement

+

Pending Item Transit

@@ -96,6 +160,9 @@

Complete Item Movessment

+
+

All Item Movement

+
@@ -104,6 +171,18 @@
+
+

Assign Station

+
+
+
+
+ Loading... +
+
+
+
@@ -130,7 +209,7 @@ Loading...
-
+
@*

Item : {{ group.uniqueID }}

*@

Item : {{ group.uniqueID }}

@@ -159,13 +238,13 @@ -
-

{{movement.action === 'Assign' ? 'Assign Date' : 'Send Date'}}

- {{ movement.sendDate }} +
+

{{movement.action === 'Assign' ? 'Assign Date' : movement.action === 'Register' ? 'Register Date' : 'Send Date'}}

+ {{movement.action !== 'Register' ? movement.sendDate : movement.date }}
-
+

Receive Date:

{{ movement.receiveDate || 'Not arrive' }}
@@ -260,13 +339,13 @@ -
-

{{movement.action === 'Assign' ? 'Assign Date' : 'Send Date'}}

- {{ movement.sendDate }} +
+

{{movement.action === 'Assign' ? 'Assign Date' : movement.action === 'Register' ? 'Register Date' : 'Send Date'}}

+ {{movement.action !== 'Register' ? movement.sendDate : movement.date }}
-
+

Receive Date:

{{ movement.receiveDate || 'Not arrive' }}
@@ -347,11 +426,9 @@
- -
-
@@ -363,7 +440,7 @@
-
+
@*

Item : {{ group.uniqueID }}

*@ @@ -390,14 +467,14 @@ - -
-

{{movement.action === 'Assign' ? 'Assign Date' : 'Send Date'}}

- {{ movement.sendDate }} + +
+

{{movement.action === 'Assign' ? 'Assign Date' : movement.action === 'Register' ? 'Register Date' : 'Send Date'}}

+ {{movement.action !== 'Register' ? movement.sendDate : movement.date }}
-
+

Receive Date:

{{ movement.receiveDate || 'Not arrive' }}
@@ -484,14 +561,14 @@ - -
-

{{movement.action === 'Assign' ? 'Assign Date' : 'Send Date'}}

- {{ movement.sendDate }} + +
+

{{movement.action === 'Assign' ? 'Assign Date' : movement.action === 'Register' ? 'Register Date' : 'Send Date'}}

+ {{movement.action !== 'Register' ? movement.sendDate : movement.date }}
-
+

Receive Date:

{{ movement.receiveDate || 'Not arrive' }}
@@ -602,6 +679,28 @@
+
+ + + Page {{ currentPage }} of {{ totalPages }} + + +
+ +
+ + + Page {{ currentPageStation }} of {{ itemsPerPageStation }} + +
@@ -644,6 +743,7 @@ selectedTeamType: "", selectedtoStation: "", consignmentNoteUrl: "", + assignStationDatatable: null, showItemModal: false, loading: false, items: [], @@ -651,20 +751,39 @@ currentUserCompanyDept: null, sortBy: "all", searchQuery: "", + searchQueryStation: "", categoryVisible: {}, historyVisible: {}, detailsVisible: {}, currentRole:"", stationName: "", searchStation: "", - + currentPage: 1, + itemsPerPage: 10, + currentPageStation : 1, + itemsPerPageStation: 10, + dropdownOpen: false, } }, mounted() { this.fetchItem(); - + this.fetchStation(); }, computed: { + paginatedItems() { + const start = (this.currentPage - 1) * this.itemsPerPage; + const end = start + this.itemsPerPage; + return Object.fromEntries( + Object.entries(this.filteredItems).slice(start, end) + ); + }, + totalPages() { + return Math.ceil(Object.keys(this.filteredItems).length / this.itemsPerPage); + }, + + totalPagesStation() { + return Math.ceil(Object.keys(this.filteredStation).length / this.itemsPerPage); + }, groupedItems() { let grouped = this.items.reduce((acc, movement) => { if (!acc[movement.itemId]) { @@ -761,16 +880,16 @@ }, filteredStation() { - if (!this.searchStation) { + if (!this.searchQueryStation) { return this.groupedByStation; } - let searchQuery = this.searchStation.toLowerCase(); + let searchQueryStation = this.toLowerCase(); let grouped = this.groupedByStation; let filtered = {}; Object.keys(grouped).forEach(station => { - if (station.toLowerCase().includes(searchQuery)) { + if (station.toLowerCase().includes(searchQueryStation)) { filtered[station] = grouped[station]; } }); @@ -780,6 +899,30 @@ }, methods: { + paginatedItemsStation(item) { + const start = (this.currentPageStation - 1) * this.itemsPerPageStation; + const end = start + this.itemsPerPageStation; + return Object.fromEntries( + Object.entries(item).slice(start, end) + ); + }, + selectStation(item) { + this.searchQueryStation = item.stationName; + this.dropdownOpen = false; + }, + closeDropdown() { + this.dropdownOpen = false; // Tutup dropdown + }, + goToPage(page) { + if (page >= 1 && page <= this.totalPages) { + this.currentPage = page; + } + }, + goToPageStation(page) { + if (page >= 1 && page <= this.itemsPerPageStation) { + this.currentPageStation = page; + } + }, remark(remark) { document.getElementById("remarkContent").innerText = remark || "No remark message provide."; let modal = new bootstrap.Modal(document.getElementById("remarkModal")); @@ -963,6 +1106,25 @@ console.error('There was a problem with the fetch operation:', 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 Station'); + } + + const data = await response.json(); + this.stations = data; + + } catch (error) { + console.error('Error fetching Station:', error); + } + }, handleSorting() { this.renderTables(); }, @@ -979,11 +1141,15 @@ if (this.itemMovementCompleteDatatable) { this.itemMovementCompleteDatatable.destroy(); } + if (this.assignStationDatatable) { + this.assignStationDatatable.destroy(); + } this.itemMovementNotCompleteDatatable = $("#itemMovementNotCompleteDatatable").DataTable({ data: this.items.filter((m) => m.movementComplete == 0), columns: [ { title: "Unique Id", data: "id" }, + { title: "Product Name", data: "productName", render: (data, type, full) => { return `${data}
${renderFile(full.productImage)}`; } }, { title: "Product Code", data: "uniqueID" }, { title: "Action", data: "action" }, { title: "Send Date", data: "sendDate" }, @@ -994,35 +1160,7 @@ { title: "Start Status", data: "toOther" }, { title: "Product Category", data: "productCategory" }, { title: "Qty", data: "quantity" }, - { - title: "Note", - data: "consignmentNote", - render: function (data, type, full, meta) { - if (!data) { - return "No Document"; - } - - // Check if the document is an image based on file extension - var isImage = /\.(jpeg|jpg|png|gif)$/i.test(data); - var isPdf = /\.pdf$/i.test(data); - - if (isImage) { - return ` - Image - `; - } - else if (isPdf) { - return ` - PDF Document -
View PDF -
`; - } else { - return `Download File`; - } - }, - }, + { title: "Note", data: "consignmentNote", render: renderFile }, { title: "Remark", data: "remark" }, ], order: [[0, "desc"]], @@ -1030,9 +1168,10 @@ }); this.itemMovementCompleteDatatable = $("#itemMovementCompleteDatatable").DataTable({ - data: this.items.filter((m) => m.movementComplete == 1), + data: this.items.filter((m) => m.movementComplete == 1 && m.action !== "Assign"), columns: [ { title: "Unique Id", data: "id" }, + { title: "Product Name", data: "productName", render: (data, type, full) => { return `${data}
${renderFile(full.productImage)}`; } }, { title: "Product Code", data: "uniqueID" }, { title: "Send Date", data: "sendDate" }, { title: "Receive Date", data: "receiveDate" }, @@ -1046,85 +1185,57 @@ { title: "Start Status", data: "toOther" }, { title: "Latest Status", data: "latestStatus" }, { title: "Product Category", data: "productCategory" }, - { title: "Qty", data: "quantity" }, - { title: "Note", - data: "consignmentNote", - render: function (data, type, full, meta) { - if (!data) { - return "No Document"; - } - - // Check if the document is an image based on file extension - var isImage = /\.(jpeg|jpg|png|gif)$/i.test(data); - var isPdf = /\.pdf$/i.test(data); - - if (isImage) { - return ` - Image - `; - } - else if (isPdf) { - return ` - PDF Document -
View PDF -
`; - } else { - return `Download File`; - } - }, - }, + { title: "Note", data: "consignmentNote", render: renderFile }, { title: "Remark", data: "remark" }, ], order: [[0, "desc"]], responsive: true, }); - this.stationDatatable = $("#stationDatatable").DataTable({ + this.assignStationDatatable = $("#assignStationDatatable").DataTable({ data: this.items.filter((m) => m.action === "Assign" ), columns: [ { title: "Unique Id", data: "id" }, + { title: "Product Name", data: "productName", render: (data, type, full) => { return `${data}
${renderFile(full.productImage)}`; } }, { title: "Product Code", data: "uniqueID" }, { title: "Assign Date", data: "sendDate" }, - { title: "From User", data: "toUserName" }, + { title: "Action", data: "action" }, + { title: "Station User PIC", data: "toUserName" }, { title: "From Station", data: "toStationName" }, { title: "Last Station", data: "lastStationName" }, { title: "Qty", data: "quantity" }, - { - title: "Note", - data: "consignmentNote", - render: function (data, type, full, meta) { - if (!data) { - return "No Document"; - } - - // Check if the document is an image based on file extension - var isImage = /\.(jpeg|jpg|png|gif)$/i.test(data); - var isPdf = /\.pdf$/i.test(data); - - if (isImage) { - return ` - Image - `; - } - else if (isPdf) { - return ` - PDF Document -
View PDF -
`; - } else { - return `Download File`; - } - }, - }, + { title: "Note", data: "consignmentNote", render: renderFile }, { title: "Remark", data: "remark" }, ], responsive: true, }); - }, + + function renderFile(data, type, full, meta) { + if (!data) { + return "No Document"; + } + + // Check if the document is an image based on file extension + var isImage = /\.(jpeg|jpg|png|gif)$/i.test(data); + var isPdf = /\.pdf$/i.test(data); + + if (isImage) { + return ` + Image + `; + } + else if (isPdf) { + return ` + PDF Document +
View PDF +
`; + } else { + return `Download File`; + } + } + }, toggleCategory(itemId) { this.categoryVisible[itemId] = !this.categoryVisible[itemId]; @@ -1148,6 +1259,21 @@ }, }, + directives: { + clickOutside: { + beforeMount(el, binding) { + el.clickOutsideEvent = (event) => { + if (!(el.contains(event.target))) { + binding.value?.(); // Guna optional chaining untuk elak error + } + }; + document.body.addEventListener("click", el.clickOutsideEvent); + }, + unmounted(el) { + document.body.removeEventListener("click", el.clickOutsideEvent); + } + } + } }); } \ No newline at end of file diff --git a/Areas/Inventory/Views/InventoryMaster/ItemRegistration.cshtml b/Areas/Inventory/Views/InventoryMaster/ItemRegistration.cshtml index 2f41ebb..1670fa4 100644 --- a/Areas/Inventory/Views/InventoryMaster/ItemRegistration.cshtml +++ b/Areas/Inventory/Views/InventoryMaster/ItemRegistration.cshtml @@ -80,14 +80,14 @@