| | |
| | | }); |
| | | |
| | | laydate.render({ |
| | | elem: '#foodYear', |
| | | theme: '#7b8e9f', |
| | | value: foodYear, |
| | | type: 'year' |
| | | }); |
| | | |
| | | laydate.render({ |
| | | elem: '#checkTime', |
| | | theme: '#7b8e9f', |
| | | format: 'yyyy-MM-dd HH:mm:ss', |
| | |
| | | |
| | | //显示入库流程 |
| | | showProgress(); |
| | | |
| | | // 初始化WebSocket |
| | | //initInoutWS(deptId, bizType, progress, userId); |
| | | }); |
| | | window.onbeforeunload = function () { |
| | | } |
| | | |
| | | window.onunload = function () { |
| | | } |
| | | window.onload = function () { |
| | | |
| | | //扫描枪自动回车事件 |
| | | $('#checkId').bind('keyup', function (event) { |
| | | if (event.keyCode == "13") { |
| | | // //去掉焦点,防止刷新页面 |
| | | // $('#checkId').blur(); |
| | | getDataByCheckId(); |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | // socket信息返回處理 |
| | | function socketOnMessage(packet) { |
| | |
| | | var limit = data.upperLimit; |
| | | //运算符 |
| | | var symbol = data.operaSymbol; |
| | | |
| | | if (symbol && limit) { |
| | | if (">=" == symbol) { |
| | | if (newValue < limit) { |
| | |
| | | // window.parent.openTab(url, "化验结果导出", "checkDataExport"); |
| | | }; |
| | | |
| | | // 根据模式启动开始扦样 |
| | | function checkExe(type) { |
| | | checkDto.type = type; |
| | | var param = JSON.stringify(checkDto); |
| | | var index = layer.load(); |
| | | $.ajax({ |
| | | type: "POST", |
| | | url: "../../api/check/check-exe", |
| | | dataType: "json", |
| | | contentType: "application/json;charset=UTF-8", |
| | | data: param, |
| | | success: function (result) { |
| | | layer.close(index); |
| | | if (result.code != "0000") { |
| | | layer.alert(result.msg); |
| | | } else { |
| | | layer.msg("操作命令发送成功!"); |
| | | } |
| | | }, |
| | | error: function () { |
| | | layer.close(index); |
| | | layer.alert("后台异常,操作命令发送失败!"); |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | // 关闭扦样机器 |
| | | function checkStop() { |
| | | var param = JSON.stringify(checkDto); |
| | | var index = layer.load(); |
| | | $.ajax({ |
| | | type: "POST", |
| | | url: "../../api/check/stop", |
| | | dataType: "json", |
| | | contentType: "application/json;charset=UTF-8", |
| | | data: param, |
| | | success: function (result) { |
| | | layer.close(index); |
| | | if (result.code != "0000") { |
| | | layer.alert(result.msg); |
| | | } else { |
| | | layer.msg("操作命令发送成功!"); |
| | | } |
| | | }, |
| | | error: function () { |
| | | layer.close(index); |
| | | layer.alert("后台异常,操作命令发送失败!"); |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | // 扦样机复位 |
| | | function checkReset() { |
| | | var param = JSON.stringify(checkDto); |
| | | var index = layer.load(); |
| | | $.ajax({ |
| | | type: "POST", |
| | | url: "../../api/check/reset", |
| | | dataType: "json", |
| | | contentType: "application/json;charset=UTF-8", |
| | | data: param, |
| | | success: function (result) { |
| | | layer.close(index); |
| | | if (result.code != "0000") { |
| | | layer.alert(result.msg); |
| | | } else { |
| | | layer.msg("操作命令发送成功!"); |
| | | } |
| | | }, |
| | | error: function () { |
| | | layer.close(index); |
| | | layer.alert("后台异常,操作命令发送失败!"); |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | // 扦样机解除急停 |
| | | function checkResetStop() { |
| | | var param = JSON.stringify(checkDto); |
| | |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | //隐藏信息--替换为* |
| | | function replaceStr(str) { |
| | | if (!str) { |
| | | return ""; |
| | | } |
| | | var split = str.split(""); |
| | | |
| | | if (split.length == 1) { |
| | | return "*"; |
| | | } |
| | | if (split.length == 2 || split.length == 3) { |
| | | return str.slice(0, 1) + "**" |
| | | } |
| | | return str.slice(0, 1) + "***" + str.slice(split.length - 1); |
| | | } |
| | | |
| | | // 更新化验结果提醒,只做提醒,不做自动判断 |
| | | function updateCheckResultTip() { |
| | |
| | | title: '备注说明', |
| | | align: 'center', |
| | | edit: 'text' |
| | | }]] |
| | | }]], |
| | | limit: this.curCheckItems.length //显示的数量 |
| | | }); |
| | | |
| | | $("thead tr").css({ |
| | |
| | | |
| | | function showDetail(data) { |
| | | curCheckData = data; |
| | | |
| | | if (!curCheckData.checkTime) { |
| | | curCheckData.checkTime = dateFtt("yyyy-MM-dd hh:mm:ss", new Date()); |
| | | } |
| | |
| | | shade: 0, |
| | | content: $('#checkDetail'), |
| | | btnAlign: 'c', |
| | | btn: ['仅保存', '保存提交','关闭取消'], |
| | | btn: ['仅保存', '保存提交', '关闭取消'], |
| | | yes: function () { |
| | | // 更新到页面 |
| | | var data = form.val("form-detail"); |
| | | // 合并更新當前编辑数据 |
| | | Object.assign(curCheckData, data); |
| | | saveCheckData(); |
| | | if(scanCodeTag){ |
| | | if (scanCodeTag) { |
| | | showScanCode(); |
| | | } |
| | | }, btn2: function () { |
| | |
| | | // 合并更新當前编辑数据 |
| | | Object.assign(curCheckData, data); |
| | | submit(); |
| | | if(scanCodeTag){ |
| | | if (scanCodeTag) { |
| | | showScanCode(); |
| | | } |
| | | }, btn3: function () { |
| | | parent.layer.closeAll(); |
| | | if(scanCodeTag){ |
| | | if (scanCodeTag) { |
| | | showScanCode(); |
| | | } |
| | | }, |
| | | closeBtn: 0 |
| | | }); |
| | | |
| | | // 获取化验项信息 |
| | | flushCheckItem(curCheckData.foodVariety); |
| | | getPriceByFoodLevel(curCheckData.foodLevel); |
| | |
| | | $("#check-result-tip").text("检验结果:#"); |
| | | $("#price-result-tip2").text("粮食定价:#元/公斤"); |
| | | curCheckData.foodVariety = foodVariety; |
| | | |
| | | var index = layer.load(); |
| | | $.ajax({ |
| | | type: "POST", |
| | |
| | | area: ['700px', '320px'], |
| | | shade: 0, |
| | | content: $('#scanCodeDetail'), |
| | | success: function(layero, index){ |
| | | success: function () { |
| | | document.getElementById('checkId').focus(); |
| | | }, |
| | | btnAlign: 'c', |
| | |
| | | //根据质检单号获取信息 |
| | | function getDataByCheckId() { |
| | | var param = form.val("form-sacnCodeDetail"); |
| | | if(!param.checkId){ |
| | | if (!param.checkId) { |
| | | layer.alert("质检单号为空,请扫码或输入质检单号"); |
| | | } |
| | | var index = layer.load(); |
| | |
| | | layer.close(index); |
| | | $("#form-sacnCodeDetail")[0].reset(); |
| | | form.render(); |
| | | layer.alert("保存失败,请重新尝试!"); |
| | | alertError("保存失败,请重新尝试!") |
| | | } |
| | | }); |
| | | } |