WebTM/views/ÑéÊÕÈë¿â/²úÆ·Èë¿â/Kf_ProductInBill_FastList.html
@@ -44,15 +44,27 @@
                            <div class="layui-tab-item  layui-show">
                                <div class="layui-row">
                                    <div class="layui-col-xs12">
                                        <table class="layui-hide" id="dj-table" lay-filter="dj-table"></table>
                                    </div>
                                </div>
                                        <div class="layui-form layui-border-box layui-table-view" lay-filter=" dj-table" lay-id="dj-table" style=" height:500px;margin-bottom:20px;">
                                            <table class="layui-hide" id="dj-table" lay-filter="dj-table"></table>
                                        </div>
                                                <button type="button" lay-submit="" class="layui-btn" lay-filter="cmdModify">编辑</button>
                                                <button type="button" lay-submit="" class="layui-btn" lay-filter="cmdDelete">删除</button>
                                                <button type="button" lay-submit="" class="layui-btn" lay-filter="cmdRefresh">刷新</button>
                                                <button type="button" lay-submit="" class="layui-btn" lay-filter="cmdCancel">退出</button>
                                     </div>
                                 </div>
                            </div>
                            <div class="layui-tab-item">
                                <div class="layui-row">
                                    <div class="layui-col-xs12">
                                        <table class="layui-hide" id="yd-table" lay-filter="yd-table"></table>
                                    </div>
                                        <div class="layui-form layui-border-box layui-table-view" lay-filter=" yd-table" lay-id="yd-table" style=" height:500px;margin-bottom:20px;">
                                            <table class="layui-hide" id="yd-table" lay-filter="yd-table"></table>
                                        </div>
                                                <button type="button" lay-submit="" class="layui-btn" lay-filter="cmdRescind">撤销</button>
                                                <button type="button" lay-submit="" class="layui-btn" lay-filter="cmdRefresh">刷新</button>
                                                <button type="button" lay-submit="" class="layui-btn" lay-filter="cmdCancel">退出</button>
                                     </div>
                                </div>
                            </div>
                            <div class="layui-tab-item">
@@ -68,19 +80,24 @@
                                        <input type="text" class="layui-input" name="HSourceBillNo" id="HSourceBillNo">
                                    </div>
                                </div>
                                <div class="layui-col-xs2">
                                <!--<div class="layui-col-xs2">
                                    <button type="button" lay-submit="" class="layui-btn" lay-filter="cmdQuery">查询</button>
                                </div>
                                </div>-->
                                <div class="layui-row">
                                    <div class="layui-col-xs12">
                                        <table class="layui-hide" id="sy-table" lay-filter="sy-table"></table>
                                        <div class="layui-form layui-border-box layui-table-view" lay-filter=" sy-table" lay-id="sy-table" style=" height:500px;margin-bottom:20px;">
                                            <table class="layui-hide" id="sy-table" lay-filter="sy-table"></table>
                                        </div>
                                        <button type="button" lay-submit="" class="layui-btn" lay-filter="cmdRescind">撤销</button>
                                        <button type="button" lay-submit="" class="layui-btn" lay-filter="cmdQuery">查询</button>
                                        <button type="button" lay-submit="" class="layui-btn" lay-filter="cmdCancel">退出</button>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="layui-form-item" style="margin-bottom: 20px;">
                            <div class="layui-row">
                                <div class="layui-col-xs2">
                                <!--<div class="layui-col-xs2">
                                    <button type="button" lay-submit="" class="layui-btn" lay-filter="cmdModify">编辑</button>
                                </div>
                                <div class="layui-col-xs2">
@@ -94,10 +111,10 @@
                                </div>
                                <div class="layui-col-xs2">
                                    <button type="button" lay-submit="" class="layui-btn" lay-filter="cmdCancel">退出</button>
                                </div>
                                <div class="layui-col-xs2">
                                    <!--<button type="button" lay-submit="" class="layui-btn" lay-filter="cmdAdd">新增</button>-->
                                </div>
                                </div>-->
                                <!--<div class="layui-col-xs2">
                                    <button type="button" lay-submit="" class="layui-btn" lay-filter="cmdAdd">新增</button>
                                </div>-->
                            </div>
                        </div>
                    </div>
@@ -121,6 +138,8 @@
                , table = layui.table
                , form = layui.form
                , element = layui.element;
            var option = {}
            //清空界面  new
            var sBillType = '1202'
@@ -131,8 +150,10 @@
            //读取单据列表
            //
            form.on('submit(Cancel)', function () {
                parent.location.href = "../../../views/index.html"
            form.on('submit(cmdCancel)', function () {
                layer.confirm('您确定要退出吗?', { icon: 3, title: '提示' }, function (index) {
                    parent.location.href = "../../../views/index_Mobile.html"
                });
                //window.close();//关闭当前页
            })
@@ -195,69 +216,79 @@
                    }
                })
            });
            var option = {
                elem: '#dj-table'
                //, url: GetWEBURL() + '/ProductIn/DisBillEntryList_Json'
            table.render({
                elem: '#sy-table'
                , toolbar: '#toolbarDemo'
                , where: { HBillType: sBillType, sHMaker: sessionStorage["HUserName"], HOrgID: sessionStorage["OrganizationID"] }
                , cols: [[
                    { type: 'radio' }
                    , { field: 'HInterID', title: '单据内码', width: 80 }
                    , { field: 'HBillNo', title: '单据号', width: 80 }
                    , { field: 'HMaker', title: '制单人', width: 100 }
                    , { field: 'HMakeDate', title: '制单日期', width: 100 }
                    , { 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: 100 }
                    , { field: 'HRedBlueFlag', title: '红蓝字', width: 100 }
                    , { field: 'HSourceBillType', title: '源单类型', width: 100 }
                    , { field: 'HSourceBillNo', title: '源单单号', width: 150 }
                    , { field: 'HOrgID', title: '组织', width: 120 }
                ]]
                , height: 500
                , done: function () {
                    layer.closeAll("loading");
                }
            }
            })
            // 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: 80 }
                        , { field: 'HBillNo', title: '单据号', width: 80 }
                        , { field: 'HMaker', title: '制单人', width: 100 }
                        , { field: 'HMakeDate', title: '制单日期', width: 100 }
                        , { field: 'HQty', title: '数量', width: 100 }
                        , { field: 'HSourceBillNo', title: '源单单号', width: 100 }
                        , { field: 'HRedBlueFlag', title: '红蓝字', width: 100 }
                        , { 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'
                        , toolbar: '#toolbarDemo'
                        , defaultToolbar: []
                        , 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: 80 }
                            , { field: 'HBillNo', title: '单据号', width: 80 }
                            , { field: 'HMaker', title: '制单人', width: 100 }
                            , { field: 'HMakeDate', title: '制单日期', width: 100 }
                            , { field: 'HMaterNumber', title: '物料代码', width: 100 }
                            , { field: 'HMaterName', title: '物料名称', width: 100 }
                            , { field: 'HMaterModel', title: '规格型号', width: 100 }
                            , { 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: 100 }
                            , { field: 'HOrgID', title: '组织', width: 100 }
                            , { field: 'HSourceBillNo', title: '源单单号', width: 150 }
                            , { field: 'HOrgID', title: '组织', width: 120 }
                        ]]
                        , height: 500
                        , done: function () {
@@ -269,10 +300,21 @@
            //撤销功能
            form.on('submit(cmdRescind)', function () {
                var checkStatus = table.checkStatus('yd-table')
                    , data = checkStatus.data;
                var sInterID = data[0].HInterID
                var sBillNo = data[0].HBillNo
                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 == 'undefined' ? data[0].单据内码 : data[0].HInterID;
                var sBillNo = data[0].HBillNo == 'undefined' ? data[0].单据号 : data[0].HBillNo;
                var sBillType = '1202'
                $.ajax(
                    {
@@ -314,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(
@@ -358,52 +400,172 @@
            //查询
            form.on('submit(cmdQuery)', function () {
                var HBillNo = $("#HBillNo").val();
                var HSourceBillNo = $("#HSourceBillNo").val();
                var HSourceBillNo = $("#HSourceBillNo").val();;
                //进入页面显示的缓存列表
                $.ajax({
                    url: GetWEBURL() + '/Gy_Mould/list1',
                    type: "GET",
                    data: { "BillType": sBillType, "HBillNo": HBillNo, "HSourceBillNo": HSourceBillNo },
                    success: function (data1) {
                        if (data1.count == 1) {
                            option.data = data1.data;
                            table.render(option);
                            layer.close(index);
                        } else {
                            layer.close(index);
                            layer.alert(data1.code + data1.Message, { icon: 5 });
                        }
                    }, error: function () {
                        layer.close(index);
                        layer.alert("接口请求失败!", { icon: 5 });
                //$.ajax({
                //    url: GetWEBURL() + '/ProductInBillList/list1',
                //    type: "GET",
                //    data: { "BillType": sBillType, "HBillNo": HBillNo, "HSourceBillNo": HSourceBillNo },
                //    success: function (data1) {
                //        if (data1.count == 1) {
                //            //option.data = data1.data;
                //            //table.render(option);
                //            table.render({
                //                elem: '#sy-table'
                //                , toolbar: '#toolbarDemo'
                //                , cols: [[
                //                    { type: 'radio' }
                //                    , { field: 'HInterID', title: '单据内码', width: 80 }
                //                    , { field: 'HBillNo', title: '单据号', width: 80 }
                //                    , { field: 'HMaker', title: '制单人', width: 100 }
                //                    , { field: 'HMakeDate', title: '制单日期', width: 100 }
                //                    , { field: 'HMaterNumber', title: '物料代码', width: 100 }
                //                    , { field: 'HMaterName', title: '物料名称', width: 100 }
                //                    , { field: 'HMaterModel', title: '规格型号', width: 100 }
                //                    , { field: 'HQty', title: '数量', width: 100 }
                //                    , { field: 'HSourceBillNo', title: '源单单号', width: 100 }
                //                    , { field: 'HOrgID', title: '组织', width: 100 }
                //                ]]
                //                , height: 500
                //            })
                //            //layer.close(index);
                //        } else {
                //            layer.close(index);
                //            layer.alert(data1.code + data1.Message, { icon: 5 });
                //        }
                //    }, error: function () {
                //        layer.close(index);
                //        layer.alert("接口请求失败!", { icon: 5 });
                //    }
                //});
                table.render({
                    elem: '#sy-table'
                    , url: GetWEBURL() + '/ProductInBillList/list1'
                    , toolbar: '#toolbarDemo'
                    , defaultToolbar: []
                    , where: { "BillType": sBillType, "HBillNo": HBillNo, "HSourceBillNo": HSourceBillNo }
                    , 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");
                    }
                });
                })
            });
            ////缓存列表
            //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: 80 }
                    , { field: 'HBillNo', title: '单据号', width: 80 }
                    , { field: 'HMaker', title: '制单人', width: 100 }
                    , { field: 'HMakeDate', title: '制单日期', width: 100 }
                    , { field: 'HQty', title: '数量', width: 100 }
                    , { field: 'HSourceBillNo', title: '源单单号', width: 100 }
                    , { field: 'HRedBlueFlag', title: '红蓝字', width: 100 }
                    , { 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({
@@ -412,18 +574,21 @@
                , toolbar: '#toolbarDemo'
                , defaultToolbar: []
                , 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: 80 }
                    , { field: 'HBillNo', title: '单据号', width: 80 }
                    , { field: 'HMaker', title: '制单人', width: 100 }
                    , { field: 'HMakeDate', title: '制单日期', width: 100 }
                    , { field: 'HMaterNumber', title: '物料代码', width: 100 }
                    , { field: 'HMaterName', title: '物料名称', width: 100 }
                    , { field: 'HMaterModel', title: '规格型号', width: 100 }
                    , { 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: 100 }
                    , { field: 'HOrgID', title: '组织', width: 100 }
                    , { field: 'HSourceBillNo', title: '源单单号', width: 150 }
                    , { field: 'HOrgID', title: '组织', width: 120 }
                ]]
                , height: 500
                , done: function () {
@@ -437,16 +602,16 @@
                , toolbar: '#toolbarDemo'
                , cols: [[
                    { type: 'radio' }
                    , { field: 'HInterID', title: '单据内码', width: 80 }
                    , { field: 'HBillNo', title: '单据号', width: 80 }
                    , { field: 'HMaker', title: '制单人', width: 100 }
                    , { field: 'HMakeDate', title: '制单日期', width: 100 }
                    , { field: 'HMaterNumber', title: '物料代码', width: 100 }
                    , { field: 'HMaterName', title: '物料名称', width: 100 }
                    , { field: 'HMaterModel', title: '规格型号', width: 100 }
                    , { 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: 100 }
                    , { field: 'HOrgID', title: '组织', width: 100 }
                    , { field: 'HSourceBillNo', title: '源单单号', width: 150 }
                    , { field: 'HOrgID', title: '组织', width: 120 }
                ]]
                , height: 500
            })
@@ -458,7 +623,7 @@
                //, toolbar: '#toolbarDemo'
                // , where: { sMsg: linterid, sMsg2: lentryid }
                , cols: [[
                    , { field: 'HMaterID', title: '物料ID', width: 100, hide: true }
                    , { field: 'HMaterID', title: '物料ID', width: 150, hide: true }
                ]]
                , page: true
                , height: 500