animeic 2 年之前
父节点
当前提交
8e0f7a84ca
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      boxcost/api/plan-cost-excel.go

+ 3 - 1
boxcost/api/plan-cost-excel.go

@@ -163,6 +163,7 @@ func (b *PlanCostExcel) drawSupplierContent() error {
 	if err != nil {
 		return err
 	}
+	supplier := ""
 	comps := b.Content.Pack.Components
 	// 预算金额汇总
 	var totalBudgetPrice float64 = 0.00
@@ -179,6 +180,7 @@ func (b *PlanCostExcel) drawSupplierContent() error {
 				for _, stage := range comp.Stages {
 					if stage.SupplierInfo != nil {
 						if supplierId == stage.SupplierInfo.Id {
+							supplier = stage.SupplierInfo.Name
 							// 材料
 							if startRow == 0 {
 								startRow = b.Row
@@ -270,7 +272,7 @@ func (b *PlanCostExcel) drawSupplierContent() error {
 	MCell := fmt.Sprintf("%s%d", "M", b.Row)
 	b.Excel.MergeCell(b.SheetName, startACell, endKCell)
 	b.Excel.SetCellStyle(b.SheetName, startACell, endKCell, b.AlignCenterStyle)
-	b.Excel.SetCellValue(b.SheetName, startACell, "生产计划汇总金额")
+	b.Excel.SetCellValue(b.SheetName, startACell, fmt.Sprintf("【%s】生产计划汇总金额", supplier))
 
 	// 生产预算汇总
 	b.Excel.SetCellStyle(b.SheetName, LCell, LCell, b.AlignCenterStyle)