自动化立体仓库 - WMS系统
#
野心家
2023-08-10 f9a1f1b0a23bb8bc33a4a649f61f9efcce349279
src/main/webapp/static/js/docType/docType.js
@@ -1,4 +1,5 @@
var pageCurr;
var tableData;
layui.config({
    base: baseUrl + "/static/layui/lay/modules/"
}).use(['table','laydate', 'form', 'admin'], function(){
@@ -24,12 +25,14 @@
            {type: 'checkbox'}
            ,{field: 'docId', align: 'center',title: '类型编号'}
            ,{field: 'docName', align: 'center',title: '类型名称'}
            ,{field: 'pakin', align: 'center',title: '入库', templet: '#pakinTpl', width: 120, unresize: true}
            ,{field: 'pakout', align: 'center',title: '出库', templet: '#pakoutTpl', width: 120, unresize: true}
            ,{field: 'status$', align: 'center',title: '状态'}
            ,{field: 'createBy$', align: 'center',title: '添加人员'}
            ,{field: 'createTime$', align: 'center',title: '添加时间'}
            // ,{field: 'createBy$', align: 'center',title: '添加人员'}
            // ,{field: 'createTime$', align: 'center',title: '添加时间'}
            ,{field: 'updateBy$', align: 'center',title: '修改人员'}
            ,{field: 'updateTime$', align: 'center',title: '修改时间'}
            ,{field: 'memo', align: 'center',title: '备注'}
            ,{field: 'memo', align: 'center',title: '备注', hide: true}
            ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:120}
        ]],
@@ -52,6 +55,7 @@
            if (res.code === 403) {
                top.location.href = baseUrl+"/";
            }
            tableData = table.cache.docType;
            pageCurr=curr;
            limit();
        }
@@ -71,6 +75,24 @@
        });
    });
    form.on('switch(pakinSwitch)', function (obj) {
        let index  = obj.othis.parents('tr').attr("data-index");
        let data = tableData[index];
        data[this.name] = obj.elem.checked?1:0;
        http.post(baseUrl+"/docType/update/auth", {docId: data.docId, pakin: data[this.name]}, function (res) {
            layer.msg(res.msg, {icon: 1});
        })
    })
    form.on('switch(pakoutSwitch)', function (obj) {
        let index  = obj.othis.parents('tr').attr("data-index");
        let data = tableData[index];
        data[this.name] = obj.elem.checked?1:0;
        http.post(baseUrl+"/docType/update/auth", {docId: data.docId, pakout: data[this.name]}, function (res) {
            layer.msg(res.msg, {icon: 1});
        })
    })
    // 监听头工具栏事件
    table.on('toolbar(docType)', function (obj) {
        var checkStatus = table.checkStatus(obj.config.id).data;