From 8f4a22b80274984982635f25bd29407771835f03 Mon Sep 17 00:00:00 2001 From: Pascal Marzec Date: Thu, 11 Jan 2024 10:30:37 +0100 Subject: [PATCH 1/8] feat(SupplierDashboard.vue): added locations and customer Stock and exported mock data to .json --- .../src/assets/supplierDashboardMockData.json | 270 ++++++++++++++++++ frontend/src/views/SupplierDashboard.vue | 129 ++++----- 2 files changed, 318 insertions(+), 81 deletions(-) create mode 100644 frontend/src/assets/supplierDashboardMockData.json diff --git a/frontend/src/assets/supplierDashboardMockData.json b/frontend/src/assets/supplierDashboardMockData.json new file mode 100644 index 00000000..d502f2c8 --- /dev/null +++ b/frontend/src/assets/supplierDashboardMockData.json @@ -0,0 +1,270 @@ +[ + { + "name": "Customer 1", + "materials": { + "centralControlUnit": { + "name": "Central Control Unit", + "bpns": { + "siteOne": { + "name": "Site 1", + "bpna": { + "addressOne": { + "name": "Address 1", + "demandActual": [398,23,183,53,341,492,282,80,48,199,417,223,242,263,262,185,313,78,209,405,7,134,362,196,247,248,336,302], + "demandAdditional": [], + "production": [398,23,183,53,341,492,282,80,48,199,417,223,242,263,262,185,313,78,209,405,7,134,362,196,247,248,336,302], + "currentStock": 300 + }, + "addressTwo": { + "name": "Address 2", + "demandActual": [398,23,183,53,341,492,282,80,48,199,417,223,242,263,262,185,313,78,209,405,7,134,362,196,247,248,336,302], + "demandAdditional": [], + "production": [398,23,183,53,341,492,282,80,48,199,417,223,242,263,262,185,313,78,209,405,7,134,362,196,247,248,336,302], + "currentStock": 350 + } + } + }, + "siteTwo": { + "name": "Site 2", + "bpna": { + "addressOne": { + "name": "Address 1", + "demandActual": [398,23,183,53,341,492,282,80,48,199,417,223,242,263,262,185,313,78,209,405,7,134,362,196,247,248,336,302], + "demandAdditional": [], + "production": [398,23,183,53,341,492,282,80,48,199,417,223,242,263,262,185,313,78,209,405,7,134,362,196,247,248,336,302], + "currentStock": 325 + }, + "addressTwo": { + "name": "Address 2", + "demandActual": [398,23,183,53,341,492,282,80,48,199,417,223,242,263,262,185,313,78,209,405,7,134,362,196,247,248,336,302], + "demandAdditional": [], + "production": [398,23,183,53,341,492,282,80,48,199,417,223,242,263,262,185,313,78,209,405,7,134,362,196,247,248,336,302], + "currentStock": 375 + } + } + } + } + }, + "steeringWheel": { + "name": "Steering Wheel", + "bpns": { + "siteOne": { + "name": "Site 1", + "bpna": { + "addressOne": { + "name": "Address 1", + "demandActual": [342,294,48,32,243,180,113,395,5,477,223,31,193,418,472,338,45,219,149,324,92,28,129,481,235,348,132,259], + "demandAdditional": [], + "production": [342,294,48,32,243,180,113,395,5,477,223,31,193,418,472,338,45,219,149,324,92,28,129,481,235,348,132,259], + "currentStock": 200 + }, + "addressTwo": { + "name": "Address 2", + "demandActual": [342,294,48,32,243,180,113,395,5,477,223,31,193,418,472,338,45,219,149,324,92,28,129,481,235,348,132,259], + "demandAdditional": [], + "production": [342,294,48,32,243,180,113,395,5,477,223,31,193,418,472,338,45,219,149,324,92,28,129,481,235,348,132,259], + "currentStock": 275 + } + } + }, + "siteTwo": { + "name": "Site 2", + "bpna": { + "addressOne": { + "name": "Address 1", + "demandActual": [342,294,48,32,243,180,113,395,5,477,223,31,193,418,472,338,45,219,149,324,92,28,129,481,235,348,132,259], + "demandAdditional": [], + "production": [342,294,48,32,243,180,113,395,5,477,223,31,193,418,472,338,45,219,149,324,92,28,129,481,235,348,132,259], + "currentStock": 250 + }, + "addressTwo": { + "name": "Address 2", + "demandActual": [342,294,48,32,243,180,113,395,5,477,223,31,193,418,472,338,45,219,149,324,92,28,129,481,235,348,132,259], + "demandAdditional": [], + "production": [342,294,48,32,243,180,113,395,5,477,223,31,193,418,472,338,45,219,149,324,92,28,129,481,235,348,132,259], + "currentStock": 225 + } + } + } + } + }, + "wheel": { + "name": "Wheel", + "bpns": { + "siteOne": { + "name": "Site 1", + "bpna": { + "addressOne": { + "name": "Address 1", + "demandActual": [311,152,173,496,418,17,79,267,22,426,103,396,469,362,299,112,105,180,141,1,133,9,476,93,118,373,394,376], + "demandAdditional": [], + "production": [311,152,173,496,418,17,79,267,22,426,103,396,469,362,299,112,105,180,141,1,133,9,476,93,118,373,394,376], + "currentStock": 175 + }, + "addressTwo": { + "name": "Address 2", + "demandActual": [311,152,173,496,418,17,79,267,22,426,103,396,469,362,299,112,105,180,141,1,133,9,476,93,118,373,394,376], + "demandAdditional": [], + "production": [311,152,173,496,418,17,79,267,22,426,103,396,469,362,299,112,105,180,141,1,133,9,476,93,118,373,394,376], + "currentStock": 150 + } + } + }, + "siteTwo": { + "name": "Site 2", + "bpna": { + "addressOne": { + "name": "Address 1", + "demandActual": [311,152,173,496,418,17,79,267,22,426,103,396,469,362,299,112,105,180,141,1,133,9,476,93,118,373,394,376], + "demandAdditional": [], + "production": [311,152,173,496,418,17,79,267,22,426,103,396,469,362,299,112,105,180,141,1,133,9,476,93,118,373,394,376], + "currentStock": 100 + }, + "addressTwo": { + "name": "Address 2", + "demandActual": [311,152,173,496,418,17,79,267,22,426,103,396,469,362,299,112,105,180,141,1,133,9,476,93,118,373,394,376], + "demandAdditional": [], + "production": [311,152,173,496,418,17,79,267,22,426,103,396,469,362,299,112,105,180,141,1,133,9,476,93,118,373,394,376], + "currentStock": 125 + } + } + } + } + } + } + }, + { + "name": "Customer 2", + "materials": { + "centralControlUnit": { + "name": "Central Control Unit", + "bpns": { + "siteOne": { + "name": "Site 1", + "bpna": { + "addressOne": { + "name": "Address 1", + "demandActual": [399,238,16,187,317,496,134,189,264,15,357,203,322,388,1,65,423,441,119,28,417,460,218,129,217,5,63,198], + "demandAdditional": [100,50,75,0,150,500,0,20,150,0,175,200,0,40,100,50,75,0,150,500,0,20,150,0,175,200,0,40], + "production": [499,288,66,187,467,996,134,209,314,15,532,403,322,248,101,115,498,441,269,528,417,460,218,129,392,205,63,198], + "currentStock": 125 + }, + "addressTwo": { + "name": "Address 2", + "demandActual": [399,238,16,187,317,496,134,189,264,15,357,203,322,388,1,65,423,441,119,28,417,460,218,129,217,5,63,198], + "demandAdditional": [100,50,75,0,150,500,0,20,150,0,175,200,0,40,100,50,75,0,150,500,0,20,150,0,175,200,0,40], + "production": [499,288,66,187,467,996,134,209,314,15,532,403,322,248,101,115,498,441,269,528,417,460,218,129,392,205,63,198], + "currentStock": 175 + } + } + }, + "siteTwo": { + "name": "Site 2", + "bpna": { + "addressOne": { + "name": "Address 1", + "demandActual": [399,238,16,187,317,496,134,189,264,15,357,203,322,388,1,65,423,441,119,28,417,460,218,129,217,5,63,198], + "demandAdditional": [100,50,75,0,150,500,0,20,150,0,175,200,0,40,100,50,75,0,150,500,0,20,150,0,175,200,0,40], + "production": [499,288,66,187,467,996,134,209,314,15,532,403,322,248,101,115,498,441,269,528,417,460,218,129,392,205,63,198], + "currentStock": 100 + }, + "addressTwo": { + "name": "Address 2", + "demandActual": [399,238,16,187,317,496,134,189,264,15,357,203,322,388,1,65,423,441,119,28,417,460,218,129,217,5,63,198], + "demandAdditional": [100,50,75,0,150,500,0,20,150,0,175,200,0,40,100,50,75,0,150,500,0,20,150,0,175,200,0,40], + "production": [499,288,66,187,467,996,134,209,314,15,532,403,322,248,101,115,498,441,269,528,417,460,218,129,392,205,63,198], + "currentStock": 150 + } + } + } + } + }, + "steeringWheel": { + "name": "Steering Wheel", + "bpns": { + "siteOne": { + "name": "Site 1", + "bpna": { + "addressOne": { + "name": "Address 1", + "demandActual": [299,252,313,63,497,35,351,426,419,86,127,374,6,66,120,82,89,286,162,327,454,500,98,10,140,415,368,178], + "demandAdditional": [100,0,50,200,150,0,75,100,0,50,200,150,0,75,100,0,50,200,150,0,75,100,0,50,200,150,0,75], + "production": [399,252,313,263,647,35,426,526,419,136,327,374,6,141,220,82,139,486,312,327,454,600,98,60,340,565,368,253 ], + "currentStock": 200 + }, + "addressTwo": { + "name": "Address 2", + "demandActual": [299,252,313,63,497,35,351,426,419,86,127,374,6,66,120,82,89,286,162,327,454,500,98,10,140,415,368,178], + "demandAdditional": [100,0,50,200,150,0,75,100,0,50,200,150,0,75,100,0,50,200,150,0,75,100,0,50,200,150,0,75], + "production": [399,252,313,263,647,35,426,526,419,136,327,374,6,141,220,82,139,486,312,327,454,600,98,60,340,565,368,253 ], + "currentStock": 275 + } + } + }, + "siteTwo": { + "name": "Site 2", + "bpna": { + "addressOne": { + "name": "Address 1", + "demandActual": [299,252,313,63,497,35,351,426,419,86,127,374,6,66,120,82,89,286,162,327,454,500,98,10,140,415,368,178], + "demandAdditional": [100,0,50,200,150,0,75,100,0,50,200,150,0,75,100,0,50,200,150,0,75,100,0,50,200,150,0,75], + "production": [399,252,313,263,647,35,426,526,419,136,327,374,6,141,220,82,139,486,312,327,454,600,98,60,340,565,368,253 ], + "currentStock": 250 + }, + "addressTwo": { + "name": "Address 2", + "demandActual": [299,252,313,63,497,35,351,426,419,86,127,374,6,66,120,82,89,286,162,327,454,500,98,10,140,415,368,178], + "demandAdditional": [100,0,50,200,150,0,75,100,0,50,200,150,0,75,100,0,50,200,150,0,75,100,0,50,200,150,0,75], + "production": [399,252,313,263,647,35,426,526,419,136,327,374,6,141,220,82,139,486,312,327,454,600,98,60,340,565,368,253 ], + "currentStock": 225 + } + } + } + } + }, + "seats": { + "name": "Seats", + "bpns": { + "siteOne": { + "name": "Site 1", + "bpna": { + "addressOne": { + "name": "Address 1", + "demandActual": [100,200,834,325,989,442,121,609,964,789,331,923,22,315,947,956,732,422,878,425,562,737,370,904,727,706,823,459], + "demandAdditional": [22,300,0,200,50,350,150,100,300,400,200,50,350,150,100,300,400,200,50,350,150,100,300,400,200,50,350,150], + "production": [122,500,940,237,977,626,915,196,749,382,48,982,95,14,831,23,542,142,10,664,333,731,611,797,366,485,732,357], + "currentStock": 300 + }, + "addressTwo": { + "name": "Address 2", + "demandActual": [100,200,834,325,989,442,121,609,964,789,331,923,22,315,947,956,732,422,878,425,562,737,370,904,727,706,823,459], + "demandAdditional": [22,300,0,200,50,350,150,100,300,400,200,50,350,150,100,300,400,200,50,350,150,100,300,400,200,50,350,150], + "production": [122,500,940,237,977,626,915,196,749,382,48,982,95,14,831,23,542,142,10,664,333,731,611,797,366,485,732,357], + "currentStock": 375 + } + } + }, + "siteTwo": { + "name": "Site 2", + "bpna": { + "addressOne": { + "name": "Address 1", + "demandActual": [100,200,834,325,989,442,121,609,964,789,331,923,22,315,947,956,732,422,878,425,562,737,370,904,727,706,823,459], + "demandAdditional": [22,300,0,200,50,350,150,100,300,400,200,50,350,150,100,300,400,200,50,350,150,100,300,400,200,50,350,150], + "production": [122,500,940,237,977,626,915,196,749,382,48,982,95,14,831,23,542,142,10,664,333,731,611,797,366,485,732,357], + "currentStock": 325 + }, + "addressTwo": { + "name": "Address 2", + "demandActual": [100,200,834,325,989,442,121,609,964,789,331,923,22,315,947,956,732,422,878,425,562,737,370,904,727,706,823,459], + "demandAdditional": [22,300,0,200,50,350,150,100,300,400,200,50,350,150,100,300,400,200,50,350,150,100,300,400,200,50,350,150], + "production": [122,500,940,237,977,626,915,196,749,382,48,982,95,14,831,23,542,142,10,664,333,731,611,797,366,485,732,357], + "currentStock": 350 + } + } + } + } + } + } + } +] diff --git a/frontend/src/views/SupplierDashboard.vue b/frontend/src/views/SupplierDashboard.vue index e040fd1c..cd9dcc15 100644 --- a/frontend/src/views/SupplierDashboard.vue +++ b/frontend/src/views/SupplierDashboard.vue @@ -39,9 +39,24 @@ +
+
+ +
+ +
+ +
+
@@ -69,25 +84,30 @@ Demand (Actual) - {{item}} + {{item}} Demand (Additional) - {{item}} + {{item}} Demand (Total) - {{item}} - + + + Customer Stock: + 100 + + @@ -105,7 +125,7 @@ Production - {{item}} @@ -113,10 +133,13 @@ - + - diff --git a/frontend/src/views/SupplierDashboard.vue b/frontend/src/views/SupplierDashboard.vue index c04a81ff..5f579563 100644 --- a/frontend/src/views/SupplierDashboard.vue +++ b/frontend/src/views/SupplierDashboard.vue @@ -22,7 +22,8 @@
@@ -445,7 +446,6 @@ export default{ text-align: center; padding: 10px; color: red; - font-weight: bold; } #updateCustomerDataBtn, #hintMessage{ position: sticky; From 570cc7e8557c86789631f200f98c1588f6f9a1eb Mon Sep 17 00:00:00 2001 From: Pascal Marzec Date: Tue, 30 Jan 2024 10:35:39 +0100 Subject: [PATCH 7/8] feat(StockView.vue): added disabling of "Update Partner Stocks" button if no material chosen Signed-off-by: Pascal Marzec --- frontend/src/assets/base.css | 3 +++ frontend/src/views/SupplierDashboard.vue | 14 +++++++------- frontend/src/views/stock/PartnerStockSFC.vue | 11 ++++++++--- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/frontend/src/assets/base.css b/frontend/src/assets/base.css index a67a0e43..221ee740 100644 --- a/frontend/src/assets/base.css +++ b/frontend/src/assets/base.css @@ -97,4 +97,7 @@ input:disabled, select:disabled { .btn-primary { @apply my-2 bg-blue-500 text-white font-bold py-2 px-4 rounded hover:bg-blue-700; } + .btn-primary:disabled{ + opacity: 0.6; + } } diff --git a/frontend/src/views/SupplierDashboard.vue b/frontend/src/views/SupplierDashboard.vue index 5f579563..d131dd1d 100644 --- a/frontend/src/views/SupplierDashboard.vue +++ b/frontend/src/views/SupplierDashboard.vue @@ -92,9 +92,9 @@ --> - + - + @@ -132,11 +132,11 @@ - + - @@ -281,7 +281,7 @@ export default{ } }, changeBgColor: function (index, production){ - if (production < this.totalDemand[index]){ + if (production < this.mockTotalDemand[index]){ return {'background-color': 'red'}; } }, @@ -467,7 +467,7 @@ th, td { div > .outerBox{ margin: 20px 0px; } -td.firstRow{ +th.firstRow{ font-weight: bold; border-bottom: 1px solid rgb(229 231 235 / var(--tw-border-opacity));; } diff --git a/frontend/src/views/stock/PartnerStockSFC.vue b/frontend/src/views/stock/PartnerStockSFC.vue index 5f757682..a9b364d3 100644 --- a/frontend/src/views/stock/PartnerStockSFC.vue +++ b/frontend/src/views/stock/PartnerStockSFC.vue @@ -31,20 +31,25 @@ Your {{ this.partnerRole }}s' stocks for {{ this.selectedMaterialOrProductId }}. -

Info: These are your suppliers' stocks (your potential inputs) - at his site that not yet sent to you. + at his site that have not yet been sent to you.
+ Please choose a material from above table before clicking the "Update Partner Stocks" button.

Info: These are your customers' stocks (your recent outputs) at - his site that have not yet been used for production. + his site that have not yet been used for production.
+ Please choose a material from above table before clicking the "Update Partner Stocks" button.

From 779e51e88b51590275391a80b09651bf5ff336d6 Mon Sep 17 00:00:00 2001 From: Pascal Marzec Date: Tue, 30 Jan 2024 12:21:15 +0100 Subject: [PATCH 8/8] refactor(SupplierDashboard.vue): removed unnecessary console.logs Signed-off-by: Pascal Marzec --- frontend/src/views/SupplierDashboard.vue | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/frontend/src/views/SupplierDashboard.vue b/frontend/src/views/SupplierDashboard.vue index d131dd1d..1f9ef05e 100644 --- a/frontend/src/views/SupplierDashboard.vue +++ b/frontend/src/views/SupplierDashboard.vue @@ -350,7 +350,6 @@ export default{ return string.slice(0,-2); }, updateCustomerStocks: function(material){ - console.log(material) fetch(this.backendURL + this.endpointUpdateReportedProductStocks + material.ownMaterialNumber, @@ -371,7 +370,7 @@ export default{ }, }) .then((res) => res.json()) - .then((data) => (this.fetchedAllProductStocks = data) && console.log(data)) + .then((data) => (this.fetchedAllProductStocks = data)) .catch((err) => console.log(err)); }, filterAllProductStocks: function (material,bpnl){
Customer InformationCustomer Information{{day}}{{day}}
Your Own InformationYour Own Information + {{}} - +