You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
1.3 KiB
46 lines
1.3 KiB
<#import "../master.ftl" as master>
|
|
<@master.layout>
|
|
<script src='http://127.0.0.1:8000/CLodopfuncs.js'></script>
|
|
|
|
<div class="page-header">
|
|
<h3>默认打印设置</h3>
|
|
</div>
|
|
|
|
<div class="row" id="app">
|
|
<div class="col-md-4">
|
|
<p><select id="printers" class="form-control">
|
|
<option>先预览后打印</option>
|
|
</select>
|
|
</p>
|
|
<p>
|
|
<button class="btn btn-primary" id="btnOK" >Ok</button>
|
|
</p>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
|
|
$("#btnOK").on("click", function() {
|
|
var printName = $("#printers").find('option:selected').text();
|
|
console.log(printName);
|
|
$.post("/print/setprinter/do", {printerIndex: $("#printers").val(),printName:printName}, function (data) {
|
|
if(data.success){
|
|
$.messager.alert("Info", "设置成功", "info");
|
|
}
|
|
})
|
|
});
|
|
|
|
$(function(){
|
|
CLODOP.Create_Printer_List(document.getElementById('printers'));
|
|
//判断是否打开设计模式
|
|
<#if currentUser.isAdmin>
|
|
$("#printers").prepend("<option value='-2'>设计模式</option>");
|
|
</#if>
|
|
|
|
$("#printers").prepend("<option value=-1>先预览后打印</option>").val(${printerIndex});
|
|
})
|
|
|
|
</script>
|
|
|
|
</@master.layout>
|
|
|