1
yangle
2023-04-27 07c624c777bd16e0b4351ade060386a2c3b7a7a8
WebTM/views/ÑéÊÕÈë¿â/²úÆ·Èë¿â/Kf_ProductInBill_FastList.html
@@ -138,6 +138,8 @@
                , table = layui.table
                , form = layui.form
                , element = layui.element;
            var option = {}
            //清空界面  new
            var sBillType = '1202'
@@ -214,27 +216,7 @@
                    }
                })
            });
            var option = {
                elem: '#dj-table'
                //, url: GetWEBURL() + '/ProductIn/DisBillEntryList_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: '#sy-table'
@@ -258,28 +240,34 @@
           
            // url: GetWEBURL() + '/Web/chanpinruk',
            form.on('submit(cmdRefresh)', function () {//刷新
                table.render({
                    elem: '#dj-table'
                    , url: GetWEBURL() + '/Web/chanpinruk'
                    , toolbar: '#toolbarDemo'
                    , defaultToolbar: []
                    , 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'
                //    , defaultToolbar: []
                //    , 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(option);
                //刷新已上传列表
                    table.render({
                        elem: '#yd-table'
                        , url: GetWEBURL() + '/Web/DisBillUpdateLoad_Json'
@@ -314,16 +302,19 @@
            form.on('submit(cmdRescind)', function () {
                var checkStatus = table.checkStatus('yd-table');
                var checkStatus2 = table.checkStatus('sy-table');
                var checkStatus3 = table.checkStatus('dj-table');
                var data = "";
                if (checkStatus.data.length != 0) {
                    data = checkStatus.data;
                } else if (checkStatus2.data.length != 0) {
                    data = checkStatus2.data;
                } else if (checkStatus3.data.length != 0) {
                    data = checkStatus3.data;
                } else {
                    return layer.msg("请选择一条数据");
                }
                var sInterID = data[0].HInterID
                var sBillNo = data[0].HBillNo
                var sInterID = data[0].HInterID = 'undefined' ? data[0].单据内码 : data[0].HInterID;
                var sBillNo = data[0].HBillNo = 'undefined' ? data[0].单据号 : data[0].HBillNo;
                var sBillType = '1202'
                $.ajax(
                    {
@@ -365,7 +356,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(
@@ -475,30 +466,106 @@
                })
            });
            ////缓存列表
            //table.render({
            //    elem: '#dj-table'
            //    , url: GetWEBURL() + '/Web/chanpinruk'
            //    , toolbar: '#toolbarDemo'
            //    , defaultToolbar: []
            //    , 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'
                , defaultToolbar: []
                , 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/chanpinruk1",
                type: "GET",
                async: false,
                data: { HBillType: sBillType, sHMaker: sessionStorage["HUserName"], HOrgID: sessionStorage["OrganizationID"] },
                //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({