123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322 |
- 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();
- }
|