Commit c07dca64 authored by liboyang's avatar liboyang

标签打印

parent 410f0e9e
...@@ -117,8 +117,8 @@ ...@@ -117,8 +117,8 @@
</div> </div>
</div> </div>
</section> </section>
<div style="display: none;"> <!--<div style="display: none;">
<!--<div id="div1"> <div id="div1">
<p> <p>
<object id="LODOP_OB" classid="clsid:2105C259-1E0C-4534-8141-A753534CB4CA" width=0 height=0> <object id="LODOP_OB" classid="clsid:2105C259-1E0C-4534-8141-A753534CB4CA" width=0 height=0>
<embed id="LODOP_EM" type="application/x-print-lodop" width=0 height=0 pluginspage="install_lodop32.exe"></embed> <embed id="LODOP_EM" type="application/x-print-lodop" width=0 height=0 pluginspage="install_lodop32.exe"></embed>
...@@ -127,7 +127,7 @@ ...@@ -127,7 +127,7 @@
<div style="font-family:'黑体';height:7mm;position: absolute;top:5mm;left:4mm;">{{json.policeData}}</div> <div style="font-family:'黑体';height:7mm;position: absolute;top:5mm;left:4mm;">{{json.policeData}}</div>
<div style="font-family:'黑体';height:7mm;position: absolute;top:12mm;left:3mm;">{{json.policeName}}</div> <div style="font-family:'黑体';height:7mm;position: absolute;top:12mm;left:3mm;">{{json.policeName}}</div>
<div style="font-family:'黑体';height:7mm;position: absolute;top:20mm;left:5mm;">数量:{{json.count}}张</div> <div style="font-family:'黑体';height:7mm;position: absolute;top:20mm;left:5mm;">数量:{{json.count}}张</div>
</div>--> </div>
<div id="tagDiv"> <div id="tagDiv">
<p> <p>
<object id="LODOP_OB" classid="clsid:2105C259-1E0C-4534-8141-A753534CB4CA" <object id="LODOP_OB" classid="clsid:2105C259-1E0C-4534-8141-A753534CB4CA"
...@@ -149,4 +149,4 @@ ...@@ -149,4 +149,4 @@
</p > </p >
</div> </div>
</div> </div>
</div> </div>-->
...@@ -173,30 +173,73 @@ angular.module('AvatarCheck.tagPrint', ['ngRoute', 'AvatarCheck.http', 'tm.pagin ...@@ -173,30 +173,73 @@ angular.module('AvatarCheck.tagPrint', ['ngRoute', 'AvatarCheck.http', 'tm.pagin
// }) // })
// } // }
// $scope.PreviewMytableRotate = function(){
// HttpService.getPoliceName($scope.json.policeCode,function(data) {
// $scope.json.policeData = data[0].POLICE_NAME;
// console.log($scope.json.policeData)
// $timeout(function () {
// var LODOP = getLodop();
// LODOP = getLodop(document.getElementById('LODOP1'), document.getElementById('LODOP_EM'));
// if (!LODOP) { alert("请先安装控件!"); return; }
// LODOP.SET_LICENSES("民软网(www.minsoft.cn)", "158703810611011350109107113120", "", "");
// //初始化
// LODOP.PRINT_INIT("打印封口签");
// //设置纸张大小
// // LODOP.SET_PRINT_PAGESIZE(1, "80mm", "50mm", "CreateCustomPage");
// LODOP.SET_PRINT_PAGESIZE(1, "84mm", "54mm", "");
// // LODOP.SET_PRINT_STYLE("FontName", "黑体");
// //设定该条形码在纸张内的位置和大小【Top, Left,Width, Height, CodeType, CodeValue】
// LODOP.ADD_PRINT_BARCODE("2mm", "2mm", "74mm", "20mm", "128A", $scope.json.policeCardsList[0].ACCEPT_NO.substring(0,8));
// //设定该打印项在纸张内的位置和区域大小【Top,Left,Width,Height,strHtmlContent】
// LODOP.ADD_PRINT_HTM("22mm", "0", "78mm", "24mm", document.getElementById("tagDiv").innerHTML);
// LODOP.PREVIEW();
// // LODOP.PRINT();
// })
// })
// };
$scope.PreviewMytableRotate = function(){ $scope.PreviewMytableRotate = function(){
HttpService.getPoliceName($scope.json.policeCode,function(data) { HttpService.getPoliceName($scope.json.policeCode,function(data) {
$scope.json.policeData = data[0].POLICE_NAME; $scope.json.policeData = data[0].POLICE_NAME;
console.log($scope.json.policeData) console.log($scope.json.policeData)
$timeout(function () { $timeout(function () {
var LODOP = getLodop(); var LODOP = getLodop();
LODOP = getLodop(document.getElementById('LODOP1'), document.getElementById('LODOP_EM')); LODOP = getLodop(document.getElementById('LODOP1'), document.getElementById('LODOP_EM'));
if (!LODOP) { alert("请先安装控件!"); return; } if (!LODOP) { alert("请先安装控件!"); return; }
LODOP.SET_LICENSES("民软网(www.minsoft.cn)", "158703810611011350109107113120", "", ""); // LODOP.SET_LICENSES("民软网(www.minsoft.cn)", "158703810611011350109107113120", "", "");
//初始化 //初始化
LODOP.PRINT_INIT("打印封口签"); LODOP.PRINT_INIT("打印封口签");
//设置纸张大小 //设置纸张大小
// LODOP.SET_PRINT_PAGESIZE(1, "80mm", "50mm", "CreateCustomPage"); // LODOP.SET_PRINT_PAGESIZE(1, "80mm", "50mm", "CreateCustomPage");
LODOP.SET_PRINT_PAGESIZE(1, "84mm", "54mm", ""); LODOP.SET_PRINT_PAGESIZE(1, "80mm", "50mm", "");
// LODOP.SET_PRINT_STYLE("FontName", "黑体"); // LODOP.SET_PRINT_STYLE("FontName", "黑体");
//设定该条形码在纸张内的位置和大小【Top, Left,Width, Height, CodeType, CodeValue】 //设定该条形码在纸张内的位置和大小【Top, Left,Width, Height, CodeType, CodeValue】
LODOP.ADD_PRINT_BARCODE("2mm", "2mm", "74mm", "20mm", "128A", $scope.json.policeCardsList[0].ACCEPT_NO.substring(0,8)); LODOP.ADD_PRINT_BARCODE(15,9, "78mm", "20mm", "128A", $scope.json.policeCardsList[0].ACCEPT_NO.substring(0,8));
//设定该打印项在纸张内的位置和区域大小【Top,Left,Width,Height,strHtmlContent】 LODOP.SET_PRINT_STYLEA(0, "FontSize", 14);
LODOP.ADD_PRINT_HTM("22mm", "0", "78mm", "24mm", document.getElementById("tagDiv").innerHTML); LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
LODOP.PREVIEW();
// LODOP.PRINT(); //设定该打印项在纸张内的位置和区域大小【Top,Left,Width,Height,strHtmlContent】
}) // LODOP.ADD_PRINT_HTM("24mm", "0", "80mm", "24mm", document.getElementById("tagDiv").innerHTML);
LODOP.ADD_PRINT_TEXT(102, 0, "100%", 20, $scope.json.policeData.toString());
LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
LODOP.SET_PRINT_STYLEA(0, "FontSize", 15);
LODOP.ADD_PRINT_TEXT(132, 0, "100%", 20, $scope.json.policeName.toString());
LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
LODOP.SET_PRINT_STYLEA(0, "VOrient", 0);
LODOP.SET_PRINT_STYLEA(0, "FontSize", 13);
LODOP.ADD_PRINT_TEXT(165, 0, "100%", 20, "数量:"+$scope.json.count.toString()+"");
LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
LODOP.SET_PRINT_STYLEA(0, "Alignment", 2);
LODOP.SET_PRINT_STYLEA(0, "FontSize", 15);
// LODOP.PREVIEW();
LODOP.PRINT();
}) })
}; })
};
}); });
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment