//控制流程环节显示 function showProgress() { if (!inoutProgress) { return; } if (inoutProgress.indexOf("REGISTER") == -1) { $("#progress-register").css("display", "none"); } if (inoutProgress.indexOf("CHECK") == -1) { $("#progress-check").css("display", "none"); } if (inoutProgress.indexOf("WEIGHT_FULL") == -1) { $("#progress-fullWeight").css("display", "none"); } if (inoutProgress.indexOf("HANDLE") == -1) { $("#progress-hand").css("display", "none"); } if (inoutProgress.indexOf("WEIGHT_EMPTY") == -1) { $("#progress-emptyWeight").css("display", "none"); } if (inoutProgress.indexOf("CARD_BACK") == -1) { $("#progress-cardBack").css("display", "none"); } } // ---------------------------粮食产地-开始 -------------------// function showFoodLocation() { var index = layer.load(); table.render({ elem: '#tableFoodLoaction', url: '/basic/inout/page-dicArea', page: true, toolbar: '#toolbarFoodLocaton', even: true, method: 'POST', contentType: "application/json;charset=UTF-8", cols: [[{ field: 'code', title: '编码', }, { field: 'simple', title: '简拼', }, { field: 'name', title: '名称', width: '60%' }]], where: { "page": 1, "limit": 8 }, parseData: function (res) { if ("0000" == res.code) { return { "code": "0", "msg": res.msg, "count": res.data.total, "data": res.data.records } } else { return { "code": "1", "msg": res.msg } } }, done: function (res) { layer.close(index); } }); //双击显示选中数据 table.on('rowDouble(tableFoodLoaction)', function (obj) { var data = obj.data; // 赋值 form.val("form-data", { foodLocation: data.name, foodLocationId: data.code }); // 关闭 $("#listFoodLocation").css("display", "none"); layer.close(index3); }); // 弹出对话框 var index3 = layer.open({ type: 1, title: "选择粮产地", offset: ['240px', '100px'], area: ['600px', '530px'], cancel: function (index, layero) { $("#listFoodLocation").css("display", "none"); }, shade: 0, scrollbar: 0, content: $('#listFoodLocation'), closeBtn: 1 }); } // 刷新 function flushFoodLocation() { var key = $("#key2").val(); table.reload('tableFoodLoaction', { url: "/basic/inout/page-dicArea", where: { key: key }, done: function (res) { if (key) { $("#key2").val(key); } } }); } // ---------------------------通知单-开始 -------------------// // 弹出往来单位下拉框 function showNotice() { var titleCustomer = "送货单位"; var url = "/basic/inout/list-notice-in"; if ("OUT" == type) { titleCustomer = "收货单位"; url = "/basic/inout/list-notice-out" } var index = layer.load(); var param = { type: type }; console.log(url); table.render({ elem: '#tableNotice', url: url, page: false, even: true, method: 'POST', contentType: "application/json;charset=UTF-8", cols: [[{ field: 'name', title: '通知单名称', width: '15%' }, { field: 'customerName', title: titleCustomer }, { field: 'foodVarietyName', title: '粮食品种', width: '10%' }, { field: 'year', title: '年份', width: '8%' }, { field: 'contract', 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; console.log(data) form.val("form-data", { customerName: data.customerName, noticeId: data.id, foodYear: data.year, depotId: data.depotId, foodVariety: data.foodVariety }); layer.close(index2); // 关闭 $("#listNotice").css("display", "none"); }); // 弹出对话框 var index2 =layer.open({ type: 1, offset: ['100px', '250px'], title: "通知单列表(双击选中)", area: ['900px', '600px'], cancel: function (index, layero) { $("#listNotice").css("display", "none"); }, shade: 0, scrollbar: 0, content: $('#listNotice'), closeBtn: 1 }); } //错误提醒 function alertError(msg) { layer.alert(msg, { icon: 5, offset: ['300px', '300px'] }); } function alertSuccess(msg) { layer.alert(msg, { icon: 1, offset: ['300px', '300px'] }); } /** * 弹出提醒框 * @param msg 提醒信息 * @param data 数据信息,可能为空 */ function notifyProgress(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)); } 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 { alertError(msg); } }