1
yangle
2023-04-27 07c624c777bd16e0b4351ade060386a2c3b7a7a8
WebTM/views/ÑéÊÕÈë¿â/Í⹺Èë¿â/Kf_POStockInBill_FastList.html
@@ -123,6 +123,7 @@
                , form = layui.form
                , element = layui.element;
            var sBillType = '1201'
            var option = {};
            //清空界面  new
            //动态加载源单类型列表 new
@@ -162,86 +163,67 @@
            //刷新
            form.on('submit(cmdRefresh)', function () {//
                var sBillType = '1201'
                //动态列-刷新缓存列表
                table.render(option);
                table.render({
                    elem: '#dj-table'
                    , url: GetWEBURL() + '/Web/DisBillEntryList_Mate_Webs_Json'
                    elem: '#yd-table'
                    , url: GetWEBURL() + '/Web/DisBillUpdateLoad_Json'
                    , toolbar: '#toolbarDemo'
                    , where: { HBillType: sBillType, sWhere: '' }
                    , where: { HBillType: sBillType, HMaker: sessionStorage["HUserName"], HOrgID: sessionStorage["OrganizationID"] }
                    , page: true  // å¼€å¯åˆ†é¡µ
                    , limits: [20, 40, 80, 100]
                    , limit: 20
                    , cols: [[
                        { type: 'radio' }
                        , { field: 'HInterID', title: '单据内码', width: 120 }
                        , { field: 'HBillNo', title: '单据号', width: 150 }
                        , { field: 'HMaker', title: '制单人', width: 120 }
                        , { field: 'HMakeDate', title: '制单日期', width: 150 }
                        , { field: 'HMaterNumber', title: '物料代码', width: 150 }
                        , { field: 'HMaterName', title: '物料名称', width: 150 }
                        , { field: 'HMaterModel', title: '规格型号', width: 150 }
                        , { field: 'HQty', title: '数量', width: 100 }
                        , { field: 'HSourceBillNo', title: '源单单号', width: 150 }
                        , { field: 'HRedBlueFlag', title: '红蓝字', width: 120 }
                        , { field: 'HSourceBillType', title: '源单类型', width: 100 }
                        , { field: 'HOrgID', title: '组织', width: 120 }
                    ]]
                      , height: 500
                      , done: function () {
                          layer.closeAll("loading");
                      }
                    , height: 500
                    , done: function () {
                        layer.closeAll("loading");
                    }
                })
            });
            table.render({
                elem: '#yd-table'
                , url: GetWEBURL() + '/Web/DisBillUpdateLoad_Json'
                , toolbar: '#toolbarDemo'
                , where: { HBillType: sBillType, HMaker: sessionStorage["HUserName"], HOrgID: sessionStorage["OrganizationID"] }
                , page: true  // å¼€å¯åˆ†é¡µ
                , limits: [20, 40, 80, 100]
                , limit: 20
                , cols: [[
                    { type: 'radio' }
                    , { field: 'HInterID', title: '单据内码', width: 120 }
                    , { field: 'HBillNo', title: '单据号', width: 150 }
                    , { field: 'HMaker', title: '制单人', width: 120 }
                    , { field: 'HMakeDate', title: '制单日期', width: 150 }
                    , { field: 'HMaterNumber', title: '物料代码', width: 150 }
                    , { field: 'HMaterName', title: '物料名称', width: 150 }
                    , { field: 'HMaterModel', title: '规格型号', width: 150 }
                    , { field: 'HQty', title: '数量', width: 100 }
                    , { field: 'HSourceBillNo', title: '源单单号', width: 150 }
                    , { field: 'HOrgID', title: '组织', width: 120 }
                ]]
                , height: 500
                , done: function () {
                    layer.closeAll("loading");
            //撤销功能
            form.on('submit(cmdRescind)', function () {
                var checkStatus = table.checkStatus('yd-table');
                var checkStatus2 = table.checkStatus('sy-table');
                var data = "";
                if (checkStatus.data.length != 0) {
                    data = checkStatus.data;
                } else if (checkStatus2.data.length != 0) {
                    data = checkStatus2.data;
                } else {
                    return layer.msg("请选择一条数据");
                }
            })
        });
        //撤销功能
        form.on('submit(cmdRescind)', function () {
            var checkStatus = table.checkStatus('yd-table');
            var checkStatus2 = table.checkStatus('sy-table');
            var data = "";
            if (checkStatus.data.length != 0) {
                data = checkStatus.data;
            } else if (checkStatus2.data.length != 0) {
                data = checkStatus2.data;
            } else {
                return layer.msg("请选择一条数据");
            }
            var sInterID = data[0].HInterID
            var sBillNo = data[0].HBillNo
            var sBillType = '1201'
            $.ajax(
                {
                    type: "Get",
                    url: GetWEBURL() + "/Web/Rescind_Json",
                    async: true,
                    data: { "sHInterID": sInterID, "sBillNo": sBillNo, "sBillType": sBillType },
                    dataType: "json",
                    success: function (data) {
                        if (data.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                            layer.msg(data.Message, { time: 1 * 1000, icon: 1 }, function () {
                                // å¾—到frame索引
                                var index = layer.getFrameIndex(window.name);
                                //关闭当前frame
                                layer.close(index);
                                //修改为功后刷新界面
                                window.location.reload();
                            });
                var sInterID = data[0].HInterID
                var sBillNo = data[0].HBillNo
                var sBillType = '1201'
                $.ajax(
                    {
                        type: "Get",
                        url: GetWEBURL() + "/Web/Rescind_Json",
                        async: true,
                        data: { "sHInterID": sInterID, "sBillNo": sBillNo, "sBillType": sBillType },
                        dataType: "json",
                        success: function (data) {
                            if (data.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                                layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () {
                                    // å¾—到frame索引
                                    var index = layer.getFrameIndex(window.name);
                                    //关闭当前frame
                                    layer.close(index);
                                    //修改为功后刷新界面
                                    window.location.reload();
                                });
                            }
                            else {
                                layer.msg(data.Message, { icon: 2 });
@@ -262,7 +244,7 @@
                var checkStatus = table.checkStatus('dj-table')
                    , data = checkStatus.data;
                if (checkStatus.data.length === 1) {
                    var sInterID = data[0].HInterID
                    var sInterID = data[0].HInterID = 'undefined' ? data[0].单据内码 : data[0].HInterID;
                    //逻辑删除方法
                    layer.confirm("确认要删除吗,删除后不能恢复", { title: "删除确认" }, function (index) {
                        $.ajax(
@@ -329,29 +311,108 @@
                });
            });
            ////缓存列表
            //table.render({
            //    elem: '#dj-table'
            //    , url: GetWEBURL() + '/Web/DisBillEntryList_Mate_Webs_Json'
            //    , toolbar: '#toolbarDemo'
            //    , where: { HBillType: sBillType, sHMaker: sessionStorage["HUserName"], HOrgID: sessionStorage["OrganizationID"] }
            //    , cols: [[
            //        { type: 'radio' }
            //        , { field: 'HInterID', title: '单据内码', width: 120 }
            //        , { field: 'HBillNo', title: '单据号', width: 150 }
            //        , { field: 'HMaker', title: '制单人', width: 120 }
            //        , { field: 'HMakeDate', title: '制单日期', width: 150 }
            //        , { field: 'HQty', title: '数量', width: 100 }
            //        , { field: 'HSourceBillNo', title: '源单单号', width: 150 }
            //        , { field: 'HRedBlueFlag', title: '红蓝字', width: 120 }
            //        , { field: 'HSourceBillType', title: '源单类型', width: 100 }
            //    ]]
            //    , height: 500
            //    , done: function () {
            //        layer.closeAll("loading");
            //    }
            //})
            //缓存列表
            table.render({
                elem: '#dj-table'
                , url: GetWEBURL() + '/Web/chanpinruk'
                , toolbar: '#toolbarDemo'
                , where: { HBillType: sBillType, sHMaker: sessionStorage["HUserName"], HOrgID: sessionStorage["OrganizationID"] }
                , cols: [[
                    { type: 'radio' }
                    , { field: 'HInterID', title: '单据内码', width: 120 }
                    , { field: 'HBillNo', title: '单据号', width: 150 }
                    , { field: 'HMaker', title: '制单人', width: 120 }
                    , { field: 'HMakeDate', title: '制单日期', width: 150 }
                    , { field: 'HQty', title: '数量', width: 100 }
                    , { field: 'HSourceBillNo', title: '源单单号', width: 150 }
                    , { field: 'HRedBlueFlag', title: '红蓝字', width: 120 }
                    , { field: 'HSourceBillType', title: '源单类型', width: 100 }
                ]]
                , height: 500
                , done: function () {
                    layer.closeAll("loading");
            //动态列-缓存列表
            $.ajax({
                url: GetWEBURL() + "/Web/DisBillEntryList_Mate_Webs_Json",
                type: "GET",
                async: false,
                data: { HBillType: sBillType, sWhere: '' },
                //async: false,
                success: function (data1) {
                    if (data1.count == 1) {
                        var data = [];
                        var col = [];
                        //给空的数组赋值
                        for (var key in data1.list) {
                            data.push({ "id": data1.list[key].ColmCols, "name": data1.list[key].ColmCols, "Type": data1.list[key].ColmType });
                        }
                        //在列表左边添加勾选框
                        col.push({ type: 'radio', fixed: 'left' });
                        for (var i = 0; i < data.length; i++) {
                            if ($.inArray(data[i].name, "") > -1) {
                                col.push({ field: data[i].id, title: data[i].name, align: 'center', hide: true }); //隐藏id列
                            }
                            else {
                                switch (data[i].Type) {
                                    //int
                                    case 'DateTime':
                                        col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, templet: "<div>{{d." + data[i].name + " ==null ?'':layui.util.toDateString(d." + data[i].name + ", 'yyyy-MM-dd HH:mm:ss')}}</div>", width: 200 });
                                        break;
                                    default:
                                        col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 200 });
                                }
                            }
                        }
                        option = {
                            elem: '#dj-table'
                            , toolbar: '#toolbarDemo'
                            , height: 500
                            , page: true //开启分页
                            , limit: 50
                            , limits: [50, 500, 5000, 20000]
                            , cols: [col]
                            , data: data1.data
                        };
                        table.render(option);
                    } else {
                        option = {
                            elem: '#dj-table'
                            , toolbar: '#toolbarDemo'
                            , height: 500
                            , page: true //开启分页
                            , limit: 50
                            , limits: [50, 500, 5000, 20000]
                            , cols: [[
                                { type: 'radio' }
                                , { field: 'HMakeDate', title: '制单日期', width: 150 }
                                , { field: 'HBillNo', title: '单据号', width: 150 }
                                , { field: 'HMaterName', title: '物料名称', width: 150 }
                                , { field: 'HQty', title: '数量', width: 100 }
                            ]]
                            , data: []
                        };
                        table.render(option);
                    }
                },
                error: function (err) {
                    layer.msg('错误' + err, {
                        icon: 5,
                        time: 20000
                    }, function () {
                        //do something
                    });
                }
            })
            //已上传列表
            table.render({
                elem: '#yd-table'