|
|
|
@ -138,14 +138,12 @@
|
|
|
|
|
function update_price(commission: Commission) {
|
|
|
|
|
commission.price = 0;
|
|
|
|
|
|
|
|
|
|
console.log(commission.answers);
|
|
|
|
|
for (let index = 0; index < commission.answers.length; index++) {
|
|
|
|
|
const answer = commission.answers[index];
|
|
|
|
|
const question = commission.questions.filter(value => {
|
|
|
|
|
return value['name'] == answer['name'];
|
|
|
|
|
})[0];
|
|
|
|
|
|
|
|
|
|
console.log(commission.price);
|
|
|
|
|
question['options'].forEach(value => {
|
|
|
|
|
if(value['name'] == answer['option']) {
|
|
|
|
|
commission.price += value['price'];
|
|
|
|
@ -154,7 +152,6 @@
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
total = 0;
|
|
|
|
|
// console.log(commissions);
|
|
|
|
|
commissions.forEach(value => {
|
|
|
|
|
total += value.price;
|
|
|
|
|
})
|
|
|
|
|