Item Movement User

This commit is contained in:
ArifHilmi 2025-03-07 14:29:48 +08:00
parent 0225c22696
commit 9857983174
4 changed files with 682 additions and 692 deletions

View File

@ -1,5 +1,4 @@

@{
@{
ViewData["Title"] = "Item Form";
Layout = "~/Views/Shared/_Layout.cshtml";
}
@ -12,6 +11,7 @@
.QrPrintFont {
font-family: 'OCR-A', monospace;
}
.table td img {
display: block !important;
}
@ -223,7 +223,7 @@
<div class="dropdown">
<select class="btn btn-primary dropdown-toggle col-md-10" data-toggle="dropdown" aria-expanded="false" v-model="selectedSupplier" required>
<option class="btn-light" value="" disabled selected>Select Supplier</option>
<option class="btn-light" v-for="(item, index) in suppliers" :value="item.supplierId">{{ item.supplierCompName }}</option>
<option class="btn-light" v-for="(item, index) in suppliers">{{ item.supplierCompName }}</option>
</select>
</div>
</div>
@ -356,10 +356,10 @@
</div>
@section Scripts {
@{
@{
await Html.RenderPartialAsync("_ValidationScriptsPartial");
}
<script>
}
<script>
$(function () {
app.mount('#registerItem');
@ -404,7 +404,7 @@
DefaultPrice: 0.01,
currencyRate: 1,
convertPrice: 0.01,
DONo:null,
DONo: null,
DODate: null,
warranty: 0,
EndWDate: null,
@ -967,7 +967,7 @@
<div class="row-fluid">
<div class="col-12 h3"style="font-family: 'Verdana', monospace;"><b>${this.thisQRInfo.departmentName}</b></div>
<div class="col-12 h4"style="font-family: 'Arial', monospace;"><b>${this.thisQRInfo.productShortName}</b></div>
<div class="col-12 h4"style="font-family: 'Arial', monospace;"><b>${this.thisQRInfo.serialNumber??"-"}</b></div>
<div class="col-12 h4"style="font-family: 'Arial', monospace;"><b>${this.thisQRInfo.serialNumber ?? "-"}</b></div>
<div class="col-12 h4"style="font-family: 'Arial', monospace;"><b>${this.thisQRInfo.partNumber}</b></div>
</div>
</div>
@ -1022,5 +1022,5 @@
},
});
</script>
</script>
}

View File

@ -4,19 +4,6 @@
Layout = "~/Views/Shared/_Layout.cshtml";
}
<style>
@@font-face {
font-family: 'OCR-A';
src: url('../assets/fonts/ocraext.ttf');
}
.QrPrintFont {
font-family: 'OCR-A', monospace;
}
.table td img {
display: block !important;
}
.text-true {
color: green;
}
@ -88,13 +75,6 @@
<div class="card-body">
<table class="table table-bordered table-hover table-striped no-wrap" id="itemMovementCompleteDatatable" style="width:100%;border-style: solid; border-width: 1px"></table>
</div>
<div class="card-header">
<h3>Assign Station Movement</h3>
</div>
<div class="card-body">
<table class="table table-bordered table-hover table-striped no-wrap" id="stationDatatable" style="width:100%;border-style: solid; border-width: 1px"></table>
</div>
</div>
</div>
@ -778,10 +758,8 @@
latestMovements.forEach(movement => {
if (movement.movementComplete == 0) {
notCompleteData.push(movement);
} else if (movement.movementComplete == 1 && movement.action !== "Assign") {
} else if (movement.movementComplete == 1) {
completeData.push(movement);
} else if (movement.movementComplete == 1 && movement.action == "Assign") {
assignedData.push(movement);
}
});
@ -831,24 +809,6 @@
responsive: true,
});
// Table 3: Assigned Movements
this.stationDatatable = $("#stationDatatable").DataTable({
data: assignedData,
columns: [
{ title: "Unique Id", data: "id" },
{ title: "Product Name", data: "productName" },
{ title: "Product Code", data: "uniqueID" },
{ title: "Assign Date", data: "sendDate" },
{ title: "From User", data: "toUserName" },
{ title: "From Station", data: "toStationName" },
{ title: "Last Station", data: "lastStationName" },
{ title: "Qty", data: "quantity" },
{ title: "Note", data: "consignmentNote", render: renderFile },
{ title: "Remark", data: "remark" },
],
responsive: true,
});
// Function to render file (image/PDF)
function renderFile(data, type, full, meta) {
if (!data) {
@ -881,6 +841,7 @@
},
toggleHistory(itemId) {
this.historyVisible = {};
this.historyVisible[itemId] = !this.historyVisible[itemId];
},

View File

@ -452,18 +452,37 @@
$(td).attr('id', `qr${cellData}`);
},
},
{ "title": "Product Image",
"data": "productPicture",
"render": function (data, type, full, meta) {
var image = `<a href="${data}" target="_blank" data-lightbox="image-1">
<img src="${data}" alt="Image" class="img-thumbnail" style="width: 100px; height: 100px;" />
</a>`;
return image;
},
},
{
"title": "Product Name",
"data": "productName",
"render": function (data, type, full, meta) {
if (!data) {
return "No Document";
}
var imageSrc = full.productPicture;
// 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
console.log(full);
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>`;
}
},
},
{
"title": "Product Category",
@ -530,16 +549,6 @@
return deleteButton;
},
"className": "align-middle",
// "title": "Delete",
// "data": "requestID",
// "render": function (data, type, row) {
// if (row.status === "Approved" || row.status === "Rejected") {
// return `<button type="button" class="btn btn-danger delete-btn" data-id="${data}" disabled>Delete</button>`;
// } else {
// return `<button type="button" class="btn btn-danger delete-btn" data-id="${data}">Delete</button>`;
// }
// },
// "className": "align-middle",
}
],
@ -560,18 +569,37 @@
"title": "Status",
"data": "status",
},
{ "title": "Product Image",
"data": "productPicture",
"render": function (data, type, full, meta) {
var image = `<a href="${data}" target="_blank" data-lightbox="image-1">
<img src="${data}" alt="Image" class="img-thumbnail" style="width: 100px; height: 100px;" />
</a>`;
return image;
},
},
{
"title": "Product Name",
"data": "productName",
"render": function (data, type, full, meta) {
if (!data) {
return "No Document";
}
var imageSrc = full.productPicture;
// 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
console.log(full);
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>`;
}
},
},
{
"title": "Product Category",

View File

@ -815,6 +815,7 @@ namespace PSTW_CentralSystem.Controllers.API.Inventory
i.ToUser,
UniqueID = i.Item?.UniqueID,
ProductName = i.Item?.Product?.ProductName,
ProductImage = i.Item?.Product?.ImageProduct,
LastUserName = i.FromUser?.FullName,
LastStoreName = i.FromStore?.StoreName,
LastStationName = i.FromStation?.StationName,