Item Movement User
This commit is contained in:
parent
0225c22696
commit
9857983174
@ -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>
|
||||
|
||||
@ -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];
|
||||
},
|
||||
|
||||
|
||||
@ -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",
|
||||
|
||||
@ -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,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user