| | |
| | | }); |
| | | |
| | | laydate.render({ |
| | | elem: '#foodYear', |
| | | theme: '#7b8e9f', |
| | | value: foodYear, |
| | | type: 'year' |
| | | }); |
| | | |
| | | laydate.render({ |
| | | elem: '#checkTime', |
| | | theme: '#7b8e9f', |
| | | format: 'yyyy-MM-dd HH:mm:ss', |
| | |
| | | showProgress(); |
| | | }); |
| | | window.onbeforeunload = function () { |
| | | console.log('页面刷新之前触发'); |
| | | } |
| | | |
| | | window.onunload = function () { |
| | | console.log('页面刷新完成触发'); |
| | | } |
| | | window.onload = function () { |
| | | |
| | |
| | | if (event.keyCode == "13") { |
| | | // //去掉焦点,防止刷新页面 |
| | | // $('#checkId').blur(); |
| | | console.log("in-check", "扫码枪"); |
| | | getDataByCheckId(); |
| | | } |
| | | }); |
| | |
| | | var limit = data.upperLimit; |
| | | //运算符 |
| | | var symbol = data.operaSymbol; |
| | | |
| | | if (symbol && limit) { |
| | | if (">=" == symbol) { |
| | | if (newValue < limit) { |
| | |
| | | }); |
| | | form.render(); |
| | | var data = form.val("form-detail"); |
| | | console.log("getPriceByFoodLevel") |
| | | |
| | | $.ajax({ |
| | | type: "POST", |
| | |
| | | success: function (result) { |
| | | if (result.code != "0000") { |
| | | layer.msg(result.msg); |
| | | console.log("getPriceByFoodLevel", "!=0000") |
| | | } else { |
| | | console.log("getPriceByFoodLevel", "==0000") |
| | | $("#check-result-tip2").text("粮食定价:" + result.data.price + "元/公斤"); |
| | | } |
| | | }, |
| | |
| | | * 渲染表格 |
| | | */ |
| | | function renderTableCheckItem() { |
| | | console.log("renderTableCheckItem") |
| | | // 清空数据 |
| | | $("#tableCheckItem").empty(); |
| | | table.render({ |
| | |
| | | title: '备注说明', |
| | | align: 'center', |
| | | edit: 'text' |
| | | }]] |
| | | }]], |
| | | limit: this.curCheckItems.length //显示的数量 |
| | | }); |
| | | |
| | | $("thead tr").css({ |
| | |
| | | // 赋值 |
| | | form.val("form-detail", curCheckData); |
| | | form.render(); |
| | | console.log("showDetail"); |
| | | |
| | | layer.open({ |
| | | type: 1, |
| | |
| | | btnAlign: 'c', |
| | | btn: ['仅保存', '保存提交', '关闭取消'], |
| | | yes: function () { |
| | | console.log("showDetail", "btn1") |
| | | // 更新到页面 |
| | | var data = form.val("form-detail"); |
| | | // 合并更新當前编辑数据 |
| | | Object.assign(curCheckData, data); |
| | | saveCheckData(); |
| | | if (scanCodeTag) { |
| | | console.log("showScanCode") |
| | | showScanCode(); |
| | | } |
| | | }, btn2: function () { |
| | | console.log("showDetail", "btn2") |
| | | // 更新到页面 |
| | | var data = form.val("form-detail"); |
| | | // 合并更新當前编辑数据 |
| | |
| | | } |
| | | }, btn3: function () { |
| | | parent.layer.closeAll(); |
| | | console.log("showDetail", "btn3") |
| | | if (scanCodeTag) { |
| | | showScanCode(); |
| | | } |
| | | }, |
| | | closeBtn: 0 |
| | | }); |
| | | console.log("showDetail", "end"); |
| | | // 获取化验项信息 |
| | | flushCheckItem(curCheckData.foodVariety); |
| | | getPriceByFoodLevel(curCheckData.foodLevel); |
| | |
| | | $("#price-result-tip2").text("粮食定价:#元/公斤"); |
| | | curCheckData.foodVariety = foodVariety; |
| | | var index = layer.load(); |
| | | console.log("flushCheckItem") |
| | | $.ajax({ |
| | | type: "POST", |
| | | url: "../../basic/inout/get-check-item", |
| | |
| | | data: JSON.stringify(curCheckData), |
| | | success: function (result) { |
| | | if (result.code != "0000") { |
| | | console.log("flushCheckItem", "!==0000") |
| | | layer.msg(result.msg); |
| | | } else { |
| | | curCheckItems = result.data; |
| | | console.log("flushCheckItem", "==0000") |
| | | // 根据化验结果提醒是否合格 |
| | | updateCheckResultTip(); |
| | | // 页面渲染检测项 |
| | |
| | | } |
| | | }, |
| | | error: function () { |
| | | console.log("flushCheckItem", "error") |
| | | layer.close(index); |
| | | layer.msg("后台异常,请重试或者联系管理员!!"); |
| | | } |
| | | }); |
| | | console.log("flushCheckItem", "end") |
| | | }; |
| | | |
| | | //仅保存 |
| | |
| | | data: JSON.stringify(param), |
| | | success: function (result) { |
| | | if (result.code != "0000") { |
| | | console.log("success", "!=0000") |
| | | layer.close(index); |
| | | $("#form-sacnCodeDetail")[0].reset(); |
| | | form.render(); |
| | | notify(result.msg, result.data); |
| | | } else { |
| | | console.log("success", "==0000") |
| | | updateSelect(); |
| | | showDetail(result.data); |
| | | } |