wangchao пре 3 година
родитељ
комит
0170d2b715
1 измењених фајлова са 11 додато и 6 уклоњено
  1. 11 6
      pages/erpbusiness/sendCommand.vue

+ 11 - 6
pages/erpbusiness/sendCommand.vue

@@ -66,7 +66,7 @@
 		onLoad() {
 			uni.showLoading({
 				title: '加载中',
-				mask:true
+				mask: true
 			})
 			this.$api.doRequest('get', '/qualityInspectionManagement/api/getQualityInspection', {
 				id: uni.getStorageSync('quality_print_id')
@@ -186,13 +186,18 @@
 				var command = esc.jpPrinter.createNew()
 				command.init()
 				//编号
-				command.bold(3); //加粗
-				command.setFontSize(36); //字体大小
-				command.setSelectJustification(1) //居中
-				command.rowSpace(200);
 				// command.rowSpace(10);
+				if (that.gridList.qualityNo) {
+					command.bold(3); //加粗
+					command.setFontSize(36); //字体大小
+					command.setSelectJustification(1) //居中
+					command.rowSpace(200);
+					command.setText(that.gridList.qualityNo.substring(that.gridList.qualityNo.length - 3));
+				} else {
+					uni.showToast('编号错误!')
+				}
+
 
-				command.setText(that.gridList.qualityNo.substring(that.gridList.qualityNo.length - 3));
 				command.setPrint();
 				command.rowSpace(60);
 				command.bold(0); //取消加粗