animeic 2 سال پیش
والد
کامیت
a9a6e8438e
1فایلهای تغییر یافته به همراه9 افزوده شده و 3 حذف شده
  1. 9 3
      boxcost/api/bill-purchase-excel.go

+ 9 - 3
boxcost/api/bill-purchase-excel.go

@@ -170,13 +170,19 @@ func (b *PurchaseBillExcel) drawTableTitle() error {
 
 	drawCol2("C", "D", "尺寸(mm)", "长", "宽")
 	drawCol2("C", "D", "尺寸(mm)", "长", "宽")
-	unit1 := "元/张"
-	unit2 := "元/吨"
+	unit1 := "-"
+	unit2 := "-"
 	if len(b.Content.Paper) > 0 {
 		if b.Content.Paper[0].PriceUnit != "" {
 			unit1 = b.Content.Paper[0].PriceUnit
+		} else if b.Content.Paper[0].Price2Unit != "" {
+			unit2 = b.Content.Paper[0].Price2Unit
+		} else {
+			unit1 = "元/张"
+			unit2 = "元/吨"
 		}
-		if b.Content.Paper[0].Price2Unit != "" {
+		if b.Content.Paper[0].PriceUnit != "" && b.Content.Paper[0].Price2Unit != "" {
+			unit1 = b.Content.Paper[0].PriceUnit
 			unit2 = b.Content.Paper[0].Price2Unit
 		}
 	}