duhe
2024-05-21 8a24a82d61360eb005df8f91fbf40754dfda48db
WebTM/views/ÏúÊÛ¹ÜÀí/·¢»õ֪ͨµ¥/Add_Edit_Xs_SeOutStockBillList.html
@@ -69,13 +69,13 @@
                                            </div>
                                        </div>
                                        <div class="layui-col-xs4 layui-inline">
                                            <label class="layui-form-label">日期</label>
                                            <label class="layui-form-label">日期<label style="color:red"> * </label></label>
                                            <div class="layui-input-inline">
                                                <input class="layui-input" name="HDate" id="HDate" autocomplete="off" model="datetime" dateFormat="yyyy-MM-dd" placeholder="yyyy-MM-dd">
                                            </div>
                                        </div>
                                        <div class="layui-col-xs4 layui-inline">
                                            <label class="layui-form-label">业务员</label>
                                            <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;">
@@ -88,7 +88,7 @@
                                    </div>
                                    <div class="layui-row">
                                        <div class="layui-col-xs4 layui-inline">
                                            <label class="layui-form-label">客户</label>
                                            <label class="layui-form-label">客户<label style="color:red"> * </label></label>
                                            <div class="layui-input-inline">
                                                <input type="text" name="HCusName" id="HCusName" class="layui-input" value="" style="float:left;width:150px;">
                                                <input type="hidden" name="HCusID" id="HCusID" class="layui-input" value="0" style="float:left;width:150px;">
@@ -98,7 +98,7 @@
                                            </div>
                                        </div>
                                        <div class="layui-col-xs4 layui-inline">
                                            <label class="layui-form-label">仓库</label>
                                            <label class="layui-form-label">仓库<label style="color:red"> * </label></label>
                                            <div class="layui-input-inline">
                                                <input type="text" name="HWHName" id="HWHName" class="layui-input" value="" style="float:left;width:150px;">
                                                <input type="hidden" name="HWHID" id="HWHID" class="layui-input" value="0" style="float:left;width:150px;">
@@ -116,7 +116,7 @@
                                    </div>
                                    <div class="layui-row">
                                        <div class="layui-col-xs4 layui-inline">
                                            <label class="layui-form-label">部门</label>
                                            <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;">
@@ -126,7 +126,7 @@
                                            </div>
                                        </div>
                                        <div class="layui-col-xs4 layui-inline">
                                            <label class="layui-form-label">币别</label>
                                            <label class="layui-form-label">币别<label style="color:red"> * </label></label>
                                            <div class="layui-input-inline">
                                                <input type="text" name="HCurName" id="HCurName" class="layui-input" value="" style="float:left;width:150px;">
                                                <input type="hidden" name="HCurID" id="HCurID" class="layui-input" value="0" style="float:left;width:150px;">
@@ -136,7 +136,7 @@
                                            </div>
                                        </div>
                                        <div class="layui-col-xs4 layui-inline">
                                            <label class="layui-form-label">汇率</label>
                                            <label class="layui-form-label">汇率<label style="color:red"> * </label></label>
                                            <div class="layui-input-inline">
                                                <input class="layui-input" name="HExRate" id="HExRate" autocomplete="off" value="0">
                                            </div>
@@ -152,7 +152,7 @@
                                            </div>
                                        </div>
                                        <div class="layui-col-xs4 layui-inline">
                                            <label class="layui-form-label">主管</label>
                                            <label class="layui-form-label">主管<label style="color:red"> * </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;">
@@ -237,11 +237,28 @@
                                        </div>
                                    </div>        
                                    <div class="layui-row">
                                        <div class="layui-inline">
                                        <div class="layui-col-xs4 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 class="layui-col-xs4 layui-inline">
                                            <label class="layui-form-label">项目代码</label>
                                            <div class="layui-input-inline">
                                                <input type="text" class="layui-input" lay-verify="HProjectNumber" name="HProjectNumber" id="HProjectNumber" value="" style="background-color: #efefef4d;float: left; width: 150px;" readonly>
                                                <input type="hidden" name="HProjectID" id="HProjectID" lay-verify="HProjectID" value="0">
                                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearchHProNumber" id="btnSearchHProNumber" 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">
                                                <input class="layui-input" name="HProjectName" id="HProjectName" autocomplete="off" readonly>
                                            </div>
                                        </div>
                                    </div>
                                </div>
@@ -287,7 +304,7 @@
                                        <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>
                                                <input model="datetime" dateFormat="yyyy-MM-dd" placeholder="yyyy-MM-dd" class="layui-input" name="HMakeDate" id="HMakeDate" style="background-color:#efefef4d;" readonly>
                                            </div>
                                        </div>
                                    </div>
@@ -368,6 +385,7 @@
            var shijian = year + "-" + month + "-" + day;
            var allVal;
            //#endregion
@@ -375,7 +393,7 @@
            //判断是否登录 æœªç™»å½•则跳到登录页
            get_LoginIs();
            window.OptionData = [];
            //#region ã€åŠ¨æ€èŽ·å–æ¨¡å—åç§°ã€‘
            var HModuleType = "1402";
            //通过单据类型,从数据库动态获取单据模块命名,引用js文件 PageTitle.js
@@ -395,6 +413,8 @@
            //判断操作类型
            if (OperationType == 1) {//无源单新增
                $("#HItemID").val(0);
                //页面初始化加载 ä¸šåŠ¡å‘˜ ä¸»ç®¡   éƒ¨é—¨
                get_DeptHManage();
            }
            else if (OperationType == 3) {//编辑
                $("#HItemID").val(linterid);//修改时主表ID
@@ -508,7 +528,10 @@
            form.on('submit(HManagerList)', function () {
                get_checkManager();
            });
            //项目代码
            form.on('submit(btnSearchHProNumber)', function () {
                get_checkSearchHProNumber();
            });
            //保存按钮
            form.on('submit(Saver)', function (data) {
@@ -616,6 +639,7 @@
            function getSupType() {
                var type = $("#HSourceBillType").val();
                var data = [];
                var HOrgID = sessionStorage["OrganizationID"];
                //获取编码对应单据名称
                $.ajax({
                    type: "get",
@@ -628,7 +652,8 @@
                })
                switch (type) {
                    case '1401':
                        return { url: "../../销售管理/销售订单/Xs_SeOrderBillList.html", name: data[0]["HName"] };
                        return {
                            url: "../../销售管理/销售订单/Xs_SeOrderBillList.html?openType=2&HOrgID=" + HOrgID, name: data[0]["HName"] };
                        break;
                }
@@ -663,7 +688,6 @@
                        if (checkStatus.data.length == 0) {
                            return layer.msg("请至少选择一条数据!");
                        }
                        //layer.alert("你已选择" + checkStatus.data.length + "条数据");
                        //获取销售订单代码
                        var ProcessNumber = [];
                        for (var i = 0; i < checkStatus.data.length; i++) {
@@ -677,16 +701,36 @@
                                , "规格型号": checkStatus.data[i].规格型号
                                , "HUnitID": checkStatus.data[i].HUnitID
                                , "计量单位": checkStatus.data[i].计量单位
                                ,"HWHID": "0"
                                , "发货仓库": ""
                                , "HQty": "0", "HPrice": "0", "HMoney": "0", "HRemark": ""
                                , "HWHID": checkStatus.data[i].HWhID
                                , "发货仓库": checkStatus.data[i].子仓库
                                , "HQty": checkStatus.data[i].数量,
                                "HPrice": checkStatus.data[i].单价,
                                "HMoney": checkStatus.data[i].金额, "HRemark": ""
                                , "HSourceBillNo": checkStatus.data[i].单据号
                                , "HSourceBillType": checkStatus.data[i].HBillType
                                , "HSourceInterID": checkStatus.data[i].hmainid
                                , "HSourceEntryID": checkStatus.data[i].hsubid
                            })
                        }
                        $("#HProjectID").val(checkStatus.data[0].HProjectID ? checkStatus.data[0].HProjectID : 0);
                        $("#HProjectNumber").val(checkStatus.data[0].项目编码);
                        $("#HProjectName").val(checkStatus.data[0].项目名称);
                        $("#HCusID").val(checkStatus.data[0].HCusID);
                        $("#HCusName").val(checkStatus.data[0].客户);
                        $("#HDeptID").val(checkStatus.data[0].HDeptID);
                        $("#HDeptName").val(checkStatus.data[0].部门);
                        $("#HManagerID").val(checkStatus.data[0].HManagerID);
                        $("#HManagerName").val(checkStatus.data[0].主管);
                        $("#HEmpID").val(checkStatus.data[0].HEmpID);
                        $("#HEmpName").val(checkStatus.data[0].业务员);
                        $("#HCurID").val(checkStatus.data[0].HCurID);
                        $("#HCurName").val(checkStatus.data[0].币别);
                        $("#HExRate").val(checkStatus.data[0].汇率);
                        $("#HWHID").val(checkStatus.data[0].主仓库id);
                        $("#HWHName").val(checkStatus.data[0].主仓库);
                        table.render(option);
                        layer.close(index);//关闭弹窗
                    }
@@ -771,8 +815,8 @@
                                , "HEmpName": data.业务员
                                , "HCusID": data.HCusID
                                , "HCusName": data.客户
                                , "HWHID": data.HWHID
                                , "HWHName": data.发货仓库
                                , "HWHID": data.主仓库ID
                                , "HWHName": data.主发货仓库
                                , "HAddress": data.交货地址
                                , "HDeptName": data.部门
                                , "HDeptID": data.HDeptID
@@ -788,6 +832,10 @@
                                //, "HConveyTypeID": data.运输方式
                                //, "HConveyMoney": data.运费
                                //, "HDFflag": data.是否垫付
                                , "HProjectID": data.HProjectID
                                , "HProjectNumber": data.项目编码
                                , "HProjectName": data.项目名称
                                , "Box2": ""
                                , "HRemark": data.表头备注
                                , "HMaker": data.制单人
@@ -852,8 +900,12 @@
                        $("#HBillNo").val(d.data[0].HBillNo);
                        $("#HDate").val(shijian);
                        $("#HInterID").val(d.data[0].HInterID);
                        $("#HMakeDate").val(shijian);
                        $("#HMaker").val(sessionStorage["HUserName"]);
                    }
                });
                //页面初始化加载 ä¸šåŠ¡å‘˜ ä¸»ç®¡   éƒ¨é—¨
                get_DeptHManage();
            }
            else {//如果修改则走下面 new
                $("#HInterID").val(linterid);
@@ -876,6 +928,36 @@
            //#region ä¿å­˜æ–¹æ³•
            function set_SaveBill(data) {
                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 ($("#HCusID").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 ($("#HCurID ").val() == 0) {
                    layer.msg("请选择币别!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return;
                }
                if ($("#HExRate").val() == 0) {
                    layer.msg("汇率不能为0!", { 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;
                }
                var num = [];
                for (var i = 0; i < table.cache["mainTable"].length; i++) {
@@ -917,6 +999,33 @@
            }
            //#endregion
            //页面初始化加载 ä¸šåŠ¡å‘˜ ä¸»ç®¡   éƒ¨é—¨
            function get_DeptHManage() {
                //页面初始化加载 ä¸šåŠ¡å‘˜ ä¸»ç®¡   éƒ¨é—¨
                $("#HDeptID").val(sessionStorage["HDeptID"]);
                $("#HDeptName").val(sessionStorage["HDept"]);
                $("#HEmpName").val(sessionStorage["HUserName"]);
                $("#HEmpID").val(sessionStorage["HEmpID"]);
                //根据当前登录用户的部门 èŽ·å– ä¸»ç®¡
                if ($("#HDeptID").val() != 0) {
                    $.ajax({
                        url: GetWEBURL() + "Gy_Department/list",
                        async: false,
                        type: "GET",
                        data: {
                            "sWhere": "and HItemID = '" + $("#HDeptID").val() + "'", "user": sessionStorage["HUserName"], "Organization": sessionStorage["Organization"]
                        },
                        success: function (result) {
                            $("#HManagerID").val(result.data[0].HEmpID);
                            $("#HManagerName").val(result.data[0].负责人);
                        }, error: function () {
                            layer.alert("发生错误!", { icon: 5 });
                        }
                    });
                }
            }
            //行内快捷键筛选
            function set_GridCellCheck(obj) {
                $(document).off('keydown', ".layui-table-edit").on('keydown', '.layui-table-edit', function (e) {
@@ -953,6 +1062,20 @@
                                    })
                                    layer.close(index);//关闭弹窗
                                }
                                , end: function () {
                                    if (typeof (OptionData.HItemID) != "undefined") {
                                        //更新表格缓存的数据
                                        obj.update({
                                            "HMaterID": OptionData.HItemID
                                            , "物料代码": OptionData.物料代码
                                            , "物料名称": OptionData.物料名称
                                            , "规格型号": OptionData.规格型号
                                            , "HUnitID": OptionData.HUnitID
                                            , "计量单位": OptionData.计量单位名称
                                        })
                                        OptionData = [];
                                    }
                                }
                            })
                        }
                        //计量单位
@@ -965,7 +1088,7 @@
                                , shift: 2 //弹出动画
                                , area: ["90%", "90%"] //窗体大小
                                , maxmin: true //设置最大最小按钮是否显示
                                , content: ['../../基础资料/公用基础资料/Gy_Unit.html', 'yes']
                                , content: ['../../基础资料/公用基础资料/Gy_Unit.html?type=AuxiliaryUnit', 'yes']
                                , btn: ["确定", "取消"]
                                , btn1: function (index, laero) {
                                    //按钮一  çš„回调
@@ -982,6 +1105,16 @@
                                    })
                                    layer.close(index);//关闭弹窗
                                }
                                , end: function () {
                                    if (typeof (OptionData.HItemID) != "undefined") {
                                        //更新表格缓存的数据
                                        obj.update({
                                            "HUnitID": OptionData.HItemID
                                            , "计量单位": OptionData.计量单位名称
                                        })
                                        OptionData = [];
                                    }
                                }
                            })
                        }
                        //发货仓库
@@ -994,7 +1127,7 @@
                                , shift: 2 //弹出动画
                                , area: ["90%", "90%"] //窗体大小
                                , maxmin: true //设置最大最小按钮是否显示
                                , content: ['../../基础资料/公用基础资料/Gy_Warehouse.html', 'yes']
                                , content: ['../../基础资料/公用基础资料/Gy_Warehouse.html?type=HWHSub', 'yes']
                                , btn: ["确定", "取消"]
                                , btn1: function (index, laero) {
                                    //按钮一  çš„回调
@@ -1006,10 +1139,20 @@
                                    }
                                    //更新表格缓存的数据
                                    obj.update({
                                        "HWHID": checkStatus.data[0].HItemID,
                                        "发货仓库": checkStatus.data[0].仓库名称
                                        , "HWHID": checkStatus.data[0].HItemID
                                    })
                                    layer.close(index);//关闭弹窗
                                }
                                , end: function () {
                                    if (typeof (OptionData.HItemID) != "undefined") {
                                        obj.update({
                                            "HWHID": OptionData.HItemID
                                            , "发货仓库": OptionData.仓库名称
                                        })
                                        OptionData = [];
                                    }
                                }
                            })
                        }
@@ -1045,7 +1188,7 @@
                    , area: ['90%', '90%']//大小
                    , title: '业务员列表'//标题
                    , shift: 2//弹出动画
                    , content: ['../../基础资料/公用基础资料/Gy_EmployeeList.html', 'yes']
                    , content: ['../../基础资料/公用基础资料/Gy_EmployeeList.html?Type=HEmp', 'yes']
                    , btn: ['确定', '取消']
                    , btn1: function (index, layero) {//按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
@@ -1089,7 +1232,7 @@
                    , area: ['90%', '90%']//大小
                    , title: '仓库列表'//标题
                    , shift: 2//弹出动画
                    , content: ['../../基础资料/公用基础资料/Gy_Warehouse.html', 'yes']
                    , content: ['../../基础资料/公用基础资料/Gy_Warehouse.html?Type=HWH', 'yes']
                    , btn: ['确定', '取消']
                    , btn1: function (index, layero) {//按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
@@ -1099,6 +1242,16 @@
                        }
                        $("#HWHName").val(checkStatus.data[0].仓库名称);
                        $("#HWHID").val(checkStatus.data[0].HItemID);
                        if (option.data.length > 0) {
                            for (var i = 0; i < option.data.length; i++) {
                                if (option.data[i]["HWHID"] == 0) {
                                    option.data[i]["HWHID"] = checkStatus.data[0].HItemID;
                                    option.data[i]["发货仓库"] = checkStatus.data[0].仓库名称;
                                }
                            }
                        }
                        table.render(option);
                        layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
                    , btn2: function (index, layero) { }
@@ -1157,7 +1310,7 @@
                    , area: ['90%', '90%']//大小
                    , title: '主管列表'//标题
                    , shift: 2//弹出动画
                    , content: ['../../基础资料/公用基础资料/Gy_EmployeeList.html', 'yes']
                    , content: ['../../基础资料/公用基础资料/Gy_EmployeeList.html?Type=HManager', 'yes']
                    , btn: ['确定', '取消']
                    , btn1: function (index, layero) {//按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
@@ -1173,6 +1326,43 @@
                })
            }
            //项目代码
            function get_checkSearchHProNumber() {
                var HOrgID = sessionStorage["OrganizationID"];
                //打开工程项目小窗体
                layer.open({
                    type: 2
                    , skin: "layui-layer-rim"                           //加上边框
                    , title: "工程项目列表"                             //标题
                    , closeBtn: 1                                       //窗体右上角关闭 çš„ æ ·å¼
                    , shift: 2                                          //弹出动画
                    , area: ["90%", "90%"]                              //窗体大小
                    , maxmin: true                                      //设置最大最小按钮是否显示
                    , content: ["../../项目管理/工程项目/PM_ProjectBillList.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");//获取选中的数据
                        if (checkStatus.data.length != 1) {
                            return layer.msg("请选择一条数据");
                        }
                        //判断项目是否关闭
                        if (checkStatus.data[0].关闭人 == null || checkStatus.data[0].关闭人 == "") {
                            $("#HProjectID").val(checkStatus.data[0].HInterID);
                            $("#HProjectNumber").val(checkStatus.data[0].项目代码);//工程项目代码
                            $("#HProjectName").val(checkStatus.data[0].项目名称);//工程项目代码
                        } else {
                            layer.msg("该项目已关闭,不可选择!");
                        }
                        layer.close(index);//关闭弹窗
                    }
                    , btn2: function (index, layero) { }
                    , end: function () { }
                })
            }
            //#region èŽ·å–æºå•ç±»åž‹
            function HSourceBillType() {
                var HName = '发货通知单';
@@ -1180,7 +1370,7 @@
                $.ajax({
                    type: "get",
                    async: false,
                    data: { "HName": HName },
                    data: { "HName": HName, "Num":2 },       //0蓝单 1红单 2不分红蓝单
                    url: GetWEBURL() + "/Web/GetHSourceBillType",
                    success: function (result) {
                        var HSourceBillTypes = "";
@@ -1197,7 +1387,6 @@
            }
            //#endregion
            //#region ä¿å­˜åŽæµè§ˆæ–¹æ³•
            function ReRoadBillMain() {
                location.replace('Add_Edit_Xs_SeOutStockBillList.html?OperationType=4&linterid=' + linterid + '&HSouceBillType=');
@@ -1212,35 +1401,74 @@
            //以上是layui模块
        });
        // åŸºç¡€èµ„料返回数据
        //function GetHEmpValue(obj)  //返回业务员
        //{
        //    $("#HEmpName").val(obj[0].HName);
        //    $("#HEmpID").val(obj[0].HItemID);
        //}
        function GetHEmpValue(obj)  //返回业务员
        {
            $("#HEmpName").val(obj[0].职员名称);
            $("#HEmpID").val(obj[0].HItemID);
        }
        //function GetHSupValue(obj)  //返回客户
        //{
        //    $("#HCusName").val(obj[0].HName);
        //    $("#HCusID").val(obj[0].HItemID);
        //}
        function GetHCusNameValue(obj)  //返回客户
        {
            $("#HCusName").val(obj[0].客户名称);
            $("#HCusID").val(obj[0].HItemID);
        }
        //function GetHManagerValue(obj)  //返回主管
        //{
        //    $("#HManagerName").val(obj[0].HName);
        //    $("#HManagerID").val(obj[0].HItemID);
        //}
        function GetHManagerValue(obj)  //返回主管
        {
            $("#HManagerName").val(obj[0].职员名称);
            $("#HManagerID").val(obj[0].HItemID);
        }
        //function GetHDeptNameValue(obj)  //返回部门
        //{
        //    $("#HDeptName").val(obj[0].HName);
        //    $("#HDeptID").val(obj[0].HItemID);
        //}
        function GetHDeptNameValue(obj)  //返回部门
        {
            $("#HDeptName").val(obj[0].部门名称);
            $("#HDeptID").val(obj[0].HItemID);
        }
        //function GetHWHValue(obj)  //返回仓库
        //{
        //    $("#HWHName").val(obj[0].HName);
        //    $("#HWHID").val(obj[0].HItemID);
        //}
        //项目代码
        function GetProjectBillValue(obj) {
            if (obj[0].关闭人 == null || obj[0].关闭人 == "") {
                $("#HProjectID").val(obj[0].HInterID);
                $("#HProjectNumber").val(obj[0].项目代码);//工程项目代码
                $("#HProjectName").val(obj[0].项目名称);//工程项目代码
            } else {
                layer.msg("该项目已关闭,不可选择!");
            }
        }
        function GetHWHValue(obj)  //返回仓库
        {
            $("#HWHName").val(obj[0].仓库名称);
            $("#HWHID").val(obj[0].HItemID);
            if (option.data.length > 0) {
                for (var i = 0; i < option.data.length; i++) {
                    if (option.data[i]["HWHID"] == 0 || option.data[i]["发货仓库"] == undefined) {
                        option.data[i]["HWHID"] = obj[0].HItemID;
                        option.data[i]["发货仓库"] = obj[0].仓库名称;
                    }
                }
            }
            layui.table.render(option);
        }
        //双击返回仓库
        function GetHWHSubValue(data) {
            OptionData = data[0]
        }
        function GetGyMaterial(obj)           //物料名称
        {
            OptionData = obj;
        }
        function GetAuxiliaryUnitValue(obj)           //计量单位
        {
            OptionData = obj[0];
        }
    </script>
</body>
</html>