Skip to content

Commit

Permalink
feat: connected 'Your Stock' with JSON data and added mock data
Browse files Browse the repository at this point in the history
  • Loading branch information
PaMarzec committed Aug 25, 2023
1 parent f3952f9 commit fe317f9
Showing 1 changed file with 43 additions and 22 deletions.
65 changes: 43 additions & 22 deletions frontend/src/views/SupplierDashboard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@

<tr>
<td class="font-bold text-xl firstRow firstColumn ">Your Own Information</td>

<!-- upper border of production items -->
<td class="firstRow" v-for="item in datesData">
{{}}
</td>
Expand All @@ -125,8 +125,9 @@
</tr>

<tr>
<td class="text-center firstColumn"> <b>Your Stock:</b> &ensp; 300 pieces </td>

<template v-for="material in currentStocks">
<td class="text-center firstColumn" v-if="material.name === dropdownMaterial.name"> <b>Your Stock:</b> &ensp;{{material.value}} </td>
</template>
<!-- <td class=" text-center" colspan="">Test Number</td> -->

</tr>
Expand All @@ -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],
}
}
},
Expand All @@ -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() {
Expand Down Expand Up @@ -236,6 +255,8 @@ export default{
},
emptyTotalDemandArray: function (){
this.totalDemand.length = 0;
console.log(this.dropdownMaterial.name)
},
}
};
Expand Down

0 comments on commit fe317f9

Please sign in to comment.