#
luxiaotao1123
2021-03-12 fc3132120fdcbd5a4eb7876c98c277d4b1e19714
#
1个文件已修改
49 ■■■■ 已修改文件
src/main/webapp/static/js/ioWorks/matQuery.js 49 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/ioWorks/matQuery.js
@@ -9,12 +9,16 @@
    cols.push({fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:65})
    return cols;
}
layui.use(['table','laydate', 'form'], function() {
layui.config({
    base: baseUrl + "/static/layui/lay/modules/"
}).extend({
    notice: 'notice/notice',
}).use(['table','laydate', 'form',  'notice'], function() {
    var table = layui.table;
    var $ = layui.jquery;
    var layer = layui.layer;
    var form = layui.form;
    var notice = layui.notice;
    tableIns = table.render({
        elem: '#chooseData',
@@ -41,12 +45,18 @@
        switch (obj.event) {
            case 'createDoc':
                if (data.length === 0){
                    layer.msg('请添加物料');
                    notice.error({
                        title: '消息通知',
                        message: '请添加物料'
                    });
                } else {
                    var success = true;
                    for (var i=0;i<matData.length;i++) {
                        if (matData[i].count <= 0) {
                            layer.msg(matData[i].matnr + '物料数量必须大于零!', {icon: 2})
                            notice.error({
                                title: '消息通知',
                                message: matData[i].matnr + '物料数量必须大于零!'
                            });
                            success = false;
                            return false;
                        }
@@ -111,12 +121,18 @@
            method: 'POST',
            success: function (res) {
                if (res.code === 200){
                    layer.msg(res.msg, {icon: 1});
                    notice.success({
                        title: '消息通知',
                        message: res.msg
                    });
                    top.layui.layer.close(top.popupRight);
                } else if (res.code === 403){
                    top.location.href = baseUrl+"/";
                } else {
                    layer.msg(res.msg, {icon: 2})
                    notice.error({
                        title: '消息通知',
                        message: res.msg
                    });
                }
            }
        });
@@ -124,21 +140,23 @@
    function updateMatData(locNo, matnr, count) {
        if (isNaN(count)) {
            layer.msg("请输入数字");
            notice.error({
                title: '消息通知',
                message: '请输入数字'
            });
        } else {
            if (count > 0) {
                for (var i=0;i<matData.length;i++){
                    if (matData[i]["matnr"] === matnr){
                        // if (count > locDetlData[i]["anfme"]) {
                        //     layer.msg("不能超过原数量");
                        // } else {
                            matData[i]["count"] = count;
                        // }
                        matData[i]["count"] = count;
                        break;
                    }
                }
            } else {
                layer.msg("数量必须大于零");
                notice.error({
                    title: '消息通知',
                    message: '数量必须大于零'
                });
            }
        }
        tableIns.reload({data: matData,done:function (res) {
@@ -197,7 +215,10 @@
            } else if (res.code === 403){
                top.location.href = baseUrl+"/";
            } else {
                layer.msg(res.msg, {icon: 2})
                notice.error({
                    title: '消息通知',
                    message: res.msg
                });
            }
        }
    });