1
0
xwh 4 rokov pred
rodič
commit
70e9f15cd9

+ 5 - 2
kmall-admin/src/main/java/com/kmall/admin/utils/pdf/type/PDFWrite_nohead_36.java

@@ -34,7 +34,7 @@ public class PDFWrite_nohead_36 {
 
         writer.setPdfVersion(PdfWriter.PDF_VERSION_1_2);//版本(默认1.4)
         doc.open();// 打开文档
-        doc.setMargins(0,0,0,0);
+        doc.setMargins(0,0,-20,0);
 
         // -----------------------标签头----------------------
         for (int i = 0; i < 9; i++) {
@@ -89,6 +89,7 @@ public class PDFWrite_nohead_36 {
             priceCell.setBorder(0);
             priceCell.setHorizontalAlignment(Element.ALIGN_LEFT); // 水平居中
             priceCell.setVerticalAlignment(Element.ALIGN_BOTTOM); // 垂直居中
+            priceCell.setPaddingRight(5f);
             pdfPTable4.addCell(priceCell);
 
 
@@ -123,10 +124,11 @@ public class PDFWrite_nohead_36 {
         for (int i = 0; i < 4; i++) {
             // --------------底部黑色和条形码区域-------------------------------
             PdfPTable pdfPTable7 = new PdfPTable(2);
+            pdfPTable7.setWidths(new int[]{8,10});
             Font font = new Font(bfHei, 5.5f);
             font.setColor(Color.WHITE);
             Paragraph PLU = new Paragraph(pdfGoodsDto.getPlu(), font);
-            Paragraph blankParagraph = new Paragraph("                        ", font);
+            Paragraph blankParagraph = new Paragraph("           ", font);
             Paragraph barCode = new Paragraph(dtoBarCode.substring(dtoBarCode.length()-4), font);
             blankParagraph.add(barCode);
             PLU.add(blankParagraph);
@@ -147,6 +149,7 @@ public class PDFWrite_nohead_36 {
             img.scaleAbsolute(72,10.5f);
             PdfPCell imgCell = new PdfPCell(img,false);
             imgCell.setBorder(0);
+            imgCell.setPaddingLeft(3f);
             pdfPTable7.addCell(pluCell);
             pdfPTable7.addCell(imgCell);
             PdfPCell p = new PdfPCell(pdfPTable7);

+ 1 - 1
kmall-admin/src/main/resources/mybatis/mapper/GoodsDao.xml

@@ -701,7 +701,7 @@
             mall_goods g
         left join mall_product_store_rela rela on g.id = rela.goods_id
         <where>
-            <if test="sku != null and storeId != ''">
+            <if test="sku != null and sku != ''">
                and g.sku = #{sku}
             </if>
             <if test="storeId != null and storeId != ''">

+ 8 - 0
kmall-admin/src/main/webapp/js/shop/goodsexportpdf.js

@@ -75,6 +75,14 @@ let vm = new Vue({
 		},
 
 		exportPdf: function () {
+            if (vm.q.storeId==''){
+                alert("请先选择门店")
+                return;
+            }
+            if (vm.q.sku==''){
+                alert("请先输入sku")
+                return;
+            }
 
             window.open("../pdf/printPdf?type="+vm.q.pdfType+"&sku="+vm.q.sku+"&barCode="+vm.q.barCode+"&head="+vm.q.isHead+"&headUrl="+vm.q.headUrl+"&storeId="+vm.q.storeId);