zgq
2021-03-29 9451b3f86064ca3c94e1eca0c7e2b4cdba648842
WebTM/views/ÁìÁÏ·¢»õ/ÏúÊÛ³ö¿â/Kf_SellOutBill_Fast.html
@@ -35,9 +35,11 @@
                            <li lay-id="2" style="padding:1px;">单据信息</li>
                            <li lay-id="3" style="padding:1px;">物料清单</li>
                            <li lay-id="4" style="padding:1px;">明细清单</li>
                            <li lay-id="5" style="padding:1px;">日志</li>
                            <li lay-id="5" style="padding:1px;">源单找货</li>
                            <li lay-id="6" style="padding:1px;">日志</li>
                        </ul>
                        <div class="layui-tab-content">
                            <!--源单信息-->
                            <div class="layui-tab-item layui-show">
                                <div class="layui-form-item">
                                    <div class="layui-row">
@@ -63,6 +65,7 @@
                                    </div>
                                </div>
                            </div>
                            <!--单据信息-->
                            <div class="layui-tab-item">
                                <div class="layui-form-item" style="padding:0px;margin:0px">
                                    <div class="layui-row">
@@ -174,17 +177,18 @@
                                    </div>
                                </div>
                            </div>
                            <!--物料清单-->
                            <div class="layui-tab-item">
                                <!--<div class="layui-form-item" style="padding:0px;margin:0px">
                            <div class="layui-row">
                                <div class="layui-col-xs4">
                                    <label class="layui-form-label" style="width:40px;padding-left:0px;">条码</label>
                                </div>
                                <div class="layui-col-xs8">
                                    <input type="text" name="HBarCode" id="HBarCode" lay-verify="HBarCode" autocomplete="off" class="layui-input">
                                </div>
                            </div>
                        </div>-->
            <div class="layui-row">
                <div class="layui-col-xs4">
                    <label class="layui-form-label" style="width:40px;padding-left:0px;">条码</label>
                </div>
                <div class="layui-col-xs8">
                    <input type="text" name="HBarCode" id="HBarCode" lay-verify="HBarCode" autocomplete="off" class="layui-input">
                </div>
            </div>
        </div>-->
                                <div class="layui-form-item" style="padding:0px;margin:0px">
                                    <div class="layui-row">
                                        <div class="layui-col-xs3">
@@ -197,9 +201,15 @@
                                </div>
                                <table class="layui-hide" id="wl-table" lay-filter="wl-table"></table>
                            </div>
                            <!--明细清单-->
                            <div class="layui-tab-item">
                                <table class="layui-hide" id="mx-table" lay-filter="mx-table"></table>
                            </div>
                            <!--源单找货-->
                            <div class="layui-tab-item">
                                <table class="layui-hide" id="zh-table" lay-filter="zh-table"></table>
                            </div>
                            <!--日志-->
                            <div class="layui-tab-item">
                                <table class="layui-hide" id="fj-table-qd" lay-filter="fj-table-qd"></table>
                            </div>
@@ -248,6 +258,29 @@
            , form = layui.form
            , element = layui.element;
            //源单找货列表
            var ZHOption = {
                elem: '#zh-table'
                //, toolbar: '#toolbarDemo'
                , height: 'full-50'
                , page: true
                , cellMinWidth: 90
                , cols: [[
                    { field: '在库状态', title: '在库状态',width:180 }
                    , { field: '物料名称', title: '物料名称' }
                    , { field: '批次', title: '批次' }
                    , { field: '数量', title: '数量' }
                    , { field: '物料代码', title: '物料代码' }
                    , { field: '规格型号', title: '规格型号' }
                ]]
                , text: {
                    none: '暂无相关数据,请先扫描源单号!'
                }
            };
            //初始加载表格
            ZHOption.data = [];
            table.render(ZHOption);
            //表头初始化赋值(根据登录用户获取 é»˜è®¤ä»“库、部门、验收、保管、金蝶用户) new
            $("#HWHID").val(sessionStorage["HWHID"]);
@@ -267,6 +300,7 @@
            $("#HMakerID").hide();
            $("#HBillerID").val(sessionStorage["HBillerID"]);
            $("#HBillerID").hide();
            var HSourceFlag = sessionStorage["SourceFlag"];
            //判断是否登录 æœªç™»å½•则跳到登录页
            if (sessionStorage.login != "login") {
@@ -293,7 +327,7 @@
        
            
            function  RoadBillMain(linterid)//加载表头
            function  RoadBillMain(linterid)//加载表头-----不会走
            {
                $.ajax({
                    url: GetWEBURL() + "/Web/GetPonderationBill",
@@ -316,7 +350,7 @@
                })
            }
            function RoadSup()//根据源单类型及源单号 åŠ è½½å®¢æˆ·
            function RoadSup()//根据源单类型及源单号 åŠ è½½å®¢æˆ·-----不会走
            {
                //var sInterID = $("#HInterID").val()
                var HSourceBillNo = $('#HSourceBillNo').val()
@@ -338,8 +372,8 @@
                                $("#HSupID").val(result.data[0].HSupID);
                                $("#HSupName").val(result.data[0].HSupName);
                                $("#HDeptID").val(result.data[0].HDeptID);
                                $("#HDeptName").val(result.data[0].HDeptName);
                                sessionStorage["SourceFlag"] = true;
                                //$("#HDeptName").val(result.data[0].HDeptName);
                                //sessionStorage["SourceFlag"] = true;
                                element.tabChange('tab-SellOutBill', '2');
                                layer.load(3);
                            }
@@ -352,11 +386,11 @@
                }
            }
            function RoadBillSub(linterid)//加载表体
            function RoadBillSub(linterid)//加载表体-----不会走
            {
                table.render({
                    elem: '#wl-table'
                    , url: GetWEBURL1() + '/SellOut/DisBillEntryList_Webs_Json'
                    , url: GetWEBURL() + '/SellOut/DisBillEntryList_Webs_Json'
                    , cellMinWidth: 80
                    , toolbar: '#toolbarDemo'
                    , where: { HBillID: linterid, HBillType: '1205', sWhere: '' }
@@ -404,7 +438,7 @@
                    }
                }); 
            }
            else {//如果修改则走下面 new
            else {//如果修改则走下面 new-----不会走
                RoadBillMain(linterid);
                RoadBillSub(linterid);
            }
@@ -504,7 +538,7 @@
            });
            form.on('submit(Cancel)', function () {
                sessionStorage["SourceFlag"] = false;
                //sessionStorage["SourceFlag"] = false;
                parent.location.href = "../../../views/index.html"
                //window.close();//关闭当前页
            })
@@ -554,7 +588,7 @@
                           if (data.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†
                               table.render({
                                   elem: '#wl-table' 
                                   , url: GetWEBURL1() + '/SellOut/DisBillEntryList_Webs_Json'
                                   , url: GetWEBURL() + '/SellOut/DisBillEntryList_Webs_Json'
                                   , cellMinWidth: 80
                                   , toolbar: '#toolbarDemo'
                                   , where: { HBillID: sInterID, HBillType: '1205', sWhere: '' }
@@ -634,7 +668,7 @@
                                    parent.location.href = "../../../views/index.html";
                                }//关闭
                            }, function () {
                                sessionStorage["SourceFlag"] = false;
                                //sessionStorage["SourceFlag"] = false;
                                window.location.reload();
                            });//新增
                        }
@@ -670,7 +704,7 @@
                var sHWHID = $("#HWHID").val();//仓库ID
                var sHSPID = $("#HStockPlaceID").val();//仓位ID
                var sQty = $("#HQty").val()//数量
                var SourceFlag = sessionStorage["SourceFlag"];
                //var SourceFlag = sessionStorage["SourceFlag"];
                var sSourceBillNo = $("#HSourceBillNo").val();//源单号
                var sHBillType = $("#HBillType").val()  //源单类型-发货通知单:1402,销售订单1401
                
@@ -688,7 +722,7 @@
                    $.ajax({
                        url: GetWEBURL() + "/SellOut/get_CheckTypeByBarCode_Json",
                        type: "GET",
                        data: { "sCode": sBarCode, "sInterID": sInterID, "HBillType": sBillType, "sBillNo": sBillNo, "sMaker": sMaker, "WhID": sHWHID, "SPID": sHSPID, "sQty": sQty, "sRedBlue": false, "SourceFlag": SourceFlag, "sSourceBillNo": sSourceBillNo, "sSourceType": sHBillType, "HOWNERID": 0 },
                        data: { "sCode": sBarCode, "sInterID": sInterID, "HBillType": sBillType, "sBillNo": sBillNo, "sMaker": sMaker, "WhID": sHWHID, "SPID": sHSPID, "sQty": sQty, "sRedBlue": false, "SourceFlag": HSourceFlag, "sSourceBillNo": sSourceBillNo, "sSourceType": sHBillType, "HOWNERID": 0 },
                        success: function (result) {
                            if (result.count == 1) {
                                if (result.data.HBarType == '仓库条码') {
@@ -715,10 +749,10 @@
                                else if (result.data.HBarType == '源单条码') {
                                    $("#HSupName").val(result.data.HSupName);
                                    $("#HSupID").val(result.data.HSupID);
                                    $("#HDeptName").val(result.data.HDeptName);
                                    //$("#HDeptName").val(result.data.HDeptName);
                                    $("#HDeptID").val(result.data.HDeptID);
                                    $("#HSourceBillNo").val(result.data.HSourceBillNo);
                                    sessionStorage["SourceFlag"] = true;
                                    HSourceFlag = true;
                                    //获取源单类型、源单单号
                                    if (result.data.HSourceBillType == "1402") {
                                        $("#HBillType").val("1402");
@@ -734,16 +768,16 @@
                                    element.tabChange('tab-Kf_SellOutBill', '3');
                                }
                                else {
                                    if (sessionStorage["SourceFlag"] == "true") {
                                    if (HSourceFlag == "true") {
                                        element.tabChange('tab-Kf_SellOutBill', '3');
                                    }
                                    else {
                                        $("#HSupName").val(result.data.HSupName);
                                        $("#HSupID").val(result.data.HSupID);
                                        $("#HDeptName").val(result.data.HDeptName);
                                        //$("#HDeptName").val(result.data.HDeptName);
                                        $("#HDeptID").val(result.data.HDeptID);
                                        $("#HSourceBillNo").val(result.data.HSourceBillNo);
                                        sessionStorage["SourceFlag"] = true;
                                        HSourceFlag = true;
                                        //获取源单类型、源单单号
                                        if (result.data.HSourceBillType == "1402") {
                                            $("#HBillType").val("1402");
@@ -767,7 +801,7 @@
                                table.render({
                                    elem: '#wl-table'
                                    // , url: 'http://61.130.49.162:9090/WMSAPI///OtherInStockBill/DisBillEntryList_Webs_Json'
                              , url: GetWEBURL1() + '/SellOut/DisBillEntryList_Webs_Json'
                              , url: GetWEBURL() + '/SellOut/DisBillEntryList_Webs_Json'
                              , toolbar: '#toolbarDemo'
                              , where: { HBillID: sInterID, HBillType: '1205', sWhere: '' }
                              , cols: [[
@@ -871,7 +905,7 @@
            //                    table.render({
            //                        elem: '#wl-table'
            //                        //, url: 'http://61.130.49.162:9090/WMSAPI///SellOut/DisBillEntryList_Webs_Json'
            //                        , url: GetWEBURL1() + '/SellOut/DisBillEntryList_Webs_Json'
            //                        , url: GetWEBURL() + '/SellOut/DisBillEntryList_Webs_Json'
            //                  , toolbar: '#toolbarDemo'
            //                  , where: { HBillID: sInterID, HBillType: '1205', sWhere: '' }
            //                  , cellMinWidth: 90
@@ -911,8 +945,10 @@
                var sBillNo = $("#HBillNo").val()
                var HSourceBillType = $("#HBillType").val()
                if (event.keyCode == 13) {
                    var index = layer.load(0);
                    //判断文本框是否有数据    new
                    if (HSourceBillNo == "" || sInterID <= 0) {
                        layer.close(index);
                        layer.msg("源单号为空,或者内码不存在!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        return;
                    }
@@ -926,13 +962,11 @@
                                $("#HSupName").val(result.data[0].HSupName);
                                //$("#HDeptID").val(result.data[0].HDeptID);
                                //$("#HDeptName").val(result.data[0].HDeptName);
                                sessionStorage["SourceFlag"] = true;
                                element.tabChange('tab-SellOutBill', '2');
                                layer.load(3);
                                HSourceFlag = true;
                                element.tabChange('tab-SellOutBill', '3');
                                table.render({
                                    elem: '#wl-table'
                                    , url: GetWEBURL1() + '/SellOut/DisBillEntryList_Webs_Json'
                                    , url: GetWEBURL() + '/SellOut/DisBillEntryList_Webs_Json'
                                  , toolbar: '#toolbarDemo'
                                  , where: { HBillID: sInterID, HBillType: '1205', sWhere: '' }
                                  , cols: [[
@@ -951,14 +985,16 @@
                                    // , page: true
                                  //, height: 500
                                  , done: function () {
                                      layer.closeAll("loading");
                                      layer.close(index);
                                  }
                                });
                                layer.close(index);
                            }
                            else {
                                layer.close(index);
                                layer.msg(result.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                            }
                            layer.closeAll("loading");
                            layer.close(index);
                        }
                    });
                }
@@ -977,6 +1013,36 @@
             , done: function () {
             }
            });
            //扫源单查货
            $('#HSourceBillNo').on('keydown', function (event) {
                var HSourceBillNo = $('#HSourceBillNo').val();
                if (event.keyCode == 13) {
                    var index = layer.load(0);
                    $.ajax({
                        url: GetWEBURL() + "/LookingFor/GetSellOutFindSP",
                        type: "GET",
                        data: { "HbillNo": HSourceBillNo },
                        success: function (result) {
                            if (result.count == 1) {
                                ZHOption.data = result.data;
                                table.render(ZHOption);
                                layer.close(index);
                                element.tabChange('tab-SellOutBill', '5');
                            }
                            else {
                                layer.close(index);
                                layer.msg(result.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                            }
                        }, error: function () {
                            layer.close(index);
                            layer.alert("接口请求失败!", { icon: 5 });
                        }
                    });
                }
            });
        //以上为layui模块
        });
        function GetHWHValue(obj)  //返回仓库
        {