|
@@ -310,57 +310,57 @@ func (b *ProductBillExcel) drawRemark() error {
|
|
|
|
|
|
}
|
|
|
|
|
|
-func (b *ProductBillExcel) drawTableSignature() error {
|
|
|
- b.Row += 2
|
|
|
- style1, _ := b.Excel.NewStyle(&excelize.Style{
|
|
|
- Alignment: &excelize.Alignment{Horizontal: "center", Vertical: "center"},
|
|
|
- // Border: border,
|
|
|
- })
|
|
|
-
|
|
|
- // 制单人
|
|
|
- billUserCell := fmt.Sprintf("A%d", b.Row+1)
|
|
|
- b.Excel.SetCellValue(b.SheetName, billUserCell, "制单人:"+b.Content.UserName)
|
|
|
- // billUservCell := fmt.Sprintf("B%d", b.Row+1)
|
|
|
- // b.Excel.SetCellValue(b.SheetName, billUservCell, b.Content.UserName)
|
|
|
-
|
|
|
- fontCell := fmt.Sprintf("F%d", b.Row)
|
|
|
- imageCell1 := fmt.Sprintf("G%d", b.Row)
|
|
|
- imageCell2 := fmt.Sprintf("I%d", b.Row)
|
|
|
- eRow := b.Row + 2
|
|
|
- b.Excel.MergeCell(b.SheetName, fontCell, fmt.Sprintf("F%d", eRow))
|
|
|
- b.Excel.SetCellStyle(b.SheetName, fontCell, fontCell, style1)
|
|
|
- b.Excel.SetCellValue(b.SheetName, fontCell, "审核签字:")
|
|
|
-
|
|
|
- b.Excel.MergeCell(b.SheetName, imageCell1, fmt.Sprintf("H%d", eRow))
|
|
|
- b.Excel.SetCellStyle(b.SheetName, imageCell1, imageCell1, style1)
|
|
|
- b.Excel.SetCellValue(b.SheetName, imageCell1, "")
|
|
|
-
|
|
|
- b.Excel.MergeCell(b.SheetName, imageCell2, fmt.Sprintf("J%d", eRow))
|
|
|
- b.Excel.SetCellStyle(b.SheetName, imageCell2, imageCell1, style1)
|
|
|
- b.Excel.SetCellValue(b.SheetName, imageCell2, "")
|
|
|
-
|
|
|
- // 状态为已审核时,签字
|
|
|
- // `{
|
|
|
- // "x_scale": 0.12,
|
|
|
- // "y_scale": 0.12,
|
|
|
- // "x_offset": 30,
|
|
|
- // "print_obj": true,
|
|
|
- // "lock_aspect_ratio": false,
|
|
|
- // "locked": false,
|
|
|
- // "positioning": "oncell"
|
|
|
- // }`
|
|
|
- if b.Content.Reviewed == 1 {
|
|
|
- imageCells := []string{imageCell1, imageCell2}
|
|
|
- if len(b.Signatures) > 0 {
|
|
|
- for k, sign := range b.Signatures {
|
|
|
- b.Excel.AddPicture(b.SheetName, imageCells[k], sign.Path, sign.Format)
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- return nil
|
|
|
-}
|
|
|
+// func (b *ProductBillExcel) drawTableSignature() error {
|
|
|
+// b.Row += 2
|
|
|
+// style1, _ := b.Excel.NewStyle(&excelize.Style{
|
|
|
+// Alignment: &excelize.Alignment{Horizontal: "center", Vertical: "center"},
|
|
|
+// // Border: border,
|
|
|
+// })
|
|
|
+
|
|
|
+// // 制单人
|
|
|
+// billUserCell := fmt.Sprintf("A%d", b.Row+1)
|
|
|
+// b.Excel.SetCellValue(b.SheetName, billUserCell, "制单人:"+b.Content.UserName)
|
|
|
+// // billUservCell := fmt.Sprintf("B%d", b.Row+1)
|
|
|
+// // b.Excel.SetCellValue(b.SheetName, billUservCell, b.Content.UserName)
|
|
|
+
|
|
|
+// fontCell := fmt.Sprintf("F%d", b.Row)
|
|
|
+// imageCell1 := fmt.Sprintf("G%d", b.Row)
|
|
|
+// imageCell2 := fmt.Sprintf("I%d", b.Row)
|
|
|
+// eRow := b.Row + 2
|
|
|
+// b.Excel.MergeCell(b.SheetName, fontCell, fmt.Sprintf("F%d", eRow))
|
|
|
+// b.Excel.SetCellStyle(b.SheetName, fontCell, fontCell, style1)
|
|
|
+// b.Excel.SetCellValue(b.SheetName, fontCell, "审核签字:")
|
|
|
+
|
|
|
+// b.Excel.MergeCell(b.SheetName, imageCell1, fmt.Sprintf("H%d", eRow))
|
|
|
+// b.Excel.SetCellStyle(b.SheetName, imageCell1, imageCell1, style1)
|
|
|
+// b.Excel.SetCellValue(b.SheetName, imageCell1, "")
|
|
|
+
|
|
|
+// b.Excel.MergeCell(b.SheetName, imageCell2, fmt.Sprintf("J%d", eRow))
|
|
|
+// b.Excel.SetCellStyle(b.SheetName, imageCell2, imageCell1, style1)
|
|
|
+// b.Excel.SetCellValue(b.SheetName, imageCell2, "")
|
|
|
+
|
|
|
+// // 状态为已审核时,签字
|
|
|
+// // `{
|
|
|
+// // "x_scale": 0.12,
|
|
|
+// // "y_scale": 0.12,
|
|
|
+// // "x_offset": 30,
|
|
|
+// // "print_obj": true,
|
|
|
+// // "lock_aspect_ratio": false,
|
|
|
+// // "locked": false,
|
|
|
+// // "positioning": "oncell"
|
|
|
+// // }`
|
|
|
+// if b.Content.Reviewed == 1 {
|
|
|
+// imageCells := []string{imageCell1, imageCell2}
|
|
|
+// if len(b.Signatures) > 0 {
|
|
|
+// for k, sign := range b.Signatures {
|
|
|
+// b.Excel.AddPicture(b.SheetName, imageCells[k], sign.Path, sign.Format)
|
|
|
+
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+
|
|
|
+// return nil
|
|
|
+// }
|
|
|
|
|
|
func (b *ProductBillExcel) Draws() {
|
|
|
b.drawTitle()
|
|
@@ -369,7 +369,7 @@ func (b *ProductBillExcel) Draws() {
|
|
|
b.drawTableContent()
|
|
|
b.drawTableFooter()
|
|
|
b.drawRemark()
|
|
|
- b.drawTableSignature()
|
|
|
+ // b.drawTableSignature()
|
|
|
}
|
|
|
|
|
|
func NewProductBill(f *excelize.File) *ProductBillExcel {
|