Преглед на файлове

修复汇总表产品名错误

animeic преди 1 година
родител
ревизия
f323d286e9
променени са 3 файла, в които са добавени 15 реда и са изтрити 3 реда
  1. 7 2
      boxcost/api/plan-summary-excel.go
  2. 8 1
      boxcost/api/summary-sample-excel.go
  3. BIN
      boxcost/包装计价项目维护计划.doc

+ 7 - 2
boxcost/api/plan-summary-excel.go

@@ -356,6 +356,7 @@ func (b *PlanSummaryExcel) drawSupplierContent() error {
 
 	for _, splan := range b.Content.Plans {
 		planStartRow := b.Row
+		isContainSupplier := false
 		plan := splan.Plan
 		comps := plan.Pack.Components
 		// 预算金额汇总
@@ -373,6 +374,7 @@ func (b *PlanSummaryExcel) drawSupplierContent() error {
 						if stage.SupplierInfo != nil {
 							if b.Content.SupplierId == stage.SupplierInfo.Id {
 								supplier = stage.SupplierInfo.Name
+								isContainSupplier = true
 								// 材料
 								if startRow == 0 {
 									startRow = b.Row
@@ -516,11 +518,13 @@ func (b *PlanSummaryExcel) drawSupplierContent() error {
 
 		}
 
+		if !isContainSupplier {
+			continue
+		}
 		totalBudgetPrice += planBudgetPrice
 		totalRealPrice += planRealPrice
 
-		// plan
-		// b.row +2 分割每个计划
+		// 产品名称
 		planEndRow := b.Row
 		planStartACell := fmt.Sprintf("%s%d", "A", planStartRow)
 		planEndACell := fmt.Sprintf("%s%d", "A", planEndRow-1)
@@ -530,6 +534,7 @@ func (b *PlanSummaryExcel) drawSupplierContent() error {
 			return err
 		}
 		b.Excel.SetCellValue(b.SheetName, planStartACell, fmt.Sprintf("%s(%d)", plan.Name, plan.Total))
+
 	}
 
 	// summaryEndRow := b.Row

+ 8 - 1
boxcost/api/summary-sample-excel.go

@@ -233,8 +233,9 @@ func (b *SummarySampleExcel) drawSupplierContent() error {
 	supplier := ""
 	// summaryPlans
 	for _, splan := range b.Content.Plans {
-		index++
+
 		planStartRow := b.Row
+		isContainSupplier := false
 		plan := splan.Plan
 		comps := plan.Pack.Components
 		if len(comps) > 0 {
@@ -246,6 +247,7 @@ func (b *SummarySampleExcel) drawSupplierContent() error {
 						if stage.SupplierInfo != nil {
 							if b.Content.SupplierId == stage.SupplierInfo.Id {
 								supplier = stage.SupplierInfo.Name
+								isContainSupplier = true
 								// 材料
 								if startRow == 0 {
 									startRow = b.Row
@@ -336,6 +338,11 @@ func (b *SummarySampleExcel) drawSupplierContent() error {
 
 		}
 
+		if !isContainSupplier {
+			continue
+
+		}
+		index++
 		// 序号
 		planEndRow := b.Row
 		planStartACell := fmt.Sprintf("%s%d", "A", planStartRow)

BIN
boxcost/包装计价项目维护计划.doc