animeic 2 years ago
parent
commit
3e5a172c1d

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

@@ -295,32 +295,32 @@ func (b *PurchaseBillExcel) drawTableFooter() error {
 
 func (b *PurchaseBillExcel) drawTableSignature() error {
 	b.Row += 2
-	row := b.Row
+	// row := b.Row
 
 	style1, _ := b.Excel.NewStyle(&excelize.Style{
 		Alignment: &excelize.Alignment{Horizontal: "center", Vertical: "center"},
 	})
 
 	// 制单人
-	billUserCell := fmt.Sprintf("A%d", row+1)
+	billUserCell := fmt.Sprintf("A%d", b.Row+1)
 	b.Excel.SetCellValue(b.SheetName, billUserCell, "制单人:")
-	billUservCell := fmt.Sprintf("B%d", row+1)
+	billUservCell := fmt.Sprintf("B%d", b.Row+1)
 	b.Excel.SetCellValue(b.SheetName, billUservCell, b.Content.UserName)
 
-	fontCell := fmt.Sprintf("H%d", row)
-	imageCell1 := fmt.Sprintf("I%d", row)
-	imageCell2 := fmt.Sprintf("K%d", row)
-	b.Excel.MergeCell(b.SheetName, fontCell, fmt.Sprintf("H%d", row+2))
+	fontCell := fmt.Sprintf("H%d", b.Row)
+	imageCell1 := fmt.Sprintf("I%d", b.Row)
+	imageCell2 := fmt.Sprintf("K%d", b.Row)
+	b.Excel.MergeCell(b.SheetName, fontCell, fmt.Sprintf("H%d", b.Row+2))
 	b.Excel.SetCellStyle(b.SheetName, fontCell, fontCell, style1)
 	b.Excel.SetCellValue(b.SheetName, fontCell, "审核签字:")
 
 	// 签字图片1 I10-J12
-	b.Excel.MergeCell(b.SheetName, imageCell1, fmt.Sprintf("J%d", row+2))
+	b.Excel.MergeCell(b.SheetName, imageCell1, fmt.Sprintf("J%d", b.Row+2))
 	b.Excel.SetCellStyle(b.SheetName, imageCell1, imageCell1, style1)
 	b.Excel.SetCellValue(b.SheetName, imageCell1, "")
 
 	// 签字图片2 K10-L12
-	b.Excel.MergeCell(b.SheetName, imageCell2, fmt.Sprintf("L%d", row+2))
+	b.Excel.MergeCell(b.SheetName, imageCell2, fmt.Sprintf("L%d", b.Row+2))
 	b.Excel.SetCellStyle(b.SheetName, imageCell2, imageCell1, style1)
 	b.Excel.SetCellValue(b.SheetName, imageCell2, "")
 
@@ -344,7 +344,7 @@ func (b *PurchaseBillExcel) drawTableSignature() error {
 		}
 	}
 
-	b.Excel.SetRowHeight(b.SheetName, row, 21)
+	b.Excel.SetRowHeight(b.SheetName, b.Row, 21)
 
 	return nil
 }

+ 1 - 1
boxcost/api/plan.go

@@ -228,7 +228,7 @@ func DownLoadCompBills(c *gin.Context, apictx *ApiSession) (interface{}, error)
 		billExcel.SetRow(row)
 		billExcel.Draws()
 		fmt.Println(billExcel.GetRow())
-		row = billExcel.GetRow() + 3
+		row = billExcel.GetRow() + 5
 	}
 
 	c.Header("Content-Type", "application/octet-stream")

+ 5 - 6
boxcost/api/report-produce-excel.go

@@ -201,12 +201,11 @@ func (b *ReportProduceExcel) drawTableContent() error {
 			b.FormatToEmpty(&budgetAmount)
 			// 实际金额
 			realPrice := ""
-			if b.Content.Status == "complete" {
-				// 实际完成数
-				realCount = fmt.Sprintf("%d", produce.ConfirmCount)
-				b.FormatToEmpty(&realCount)
-				realPrice = fmt.Sprintf("%.3f", produce.OrderPrice*float64(produce.ConfirmCount))
-			}
+			// 实际完成数
+			realCount = fmt.Sprintf("%d", produce.ConfirmCount)
+			b.FormatToEmpty(&realCount)
+			realPrice = fmt.Sprintf("%.3f", produce.OrderPrice*float64(produce.ConfirmCount))
+			b.FormatToEmpty(&realPrice)
 
 			deliveryTime := produce.DeliveryTime.Local().Format("2006-01-02")
 			DrawRow(b.Row, produce.Name, produce.Norm, produce.Paper, produce.PaperSize, produce.PrintSize, fmt.Sprintf("%d", produce.OrderCount), realCount, priceStr, budgetAmount, realPrice, deliveryTime, produce.Remark)

+ 7 - 9
boxcost/api/report-purchase-excel.go

@@ -242,15 +242,13 @@ func (b *ReportPurchaseExcel) drawTableContent() error {
 			budgetAmount := fmt.Sprintf("%.3f", paper.OrderPrice*float64(paper.OrderCount))
 			b.FormatToEmpty(&budgetAmount)
 
-			if b.Content.Status == "complete" {
-				// 实际完成数
-				realCount = fmt.Sprintf("%d", paper.ConfirmCount)
-				b.FormatToEmpty(&realCount)
-
-				// 实际金额
-				realPrice = fmt.Sprintf("%.3f", paper.OrderPrice*float64(paper.ConfirmCount))
-				b.FormatToEmpty(&realPrice)
-			}
+			// 实际完成数
+			realCount = fmt.Sprintf("%d", paper.ConfirmCount)
+			b.FormatToEmpty(&realCount)
+
+			// 实际金额
+			realPrice = fmt.Sprintf("%.3f", paper.OrderPrice*float64(paper.ConfirmCount))
+			b.FormatToEmpty(&realPrice)
 
 			DrawRow(b.Row, paper.Name, paper.Norm, paper.Height, paper.Width, fmt.Sprintf("%d", paper.OrderCount), realCount, price, price2, budgetAmount, realPrice, deliveryTime, paper.Remark)
 			b.Row++