diff --git a/Areas/Inventory/Views/ItemMovement/ItemMovementUser.cshtml b/Areas/Inventory/Views/ItemMovement/ItemMovementUser.cshtml index 59c3380..4357a51 100644 --- a/Areas/Inventory/Views/ItemMovement/ItemMovementUser.cshtml +++ b/Areas/Inventory/Views/ItemMovement/ItemMovementUser.cshtml @@ -15,6 +15,56 @@ .table td img { display: block !important; } + + + .text-true { + color: green; + } + + .text-false { + color: red; + } + + .text-primary { + color: blue; /* Warna asal untuk 'Receive' */ + } + + .text-warning { + color: orange; /* Warna oren untuk 'Return' */ + } + + .fixed-label { + margin-left:100px; + font-weight: bold; + min-width: 120px; /* Ensure labels have same width */ + } + + .fixed-labelStatus { + margin-left: 25px; + font-weight: bold; + min-width: 20px; /* Ensure labels have same width */ + } + .fixed-value { + min-width: 150px; + margin-right:-20px; + display: inline-block; + } + + .gap-4 { + gap: 30px; /* Increase spacing between Send Date and Receive Date */ + } + + .gap-2 { + gap: 1rem !important; /* Ensure Status is closer to its value */ + } + + .me-5 { + margin-right: 2rem !important; /* Move Receive/Return further from Send Date */ + } + + .ms-auto { + margin-left: auto !important; /* Push Complete/Incomplete to right */ + } @await Html.PartialAsync("~/Areas/Inventory/Views/_InventoryPartialUser.cshtml"); @@ -49,40 +99,67 @@
-
+

Item Name: {{ group.productName }}

-
- {{ movement.toOther === 'On Delivery' ? 'Receive' : 'Return' }}: - | Send Date: {{ movement.sendDate }} - | Receive Date: {{ movement.receiveDate || 'Not arrive' }} - | Status: {{ movement.latestStatus || movement.toOther }} - | +
+ +

+ {{ movement.toOther === 'On Delivery' ? 'Receive' : 'Return' }} +

+ +
+

Send Date:

+ {{ movement.sendDate }} +
+ +
+

Receive Date:

+ {{ movement.receiveDate || 'Not arrive' }} +
+ +
+

Action:

+ {{ movement.action}} +
+ +
+

Status:

+ {{ movement.latestStatus || movement.toOther }} +
+ + + +

+ {{ movement.movementComplete == 1 ? 'Complete' : 'Incomplete' }} +

+
-

Information: {{ movement.toOther }}

-

User: {{ movement.toUser }}

-

Station: {{ movement.toStationName }}

-

Store: {{ movement.toStoreName }}

+

Information: {{ movement.toOther }}

+

User: {{ movement.toUserName }}

+

Station: {{ movement.toStationName }}

+

Store: {{ movement.toStoreName }}

+

{{ movement.latestStatus || movement.toOther }}

-

Information: {{ movement.toOther }}

-

User: {{ movement.lastUser }}

-

Station: {{ movement.lastStationName }}

-

Store: {{ movement.lastStoreName }}

+

Information: {{ movement.latestStatus }}

+

User: {{ movement.lastUserName }}

+

Station: {{ movement.lastStationName }}

+

Store: {{ movement.lastStoreName }}

@@ -90,6 +167,7 @@
+
@@ -111,8 +189,12 @@ sortBy: 'all', // Sorting option } }, - computed: { - groupedByItem() { + mounted() { + console.log("Vue app mounted!"); + this.fetchItemMovement(); + }, + methods: { + getGroupedByItem() { return this.itemMovements.reduce((acc, movement) => { if (!acc[movement.itemId]) { acc[movement.itemId] = { @@ -120,15 +202,10 @@ movements: [] }; } - acc[movement.itemId].movements.push({...movement, showDetails: false}); + acc[movement.itemId].movements.push(movement); // Jangan reset showDetails return acc; }, {}); }, - }, - mounted() { - this.fetchItemMovement(); - }, - methods: { async fetchItemMovement() { try { const response = await fetch('/InvMainAPI/ItemMovementUser', { @@ -155,7 +232,7 @@ if (this.itemMovementCompleteDatatable) { this.itemMovementCompleteDatatable.clear().destroy(); } - + this.$forceUpdate(); this.renderTables(); } catch (error) { @@ -234,12 +311,13 @@ }, toggleDetails(id) { - const movement = this.itemMovements.find(m => m.id === id); + const movement = this.itemMovements.find(mov => mov.id === id); if (movement) { - movement.showDetails = !movement.showDetails; + movement.showDetails = !movement.showDetails; // Toggle value } }, + resetForm() { this.itemMovement = ''; },