|
@@ -191,6 +191,8 @@ func (b *ReportProduceExcel) drawTableContent() error {
|
|
|
|
|
|
produces := b.Content.Produces
|
|
|
if len(produces) > 0 {
|
|
|
+ startRow := b.Row
|
|
|
+ endRow := b.Row
|
|
|
for _, produce := range produces {
|
|
|
|
|
|
confirmCount := "-"
|
|
@@ -201,26 +203,27 @@ func (b *ReportProduceExcel) drawTableContent() error {
|
|
|
b.FormatToEmpty(&priceStr)
|
|
|
|
|
|
// 预算金额
|
|
|
- budgetAmount := fmt.Sprintf("%.2f", float64(produce.OrderCount)*price)
|
|
|
- b.FormatToEmpty(&budgetAmount)
|
|
|
-
|
|
|
- b.BudgetCount += float64(produce.OrderCount) * price
|
|
|
+ budgetAmount := ""
|
|
|
|
|
|
// 实际完成数
|
|
|
- confirmCount = fmt.Sprintf("%d", b.Content.ConfirmCount)
|
|
|
+ confirmCount = fmt.Sprintf("%d", produce.ConfirmCount)
|
|
|
b.FormatToEmpty(&confirmCount)
|
|
|
|
|
|
// 实际金额
|
|
|
- realAmount = fmt.Sprintf("%.2f", float64(b.Content.ConfirmCount)*price)
|
|
|
- b.FormatToEmpty(&realAmount)
|
|
|
-
|
|
|
- b.RealCount += float64(b.Content.ConfirmCount) * price
|
|
|
+ realAmount = ""
|
|
|
|
|
|
deliveryTime := produce.DeliveryTime.Local().Format("2006-01-02")
|
|
|
DrawRow(row, produce.Name, produce.Norm, produce.Paper, produce.PaperSize, produce.PrintSize, fmt.Sprintf("%d", produce.OrderCount), confirmCount, priceStr, budgetAmount, realAmount, deliveryTime, produce.Remark)
|
|
|
row++
|
|
|
b.Row++
|
|
|
}
|
|
|
+ // 多个工序 合并预算价格、实际价格
|
|
|
+ b.Excel.MergeCell(b.SheetName, fmt.Sprintf("I%d", startRow), fmt.Sprintf("I%d", endRow))
|
|
|
+ b.Excel.SetCellValue(b.SheetName, fmt.Sprintf("I%d", startRow), b.Content.BudgetAmount)
|
|
|
+ b.Excel.MergeCell(b.SheetName, fmt.Sprintf("J%d", startRow), fmt.Sprintf("J%d", endRow))
|
|
|
+ b.Excel.SetCellValue(b.SheetName, fmt.Sprintf("J%d", startRow), b.Content.RealAmount)
|
|
|
+ b.BudgetCount += b.Content.BudgetAmount
|
|
|
+ b.RealCount += b.Content.RealAmount
|
|
|
}
|
|
|
|
|
|
return nil
|