| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313 | var refreshGirdData;var logbegin = '';var logend = '';var StartTimeBegin = '';var StartTimeend = '';var EndTimeBegin = '';var EndTimeend = '';var selectRowsData;var bootstrap = function ($, learun) {    "use strict";    var psuid = "";    var page = {        init: function () {            page.initGird();            page.bind();            page.search({ queryJson: JSON.stringify({ Finish: 0 }) });        },        bind: function () {            $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {                // 调用后台查询                // queryJson 查询条件                var date = $('#lr_search_date_datesearch').html();                if (date == '') {                    logbegin = '';                    logend = '';                }                var starttime = $('#lr_search_date_StartTime').html();                if (starttime == '') {                    StartTimeBegin = '';                    StartTimeend = '';                }                var endtime = $('#lr_search_date_EndTime').html();                if (endtime == '') {                    EndTimeBegin = '';                    EndTimeend = '';                }                //queryJson["AddTimeFrom"] = logbegin;                //queryJson["AddTimeTo"] = logend;                queryJson["WarehouseCode"] = $("#WarehouseCode").lrselectGet();                queryJson["TaskId"] = $("#TaskId").val();                queryJson["Code"] = $("#Code").val();                queryJson["ProMaterCode"] = $("#ProMaterCode").val();                queryJson["PalletizingStation"] = $("#PalletizingStation").val();                queryJson["MatCodeList"] = $("#MatCodeList").val();                queryJson["Finish"] = $("#Finish").lrselectGet();                               queryJson["PalleCode"] = $("#PalleCode").val();                queryJson["AddTimeFrom"] = $("#AddTimeFrom").val();                queryJson["AddTimeTo"] = $("#AddTimeTo").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() }) });            });            // 刷新             $('#lr_refresh').on('click', function () {                location.reload();            });            // 删除            $('#lr_Finish').on('click', function () {                selectRowsData = $('#gridtable').jfGridGet("rowdata");                if (selectRowsData.length == 0) {                    learun.alert.error('未选择行!');                    return false;                }                learun.layerForm({                    id: 'form1',                    title: '修改是否结束',                    url: top.$.rootUrl + '/FJManager/WCSPalletizing/Form',                    width: 700,                    height: 300,                    callBack: function (id) {                        return top[id].acceptClick(refreshGirdData);                    }                });            });            $('#lr_PalleCode').on('click', function () {                selectRowsData = $('#gridtable').jfGridGet("rowdata");                if (selectRowsData.length == 0) {                    learun.alert.error('未选择行!');                    return false;                }                learun.layerForm({                    id: 'form1',                    title: '修改托盘条码',                    url: top.$.rootUrl + '/FJManager/WCSPalletizing/PalleCodeForm',                    width: 700,                    height: 300,                    callBack: function (id) {                        return top[id].acceptClick(refreshGirdData);                    }                });            });                        $('#lr_PalletizingStation').on('click', function () {                            var postData = $('#gridtable').jfGridGet("rowdata");                if (postData.length == 0) {                    learun.alert.error('未选择行!');                    return false;                }                learun.layerConfirm('是否确认重新分配码垛位!', function (res) {                    if (res) {                        learun.postForm(top.$.rootUrl + '/FJManager/WCSPalletizing/PalletizingStation', { ids: JSON.stringify(postData.map((item) => item.Id)) }, function () {                            refreshGirdData();                            top.layer.close(top.layer.index);                                                     });                    }                });                   });            $('.datetime').each(function () {                $(this).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) {                        let id = $(this).attr('id');                        if (id == 'datesearch') {                            logbegin = begin;                            logend = end;                        }                        else if (id == 'StartTime') {                            StartTimeBegin = begin;                            StartTimeend = end;                        }                        else if (id == 'EndTime') {                            EndTimeBegin = begin;                            EndTimeend = end;                        }                    }                });            });            $('#WarehouseCode').lrselect({                url: top.$.rootUrl + '/FJManager/BaseWarehouse/GetSelectWarehouseCodeNameList',                maxHeight: 180,                allowSearch: false            });            $('#Finish').lrselect({                url: top.$.rootUrl + '/FJManager/Enums/YesNoList',                maxHeight: 60,                allowSearch: false            });                   },        // 初始化列表         initGird: function () {            $('#gridtable').jfGrid({                url: top.$.rootUrl + '/FJManager/WCSPalletizing/GetPageList',                headData: [                    { label: 'Id', name: 'Id', width: 100, align: 'left' },                                        { label: '任务Id', name: 'TaskId', width: 100, align: 'left' },                    { label: '托盘条码', name: 'PalleCode', width: 80, align: 'left' },                    { label: '垛型编码', name: 'Code', width: 110, align: 'left' },                    { label: '短垛型编码', name: 'ShortCode', width: 60, align: 'left' },                    { label: '帘线物料编码', name: 'ProMaterCode', width: 150, align: 'left' },                    { label: '码垛工位', name: 'PalletizingStation', width: 80, align: 'left' },                    { label: '产品总数', name: 'CountQty', width: 60, align: 'left' },                    { label: '托盘类型', name: 'TpTypeCode', width: 100, align: 'left' },                    { label: '层数', name: 'LayerCountQty', width: 60, align: 'left' },                    {                        label: '是否结束', name: 'Finish', width: 100, 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: 'MatCodeList', width: 100, align: 'left' },                    { label: '仓库名称', name: 'WarehouseName', width: 100, align: 'left', sortname: 'WarehouseCode' },                    { label: '设备编号', name: 'DeviceCode', width: 100, align: 'left' },                    {                        label: '是否二次绑盘', name: 'isItHalf', width: 100, 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: 'TaskAddNext', width: 100, align: 'left' },                    { label: "创建时间", name: "AddTime", width: 130, align: "left" },                    { label: "更新时间", name: "EditTime", width: 130, align: "left" },                ],                mainId: 'Id',                isMultiselect: true,                isPage: true,                reloadSelected: true,                sidx: 'AddTime',                sord: 'DESC',                isSubGrid: true,             // 是否有子表                subGridExpanded: function (subid, rowdata) {                    psuid = subid;                    $('#' + subid).jfGrid({                        url: top.$.rootUrl + '/FJManager/WCSPalletizing/GetPalletizingItem',                        headData: [                            { label: '层号', name: 'LayerNo', width: 60, align: 'left' },                            {                                label: '层是否空置', name: 'IsEmpty', width: 100, 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: 'RowCountQty', width: 60, align: 'left' },                            { label: '物料号', name: 'MatCodeList', width: 150, align: 'left' },                            {                                label: '是否结束', name: 'Finish', width: 80, 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: 'RowsIsEmpty', width: 100, 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: 'QtyMaxCount', width: 60, align: 'left' },                            { label: '行号', name: 'RowNo', width: 60, align: 'left' },                            { label: '是否混合料行', name: 'IsMixRow', width: 100, align: 'left' },                            { label: '缓存Id', name: 'CacheLineId', width: 100, align: 'left' },                            /*   { label: '当前所有的物料号', name: 'MatCodeList', width: 100, align: 'left' },*/                            {                                label: '是否结束', name: 'RowsFinish', width: 100, 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: 'LineCode', width: 100, align: 'left' },                            { label: '任务Id', name: 'TaskId', width: 100, align: 'left' },                            {                                label: '列是否空置', name: 'ColsIsEmpty', width: 100, 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: 'XYNo', width: 100, align: 'left' },                            { label: '所属设备号', name: 'DevCode', width: 100, align: 'left' },                            { label: '物料编码', name: 'MatCode', width: 100, align: 'left' },                            { label: '正反面', name: 'SideNum', width: 100, align: 'left' },                            { label: '工字轮类型', name: 'SpoolType', width: 100, align: 'left' },                            {                                label: '是否结束', name: 'ColsFinish', width: 100, 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: "AddTime", width: 130, align: "left" },                            { label: "更新时间", name: "EditTime", width: 130, align: "left" },                        ]                    });                    $('#' + subid).jfGridSet('reloadSon', { palletizingId: rowdata.Id });                },            });            page.search({ queryJson: JSON.stringify({ keyword: $('#txt_Keyword').val() }) });        },        search: function (param) {            $('#gridtable').jfGridSet('reload', param);        }    };    refreshGirdData = function () {        $('#gridtable').jfGridSet('reload');    };    page.init();}
 |