duhe
2024-09-26 92b75271be9decbafcd988c6125f16821cd5e111
生产订单:分页
2个文件已修改
175 ■■■■■ 已修改文件
WebTM/Properties/PublishProfiles/JFTM.pubxml.user 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/生产管理/生产任务单/Sc_ICMOBillList.html 173 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/Properties/PublishProfiles/JFTM.pubxml.user
@@ -4731,7 +4731,7 @@
      <publishTime>04/11/2023 16:34:43</publishTime>
    </File>
    <File Include="views/生产管理/生产任务单/Sc_ICMOBillList.html">
      <publishTime>09/19/2024 10:08:59</publishTime>
      <publishTime>09/26/2024 14:47:33</publishTime>
    </File>
    <File Include="views/生产管理/生产任务单/Sc_ICMOBillList_LookDown.html">
      <publishTime>03/07/2024 10:26:24</publishTime>
WebTM/views/Éú²ú¹ÜÀí/Éú²úÈÎÎñµ¥/Sc_ICMOBillList.html
@@ -96,10 +96,10 @@
                                            <input type="text" class="layui-input ForFilteringSchemes" name="WorkCenter" id="WorkCenter">
                                        </div>
                                    </div>
                                    <button class="layui-btn layuiadmin-btn-order" style="display:none;" type="button" lay-submit="" lay-filter="btnSearch" id="btnSearch">
                                    <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearch" id="btnSearch">
                                        <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                                    </button>
                                    <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnReSearch" id="btnReSearch" style="padding:0 5px;display:none;">重置</button>
                                    <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnReSearch" id="btnReSearch" style="padding:0 5px;">重置</button>
                                    <div class="layui-inline">
@@ -255,6 +255,7 @@
                            </div>
                        </div>
                        <table class="" id="mainTable" lay-filter="mainTable"></table>
                        <div id="page" style="margin-top:70px;"></div>
                        <script type="text/html" id="toolbarDemo">
                            <!--<div class="layui-btn-container">
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="set_ShowBill"><i class="layui-icon layui-icon-form"></i>下推</button>
@@ -342,6 +343,11 @@
                , laypage = layui.laypage
                , laydate = layui.laydate
                , soulTable = layui.soulTable
            var Organization = sessionStorage["Organization"];
            var sWhere = "";
            var sWhere = "";
            var HModName = "Sc_ICMOBillList";
@@ -350,6 +356,10 @@
            var params = getUrlVars();
            var HDeptID = params[params[0]];
            var option = [];
            var page = 1;//分页数据
            var size = 50;
            var ins;                        //用于导出excel
            var titleData = ["hmainid", "HEntryID", "作废人", "作废日期", "销售订单日期", "订单跟踪号", "HDeptID", "HMaterID", "hunitid", "hempid", "业务员代码", "业务员", "hcusid", "客户代码", "客户", "HCenterID", "工作中心代码", "工作中心", "hbomid", "BOM单编码", "HRoutingInterID", "工艺路线代码", "订单包装备注", "hsubid", "源单单号", "源单主内码", "源单子内码", "行关闭人", "关闭类型", "单据类型", "计划跟踪号"];//不需要显示的字段 å¯æ‰©å±•
            //var titleData = ["hmainid", "HEntryID", "作废人", "作废日期", "销售订单日期", "订单跟踪号", "HDeptID", "HMaterID", "hunitid", "hempid", "业务员代码", "业务员", "hcusid", "客户代码", "客户", "HCenterID", "工作中心代码", "工作中心", "hbomid", "BOM单编码", "HRoutingInterID", "工艺路线代码", "工艺路线", "订单包装备注", "hsubid", "源单单号", "源单主内码", "源单子内码", "行关闭人", "关闭类型", "单据类型", "计划跟踪号"];//不需要显示的字段 å¯æ‰©å±•
@@ -558,16 +568,29 @@
            form.on('submit(btnReSearch)', function (data) {
                set_ClearQuery();
                if (page != 1) {
                    $("#page a:eq(1)").get(0).click();//点击分页栏第一页
                } else {
                    if ($("#HProject").val() == 0) {
                        get_FastQuery(2);
                    } else {
                        get_FastQuery(3);
                    }
                }
            });
            //查询按钮
            form.on('submit(btnSearch)', function (data) {//选择仓位
                if ($("#HProject").val() == 0) {
                    get_FastQuery(2);
                if (page != 1) {
                    $("#page a:eq(1)").get(0).click();//点击分页栏第一页
                } else {
                    get_FastQuery(3);
                    if ($("#HProject").val() == 0) {
                        get_FastQuery(2);
                    } else {
                        get_FastQuery(3);
                    }
                }
            });
            //#region æ—¥æœŸé—´éš”下拉列表监听
@@ -758,12 +781,12 @@
                option = {
                    elem: '#mainTable'
                    , toolbar: '#toolbarDemo'
                    , height: 'full-50'
                    , page: true
                    , height: 'full-80'
                    //, page: true
                    , cellMinWidth: 'auto'
                    , totalRow: true
                    , limit: 50
                    , limits: [50, 500, 5000, 20000]
                    //, limits: [50, 500, 5000, 20000]
                    , done: function (res, curr, count) {
                        soulTable.render(this);
                    }
@@ -855,6 +878,33 @@
                        , { field: '物料分类', title: '物料分类', sort: true }
                    ]]
                };
                optionPage = {
                    elem: 'page', //注意,这里的 page æ˜¯ ID,不用加 # å·
                    count: 10000, //数据总数,从服务端得到
                    limit: 50,
                    limits: [50, 500, 5000, 50000],
                    layout: ['count', 'prev', 'page', 'next', 'limit', 'skip'],
                    jump: function (obj, first) {
                        //console.log(obj)
                        //obj包含了当前分页的所有参数,比如:
                        //console.log(obj.curr); //得到当前页,以便向服务端请求对应页的数据。
                        //console.log(obj.limit); //得到每页显示的条数
                        //首次不执行
                        if (!first) {
                            //do something
                            console.log(obj)
                            page = obj.curr;
                            size = obj.limit;
                            get_FastQuery();
                        }
                    }
                }
                laypage.render(optionPage);
            }
            //#endregion  ç›‘听网格表体事件
            table.on('tool(mainTable)', function (obj) {
@@ -1028,6 +1078,105 @@
            }
            //#endregion
            //#region æŸ¥è¯¢-分页
            function get_DisplayPage(sWhere) {
                var wait = layer.load();//遮罩
                var ajaxLoad = layer.load();
                sWhere += " and HPRDORGID=" + sessionStorage["OrganizationID"] + " ";
                $.ajax({
                    url: GetWEBURL() + '/LEMS/MES_IF_ICMOBillList_Json_byPage',
                    type: "GET",
                    async: false,
                    data: { "sWhere": sWhere, "user": sessionStorage["HUserName"], "Organization": Organization, "page": page, "size": size },
                    success: function (data1) {
                        option.limit = size;//改变表格页大小
                        if (data1.count != 0) {
                            optionPage.count = data1.count;//改变列表数据总数
                            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 });
                                //获取不需要显示的列(H开头的列不显示)
                                var patrn = new RegExp(/^h/i);
                                if (patrn.test(data1.list[key].ColmCols)) {
                                    titleData[key] = data1.list[key].ColmCols;
                                }
                            }
                            //在列表左边添加勾选框
                            col.push({ type: 'checkbox', fixed: 'left', totalRowText: '合计行' });
                            for (var i = 0; i < data.length; i++) {
                                // if (data[i].name == 'HInterID' || data[i].name == 'HBillType' || data[i].name == 'hmainid') {
                                if ($.inArray(data[i].name, titleData) > -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')}}</div>", width: 200 });
                                            break;
                                        case 'long':
                                        case 'Int32':
                                        case 'Int64':
                                        case 'double':
                                        case 'Decimal':
                                            col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 120, totalRow: true });
                                            break;
                                        default:
                                            col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 200 });
                                    }
                                }
                            }
                            //动态显示列名
                            option = {
                                elem: '#mainTable'
                                , toolbar: '#toolbarDemo'
                                , totalRow: true
                                , cols: [col]
                                , data: data1.data
                                , height: 'full-120'
                                //, page: true
                                //, limits: [50, 500, 5000, 50000]
                                , limit: 500
                                , cellMinWidth: 90
                                , done: function (res, curr, count) {
                                    soulTable.render(this);
                                }
                            }
                            ins = table.render(option);
                            laypage.render(optionPage);
                            //刷新表格数据
                            DisPlay_HideColumn();
                            //刷新按钮显示
                            var btns = document.getElementsByTagName("button");     //获取本页所有按钮对象
                            var HBillType = "3710";
                            Display_HideButton(btns, HBillType, HModName, sessionStorage["HUserName"]);
                            if ($("#Comparator").val() == 0 && $("#ColContent").val() == "" && $("#Comparator1").val() == 0 && $("#ColContent1").val() == "" && $("#Comparator2").val() == 0 && $("#ColContent2").val() == "") {
                                ColFilter();
                            }
                            layer.close(ajaxLoad);
                        } else {
                            option.data = [];
                            table.render(option);
                            layer.close(ajaxLoad);
                            /*layer.alert(data1.code + data1.Message, { icon: 5 });*/
                        }
                    }, error: function () {
                        layer.close(ajaxLoad);
                        layer.alert("接口请求失败!", { icon: 5 });
                    }
                });
                layer.close(wait);
            }
            //#endregion
            //#region å¿«é€Ÿè¿‡æ»¤
            function get_FastQuery(number) {
                var HDate = $("#HDate").val();;//开始日期
@@ -1188,7 +1337,10 @@
                //根据用户过滤用户关联客户的记录
                sWhere += getSWhereByHUser();
                get_Display(sWhere);
                //get_Display(sWhere);
                get_DisplayPage(sWhere);
                sWhere = "";//调用接口后清空sWhere缓存
                GetDataCols = "";
            }
@@ -2464,6 +2616,7 @@
                $.ajax({
                    url: GetWEBURL() + '/Xt_FastICScheme/Chooselist',
                    type: "GET",
                    async: false,
                    data: { "user": sessionStorage["Czybm"], "HModuleName": HModuleName, "HInterID": 0, "Type": "Default" },
                    success: function (data1) {
                        if (data1.count == 1) {