| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344 | var refreshGirdData;var OneInTimebegin = '';var OneInTimeend = '';var ProductTimebegin = '';var ProductTimeend = '';var logbegin = '';var logend = '';var selectRowsData;var  BusType = '0';var bootstrap = function ($, learun) {    "use strict";    var page = {        init: function () {            page.initGird();            page.bind();        },        bind: function () {            $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {                // 调用后台查询                // queryJson 查询条件                var oneintime = $('#lr_search_date_OneInTime').html();                if (oneintime == '') {                    OneInTimebegin = '';                    OneInTimeend = '';                }                var producttime = $('#lr_search_date_ProductTime').html();                if (producttime == '') {                    ProductTimebegin = '';                    ProductTimeend = '';                }                console.log(queryJson);                queryJson["MatCode"] = $("#MatCode").val();                queryJson["MatName"] = $("#MatName").val();                queryJson["RFIDBarCode"] = $("#RFIDBarCode").val();                queryJson["InvBarCode"] = $("#InvBarCode").val();                queryJson["Tunnel"] = $("#Tunnel").val();                queryJson["Code"] = $("#Code").val();                queryJson["PutRow"] = $("#PutRow").val();                queryJson["PutCol"] = $("#PutCol").val();                queryJson["PutLayer"] = $("#PutLayer").val();                queryJson["OneInTimeBegin"] = $("#OneInTimeBegin").val();                queryJson["OneInTimeEnd"] = $("#OneInTimeEnd").val();                queryJson["ProductTimeBegin"] = $("#ProductTimeBegin").val();                queryJson["ProductTimeEnd"] = $("#ProductTimeEnd").val();                //queryJson["OneInTimeBegin"] = OneInTimebegin;                //queryJson["OneInTimeEnd"] = OneInTimeend;                //queryJson["ProductTimeBegin"] = ProductTimebegin;                //queryJson["ProductTimeEnd"] = ProductTimeend;                queryJson["Grade"] = $("#Grade").val();                queryJson["ContGrpType"] = $("#ContGrpType").lrselectGet();                queryJson["WarehouseId"] = $("#WarehouseId").lrselectGet();                queryJson["InvStateCode"] = 3;                queryJson["IsManualOut"] = '1';                queryJson["IsSurplus"] = $("#IsSurplus").lrselectGet();                queryJson["IsRework"] = $("#IsRework").lrselectGet();                queryJson["IsFast"] = $("#IsFast").lrselectGet();                queryJson["IsFail"] = $("#IsFail").lrselectGet();                queryJson["IsBack"] = $("#IsBack").lrselectGet();                queryJson["ExecStateCode"] = $("#ExecStateCode").lrselectGet();                queryJson["SetGrpCode"] = $("#SetGrpCode").val();                page.search({ queryJson: JSON.stringify(queryJson) });            }, 250);            // 查询            $('#btn_Search').on('click', function () {                var keyword = $('#txt_Keyword').val();                page.search({ queryJson: JSON.stringify({ keyword: $('#txt_Keyword').val(), InvStateCode: 3, IsManualOut:'1' }) });            });            // 刷新             $('#lr_refresh').on('click', function () {                location.reload();            });            // 手动出库            $('#lr_edit').on('click', function () {                selectRowsData = $('#gridtable').jfGridGet("rowdata");                                 if (selectRowsData.length == 0) {                    learun.alert.error('未选择行!');                    return false;                }                if (selectRowsData.filter(o => o.WarehouseTypeNum == 4).length > 0) {                    learun.alert.error('环形库不能手动出库!');                    return false;                }                if (selectRowsData.filter(o => o.WarehouseName != selectRowsData[0].WarehouseName  ).length > 0) {                    learun.alert.error('请选择同一个仓库的数据手动出库!');                    return false;                }                                              BusType = '1';                learun.layerForm({                    id: 'form',                    title: '手动出库',                    url: top.$.rootUrl + '/FJManager/Inventorys/Form',                    width: 450,                    height: 300,                    callBack: function (id) {                        return top[id].acceptClick(refreshGirdData);                    }                });                            });            $('#OneInTime').lrdatetime({                dfdata: [                    { name: '今天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00') }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },                    { name: '近7天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'd', -6) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },                    { name: '近1个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -1) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },                    { name: '近3个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -3) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },                ],                // 月                mShow: false,                premShow: false,                // 季度                jShow: false,                prejShow: false,                // 年                ysShow: false,                yxShow: false,                preyShow: false,                yShow: false,                // 默认                dfvalue: 'all',                selectfn: function (begin, end) {                    OneInTimebegin = begin;                    OneInTimeend = end;                }            });            $('#ProductTime').lrdatetime({                dfdata: [                    { name: '今天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00') }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },                    { name: '近7天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'd', -6) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },                    { name: '近1个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -1) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },                    { name: '近3个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -3) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },                ],                // 月                mShow: false,                premShow: false,                // 季度                jShow: false,                prejShow: false,                // 年                ysShow: false,                yxShow: false,                preyShow: false,                yShow: false,                // 默认                dfvalue: 'all',                selectfn: function (begin, end) {                    ProductTimebegin = begin;                    ProductTimeend = end;                }            });            $('#ContGrpType').lrselect({                url: top.$.rootUrl + '/FJManager/Enums/GetContGrpTypeList',                maxHeight: 180,                allowSearch: false            });            $('#InvStateCode').lrselect({                url: top.$.rootUrl + '/FJManager/Enums/GetInvStateList',                maxHeight: 180,                allowSearch: false            });            $('#WarehouseId').lrselect({                url: top.$.rootUrl + '/FJManager/BaseWarehouse/GetSelectWarehouseNameListByType?typenum=1',                maxHeight: 180,                allowSearch: false            });            $('#ExecStateCode').lrselect({                url: top.$.rootUrl + '/FJManager/Enums/InvLockStateList',                maxHeight: 60,                allowSearch: false            });            $('#IsSurplus').lrselect({                url: top.$.rootUrl + '/FJManager/Enums/YesNoList',                maxHeight: 60,                allowSearch: false            });            $('#IsRework').lrselect({                url: top.$.rootUrl + '/FJManager/Enums/YesNoList',                maxHeight: 60,                allowSearch: false            });            $('#IsFast').lrselect({                url: top.$.rootUrl + '/FJManager/Enums/YesNoList',                maxHeight: 60,                allowSearch: false            });            $('#IsFail').lrselect({                url: top.$.rootUrl + '/FJManager/Enums/YesNoList',                maxHeight: 60,                allowSearch: false            });            $('#IsBack').lrselect({                url: top.$.rootUrl + '/FJManager/Enums/YesNoList',                maxHeight: 60,                allowSearch: false            });        },        // 初始化列表         initGird: function () {            $('#gridtable').jfGrid({                url: top.$.rootUrl + '/FJManager/Inventorys/GetPageList',                headData: [                    { label: "仓库", name: "WarehouseName", width: 120, align: "left" },                    { label: "容器条码", name: "ContGrpBarCode", width: 120, align: "left" },                    {                        label: "库存类型", name: "ContGrpType", width: 60, align: "left", formatter: function (cellvalue) {                            if (cellvalue == 1) {                                return '<span class=\"label label-success\"  >物料盘</span>';                            } else if (cellvalue == 2) {                                return '<span class=\"label  label-default\" >空盘</span>';                            } else {                                return '<span class=\"label  label-default\" >未知</span>';                            }                        }                    },                    { label: "材料号", name: "InvBarCode", width: 110, align: "left" },                    { label: "库存状态", name: "InvStateName", width: 80, align: "left", sortname: "InvStateCode" },                    { label: "巷道", name: "Tunnel", width: 50, align: "left" },                    { label: "货位号", name: "Code", width: 100, align: "left" },                    {                        label: "货位状态", name: "CellState", width: 80, align: "left"                        , formatter: function (cellvalue) {                            if (cellvalue == 0) {                                return '<span class=\"label label-success\"  >启用</span>';                            } else {                                return '<span class=\"label  label-default\" >禁用</span>';                            }                        }                    },                    { label: "行", name: "PutRow", width: 40, align: "left" },                    { label: "列", name: "PutCol", width: 40, align: "left" },                    { label: "层", name: "PutLayer", width: 40, align: "left" },                    { label: "首次入库时间", name: "OneInTime", width: 130, align: "left" },                    { label: "生产时间", name: "ProductTime", width: 130, align: "left" },                    { label: "物料编码", name: "MatCode", width: 80, align: "left" },                    { label: "物料名称", name: "MatName", width: 160, align: "left" },                    { label: "配方编码", name: "BomMatCode", width: 110, align: "left" },                    { label: "配方名称", name: "BomMatName", width: 160, align: "left" },                    { label: "垛型编码", name: "SetGrpCode", width: 150, align: "left" },                    { label: "总重量", name: "TolWQty", width: 80, align: "left" },                    { label: "净重", name: "NetWQty", width: 80, align: "left" },                    { label: "皮重", name: "TareWQty", width: 80, align: "left" },                    { label: "长度", name: "LengthQty", width: 80, align: "left" },                    { label: "RFID编号", name: "RFIDBarCode", width: 80, align: "left" },                    { label: "工字轮类型", name: "HWTypeCode", width: 80, align: "left" },                    {                        label: "是否余料", name: "IsSurplus", width: 70, align: "left"                        , formatter: function (cellvalue) {                            if (cellvalue == true) {                                return '<span class=\"label label-success\"  >是</span>';                            } else {                                return '<span class=\"label  label-default\" >否</span>';                            }                        }                    },                    {                        label: "是否退料", name: "IsBack", width: 70, align: "left"                        , formatter: function (cellvalue) {                            if (cellvalue == true) {                                return '<span class=\"label label-success\"  >是</span>';                            } else {                                return '<span class=\"label  label-default\" >否</span>';                            }                        }                    },                    {                        label: "是否锁定", name: "ExecStateCode", width: 80, align: "left"                        , formatter: function (cellvalue) {                            if (cellvalue == "InvState_Normal") {                                return '<span class=\"label label-default\"  >否</span>';                            } else {                                return '<span class=\"label  label-success\" >是</span>';                            }                        }                    },                    {                        label: "返工标记", name: "IsRework", width: 60, align: "left", formatter: function (cellvalue) {                            if (cellvalue == true) {                                return '<span class=\"label label-success\"  >是</span>';                            } else {                                return '<span class=\"label  label-default\" >否</span>';                            }                        }                    },                    {                        label: "快投标记", name: "IsFast", width: 60, align: "left", formatter: function (cellvalue) {                            if (cellvalue == true) {                                return '<span class=\"label label-success\"  >是</span>';                            } else {                                return '<span class=\"label  label-default\" >否</span>';                            }                        }                    },                    {                        label: "是否异常", name: "IsFail", width: 60, align: "left", formatter: function (cellvalue) {                            if (cellvalue == true) {                                return '<span class=\"label label-success\"  >是</span>';                            } else {                                return '<span class=\"label  label-default\" >否</span>';                            }                        }                    },                    { label: "异常原因", name: "FailReason", width: 80, align: "left" },                    { label: "等级", name: "Grade", width: 80, align: "left" },                    { label: "退料原因", name: "BackReason", width: 80, align: "left" },                    { label: "工序订单号", name: "ProcessDocsCode", width: 120, align: "left" },                    { label: "生产机台号", name: "ProductMachCode", width: 80, align: "left" },                    { label: "产线编号", name: "ProductLineNo", width: 80, align: "left" },                    { label: "入库单号", name: "InDocsNo", width: 120, align: "left" },                    { label: "入库单行号", name: "InDocsRowNo", width: 120, align: "left" },                    { label: "创建时间", name: "AddTime", width: 150, align: "left" },                    { label: "更新时间", name: "EditTime", width: 150, align: "left" },                ],                mainId: 'Id',                isPage: true,                reloadSelected: true,                autowWidth: true,                sidx: 'AddTime',                sord: 'DESC',                isMultiselect: true,            });            page.search({ queryJson: JSON.stringify({ keyword: $('#txt_Keyword').val(), InvStateCode: 3, IsManualOut: '1' }) });        },        search: function (param) {            param = param || { queryJson: JSON.stringify({ InvStateCode: 3, IsManualOut: '1' }) };            $('#gridtable').jfGridSet('reload', param);        }    };    refreshGirdData = function () {        page.search();    };    page.init();}
 |