cp
2024-11-19 70b86bb70e6941127888979dbde37dda3b1db0b6
zy-asrs-wms/src/main/webapp/static/js/mat/mat.js
@@ -16,8 +16,8 @@
layui.config({
    base: baseUrl + "/static/layui/lay/modules/"
}).extend({
    dropdown: 'dropdown/dropdown',
}).use(['table','laydate', 'form', 'treeTable', 'admin', 'xmSelect', 'dropdown', 'element'], function(){
    dropdown: 'dropdown/dropdown',notice: 'notice/notice',
}).use(['table','laydate', 'form', 'treeTable','notice', 'admin', 'xmSelect', 'dropdown', 'element'], function(){
    var table = layui.table;
    var $ = layui.jquery;
    var layer = layui.layer;
@@ -26,7 +26,7 @@
    admin = layui.admin;
    var treeTable = layui.treeTable;
    var xmSelect = layui.xmSelect;
    var notice = layui.notice;
    // 商品分类数据
    var insTb = treeTable.render({
        elem: '#tag',
@@ -367,11 +367,25 @@
    // 同步庫存
    form.on('submit(synchronous)', function (data) {
        layer.confirm('确认同步庫存?', function(){
            http.get(baseUrl+"/hand/control/wrkMast", {workNo: data.wrkNo, type:1}, function (res) {
                $(".layui-laypage-btn")[0].click();
                layer.msg(data.wrkNo + res.msg);
            notice.msg('正在同步庫存......', {icon: 4});
            $.ajax({
                url: baseUrl+"/mat/synchronous",
                headers: {'token': localStorage.getItem('token')},
                method: 'GET',
                success: function (res) {
                    notice.destroy();
                    // layer.close(loadIndex);
                    if (res.code === 200){
                        layer.close(dIndex);
                        layer.msg(res.msg, {icon: 1});
                        $(".layui-laypage-btn")[0].click();
                    } else if (res.code === 403){
                        top.location.href = baseUrl+"/";
                    }else {
                        layer.msg(res.msg, {icon: 2});
                    }
                }
            })
            layer.closeAll();
        });
    });