自动化立体仓库 - WMS系统
lty
2026-01-22 35b1b26f1fe16550b4ee2881a26d599456fe59b4
src/main/webapp/static/js/wrkMast/wrkMast.js
@@ -1,11 +1,67 @@
var pageCurr;
var wrkNo;
layui.use(['table','laydate', 'form'], function(){
    var table = layui.table;
    var $ = layui.jquery;
    var layer = layui.layer;
    var layDate = layui.laydate;
    var form = layui.form;
    var doneCallback = function(res, curr, count) {
        if (res.code === 403) {
            top.location.href = baseUrl+"/";
        }
        pageCurr=curr;
        limit();
        form.on('checkbox(tableCheckbox)', function (data) {
            var _index = $(data.elem).attr('table-index')||0;
            if(data.elem.checked){
                res.data[_index][data.value] = 'Y';
            }else{
                res.data[_index][data.value] = 'N';
            }
        });
        if (typeof I18n !== 'undefined') {
            I18n.updatePage($('.layui-table-view'));
            I18n.updateLayuiPagination();
        }
    };
    $(document).on('i18n:languageChanged', function() {
        tableIns.reload({
            cols: getCol(),
            done: doneCallback
        });
    });
    function getCol() {
        return [[
            {type: 'checkbox'}
            ,{field: 'wrkNo', align: 'center',title: I18n.t('work_no'),sort: true, width: 85}
            ,{field: 'ioTime$', align: 'center',title: I18n.t('work_time'),sort: true, width: 160}
            ,{field: 'wrkSts', align: 'center',title: I18n.t('work_status'), templet: function(d) {
                var key = 'wrk_status_' + d.wrkSts;
                var text = I18n.t(key);
                return text === key ? d.wrkSts$ : text;
            }}
            ,{field: 'ioType', align: 'center',title: I18n.t('transaction_type'), templet: function(d) {
                var key = 'io_type_' + d.ioType;
                var text = I18n.t(key);
                return text === key ? d.ioType$ : text;
            }}
            ,{field: 'ioPri', align: 'center',title: I18n.t('priority')}
            ,{field: 'crnNo$', align: 'center',title: I18n.t('crane')}
            ,{field: 'sourceStaNo$', align: 'center',title: I18n.t('source_station')}
            ,{field: 'staNo$', align: 'center',title: I18n.t('target_station')}
            ,{field: 'sourceLocNo$', align: 'center',title: I18n.t('source_location')}
            ,{field: 'locNo$', align: 'center',title: I18n.t('target_location')}
            ,{field: 'barcode', align: 'center',title: I18n.t('barcode')}
            ,{field: 'preHave', align: 'center',title: I18n.t('pre_existing'), hide: true}
            ,{field: 'takeNone', align: 'center',title: I18n.t('empty_op'), hide: true}
            ,{field: 'modiUser$', align: 'center',title: I18n.t('modifier'), hide:true}
            ,{field: 'modiTime$', align: 'center',title: I18n.t('modify_time'), hide:true, width: 160}
            ,{fixed: 'right', title: I18n.t('operation'), align: 'center', toolbar: '#operate', width:250}
        ]];
    }
    // 数据渲染
    tableIns = table.render({
@@ -18,56 +74,7 @@
        even: true,
        toolbar: '#toolbar',
        cellMinWidth: 50,
        cols: [[
            {type: 'checkbox'}
            ,{field: 'wrkNo', align: 'center',title: '工作号',sort: true, width: 85}
            ,{field: 'ioTime$', align: 'center',title: '工作时间',sort: true, width: 160}
            ,{field: 'wrkSts$', align: 'center',title: '工作状态'}
            ,{field: 'ioType$', align: 'center',title: '入出库类型'}
            ,{field: 'ioPri', align: 'center',title: '优先级'}
            ,{field: 'crnNo$', align: 'center',title: '堆垛机'}
            ,{field: 'sourceStaNo$', align: 'center',title: '源站'}
            ,{field: 'staNo$', align: 'center',title: '目标站'}
            ,{field: 'sourceLocNo$', align: 'center',title: '源库位'}
            ,{field: 'locNo$', align: 'center',title: '目标库位'}
            ,{field: 'barcode', align: 'center',title: '条码'}
            ,{field: 'preHave', align: 'center',title: '先入品', hide: true}
            ,{field: 'takeNone', align: 'center',title: '空操作', hide: true}
            // ,{field: 'picking', align: 'center',title: '拣料', templet:function(row){
            //         var html = "<input value='picking' type='checkbox' lay-skin='primary' lay-filter='tableCheckbox' table-index='"+row.LAY_TABLE_INDEX+"'";
            //         if(row.picking === 'Y'){html += " checked ";}
            //         html += ">";
            //         return html;
            //     }}
            // ,{field: 'exitMk', align: 'center',title: '退出', templet:function(row){
            //         var html = "<input value='exitMk' type='checkbox' lay-skin='primary' lay-filter='tableCheckbox' table-index='"+row.LAY_TABLE_INDEX+"'";
            //         if(row.exitMk === 'Y'){html += " checked ";}
            //         html += ">";
            //         return html;
            //     }}
            // ,{field: 'emptyMk', align: 'center',title: '空板', templet:function(row){
            //         var html = "<input value='emptyMk' type='checkbox' lay-skin='primary' lay-filter='tableCheckbox' table-index='"+row.LAY_TABLE_INDEX+"'";
            //         if(row.emptyMk === 'Y'){html += " checked ";}
            //         html += ">";
            //         return html;
            //     }}
            //
            // ,{field: 'crnStrTime$', align: 'center',title: '堆垛机启动时间'}
            // ,{field: 'crnEndTime$', align: 'center',title: '堆垛机停止时间'}
            // ,{field: 'refIotime$', align: 'center',title: '拣料时间'}
            ,{field: 'modiUser$', align: 'center',title: '修改人员', hide:true}
            ,{field: 'modiTime$', align: 'center',title: '修改时间', hide:true, width: 160}
            // ,{field: 'memo', align: 'center',title: '备注'}
            //
            // ,{field: 'fullPlt', align: 'center',title: '满板', templet:function(row){
            //         var html = "<input value='fullPlt' type='checkbox' lay-skin='primary' lay-filter='tableCheckbox' table-index='"+row.LAY_TABLE_INDEX+"'";
            //         if(row.fullPlt === 'Y'){html += " checked ";}
            //         html += ">";
            //         return html;
            //     }}
            ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:250}
        ]],
        cols: getCol(),
        request: {
            pageName: 'curr',
            pageSize: 'limit'
@@ -83,21 +90,7 @@
        response: {
            statusCode: 200
        },
        done: function(res, curr, count) {
            if (res.code === 403) {
                top.location.href = baseUrl+"/";
            }
            pageCurr=curr;
            limit();
            form.on('checkbox(tableCheckbox)', function (data) {
                var _index = $(data.elem).attr('table-index')||0;
                if(data.elem.checked){
                    res.data[_index][data.value] = 'Y';
                }else{
                    res.data[_index][data.value] = 'N';
                }
            });
        }
        done: doneCallback
    });
    // 监听排序事件
@@ -113,13 +106,7 @@
            page: {
                curr: 1
            },
            done: function (res, curr, count) {
                if (res.code === 403) {
                    top.location.href = baseUrl+"/";
                }
                pageCurr=curr;
                limit();
            }
            done: doneCallback
        });
    });
@@ -190,7 +177,7 @@
            case 'addData':
                layer.open({
                    type: 2,
                    title: '新增',
                    title: I18n.t('add'),
                    maxmin: true,
                    area: [top.detailWidth, top.detailHeight],
                    shadeClose: false,
@@ -205,9 +192,9 @@
            case 'deleteData':
                var data = checkStatus.data;
                if (data.length === 0){
                    layer.msg('请选择数据');
                    layer.msg(I18n.t('please_select_data'));
                } else {
                    layer.confirm('确定删除'+(data.length===1?'此':data.length)+'条数据吗', function(){
                    layer.confirm(I18n.t('confirm_delete_prefix')+data.length+I18n.t('confirm_delete_suffix'), function(){
                        $.ajax({
                            url: baseUrl+"/wrkMast/delete/auth",
                            headers: {'token': localStorage.getItem('token')},
@@ -229,7 +216,7 @@
                }
                break;
            case 'exportData':
                layer.confirm('确定导出Excel吗', {shadeClose: true}, function(){
                layer.confirm(I18n.t('confirm_export'), {shadeClose: true}, function(){
                    var titles=[];
                    var fields=[];
                    obj.config.cols[0].map(function (col) {
@@ -281,7 +268,7 @@
                // 弹层显示
                layer.open({
                    type: 2,
                    title: '工作档明细',
                    title: I18n.t('work_order_detail'),
                    maxmin: true,
                    area: [top.detailWidth, top.detailHeight],
                    shadeClose: true,
@@ -292,7 +279,7 @@
                break;
            // 完成
            case 'complete':
                layer.confirm('确认完成该笔工作档?', {title: '工作号:'+data.wrkNo, shadeClose: true}, function(){
                layer.confirm(I18n.t('confirm_complete_work_order'), {title: I18n.t('work_no')+':'+data.wrkNo, shadeClose: true}, function(){
                    http.post(baseUrl+"/hand/control/wrkMast", {workNo: data.wrkNo, type:1}, function (res) {
                        $(".layui-laypage-btn")[0].click();
                        layer.msg(data.wrkNo + res.msg);
@@ -304,7 +291,7 @@
            // 取消
            case 'cancel':
                if (data.pdcType === "Y") {
                    layer.confirm('当前任务关联ERP销售单,取消将重新生成出库作业,是否继续?', {title: '工作号:'+data.wrkNo, shadeClose: true}, function(){
                    layer.confirm(I18n.t('confirm_cancel_erp_order'), {title: I18n.t('work_no')+':'+data.wrkNo, shadeClose: true}, function(){
                        http.post(baseUrl+"/hand/control/wrkMast", {workNo: data.wrkNo, type:2}, function (res) {
                            $(".layui-laypage-btn")[0].click();
                            layer.msg(data.wrkNo + res.msg);
@@ -312,7 +299,7 @@
                        layer.closeAll();
                    });
                } else {
                    layer.confirm('确认取消该笔工作档?', {title: '工作号:'+data.wrkNo, shadeClose: true}, function(){
                    layer.confirm(I18n.t('confirm_cancel_work_order'), {title: I18n.t('work_no')+':'+data.wrkNo, shadeClose: true}, function(){
                        http.post(baseUrl+"/hand/control/wrkMast", {workNo: data.wrkNo, type:2}, function (res) {
                            $(".layui-laypage-btn")[0].click();
                            layer.msg(data.wrkNo + res.msg);
@@ -323,7 +310,7 @@
                break;
            //  拣料入库
            case 'pick':
                layer.confirm('拣料入库该笔工作档?', {title: '工作号:'+data.wrkNo, shadeClose: true}, function(){
                layer.confirm(I18n.t('confirm_pick_work_order'), {title: I18n.t('work_no')+':'+data.wrkNo, shadeClose: true}, function(){
                    http.post(baseUrl+"/hand/control/wrkMast", {workNo: data.wrkNo, type:3}, function (res) {
                        $(".layui-laypage-btn")[0].click();
                        layer.msg(data.wrkNo + res.msg);
@@ -333,7 +320,7 @@
                break;
            //  先入品
            case 'preHave':
                layer.confirm('任务发生先入品异常。如需重新入库,请确保货物已放至堆垛机出库站!', {title: '工作号:'+data.wrkNo, shadeClose: true}, function(){
                layer.confirm(I18n.t('confirm_pre_existing_exception'), {title: I18n.t('work_no')+':'+data.wrkNo, shadeClose: true}, function(){
                    http.post(baseUrl+"/deal/preHave/start", {wrkNo: data.wrkNo}, function (res) {
                        $(".layui-laypage-btn")[0].click();
                        layer.msg(data.wrkNo + res.msg, {icon: 1});
@@ -343,7 +330,7 @@
                break;
            //  空操作
            case 'takeNone':
                layer.confirm('任务发送空操作异常!是否。。。。。。。。?', {title: '工作号:'+data.wrkNo, shadeClose: true}, function(){
                layer.confirm(I18n.t('confirm_empty_op_exception'), {title: I18n.t('work_no')+':'+data.wrkNo, shadeClose: true}, function(){
                });
                break;
        }
@@ -546,22 +533,22 @@
            cellMinWidth: 50,
            cols: [[
                {type: 'checkbox'}
                ,{field: 'wrkNo', align: 'center',title: '工作号'}
                ,{field: 'ioTime$', align: 'center',title: '工作时间'}
                ,{field: 'matnr', align: 'center',title: '物料'}
                ,{field: 'lgnum', align: 'center',title: '仓库号'}
                ,{field: 'tbnum', align: 'center',title: '转储请求编号'}
                ,{field: 'tbpos', align: 'center',title: '行项目'}
                ,{field: 'zmatid', align: 'center',title: '物料标签ID'}
                ,{field: 'maktx', align: 'center',title: '物料描述'}
                ,{field: 'werks', align: 'center',title: '工厂'}
                ,{field: 'anfme', align: 'center',title: '数量'}
                ,{field: 'altme', align: 'center',title: '单位'}
                ,{field: 'zpallet', align: 'center',title: '托盘条码'}
                ,{field: 'bname', align: 'center',title: '用户ID'}
                ,{field: 'memo', align: 'center',title: '备注'}
                ,{field: 'wrkNo', align: 'center',title: I18n.t('work_no')}
                ,{field: 'ioTime$', align: 'center',title: I18n.t('work_time')}
                ,{field: 'matnr', align: 'center',title: I18n.t('material')}
                ,{field: 'lgnum', align: 'center',title: I18n.t('warehouse_no')}
                ,{field: 'tbnum', align: 'center',title: I18n.t('transfer_req_no')}
                ,{field: 'tbpos', align: 'center',title: I18n.t('item_no')}
                ,{field: 'zmatid', align: 'center',title: I18n.t('material_label_id')}
                ,{field: 'maktx', align: 'center',title: I18n.t('material_desc')}
                ,{field: 'werks', align: 'center',title: I18n.t('factory')}
                ,{field: 'anfme', align: 'center',title: I18n.t('quantity')}
                ,{field: 'altme', align: 'center',title: I18n.t('unit')}
                ,{field: 'zpallet', align: 'center',title: I18n.t('pallet_barcode')}
                ,{field: 'bname', align: 'center',title: I18n.t('user_id')}
                ,{field: 'memo', align: 'center',title: I18n.t('remark')}
                ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:50}
                ,{fixed: 'right', title: I18n.t('operation'), align: 'center', toolbar: '#operate', width:50}
            ]],
            request: {
                pageName: 'curr',
@@ -616,6 +603,10 @@
            if (res.code === 403) {
                top.location.href = baseUrl+"/";
            }
            if (typeof I18n !== 'undefined') {
                I18n.updatePage($('.layui-table-view'));
                I18n.updateLayuiPagination();
            }
            pageCurr=curr;
            if (res.data.length === 0 && count !== 0) {
                tableIns.reload({