| | |
| | | btnAlign: 'c', |
| | | btn: ['打印并保存', '仅保存', '关闭取消'], |
| | | yes: function () { |
| | | printSimpleStart(); |
| | | printBar(curSampleData); |
| | | submit(); |
| | | }, btn2: function () { |
| | | // 更新到页面 |
| | | var data = form.val("form-detail"); |
| | |
| | | layer.closeAll(); |
| | | }, |
| | | closeBtn: 0 |
| | | }); |
| | | } |
| | | |
| | | |
| | | //执行打印 |
| | | function printSimpleStart() { |
| | | var index = layer.load(); |
| | | $.ajax({ |
| | | type: "POST", |
| | | url: "../../basic/inout/report/bill-simple", |
| | | dataType: "json", |
| | | contentType: "application/json;charset=UTF-8", |
| | | data: JSON.stringify(curSampleData), |
| | | success: function (result) { |
| | | layer.close(index); |
| | | if (result.code != "0000") { |
| | | alertError(result.msg); |
| | | } else { |
| | | printSimpleBill(result.data); |
| | | submit(); |
| | | } |
| | | }, |
| | | error: function () { |
| | | layer.close(index); |
| | | alertError("打印单据调用失败"); |
| | | } |
| | | }); |
| | | } |
| | | |
| | |
| | | success: function (result) { |
| | | if (result.code != "0000") { |
| | | layer.close(index); |
| | | notify(result.msg, result.data); |
| | | alertError(result.msg); |
| | | } else { |
| | | layer.closeAll(); |
| | | curSampleData = null; |
| | |
| | | alertError("提交失败,请重新尝试"); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * 弹出提醒框 |
| | | * @param msg 提醒信息 |
| | | * @param data 数据信息,可能为空 |
| | | */ |
| | | function notify(msg, data) { |
| | | if (data) { |
| | | //赋值 |
| | | $("#resultMsg").text(msg); |
| | | $("#resultUserName").text(data.userName); |
| | | $("#resultPlateNum").text(data.plateNum); |
| | | if ("IN" == data.type) { |
| | | $("#resultType").text("入库-" + INOUT_PROGRESS_MSG(data.progress)); |
| | | } else { |
| | | $("#resultType").text("出库-" + INOUT_PROGRESS_MSG(data.progress)); |
| | | } |
| | | $("#resultIntelCard").text(data.intelCard); |
| | | |
| | | layer.open({ |
| | | type: 1, |
| | | offset: ['150px', '200px'], |
| | | area: '450px;', |
| | | shade: 0.8, |
| | | id: 'dialog_notify_info', |
| | | btn: ['确定'], |
| | | content: $('#dialog-from-notify'), |
| | | yes: function (index) { |
| | | layer.closeAll(); |
| | | } |
| | | }); |
| | | } else { |
| | | layer.alert(msg, {offset: ['300px', '300px']}); |
| | | } |
| | | } |