Ver código fonte

fix:打印优化

maliang 1 semana atrás
pai
commit
83314cbe6d

+ 28 - 4
common/mixins/blePrintMixin.js

@@ -215,7 +215,15 @@ export default {
                 content: `${obj.barCode}`,
                 rotation: TRotation.ROTATION_0,
                 codeType: TCodeType.CODE128,
-                showType: 2,
+                showType: 0,
+              })
+            )
+            .text(
+              new TText({
+                x: barcodeX,
+                y: barcodeY + barcodeHeight + 5,
+                content: `SKU-${obj.barCode}`,
+                font: TFont.TSS16,
               })
             )
             .print(num);
@@ -234,19 +242,35 @@ export default {
                   content: `${obj.barCode}`,
                   rotation: TRotation.ROTATION_0,
                   codeType: TCodeType.CODE128,
-                  showType: 2,
+                  showType: 0,
+                })
+              )
+              .text(
+                new TText({
+                  x: 50,
+                  y: 30 + 100 + 5,
+                  content: `SKU-${obj.barCode}`,
+                  font: TFont.TSS16,
                 })
               )
               .barcode(
                 new TBarCode({
                   x: 50,
-                  y: 30 + 100 + 50,
+                  y: 30 + 100 + 5 + 35,
                   cellWidth: 2,
                   height: 50,
                   content: `${obj.batchNumber}`,
                   rotation: TRotation.ROTATION_0,
                   codeType: TCodeType.CODE128,
-                  showType: 2,
+                  showType: 0,
+                })
+              )
+              .text(
+                new TText({
+                  x: 50,
+                  y: 30 + 100 + 5 + 35 + 50 + 5,
+                  content: `PC${obj.batchNumber}`,
+                  font: TFont.TSS16,
                 })
               )
               .print(num);

+ 1 - 0
common/store/modules/update.js

@@ -77,6 +77,7 @@ export default {
 			if (params.os != 'ios' && params.os != 'android') false; //如果不是安卓或ios 返回false
 			selectVersion()
 			.then(async res=>{
+				console.log('selectVersion=====',res)
 				// let need_update = await compareVersion(system_info.appVersion, res.data.version); // 检查是否需要升级(对比版本号)
 				if(system_info.appVersion!=res.data.version) {
 					commit('setUpdate',true)

+ 38 - 25
components/print-pop/print-pop.vue

@@ -9,8 +9,8 @@
       :closeOnClickOverlay="false"
     >
       <view class="pop-content">
-				<!-- 出库 -->
-        <view class="pop-main" v-if="info.type==2">
+        <!-- 出库 -->
+        <view class="pop-main" v-if="info.type == 2">
           <view class="flex_box flex-row-center pd-30">
             <view class="qr-code">
               <uqrcode
@@ -26,16 +26,18 @@
               <view class="item-value">{{ info.number }}</view>
             </view>
           </view>
-					<tki-barcode
+          <tki-barcode
+            ref="skubarCode"
             :show="showBarCode"
             :val="barcodeVal"
-						cid="sku-barcode1"
+            cid="sku-barcode1"
             :opations="{
               width: 1,
               height: 100,
               displayValue: true,
               margin: 10,
             }"
+            :loadMake="false"
           />
           <view class="tips-value">请确认打印条码数量</view>
           <view class="num-box">
@@ -45,33 +47,36 @@
               :min="0"
             ></u-number-box>
           </view>
-        </view> 
-				<!-- 入库 -->
-				<view class="pop-main" v-if="info.type==1">
-					<!-- sku -->
-					<tki-barcode
+        </view>
+        <!-- 入库 -->
+        <view class="pop-main" v-if="info.type == 1">
+          <!-- sku -->
+          <tki-barcode
+            ref="skubarCode1"
             :show="showBarCode"
             :val="barcodeVal"
-						cid="sku-barcode"
+            cid="sku-barcode"
             :opations="{
               width: 1,
               height: 100,
               displayValue: true,
               margin: 10,
             }"
+            :loadMake="false"
           />
-					<!-- 批次号(入库已完成) -->
-					<tki-barcode
-					  v-if="info.status==2"
-            :show="showBarCode"
+          <!-- 批次号(入库已完成) -->
+          <tki-barcode
+            ref="batchNumber"
+            :show="showBarCode && info.status == 2"
             :val="batchNumberVal"
-						cid="batch-barcode"
+            cid="batch-barcode"
             :opations="{
               width: 1,
               height: 100,
               displayValue: true,
               margin: 10,
             }"
+            :loadMake="false"
           />
           <view class="tips-value">请确认打印条码数量</view>
           <view class="num-box">
@@ -118,28 +123,28 @@ export default {
       type: Boolean,
       default: false,
     },
-		/**
-		 * 入库显示条码号、批次号(显示:订单状态且为已入库)
-		 * 出库显示二维码(订单编号)、发货客户名称、发货商品sku
-    */ 
+    /**
+     * 入库显示条码号、批次号(显示:订单状态且为已入库)
+     * 出库显示二维码(订单编号)、发货客户名称、发货商品sku
+     */
     info: {
       type: Object,
       default: () => ({
         customerName: "", // 客户名称
         number: "", // 订单编号
         barCode: "", // 商品条码
-				batchNumber: "", // 批次号
-				type: null, // 入库:1 出库;2
+        batchNumber: "", // 批次号
+        type: null, // 入库:1 出库;2
         status: "", // 订单状态 入库状态为2才有批次号,出库不显示批次号
       }),
     },
   },
   computed: {
     barcodeVal() {
-      return this.info.barCode?`SKU-${this.info.barCode}`:"";
+      return this.info.barCode ? `SKU-${this.info.barCode}` : "";
     },
     batchNumberVal() {
-      return this.info.batchNumber?`PC${this.info.batchNumber}`:"";
+      return this.info.batchNumber ? `PC${this.info.batchNumber}` : "";
     },
   },
   data() {
@@ -158,6 +163,14 @@ export default {
     handleOpen() {
       this.printNum = 1;
       this.showBarCode = true;
+      this.$nextTick(() => {
+        if (this.info.type == 1) {
+          this.$refs.skubarCode1._makeCode();
+          this.$refs.batchNumber._makeCode();
+        } else {
+          this.$refs.skubarCode._makeCode();
+        }
+      });
     },
     handleConfirm() {
       const params = {
@@ -167,8 +180,8 @@ export default {
           customerName: this.info.customerName, //客户名
           number: this.info.number, // 单据编号
           batchNumber: this.info.batchNumber, // 批次号
-					type: this.info.type, // 入库:1 出库;2
-					status: this.info.status, // 订单状态 入库状态为2才有批次号,出库不显示批次号
+          type: this.info.type, // 入库:1 出库;2
+          status: this.info.status, // 订单状态 入库状态为2才有批次号,出库不显示批次号
         },
       };
       this.$emit("confirm", params);

+ 2 - 2
manifest.json

@@ -2,8 +2,8 @@
     "name" : "pdaApp-test",
     "appid" : "__UNI__7E491C0",
     "description" : "pdaApp",
-    "versionName" : "1.0.9",
-    "versionCode" : 109,
+    "versionName" : "1.1.1",
+    "versionCode" : 111,
     "transformPx" : false,
     /* 5+App特有相关 */
     "app-plus" : {

+ 2 - 1
pages/picking-task/delivery.vue

@@ -304,9 +304,10 @@
 				this.toOrderSubmit()
 			},
 			toOrderSubmit() {
+				console.log('this.goodsList=====',this.goodsList)
 				let materials = this.goodsList.map(item=> {
 					return {
-						batchNumber:item.batchNumber,
+						barCode:item.barCode,
 						materialNumber:item.materialNumber,
 						productionDate:item.productionDate ? this.$u.timeFormat(item.productionDate, 'yyyy-mm-dd') : ''
 					}