animeic 2 anni fa
parent
commit
e858ea829d
3 ha cambiato i file con 16 aggiunte e 14 eliminazioni
  1. 14 4
      boxcost/api/plan-cost-excel.go
  2. 0 9
      boxcost/db/model/bill.go
  3. 2 1
      boxcost/db/model/pack.go

+ 14 - 4
boxcost/api/plan-cost-excel.go

@@ -209,9 +209,13 @@ 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, "", "", stage.Norm, matHeigth, matWidth, stage.Unit, orderCount, realCount, price, budgetPrice, realPrice)
-							cates[stage.SupplierInfo.Name] = append(cates[stage.SupplierInfo.Name], b.Row)
+							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)
 							b.Row++
 						}
 
@@ -273,6 +277,8 @@ func (b *PlanCostExcel) drawSupplierContent() error {
 	return nil
 }
 
+// type merge
+
 func (b *PlanCostExcel) drawAllContent() error {
 	b.Row += 2
 	comps := b.Content.Pack.Components
@@ -312,8 +318,12 @@ func (b *PlanCostExcel) drawAllContent() error {
 					if stage.Unit == "吨" || stage.Unit == "平方米" {
 						stage.Unit = "张"
 					}
-					b.drawRow(b.Row, "", stage.Name, "", "", stage.Norm, matHeigth, matWidth, stage.Unit, orderCount, realCount, price, budgetPrice, realPrice)
-					cates[stage.SupplierInfo.Name] = append(cates[stage.SupplierInfo.Name], b.Row)
+					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)
 					b.Row++
 
 				}

+ 0 - 9
boxcost/db/model/bill.go

@@ -139,15 +139,6 @@ type ProduceBill struct {
 	UpdateTime   time.Time            `bson:"updateTime,omitempty" json:"updateTime"`
 	CompleteTime time.Time            `bson:"completeTime,omitempty" json:"completeTime"`
 
-	// //确认收货数量
-	// ConfirmCount int `bson:"confirmCount,omitempty" json:"confirmCount"`
-
-	// // 实际金额
-	// RealAmount float64 `bson:"realAmount,omitempty" json:"realAmount"`
-
-	// // 预算金额
-	// BudgetAmount float64 `bson:"budgetAmount,omitempty" json:"budgetAmount"`
-
 	//供应商
 	Supplier string `bson:"supplier,omitempty" json:"supplier"`
 

+ 2 - 1
boxcost/db/model/pack.go

@@ -50,11 +50,12 @@ type ComponentStage struct {
 	// 预算价格
 	OrderPrice float64 `bson:"orderPrice,omitempty" json:"orderPrice"`
 
-	// 订单数据量
+	// 下单单价
 	OrderCount int `bson:"orderCount,omitempty" json:"orderCount"`
 
 	//实际价格
 	RealPrice float64 `bson:"realPrice,omitempty" json:"realPrice"`
+
 	//确认收货数量
 	RealCount int `bson:"confirmCount,omitempty" json:"confirmCount"`