WebTM/views/ÑéÊÕÈë¿â/Í⹺Èë¿â/Add_Edit_Kf_POStockInBillList.html
@@ -59,7 +59,8 @@
                        <h1 style="text-align: center; padding: 10px 0;"><b>采购入库单</b></h1>
                        <ul class="layui-tab-title" lay-filter="tab-all">
                            <li lay-id="1" style="padding:1px;" class="layui-this">基本信息</li>
                            <li lay-id="2" style="padding:1px;">制单信息</li>
                            <li lay-id="2" style="padding:1px;">其他信息</li>
                            <li lay-id="3" style="padding:1px;">制单信息</li>
                        </ul>
                        <div class="layui-tab-content">
                            <!--基本信息-->
@@ -69,7 +70,7 @@
                                        <div class="layui-col-xs4 layui-inline">
                                            <label class="layui-form-label">单据号<label style="color:red"> * </label></label>
                                            <div class="layui-input-inline">
                                                <input type="text" class="layui-input" name="HBillNo" id="HBillNo" style="background-color:#efefef4d;" readonly>
                                                <input type="text" class="layui-input" name="HBillNo" id="HBillNo" style="background-color:#efefef4d;">
                                                <input type="hidden" name="HInterID" id="HInterID" value="0">
                                                <input type="hidden" name="HSTOCKORGID" id="HSTOCKORGID" lay-verify="HSTOCKORGID" value=0>
                                            </div>
@@ -81,25 +82,17 @@
                                            </div>
                                        </div>
                                        <div class="layui-col-xs4 layui-inline">
                                            <label class="layui-form-label">内部单据号</label>
                                            <div class="layui-input-inline">
                                                <input class="layui-input" name="HInnerBillNo" id="HInnerBillNo" autocomplete="off">
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row">
                                        <div class="layui-col-xs8 layui-inline">
                                            <label class="layui-form-label">供应商<label style="color:red"> * </label></label>
                                            <div class="layui-input-inline" style="width:750px">
                                                <input type="text" name="HSupName" id="HSupName" class="layui-input" value="" style="float:left;width:700px;">
                                                <input type="hidden" name="HSupID" id="HSupID" class="layui-input" value=0 style="float:left;width:700px;">
                                            <div class="layui-input-inline">
                                                <input type="text" name="HSupName" id="HSupName" class="layui-input" value="" style="float:left;width:150px;">
                                                <input type="hidden" name="HSupID" id="HSupID" class="layui-input" value=0 style="float:left;width:150px;">
                                                <button type="button" lay-submit="" class="layui-btn" lay-filter="HSupList" style="width:40px;">
                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
                                                </button>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row">
                                        <div class="layui-col-xs4 layui-inline">
                                            <label class="layui-form-label">仓库<label style="color:red"> * </label></label>
                                            <div class="layui-input-inline">
@@ -110,40 +103,39 @@
                                                </button>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row">
                                        <div class="layui-col-xs4 layui-inline">
                                            <label class="layui-form-label">验收员<label style="color:red"> * </label></label>
                                            <label class="layui-form-label">验收员</label>
                                            <div class="layui-input-inline">
                                                <input type="text" name="HSecManagerName" id="HSecManagerName" class="layui-input" value="" style="float:left;width:150px;">
                                                <input type="hidden" name="HSecManagerID" id="HSecManagerID" class="layui-input" value=0 style="float:left;width:150px;">
                                                <input type="hidden" name="HSecManagerID" id="HSecManagerID" class="layui-input" value="0" style="float:left;width:150px;">
                                                <button type="button" lay-submit="" class="layui-btn" lay-filter="HSecManagerList" style="width:40px;">
                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
                                                </button>
                                            </div>
                                        </div>
                                        <div class="layui-col-xs4 layui-inline">
                                            <label class="layui-form-label">保管员<label style="color:red"> * </label></label>
                                            <label class="layui-form-label">保管员</label>
                                            <div class="layui-input-inline">
                                                <input type="text" name="HKeeperName" id="HKeeperName" class="layui-input" value="" style="float:left;width:150px;">
                                                <input type="hidden" name="HKeeperID" id="HKeeperID" class="layui-input" value=0 style="float:left;width:150px;">
                                                <input type="hidden" name="HKeeperID" id="HKeeperID" class="layui-input" value="0" style="float:left;width:150px;">
                                                <button type="button" lay-submit="" class="layui-btn" lay-filter="HKeeperList" style="width:40px;">
                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
                                                </button>
                                            </div>
                                        </div>
                                        <div class="layui-col-xs4 layui-inline">
                                            <label class="layui-form-label">业务员<label style="color:red"> * </label></label>
                                            <div class="layui-input-inline">
                                                <input type="text" name="HEmpName" id="HEmpName" class="layui-input" value="" style="float:left;width:150px;">
                                                <input type="hidden" name="HEmpID" id="HEmpID" class="layui-input" value=0 style="float:left;width:150px;">
                                                <button type="button" lay-submit="" class="layui-btn" lay-filter="HEmpList" style="width:40px;">
                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
                                                </button>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row">
                                        <div class="layui-col-xs4 layui-inline">
                                            <label class="layui-form-label">业务员</label>
                                            <div class="layui-input-inline">
                                                <input type="text" name="HEmpName" id="HEmpName" class="layui-input" value="" style="float:left;width:150px;">
                                                <input type="hidden" name="HEmpID" id="HEmpID" class="layui-input" value="0" style="float:left;width:150px;">
                                                <button type="button" lay-submit="" class="layui-btn" lay-filter="HEmpList" style="width:40px;">
                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
                                                </button>
                                            </div>
                                        </div>
                                        <div class="layui-col-xs4 layui-inline">
                                            <label class="layui-form-label">源单类型</label>
                                            <div class="layui-input-inline">
@@ -155,37 +147,26 @@
                                        <div class="layui-col-xs4 layui-inline">
                                            <label class="layui-form-label">选单号</label>
                                            <div class="layui-input-inline">
                                                <input type="text" name="" id="" class="layui-input" value="" style="float:left;width:150px;">
                                                <input type="text" name="HSourceBillNo" id="HSourceBillNo" class="layui-input" value="" style="float:left;width:150px;">
                                                <button type="button" lay-submit="" class="layui-btn" lay-filter="XDHList" id="XDHList" style="width:40px;">
                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
                                                </button>
                                            </div>
                                            <!--<label class="layui-form-label">选单号</label>
            <div class="layui-input-inline">
                <input class="layui-input" name="Box2" id="Box2" autocomplete="off">
            </div>-->
        <div class="layui-input-inline">
            <input class="layui-input" name="Box2" id="Box2" autocomplete="off">
        </div>-->
                                        </div>
                                    </div>
                                    <div class="layui-row">
                                        <div class="layui-col-xs4 layui-inline">
                                            <label class="layui-form-label">负责人<label style="color:red"> * </label></label>
                                            <label class="layui-form-label">负责人</label>
                                            <div class="layui-input-inline">
                                                <input type="text" name="HManagerName" id="HManagerName" class="layui-input" value="" style="float:left;width:150px;">
                                                <input type="hidden" name="HManagerID" id="HManagerID" class="layui-input" value=0 style="float:left;width:150px;">
                                                <button type="button" lay-submit="" class="layui-btn" lay-filter="HManagerList" style="width:40px;">
                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
                                                </button>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row">
                                        <div class="layui-col-xs4 layui-inline">
                                            <label class="layui-form-label">部门<label style="color:red"> * </label></label>
                                            <div class="layui-input-inline">
                                                <input type="text" name="HDeptName" id="HDeptName" class="layui-input" value="" style="float:left;width:150px;">
                                                <input type="hidden" name="HDeptID" id="HDeptID" class="layui-input" value=0 style="float:left;width:150px;">
                                                <button type="button" lay-submit="" class="layui-btn" lay-filter="HDeptList" style="width:40px;">
                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
                                                </button>
                                            </div>
@@ -206,21 +187,50 @@
                                                <input class="layui-input" name="HProjectName" id="HProjectName" style="background-color:#efefef4d;" readonly autocomplete="off">
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row">
                                        <div class="layui-col-xs4 layui-inline">
                                            <label class="layui-form-label">部门<label style="color:red"> * </label></label>
                                            <div class="layui-input-inline">
                                                <input type="text" name="HDeptName" id="HDeptName" class="layui-input" value="" style="float:left;width:150px;">
                                                <input type="hidden" name="HDeptID" id="HDeptID" class="layui-input" value=0 style="float:left;width:150px;">
                                                <button type="button" lay-submit="" class="layui-btn" lay-filter="HDeptList" style="width:40px;">
                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn" style="margin-left:-9px;"></i>
                                                </button>
                                            </div>
                                        </div>
                                    </div>
                                    <!--<div class="layui-row">
        <div class="layui-col-xs7 layui-inline">
            <label class="layui-form-label">摘要</label>
            <div class="layui-input-block">
                <input class="layui-input" name="HExplanation" id="HExplanation" autocomplete="off">
            </div>
        </div>
    </div>-->
                <div class="layui-col-xs7 layui-inline">
                    <label class="layui-form-label">摘要</label>
                    <div class="layui-input-block">
                        <input class="layui-input" name="HExplanation" id="HExplanation" autocomplete="off">
                    </div>
                </div>
            </div>-->
                                    <div class="layui-row">
                                        <div class="layui-col-xs7 layui-inline">
                                            <label class="layui-form-label">备注</label>
                                            <div class="layui-input-block">
                                                <input class="layui-input" name="HRemark" id="HRemark" autocomplete="off">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <!--其他信息-->
                            <div class="layui-tab-item">
                                <div class="layui-form-item" style="padding-top: 10px;">
                                    <div class="layui-row">
                                        <div class="layui-col-xs4 layui-inline">
                                            <label class="layui-form-label">内部单据号</label>
                                            <div class="layui-input-inline">
                                                <input class="layui-input" name="HInnerBillNo" id="HInnerBillNo" autocomplete="off">
                                            </div>
                                        </div>
                                        <div class="layui-col-xs4 layui-inline" style="margin-left: 135px;">
@@ -240,7 +250,6 @@
                                    </div>
                                </div>
                            </div>
                            <!--制单信息-->
                            <div class="layui-tab-item">
@@ -267,20 +276,6 @@
                                    </div>
                                    <div class="layui-row">
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">修改人</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HUpDater" id="HUpDater" style="background-color:#efefef4d;" readonly>
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">作废人</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HDeleteMan " id="HDeleteMan " style="background-color:#efefef4d;" readonly>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row">
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">制单日期</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HMakeDate" id="HMakeDate" style="background-color:#efefef4d;" readonly>
@@ -298,18 +293,32 @@
                                                <input type="text" class="layui-input" name="HCloseDate" id="HCloseDate" style="background-color:#efefef4d;" readonly>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row">
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">修改人</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HUpDater" id="HUpDater" style="background-color:#efefef4d;" readonly>
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">作废人</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HDeleteMan" id="HDeleteMan" style="background-color:#efefef4d;" readonly>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row">
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">修改日期</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HUpDateDate" id="HUpDateDate" style="background-color:#efefef4d;" readonly>
                                            </div>
                                        </div>
                                        <div class="layui-row">
                                            <div class="layui-inline">
                                                <label class="layui-form-label" style="width: 85px;">作废日期</label>
                                                <div class="layui-input-block" style="margin-left: 120px;">
                                                    <input type="text" class="layui-input" name="HDeleteDate" id="HDeleteDate" style="background-color:#efefef4d;" readonly>
                                                </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">作废日期</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HDeleteDate" id="HDeleteDate" style="background-color:#efefef4d;" readonly>
                                            </div>
                                        </div>
                                    </div>
@@ -339,6 +348,12 @@
        <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
    </script>
    <script>
        //#region æ–‡æœ¬æ¡†è¾“入搜索相关数据-变量
        var childPage = null;                       //获取子窗口对象,用于操作子窗口的变量和方法
        var currRowIndex = 0;                       //用于定位子窗口当前选中的行
        var childData = null;                       //用于获取子窗口返回的数据
        //#endregion
        //#region æŠ˜å æ³¨é‡Š
        //#endregion
        layui.config({
@@ -363,7 +378,7 @@
            var allVal;
            //#endregion
            var HModName = "Add_Edit_Kf_POStockInBillList"
            //#region è¿›å…¥é¡µé¢å³åŠ è½½
            //判断是否登录 æœªç™»å½•则跳到登录页
@@ -458,7 +473,7 @@
                    , data = checkStatus.data;
                //新增行表格数据
                var NewRow = {
                    "HMaterID": 0, "物料代码": "", "物料名称": "", "规格型号": "", "HUnitID": 0, "计量单位": "", "HQtyMust": "", "HQty": "", "HRemark": "",
                    "HMaterID": 0, "物料代码": "", "物料名称": "", "规格型号": "", "HUnitID": 0, "计量单位": "", "HQtyMust": "0", "HQty": "0", "HRemark": "",
                    "HPrice": "0", "HMoney": "0", "HOrderPrice": "0", "HWHID": 0, "收料仓库": "",
                    "HSPID": 0, "仓位名称": "", "HBatchNo": "", "HPOOrderInterID": 0, "HPOOrderEntryID": 0,
                    "HPOOrderBillNo": "", "HSeOrderInterID": 0, "HSeOrderEntryID": 0, "HSeOrderBillNo": "",
@@ -498,10 +513,10 @@
                            //checkRefresh();
                        }
                        break;
                    ////列设置
                    //case 'set_HideColumn':
                    //    get_HideColumn();
                    //    break;
                    //列设置
                    case 'set_HideColumn':
                        get_HideColumn();
                        break;
                }
            });
@@ -580,6 +595,116 @@
                }
            });
            //#region å›žè½¦é€‰æ‹©æºå•
            $('#HSourceBillNo').on('keydown', function (event) {
                var HSourceBillNo = $('#HSourceBillNo').val();//(源单单据号)
                if (event.keyCode == 13) {
                    var ajaxLoad = layer.load();
                    var url;
                    //判断文本框是否有数据    new
                    if (HSourceBillNo == "") {
                        return;
                    }
                    if ($("#HSourceBillType").val() == "1102") {
                        //源单类型是采购订单
                        url = "/Cg_POOrderBill/PushList";
                    } else if ($("#HSourceBillType").val() == "1103") {
                        //源单类型是收料通知单
                        url = "/Cg_POInStockBill/PushList";
                    }
                    $.ajax({
                        url: GetWEBURL() + url,
                        type: "GET",
                        data: { "HBillNo": HSourceBillNo, "user": sessionStorage["HUserName"] },
                        success: function (result) {
                            if (result.code == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                                var checkStatus = result;
                                if ($("#HSourceBillType").val() == "1102") {
                                    option.data = [];//清空子表
                                    $("#HProjectName").val(checkStatus.data[0].项目名称);
                                    $("#HProjectNumber").val(checkStatus.data[0].项目代码);
                                    $("#HProjectID").val(checkStatus.data[0].HProjectID);
                                    $("#HDeptID").val(checkStatus.data[0].HDeptID);
                                    $("#HDeptName").val(checkStatus.data[0].部门);
                                    $("#HWHID").val(checkStatus.data[0].HWHID);
                                    $("#HWHName").val(checkStatus.data[0].仓库);
                                    $("#HSupID").val(checkStatus.data[0].HSupID);
                                    $("#HSupName").val(checkStatus.data[0].供应商);
                                    $("#HEmpID").val(checkStatus.data[0].HEmpID);
                                    $("#HEmpName").val(checkStatus.data[0].业务员);
                                    $("#HManagerID").val(checkStatus.data[0].HManagerID);
                                    $("#HManagerName").val(checkStatus.data[0].主管);
                                    $("#HInvoiceBillNo").val(checkStatus.data[0].发票编号);
                                    $("#HInnerBillNo").val(checkStatus.data[0].内部单据号);
                                    var j = 0;
                                    for (var i = 0; i < result.data.length; i++) {
                                        var HNewQty = checkStatus.data[j].数量 - checkStatus.data[j].关联数量//数量
                                        var HNewMoney = checkStatus.data[j].金额 - checkStatus.data[j].关联数量 * checkStatus.data[j].单价//减少关联数量的金额
                                        var HNewTaxMoney = HNewMoney * checkStatus.data[j].税率 * 0.01
                                        var HNewlineTotal = HNewMoney + HNewTaxMoney;
                                        option.data.push({
                                            "HMaterID": checkStatus.data[j].HMaterID, "物料代码": checkStatus.data[j].物料代码, "物料名称": checkStatus.data[j].物料名称, "规格型号": checkStatus.data[j].规格型号,
                                            "HUnitID": checkStatus.data[j].HUnitID, "计量单位": checkStatus.data[j].计量单位, "HWHID": checkStatus.data[j].HWHIDSub, "收料仓库": checkStatus.data[j].仓库名称,
                                            "HSPID": checkStatus.data[j].HSPID, "仓位名称": checkStatus.data[j].仓位名称, "HQtyMust": checkStatus.data[j].数量,
                                            "HQty": HNewQty, "HPrice": checkStatus.data[j].单价, "HMoney": HNewMoney,"HOrderPrice": checkStatus.data[j].金额,
                                            "HSourceBillNo": checkStatus.data[j].单据号, "HSourceBillType": checkStatus.data[j].HBillType, "HSourceInterID": checkStatus.data[j].hmainid, "HSourceEntryID": checkStatus.data[j].hsubid,
                                            "HTaxRate": checkStatus.data[j].税率, "HTaxPrice": checkStatus.data[j].含税单价, "HlineTotal": HNewlineTotal
                                        })
                                        j++;
                                    }
                                } else if ($("#HSourceBillType").val() == "1103") {
                                    option.data = [];//清空子表
                                    $("#HProjectName").val(checkStatus.data[0].项目名称);
                                    $("#HProjectNumber").val(checkStatus.data[0].项目代码);
                                    $("#HProjectID").val(checkStatus.data[0].HProjectID);
                                    $("#HDeptID").val(checkStatus.data[0].HDeptID);
                                    $("#HDeptName").val(checkStatus.data[0].部门);
                                    $("#HWHID").val(checkStatus.data[0].主表仓库ID);
                                    $("#HWHName").val(checkStatus.data[0].主表仓库);
                                    $("#HSupID").val(checkStatus.data[0].HSupID);
                                    $("#HSupName").val(checkStatus.data[0].供应商);
                                    $("#HEmpID").val(checkStatus.data[0].HEmpID);
                                    $("#HEmpName").val(checkStatus.data[0].业务员);
                                    $("#HManagerID").val(checkStatus.data[0].HManagerID);
                                    $("#HManagerName").val(checkStatus.data[0].主管);
                                    $("#HInvoiceBillNo").val(checkStatus.data[0].发票编号);
                                    $("#HInnerBillNo").val(checkStatus.data[0].内部单据号);
                                    var j = 0;
                                    for (var i = 0; i < result.data.length; i++) {
                                        var HNewQty = checkStatus.data[j].数量 - checkStatus.data[j].关联数量//数量
                                        var HNewMoney = checkStatus.data[j].金额 - checkStatus.data[j].关联数量 * checkStatus.data[j].单价//减少关联数量的金额
                                        var HNewTaxMoney = HNewMoney * checkStatus.data[j].税率 * 0.01
                                        var HNewlineTotal = HNewMoney + HNewTaxMoney;
                                        option.data.push({
                                            "HMaterID": checkStatus.data[j].HMaterID, "物料代码": checkStatus.data[j].物料代码, "物料名称": checkStatus.data[j].物料名称, "规格型号": checkStatus.data[j].规格型号,
                                            "HUnitID": checkStatus.data[j].HUnitID, "计量单位": checkStatus.data[j].计量单位, "HQtyMust": checkStatus.data[j].数量, "HQty": checkStatus.data[j].数量 - checkStatus.data[j].关联数量, "HRemark": "",
                                            "HPrice": checkStatus.data[j].单价, "HMoney": HNewMoney, "HOrderPrice": checkStatus.data[j].金额, "HWHID": checkStatus.data[j].HWHID, "收料仓库": checkStatus.data[j].收料仓库,
                                            "HSPID": checkStatus.data[j].HSPID, "仓位名称": checkStatus.data[j].仓位名称, "HBatchNo": "", "HPOOrderInterID": 0, "HPOOrderEntryID": 0,
                                            "HPOOrderBillNo": "", "HSeOrderInterID": 0, "HSeOrderEntryID": 0, "HSeOrderBillNo": "",
                                            "HSourceBillNo": checkStatus.data[j].单据号, "HSourceBillType": checkStatus.data[j].HBillType, "HSourceInterID": checkStatus.data[j].hmainid, "HSourceEntryID": checkStatus.data[j].hsubid,
                                            "HTaxRate": checkStatus.data[j].税率, "HTaxPrice": checkStatus.data[j].含税单价, "HlineTotal": HNewlineTotal
                                        })
                                        j++;
                                    }
                                }
                                table.render(option);
                                layer.close(ajaxLoad);
                                layer.msg("查询成功", { time: 1 * 1000, icon: 1 });
                            } else {
                                layer.alert(result.Message, { icon: 5, btn: ['退出'], time: 100000, offset: 't' });
                                layer.close(ajaxLoad);
                            }
                        }, error: function () {
                            layer.alert(result.Message + "发生错误!", { icon: 5 });
                            layer.close(ajaxLoad);
                        }
                    });
                }
            });
            //#endregion
            //#endregion
@@ -587,7 +712,7 @@
            function get_Inventory() {
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;
                if (checkStatus.data.length === 1) {
                if (checkStatus.data.length === 1 && data[0].HMaterID != 0) {
                    var HMaterID = data[0].HMaterID.toString();
                    //弹窗方法
                    layer.open({
@@ -604,7 +729,7 @@
                    })
                }
                else {
                    layer.msg('请选择一行数据查询!');
                    layer.msg('请选择一行有物料数据查询!');
                }
            }
            //#endregion
@@ -612,7 +737,7 @@
            function get_InOutSum() {
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;
                if (checkStatus.data.length === 1) {
                if (checkStatus.data.length === 1 && data[0].HMaterID != 0) {
                    var HMaterID = data[0].HMaterID.toString();
                    layer.open({
                        type: 2//弹窗类型
@@ -628,17 +753,44 @@
                    })
                }
                else {
                    layer.msg('请选择一行数据查询!');
                    layer.msg('请选择一行有物料数据查询!');
                }
            }
            //#endregion
            //#region æ ¹æ®ç‰©æ–™ID获取精度
            function getDecByMaterID(HMaterID) {
                var resultData = {};
                $.ajax({  // å¼‚步请求
                    url: GetWEBURL() + "Gy_Material/getDecByID",  //请求地址
                    async: false,   //是否开启异步
                    type: "GET",   //请求类型
                    data: {   //定义发送到服务器的数据
                        "HMaterID": HMaterID     //  å°†hmaterid作为请求参数发送
                    },
                    success: function (result) {   // å½“请求成功时,执行这个函数
                        if (result.code == 1) { // å¦‚果服务器返回的数据中的`code字段等于1,这可能表示审核操作成功执行
                            var data = result.data; //声明data变量,并将其赋值为result对象中的data属性
                            resultData = data[0];   //将data数组(或类数组对象)的第一个元素赋值给变量resultData
                        }
                        //else {
                        //    layer.alert(result.Message, { icon: 5, btn: ['退出'], time: 100000, offset: 't' }); //result.msg对象,提示弹窗 ç±»åž‹ä¸º5, æŒ‰é’®ï¼Œå’ŒæŒ‰é’®çš„名称为退出  æ—¶é—´ ä¸º100秒,以及偏移量(`offset: 't'
                        //}
                    }, error: function () {
                        layer.alert("发生错误!", { icon: 5 });  //提示弹窗 å‘生错误 ï¼Œè­¦ç¤ºæ ‡å¿—为5的
                    }
                });
                return resultData;
            }
            //#endregion
            //#region ç›‘听单元格编辑  å•元格编辑后 å˜æ›´
            table.on('edit(mainTable)', function (obj) {
                //数值格式校验工具
                var ref = /^\d+(\.\d+)?$/;          //非负数正则表达式
                var temp = "";
                var Dec = getDecByMaterID(obj.data.HMaterID) //获取精度
                var HQtyDec = (Dec["HQtyDec"] == null || Dec["HQtyDec"] == 0) ? 4 : Dec["HQtyDec"];  //数量精度
                var HPriceDec = (Dec["HPriceDec"] == null || Dec["HPriceDec"] == 0) ? 4 : Dec["HPriceDec"];  //单价精度
                var HMoneyDec = (Dec["HMoneyDec"] == null || Dec["HMoneyDec"] == 0) ? 2 : Dec["HMoneyDec"];  //金额精度
                // å•元格编辑之前的值
                var oldText = $(this).prev().text();
                var value = obj.value //得到修改后的值
@@ -670,12 +822,12 @@
                        var HTaxMoney = HMoney * HTaxRate;              //税额=金额*税率
                        var HlineTotal = HMoney + HTaxMoney;            //价税合计=金额+税额
                        HQty = dealDoubleToFixed(HQty, 1);
                        HPrice = dealDoubleToFixed(HPrice, 3);
                        HTaxRate = HTaxRate;
                        HTaxPrice = dealDoubleToFixed(HTaxPrice, 3);
                        HMoney = dealDoubleToFixed(HMoney, 2);
                        HlineTotal = dealDoubleToFixed(HlineTotal, 2);
                        HQty = Number(HQty.toFixed(HQtyDec));
                        HPrice = Number(HPrice.toFixed(HPriceDec));
                        HTaxPrice = Number(HTaxPrice.toFixed(HPriceDec));
                        HMoney = Number(HMoney.toFixed(HMoneyDec));
                        HlineTotal = Number(HlineTotal.toFixed(HMoneyDec));
                        //同步更新表格和缓存对应的值
                        obj.update({
@@ -684,10 +836,9 @@
                            , HMoney: HMoney
                            , HTaxRate: HTaxRate * 100
                            , HTaxPrice: HTaxPrice
                            , HMoney: HMoney
                            , HlineTotal: HlineTotal
                        });
                        /* table.render(option);*/
                         table.render(option);
                        break;
                    case "HPrice":                                         //单价
                        //数据格式校验
@@ -697,7 +848,7 @@
                            obj.update({
                                HPrice: oldText
                            });
                            /* table.render(option);*/
                             table.render(option);
                            layer.msg("单价请输入大于0的数字!");
                            return;
@@ -713,12 +864,12 @@
                        var HlineTotal = HMoney + HTaxMoney;            //价税合计=金额+税额
                        //设置数据小数位数
                        HQty = dealDoubleToFixed(HQty, 1);
                        HPrice = dealDoubleToFixed(HPrice, 3);
                        HTaxRate = HTaxRate;
                        HTaxPrice = dealDoubleToFixed(HTaxPrice, 3);
                        HMoney = dealDoubleToFixed(HMoney, 2);
                        HlineTotal = dealDoubleToFixed(HlineTotal, 2);
                        HQty = Number(HQty.toFixed(HQtyDec));
                        HPrice = Number(HPrice.toFixed(HPriceDec));
                        HTaxPrice = Number(HTaxPrice.toFixed(HPriceDec));
                        HMoney = Number(HMoney.toFixed(HMoneyDec));
                        HlineTotal = Number(HlineTotal.toFixed(HMoneyDec));
                        //同步更新表格和缓存对应的值
                        obj.update({
@@ -729,6 +880,7 @@
                            , HTaxPrice: HTaxPrice
                            , HlineTotal: HlineTotal
                        });
                        table.render(option)
                        break;
                    case "HMoney":                                         //金额
                        //数据格式校验
@@ -738,7 +890,7 @@
                            obj.update({
                                HMoney: oldText
                            });
                            /* table.render(option);*/
                             table.render(option);
                            layer.msg("金额请输入大于0的数字!");
                            return;
@@ -747,18 +899,18 @@
                        //数据校验合格,重算记录
                        var HQty = obj.data.HQty * 1;                   //数量
                        var HMoney = value * 1;
                        var HPrice = (HMoney / HQty).toFixed(2);       //单价=金额/数量
                        var HTaxRate = value * 0.01;                       //税率
                        var HPrice = (HMoney / HQty);       //单价=金额/数量
                        var HTaxRate = obj.data.HTaxRate * 0.01;                       //税率
                        var HTaxPrice = HPrice * (1 + HTaxRate);        //含税单价=单价*(1+税率)
                        var HTaxMoney = HMoney * HTaxRate;              //税额=金额*税率
                        var HlineTotal = HMoney + HTaxMoney;            //价税合计=金额+税额
                        HQty = dealDoubleToFixed(HQty, 1);
                        HPrice = dealDoubleToFixed(HPrice, 3);
                        HTaxRate = HTaxRate;
                        HTaxPrice = dealDoubleToFixed(HTaxPrice, 3);
                        HMoney = dealDoubleToFixed(HMoney, 2);
                        HlineTotal = dealDoubleToFixed(HlineTotal, 2);
                        HQty = Number(HQty.toFixed(HQtyDec));
                        HPrice = Number(HPrice.toFixed(HPriceDec));
                        HTaxPrice = Number(HTaxPrice.toFixed(HPriceDec));
                        HMoney = Number(HMoney.toFixed(HMoneyDec));
                        HlineTotal = Number(HlineTotal.toFixed(HMoneyDec));
                        //同步更新表格和缓存对应的值
@@ -770,8 +922,8 @@
                            , HMoney: HMoney
                            , HlineTotal: HlineTotal
                        });
                        break;
                        table.render(option);
                        break;
                    case "HTaxRate":                                                       //数量
                        //数据格式校验
                        temp = value + "";
@@ -800,12 +952,12 @@
                        var HlineTotal = HMoney + HTaxMoney;            //价税合计=金额+税额
                        //设置数据小数位数
                        HQty = dealDoubleToFixed(HQty, 1);
                        HPrice = dealDoubleToFixed(HPrice, 3);
                        HTaxRate = HTaxRate;
                        HTaxPrice = dealDoubleToFixed(HTaxPrice, 3);
                        HMoney = dealDoubleToFixed(HMoney, 2);
                        HlineTotal = dealDoubleToFixed(HlineTotal, 2);
                        HQty = Number(HQty.toFixed(HQtyDec));
                        HPrice = Number(HPrice.toFixed(HPriceDec));
                        HTaxPrice = Number(HTaxPrice.toFixed(HPriceDec));
                        HMoney = Number(HMoney.toFixed(HMoneyDec));
                        HlineTotal = Number(HlineTotal.toFixed(HMoneyDec));
                        //同步更新表格和缓存对应的值
                        obj.update({
@@ -817,6 +969,45 @@
                            , HlineTotal: HlineTotal
                        });
                        //table.render(option);
                        break;
                    case "HTaxPrice":                                         //单价
                        //数据格式校验
                        temp = value + "";     //修改后的值 è½¬ä¸ºå­—符串 èµ‹å€¼ç»™  å˜é‡temp
                        // ref很可能是一个正则表达式对象,用于匹配特定的字符串模式。ref.test(temp)会检查变量temp(即转换后的单价字符串)是否符合ref定义的模式。如果test方法返回false
                        if (!ref.test(temp)) { //检查单价字符串是否符合预期的格式
                            //恢复数据到编辑前
                            obj.update({            //更新表格某一行数据
                                HTaxPrice: oldText     //将hprice字段恢复到保存前的值
                            });
                            table.render(option);
                            layer.msg("含税单价请输入数字!");   //请输入单价的数值
                            return;
                        }
                        //数据校验合格,重算记录
                        var HQty = obj.data.HQty * 1;                   //数量
                        var HTaxPrice = value * 1;                    //含税单价
                        var HTaxRate = obj.data.HTaxRate * 0.01;           //税率
                        var HPrice = Number((HTaxPrice / (1 + HTaxRate)).toFixed(4));                         //单价 = å«ç¨Žå•ä»·/(1+税率)
                        var HMoney = HQty * HPrice;                     //金额=数量*单价
                        var HTaxMoney = Number((HMoney * HTaxRate).toFixed(4));         //税额=金额*税率
                        var HlineTotal = HMoney + HTaxMoney;            //价税合计=金额+税额
                        HQty = Number(HQty.toFixed(HQtyDec));
                        HPrice = Number(HPrice.toFixed(HPriceDec));
                        HTaxPrice = Number(HTaxPrice.toFixed(HPriceDec));
                        HMoney = Number(HMoney.toFixed(HMoneyDec));
                        HlineTotal = Number(HlineTotal.toFixed(HMoneyDec));
                        //同步更新表格和缓存对应的值
                        obj.update({                    //更新表格数据                æ–¹æ³•是该对象提供的一个方法,用于更新其内部状态或与之关联的数据源
                            HQty: HQty                               //更新HQty字段,HQty
                            , HPrice: HPrice                         //更新HPrice字段,HPrice
                            , HMoney: HMoney                      //更新HMoney字段,HMoney
                            , HlineTotal: HlineTotal                  //更新HlineTotal字段,HlineTotal
                            , HTaxPrice, HTaxPrice                   //更新HTaxPrice字段,HTaxPrice
                        });
                        table.render(option)
                        break;
                    default:
                }
@@ -904,10 +1095,10 @@
                    , totalRow: true
                    , cols: [[ //子表
                        { type: 'checkbox', totalRowText: '合计行' }
                        , { type: 'numbers', title: '序号', width: 100 }
                        , { type: 'HSourceBillNo', title: '源单号', width: 100, hide: true }//源单号
                        , { type: 'numbers',field: '序号', title: '序号', width: 100 }
                        , { field: 'HSourceBillNo', title: '源单号', width: 100, hide: true }//源单号
                        , { field: 'HSourceBillType', title: '源单类型', width: 100, hide: true }//源单类型
                        , { type: 'HSourceInterID', title: '源单主内码', width: 100, hide: true }//源单主内码
                        , { field: 'HSourceInterID', title: '源单主内码', width: 100, hide: true }//源单主内码
                        , { field: 'HSourceEntryID', title: '源单子内码', width: 100, hide: true }//源单子内码
                        , { field: 'HMaterID', title: 'HMaterID', width: 100, hide: true }
                        , { field: '物料代码', title: '物料代码', width: 150, edit: 'text', event: "HMaterID" }//f7
@@ -920,7 +1111,7 @@
                        , { field: 'HPrice', title: '单价', width: 100, edit: 'text' }
                        , { field: 'HMoney', title: '金额', width: 100, edit: 'text', totalRow: true }
                        , { field: 'HOrderPrice', title: '采购金额', width: 100, edit: 'text', totalRow: true}
                        , { field: 'HWHID ', title: 'HWHID ', width: 100, hide: true }
                        , { field: 'HWHID', title: 'HWHID', width: 100, hide: true }
                        , { field: '收料仓库', title: '收料仓库', width: 100, edit: 'text', event: "HWHID" }//f7
                        , { field: 'HSPID', title: 'HSPID', width: 100, hide: true }
                        , { field: '仓位名称', title: '仓位名称', width: 100, edit: 'text', event: "HSPID" }//f7
@@ -935,6 +1126,8 @@
                option.data = [];
                table.render(option);
                DisPlay_HideColumn();
            }
            //#region åŠ è½½è¡¨å¤´
@@ -981,11 +1174,11 @@
                                , "HMaker": data.制单人
                                , "HChecker": data.审核人
                                , "HCloseMan": data.关闭人
                                , "HMakeDate": data.制单日期
                                , "HCheckDate": data.审核日期
                                , "HCloseDate": data.关闭日期
                                , "HUpDateDate": data.修改日期
                                , "HDeleteDate": data.作废日期
                                , "HMakeDate": data.制单日期 == null ? "" : Pub_Format(data.制单日期, "yyyy-MM-dd hh:mm:ss")
                                , "HCheckDate": data.审核日期 == null ? "" : Pub_Format(data.审核日期, "yyyy-MM-dd hh:mm:ss")
                                , "HCloseDate": data.关闭日期 == null ? "" : Pub_Format(data.关闭日期, "yyyy-MM-dd hh:mm:ss")
                                , "HUpDateDate": data.修改日期 == null ? "" : Pub_Format(data.修改日期, "yyyy-MM-dd hh:mm:ss")
                                , "HDeleteDate": data.作废日期 == null ? "" : Pub_Format(data.作废日期, "yyyy-MM-dd hh:mm:ss")
                            });
                            //子表  èµ‹å€¼
@@ -1034,7 +1227,7 @@
                }
            });
      //#region ä¿å­˜æŒ‰é’®
            //#region ä¿å­˜æŒ‰é’®
            form.on('submit(Saver)', function (data) {
                //#region åˆ¤æ–­æºå•状态
                if (OperationType == 1 || OperationType == 4) {
@@ -1046,8 +1239,11 @@
                                var HSourceBillData = getPushSource_POOrderBillInit(option.data[i].HSourceInterID, option.data[i].HSourceEntryID);            //获取源单数据
                                if (HSourceBillData != "none") {
                                    if (HSourceBillData == null) {
                                        layer.alert("保存失败!第" + (i + 1) + "行:未查询到源单单据!", { icon: 5 });
                                        return;
                                        if (option.data[i].HSourceInterID!=0) {
                                            layer.alert("保存失败!第" + (i + 1) + "行:未查询到源单单据!", { icon: 5 });
                                            return;
                                        }
                                    } else if (HSourceBillData.状态 != "已审核") {
                                        var err = "保存失败!原因:第" + (i + 1) + "行-源单单据状态为“" + HSourceBillData.状态 + "”,不允许保存!";
                                        layer.alert(err, { icon: 5 });
@@ -1069,8 +1265,10 @@
                                var HSourceBillData = getPushSource_POInStockBillInit(option.data[i].HSourceInterID, option.data[i].HSourceEntryID);            //获取源单数据
                                if (HSourceBillData != "none") {
                                    if (HSourceBillData == null) {
                                        layer.alert("保存失败!第" + (i + 1) + "行:未查询到源单单据!", { icon: 5 });
                                        return;
                                        if (option.data[i].HSourceInterID != 0) {
                                            layer.alert("保存失败!第" + (i + 1) + "行:未查询到源单单据!", { icon: 5 });
                                            return;
                                        }
                                    } else if (HSourceBillData.状态 != "已审核") {
                                        var err = "保存失败!原因:第" + (i + 1) + "行-源单单据状态为“" + HSourceBillData.状态 + "”,不允许保存!";
                                        layer.alert(err, { icon: 5 });
@@ -1257,6 +1455,8 @@
                        , "HCurID": dataArray[0].HCurID
                        , "HCurName": dataArray[0].币别
                        , "HExRate": dataArray[0].汇率
                        , "HWHName": dataArray[0].主表仓库
                        , "HWHID": dataArray[0].主表仓库ID
                        , "HSSID": "0"
                        , "HSSName": ""
                        , "HProjectID": dataArray[0].HProjectID
@@ -1267,7 +1467,8 @@
                    });
                    //子表  èµ‹å€¼
                    var rowdata = [];
                   var rowdata = [];
                    for (var i = 0; i < dataArray.length; i++) {
                        rowdata.push(
                            {
@@ -1277,9 +1478,11 @@
                                , "规格型号": dataArray[i].规格型号
                                , "HUnitID": dataArray[i].HUnitID
                                , "计量单位": dataArray[i].计量单位
                                , "HQty": dealDoubleToFixed(dataArray[i].数量, 1)
                                , "HQty": dealDoubleToFixed(dataArray[i].数量, 2)
                                , "HPrice": dealDoubleToFixed(dataArray[i].单价, 3)
                                /*, "HTaxPrice": dealDoubleToFixed(dataArray[i].含税单价, 3)*/
                                , "HTaxPrice": dealDoubleToFixed(dataArray[i].含税单价, 3)
                                , "HQtyMust": dealDoubleToFixed(dataArray[i].数量, 2)
                                , "HOrderPrice": dealDoubleToFixed(dataArray[i].数量 * dataArray[i].单价, 2)
                                , 'HDiscountRate': "0"                                                     //
                                , 'HRelTaxPrice': "0"
                                , "HTaxRate": dataArray[i].税率
@@ -1324,10 +1527,10 @@
            //#endregion
            //#region ä¿å­˜æ–¹æ³•
            function set_SaveBill(data) {
                if ($("#HEmpName").val() == 0) {
                    layer.msg("请选择业务员!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return;
                }
                //if ($("#HEmpName").val() == 0) {
                //    layer.msg("请选择业务员!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                //    return;
                //}
                if ($("#HDeptName").val() == 0) {
                    layer.msg("请选择部门!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
@@ -1341,14 +1544,14 @@
                    layer.msg("请选择仓库!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return;
                }
                if ($("#HKeeperID").val() == 0) {
                    layer.msg("请选择保管员!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return;
                }
                if ($("#HSecManagerID").val() == 0) {
                    layer.msg("请选择验收员!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return;
                }
                //if ($("#HKeeperID").val() == 0) {
                //    layer.msg("请选择保管员!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                //    return;
                //}
                //if ($("#HSecManagerID").val() == 0) {
                //    layer.msg("请选择验收员!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                //    return;
                //}
                var num = [];
@@ -1393,10 +1596,15 @@
                    success: function (data) {
                        if (data.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                            layer.msg(data.Message, { icon: 1 });
                            if (data.Verify == "Y") //自动审核
                            {
                                $("#HInterID").val(data.HInterID);//获取提交成功返回的单据主ID
                                set_CheckBill(0); //审核
                            }
                            $('#add-btn').addClass("layui-btn-disabled").attr("disabled", true);
                            //保存后浏览
                            //ReRoadBillMain();
                            $('#print-btn').prop('disabled', false).removeClass('layui-btn-disabled');
                        }
                        else {
                            layer.alert(data.Message, { icon: 5 });
@@ -1414,13 +1622,14 @@
            ////#endregion
            function get_checkEmp() {
                var HOrgID = $("#HOrgID").val();
                layer.open({
                    type: 2//弹窗类型
                    , skin: 'layui-layer-rim' //加上边框
                    , area: ['90%', '90%']//大小
                    , title: '业务员列表'//标题
                    , shift: 2//弹出动画
                    , content: ['../../基础资料/公用基础资料/Gy_EmployeeList.html?Type=HEmp', 'yes']
                    , content: ['../../基础资料/公用基础资料/Gy_EmployeeList.html?Type=HEmp&HOrgID=' + HOrgID, 'yes']
                    , btn: ['确定', '取消']
                    , btn1: function (index, layero) {//按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
@@ -1436,13 +1645,14 @@
                })
            }
            function get_checkSup() {
                var HOrgName = $('select[name="HOrgID"] option:selected').text();
                layer.open({
                    type: 2//弹窗类型
                    , skin: 'layui-layer-rim' //加上边框
                    , area: ['90%', '90%']//大小
                    , title: '供应商列表'//标题
                    , shift: 2//弹出动画
                    , content: ['../../基础资料/采购基础资料/Gy_Supplier.html?Type=HSup', 'yes']
                    , content: ['../../基础资料/采购基础资料/Gy_Supplier.html?Type=HSup&HOrgName=' + HOrgName, 'yes']
                    , btn: ['确定', '取消']
                    , btn1: function (index, layero) {//按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
@@ -1459,13 +1669,14 @@
            }
            //工程项目
            function get_btnHProjectID() {
                var HOrgID = $("#HOrgID").val();
                layer.open({
                    type: 2//弹窗类型
                    , skin: 'layui-layer-rim' //加上边框
                    , area: ['90%', '90%']//大小
                    , title: '项目列表'//标题
                    , shift: 2//弹出动画
                    , content: ['../../项目管理/工程项目/PM_ProjectBillList.html', 'yes']
                    , content: ['../../项目管理/工程项目/PM_ProjectBillList.html?Type=2&HOrgID=' + HOrgID, 'yes']
                    , btn: ['确定', '取消']
                    , btn1: function (index, layero) {//按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
@@ -1482,13 +1693,14 @@
                })
            }
            function get_checkWH() {
                var HOrgName = $('select[name="HOrgID"] option:selected').text();
                layer.open({
                    type: 2//弹窗类型
                    , skin: 'layui-layer-rim' //加上边框
                    , area: ['90%', '90%']//大小
                    , title: '仓库列表'//标题
                    , shift: 2//弹出动画
                    , content: ['../../基础资料/公用基础资料/Gy_Warehouse.html?Type=HWH', 'yes']
                    , content: ['../../基础资料/公用基础资料/Gy_Warehouse.html?Type=HWH&HOrgName=' + HOrgName, 'yes']
                    , btn: ['确定', '取消']
                    , btn1: function (index, layero) {//按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
@@ -1515,13 +1727,14 @@
                })
            }
            function get_checkSecManager() {
                var HOrgID = $("#HOrgID").val();
                layer.open({
                    type: 2//弹窗类型
                    , skin: 'layui-layer-rim' //加上边框
                    , area: ['90%', '90%']//大小
                    , title: '验收员列表'//标题
                    , shift: 2//弹出动画
                    , content: ['../../基础资料/公用基础资料/Gy_EmployeeList.html?Type=HSecManager', 'yes']
                    , content: ['../../基础资料/公用基础资料/Gy_EmployeeList.html?Type=HSecManager&HOrgID=' + HOrgID, 'yes']
                    , btn: ['确定', '取消']
                    , btn1: function (index, layero) {//按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
@@ -1537,13 +1750,14 @@
                })
            }
            function get_checkKeeper() {
                var HOrgID = $("#HOrgID").val();
                layer.open({
                    type: 2//弹窗类型
                    , skin: 'layui-layer-rim' //加上边框
                    , area: ['90%', '90%']//大小
                    , title: '保管员列表'//标题
                    , shift: 2//弹出动画
                    , content: ['../../基础资料/公用基础资料/Gy_EmployeeList.html?Type=HKeeper', 'yes']
                    , content: ['../../基础资料/公用基础资料/Gy_EmployeeList.html?Type=HKeeper&HOrgID=' + HOrgID, 'yes']
                    , btn: ['确定', '取消']
                    , btn1: function (index, layero) {//按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
@@ -1559,13 +1773,14 @@
                })
            }
            function get_checkDept() {
                var HOrgName = $('select[name="HOrgID"] option:selected').text();
                layer.open({
                    type: 2//弹窗类型
                    , skin: 'layui-layer-rim' //加上边框
                    , area: ['90%', '90%']//大小
                    , title: '部门列表'//标题
                    , shift: 2//弹出动画
                    , content: ['../../基础资料/公用基础资料/Gy_DepartmentList.html', 'yes']
                    , content: ['../../基础资料/公用基础资料/Gy_DepartmentList.html?Type=2&HOrgName=' + HOrgName, 'yes']
                    , btn: ['确定', '取消']
                    , btn1: function (index, layero) {//按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
@@ -1582,13 +1797,14 @@
            }
            function get_checkManager() {
                var HOrgID = $("#HOrgID").val();
                layer.open({
                    type: 2//弹窗类型
                    , skin: 'layui-layer-rim' //加上边框
                    , area: ['90%', '90%']//大小
                    , title: '负责人列表'//标题
                    , shift: 2//弹出动画
                    , content: ['../../基础资料/公用基础资料/Gy_EmployeeList.html?Type=HWorker', 'yes']
                    , content: ['../../基础资料/公用基础资料/Gy_EmployeeList.html?Type=HWorker&HOrgID=' + HOrgID, 'yes']
                    , btn: ['确定', '取消']
                    , btn1: function (index, layero) {//按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
@@ -1634,6 +1850,208 @@
            //行内快捷键筛选
            function set_GridCellCheck(obj) {
                $(document).off('keydown', ".layui-table-edit").on('keydown', '.layui-table-edit', function (e) {
                    //#region å­è¡¨æ–‡æœ¬æ¡†è¾“入后检索数据
                    if (event.key != "F7") {
                        var errKeys = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight", "Enter"];
                        if (obj.event == "HMaterID") {                           //定位当前正在输入的文本框的列名
                            if ($.inArray(event.key, errKeys) == -1) {              //如果按下的键位不是 æ–¹å‘键,则刷新弹窗中的数据
                                if (childPage == null) {                            //判断当前子窗口是否已经打开,若未打卡,则打开页面,并获取子窗口的对象
                                    var offset = $(this).offset();                  //获取触发事件的元素的位置,用于定位子窗口打开的位置
                                    var innerHeight = window.innerHeight;
                                    var top = offset.top + 0.05 * innerHeight;
                                    var left = offset.left;
                                    if (top + 0.05 * innerHeight + 0.3 * innerHeight > innerHeight) {
                                        top = top - 0.3 * innerHeight - 0.05 * innerHeight;
                                    }
                                    layer.open({
                                        type: 2                                                                                     //弹窗类型
                                        , skin: 'layui-layer-rim'                                                                   //加上边框
                                        , area: ['25%', '30%']                                                                      //大小
                                        , shadeClose: true                                                                          //点击遮罩时关闭弹窗
                                        , offset: [top, left]
                                        , title: false                                                                              //不显示标题栏
                                        //, title: '项目费用列表'                                                                     //标题
                                        , shift: 2                                                                                  //弹出动画
                                        , closeBtn: 0                                                                               //禁用关闭按钮
                                        , content: ["../../基础资料/通用基础资料/Gy_CommonBaseData.html?OperationType=2", "yes"]
                                        , success: function (layero, index) {
                                            setTimeout(function () {
                                                var value = $(e.currentTarget).val().replace("'", "");                                  //获取文本框最新值
                                                currRowIndex = 0;
                                                var tableView = "h_v_Gy_MaterialList";
                                                var childSWhere = "select top(10) HItemID,物料代码,物料名称,规格型号,HUnitID,计量单位名称 from " + tableView + " where 1=1 and ç»„织名称 = '" + sessionStorage["Organization"] + "' and (物料代码 like '%" + value + "%' or ç‰©æ–™åç§° like '%" + value + "%') order by ç‰©æ–™ä»£ç  desc";
                                                childPage.getData(childSWhere, tableView);
                                            }, 200);
                                        }
                                        , end: function () {
                                            obj.event = "";
                                            childPage = null;
                                            currRowIndex = 0;
                                            if (childData != null) {
                                                OptionData = childData;
                                                //通过供应商id获取税率
                                                var HSupID = $("#HSupID").val();
                                                if (HSupID != 0 && typeof (OptionData.HItemID) != "undefined") {
                                                    var Dec = getDecByMaterID(obj.data.HMaterID) //获取精度
                                                    var HQtyDec = (Dec["HQtyDec"] == null || Dec["HQtyDec"] == 0) ? 4 : Dec["HQtyDec"];  //数量精度
                                                    var HPriceDec = (Dec["HPriceDec"] == null || Dec["HPriceDec"] == 0) ? 4 : Dec["HPriceDec"];  //单价精度
                                                    var HMoneyDec = (Dec["HMoneyDec"] == null || Dec["HMoneyDec"] == 0) ? 2 : Dec["HMoneyDec"];  //金额精度
                                                    $.ajax({
                                                        url: GetWEBURL() + "/Gy_Supplier/xg",
                                                        //url: "http://localhost:12761/Gy_Supplier/xg",
                                                        type: "GET",
                                                        data: {
                                                            "HInterID": HSupID
                                                        },
                                                        success: function (d) {
                                                            var HTaxRate = parseInt(d.data[0].增值税率) * 0.01;
                                                            //数据校验合格,重算记录
                                                            var HQty = obj.data.HQty * 1;                           //数量
                                                            var HPrice = obj.data.HPrice * 1;               //单价
                                                            var HMoney = HQty * HPrice;                     //金额=数量*单价
                                                            var HTaxMoney = Number((HMoney * HTaxRate));         //税额=金额*税率
                                                            var HTaxPrice = Number((HPrice * (1 + HTaxRate)));        //含税单价=单价*(1+税率)
                                                            var HlineTotal = HMoney + HTaxMoney;            //价税合计=金额+税额
                                                            //数字精度
                                                            HQty = Number(HQty.toFixed(HQtyDec));
                                                            HPrice = Number(HPrice.toFixed(HPriceDec));
                                                            HMoney = Number(HMoney.toFixed(HMoneyDec));
                                                            HTaxMoney = Number(HTaxMoney.toFixed(HMoneyDec));
                                                            HlineTotal = Number(HlineTotal.toFixed(HMoneyDec));
                                                            HTaxPrice = Number(HTaxPrice.toFixed(HPriceDec));
                                                            obj.update({ //更新表格数据
                                                                "HMaterID": OptionData.HItemID             //设置HItemID的值为“HBillNo”字段的值HItemID`的值
                                                                , "物料代码": OptionData.物料代码
                                                                , "物料名称": OptionData.物料名称
                                                                , "规格型号": OptionData.规格型号
                                                                , "HUnitID": OptionData.HUnitID
                                                                , "计量单位": OptionData.计量单位名称
                                                                , "HTaxRate": HTaxRate * 100
                                                                , "HQty": HQty                               //更新HQty字段,HQty
                                                                , "HPrice": HPrice                         //更新HPrice字段,HPrice
                                                                , "HMoney": HMoney                      //更新HMoney字段,HMoney
                                                                , "HlineTotal": HlineTotal                  //更新HlineTotal字段,HlineTotal
                                                                , "HTaxPrice": HTaxPrice                   //更新HTaxPrice字段,HTaxPrice
                                                            })
                                                        }
                                                    });
                                                } else if (typeof (OptionData.HItemID) != "undefined") {
                                                    obj.update({ //更新表格数据
                                                        "HMaterID": OptionData.HItemID             //设置HItemID的值为“HBillNo”字段的值HItemID`的值
                                                        , "物料代码": OptionData.物料代码
                                                        , "物料名称": OptionData.物料名称
                                                        , "规格型号": OptionData.规格型号
                                                        , "HUnitID": OptionData.HUnitID
                                                        , "计量单位": OptionData.计量单位名称
                                                    })
                                                }
                                                OptionData = {};
                                                childData = null;
                                            }
                                        }
                                    });
                                } else {
                                    setTimeout(function () {
                                        var value = $(e.currentTarget).val().replace("'", "");                                  //获取文本框最新值
                                        currRowIndex = 0;
                                        var tableView = "h_v_Gy_MaterialList";
                                        var childSWhere = "select top(10) HItemID,物料代码,物料名称,规格型号,HUnitID,计量单位名称 from " + tableView + " where 1=1 and ç»„织名称 = '" + sessionStorage["Organization"] + "' and (物料代码 like '%" + value + "%' or ç‰©æ–™åç§° like '%" + value + "%')  order by ç‰©æ–™ä»£ç  desc";
                                        childPage.getData(childSWhere, tableView);
                                    }, 200);
                                }
                            } else {                                                    //如果按下的键位是 æ–¹å‘键,则调整窗口中 é€‰ä¸­è¡Œ çš„位置
                                if (event.key == "ArrowUp") {
                                    currRowIndex--;
                                    childPage.setSelectedRow(currRowIndex);
                                } else if (event.key == "ArrowDown") {
                                    currRowIndex++;
                                    childPage.setSelectedRow(currRowIndex);
                                } else if (event.key == "Enter") {
                                    //手动失焦
                                    var element = document.getElementById("HBillNo");
                                    element.focus();
                                    childPage.getSelectedData(currRowIndex);
                                    if (childData != null) {
                                        OptionData = childData;
                                        //通过供应商id获取税率
                                        var HSupID = $("#HSupID").val();
                                        if (HSupID != 0 && typeof (OptionData.HItemID) != "undefined") {
                                            var Dec = getDecByMaterID(obj.data.HMaterID) //获取精度
                                            var HQtyDec = (Dec["HQtyDec"] == null || Dec["HQtyDec"] == 0) ? 4 : Dec["HQtyDec"];  //数量精度
                                            var HPriceDec = (Dec["HPriceDec"] == null || Dec["HPriceDec"] == 0) ? 4 : Dec["HPriceDec"];  //单价精度
                                            var HMoneyDec = (Dec["HMoneyDec"] == null || Dec["HMoneyDec"] == 0) ? 2 : Dec["HMoneyDec"];  //金额精度
                                            $.ajax({
                                                url: GetWEBURL() + "/Gy_Supplier/xg",
                                                //url: "http://localhost:12761/Gy_Supplier/xg",
                                                type: "GET",
                                                data: {
                                                    "HInterID": HSupID
                                                },
                                                success: function (d) {
                                                    var HTaxRate = parseInt(d.data[0].增值税率) * 0.01;
                                                    //数据校验合格,重算记录
                                                    var HQty = obj.data.HQty * 1;                           //数量
                                                    var HPrice = obj.data.HPrice * 1;               //单价
                                                    var HMoney = HQty * HPrice;                     //金额=数量*单价
                                                    var HTaxMoney = Number((HMoney * HTaxRate));         //税额=金额*税率
                                                    var HTaxPrice = Number((HPrice * (1 + HTaxRate)));        //含税单价=单价*(1+税率)
                                                    var HlineTotal = HMoney + HTaxMoney;            //价税合计=金额+税额
                                                    //数字精度
                                                    HQty = Number(HQty.toFixed(HQtyDec));
                                                    HPrice = Number(HPrice.toFixed(HPriceDec));
                                                    HMoney = Number(HMoney.toFixed(HMoneyDec));
                                                    HTaxMoney = Number(HTaxMoney.toFixed(HMoneyDec));
                                                    HlineTotal = Number(HlineTotal.toFixed(HMoneyDec));
                                                    HTaxPrice = Number(HTaxPrice.toFixed(HPriceDec));
                                                    obj.update({ //更新表格数据
                                                        "HMaterID": OptionData.HItemID             //设置HItemID的值为“HBillNo”字段的值HItemID`的值
                                                        , "物料代码": OptionData.物料代码
                                                        , "物料名称": OptionData.物料名称
                                                        , "规格型号": OptionData.规格型号
                                                        , "HUnitID": OptionData.HUnitID
                                                        , "计量单位": OptionData.计量单位名称
                                                        , "HTaxRate": HTaxRate * 100
                                                        , "HQty": HQty                               //更新HQty字段,HQty
                                                        , "HPrice": HPrice                         //更新HPrice字段,HPrice
                                                        , "HMoney": HMoney                      //更新HMoney字段,HMoney
                                                        , "HlineTotal": HlineTotal                  //更新HlineTotal字段,HlineTotal
                                                        , "HTaxPrice": HTaxPrice                   //更新HTaxPrice字段,HTaxPrice
                                                    })
                                                }
                                            });
                                        } else if (typeof (OptionData.HItemID) != "undefined") {
                                            obj.update({ //更新表格数据
                                                "HMaterID": OptionData.HItemID             //设置HItemID的值为“HBillNo”字段的值HItemID`的值
                                                , "物料代码": OptionData.物料代码
                                                , "物料名称": OptionData.物料名称
                                                , "规格型号": OptionData.规格型号
                                                , "HUnitID": OptionData.HUnitID
                                                , "计量单位": OptionData.计量单位名称
                                            })
                                        }
                                        OptionData = {};
                                        childData = null;
                                    }
                                    childPage = null;
                                    currRowIndex = 0;
                                    childData = null;
                                    obj.event = "";
                                }
                            }
                        }
                    }
                    //#endregion
                    if (event.key == "F7") {
                        //物料
                        if (obj.event == "HMaterID") {
@@ -1658,46 +2076,49 @@
                                    //}
                                    OptionData = checkStatus.data[0];
                                    var rowIndex = $(obj.tr).attr("data-index") * 1;
                                    for (var i = 0; i < checkStatus.data.length; i++) {
                                        if (rowIndex + i >= option.data.length) {
                                            var NewRow = {
                                                "HMaterID": 0, "物料代码": "", "物料名称": "", "规格型号": "","HUnitID": 0, "计量单位": "", "HQtyMust": "0", "HQty": "", "HRemark": "",
                                                "HPrice": "0", "HMoney": "0", "HOrderPrice": "0", "HWHID": 0, "收料仓库": "",
                                                "HSPID": 0, "仓位名称": "", "HBatchNo": "", "HPOOrderInterID": 0, "HPOOrderEntryID": 0,
                                                "HPOOrderBillNo": "", "HSeOrderInterID": 0, "HSeOrderEntryID": 0, "HSeOrderBillNo": "",
                                                "HSourceBillNo": 0, "HSourceBillType": 0, "HSourceInterID": 0, "HSourceEntryID": 0,
                                                "HTaxRate": 0, "HTaxPrice": 0, "HlineTotal": 0
                                            };
                                    if (checkStatus.data.length > 1) {
                                        var rowIndex = $(obj.tr).attr("data-index") * 1;
                                        for (var i = 0; i < checkStatus.data.length; i++) {
                                            if (rowIndex + i >= option.data.length) {
                                                var NewRow = {
                                                    "HMaterID": 0, "物料代码": "", "物料名称": "", "规格型号": "", "HUnitID": 0, "计量单位": "", "HQtyMust": "0", "HQty": "", "HRemark": "",
                                                    "HPrice": "0", "HMoney": "0", "HOrderPrice": "0", "HWHID": 0, "收料仓库": "",
                                                    "HSPID": 0, "仓位名称": "", "HBatchNo": "", "HPOOrderInterID": 0, "HPOOrderEntryID": 0,
                                                    "HPOOrderBillNo": "", "HSeOrderInterID": 0, "HSeOrderEntryID": 0, "HSeOrderBillNo": "",
                                                    "HSourceBillNo": 0, "HSourceBillType": 0, "HSourceInterID": 0, "HSourceEntryID": 0,
                                                    "HTaxRate": 0, "HTaxPrice": 0, "HlineTotal": 0
                                                };
                                            table.cache["mainTable"].push(NewRow);
                                            option.data = table.cache["mainTable"];
                                                table.cache["mainTable"].push(NewRow);
                                                option.data = table.cache["mainTable"];
                                            table.render(option);
                                                table.render(option);
                                            }
                                            var HMaterID = checkStatus.data[i].HItemID;
                                            var resultData = getMaterialByMaterID(HMaterID);
                                            option.data[rowIndex + i].HMaterID = resultData.HMaterID;
                                            option.data[rowIndex + i].物料代码 = resultData.HMaterNumber;
                                            option.data[rowIndex + i].物料名称 = resultData.HMaterName;
                                            option.data[rowIndex + i].规格型号 = resultData.HMaterModel;
                                            option.data[rowIndex + i].HUnitID = resultData.HUnitID;
                                            option.data[rowIndex + i].计量单位 = resultData.HUnitName;
                                            ////更新表格缓存的数据
                                            //obj.update({
                                            //    "HMaterID": checkStatus.data[0].HItemID
                                            //    , "物料代码": checkStatus.data[0].HNumber
                                            //    , "物料名称": checkStatus.data[0].HName
                                            //    , "规格型号": checkStatus.data[0].HModel
                                            //    , "HUnitID": checkStatus.data[0].HUnitID
                                            //    , "计量单位": checkStatus.data[0].HUnitName
                                            //})
                                            //layer.close(index);//关闭弹窗
                                        }
                                        var HMaterID = checkStatus.data[i].HItemID;
                                        var resultData = getMaterialByMaterID(HMaterID);
                                        option.data[rowIndex + i].HMaterID = resultData.HMaterID;
                                        option.data[rowIndex + i].物料代码 = resultData.HMaterNumber;
                                        option.data[rowIndex + i].物料名称 = resultData.HMaterName;
                                        option.data[rowIndex + i].规格型号 = resultData.HMaterModel;
                                        option.data[rowIndex + i].HUnitID = resultData.HUnitID;
                                        option.data[rowIndex + i].计量单位 = resultData.HUnitName;
                                        ////更新表格缓存的数据
                                        //obj.update({
                                        //    "HMaterID": checkStatus.data[0].HItemID
                                        //    , "物料代码": checkStatus.data[0].HNumber
                                        //    , "物料名称": checkStatus.data[0].HName
                                        //    , "规格型号": checkStatus.data[0].HModel
                                        //    , "HUnitID": checkStatus.data[0].HUnitID
                                        //    , "计量单位": checkStatus.data[0].HUnitName
                                        //})
                                        //layer.close(index);//关闭弹窗
                                        table.render(option);
                                    }
                                    table.render(option);
                                    layer.closeAll();
                                    //layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                                }
@@ -1706,19 +2127,57 @@
                                    //return false å¼€å¯è¯¥ä»£ç å¯ç¦æ­¢ç‚¹å‡»è¯¥æŒ‰é’®å…³é—­
                                },
                                end: function () {
                                    obj.update({
                                        "HMaterID": OptionData.HItemID
                                        ,"物料代码" : OptionData.物料代码
                                       , "物料名称" :OptionData.物料名称
                                        ,"规格型号" : OptionData.规格型号
                                        ,"HUnitID" :OptionData.HUnitID
                                        ,"计量单位" : OptionData.计量单位名称
                                })
                                    //通过供应商id获取税率
                                    var HSupID = $("#HSupID").val();
                                    if (HSupID != 0) {
                                        $.ajax({
                                            url: GetWEBURL() + "/Gy_Supplier/xg",
                                            //url: "http://localhost:12761/Gy_Supplier/xg",
                                            type: "GET",
                                            data: {
                                                "HInterID": HSupID
                                            },
                                            success: function (d) {
                                                var HTaxRate = parseInt(d.data[0].增值税率) * 0.01;
                                                //数据校验合格,重算记录
                                                var HQty = obj.data.HQty * 1;                           //数量
                                                var HPrice = obj.data.HPrice * 1;               //单价
                                                var HMoney = HQty * HPrice;                     //金额=数量*单价
                                                var HTaxMoney = Number((HMoney * HTaxRate).toFixed(4));         //税额=金额*税率
                                                var HTaxPrice = Number((HPrice * (1 + HTaxRate)).toFixed(4));        //含税单价=单价*(1+税率)
                                                var HlineTotal = HMoney + HTaxMoney;            //价税合计=金额+税额
                                                obj.update({ //更新表格数据
                                                    "HMaterID": OptionData.HItemID             //设置HItemID的值为“HBillNo”字段的值HItemID`的值
                                                    , "物料代码": OptionData.物料代码
                                                    , "物料名称": OptionData.物料名称
                                                    , "规格型号": OptionData.规格型号
                                                    , "HUnitID": OptionData.HUnitID
                                                    , "计量单位": OptionData.计量单位名称
                                                    , "HTaxRate": HTaxRate * 100
                                                    , HQty: HQty                               //更新HQty字段,HQty
                                                    , HPrice: HPrice                         //更新HPrice字段,HPrice
                                                    , HMoney: HMoney                      //更新HMoney字段,HMoney
                                                    , HlineTotal: HlineTotal                  //更新HlineTotal字段,HlineTotal
                                                    , HTaxPrice, HTaxPrice                   //更新HTaxPrice字段,HTaxPrice
                                                })
                                            }
                                        });
                                    } else {
                                        obj.update({ //更新表格数据
                                            "HMaterID": OptionData.HItemID             //设置HItemID的值为“HBillNo”字段的值HItemID`的值
                                            , "物料代码": OptionData.物料代码
                                            , "物料名称": OptionData.物料名称
                                            , "规格型号": OptionData.规格型号
                                            , "HUnitID": OptionData.HUnitID
                                            , "计量单位": OptionData.计量单位名称
                                        })
                                    }
                                }
                                });
                        }
                        //计量单位
                        if (obj.event == "HUnitID") {
                            var HOrgName = $('select[name="HOrgID"] option:selected').text();
                            layer.open({
                                type: 2
                                , skin: "layui-layer-rim" //加上边框
@@ -1727,7 +2186,7 @@
                                , shift: 2 //弹出动画
                                , area: ["90%", "90%"] //窗体大小
                                , maxmin: true //设置最大最小按钮是否显示
                                , content: ['../../基础资料/公用基础资料/Gy_Unit.html', 'yes']
                                , content: ['../../基础资料/公用基础资料/Gy_Unit.html?Type=2&HOrgName=' + HOrgName, 'yes']
                                , btn: ["确定", "取消"]
                                , btn1: function (index, laero) {
                                    //按钮一  çš„回调
@@ -1754,6 +2213,7 @@
                        }
                        //收料仓库
                        if (obj.event == "HWHID") {
                            var HOrgName = $('select[name="HOrgID"] option:selected').text();
                            layer.open({
                                type: 2
                                , skin: "layui-layer-rim" //加上边框
@@ -1762,7 +2222,7 @@
                                , shift: 2 //弹出动画
                                , area: ["90%", "90%"] //窗体大小
                                , maxmin: true //设置最大最小按钮是否显示
                                , content: ['../../基础资料/公用基础资料/Gy_Warehouse.html?type=Warehouse', 'yes']
                                , content: ['../../基础资料/公用基础资料/Gy_Warehouse.html?type=Warehouse&HOrgName=' + HOrgName, 'yes']
                                , btn: ["确定", "取消"]
                                , btn1: function (index, laero) {
                                    //按钮一  çš„回调
@@ -1827,6 +2287,139 @@
                        return false;
                    }
                })
                $('.layui-table-box tbody td[data-field="物料代码"]').off('dblclick').on('dblclick', function () {
                    var HOrgID = $("#HOrgID").val();
                    layer.open({
                        type: 2
                        , skin: "layui-layer-rim" //加上边框
                        , title: "物料列表"  //标题
                        , closeBtn: 1  //窗体右上角关闭 çš„ æ ·å¼
                        , shift: 2 //弹出动画
                        , area: ["90%", "90%"] //窗体大小
                        , maxmin: true //设置最大最小按钮是否显示
                        , content: ['../../基础资料/公用基础资料/Gy_Material.html?openType=2&HOrgID=' + HOrgID, 'yes']
                        , btn: ["确定", "取消"]
                        , btn1: function (index, laero) {
                            //按钮一  çš„回调
                            var iframeWindow = window["layui-layer-iframe" + index];//获取弹框页面
                            var checkStatus = iframeWindow.layui.table.checkStatus("mainTable");//获取选中的数据
                            var TaxRate = getHTaxRateByHSupID();
                            //if (checkStatus.data.length != 1) {
                            //    return layer.msg("请选择一条数据");
                            //}
                            OptionData = checkStatus.data[0];
                            if (checkStatus.data.length > 1) {
                                var rowIndex = $(obj.tr).attr("data-index") * 1;
                                for (var i = 0; i < checkStatus.data.length; i++) {
                                    if (rowIndex + i >= option.data.length) {
                                        var NewRow = {
                                            "HMaterID": 0, "物料代码": "", "物料名称": "", "规格型号": "", "HUnitID": 0, "计量单位": "", "HQtyMust": "0", "HQty": "", "HRemark": "",
                                            "HPrice": "0", "HMoney": "0", "HOrderPrice": "0", "HWHID": 0, "收料仓库": "",
                                            "HSPID": 0, "仓位名称": "", "HBatchNo": "", "HPOOrderInterID": 0, "HPOOrderEntryID": 0,
                                            "HPOOrderBillNo": "", "HSeOrderInterID": 0, "HSeOrderEntryID": 0, "HSeOrderBillNo": "",
                                            "HSourceBillNo": 0, "HSourceBillType": 0, "HSourceInterID": 0, "HSourceEntryID": 0,
                                            "HTaxRate": 0, "HTaxPrice": 0, "HlineTotal": 0
                                        };
                                        table.cache["mainTable"].push(NewRow);
                                        option.data = table.cache["mainTable"];
                                        table.render(option);
                                    }
                                    var HMaterID = checkStatus.data[i].HItemID;
                                    var resultData = getMaterialByMaterID(HMaterID);
                                    option.data[rowIndex + i].HMaterID = resultData.HMaterID;
                                    option.data[rowIndex + i].物料代码 = resultData.HMaterNumber;
                                    option.data[rowIndex + i].物料名称 = resultData.HMaterName;
                                    option.data[rowIndex + i].规格型号 = resultData.HMaterModel;
                                    option.data[rowIndex + i].HUnitID = resultData.HUnitID;
                                    option.data[rowIndex + i].计量单位 = resultData.HUnitName;
                                    option.data[rowIndex + i].HTaxRate = TaxRate;
                                    ////更新表格缓存的数据
                                    //obj.update({
                                    //    "HMaterID": checkStatus.data[0].HItemID
                                    //    , "物料代码": checkStatus.data[0].HNumber
                                    //    , "物料名称": checkStatus.data[0].HName
                                    //    , "规格型号": checkStatus.data[0].HModel
                                    //    , "HUnitID": checkStatus.data[0].HUnitID
                                    //    , "计量单位": checkStatus.data[0].HUnitName
                                    //})
                                    //layer.close(index);//关闭弹窗
                                }
                                table.render(option);
                            }
                            layer.closeAll();
                            //layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                        }
                        , btn2: function (index, layero) {
                            //按钮【按钮二】的回调
                            //return false å¼€å¯è¯¥ä»£ç å¯ç¦æ­¢ç‚¹å‡»è¯¥æŒ‰é’®å…³é—­
                        },
                        end: function () {
                            //通过供应商id获取税率
                            var HSupID = $("#HSupID").val();
                            if (HSupID != 0 && typeof (OptionData.HItemID) != "undefined") {
                                var Dec = getDecByMaterID(obj.data.HMaterID) //获取精度
                                var HQtyDec = (Dec["HQtyDec"] == null || Dec["HQtyDec"] == 0) ? 4 : Dec["HQtyDec"];  //数量精度
                                var HPriceDec = (Dec["HPriceDec"] == null || Dec["HPriceDec"] == 0) ? 4 : Dec["HPriceDec"];  //单价精度
                                var HMoneyDec = (Dec["HMoneyDec"] == null || Dec["HMoneyDec"] == 0) ? 2 : Dec["HMoneyDec"];  //金额精度
                                $.ajax({
                                    url: GetWEBURL() + "/Gy_Supplier/xg",
                                    //url: "http://localhost:12761/Gy_Supplier/xg",
                                    type: "GET",
                                    data: {
                                        "HInterID": HSupID
                                    },
                                    success: function (d) {
                                        var HTaxRate = parseInt(d.data[0].增值税率) * 0.01;
                                        //数据校验合格,重算记录
                                        var HQty = obj.data.HQty * 1;                           //数量
                                        var HPrice = obj.data.HPrice * 1;               //单价
                                        var HMoney = HQty * HPrice;                     //金额=数量*单价
                                        var HTaxMoney = Number((HMoney * HTaxRate));         //税额=金额*税率
                                        var HTaxPrice = Number((HPrice * (1 + HTaxRate)));        //含税单价=单价*(1+税率)
                                        var HlineTotal = HMoney + HTaxMoney;            //价税合计=金额+税额
                                        //数字精度
                                        HQty = Number(HQty.toFixed(HQtyDec));
                                        HPrice = Number(HPrice.toFixed(HPriceDec));
                                        HMoney = Number(HMoney.toFixed(HMoneyDec));
                                        HTaxMoney = Number(HTaxMoney.toFixed(HMoneyDec));
                                        HlineTotal = Number(HlineTotal.toFixed(HMoneyDec));
                                        HTaxPrice = Number(HTaxPrice.toFixed(HPriceDec));
                                        obj.update({ //更新表格数据
                                            "HMaterID": OptionData.HItemID             //设置HItemID的值为“HBillNo”字段的值HItemID`的值
                                            , "物料代码": OptionData.物料代码
                                            , "物料名称": OptionData.物料名称
                                            , "规格型号": OptionData.规格型号
                                            , "HUnitID": OptionData.HUnitID
                                            , "计量单位": OptionData.计量单位名称
                                            , "HTaxRate": HTaxRate * 100
                                            , HQty: HQty                               //更新HQty字段,HQty
                                            , HPrice: HPrice                         //更新HPrice字段,HPrice
                                            , HMoney: HMoney                      //更新HMoney字段,HMoney
                                            , HlineTotal: HlineTotal                  //更新HlineTotal字段,HlineTotal
                                            , HTaxPrice, HTaxPrice                   //更新HTaxPrice字段,HTaxPrice
                                        })
                                    }
                                });
                            } else if (typeof (OptionData.HItemID) != "undefined"){
                                obj.update({ //更新表格数据
                                    "HMaterID": OptionData.HItemID             //设置HItemID的值为“HBillNo”字段的值HItemID`的值
                                    , "物料代码": OptionData.物料代码
                                    , "物料名称": OptionData.物料名称
                                    , "规格型号": OptionData.规格型号
                                    , "HUnitID": OptionData.HUnitID
                                    , "计量单位": OptionData.计量单位名称
                                })
                            }
                        }
                    });
                });
            }
            //行内事件
@@ -1880,10 +2473,18 @@
                        if (checkStatus.data.length == 0) {
                            return layer.msg("请至少选择一条数据!");
                        }
                        var HSupID = $("#HSupID").val();//判断供应商
                        if (HSupID == 0 || HSupID == '') {
                            HSupID = checkStatus.data[0]["HSupID"];
                        }
                        //获取收料通知单代码
                        var ProcessNumber = [];
                        for (var i = 0; i < checkStatus.data.length; i++) {
                            if (checkStatus.data[i]["HSupID"] != HSupID) {
                                layer.msg("下推失败!已经选中的记录中存在不同供应商!");
                                layer.close(index);//关闭弹窗
                                return;
                            }
                            ProcessNumber.push(checkStatus.data[i]);
                        }
@@ -1918,13 +2519,17 @@
                           
                            var j = 0;
                            for (var i = 0; i < checkStatus.data.length; i++) {
                                var HNewQty = checkStatus.data[j].数量 - checkStatus.data[j].关联数量//数量
                                var HNewMoney = checkStatus.data[j].金额 - checkStatus.data[j].关联数量 * checkStatus.data[j].单价//减少关联数量的金额
                                var HNewTaxMoney = HNewMoney * checkStatus.data[j].税率 * 0.01
                                var HNewlineTotal = HNewMoney + HNewTaxMoney;
                                option.data.push({
                                    "HMaterID": checkStatus.data[j].HMaterID, "物料代码": checkStatus.data[j].物料代码, "物料名称": checkStatus.data[j].物料名称, "规格型号": checkStatus.data[j].规格型号,
                                    "HUnitID": checkStatus.data[j].HUnitID, "计量单位": checkStatus.data[j].计量单位, "HWHID": checkStatus.data[j].HWHIDSub, "收料仓库": checkStatus.data[j].仓库名称,
                                    "HSPID": checkStatus.data[j].HSPID, "仓位名称": checkStatus.data[j].仓位名称, "HQtyMust": checkStatus.data[j].数量,
                                    "HQty": checkStatus.data[j].数量-checkStatus.data[j].关联数量, "HPrice": checkStatus.data[j].单价,"HMoney": checkStatus.data[j].金额,
                                    "HQty": HNewQty, "HPrice": checkStatus.data[j].单价, "HMoney": HNewMoney, "HOrderPrice": checkStatus.data[j].金额,
                                    "HSourceBillNo": checkStatus.data[j].单据号, "HSourceBillType": checkStatus.data[j].HBillType, "HSourceInterID": checkStatus.data[j].hmainid, "HSourceEntryID": checkStatus.data[j].hsubid,
                                    "HTaxRate": checkStatus.data[j].税率, "HTaxPrice": checkStatus.data[j].含税单价, "HlineTotal": checkStatus.data[j].价税合计
                                    "HTaxRate": checkStatus.data[j].税率, "HTaxPrice": checkStatus.data[j].含税单价, "HlineTotal": HNewlineTotal
                                })
                                j++;
                            }
@@ -1934,14 +2539,18 @@
                         
                            var j = 0;
                            for (var i = 0; i < ProcessNumber.length; i++) {
                                var HNewQty = checkStatus.data[j].数量 - checkStatus.data[j].关联数量//数量
                                var HNewMoney = checkStatus.data[j].金额 - checkStatus.data[j].关联数量 * checkStatus.data[j].单价//减少关联数量的金额
                                var HNewTaxMoney = HNewMoney * checkStatus.data[j].税率 * 0.01
                                var HNewlineTotal = HNewMoney + HNewTaxMoney;
                                option.data.push({
                                    "HMaterID": checkStatus.data[j].HMaterID, "物料代码": checkStatus.data[j].物料代码, "物料名称": checkStatus.data[j].物料名称, "规格型号": checkStatus.data[j].规格型号,
                                    "HUnitID": checkStatus.data[j].HUnitID, "计量单位": checkStatus.data[j].计量单位, "HQtyMust": checkStatus.data[j].数量, "HQty": checkStatus.data[j].数量-checkStatus.data[j].关联数量, "HRemark": "",
                                    "HPrice": checkStatus.data[j].单价, "HMoney": checkStatus.data[j].金额, "HOrderPrice": "0", "HWHID": checkStatus.data[j].HWHID, "收料仓库": checkStatus.data[j].收料仓库,
                                    "HUnitID": checkStatus.data[j].HUnitID, "计量单位": checkStatus.data[j].计量单位, "HQtyMust": checkStatus.data[j].数量, "HQty": checkStatus.data[j].数量 - checkStatus.data[j].关联数量, "HRemark": "",
                                    "HPrice": checkStatus.data[j].单价, "HMoney": HNewMoney, "HOrderPrice": checkStatus.data[j].金额, "HWHID": checkStatus.data[j].HWHID, "收料仓库": checkStatus.data[j].收料仓库,
                                    "HSPID": checkStatus.data[j].HSPID, "仓位名称": checkStatus.data[j].仓位名称, "HBatchNo": "", "HPOOrderInterID": 0, "HPOOrderEntryID": 0,
                                    "HPOOrderBillNo": "", "HSeOrderInterID": 0, "HSeOrderEntryID": 0, "HSeOrderBillNo": "",
                                    "HSourceBillNo": checkStatus.data[j].单据号, "HSourceBillType": checkStatus.data[j].HBillType, "HSourceInterID": checkStatus.data[j].hmainid, "HSourceEntryID": checkStatus.data[j].hsubid,
                                    "HTaxRate": checkStatus.data[j].税率, "HTaxPrice": checkStatus.data[j].含税单价, "HlineTotal": (checkStatus.data[j].金额 + (checkStatus.data[j].金额 * checkStatus.data[j].税率))
                                    "HTaxRate": checkStatus.data[j].税率, "HTaxPrice": checkStatus.data[j].含税单价, "HlineTotal": HNewlineTotal
                                })
                                j++;
                            }
@@ -1978,14 +2587,15 @@
            //行内删除
            function set_GridDelete(obj) {
                var data = obj.data;
                var rowIndex = $(obj.tr).attr("data-index");
                var rowIndex = $(obj.tr).attr("data-index");//获取行索引
                if (obj.event === 'del') {
                    layer.confirm('真的删除行吗?', function (index) {
                        console.log("索引为:" + rowIndex);
                        if (rowIndex === '0') {
                            layer.msg('首行无法删除!!!');
                        } else {
                            obj.del();
                            obj.del();//假删除
                            table.cache["mainTable"].splice(rowIndex, 1);  //②彻底移除元素,从缓存里移除这一行
                            option.data = table.cache["mainTable"];//将数据绑定到data上
                            table.reload(option);
                            layer.close(index);
@@ -2069,15 +2679,38 @@
                            res = result.data;
                            //layer.alert(result.msg, { icon: 5, btn: ['退出'], time: 100000, offset: 't' });
                        }
                    }, error: function () {
                    }, error: function (err) {
                        res = "none";
                        layer.alert("发生错误!", { icon: 5 });
                        layer.alert("发生错误!"+err, { icon: 5 });
                    }
                });
                return res;
            }
            //#endregion
            //#region é€šè¿‡ä¾›åº”商id获取税率
            function getHTaxRateByHSupID() {
                var HTaxRate;
                //通过供应商id获取税率
                var HSupID = $("#HSupID").val();
                if (HSupID != 0) {
                    $.ajax({
                        url: GetWEBURL() + "/Gy_Supplier/xg",
                        type: "GET",
                        async: false,
                        data: {
                            "HInterID": HSupID
                        },
                        success: function (d) {
                            HTaxRate = parseInt(d.data[0].增值税率);
                        }
                    });
                } else {
                    HTaxRate = 0;
                }
                return HTaxRate;
            }
            //#endregion
            //#region æ ¹æ®ä¸»å†…码与子内码获取源单收料通知单数据
            function getPushSource_POInStockBillInit(HSourceInterID, HSourceEntryID) {
@@ -2097,57 +2730,167 @@
                            res = result.data;
                            //layer.alert(result.msg, { icon: 5, btn: ['退出'], time: 100000, offset: 't' });
                        }
                    }, error: function () {
                    }, error: function (err) {
                        res = "none";
                        layer.alert("发生错误!", { icon: 5 });
                        layer.alert("发生错误!" + err, { icon: 5 });
                    }
                });
                return res;
            }
            //#endregion
            //#region åˆ—设置
            //隐藏列设置
            function get_HideColumn() {
                var colName = "";
                for (var i = 1; i < option.cols[0].length - 1; i++) {
                    colName += option.cols[0][i]["field"] + ",";
                }
                var colTitleName = "";
                for (var i = 1; i < option.cols[0].length - 1; i++) {
                    colTitleName += option.cols[0][i]["title"] + ",";
                }
                colName = encodeURI(colName.substring(0, colName.length - 1));//对 URI è¿›è¡Œç¼–码
                layer.open({
                    type: 2
                    , skin: "layui-layer-rim" //加上边框
                    , title: "隐藏列设置"  //标题
                    , closeBtn: 1  //窗体右上角关闭 çš„ æ ·å¼
                    , shift: 2 //弹出动画
                    , area: ["50%", "90%"] //窗体大小
                    , maxmin: true //设置最大最小按钮是否显示
                    , content: ['../../基础资料/隐藏列设置/Gy_GridView_Hide.html?HModName=' + HModName + '&colName=' + colName + '&colTitleName = ' + colTitleName, "yes"]
                    , btn: ["确定", "取消"]
                    , btn1: function (index, laero) {
                        //刷新表格数据
                        DisPlay_HideColumn();
                        //更新表格缓存的数据
                        layer.close(index);//关闭弹窗
                    }
                })
            }
            //显示列数据
            function DisPlay_HideColumn() {
                $.ajax({
                    url: GetWEBURL() + '/Xt_grdAlignment_WMES/grdAlignmentWMESList',
                    type: "GET",
                    async: false,
                    data: { "HModName": HModName, "user": sessionStorage["HUserName"] },
                    success: function (data1) {
                        if (data1.data.length != 0) {
                            var dataCol = [];//数据库查询出的列数据
                            var titleData = [];//不需要显示的字段 å¯æ‰©å±•
                            dataCol = data1.data[0].HGridString.split(',');
                            for (var i = 0; i < option.cols[0].length - 2; i++) {
                                var dataCols = dataCol[i].split('|');
                                //隐藏列
                                if (dataCols[1] == 1) {
                                    option.cols[0][i + 1]["hide"] = true;
                                }
                                //设置内容字体大小
                                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 (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;
                                }
                                //字体所在位置(å·¦ å±…中 å³)
                                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;
                                }
                                //设置表格title属性显示别名
                                if (dataCols[4] != null && dataCols[4] != "") {
                                    option.cols[0][i + 1]["title"] = dataCols[4];
                                }
                            }
                            //取消冻结列
                            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 });
                    }
                })
            }
            //#endregion
            //#region ä¿å­˜æ–¹æ³•校验
            function AllowLoadData(data) {
                var ref = /^\d+(\.\d+)?$/;          //非负数正则表达式
                var temp = "";
                if ($("#HWHID").val() == 0) {
                    layer.msg("请选择仓库!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return;
                }
                if ($("#HManagerID").val() == 0) {
                    layer.msg("请选择负责人!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return;
                }
                if ($("#HEmpID").val() == 0) {
                    layer.msg("请选择业务员!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return;
                }
                if ($("#HKeeperID").val() == 0) {
                    layer.msg("请选择保管员!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return;
                }
                if ($("#HSecManagerID").val() == 0) {
                    layer.msg("请选择验收员!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return;
                }
                if ($("#HDeptID").val() == 0) {
                    layer.msg("请选择部门!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return;
                }
                //if ($("#HWHID").val() == 0) {
                //    layer.msg("请选择仓库!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                //    return;
                //}
                //if ($("#HManagerID").val() == 0) {
                //    layer.msg("请选择负责人!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                //    return;
                //}
                //if ($("#HEmpID").val() == 0) {
                //    layer.msg("请选择业务员!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                //    return;
                //}
                //if ($("#HKeeperID").val() == 0) {
                //    layer.msg("请选择保管员!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                //    return;
                //}
                //if ($("#HSecManagerID").val() == 0) {
                //    layer.msg("请选择验收员!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                //    return;
                //}
                //if ($("#HDeptID").val() == 0) {
                //    layer.msg("请选择部门!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                //    return;
                //}
                if ($("#HSupID").val() == 0) {
                    layer.msg("请选择供应商!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return;
                }
                if ($("#HPSStyleID").val() == 0) {
                    layer.msg("请选择采购方式!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return;
                }
                if ($("#HSSID").val() == 0) {
                    layer.msg("请选择结算方式!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return;
                }
                //if ($("#HPSStyleID").val() == 0) {
                //    layer.msg("请选择采购方式!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                //    return;
                //}
                //if ($("#HSSID").val() == 0) {
                //    layer.msg("请选择结算方式!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                //    return;
                //}
                //#region å­è¡¨ æ•°æ®æ£€éªŒ
                for (var i = 0; i < option.data.length; i++) {
@@ -2168,8 +2911,8 @@
                    //实发数量格式校验
                    temp = option.data[i]["HQty"] + "";
                    if (temp == "0") {
                        //layer.msg("第" + (i + 1) + "行:数量不能为0!");
                        //return false;
                        layer.msg("第" + (i + 1) + "行:数量不能为0!");
                        return false;
                    } else if (!ref.test(temp)) {
                        layer.msg("第" + (i + 1) + "行:数量请输入大于0的数字!");
                        return false;
@@ -2293,8 +3036,8 @@
             OptionData = data
         }
           //双击返回计量单位
         function GetGyUnit(data) {
             OptionData = data
        function GetUnitValue(data) {
            OptionData = data[0]
         }
           //双击返回收料仓库