|
@@ -222,6 +222,7 @@ func MakeSectionContract(Data []*viewmodels.TreeSectionContract, node *viewmodel
|
|
|
contractPriceTotal := 0.00
|
|
|
returnPriceTotal := 0.00
|
|
|
paidPriceTotal := 0.00
|
|
|
+ contractDeductionPriceTotal := 0.00
|
|
|
|
|
|
node.Children = append(node.Children, childs[0:]...) //添加子节点
|
|
|
for _, v := range childs { //查询子节点的子节点,并添加到子节点
|
|
@@ -238,12 +239,16 @@ func MakeSectionContract(Data []*viewmodels.TreeSectionContract, node *viewmodel
|
|
|
returnPriceTotal += returnPrice
|
|
|
paidPrice, _ := strconv.ParseFloat(v.ContractsPaid, 64)
|
|
|
paidPriceTotal += paidPrice
|
|
|
+
|
|
|
+ ContractDeductionTotal, _ := strconv.ParseFloat(v.ContractDeductionTotal, 64)
|
|
|
+ contractDeductionPriceTotal += ContractDeductionTotal
|
|
|
}
|
|
|
|
|
|
// 3.赋值到父项中
|
|
|
node.ContractPrice = fmt.Sprintf("%.2f", contractPriceTotal)
|
|
|
node.ContractReturned = fmt.Sprintf("%.2f", returnPriceTotal)
|
|
|
node.ContractsPaid = fmt.Sprintf("%.2f", paidPriceTotal)
|
|
|
+ node.ContractDeductionTotal = fmt.Sprintf("%.2f", contractDeductionPriceTotal)
|
|
|
}
|
|
|
}
|
|
|
|