animeic 1 year ago
parent
commit
13b3cb282c

+ 1 - 1
boxcost/api/bill-produce-excel.go

@@ -639,7 +639,7 @@ func NewProduceBill(f *excelize.File) *ProduceBillExcel {
 
 func (b *ProduceBillExcel) FormatToEmpty(str *string) {
 	if *str == "0" || *str == "0.000" {
-		*str = ""
+		*str = "-"
 	}
 
 }

+ 1 - 1
boxcost/api/bill-product-excel.go

@@ -398,7 +398,7 @@ func NewProductBill(f *excelize.File) *ProductBillExcel {
 
 func (b *ProductBillExcel) FormatToEmpty(str *string) {
 	if *str == "0" || *str == "0.000" {
-		*str = ""
+		*str = "-"
 	}
 
 }

+ 4 - 10
boxcost/api/bill-purchase-excel.go

@@ -195,19 +195,13 @@ func (b *PurchaseBillExcel) drawTableTitle() error {
 		b.Excel.SetCellValue(b.SheetName, val3Cel, value3)
 		return nil
 	}
-	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].PriceUnit != "" && b.Content.Paper[0].Price2Unit != "" {
-			unit1 = b.Content.Paper[0].PriceUnit
+		if b.Content.Paper[0].Price2Unit != "" {
 			unit2 = b.Content.Paper[0].Price2Unit
 		}
 	}
@@ -440,7 +434,7 @@ func NewPurchaseBill(f *excelize.File) *PurchaseBillExcel {
 
 func (b *PurchaseBillExcel) FormatToEmpty(str *string) {
 	if *str == "0" || *str == "0.000" {
-		*str = ""
+		*str = "-"
 	}
 
 }