123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360 |
- 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 + '/SXManager/Enums/GetInvStateList',
- maxHeight: 180,
- allowSearch: false
- });
- $('#Status').lrselect({
- url: top.$.rootUrl + '/SXManager/Enums/GetLocationStateList',
- maxHeight: 180,
- allowSearch: false
- });
- $('#TaskStatus').lrselect({
- url: top.$.rootUrl + '/SXManager/Enums/GetTaskStatusList',
- maxHeight: 180,
- allowSearch: false
- });
- //
- $('#lr_taskstatus').on('click', function () {
- var TaskNo = $('#TaskNo').val().replace(/^[' ' || ' ']*/, '').replace(/[' ' | ' ']*$/, '');
- if (TaskNo.length == 0) {
- learun.alert.error('任务号不能为空!');
- return false;
- }
- var status = $("#TaskStatus").lrselectGet();
- if (status.length == 0) {
- learun.alert.error('任务状态不能为空!');
- return false;
- }
- var url = weburl + "api/Sx/UpdateTaskState";
- learun.layerConfirm('是否修改任务状态!', function (res,index) {
- if (res) {
- $.ajax({
- type: 'post',
- //data: { location: postData.map((item) => item.Id) },
- data: JSON.stringify({
- "TaskNo": TaskNo,
- "Status": status
- }),
- dataType: 'json',
- contentType: "application/json;charset=utf-8",
- url: url,
- success: function (response) {
- //resCode 200 resMsg "成功"
- top.layer.close(index);
- learun.alert.info(response.resMsg);
- }
- });
- }
- });
- });
- //强制取消任务按钮
- $('#lr_cancel').on('click', function () {
- let CancelTaskNo = $('#CancelTaskNo').val().replace(/^[' ' || ' ']*/, '').replace(/[' ' | ' ']*$/, '');
- if (CancelTaskNo.length == 0) {
- learun.alert.error('任务号不能为空!');
- return false;
- }
- var url = weburl + "api/Sx/ForceCancelTask";
- learun.layerConfirm('是否强制取消任务!', function (res) {
- if (res) {
- $.ajax({
- type: 'post',
- //data: { location: postData.map((item) => item.Id) },
- data: JSON.stringify({
- "TaskNo": CancelTaskNo,
- "WareHouse": 'sxhouse'
- }),
- 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/Sx/DeleteStockInfo";
- learun.layerConfirm('是否删除库存信息!', function (res) {
- if (res) {
- $.ajax({
- type: 'post',
- //data: { location: postData.map((item) => item.Id) },
- data: JSON.stringify({
- "Code": BarCode,
- "WareHouse": 'sxhouse'
- }),
- 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/Sx/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": 'sxhouse'
- }),
- 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/Sx/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": 'sxhouse'
- }),
- 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/Sx/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": 'sxhouse'
- }),
- 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/Sx/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);
- }
- });
- }
- });
- });
- $('#btntorsbindrel').on('click', function () {
- var hwtorsbindrel = $('#torsbindrel').val().replace(/^[' ' || ' ']*/, '').replace(/[' ' | ' ']*$/, '');
- if (hwtorsbindrel.length == 0) {
- learun.alert.error('工字轮号不能为空!');
- return false;
- }
- var url = weburl + "api/Sx/DeleteTorsBind";
- learun.layerConfirm('是否确定删除绑定关系!', function (res) {
- if (res) {
- $.ajax({
- type: 'post',
- //data: { location: postData.map((item) => item.Id) },
- data: JSON.stringify({
- "code": hwtorsbindrel,
- "cell": "",
- "WareHouse": 'sxhouse',
- "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);
- }
- });
- }
- });
- });
- $('#btnprehwclear').on('click', function () {
- var hwprehwclear = $('#prehwclear').val().replace(/^[' ' || ' ']*/, '').replace(/[' ' | ' ']*$/, '');
- if (hwprehwclear.length == 0) {
- learun.alert.error('工字轮号不能为空!');
- return false;
- }
- var url = weburl + "api/Sx/DeleteHwPre";
- learun.layerConfirm('是否确定解锁工字轮!', function (res) {
- if (res) {
- $.ajax({
- type: 'post',
- //data: { location: postData.map((item) => item.Id) },
- data: JSON.stringify({
- "code": hwprehwclear,
- "cell": "",
- "WareHouse": 'sxhouse',
- "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();
- }
|