|
@@ -30,21 +30,21 @@
|
|
|
<input class="my-input" type="hidden" id="machineIsPrint" name="machineIsPrint"/>
|
|
|
<input class="my-input" type="text" id="settingNumber" name="printNumber" value="3" placeholder="打印数量" style="margin-top: 10px;"/>
|
|
|
<button type="button" class="my-btn-search" onclick="printList();" style="margin-right: 50px;margin-top: 10px;">打印</button>
|
|
|
-
|
|
|
+ <button type="button" class="my-btn-search" onclick="batchUpdatePring();" style="margin-right: 50px;margin-top: 10px;">修改为已打印</button>
|
|
|
</form>
|
|
|
</div>
|
|
|
<div class="mt-2" style="margin: 20px;">
|
|
|
- <table class="table table-border table-bordered table-bg table-hover table-sort">
|
|
|
+ <table class="table table-border table-bordered table-bg table-hover table-sort" style=" width: 50%;margin: 0 auto;">
|
|
|
<thead>
|
|
|
<tr class="text-c">
|
|
|
<th width="1"><input name='checkbox' type='checkbox' value='' id="all" >全选</th>
|
|
|
- <th width="10">机器条码(点击打印)</th>
|
|
|
+ <th width="10">产品条码</th>
|
|
|
<th width="20">操作</th>
|
|
|
</tr>
|
|
|
</thead>
|
|
|
<tbody id="listid">
|
|
|
<#list machineList as list>
|
|
|
- <tr >
|
|
|
+ <tr class="text-c">
|
|
|
<td width="2">
|
|
|
<input name='checkbox' type='checkbox' value='${list.machineBarcode }${list.machineQrcode }${list.machineProduceType }' >
|
|
|
</td>
|
|
@@ -109,11 +109,18 @@
|
|
|
|
|
|
}
|
|
|
function printList() {
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
var machineBarcode = null;
|
|
|
var machineQrcode = null;
|
|
|
var machineProduceType = null;
|
|
|
var prints = "";
|
|
|
var settingNumber = $("#settingNumber").val();
|
|
|
+ var msg = "每个条形码打印数量为"+settingNumber+"条!";
|
|
|
+ layer.confirm(msg, {
|
|
|
+ btn: ['确认','取消'] //按钮
|
|
|
+ }, function(){
|
|
|
$("input[name='checkbox']:checkbox:checked").each(function(){
|
|
|
prints += $(this).val();
|
|
|
machineBarcode = $(this).val().substring(0,13);
|
|
@@ -146,15 +153,26 @@
|
|
|
'<span style="position: absolute;right: 26px;top: 102px;font-size: 12px;">NO.4295</span> ' +
|
|
|
'</div>');
|
|
|
}
|
|
|
- updatePrint(machineBarcode);
|
|
|
+ /*updatePrint(machineBarcode);*/
|
|
|
}
|
|
|
})
|
|
|
- if(prints != ""){
|
|
|
- $("#printlist").printArea();
|
|
|
- $("#printlist").html("");
|
|
|
+ if(prints != ""){
|
|
|
+ $("#printlist").printArea();
|
|
|
+ $("#printlist").html("");
|
|
|
+ layer.closeAll();
|
|
|
+ }else{
|
|
|
+ layer.msg('未选中需要打印的条形码', {icon: 2,time:2000});
|
|
|
+ }
|
|
|
+ }, function(){
|
|
|
+ return;
|
|
|
+ });
|
|
|
+
|
|
|
+ /*if (confirm(msg)==true){
|
|
|
+
|
|
|
}else{
|
|
|
- alert("未选中需要打印的条形码");
|
|
|
- }
|
|
|
+ return;
|
|
|
+ }*/
|
|
|
+
|
|
|
prints = "";
|
|
|
/*$.ajax({
|
|
|
cache: true,
|
|
@@ -271,6 +289,27 @@
|
|
|
function machineLogs(machineId) {
|
|
|
window.location.href=root_path + '/admin/machine/_machine_logs_list?machineId='+machineId;
|
|
|
}
|
|
|
+
|
|
|
+ function batchUpdatePring(){
|
|
|
+ var a = new Array();
|
|
|
+ $("input[name='checkbox']:checkbox:checked").each(function(i) {
|
|
|
+ a[i] = $(this).val().substring(0, 13);
|
|
|
+ })
|
|
|
+ $.ajax({
|
|
|
+ "type" : "post",
|
|
|
+ "url" : "${path}/admin/machine/_batchUpdate_print",
|
|
|
+ "dataType" : "json",
|
|
|
+ "data" :{machineBarcodes : ""+a},
|
|
|
+ /*"data" :{machineBarcodes : JSON.stringify(a)},*/
|
|
|
+ "success" : function(data) {
|
|
|
+ layer.msg('修改成功!', {icon: 1,time:2000});
|
|
|
+ },
|
|
|
+ "error":function(data){
|
|
|
+ /*alert("操作失败,请联系管理员!");*/
|
|
|
+ layer.msg('操作失败!', {icon: 2,time:2000});
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
</script>
|
|
|
</body>
|
|
|
</html>
|