| | |
| | | shadeClose: true, |
| | | shade: 0.3, |
| | | closeBtn: 2, |
| | | offset: ['50px','120px'], |
| | | offset: ['50px', '120px'], |
| | | area: ['1000px', '640px'], |
| | | content: '../../basic/inout/inout-progress?type=' + type + "&t=" + Math.random() |
| | | }); |
| | |
| | | |
| | | // 监听重量变化 |
| | | $(".weight").blur(function () { |
| | | var name = this.name; |
| | | // deAutoByWeight(name); |
| | | deAutoByOut(name); |
| | | deAutoByOut(this.name) |
| | | }); |
| | | |
| | | // 初始化WebSocket |
| | |
| | | //暂无 |
| | | } |
| | | |
| | | // 根据当前操作的按钮ID更新其他按钮状态 |
| | | function flushBtn(btnId) { |
| | | if ("btn-weight" == btnId) {// 称重后可以点击完成称重 |
| | | $("#btn-submit").removeClass("layui-btn-disabled"); |
| | | $("#btn-submit").attr("disabled", false); |
| | | } |
| | | |
| | | if ("btn-submit" == btnId) { |
| | | $("#btn-submit").addClass("layui-btn-disabled"); |
| | | $("#btn-submit").attr("disabled", true); |
| | | |
| | | if (InoutProgress.WEIGHT_EMPTY == recordData.progress) {// 出库,如果是空车称重,完成收直接刷新页面 |
| | | resetForm(); |
| | | } else { |
| | | // 完成称重后控制按钮 |
| | | $("#btn-weight").addClass("layui-btn-disabled"); |
| | | $("#btn-weight").attr("disabled", true); |
| | | |
| | | $("#btn-printBill").removeClass("layui-btn-disabled"); |
| | | $("#btn-printBill").attr("disabled", false); |
| | | addDisabled(); |
| | | } |
| | | } |
| | | if ("btn-printBill" == btnId) {// 打印过磅单,说明业务完成 |
| | | $("#btn-weight").removeClass("layui-btn-disabled"); |
| | | $("#btn-weight").attr("disabled", false); |
| | | |
| | | $("#btn-submit").addClass("layui-btn-disabled"); |
| | | $("#btn-submit").attr("disabled", true); |
| | | |
| | | $("#btn-printBill").addClass("layui-btn-disabled"); |
| | | $("#btn-printBill").attr("disabled", true); |
| | | delDisabled(); |
| | | resetForm(); |
| | | } |
| | | } |
| | | // // 根据当前操作的按钮ID更新其他按钮状态 |
| | | // function flushBtn(btnId) { |
| | | // if ("btn-weight" == btnId) {// 称重后可以点击完成称重 |
| | | // $("#btn-submit").removeClass("layui-btn-disabled"); |
| | | // $("#btn-submit").attr("disabled", false); |
| | | // } |
| | | // |
| | | // if ("btn-submit" == btnId) { |
| | | // $("#btn-submit").addClass("layui-btn-disabled"); |
| | | // $("#btn-submit").attr("disabled", true); |
| | | // |
| | | // if (InoutProgress.WEIGHT_EMPTY == recordData.progress) {// 出库,如果是空车称重,完成收直接刷新页面 |
| | | // resetForm(); |
| | | // } else { |
| | | // // 完成称重后控制按钮 |
| | | // $("#btn-weight").addClass("layui-btn-disabled"); |
| | | // $("#btn-weight").attr("disabled", true); |
| | | // |
| | | // $("#btn-printBill").removeClass("layui-btn-disabled"); |
| | | // $("#btn-printBill").attr("disabled", false); |
| | | // addDisabled(); |
| | | // } |
| | | // } |
| | | // if ("btn-printBill" == btnId) {// 打印过磅单,说明业务完成 |
| | | // $("#btn-weight").removeClass("layui-btn-disabled"); |
| | | // $("#btn-weight").attr("disabled", false); |
| | | // |
| | | // $("#btn-submit").addClass("layui-btn-disabled"); |
| | | // $("#btn-submit").attr("disabled", true); |
| | | // |
| | | // $("#btn-printBill").addClass("layui-btn-disabled"); |
| | | // $("#btn-printBill").attr("disabled", true); |
| | | // delDisabled(); |
| | | // resetForm(); |
| | | // } |
| | | // } |
| | | |
| | | //控制流程环节显示 |
| | | function showProgress() { |
| | |
| | | form.render(); |
| | | |
| | | // 点击称重时候自动抓拍数据 |
| | | layer.msg("系统自动抓拍保留记录……"); |
| | | // layer.msg("系统自动抓拍保留记录……"); |
| | | snapData = { |
| | | companyId: companyId, |
| | | deptId: deptId, |
| | | progress: recordData.progress, |
| | | bizType: bizType, |
| | | plateNum: recordData.plateNum, |
| | | |
| | | id1: (null != snapDto1) ? snapDto1.id : null, |
| | | id2: (null != snapDto2) ? snapDto2.id : null, |
| | | id3: (null != snapDto3) ? snapDto3.id : null, |
| | | id1: snapDto1.id, |
| | | id2: snapDto2.id, |
| | | id3: snapDto3.id, |
| | | // id1: (null != snapDto1) ? snapDto1.id : null, |
| | | // id2: (null != snapDto2) ? snapDto2.id : null, |
| | | // id3: (null != snapDto3) ? snapDto3.id : null, |
| | | |
| | | sort: $("#scaleName").val(), |
| | | weight: weightDto.weight |
| | |
| | | success: function (result) { |
| | | layer.close(index); |
| | | if (result.code != "0000") { |
| | | layer.alert(result.msg); |
| | | alertError(result.msg); |
| | | // layer.alert(result.msg); |
| | | } else { |
| | | snapData = result.data; |
| | | } |
| | |
| | | } |
| | | |
| | | // 刷新状态 |
| | | flushBtn("btn-weight"); |
| | | // flushBtn("btn-weight"); |
| | | } |
| | | |
| | | //新的读卡方式 |
| | | function flushICCard() { |
| | | if(cardDto && cardDto.protocol != "TCP_DEFAULT"){ |
| | | if (cardDto && cardDto.protocol != "TCP_DEFAULT") { |
| | | //协议获取 |
| | | flushICCard2(); |
| | | }else { |
| | | } else { |
| | | //本地读取 |
| | | flushICCard1(); |
| | | } |
| | |
| | | offset: ['300px', '300px'] |
| | | }); |
| | | } else { |
| | | $("#intelCard").val(result.data.icCardNo); |
| | | paramIntelCard = data; |
| | | $("#text-param").text("识别卡号:" + paramIntelCard); |
| | | flushData(paramIntelCard, null); |
| | | } |
| | | } |
| | | layer.close(index); |
| | |
| | | * 本地读取智慧卡 |
| | | */ |
| | | function flushICCard1() { |
| | | $("#intelCard").val(null); |
| | | $("#text-param").val(null); |
| | | $("#form-data")[0].reset(); |
| | | form.render(); |
| | | recordData = null; |
| | |
| | | if (data === "not found") { |
| | | layer.alert("请重新读卡!", {offset: ['300px', '300px']}); |
| | | } else { |
| | | $("#intelCard").val(data); |
| | | flushData(); |
| | | paramIntelCard = data; |
| | | $("#text-param").text("识别卡号:" + paramIntelCard); |
| | | flushData(paramIntelCard, null); |
| | | } |
| | | }, |
| | | error: function () { |
| | |
| | | }); |
| | | } |
| | | |
| | | // 使用插件获取省份证 |
| | | // 使用插件获取身份证号 |
| | | function flushIdCard() { |
| | | var index = layer.load(); |
| | | $.ajax({ |
| | |
| | | }); |
| | | return; |
| | | } |
| | | $("#userId").val(data.idNum); |
| | | flushData(); |
| | | // $("#userId").val(data.idNum); |
| | | $("#text-param").text("识别身份证:" + paramIdCard); |
| | | |
| | | flushData(null, paramIdCard); |
| | | }, |
| | | error: function () { |
| | | layer.alert("身份证读取失败,请手动录入!", { |
| | |
| | | printWeight(result.data); |
| | | } |
| | | // 刷新按钮 |
| | | flushBtn("btn-printBill"); |
| | | // flushBtn("btn-printBill"); |
| | | } |
| | | layer.close(index); |
| | | }, |
| | |
| | | $("#btn-weight").removeClass("layui-btn-disabled"); |
| | | $("#btn-weight").attr("disabled", false); |
| | | |
| | | //空车和满车被重置 |
| | | updateEditAndProgress(); |
| | | $("#text-param").val(''); |
| | | |
| | | //扣重信息框恢复为可编辑 |
| | | delDisabled(); |
| | | // //空车和满车被重置 |
| | | // updateEditAndProgress(); |
| | | // |
| | | // //扣重信息框恢复为可编辑 |
| | | // delDisabled(); |
| | | } |
| | | |
| | | |
| | | function flushPage() { |
| | | layer.confirm('确定要刷新页面吗?', {icon: 3, title: '提示'}, function (index) { |
| | | resetForm(); |
| | | layer.msg("页面重置完成,请重新操作……"); |
| | | layer.close(index); |
| | | }); |
| | | } |
| | | |
| | | function flushData() { |
| | | function flushData(intelCard, userIdCard) { |
| | | var index = layer.load(); |
| | | var userId2 = $("#userId").val(); |
| | | var intelCard = $("#intelCard").val(); |
| | | var userId2 = userIdCard; |
| | | var intelCard = intelCard; |
| | | var plateNum = $("#plateNum").val(); |
| | | var param = { |
| | | type: type, |
| | |
| | | data: JSON.stringify(param), |
| | | success: function (result) { |
| | | if (result.code != "0000") { |
| | | notify(result.msg, result.data); |
| | | notifyProgress(result.msg, result.data); |
| | | } else { |
| | | recordData = result.data; |
| | | // 返回的数据进行赋值 |
| | |
| | | }, |
| | | error: function () { |
| | | layer.close(index); |
| | | layer.alert("查询失败,请重新尝试!!"); |
| | | alertError("查询失败,请重新尝试"); |
| | | // layer.alert("查询失败,请重新尝试!!"); |
| | | } |
| | | }); |
| | | } |
| | |
| | | } |
| | | |
| | | // 当前完成 |
| | | function submit(data) { |
| | | function submit() { |
| | | if (null == recordData) { |
| | | notify("没有数据可以提交", null); |
| | | notifyProgress("没有数据可以提交", null); |
| | | return; |
| | | } |
| | | var data = form.val("form-data"); |
| | | // 校验-出库空车 |
| | | if (InoutProgress.WEIGHT_EMPTY == recordData.progress) { |
| | | if (data.emptyWeight <= 0.0) { |
| | | notify("空车称重信息必填!!", null); |
| | | notifyProgress("空车称重信息必填!!", null); |
| | | return; |
| | | } |
| | | if (!data.depotId) { |
| | | notify("装卸仓库必须填写!!", null); |
| | | notifyProgress("装卸仓库必须填写!!", null); |
| | | return; |
| | | } |
| | | if (!data.noticeId) { |
| | | notify("通知单必须填写!!", null); |
| | | notifyProgress("通知单必须填写!!", null); |
| | | return; |
| | | } |
| | | } else { |
| | | if (data.fullWeight <= 0.0) { |
| | | notify("满车称重信息必填!!", null); |
| | | notifyProgress("满车称重信息必填!!", null); |
| | | return; |
| | | } |
| | | if (!data.foodVariety) { |
| | | notify("粮食品种必填!!", null); |
| | | notifyProgress("粮食品种必填!!", null); |
| | | return; |
| | | } |
| | | if (!data.settleWeight || data.settleWeight <= 0.0) { |
| | | notify("结算重量合规,请核对!!", null); |
| | | notifyProgress("结算重量合规,请核对!!", null); |
| | | return; |
| | | } |
| | | } |
| | |
| | | fileName: snapData.fileName3 |
| | | }]; |
| | | recordData.files = files; |
| | | |
| | | console.log("out-weight,submit") |
| | | var index = layer.load(); |
| | | $.ajax({ |
| | | type: "POST", |
| | | url: "../../basic/inout/inout-next-step", |
| | | url: "../../basic/inout/submit-weight", |
| | | dataType: "json", |
| | | contentType: "application/json;charset=UTF-8", |
| | | data: JSON.stringify(recordData), |
| | | success: function (result) { |
| | | if (result.code != "0000") { |
| | | notify(result.msg, result.data); |
| | | notifyProgress(result.msg, result.data); |
| | | } else { |
| | | notify("数据提交成功", result.data); |
| | | notifyProgress("数据提交成功", result.data); |
| | | // 更新按钮显示 |
| | | flushBtn("btn-submit"); |
| | | // flushBtn("btn-submit"); |
| | | } |
| | | layer.close(index); |
| | | }, |
| | | error: function () { |
| | | layer.close(index); |
| | | notify("提交失败,请重新尝试", null); |
| | | notifyProgress("提交失败,请重新尝试", null); |
| | | } |
| | | }); |
| | | |
| | |
| | | // }); |
| | | } |
| | | |
| | | |
| | | // ---------------------------通知单-开始 -------------------// |
| | | // 弹出往来单位下拉框 |
| | | function showNotice() { |
| | | var index = layer.load(); |
| | | var param = { |
| | | type: type |
| | | }; |
| | | // 渲染往来单位列表 |
| | | table.render({ |
| | | elem: '#tableNotice', |
| | | url: '../../basic/inout/list-notice—out', |
| | | page: false, |
| | | // skin : "nob", |
| | | // size : 'sm', |
| | | even: true, |
| | | method: 'POST', |
| | | contentType: "application/json;charset=UTF-8", |
| | | cols: [[{ |
| | | field: 'name', |
| | | title: '通知单名称', |
| | | width: '15%' |
| | | }, { |
| | | field: 'customerName', |
| | | title: '收货单位' |
| | | }, { |
| | | field: 'depotName', |
| | | title: '仓库名称', |
| | | width: '15%' |
| | | }, { |
| | | field: 'foodVarietyName', |
| | | title: '粮食品种', |
| | | width: '10%' |
| | | }, { |
| | | field: 'year', |
| | | title: '年份', |
| | | width: '8%' |
| | | }, { |
| | | field: 'contractName', |
| | | title: '所属合同' |
| | | }]], |
| | | where: param, |
| | | parseData: function (res) { |
| | | if ("0000" == res.code) { |
| | | return { |
| | | "code": "0", |
| | | "msg": res.msg, |
| | | "data": res.data |
| | | } |
| | | } else { |
| | | return { |
| | | "code": "1", |
| | | "msg": res.msg |
| | | } |
| | | } |
| | | }, |
| | | done: function (res) { |
| | | layer.close(index); |
| | | } |
| | | }); |
| | | |
| | | //双击显示选中数据 |
| | | table.on('rowDouble(tableNotice)', function (obj) { |
| | | var data = obj.data; |
| | | form.val("form-data", { |
| | | customerId: data.customerId, |
| | | customerName: data.customerName, |
| | | noticeId: data.id, |
| | | foodType: data.foodType, |
| | | foodLevel: data.foodLevel |
| | | }); |
| | | // 关闭 |
| | | layer.closeAll(); |
| | | }); |
| | | |
| | | // 弹出对话框 |
| | | layer.open({ |
| | | type: 1, |
| | | offset: ['100px', '250px'], |
| | | title: "出库通知单", |
| | | area: ['900px', '600px'], |
| | | shade: 0, |
| | | content: $('#listNotice'), |
| | | btn: 0, |
| | | btn: ['取消'], |
| | | yes: function () { |
| | | layer.closeAll(); |
| | | }, |
| | | closeBtn: 0 |
| | | }); |
| | | } |
| | | // ---------------------------通知单 -结束 -------------------// |
| | | //-----------------------转移至weight.js中----------------------// |
| | | // // ---------------------------通知单-开始 -------------------// |
| | | // // 弹出往来单位下拉框 |
| | | // function showNotice() { |
| | | // var index = layer.load(); |
| | | // var param = { |
| | | // type: type |
| | | // }; |
| | | // // 渲染往来单位列表 |
| | | // table.render({ |
| | | // elem: '#tableNotice', |
| | | // url: '../../basic/inout/list-notice-out', |
| | | // page: false, |
| | | // // skin : "nob", |
| | | // // size : 'sm', |
| | | // even: true, |
| | | // method: 'POST', |
| | | // contentType: "application/json;charset=UTF-8", |
| | | // cols: [[{ |
| | | // field: 'name', |
| | | // title: '通知单名称', |
| | | // width: '15%' |
| | | // }, { |
| | | // field: 'customerName', |
| | | // title: '收货单位' |
| | | // }, { |
| | | // field: 'depotName', |
| | | // title: '仓库名称', |
| | | // width: '15%' |
| | | // }, { |
| | | // field: 'foodVarietyName', |
| | | // title: '粮食品种', |
| | | // width: '10%' |
| | | // }, { |
| | | // field: 'year', |
| | | // title: '年份', |
| | | // width: '8%' |
| | | // }, { |
| | | // field: 'contractName', |
| | | // title: '所属合同' |
| | | // }]], |
| | | // where: param, |
| | | // parseData: function (res) { |
| | | // if ("0000" == res.code) { |
| | | // return { |
| | | // "code": "0", |
| | | // "msg": res.msg, |
| | | // "data": res.data |
| | | // } |
| | | // } else { |
| | | // return { |
| | | // "code": "1", |
| | | // "msg": res.msg |
| | | // } |
| | | // } |
| | | // }, |
| | | // done: function (res) { |
| | | // layer.close(index); |
| | | // } |
| | | // }); |
| | | // |
| | | // //双击显示选中数据 |
| | | // table.on('rowDouble(tableNotice)', function (obj) { |
| | | // var data = obj.data; |
| | | // form.val("form-data", { |
| | | // customerId: data.customerId, |
| | | // customerName: data.customerName, |
| | | // noticeId: data.id, |
| | | // foodType: data.foodType, |
| | | // foodLevel: data.foodLevel |
| | | // }); |
| | | // // 关闭 |
| | | // layer.closeAll(); |
| | | // }); |
| | | // |
| | | // // 弹出对话框 |
| | | // layer.open({ |
| | | // type: 1, |
| | | // offset: ['100px', '250px'], |
| | | // title: "出库通知单", |
| | | // area: ['900px', '600px'], |
| | | // shade: 0, |
| | | // content: $('#listNotice'), |
| | | // btn: 0, |
| | | // btn: ['取消'], |
| | | // yes: function () { |
| | | // layer.closeAll(); |
| | | // }, |
| | | // closeBtn: 0 |
| | | // }); |
| | | // } |
| | | // |
| | | // // ---------------------------通知单 -结束 -------------------// |