|
@@ -156,6 +156,11 @@
|
|
|
alert("设置成功!");
|
|
|
}*/
|
|
|
function print(machineBarcode,machineQrcode,machineId,produceType){
|
|
|
+ var produce = getProduce(machineId);
|
|
|
+ var producePattern = produce.producePattern; //获取产品型号前两位
|
|
|
+ var produceModel = produce.produceModel; //获取产品型号后两位
|
|
|
+ alert(JSON.stringify(machineId));
|
|
|
+
|
|
|
var settingNumber = $("#settingNumber").val();
|
|
|
var machineNo = 1000000 + parseInt(machineId);
|
|
|
for (var i=0;i<settingNumber;i++){
|
|
@@ -166,7 +171,7 @@
|
|
|
if(produceType == 1){//净水机模板
|
|
|
$("#printlist").append('<div style="width: 268px;height: 152px;position: relative;">' +
|
|
|
'<span style="position: absolute;top:0px;font-size: 14px;">WaterO可移动智能净水机</span>' +
|
|
|
- '<span style="position: absolute;top: 24px;font-size: 12px;">型号:WA-1X</span>' +
|
|
|
+ '<span style="position: absolute;top: 24px;font-size: 12px;">型号:'+producePattern+'-'+produceModel+'</span>' +
|
|
|
'<span style="position: absolute;top: 40px;font-size: 12px;">S/N</span>' +
|
|
|
'<div style="position: absolute;left: -10px;top: 75px;height: 30px;" id="bcTarget2" class="barcodeImg">'+barcodes+'</div>' +
|
|
|
'<span style="position: absolute;top: 102px;font-size: 12px;width: 116px;text-align: center;" id="barcodeId">'+machineBarcode+'</span>' +
|
|
@@ -177,7 +182,7 @@
|
|
|
if(produceType == '' || produceType == null){
|
|
|
$("#printlist").append('<div style="width: 268px;height: 152px;position: relative;">' +
|
|
|
'<span style="position: absolute;top:0px;font-size: 14px;">WaterO可移动智能净水机</span>' +
|
|
|
- '<span style="position: absolute;top: 24px;font-size: 12px;">型号:WA-1X</span>' +
|
|
|
+ '<span style="position: absolute;top: 24px;font-size: 12px;">型号:'+producePattern+'-'+produceModel+'</span>' +
|
|
|
'<span style="position: absolute;top: 40px;font-size: 12px;">S/N</span>' +
|
|
|
'<div style="position: absolute;left: -10px;top: 75px;height: 30px;" id="bcTarget2" class="barcodeImg">'+barcodes+'</div>' +
|
|
|
'<span style="position: absolute;top: 102px;font-size: 12px;width: 116px;text-align: center;" id="barcodeId">'+machineBarcode+'</span>' +
|
|
@@ -188,7 +193,7 @@
|
|
|
if(produceType == 2){//冲奶机模板
|
|
|
$("#printlist").append('<div style="width: 268px;height: 152px;position: relative;">' +
|
|
|
'<span style="position: absolute;top:0px;font-size: 14px;">爱贝源冲奶机</span>' +
|
|
|
- '<span style="position: absolute;top: 24px;font-size: 12px;">型号:WA-1X</span>' +
|
|
|
+ '<span style="position: absolute;top: 24px;font-size: 12px;">型号:'+producePattern+'-'+produceModel+'</span>' +
|
|
|
'<span style="position: absolute;top: 40px;font-size: 12px;">S/N</span>' +
|
|
|
'<div style="position: absolute;left: -10px;top: 75px;height: 30px;" id="bcTarget2" class="barcodeImg">'+barcodes+'</div>' +
|
|
|
'<span style="position: absolute;top: 102px;font-size: 12px;width: 116px;text-align: center;" id="barcodeId">'+machineBarcode+'</span>' +
|
|
@@ -321,6 +326,31 @@
|
|
|
function batch_add_machine(title,url,w,h){
|
|
|
layer_show(title,url,w,h);
|
|
|
}
|
|
|
+
|
|
|
+ /*获取产品信息*/
|
|
|
+ function getProduce(machineId){
|
|
|
+ var produce = new Object();
|
|
|
+ produce.producePattern = "";
|
|
|
+ produce.produceModel = "";
|
|
|
+ produce.produceFeature = "";
|
|
|
+ $.ajax({
|
|
|
+ type: "POST",
|
|
|
+ url: "${path}/admin/machine/_getProduce_print",
|
|
|
+ async: false,
|
|
|
+ data:{machineId : machineId},
|
|
|
+ success: function(data){
|
|
|
+ if(data != null){
|
|
|
+ produce.producePattern = data.producePattern;
|
|
|
+ produce.produceModel = data.produceModel;
|
|
|
+ produce.produceFeature = data.produceFeature;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error: function(){
|
|
|
+ console.log("查询产品型号信息失败!");
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return produce;
|
|
|
+ }
|
|
|
</script>
|
|
|
</body>
|
|
|
</html>
|