pang.jiabao
2025-05-13 688e299d29bd76cbd30bf3d7267bdc9afad954b0
src/main/webapp/static/wms/js/locMast/locMast.js
@@ -1,11 +1,11 @@
var pageCurr;
layui.use(['table','laydate', 'form'], function(){
layui.use(['table','laydate', 'form','upload','layer'], function(){
    var table = layui.table;
    var $ = layui.jquery;
    var layer = layui.layer;
    var layDate = layui.laydate;
    var form = layui.form;
    var upload = layui.upload;
    // 数据渲染
    tableIns = table.render({
        elem: '#locMast',
@@ -93,6 +93,28 @@
        }
    });
    upload.render({
        elem: '#uploadExcel', // 绑定元素
        url: baseUrl+'/importCrnErr', // 上传接口,替换为你的后端接口
        headers:{'token': localStorage.getItem('token')},
        accept: 'file', // 允许上传的文件类型
        exts: 'xls|xlsx', // 允许上传的文件后缀
        done: function(res){
            // 上传完毕回调
            if(res.code === 200){
                layer.msg(res.msg);
                console.log('文件数据:', res.data);
            } else {
                layer.msg(res.msg || '上传失败');
            }
        },
        error: function(){
            // 请求异常回调
            layer.msg('上传失败,请重试');
        }
    });
    // 监听排序事件
    table.on('sort(locMast)', function (obj) {
        var searchData = {};