From fe317f950d63e41fc27d7f01baecc8af8f505d81 Mon Sep 17 00:00:00 2001 From: Pascal Marzec Date: Fri, 25 Aug 2023 14:15:24 +0200 Subject: [PATCH] feat: connected 'Your Stock' with JSON data and added mock data --- frontend/src/views/SupplierDashboard.vue | 65 ++++++++++++++++-------- 1 file changed, 43 insertions(+), 22 deletions(-) diff --git a/frontend/src/views/SupplierDashboard.vue b/frontend/src/views/SupplierDashboard.vue index 3790b0ed..558c4731 100644 --- a/frontend/src/views/SupplierDashboard.vue +++ b/frontend/src/views/SupplierDashboard.vue @@ -105,7 +105,7 @@ Your Own Information - + {{}} @@ -125,8 +125,9 @@ - Your Stock:   300 pieces - + @@ -152,28 +153,28 @@ export default{ datesData: [], // Temp array for total demand totalDemand: [], - + // Customer Json customer: { customer1: { name: "Customer 1", materials: { centralControlUnit: { name: "Central Control Unit", - demandActual: [], + 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: [], + 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], }, steeringWheel: { name: "Steering Wheel", - demandActual: [], + 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: [], + 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], }, wheel: { name: "Wheel", - demandActual: [], + 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: [], + 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], } } }, @@ -182,25 +183,43 @@ export default{ materials: { centralControlUnit: { name: "Central Control Unit", - demandActual: [], - demandAdditional: [], - production: [], + 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], }, steeringWheel: { name: "Steering Wheel", - demandActual: [100, 100, 150], - demandAdditional: [100, 0, 50], - production: [100,150,200], + 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 ], }, - wheel: { - name: "Test", - demandActual: [868,614,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: [100,300,400,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,339,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], + seats: { + name: "Seats", + 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], } } }, - } + }, + currentStocks:{ + centralControlUnit: { + value: 300, + name: "Central Control Unit", + }, + steeringWheel: { + value: 200, + name: "Steering Wheel", + }, + wheel: { + value: 100, + name: "Wheel", + }, + seats: { + value: 400, + name: "Seats", + }, + }, }; }, mounted() { @@ -236,6 +255,8 @@ export default{ }, emptyTotalDemandArray: function (){ this.totalDemand.length = 0; + + console.log(this.dropdownMaterial.name) }, } };