yangle
2024-03-25 c4e556a509b7fd8084a4aee8f4221158bac6cd3a
WebTM/views/²É¹º¹ÜÀí/²É¹º¶©µ¥/Cg_POOrderBillList.html
@@ -17,7 +17,7 @@
    <script src="../../../layuiadmin/zgqCustom/zgqCustom.js"></script>
    <script src="../../../layuiadmin/HideButton.js"></script>
    <script src="../../../layuiadmin/soulTable.slim.js"></script>
    <!--<script src="../../../layuiadmin/PageTitle.js"></script>-->
    <script src="../../../layuiadmin/PageTitle.js"></script>
</head>
<body>
    <div class="layui-fluid">
@@ -226,10 +226,13 @@
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-view" id="view"><i class="layui-icon layui-icon-tips"></i>预览</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-print" id="print"><i class="layui-icon layui-icon-print"></i>打印</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="get_Refresh" id="Refresh"><i class="layui-icon layui-icon-refresh-3"></i>刷新</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Audit" id="CheckBill"><i class="layui-icon layui-icon-radio"></i>审核</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-DeAudit" id="AbandonCheck"><i class="layui-icon layui-icon-circle"></i>反审核</button>
                                <button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="btn-PushPOInStockBills" id="btn-PushPOInStockBills"><i class="layui-icon layui-icon-delete"></i>多行下推(收料通知单)</button>
                                <button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="set_CheckBill" id="CheckBill"><i class="layui-icon layui-icon-form"></i>审核</button>
                                <button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="set_AbandonCheck" id="AbandonCheck"><i class="layui-icon layui-icon-form"></i>反审核</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Close" id="Close"><i class="layui-icon layui-icon-radio"></i>关闭</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-DeClose" id="DeClose"><i class="layui-icon layui-icon-radio"></i>反关闭</button>
                                <button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="set_CloseRow" id="set_CloseRow"><i class="layui-icon layui-icon-form"></i>行关闭</button>
                                <button type="button" class="layui-btn layui-btn-sm" style="display:none;" lay-event="set_CancelCloseRow" id="set_CancelCloseRow"><i class="layui-icon layui-icon-form"></i>行反关闭</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Drop" id="Drop"><i class="layui-icon layui-icon-radio"></i>作废</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-DeDrop" id="DeDrop"><i class="layui-icon layui-icon-radio"></i>反作废</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="set_HideColumn" id="HideColumn"><i class="layui-icon layui-icon-form"></i>列设置</button>
@@ -266,14 +269,17 @@
            var option = [];
            var Name = "MouldProdInHouseCellWidth";
            var HModName = "Cg_POOrderBillList";
        var HBillType = "1102";
            //#region ã€åŠ¨æ€èŽ·å–æ¨¡å—åç§°ã€‘
            var HModuleType = "1102";
            //通过单据类型,从数据库动态获取单据模块命名
            var HPageTitle = "";
            get_PageTitle(HModuleType);
            //通过单据类型,从数据库动态获取单据模块命名,引用js文件 PageTitle.js
            var HPageTitle = get_PageTitle(HModuleType) == "" ? document.title : get_PageTitle(HModuleType);
            //#endregion
            //不需要显示的字段 å¯æ‰©å±•
            var titleData = ["hmainid","HBillType", "HSupID", "HPSStyleID", "HSSID", "HCurID", "HDeptID", "HManagerID", "HEmpID", "hsubid", "HMaterID", "HUnitID",
                "HFeedback", "HPriority", "HUserID"];
                "HFeedback", "HPriority", "HUserID","币别代码","采购方式代码","结算方式代码","部门代码","主管代码","业务员代码","计量单位代码"];
            //#endregion 
            //#region ã€è¿‡æ»¤æ–¹æ¡ˆã€‘
@@ -288,6 +294,8 @@
            window.HInterID_Choose = 0;
            //#endregion
            //#region è¿›å…¥é¡µé¢æ—¢åŠ è½½
            set_ClearBill();
@@ -317,13 +325,15 @@
                    //刷新
                    case 'get_Refresh': set_Refresh();
                        break;
                    //审核按钮
                    case 'btn-Audit':
                        set_CheckBill(1);
                   //多行下推(收料通知单)
                    case 'btn-PushPOInStockBills':
                        set_PushPOInStockBills();
                        break;
                    //反审核按钮
                    case 'btn-DeAudit':
                        set_CheckBill(2);
                    //审核
                    case 'set_CheckBill': set_CheckBill(0);
                        break;
                    //反审核
                    case 'set_AbandonCheck': set_CheckBill(1);
                        break;
                    //关闭按钮        ï¼ˆ1:关闭、2:反关闭)
                    case 'btn-Close':
@@ -332,6 +342,12 @@
                    //反关闭按钮
                    case 'btn-DeClose':
                        set_CloseBill(2);
                        break;
                    //行关闭
                    case 'set_CloseRow': set_CloseRow(0);
                        break;
                    //行反关闭
                    case 'set_CancelCloseRow': set_CloseRow(1);
                        break;
                    //作废按钮        ï¼ˆ1:作废、2:反作废)
                    case 'btn-Drop':
@@ -382,26 +398,6 @@
            form.on('submit(btnReSearch)', function (data) {
                set_ClearQuery();
            });
            //#region èŽ·å–æ¨¡å—é¡µé¢æ ‡é¢˜
            function get_PageTitle(HModuleType) {
                $.ajax({
                    type: "GET",
                    async: false,
                    url: GetWEBURL() + "Web/GetModuleName", //方法所在页面和方法名
                    data: { "HModuleType": HModuleType },
                    success: function (result) {
                        if (result.count == 1) {
                            var data = result.data[0];
                            HPageTitle = data.HName;
                        } else {
                            return "";
                        }
                    }, error: function () {
                        layer.alert("接口请求失败!", { icon: 5 });
                    }
                });
            }
            //获取组织
            function Organ() {
@@ -472,6 +468,8 @@
            //#region æ­¤é¡µé¢æ‰€æœ‰æ–¹æ³•
            function set_ClearBill() {
                $("#HBeginDate").val("2022-03-14");
                $("#HEndDate").val(Format(new Date(), "yyyy-MM-dd"));
                //初始化表格
                set_InitGrid();
                //直接执行列表筛选 åŠ è½½æ•°æ®åˆ°ç½‘æ ¼
@@ -486,106 +484,110 @@
            }
            //初始化表格
            function set_InitGrid() {
                $("#HBeginDate").val("2022-03-14");
                $("#HEndDate").val(Format(new Date(), "yyyy-MM-dd"));
                var columns = [
                    { type: 'checkbox', fixed: 'left', totalRowText: '合计' }
                    ,{ field: 'hmainid', title: 'hmainid', sort: true, hide: true }
                    , { field: '日期', title: '日期', width: 120, templet: "<div>{{d.日期 ==null ?'':layui.util.toDateString(d.日期, 'yyyy-MM-dd')}}</div>" }
                    , { field: '单据号', title: '单据号', width: 150 }
                    , { field: '供应商', title: '供应商', width: 150 }
                    , { field: '业务员', title: '业务员', width: 100 }
                    //, { field: 'HBillType', title: 'HBillType', hide: true }
                    //, { field: 'HSupID', title: 'HSupID', hide: true }
                    //, { field: '业务状态', title: '业务状态', width: 100, hide: true }
                    , { field: '分配状态', title: '分配状态', width: 100 }
                    , { field: '发布状态', title: '发布状态', width: 100 }
                    , { field: '供应商协同状态', title: '供应商协同状态', width: 135 }/*物料代码,物料名称,规格型号,批号,数量,单位,源单单号*/
                    , { field: '反馈状态', title: '供应商反馈状态', width: 135 }
                    , { field: '物料编码', title: '物料编码', width: 120 }
                    , { field: '物料代码', title: '物料代码', width: 130 }
                    , { field: '旧物料编码', title: '旧物料编码', width: 130 }
                    , { field: '物料名称', title: '物料名称', width: 130 }
                    , { field: '数量', title: '订单数量', width: 100 }
                    , { field: '打印条码数量', title: '打印条码数量', width: 120 }
                    /* å®‰ç‘žæ–°å¢žå­—段 begin */
                    , { field: '可打印条码数量', title: '可打印条码数量', width: 120 }
                    /* å®‰ç‘žæ–°å¢žå­—段 end */
                    , { field: '关联数量', title: '已发货数量', width: 120 }
                    , { field: '未关联数量', title: '可发货数量', width: 120 }
                    /* å®‰ç‘žæ–°å¢žå­—段 begin */
                    , { field: '退料数量', title: '退料数量', width: 120 }
                    , { field: '实收数量', title: '实收数量', width: 120 }
                    , { field: '入库数量', title: '入库数量', width: 120 }
                    , { field: '剩余入库数量', title: '剩余入库数量', width: 120 }
                    , { field: '剩余收料数量', title: '剩余收料数量', width: 120 }
                    /* å®‰ç‘žæ–°å¢žå­—段 end */
                    , { field: '完成状态', title: '完成状态', width: 100 }
                    , { field: 'HUnitID', title: 'HUnitID', hide: true }
                    , { field: '规格型号', title: '规格型号', width: 100 }
                    //, { field: 'HUnitID', title: 'HUnitID', hide: true }  é‡å¤
                    , { field: '计量单位代码', title: '计量单位代码', width: 120 }
                    , { field: '计量单位', title: '计量单位', width: 100 }
                    , { field: '批号', title: '批号', width: 100 }
                    , { field: '数量', title: '数量', width: 100 }
                    , { field: '源单单号', title: '源单单号', width: 100 }
                    //, { field: '供应商代码', title: '供应商代码', width: 120, hide: true}
                    //, { field: '业务员代码', title: '业务员代码', width: 100, hide: true}
                    //, { field: 'HPriority', title: 'HPriority', width: 100, hide: true }
                    , { field: '优先级', title: '优先级', width: 100 }
                    , { field: '交货地点', title: '交货地点', width: 100}
                    , { field: 'HPSStyleID', title: 'HPSStyleID', hide: true }
                    , { field: '采购方式代码', title: '采购方式代码', width: 120}
                    , { field: '采购方式', title: '采购方式', width: 100}
                    , { field: 'HSSID', title: 'HSSID', hide: true }
                    , { field: '结算方式代码', title: '结算方式代码', width: 120}
                    , { field: '结算方式', title: '结算方式', width: 100}
                    , { field: '结算日期', title: '结算日期', width: 120, templet: "<div>{{d.日期 ==null ?'':layui.util.toDateString(d.结算日期, 'yyyy-MM-dd')}}</div>" }
                    , { field: 'HCurID', title: 'HCurID', hide: true }
                    , { field: '币别代码', title: '币别代码', width: 100}
                    , { field: '币别', title: '币别', width: 100}
                    , { field: '汇率', title: '汇率', width: 100}
                    , { field: 'HDeptID', title: 'HDeptID', hide: true }
                    , { field: '部门代码', title: '部门代码', width: 100}
                    , { field: '部门', title: '部门', width: 100}
                    , { field: 'HManagerID', title: 'HManagerID', hide: true }
                    , { field: '主管代码', title: '主管代码', width: 100}
                    , { field: '主管', title: '主管', width: 100}
                    , { field: 'HEmpID', title: 'HEmpID', hide: true }
                    , { field: '摘要', title: '摘要', width: 100}
                    , { field: '表头备注', title: '表头备注', width: 100}
                    , { field: 'hsubid', title: 'hsubid', hide: true }
                    , { field: 'HMaterID', title: 'HMaterID', hide: true }
                    , { field: '单价', title: '单价', width: 100}
                    , { field: '金额', title: '金额', width: 100}
                    , { field: '税率', title: '税率', width: 100}
                    , { field: '税额', title: '税额', width: 100}
                    , { field: '价税合计', title: '价税合计', width: 100}
                    , { field: '交货日期', title: '交货日期', width: 120, templet: "<div>{{d.日期 ==null ?'':layui.util.toDateString(d.交货日期, 'yyyy-MM-dd')}}</div>" }
                    , { field: '计划跟踪号', title: '计划跟踪号', width: 100}
                    , { field: '表体备注', title: '表体备注', width: 100}
                    , { field: '制单人', title: '制单人', width: 100}
                    , { field: '制单日期', title: '制单日期', width: 120, templet: "<div>{{d.日期 ==null ?'':layui.util.toDateString(d.制单日期, 'yyyy-MM-dd')}}</div>" }
                    , { field: '审核人', title: '审核人', width: 100}
                    , { field: '审核日期', title: '审核日期', width: 120, templet: "<div>{{d.日期 ==null ?'':layui.util.toDateString(d.审核日期, 'yyyy-MM-dd')}}</div>" }
                    , { field: '修改人', title: '修改人', width: 100}
                    , { field: '修改日期', title: '修改日期', width: 120, templet: "<div>{{d.日期 ==null ?'':layui.util.toDateString(d.修改日期, 'yyyy-MM-dd')}}</div>" }
                    , { field: '关闭人', title: '关闭人', width: 100}
                    , { field: '关闭日期', title: '关闭日期', width: 120, templet: "<div>{{d.日期 ==null ?'':layui.util.toDateString(d.关闭日期, 'yyyy-MM-dd')}}</div>" }
                    , { field: '作废人', title: '作废人', width: 100}
                    , { field: '作废日期', title: '作废日期', width: 120, templet: "<div>{{d.日期 ==null ?'':layui.util.toDateString(d.作废日期, 'yyyy-MM-dd')}}</div>" }
                ];
                option = {
                    elem: '#mainTable'
                    , toolbar: '#toolbarDemo'
                    , page: true
                    , cellMinWidth: 120
                    , totalRow: true
                    , limit: 500
                    , height: 'full-50'
                    , cols: [columns]
                    , limits: [500, 5000, 20000]
                    , page: true
                    , totalRow: true
                    , cellMinWidth: 90
                    , limit: 50
                    , limits: [50, 500, 5000, 20000]
                    , cols: [[
                        { type: 'checkbox', fixed: 'left', totalRowText: '合计' }
                        ,{ field: 'hmainid', title: 'hmainid', sort: true, hide: true }
                        , { field: '日期', title: '日期', width: 120, templet: "<div>{{d.日期 ==null ?'':layui.util.toDateString(d.日期, 'yyyy-MM-dd')}}</div>" }
                        , { field: '单据号', title: '单据号', width: 150}
                        , { field: '状态', title: '状态', width: 100, sort: true }
                        , { field: 'HBillType', title: 'HBillType', hide: true, sort: true }
                        , { field: '行状态', title: '行状态', width: 125, sort: true }
                        , { field: '供应商', title: '供应商', width: 150 }
                        , { field: '业务员', title: '业务员', width: 100 }
                        //, { field: 'HBillType', title: 'HBillType', hide: true }
                        //, { field: 'HSupID', title: 'HSupID', hide: true }
                        //, { field: '业务状态', title: '业务状态', width: 100, hide: true }
                        , { field: '分配状态', title: '分配状态', width: 100 }
                        , { field: '发布状态', title: '发布状态', width: 100 }
                        , { field: '供应商协同状态', title: '供应商协同状态', width: 135 }/*物料代码,物料名称,规格型号,批号,数量,单位,源单单号*/
                        , { field: '反馈状态', title: '供应商反馈状态', width: 135 }
                        , { field: '物料编码', title: '物料编码', width: 120 }
                        , { field: '物料代码', title: '物料代码', width: 130 }
                        , { field: '旧物料编码', title: '旧物料编码', width: 130 }
                        , { field: '物料名称', title: '物料名称', width: 130 }
                        , { field: '数量', title: '订单数量', width: 100, totalRow: true }
                        , { field: '打印条码数量', title: '打印条码数量', width: 120, totalRow: true  }
                        /* å®‰ç‘žæ–°å¢žå­—段 begin */
                        , { field: '可打印条码数量', title: '可打印条码数量', width: 120, totalRow: true}
                        /* å®‰ç‘žæ–°å¢žå­—段 end */
                        , { field: '关联数量', title: '已发货数量', width: 120, totalRow: true}
                        , { field: '未关联数量', title: '可发货数量', width: 120, totalRow: true}
                        /* å®‰ç‘žæ–°å¢žå­—段 begin */
                        , { field: '退料数量', title: '退料数量', width: 120, totalRow: true}
                        , { field: '实收数量', title: '实收数量', width: 120, totalRow: true}
                        , { field: '入库数量', title: '入库数量', width: 120, totalRow: true}
                        , { field: '剩余入库数量', title: '剩余入库数量', width: 120, totalRow: true}
                        , { field: '剩余收料数量', title: '剩余收料数量', width: 120, totalRow: true}
                        /* å®‰ç‘žæ–°å¢žå­—段 end */
                        , { field: '完成状态', title: '完成状态', width: 100 }
                        , { field: 'HUnitID', title: 'HUnitID', hide: true }
                        , { field: '规格型号', title: '规格型号', width: 100 }
                        //, { field: 'HUnitID', title: 'HUnitID', hide: true }  é‡å¤
                        , { field: '计量单位代码', title: '计量单位代码', width: 120 , hide: true }
                        , { field: '计量单位', title: '计量单位', width: 100 }
                        , { field: '批号', title: '批号', width: 100 }
                        , { field: '数量', title: '数量', width: 100, totalRow: true }
                        , { field: '源单单号', title: '源单单号', width: 100 }
                        //, { field: '供应商代码', title: '供应商代码', width: 120, hide: true}
                        //, { field: '业务员代码', title: '业务员代码', width: 100, hide: true}
                        //, { field: 'HPriority', title: 'HPriority', width: 100, hide: true }
                        , { field: '优先级', title: '优先级', width: 100 }
                        , { field: '交货地点', title: '交货地点', width: 100}
                        , { field: 'HPSStyleID', title: 'HPSStyleID', hide: true }
                        , { field: '采购方式代码', title: '采购方式代码', width: 120, hide: true }
                        , { field: '采购方式', title: '采购方式', width: 100}
                        , { field: 'HSSID', title: 'HSSID', hide: true }
                        , { field: '结算方式代码', title: '结算方式代码', width: 120}
                        , { field: '结算方式', title: '结算方式', width: 100}
                        , { field: '结算日期', title: '结算日期', width: 120, templet: "<div>{{d.日期 ==null ?'':layui.util.toDateString(d.结算日期, 'yyyy-MM-dd')}}</div>" }
                        , { field: 'HCurID', title: 'HCurID', hide: true }
                        , { field: '币别代码', title: '币别代码', width: 100, hide: true }
                        , { field: '币别', title: '币别', width: 100}
                        , { field: '汇率', title: '汇率', width: 100}
                        , { field: 'HDeptID', title: 'HDeptID', hide: true }
                        , { field: '部门代码', title: '部门代码', width: 100, hide: true }
                        , { field: '部门', title: '部门', width: 100}
                        , { field: 'HManagerID', title: 'HManagerID', hide: true }
                        , { field: '主管代码', title: '主管代码', width: 100, hide: true }
                        , { field: '主管', title: '主管', width: 100}
                        , { field: 'HEmpID', title: 'HEmpID', hide: true }
                        , { field: '摘要', title: '摘要', width: 100}
                        , { field: '表头备注', title: '表头备注', width: 100}
                        , { field: 'hsubid', title: 'hsubid', hide: true }
                        , { field: 'HMaterID', title: 'HMaterID', hide: true }
                        , { field: '单价', title: '单价', width: 100}
                        , { field: '金额', title: '金额', width: 100, totalRow: true }
                        , { field: '税率', title: '税率', width: 100}
                        , { field: '税额', title: '税额', width: 100}
                        , { field: '折扣率', title: '折扣率', width: 100}
                        , { field: '价税合计', title: '价税合计', width: 100}
                        , { field: '交货日期', title: '交货日期', width: 120, templet: "<div>{{d.交货日期 ==null ?'':layui.util.toDateString(d.交货日期, 'yyyy-MM-dd')}}</div>" }
                        , { field: '计划跟踪号', title: '计划跟踪号', width: 100}
                        , { field: '表体备注', title: '表体备注', width: 100}
                        , { field: '制单人', title: '制单人', width: 100}
                        , { field: '制单日期', title: '制单日期', width: 200, templet: "<div>{{d.制单日期 ==null ?'':layui.util.toDateString(d.制单日期, 'yyyy-MM-dd HH:mm:ss')}}</div>", sort: true }
                        , { field: '审核人', title: '审核人', width: 100}
                        , { field: '审核日期', title: '审核日期', width: 120, templet: "<div>{{d.审核日期 ==null ?'':layui.util.toDateString(d.审核日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                        , { field: '修改人', title: '修改人', width: 100}
                        , { field: '修改日期', title: '修改日期', width: 120, templet: "<div>{{d.修改日期 ==null ?'':layui.util.toDateString(d.修改日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                        , { field: '关闭人', title: '关闭人', width: 100}
                        , { field: '关闭日期', title: '关闭日期', width: 120, templet: "<div>{{d.关闭日期 ==null ?'':layui.util.toDateString(d.关闭日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                        , { field: '行关闭人', title: '行关闭人', width: 125, sort: true }
                       , { field: '行关闭日期', title: '行关闭日期', width: 200, templet: "<div>{{d.行关闭人 == ''?'':layui.util.toDateString(d.行关闭日期, 'yyyy-MM-dd HH:mm:ss')}}</div>", sort: true }
                        , { field: '作废人', title: '作废人', width: 100}
                        , { field: '作废日期', title: '作废日期', width: 120, templet: "<div>{{d.作废日期 ==null ?'':layui.util.toDateString(d.作废日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
                ]]
                    , done: function (res, curr, count) {
                        soulTable.render(this);
                    }
@@ -612,22 +614,25 @@
                        if (data1.count == 1) {
                            var data = [];
                            var col = [];
                            var totalArray = ["数量", "关联数量", "未关联数量", "打印条码数量", "未打印条码数量","实收数量","金额"];
                            //给空的数组赋值
                            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: 'checkbox', fixed: 'left' });
                            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 {
                                else if ($.inArray(data[i].name, totalArray) > -1) {
                                    col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, totalRow: true, width: 120 });
                                } 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 });
                                            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 });
@@ -643,6 +648,7 @@
                                , data: data1.data
                                , height: 800
                                , page: true
                                , totalRow: true
                                , cellMinWidth: 90
                                , limit: 50
                                , limits: [50, 500, 5000, 20000]
@@ -732,7 +738,7 @@
                        $.ajax({
                            type: "GET",
                            url: GetWEBURL() + "/Cg_POOrderBill/DeltetCg_POOrderBill", //方法所在页面和方法名
                            data: { "HInterID": InterID },
                            data: { "HInterID": InterID, "user": sessionStorage["HUserName"]},
                            success: function (result) {
                                if (result.count == 1) {
                                    layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () {
@@ -809,7 +815,69 @@
                }
            }
            //#region åå®¡æ ¸/审核数据
           //#region å¤šè¡Œä¸‹æŽ¨ï¼ˆæ”¶æ–™é€šçŸ¥å•)
            function set_PushPOInStockBills() {
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;
                if (data.length > 0) {
                    var dataArray = [];
                    var HCusName = data[0].客户;
                    var HEmpName = data[0].业务员;
                    for (var i = 0; i < data.length; i++) {
                        var temp = {
                            "hmainid": data[i].hmainid
                            , "hsubid": data[i].hsubid
                            , "HBillStatus": data[i].状态
                            , "HSourceBillType": "1102"
                        }
                        dataArray.push(temp);
                        if (data[i].状态 != "已审核") {
                            var err = "下推失败!单据【" + data[i].单据号 + "】的状态为“" + data[0].状态 + "”,不允许下推!";
                            layer.alert(err, { icon: 5 });
                            return;
                        }
                        if (data[i].行状态 == "已关闭") {
                            layer.msg("下推失败!单据号【" + data[i].单据号 + "】下选中的记录中存在已关闭状态的记录!");
                            return;
                        }
                        if (data[i].客户 != HCusName) {
                            layer.msg("下推失败!已经选中的记录中存在不同客户!");
                            return;
                        }
                        if (data[i].业务员 != HEmpName) {
                            layer.msg("下推失败!已经选中的记录中存在不同业务员!");
                            return;
                        }
                    }
                    var datajson = {
                        "data": dataArray
                    };
                    var url = encodeURI('../../采购管理/收料通知单/Add_Edit_Cg_POInStockBillList.html?OperationType=4&linterid=0&HSouceBillType=1102&res=' + JSON.stringify(datajson))
                    layer.open({
                        type: 2
                        , area: ['100%', '100%']
                        , title: '采购订单-多行下推收料通知单'
                        , shift: 0//弹出动画
                        , content: url
                        , btn: [],
                        // æŒ‰é’®1 çš„回调
                        end: function (index, layero, that) {
                            //刷新页面
                            $("#btnSearch").trigger('click');
                        }
                    })
                } else {
                    layer.msg('请选择数据下推!');
                }
            }
            //#endregion
         //#region åå®¡æ ¸/审核数据
            function set_CheckBill(num) {
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;
@@ -819,7 +887,7 @@
                    $.ajax({
                        type: "GET",
                        url: GetWEBURL() + "/Cg_POOrderBill/AuditCg_POOrderBill", //方法所在页面和方法名
                        data: { "HInterID": InterID, "Type": num, "user": sessionStorage["HUserName"] },
                        data: { "HInterID": InterID, "IsAudit": num, "CurUserName": sessionStorage["HUserName"] },
                        success: function (result) {
                            if (result.count == 1) {
                                layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () {
@@ -844,6 +912,7 @@
                }
            }
            //#endregion
            //#region åå…³é—­/关闭数据
            function set_CloseBill(num) {
@@ -877,6 +946,43 @@
                }
                else {
                    layer.msg('请选择一行数据审核!');
                }
            }
            //#endregion
           //#region è¡Œåå…³é—­/行关闭数据
            function set_CloseRow(num) {
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;
                if (checkStatus.data.length === 1) {
                    var InterID = data[0].hmainid.toString();
                    var hsubid = data[0].hsubid.toString();
                    //逻辑审核方法
                    $.ajax({
                        type: "GET",
                        url: GetWEBURL() + "/Cg_POOrderBill/CloseRowCg_POOrderBill", //方法所在页面和方法名
                        data: { "HInterID": InterID, "HEntryID": hsubid, "IsAudit": num, "CurUserName": sessionStorage["HUserName"] },
                        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);
                                    //修改为功后刷新界面
                                    $("#btnSearch").trigger('click');
                                });
                            } else {
                                layer.alert(result.code + result.Message, { icon: 5 });
                            }
                        }, error: function () {
                            layer.alert("接口请求失败!", { icon: 5 });
                        }
                    });
                }
                else {
                    layer.msg('请选择一行数据关闭!');
                }
            }
            //#endregion
@@ -1367,6 +1473,8 @@
                    sWhere += " and å®ŒæˆçŠ¶æ€ like '%" + HFinishStatus + "%'";
                }
                sWhere += addSWhereByOpenType();
                //添加查询条件,根据当前登录用户关联职员返回数据
                //sWhere += " and HUserID =" + sessionStorage["Czybm"]
                var index = layer.load(0);
@@ -1450,22 +1558,14 @@
                })
            }
            //隐藏列设置
            //#region éšè—åˆ—设置
            function get_HideColumn() {
                var colName = "";
                var contentUrl = "";
                for (var i = 1; i < option.cols[0].length - 1; i++) {
                for (var i = 1; i < option.cols[0].length; 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" //加上边框
@@ -1474,7 +1574,7 @@
                    , shift: 2 //弹出动画
                    , area: ["50%", "90%"] //窗体大小
                    , maxmin: true //设置最大最小按钮是否显示
                    , content: [contentUrl, "yes"]
                    , content: ['../../基础资料/隐藏列设置/Gy_GridView_Hide.html?HModName=' + HModName + '&colName=' + colName, "yes"]
                    , btn: ["确定", "取消"]
                    , btn1: function (index, laero) {
                        //刷新表格数据
@@ -1484,8 +1584,8 @@
                    }
                })
            }
            //显示列数据
            //#endregion
            //#region æ˜¾ç¤ºåˆ—数据
            function DisPlay_HideColumn() {
                $.ajax({
                    url: GetWEBURL() + '/Xt_grdAlignment_WMES/grdAlignmentWMESList',
@@ -1494,23 +1594,16 @@
                    success: function (data1) {
                        if (data1.data.length != 0) {
                            var dataCol = [];//数据库查询出的列数据
                            var titleData = ["hmainid", "HBillType", "HSupID", "业务状态", "HUnitID", "供应商代码", "业务员代码", "HPriority", "HPSStyleID", "HSSID", "HCurID", "HDeptID", "HManagerID", "HEmpID", "hsubid","HMaterID"];//不需要显示的字段 å¯æ‰©å±•
                            var titleData = ["hmainid", "HBillType", "HSupID", "业务状态", "HUnitID", "供应商代码", "业务员代码", "HPriority", "HPSStyleID", "HSSID", "HCurID", "HDeptID", "HManagerID", "HEmpID", "hsubid", "HMaterID"];//不需要显示的字段 å¯æ‰©å±•
                            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('|');
                                }
                            for (var i = 0; i < option.cols[0].length - 1; 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) {
@@ -1519,11 +1612,9 @@
                                    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[3] > 0) {
                                    option.cols[0][i + 1]["width"] = dataCols[3];
                                }
                                //显示列
                                if (dataCols[1] == 0 && $.inArray(option.cols[0][i + 1]["title"], titleData) == -1) {
                                    option.cols[0][i + 1]["hide"] = false;
@@ -1561,20 +1652,46 @@
                                }
                            }
                            table.render(option);
                            var HBillType = "1102";
                            //刷新按钮显示
                            var btns = document.getElementsByTagName("button");     //获取本页所有按钮对象
                            Display_HideButton(btns, HBillType, HModName, sessionStorage["HUserName"]);
                        } else {
                            table.render(option);
                            var HBillType = "1102";
                            //刷新按钮显示
                            var btns = document.getElementsByTagName("button");     //获取本页所有按钮对象
                            Display_HideButton(btns, HBillType, HModName, sessionStorage["HUserName"]);
                        }
                        //刷新按钮显示
                        var btns = document.getElementsByTagName("button");     //获取本页所有按钮对象
                        var HBillType = "1102";
                        Display_HideButton(btns, HBillType, HModName, sessionStorage["HUserName"]);
                    }, error: function () {
                        layer.alert("接口请求失败!", { icon: 5 });
                    }
                })
            }
            //#endregion
            //#region ç‚¹å‡»è¡Œé€‰ä¸­é«˜äº®
            table.on('row(mainTable)', function (obj) {
                //选中行改变颜色
                var flag = !obj.tr.find(':checkbox:first').prop('checked');
                obj.tr.find(':checkbox').prop('checked', flag);
                if (flag) {
                    obj.tr.find('.layui-form-checkbox').addClass('layui-form-checked');  //设置复选框选中样式
                    $(obj.tr.selector).attr({ "style": "background:#ceedfa;color:black" });//改变当前tr背景颜色和字体颜色
                } else {
                    obj.tr.find('.layui-form-checkbox').removeClass('layui-form-checked');//取消复选框选中样式
                    $(obj.tr.selector).attr({ "style": "background:" });//取消当前tr颜色
                }
                //mainTable ä¸ºè¡¨æ ¼ID   æ³¨æ„æ­¤å¤„如果ID不正确将导致你在监听复选框时获取不到你选择的数据,前面的只是添加或删除选中未选中样式以及设置背景色,字体颜色
                layui.each(table.cache.mainTable, function (i, l) {
                    if (obj.tr.index() == l.LAY_TABLE_INDEX) {
                        l.LAY_CHECKED = flag;
                    }
                });
            })
            //#endregion
            //#region ä»»æ„å­—段过滤:列名显示下拉框
            function ColFilter() {
@@ -1798,6 +1915,35 @@
            //#endregion
        //#region èŽ·å–å‚æ•°
            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
            //#region åˆ¤æ–­æ˜¯ç›´æŽ¥æ‰“开页面还是其它页面通过选择按钮打开,并显示相应数据
            function addSWhereByOpenType() {
                //获取参数
                var params = getUrlVars();
                var openType = params[params[0]]; //从参数中获取 æ‰“开方式  1直接打开 2其它页面通过选择按钮打开
                var HOrgID = params[params[1]];
                var addSWhere = "";
                if (openType == 2) {
                    addSWhere = " and çŠ¶æ€ = '已审核' and è¡ŒçŠ¶æ€ = '' and HOrgID = " + HOrgID;
                }
                return addSWhere;
            }
            //#endregion
            //以上是layui模块
        });