var refreshGirdData; var logbegin = ''; var logend = ''; var StartTimeBegin = ''; var StartTimeend = ''; var EndTimeBegin = ''; var EndTimeend = ''; var bootstrap = function ($, learun) { "use strict"; var page = { init: function () { //page.initGird(); page.bind(); }, bind: function () { $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { // 调用后台查询 // queryJson 查询条件 }, 250); $('#InvStateCode').lrselect({ url: top.$.rootUrl + '/HJManager/Enums/GetInvStateList', maxHeight: 180, allowSearch: false }); $('#Status').lrselect({ url: top.$.rootUrl + '/HJManager/Enums/GetLocationStateList', maxHeight: 180, allowSearch: false }); //强制取消任务按钮 $('#lr_cancel').on('click', function () { var TaskNo = $('#TaskNo').val().replace(/^[' ' || ' ']*/, '').replace(/[' ' | ' ']*$/, ''); if (TaskNo.length == 0) { learun.alert.error('任务号不能为空!'); return false; } var url = weburl + "api/Hj/ForceCancelTask"; learun.layerConfirm('是否强制取消任务!', function (res) { if (res) { $.ajax({ type: 'post', //data: { location: postData.map((item) => item.Id) }, data: JSON.stringify({ "TaskNo": TaskNo }), dataType: 'json', contentType: "application/json;charset=utf-8", url: url, success: function (response) { //resCode 200 resMsg "成功" refreshGirdData(); top.layer.close(top.layer.index); learun.alert.info(response.resMsg); } }); } }); }); //删除组盘信息 $('#stock_delete').on('click', function () { var BarCode = $('#BarCode').val().replace(/^[' ' || ' ']*/, '').replace(/[' ' | ' ']*$/, ''); if (BarCode.length == 0) { learun.alert.error('工字轮条码不能为空!'); return false; } var url = weburl + "api/Hj/DeleteStockInfo"; learun.layerConfirm('是否删除库存信息!', function (res) { if (res) { $.ajax({ type: 'post', //data: { location: postData.map((item) => item.Id) }, data: JSON.stringify({ "Code": BarCode }), dataType: 'json', contentType: "application/json;charset=utf-8", url: url, success: function (response) { //resCode 200 resMsg "成功" refreshGirdData(); top.layer.close(top.layer.index); learun.alert.info(response.resMsg); } }); } }); }); //修改库存状态信息 $('#Update_StockState').on('click', function () { var Code = $('#Code').val().replace(/^[' ' || ' ']*/, '').replace(/[' ' | ' ']*$/, ''); var InvStateCode = $("#InvStateCode").lrselectGet(); if (Code.length == 0) { learun.alert.error('工字轮条码不能为空!'); return false; } var url = weburl + "api/Hj/UpdateStockState"; learun.layerConfirm('是否确定修改库存状态!', function (res) { if (res) { $.ajax({ type: 'post', //data: { location: postData.map((item) => item.Id) }, data: JSON.stringify({ "Code": Code, "State": InvStateCode }), dataType: 'json', contentType: "application/json;charset=utf-8", url: url, success: function (response) { //resCode 200 resMsg "成功" refreshGirdData(); top.layer.close(top.layer.index); learun.alert.info(response.resMsg); } }); } }); }); //修改货位状态 $('#Update_CellState').on('click', function () { var CellCode = $('#CellCode').val().replace(/^[' ' || ' ']*/, '').replace(/[' ' | ' ']*$/, ''); var Status = $("#Status").lrselectGet(); if (CellCode.length == 0) { learun.alert.error('货位编码不能为空!'); return false; } var url = weburl + "api/Hj/UpdateCellState"; learun.layerConfirm('是否确定修改货位状态!', function (res) { if (res) { $.ajax({ type: 'post', //data: { location: postData.map((item) => item.Id) }, data: JSON.stringify({ "Code": CellCode, "State": Status }), dataType: 'json', contentType: "application/json;charset=utf-8", url: url, success: function (response) { //resCode 200 resMsg "成功" refreshGirdData(); top.layer.close(top.layer.index); learun.alert.info(response.resMsg); } }); } }); }); //货位数据互换 $('#CellDataSwap').on('click', function () { var CellFrom = $('#CellFrom').val().replace(/^[' ' || ' ']*/, '').replace(/[' ' | ' ']*$/, ''); var CellTo = $('#CellTo').val().replace(/^[' ' || ' ']*/, '').replace(/[' ' | ' ']*$/, ''); if (CellFrom.length == 0) { learun.alert.error('起始货位不能为空!'); return false; } if (CellTo.length == 0) { learun.alert.error('目标货位不能为空!'); return false; } var url = weburl + "api/Hj/DataSwapCell"; learun.layerConfirm('是否确定互换数据!', function (res) { if (res) { $.ajax({ type: 'post', //data: { location: postData.map((item) => item.Id) }, data: JSON.stringify({ "StatEquip": CellFrom, "EndEquip": CellTo }), dataType: 'json', contentType: "application/json;charset=utf-8", url: url, success: function (response) { //resCode 200 resMsg "成功" refreshGirdData(); top.layer.close(top.layer.index); learun.alert.info(response.resMsg); } }); } }); }); //补空轮库存 $('#btnSaveEmptyStock').on('click', function () { var txtConBarcode = $('#txtConBarcode').val().replace(/^[' ' || ' ']*/, '').replace(/[' ' | ' ']*$/, ''); var txtCellCode = $('#txtCellCode').val().replace(/^[' ' || ' ']*/, '').replace(/[' ' | ' ']*$/, ''); if (txtConBarcode.length == 0) { learun.alert.error('工字轮号不能为空!'); return false; } if (txtCellCode.length == 0) { learun.alert.error('目标货位不能为空!'); return false; } var url = weburl + "api/Hj/DataBasePatch"; learun.layerConfirm('是否确定提交!', function (res) { if (res) { $.ajax({ type: 'post', //data: { location: postData.map((item) => item.Id) }, data: JSON.stringify({ "Code": txtConBarcode, "Cell": txtCellCode, "ContGrpType": 2 }), dataType: 'json', contentType: "application/json;charset=utf-8", url: url, success: function (response) { //resCode 200 resMsg "成功" refreshGirdData(); top.layer.close(top.layer.index); learun.alert.info(response.resMsg); } }); } }); }); //库存转移 $('#btnSaveStockTrans').on('click', function () { var txtStartCell = $('#txtStartCell').val().replace(/^[' ' || ' ']*/, '').replace(/[' ' | ' ']*$/, ''); var txtEndCell = $('#txtEndCell').val().replace(/^[' ' || ' ']*/, '').replace(/[' ' | ' ']*$/, ''); if (txtStartCell.length == 0) { learun.alert.error('起始货位不能为空!'); return false; } if (txtEndCell.length == 0) { learun.alert.error('目标货位不能为空!'); return false; } var url = weburl + "api/Hj/TransStock"; learun.layerConfirm('是否确定提交!', function (res) { if (res) { $.ajax({ type: 'post', //data: { location: postData.map((item) => item.Id) }, data: JSON.stringify({ "StatEquip": txtStartCell, "EndEquip": txtEndCell }), dataType: 'json', contentType: "application/json;charset=utf-8", url: url, success: function (response) { //resCode 200 resMsg "成功" refreshGirdData(); top.layer.close(top.layer.index); learun.alert.info(response.resMsg); } }); } }); }); $('#btnwmstask').on('click', function () { var wmstaskNo = $('#wmstasknum').val().replace(/^[' ' || ' ']*/, '').replace(/[' ' | ' ']*$/, ''); if (wmstaskNo.length == 0) { learun.alert.error('WMS任务号不能为空!'); return false; } var url = weburl + "api/Hj/CompleteTask"; learun.layerConfirm('是否确定完成WMS任务!', function (res,index) { if (res) { $.ajax({ type: 'post', //data: { location: postData.map((item) => item.Id) }, data: JSON.stringify({ "taskNum": parseInt(wmstaskNo), "operationType": 2, "wcsUpdateName": "1", "memo1": "", "memo2": "" }), dataType: 'json', contentType: "application/json;charset=utf-8", url: url, success: function (response) { //resCode 200 resMsg "成功" //refreshGirdData(); top.layer.close(index); learun.alert.info(response.resMsg); } }); } }); }); }, search: function (param) { $('#gridtable').jfGridSet('reload', param); } }; refreshGirdData = function () { $('#gridtable').jfGridSet('reload'); }; page.init(); }