animeic 2 éve
szülő
commit
4ebbb0132e
1 módosított fájl, 17 hozzáadás és 8 törlés
  1. 17 8
      boxcost/api/plan-cost-excel.go

+ 17 - 8
boxcost/api/plan-cost-excel.go

@@ -209,13 +209,22 @@ func (b *PlanCostExcel) drawSupplierContent() error {
 							if stage.Unit == "吨" || stage.Unit == "平方米" {
 								stage.Unit = "张"
 							}
-							supplierName := ""
-							if stage.SupplierInfo != nil {
-								supplierName = stage.SupplierInfo.Name
-							}
 
-							b.drawRow(b.Row, "", stage.Name, "", supplierName, stage.Norm, matHeigth, matWidth, stage.Unit, orderCount, realCount, price, budgetPrice, realPrice)
-							cates[stage.Group] = append(cates[stage.Group], b.Row)
+							stageType := ""
+							if stage.BillType > 0 {
+								stage.Type = stage.BillType
+							}
+							if stage.Type == 1 {
+								stageType = "材料采购"
+							}
+							if stage.Type == 2 {
+								stageType = "工艺"
+							}
+							if stage.Type == 3 {
+								stageType = "成品采购"
+							}
+							b.drawRow(b.Row, "", stageType, stage.Name, "", stage.Norm, matHeigth, matWidth, stage.Unit, orderCount, realCount, price, budgetPrice, realPrice)
+							cates[stage.SupplierInfo.Name] = append(cates[stage.SupplierInfo.Name], b.Row)
 							b.Row++
 						}
 
@@ -292,7 +301,7 @@ func (b *PlanCostExcel) drawAllContent() error {
 			var perRealPrice float64 = 0.00
 			if len(comp.Stages) > 0 {
 				startRow := b.Row
-				cates := map[string][]int{}
+				// cates := map[string][]int{}
 				for _, stage := range comp.Stages {
 					matHeigth := fmt.Sprintf("%d", stage.BatchSizeHeight)
 					b.FormatToEmpty(&matHeigth)
@@ -336,7 +345,7 @@ func (b *PlanCostExcel) drawAllContent() error {
 						stageType = "成品采购"
 					}
 					b.drawRow(b.Row, "", stageType, stage.Name, supplierName, stage.Norm, matHeigth, matWidth, stage.Unit, orderCount, realCount, price, budgetPrice, realPrice)
-					cates[stage.Group] = append(cates[stage.Group], b.Row)
+					// cates[stage.Group] = append(cates[stage.Group], b.Row)
 					b.Row++
 
 				}