yusijie
2023-04-03 fc15aa9c6e6b31cbaf0f417fb4f693511f6ac418
WebTM/views/Éú²ú¹ÜÀí/Éú²úÈÎÎñµ¥/Sc_ICMOBillList.html
@@ -27,33 +27,56 @@
                                        <span>更多</span>
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label">开始日期</label>
                                    <div class="layui-input-block">
                                        <input type="date" class="layui-input" id="HDate">
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label">结束日期</label>
                                    <div class="layui-input-block">
                                        <input type="date" class="layui-input" id="HDate1">
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label">单据号</label>
                                    <div class="layui-input-block">
                                        <input type="text" class="layui-input" name="WorkCenter" id="WorkCenter">
                                    </div>
                                </div>
                                <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">重置</button>
                                <div class="layui-colla-content">
                                <div class="layui-row">
                                    <div class="layui-inline">
                                        <div class="layui-inline">
                                            <span>其他条件></span>
                                        <label class="layui-form-label">生产车间</label>
                                        <div class="layui-input-block">
                                            <select name="HDeptName" id="HDeptName" lay-verify="required" lay-search class="layui-input">
                                                <!--动态渲染车间-->
                                            </select>
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <label class="layui-form-label">业务状态</label>
                                        <div class="layui-input-block">
                                            <select name="HStatus" id="HStatus" lay-verify="required" lay-search class="layui-input">
                                                <!--  <option value="全部">全部</option>-->
                                                <option value="开工">开工</option>
                                                <option value="计划">计划</option>
                                                <option value="计划确认">计划确认</option>
                                                <option value="下达">下达</option>
                                                <option value="0">全部</option>
                                                <option value="完工">完工</option>
                                                <option value="结案">结案</option>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <label class="layui-form-label">是否下推生成流转卡</label>
                                        <div class="layui-input-block" style="margin-top:10px">
                                            <select name="HSF" id="HSF" lay-verify="required" lay-search class="layui-input">
                                                <!--  <option value="全部">全部</option>-->
                                                <option value="全部">全部</option>
                                                <option value="已下推">已下推</option>
                                                <option value="未下推"  selected="selected">未下推</option>
                                            </select>
                                        </div>
                                    </div>
                                </div>
                                <div class="layui-row">
                                    <div class="layui-inline">
                                        <label class="layui-form-label">开始日期</label>
                                        <div class="layui-input-block">
                                            <input type="date" class="layui-input" id="HDate">
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <label class="layui-form-label">结束日期</label>
                                        <div class="layui-input-block">
                                            <input type="date" class="layui-input" id="HDate1">
                                        </div>
                                    </div>
                                    <div class="layui-inline">
@@ -62,16 +85,87 @@
                                            <input type="text" class="layui-input" name="WorkCenter" id="WorkCenter">
                                        </div>
                                    </div>
                                    <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">重置</button>
                                </div>
                                <div class="layui-colla-content">
                                    <div class="layui-row">
                                        <div class="layui-inline">
                                            <label class="layui-form-label">单据类型</label>
                                            <div class="layui-input-block">
                                                <input type="text" class="layui-input" name="HBillType" id="HBillType">
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label">物料编码</label>
                                            <div class="layui-input-block">
                                                <input type="text" class="layui-input" name="HMaterName" id="HMaterName">
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label">唯一ID</label>
                                            <div class="layui-input-block">
                                                <input type="text" class="layui-input" name="HERPID" id="HERPID">
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row" style="margin-top:5px">
                                        <div class="layui-inline">
                                            <label class="layui-form-label">过滤</label>
                                            <div class="layui-input-block">
                                                <select name="ColName" id="ColName" lay-filter="ColName" style="width:190px;">
                                                </select>
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <select name="Comparator" id="Comparator" lay-filter="Comparator" style="width:190px;">
                                                <option value="0" selected="selected"></option>
                                                <option value="=">=</option>
                                                <option value=">=">>=</option>
                                                <option value=">">></option>
                                                <option value="<="><=</option>
                                                <option value="<"><</option>
                                                <option value="<>"><></option>
                                                <option value="7">包含</option>
                                                <option value="8">左包含</option>
                                                <option value="9">右包含</option>
                                                <option value="10">不包含</option>
                                            </select>
                                        </div>
                                        <div class="layui-inline">
                                            <input type="text" class="layui-input" value="" name="ColContent" id="ColContent">
                                        </div>
                                    </div>
                                    <div class="layui-row" style="margin-top:5px">
                                        <div class="layui-inline">
                                            <label class="layui-form-label">单据号</label>
                                            <div class="layui-input-block">
                                                <input type="text" class="layui-input" name="HBillno2" id="HBillno2" style="width:190px;">
                                            </div>
                                        </div>
                                        <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnResCnz" id="btnReSearch" style="padding:0 5px">重新同步</button>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <table class="" id="mainTable" lay-filter="mainTable"></table>
                        <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>
                                <button type="button" class="layui-btn layui-btn-lg" lay-event="set_ShowBill"><i class="layui-icon layui-icon-form"></i>下推</button>
                                <button type="button" class="layui-btn" lay-event="get_Refresh"><i class="layui-icon layui-icon-refresh-3"></i>刷新</button>
                                <button type="button" class="layui-btn" lay-event="get_Exit"><i class="layui-icon layui-icon-logout"></i>退出</button>
                                <button type="button" class="layui-btn" lay-event="set_HideColumn"><i class="layui-icon layui-icon-form"></i>列设置</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="set_ShowBill_pl"><i class="layui-icon layui-icon-form"></i>批量下推</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="set_AddNew"><i class="layui-icon layui-icon-file-b"></i>新增</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="set_Edit"><i class="layui-icon layui-icon-form"></i>编辑</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="set_AddNew_NT"><i class="layui-icon layui-icon-file-b"></i>新增(无列表)</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="set_Edit_NT"><i class="layui-icon layui-icon-form"></i>编辑(无列表)</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="set_DeleteBill"><i class="layui-icon layui-icon-delete"></i>删除</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="get_Refresh"><i class="layui-icon layui-icon-refresh-3"></i>刷新</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="get_Exit"><i class="layui-icon layui-icon-logout"></i>退出</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="set_Excel"><i class="layui-icon layui-icon-file-b"></i>Excel导入</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="get-view"><i class="layui-icon layui-icon-tips"></i>预览</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="get-print"><i class="layui-icon layui-icon-print"></i>打印</button>
                            </div>
                        </script>
                    </form>
@@ -101,11 +195,43 @@
            //var sWhere = " äº§å“ä»£ç  = 'BX0002'";
            var sWhere = "";
            var sWhere = "";
            var HModName = "Sc_ICMOBillList";
            var HDeptID = 0;
            var params = getUrlVars();
            var HDeptID = params[params[0]];
            //判断是否有参数传递
            //初始化表格
            DisPlay_HideColumn();
            //初始化界面
            set_ClearBill();
            //获取车间列
            var HDeptName = '<option value="0" style="color:red;" selected>全部车间</option>';
            $.ajax({
                type: "get",
                url: GetWEBURL() + "/Sc_ICMOBill/GetHDeptList",
                success: function (result) {
                    if (result.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                        var data = result.data;
                        for (var i = 0; i < data.length; i++) {
                            if (i == 0)
                                HDeptName += '<option  style="color:blue;"  value="' + data[i].HItemID + '" >' + data[i].HName + '</option>';
                            else
                                HDeptName += '<option  style="color:blue;" value="' + data[i].HItemID + '">' + data[i].HName + '</option>';
                        }
                        $("#HDeptName").append(HDeptName);
                        if (!isNaN(HDeptID)) {
                            $("#HDeptName").val(HDeptID);
                        }
                        form.render('select');
                    }
                    layer.closeAll("loading");
                }
            })
            //#endregion
@@ -113,10 +239,32 @@
            table.on('toolbar(mainTable)', function (obj) {
                switch (obj.event) {
                    //下推
                    case 'set_ShowBill': set_ShowBill();
                    case 'set_ShowBill': set_ShowBill();
                        break;
                    //批量下推
                    case 'set_ShowBill_pl': set_ShowBill_pl(); //set_ShowBill_pl
                        break;
                    //新增
                    case 'set_AddNew': set_AddNew();
                        break;
                    //编辑
                    case 'set_Edit': set_Edit();
                        break;
                    //新增(无列表)
                    case 'set_AddNew_NT': set_AddNew_NT();
                        break;
                    //编辑(无列表)
                    case 'set_Edit_NT': set_Edit_NT();
                        break;
                    //删除
                    case 'set_DeleteBill': set_DeleteBill();
                        break;
                    //导入
                    case 'set_Excel': set_Excel();
                        break;
                    case 'get-view': get_ViewReport();
                        break;
                    case 'get-print': get_PrintReport();
                        break;
                    //刷新
                    case 'get_Refresh': get_Refresh();
@@ -124,7 +272,20 @@
                    //退出按钮
                    case 'get_Exit': Pub_Close(2);
                        break;
                    //打印
                    case 'btn-print':
                        get_PrintReport();
                        break;
                    //列设置
                    case 'set_HideColumn':
                        get_HideColumn();
                        break;
                };
            });
            //重新同步按钮
            form.on('submit(btnResCnz)', function (data) {
                set_ResCnz();
            });
            //重置按钮
@@ -149,6 +310,87 @@
            //#endregion
            option_YQN = {
                elem: '#mainTable'
                , toolbar: '#toolbarDemo'
                , height: 'full-50'
                , page: true
                , cellMinWidth: 90
                , limit: 50
                , limits: [50, 500, 5000, 20000]
                , cols: [[
                    { type: 'checkbox', fixed: 'left' }
                    , { field: 'hmainid', title: 'hmainid', sort: true, width: 165, hide: true }
                    , { field: 'HEntryID', title: 'HEntryID', sort: true, width: 165, hide: true }
                    , { field: '日期', title: '日期', sort: true, width: 120, hide: true }
                    , { field: '销售订单日期', title: '销售订单日期', sort: true, width: 120, hide: true }
                    , { field: '单据号', title: '单据号', sort: true, width: 170, hide: true }
                    , { field: '销售订单日期', title: '销售订单日期', sort: true, width: 200 }
                    , { field: '销售订单编号', title: '销售订单编号', sort: true, width: 200 }
                    , { field: '销售物料名称', title: '销售物料名称', sort: true, width: 200 }
                    , { field: '包装方式', title: '包装方式', sort: true, width: 150 }
                    , { field: '销售数量', title: '销售数量', sort: true, width: 150 }
                    , { field: '销售订单联系人', title: '销售订单联系人', sort: true, width: 150 }
                    , { field: '业务状态', title: '业务状态', sort: true, width: 150 }
                    , { field: '订单跟踪号', title: '订单跟踪号', sort: true, width: 120, hide: true }
                    , { field: 'HDeptID', title: 'HDeptID', hide: true }
                    , { field: '生产车间代码', title: '生产车间代码', width: 115, hide: true }
                    , { field: '生产车间', title: '生产车间', width: 115, hide: true }
                    , { field: 'HMaterID', title: 'HMaterID', hide: true }
                    , { field: '产品代码', title: '产品代码', width: 160, hide: true }
                    , { field: '产品名称', title: '产品名称', width: 160, hide: true }
                    , { field: '规格型号', title: '规格型号', width: 215, hide: true }
                    , { field: 'hunitid', title: 'hunitid', hide: true }
                    , { field: '计量单位代码', title: '计量单位代码', width: 115, hide: true }
                    , { field: '计量单位', title: '计量单位', hide: true }
                    , { field: 'hempid', title: 'hempid', hide: true }
                    , { field: '业务员代码', title: '业务员代码', width: 100, hide: true }
                    , { field: '业务员', title: '业务员', hide: true }
                    , { field: 'hcusid', title: 'hcusid', hide: true }
                    , { field: '客户代码', title: '客户代码', hide: true }
                    , { field: '客户', title: '客户', hide: true }
                    , { field: 'HCenterID', title: 'HCenterID', hide: true }
                    , { field: '工作中心代码', title: '工作中心代码', hide: true }
                    , { field: '工作中心', title: '工作中心', hide: true }
                    , { field: 'hbomid', title: 'hbomid', hide: true }
                    , { field: 'BOM单编码', title: 'BOM单编码', hide: true }
                    , { field: 'HRoutingInterID', title: 'HRoutingInterID', hide: true }
                    , { field: '工艺路线代码', title: '工艺路线代码', hide: true }
                    , { field: '工艺路线', title: '工艺路线', hide: true }
                    , { field: '计划开工日期', title: '计划开工日期', hide: true }
                    , { field: '计划完工日期', title: '计划完工日期', hide: true }
                    , { field: '最迟开工日期', title: '最迟开工日期', hide: true }
                    , { field: '最迟完工日期', title: '最迟完工日期', hide: true }
                    , { field: '齐套数量', title: '齐套数量', hide: true }
                    , { field: '计划生产数量', title: '计划生产数量', hide: true }
                    , { field: '关联数量', title: '关联数量', hide: true }
                    , { field: '未关联数量', title: '未关联数量', hide: true }
                    , { field: '表头备注', title: '表头备注', hide: true }
                    , { field: 'hsubid', title: 'hsubid', hide: true }
                    , { field: '源单单号', title: '源单单号', hide: true }
                    , { field: '源单主内码', title: '源单主内码', hide: true }
                    , { field: '源单子内码', title: '源单子内码', hide: true }
                    , { field: '制单人', title: '制单人', hide: true }
                    , { field: '制单日期', title: '制单日期', hide: true }
                    , { field: '审核人', title: '审核人', hide: true }
                    , { field: '审核日期', title: '审核日期', hide: true }
                    , { field: '修改人', title: '修改人', hide: true }
                    , { field: '修改日期', title: '修改日期', hide: true }
                    , { field: '关闭人', title: '关闭人', hide: true }
                    , { field: '关闭日期', title: '关闭日期', hide: true }
                    , { field: '作废人', title: '作废人', hide: true }
                    , { field: '作废日期', title: '作废日期', hide: true }
                    , { field: '行关闭人', title: '行关闭人', hide: true }
                    , { field: '关闭类型', title: '关闭类型', hide: true }
                    , { field: '单据类型', title: '单据类型', hide: true }
                    , { field: '计划跟踪号', title: '计划跟踪号', hide: true }
                ]]
            };
            function set_InitGrid() {
                $("#HDate").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 30), "yyyy-MM-dd"));
                $("#HDate1").val(Format(new Date(), "yyyy-MM-dd"));
@@ -158,38 +400,28 @@
                    , height: 'full-50'
                    , page: true
                    , cellMinWidth: 90
                    , totalRow: true
                    , limit: 50
                    , limits: [50, 500, 5000, 20000]
                    , cols: [[
                        { type: 'checkbox', fixed: 'left' }
                        //{ field: 'hmainid', title: 'hmainid', sort: true, width: 165 }
                        , { field: '日期', title: '日期', sort: true, width: 120 }
                        { type: 'checkbox', fixed: 'left', totalRowText: '合计' }
                        , { field: 'hmainid', title: 'hmainid', sort: true, width: 165, hide: true }
                        , { field: 'HEntryID', title: 'HEntryID', sort: true, width: 165, hide: true }
                        , { field: '单据号', title: '单据号', sort: true, width: 170 }
                        , { field: '订单跟踪号', title: '订单跟踪号', width: 105 }
                        //, { field: 'HDeptID', title: 'HDeptID' }
                        , { field: '生产车间代码', title: '生产车间代码', width: 115 }
                        , { field: '生产车间', title: '生产车间', width: 115 }
                        //, { field: 'HMaterID', title: 'HMaterID' }
                        , { field: '状态', title: '状态', sort: true, width: 170 }
                        , { field: '唯一ID', title: '唯一ID', sort: true, width: 170 }
                        , { field: '是否下推生成流转卡', title: '是否下推生成流转卡', sort: true, width: 170 }
                        , { field: '日期', title: '日期' }
                        , { field: '产品代码', title: '产品代码', width: 160 }
                        , { field: '产品名称', title: '产品名称', width: 160 }
                        , { field: '规格型号', title: '规格型号', width: 215 }
                        //, { field: 'hunitid', title: 'hunitid' }
                        , { field: '生产车间代码', title: '生产车间代码', width: 115 }
                        , { field: '生产车间', title: '生产车间', width: 115 }
                        , { field: '生产任务单数量', title: '生产订单数量', width: 115, totalRow: true }
                        , { field: '包装标识代码', title: '包装标识代码', width: 115 }
                        , { field: '包装标识', title: '包装标识', width: 115 }
                        , { field: '计量单位代码', title: '计量单位代码', width: 115 }
                        , { field: '计量单位', title: '计量单位' }
                        //, { field: 'hempid', title: 'hempid' }
                        , { field: '业务员代码', title: '业务员代码', width: 100 }
                        , { field: '业务员', title: '业务员' }
                        , { field: 'hcusid', title: 'hcusid' }
                        , { field: '客户代码', title: '客户代码' }
                        , { field: '客户', title: '客户' }
                        //, { field: 'HCenterID', title: 'HCenterID' }
                        , { field: '工作中心代码', title: '工作中心代码' }
                        , { field: '工作中心', title: '工作中心' }
                        //, { field: 'hbomid', title: 'hbomid' }
                        , { field: 'BOM单编码', title: 'BOM单编码' }
                        //, { field: 'HRoutingInterID', title: 'HRoutingInterID' }
                        , { field: '工艺路线代码', title: '工艺路线代码' }
                        , { field: '工艺路线', title: '工艺路线' }
                        , { field: '计划开工日期', title: '计划开工日期' }
                        , { field: '计划完工日期', title: '计划完工日期' }
                        , { field: '最迟开工日期', title: '最迟开工日期' }
@@ -199,10 +431,6 @@
                        , { field: '关联数量', title: '关联数量' }
                        , { field: '未关联数量', title: '未关联数量' }
                        , { field: '表头备注', title: '表头备注' }
                        //, { field: 'hsubid', title: 'hsubid' }
                        , { field: '源单单号', title: '源单单号' }
                        , { field: '源单主内码', title: '源单主内码' }
                        , { field: '源单子内码', title: '源单子内码' }
                        , { field: '制单人', title: '制单人' }
                        , { field: '制单日期', title: '制单日期' }
                        , { field: '审核人', title: '审核人' }
@@ -211,12 +439,43 @@
                        , { field: '修改日期', title: '修改日期' }
                        , { field: '关闭人', title: '关闭人' }
                        , { field: '关闭日期', title: '关闭日期' }
                        , { field: '作废人', title: '作废人' }
                        , { field: '作废日期', title: '作废日期' }
                        , { field: '行关闭人', title: '行关闭人' }
                        , { field: '关闭类型', title: '关闭类型' }
                        , { field: '单据类型', title: '单据类型' }
                        , { field: '计划跟踪号', title: '计划跟踪号' }
                        //, { field: '作废人', title: '作废人', hide: true }
                        //, { field: '作废日期', title: '作废日期', hide: true }
                        //, { field: '销售订单日期', title: '销售订单日期', sort: true, width: 120, hide: true }
                        , { field: '销售订单日期', title: '销售订单日期', sort: true, width: 200 }
                        , { field: '销售订单编号', title: '销售订单编号', sort: true, width: 200 }
                        , { field: '销售物料名称', title: '销售物料名称', sort: true, width: 200 }
                        , { field: '包装方式', title: '包装方式', sort: true, width: 150 }
                        , { field: '销售数量', title: '销售数量', sort: true, width: 150 }
                        , { field: '销售订单联系人', title: '销售订单联系人', sort: true, width: 150 }
                        , { field: '业务状态', title: '业务状态', sort: true, width: 150 }
                        //, { field: '订单跟踪号', title: '订单跟踪号', sort: true, width: 120, hide: true }
                        //, { field: 'HDeptID', title: 'HDeptID', hide: true}
                        //, { field: 'HMaterID', title: 'HMaterID', hide: true }
                        //, { field: 'hunitid', title: 'hunitid', hide: true }
                        //, { field: 'hempid', title: 'hempid' , hide: true}
                        //, { field: '业务员代码', title: '业务员代码', width: 100, hide: true}
                        //, { field: '业务员', title: '业务员', hide: true}
                        //, { field: 'hcusid', title: 'hcusid', hide: true }
                        //, { field: '客户代码', title: '客户代码', hide: true }
                        //, { field: '客户', title: '客户', hide: true }
                        //, { field: 'HCenterID', title: 'HCenterID' , hide: true}
                        //, { field: '工作中心代码', title: '工作中心代码', hide: true}
                        //, { field: '工作中心', title: '工作中心', hide: true}
                        //, { field: 'hbomid', title: 'hbomid' , hide: true}
                        //, { field: 'BOM单编码', title: 'BOM单编码', hide: true }
                        //, { field: 'HRoutingInterID', title: 'HRoutingInterID' , hide: true}
                        , { field: '工艺路线代码', title: '工艺路线代码'}
                        , { field: '工艺路线', title: '工艺路线'}
                        //, { field: 'hsubid', title: 'hsubid' , hide: true}
                        //, { field: '源单单号', title: '源单单号', hide: true}
                        //, { field: '源单主内码', title: '源单主内码', hide: true}
                        //, { field: '源单子内码', title: '源单子内码', hide: true}
                        //, { field: '行关闭人', title: '行关闭人', hide: true}
                        //, { field: '关闭类型', title: '关闭类型', hide: true}
                        //, { field: '单据类型', title: '单据类型', hide: true}
                        //, { field: '计划跟踪号', title: '计划跟踪号', hide: true}
                    ]]
                };
            }
@@ -234,7 +493,11 @@
                            option.data = data1.data;
                            table.render(option);
                            layer.close(ajaxLoad);
                            //layer.alert("查询成功", { icon: 1 });
                            if ($("#Comparator").val() == 0 && $("#ColContent").val() == "") {
                                ColFilter();
                            }
                            layer.close(ajaxLoad);
                        } else {
                            layer.close(ajaxLoad);
                            layer.alert(data1.code + data1.Message, { icon: 5 });
@@ -250,10 +513,61 @@
            //#region å¿«é€Ÿè¿‡æ»¤
            function get_FastQuery() {
                var HDate = $("#HDate").val();//开始日期
                var HDate =  $("#HDate").val();;//开始日期
                var HDate1 = $("#HDate1").val();//结束日期
                var HOrderProcNO = $("#HOrderProcNO").val();//订单跟踪号
                var WorkCenter = $("#WorkCenter").val();//单据号
                var HMaterName = $("#HMaterName").val();//单据号
                var HErpID = $("#HERPID").val();//唯一标识
                var HDeptName = $("#HDeptName").val();//单据号
                var HStatus = $("#HStatus").val();//单据号
                var HBillType = $("#HBillType").val();//单据类型
                var HSF = $("#HSF").val();//单据类型
                var ColName = $("#ColName").val();//复选框
                var Comparator = $("#Comparator").val()
                var ColContent = $("#ColContent").val();
                if (ColName != 0 && Comparator != 0) {
                    var com = "";
                    switch (Comparator) {
                        case "7":
                            com = "like'%" + ColContent + "%'";
                            break;
                        case "8":
                            com = "like'%" + ColContent + "'";
                            break;
                        case "9":
                            com = "like'" + ColContent + "%'";
                            break;
                        case "10":
                            com = "not like'%" + ColContent + "%'";
                            break;
                        default:
                            com = "" + Comparator + "'" + ColContent + "'";
                            break;
                    }
                    sWhere += " and " + ColName + " " + com;
                }
                //传递的参数不为NAN
                if (!isNaN(HDeptID) && HDeptName==0) {
                    HDeptName = HDeptID;
                }
                if (!isNaN(HDeptID)) {
                    HStatus = "开工";
                }
                if (HSF) {//判断打印状态
                    if (HSF == "全部") {
                        sWhere += "";
                    }
                    if (HSF == "已下推") {
                        sWhere += " and æ˜¯å¦ä¸‹æŽ¨ç”Ÿæˆæµè½¬å¡ like '%" + HSF + "%' ";
                    }
                    if (HSF == "未下推") {
                        sWhere += " and æ˜¯å¦ä¸‹æŽ¨ç”Ÿæˆæµè½¬å¡ like '%" + HSF + "%' ";
                    }
                }
                if (HDate) {
                    sWhere += " and æ—¥æœŸ >= '" + HDate + "'";
                }
@@ -266,6 +580,24 @@
                if (WorkCenter) {
                    sWhere += " and å•据号 like '%" + WorkCenter + "%'";
                }
                if (HMaterName) {
                    sWhere += " and äº§å“ä»£ç  like '%" + HMaterName + "%'";
                }
                if (HDeptName && HDeptName!=0) {
                    sWhere += " and HDeptID = " + HDeptName ;
                }
                if (HStatus && HStatus != 0) {
                    sWhere += " and çŠ¶æ€  like '%" + HStatus + "%'";
                }
                if (HBillType) {
                    sWhere += " and å•据类型 like '%" + HBillType + "%'";
                }
                if (HErpID) {
                    sWhere += " and å”¯ä¸€ID like '%" + HErpID + "%'";
                }
                //if (HSF) {
                //    sWhere += " and æ˜¯å¦ä¸‹æŽ¨ç”Ÿæˆæµè½¬å¡ like '%" + HSF + "%'";
                //}
                get_Display(sWhere);
                sWhere = "";//调用接口后清空sWhere缓存
            }
@@ -273,11 +605,19 @@
            //#region é‡ç½®è¿‡æ»¤æ¡ä»¶æ–¹æ³•
            function set_ClearQuery() {
                $("#HDate").val("");//开始日期
                $("#HDate1").val("");//结束日期
                $("#HDate").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 30), "yyyy-MM-dd"));//开始日期
                $("#HDate1").val(Format(new Date(), "yyyy-MM-dd"));;//结束日期
                $("#HOrderProcNO").val("");//订单跟踪号
                $("#WorkCenter").val("");//单据号
                $("#HDeptName").val("");//单据号
                $("#HMaterName").val("");//单据号
                $("#HDeptName").val("");//单据号
                $("#HStatus").val("");//单据号
                $("#btnSearch").click();
                $("#ColContent").val("");
                $("#ColName").val("0");
                $("#Comparator").val("0");
                form.render('select');
                sWhere = "";
            }
            //#endregion
@@ -302,21 +642,121 @@
            //        layer.alert("接口请求失败!", { icon: 5 });
            //    }
            //});
            //编辑单据
            //下推单据
            function set_ShowBill() {
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;
                if (data.length === 1) {
                    var linterid = data[0].hmainid.toString();
                    var HEntryID = data[0].HEntryID.toString();
                    layer.open({
                        type: 2
                        , area: ['100%', '100%']
                        , title: '工序流转卡-编辑'
                        , shift: 0//弹出动画
                        , content: '../../车间管理/工序流转卡/Sc_ProcessExchangeBill.html?OperationType=2&linterid=' + linterid + '&HSouceBillType=3772'
                        , content: '../../车间管理/工序流转卡/Sc_ProcessExchangeBill.html?OperationType=2&linterid=' + linterid + '&HEntryID=' + HEntryID+'&HSouceBillType=3772'
                    })
                } else {
                    layer.msg('请选择一行数据下推!');
                }
            }
            //批量下推单据
            function set_ShowBill_pl() {
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;
                if (data.length === 1) {
                    var linterid = data[0].hmainid.toString();
                    var HEntryID = data[0].HEntryID.toString();
                    layer.open({
                        type: 2
                        , area: ['100%', '100%']
                        , title: '工序流转卡-编辑'
                        , shift: 0//弹出动画
                        , content: '../../车间管理/工序流转卡/Sc_ProcessExchangeBill_Mul.html?OperationType=2&linterid=' + linterid + '&HEntryID=' + HEntryID + '&HSouceBillType=3772'
                    })
                } else {
                    layer.msg('请选择一行数据下推!');
                }
            }
            //新增
            function set_AddNew() {
                layer.open({
                    type: 2
                    , skin: 'layui-layer-rim' //加上边框
                    , area: ['100%', '100%']
                    , title: '生产订单新增'
                    , shift: 0//弹出动画
                    , content: '../生产任务单/Sc_ICMOBillEdit.html?OperationType=1&linterid='
                    , end: function () {
                        //刷新页面,
                        location.reload();
                    }
                })
            }
            // ç¼–辑
            function set_Edit() {
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;
                if (checkStatus.data.length === 1) {
                    var linterid = data[0].hmainid;
                    layer.open({
                        type: 2
                        , area: ['100%', '100%']
                        , title: '生产订单编辑'
                        , shift: 0//弹出动画
                        , content: '../生产任务单/Sc_ICMOBillEdit.html?OperationType=3&linterid=' + linterid +''
                        , end: function () {
                            //刷新页面,
                            location.reload();
                        }
                    })
                } else {
                    layer.msg('请选择一行数据编辑!');
                }
            }
            //新增(无列表)
            function set_AddNew_NT() {
                layer.open({
                    type: 2
                    , skin: 'layui-layer-rim' //加上边框
                    , area: ['100%', '100%']
                    , title: '生产订单新增'
                    , shift: 0//弹出动画
                    , content: '../生产任务单/Sc_ICMOBillEdit_NoTable.html?OperationType=1&linterid=&HEntryID=1'
                    , end: function () {
                        //刷新页面,
                        location.reload();
                    }
                })
            }
            // ç¼–辑(无列表)
            function set_Edit_NT() {
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;
                if (checkStatus.data.length === 1) {
                    var linterid = data[0].hmainid;
                    var HEntryID = data[0].hsubid;
                    layer.open({
                        type: 2
                        , area: ['100%', '100%']
                        , title: '生产订单编辑'
                        , shift: 0//弹出动画
                        , content: '../生产任务单/Sc_ICMOBillEdit_NoTable.html?OperationType=3&linterid=' + linterid + '&HEntryID=' + HEntryID
                        , end: function () {
                            //刷新页面,
                            location.reload();
                        }
                    })
                } else {
                    layer.msg('请选择一行数据编辑!');
                }
            }
@@ -360,12 +800,52 @@
            }
            //#endregion
            //laydate.render({
            //    elem: '#HDate'
            //    , type: 'datetime'
            //    , trigger: 'click'
            //    , format:'yyyy-MM-dd HH:mm'
            //});
            //导入
            function set_Excel() {
                layer.open({
                    type: 2
                    , skin: 'layui-layer-rim' //加上边框
                    , area: ['100%', '100%']
                    , title: '生产订单导入'
                    , shift: 0//弹出动画
                    , content: '../生产任务单/Sc_ICMOBillImport.html?OperationType=1'
                    , end: function () {
                        //刷新页面,
                        location.reload();
                    }
                })
            }
            //重新同步按钮
            function set_ResCnz() {
                var HBillno2 = $('#HBillno2').val();
                $.ajax({
                    url: GetWEBURL() + '/Sc_ICMOBill/Sc_ICMOBillViewApi',
                    type: "GET",
                    data: { "BillNo": HBillno2, "BillType": 3710 },
                    success: function (result) {
                        if (result.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.alert(result.code + result.Message, { icon: 5 });
                        }
                    }, error: function () {
                        layer.close(wait);
                        layer.alert("接口请求失败!", { icon: 5 });
                    }
                });
            }
            //#endregion
            //#region åˆ·æ–°
            function get_Refresh() {
                set_ClearQuery();
@@ -373,11 +853,208 @@
            }
            //#endregion
            //#region æ‰“印
            //预览
            function get_ViewReport() {
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;
                var PrintIds = "";
                if (checkStatus.data.length >= 1) {
                    for (var i = 0; i < data.length; i++) {
                        PrintIds += data[i].hmainid+"0"+data[i].HEntryID + ","
                    }
                    PrintIds = PrintIds.substring(0, PrintIds.length - 1);
                    layer.open({
                        type: 2
                        , area: ['50%', '50%']
                        , title: '打印模版选择'
                        , shade: 0.6 //遮罩透明度
                        , maxmin: false //允许全屏最小化
                        , anim: 0 //0-6的动画形式,-1不开启
                        , content: ['../../BaseSet/SRM_OpenTmpList.html?linterid=' + PrintIds + '&MyMsg=' + data[0].hmainid.toString() + '&Type=HIcmoBill', 'yes']
                        , resize: false
                    })
                }
                else {
                    layer.msg('请选择至少一行数据打印!');
                }
            }
            //打印
            function get_PrintReport() {
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;
                var PrintIds = "";
                if (checkStatus.data.length >= 1) {
                    for (var i = 0; i < data.length; i++) {
                        PrintIds += data[i].hmainid + "-" + data[i].HEntryID + ","
                    }
                    PrintIds = PrintIds.substring(0, PrintIds.length - 1);
                    layer.open({
                        type: 2
                        , area: ['50%', '50%']
                        , title: '打印模版选择'
                        , shade: 0.6 //遮罩透明度
                        , maxmin: false //允许全屏最小化
                        , anim: 0 //0-6的动画形式,-1不开启
                        , content: ['../../BaseSet/SRM_OpenTmpList.html?linterid=' + PrintIds + '&MyMsg=' + data[0].hmainid.toString() + '&Type=HIcmoBill', 'yes']
                        , resize: false
                    })
                }
                else {
                    layer.msg('请选择至少一行数据打印!');
                }
            }
            //隐藏列设置
            function get_HideColumn() {
                var colName = "";
                var contentUrl = "";
                for (var i = 1; i < option.cols[0].length - 1; i++) {
                    colName += option.cols[0][i]["title"] + ",";
                }
                var urlStr = window.document.location.pathname;//获取文件路径
                var urlLen = urlStr.split('/');
                for (var i = 0; i < urlLen.length - 4; i++) {
                    contentUrl += "../";
                }
                colName = encodeURI(colName.substring(0, colName.length - 1));//对 URI è¿›è¡Œç¼–码
                contentUrl += '基础资料/隐藏列设置/Gy_GridView_Hide.html?HModName=' + HModName + '&colName=' + colName;
                layer.open({
                    type: 2
                    , skin: "layui-layer-rim" //加上边框
                    , title: "隐藏列设置"  //标题
                    , closeBtn: 1  //窗体右上角关闭 çš„ æ ·å¼
                    , shift: 2 //弹出动画
                    , area: ["50%", "90%"] //窗体大小
                    , maxmin: true //设置最大最小按钮是否显示
                    , content: [contentUrl, "yes"]
                    , btn: ["确定", "取消"]
                    , btn1: function (index, laero) {
                        //刷新表格数据
                        DisPlay_HideColumn();
                        //更新表格缓存的数据
                        layer.close(index);//关闭弹窗
                    }
                })
            }
            //显示列数据
            function DisPlay_HideColumn() {
                $.ajax({
                    url: GetWEBURL() + '/Xt_grdAlignment_WMES/grdAlignmentWMESList',
                    type: "GET",
                    data: { "HModName": HModName, "user": sessionStorage["HUserName"] },
                    success: function (data1) {
                        if (data1.data.length != 0) {
                            var dataCol = [];//数据库查询出的列数据
                            var titleData = ["hmainid", "HEntryID", "作废人", "作废日期", "销售订单日期", "订单跟踪号", "HDeptID", "HMaterID", "hunitid", "hempid", "业务员代码", "业务员", "hcusid", "客户代码", "客户", "HCenterID", "工作中心代码", "工作中心", "hbomid", "BOM单编码", "HRoutingInterID", "工艺路线代码", "工艺路线", "hsubid", "源单单号", "源单主内码", "源单子内码", "行关闭人", "关闭类型", "单据类型", "计划跟踪号"];//不需要显示的字段 å¯æ‰©å±•
                            dataCol = data1.data[0].HGridString.split(',');
                            for (var i = 0; i < option.cols[0].length - 2; i++) {
                                if (dataCol[i]) {
                                    var dataCols = dataCol[i].split('|');
                                }
                                //隐藏列
                                if (dataCols[1] == 1) {
                                    option.cols[0][i + 1]["hide"] = true;
                                }
                                //设置列宽
                                if (dataCols[3] > 0) {
                                    option.cols[0][i + 1]["width"] = dataCols[3];
                                }
                                //设置内容字体大小
                                if (data1.data[0].HFontSize != 0) {
                                    option.cols[0][i + 1]["style"] = "font-size:" + data1.data[0].HFontSize + "px;";
                                } else {
                                    option.cols[0][i + 1]["style"] = "font-size:100%";
                                }
                                //设置列宽
                                //if (data1.data[0].HColumnWidth != 0) {
                                //    option.cols[0][i + 1]["width"] = data1.data[0].HColumnWidth + "px;";
                                //} else {
                                //    option.cols[0][i + 1]["width"] = "";
                                //}
                                //显示列
                                if (dataCols[1] == 0 && $.inArray(option.cols[0][i + 1]["title"], titleData) == -1) {
                                    option.cols[0][i + 1]["hide"] = false;
                                }
                                //字体所在位置(å·¦ å±…中 å³)
                                switch (dataCols[2]) {
                                    case "L":
                                        option.cols[0][i + 1]["align"] = "left";
                                        break;
                                    case "M":
                                        option.cols[0][i + 1]["align"] = "center";
                                        break;
                                    case "R":
                                        option.cols[0][i + 1]["align"] = "right";
                                        break;
                                }
                            }
                            //取消冻结列
                            for (var i = 1; i < option.cols[0].length - 1; i++) {
                                if (option.cols[0][i]["fixed"] != null) {
                                    option.cols[0][i]["fixed"] = null;
                                }
                                else {
                                    break;
                                }
                            }
                            //冻结列
                            if (data1.data[0].HFixCols != 0) {
                                for (var i = 0; i < data1.data[0].HFixCols; i++) {
                                    if ($.inArray(option.cols[0][i + 1]["title"], titleData) != -1) {
                                        data1.data[0].HFixCols += 1;
                                    }
                                    option.cols[0][i + 1]["fixed"] = "left";
                                }
                            }
                            table.render(option);
                        } else {
                            table.render(option);
                        }
                    }, error: function () {
                        layer.alert("接口请求失败!", { icon: 5 });
                    }
                })
            }
            //列明显示下拉框
            function ColFilter() {
                var Organization = '<option  value="0" selected="selected" ></option>';
                for (var i = 1; i < option.cols[0].length; i++) {
                    if (option.cols[0][i].hide != true) {
                        Organization += '<option  style="color:blue;" value="' + option.cols[0][i].field + '">' + option.cols[0][i].field + '</option>';
                    }
                }
                $("#ColName").empty();
                $("#ColName").append(Organization);
                form.render('select');
            }
            //获取参数
            function getUrlVars() {
                var vars = [], hash;
                var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
                for (var i = 0; i < hashes.length; i++) {
                    hash = hashes[i].split('=');
                    vars.push(hash[0]);
                    vars[hash[0]] = hash[1];
                }
                return vars;
            }
            //#endregion
            //以上是layui模块
        });
    </script>