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 + '/PTManager/Enums/GetInvStateList', maxHeight: 180, allowSearch: false }); $('#Status').lrselect({ url: top.$.rootUrl + '/PTManager/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/Pt/ForceCancelTask"; learun.layerConfirm('是否强制取消任务!', function (res) { if (res) { $.ajax({ type: 'post', //data: { location: postData.map((item) => item.Id) }, data: JSON.stringify({ "TaskNo": TaskNo, "WareHouse" : 'pthouse' }), 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/Pt/DeleteStockInfo"; learun.layerConfirm('是否删除库存信息!', function (res) { if (res) { $.ajax({ type: 'post', //data: { location: postData.map((item) => item.Id) }, data: JSON.stringify({ "Code": BarCode, "WareHouse": 'pthouse' }), 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); } }); } }); }); //删除条码信息 $('#Rfid_delete').on('click', function () { var BarCode = $('#RfidBarCode').val().replace(/^[' ' || ' ']*/, '').replace(/[' ' | ' ']*$/, ''); if (BarCode.length == 0) { learun.alert.error('标牌条码不能为空!'); return false; } var url = weburl + "api/Pt/DeleteBarCodeInfo"; learun.layerConfirm('是否删除标牌条码信息!', function (res) { if (res) { $.ajax({ type: 'post', //data: { location: postData.map((item) => item.Id) }, data: JSON.stringify({ "Code": BarCode, "WareHouse": 'pthouse' }), 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/Pt/UpdateStockState"; learun.layerConfirm('是否确定修改库存状态!', function (res) { if (res) { $.ajax({ type: 'post', //data: { location: postData.map((item) => item.Id) }, data: JSON.stringify({ "Code": Code, "State": InvStateCode, "WareHouse": 'pthouse' }), 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/Pt/UpdateCellState"; learun.layerConfirm('是否确定修改货位状态!', function (res) { if (res) { $.ajax({ type: 'post', //data: { location: postData.map((item) => item.Id) }, data: JSON.stringify({ "Code": CellCode, "State": Status, "WareHouse": 'pthouse' }), 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/Pt/DataSwapCell"; learun.layerConfirm('是否确定互换数据!', function (res) { if (res) { $.ajax({ type: 'post', //data: { location: postData.map((item) => item.Id) }, data: JSON.stringify({ "StatEquip": CellFrom, "EndEquip": CellTo, "WareHouse": 'pthouse' }), 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); } }); } }); }); //修改任务RFID $('#TaskRfid').on('click', function () { var TaskCode = $('#TaskCode').val().replace(/^[' ' || ' ']*/, '').replace(/[' ' | ' ']*$/, ''); var TaskBarCode = $('#TaskBarCode').val().replace(/^[' ' || ' ']*/, '').replace(/[' ' | ' ']*$/, ''); if (TaskCode.length == 0) { learun.alert.error('任务号不能为空!'); return false; } if (TaskBarCode.length == 0) { learun.alert.error('RFID号不能为空!'); return false; } let reg = /^[0-9]*[1-9][0-9]*$/; if (!reg.test(TaskCode)) { learun.alert.error('任务号请输入正整数!'); return false; } var url = weburl + "api/Pt/UpdateTaskCont"; learun.layerConfirm('是否确定修改任务RFID!', function (res) { if (res) { $.ajax({ type: 'post', //data: { location: postData.map((item) => item.Id) }, data: JSON.stringify({ "TaskCode": parseInt( TaskCode), "BarCode": TaskBarCode, "WareHouse": 'pthouse' }), 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); } }); } }); }); //修改货位RFID $('#warecellrfid').on('click', function () { var LocCode = $('#LocCode').val().replace(/^[' ' || ' ']*/, '').replace(/[' ' | ' ']*$/, ''); var ContGrpBarCode = $('#ContGrpBarCode').val().replace(/^[' ' || ' ']*/, '').replace(/[' ' | ' ']*$/, ''); if (LocCode.length == 0) { learun.alert.error('货位编号不能为空!'); return false; } if (ContGrpBarCode.length == 0) { learun.alert.error('RFID不能为空!'); return false; } var url = weburl + "api/Pt/UpdateLocationContGrpBarCode"; learun.layerConfirm('是否确定修改货位RFID!', function (res) { if (res) { $.ajax({ type: 'post', //data: { location: postData.map((item) => item.Id) }, data: JSON.stringify({ "LocCode": LocCode, "ContGrpBarCode": ContGrpBarCode, "WareHouse": 'pthouse' }), 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/Pt/CompleteTask"; learun.layerConfirm('是否确定完成WMS任务!', function (res) { 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(top.layer.index); learun.alert.info(response.resMsg); } }); } }); }); }, search: function (param) { $('#gridtable').jfGridSet('reload', param); } }; refreshGirdData = function () { $('#gridtable').jfGridSet('reload'); }; page.init(); }