yangle
2023-03-06 b0c4fd3d7c914dd8aee43804fa77f1ee5d04a11d
WebTM/views/ÁìÁÏ·¢»õ/ÏúÊÛ³ö¿â/Kf_SellOutBill_Fast.html
@@ -9,7 +9,7 @@
    <link rel="stylesheet" href="../../../layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="../../../layuiadmin/style/admin.css" media="all">
    <style>
        .layui-col-xs8 {
            width: 55.666667%;
        }
@@ -62,27 +62,12 @@
                                <div class="layui-form-item">
                                    <div class="layui-row">
                                        <div class="layui-col-xs3">
                                            <label class="layui-form-label" style="width:60px;padding-left:0px;">单据类型</label>
                                            <label class="layui-form-label" style="width:60px;padding-left:0px;">源单类型</label>
                                        </div>
                                        <div class="layui-col-xs8">
                                            <select name=" HBillType" id="HBillType">
                                                <option value="1402">发货通知单</option>
                                                <option value="1401">销售订单</option>
                                            </select>
                                        </div>
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <div class="layui-row">
                                        <div class="layui-col-xs3">
                                            <label class="layui-form-label" style="width:60px;padding-left:0px;">扫描类型</label>
                                        </div>
                                        <div class="layui-col-xs8">
                                            <select name=" HScanStyle" id="HScanStyle">
                                                <option value="整托扫码">整托扫码</option>
                                                <option value="单个拆码">单个拆码</option>
                                                <option value="反向拆码">反向拆码</option>
                                                <option value="整托删除">整托删除</option>
                                            </select>
                                        </div>
                                    </div>
@@ -97,6 +82,45 @@
                                        </div>
                                        <div class="layui-col-xs2">
                                            <button type="button" lay-submit="" class="layui-btn" lay-filter="QueDin2">确定</button>
                                        </div>
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <div class="layui-row">
                                        <div class="layui-col-xs3">
                                            <label class="layui-form-label" style="width:60px;padding-left:0px;">扫描类型</label>
                                        </div>
                                        <div class="layui-col-xs8">
                                            <select name=" HScanStyle" id="HScanStyle" disabled:"disabled">
                                                <option value="整托扫码">整托扫码</option>
                                                <option value="单个拆码">单个拆码</option>
                                                <option value="反向拆码">反向拆码</option>
                                                <option value="整托删除">整托删除</option>
                                            </select>
                                        </div>
                                    </div>
                                </div>
                                <div class="layui-form-item" style="padding:0px;margin:0px">
                                    <div class="layui-row">
                                        <div class="layui-col-xs3">
                                            <label class="layui-form-label" style="width:60px;padding-left:0px;">先进先出仓库</label>
                                        </div>
                                        <div class="layui-col-xs6">
                                            <input type="text" name="HWHNAME_FIFO" id="HWHNAME_FIFO" lay-verify="HWHNAME_FIFO" autocomplete="off" class="layui-input">
                                            <input type="hidden" name="HWHID_FIFO" id="HWHID_FIFO" lay-verify="HWHID_FIFO" value="0" autocomplete="off" class="layui-input">
                                        </div>
                                        <div class="layui-col-xs3">
                                            <button type="button" lay-submit="" class="layui-btn" lay-filter="HWHID_FIFO-BT" disabled:"disabled">...</button>
                                        </div>
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <div class="layui-row">
                                        <div class="layui-col-xs3">
                                            <label class="layui-form-label" style="width:60px;padding-left:0px;">日期</label>
                                        </div>
                                        <div class="layui-col-xs8">
                                            <input type="date" name="HDate" id="HDate" autocomplete="off" class="layui-input">
                                        </div>
                                    </div>
                                </div>
@@ -127,7 +151,7 @@
                                            <input type="hidden" name="HStockPlaceID" id="HStockPlaceID" lay-verify="HStockPlaceID" value="0" autocomplete="off" class="layui-input">
                                        </div>
                                        <div class="layui-col-xs3">
                                            <button type="button" lay-submit="" class="layui-btn" lay-filter="HSpID-BT" >...</button>
                                            <button type="button" lay-submit="" class="layui-btn" lay-filter="HSpID-BT">...</button>
                                        </div>
                                    </div>
                                </div>
@@ -216,20 +240,21 @@
                            <!--物料清单-->
                            <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-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>
                                <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>
@@ -313,14 +338,13 @@
            index: 'lib/index' //主入口模块
        }).use(['index', 'form', 'laydate', 'table', 'element'], function () {
            var $ = layui.$
            , admin = layui.admin
            , layer = layui.layer
            , table = layui.table
            , form = layui.form
                , admin = layui.admin
                , layer = layui.layer
                , table = layui.table
                , form = layui.form
                , laydate = layui.laydate
                , element = layui.element;
            var HStockOrgID = sessionStorage["OrganizationID"]
            var option = [];
            //源单找货列表
@@ -331,7 +355,7 @@
                , page: true
                , cellMinWidth: 90
                , cols: [[
                    { field: '在库状态', title: '在库状态',width:180 }
                    { field: '在库状态', title: '在库状态', width: 180 }
                    , { field: '物料名称', title: '物料名称' }
                    , { field: '批次', title: '批次' }
                    , { field: '数量', title: '数量' }
@@ -365,8 +389,21 @@
            $("#HMakerID").hide();
            $("#HBillerID").val(sessionStorage["HBillerID"]);
            $("#HBillerID").hide();
            $("#HDate").val(formatDate(sessionStorage["HDate"]));
            var HSourceFlag = sessionStorage["SourceFlag"];
            // ç¼–辑获取表头时时间格式矫正方式
            function formatDate(date) {
                var d = new Date(date),
                    month = '' + (d.getMonth() + 1),
                    day = '' + d.getDate(),
                    year = d.getFullYear();
                if (month.length < 2) month = '0' + month;
                if (day.length < 2) day = '0' + day;
                return [year, month, day].join('-');
            }
            //初始化明细表格
            function set_InitGrid() {
@@ -428,10 +465,20 @@
            var params = getUrlVars();
            var linterid = params[params[0]]; //从参数中获取 å•据内码
            var lSourceBillType = params[params[2]];  //从单据获取 æºå•类型
            function  RoadBillMain(linterid)//加载表头
            //初始化表单插件
            set_InitFrom();
            //初始化表单插件
            function set_InitFrom() {
                //常规用法
                laydate.render({
                    elem: '#HDate'
                });
            }
            function RoadBillMain(linterid)//加载表头
            {
                $.ajax({
                    url: GetWEBURL() + "/Web/GetPonderationBill",
@@ -441,10 +488,36 @@
                        // console.log(d.data);
                        $("#HInterID").val(d.data[0].HInterID);
                        $("#HBillNo").val(d.data[0].HBillNo);
                        $("#HBillType").val(d.data[0].HSourceBillType);
                        $("#HBillType").val(d.data[0].HSourceBillType == null ? "1402" : d.data[0].HSourceBillType);
                        //获取源单类型、源单单号
                        if (d.data[0].HSourceBillType == "1402") {
                            $("#HBillType").empty();
                            $("#HBillType").val("1402");
                            var optionHtml = '';
                            optionHtml += "<option value = '" + d.data[0].HSourceBillType + "' >" + '发货通知单' + "</option>";
                            $("#HBillType").append(optionHtml);
                            layui.form.render('select');
                            $("#HBillType").attr("readonly", "readonly");
                        }
                        else if (d.data[0].HSourceBillType == "1401") {
                            $("#HBillType").empty();
                            $("#HBillType").val("1401");
                            var optionHtml = '';
                            optionHtml += "<option value = '" + d.data[0].HSourceBillType + "' >" + '销售订单' + "</option>";
                            $("#HBillType").append(optionHtml);
                            layui.form.render('select');
                            $("#HBillType").attr("readonly", "readonly");
                        }
                        else {
                            //$("#HBillType").val("-1");
                        }
                        $("#HSourceBillNo").val(d.data[0].HSourceBillNo);
                        $("#HSourceBillNo").attr("disabled", "true");
                        HSourceFlag = true;
                        $("#HDeptID").val(d.data[0].HDeptID);
                        $("#HDeptName").val(d.data[0].HDeptName);
                        $("#HDate").val(formatDate(new Date(), "yyyy-MM-dd"));
                        //$("#HWHID").val(d.data[0].HWhID);
                        //$("#HStockPlaceID").val(d.data[0].HSPID);
                        //$("#HKeeperID").val(d.data[0].HKeeperID);
@@ -522,34 +595,64 @@
                        layer.closeAll("loading");
                    }
                });
                //$.ajax({
                //    url: GetWEBURL() + '/OtherInStockBill/DisBillEntryList_Webs_New_Json1',
                //    type: "GET",
                //    data: { HBillID: sInterID, HBillNo: sBillNo, HBillType: HBillType, sMouldManagerCtl: sMouldManagerCtl, sFIFOCtl: sFIFOCtl },
                //    success: function (result) {
                //        if (result.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                //            listOption.data = result.data.list;
                //            table.render(listOption);
                //            listOption1.data = result.data.list2;
                //            table.render(listOption1);
                //            //console.log(result.data.list2);
                //            var count = 0;
                //            var count1 = 0;
                //            for (var i = 0; i < result.data.list.length; i++) {
                //                count += result.data.list[i].HQty;
                //                count1 += result.data.list[i].HPieceQty;
                //            }
                //            $("#HSumQtys").val(count);
                //            $("#HBarCodeQtys").val(count1);
                //            //return;
                //        }
                //        else {
                //            layer.msg(result.Message);
                //        }
                //        layer.closeAll("loading");
                //    }
                //});
            }
            //动态加载源单类型列表 new
            //判断是否新增
            if (linterid == null || linterid == 0) {
                //获取最大单据号 new
                $("#HInterID").val("");
                $("#HBillNo").val("");
                $("#HBillNo").val("");
                $.ajax({
                    url: GetWEBURL() + "/Web/GetMAXNumPDA",
                    url: GetWEBURL() + "/Web/GetMAXNum",
                    type: "GET",
                    data: { "HBillType": '1205' },
                    success: function (d) {
                        //console.log(d.data);
                        $("#HInterID").val(d.data[0].HInterID);
                        $("#HBillNo").val(d.data[0].HBillNo);
                        $("#HDate").val(formatDate(new Date(), "yyyy-MM-dd"));
                        //$("#HInterID").val('132522535');
                        //$("#HBillNo").val('421458026');
                        set_InitGrid();
                    }
                });
                });
            }
            else {//如果修改则走下面 new-----不会走
                RoadBillMain(linterid);
@@ -565,7 +668,36 @@
                    , shade: 0.6 //遮罩透明度
                    , maxmin: true //允许全屏最小化
                    , anim: 0 //0-6的动画形式,-1不开启
                    , content: ['../../../views/Baseset/基础资料/Gy_WarehouseList.html?Type=HWHID', 'yes']
                    , content: ['../../../views/Baseset/基础资料/Gy_WarehouseListNew.html?Type=HWHID&HOrgID=' + HStockOrgID + '', 'yes']
                    , resize: false
                    , cancel: function () {
                    }
                })
            });
            //form.on('submit(HWHID-BT)', function () {//选择仓库
            //    layer.open({
            //        type: 2
            //        , area: ['100%', '100%']
            //        , title: '仓库列表'
            //        , shade: 0.6 //遮罩透明度
            //        , maxmin: true //允许全屏最小化
            //        , anim: 0 //0-6的动画形式,-1不开启
            //        , content: ['../../../views/Baseset/基础资料/Gy_WarehouseList.html?Type=HWHID', 'yes']
            //        , resize: false
            //        , cancel: function () {
            //            //$(".layui-btn").removeClass("layui-btn-disabled");
            //        }
            //    })
            //});
            form.on('submit(HWHID_FIFO-BT)', function () {//选择先进先出仓库
                layer.open({
                    type: 2
                    , area: ['100%', '100%']
                    , title: '仓库列表'
                    , shade: 0.6 //遮罩透明度
                    , maxmin: true //允许全屏最小化
                    , anim: 0 //0-6的动画形式,-1不开启
                    , content: ['../../../views/Baseset/基础资料/Gy_WarehouseList.html?Type=HFIFOWHID', 'yes']
                    , resize: false
                    , cancel: function () {
                        //$(".layui-btn").removeClass("layui-btn-disabled");
@@ -697,9 +829,6 @@
            });
            form.on('submit(Cancel)', function () {
                //sessionStorage["SourceFlag"] = false;
                //parent.location.href = "../../../views/index.html"
                //window.close();//关闭当前页
                layer.confirm('您确定要退出吗?', { icon: 3, title: '提示' }, function (index) {
                    window.close();
                });
@@ -798,61 +927,61 @@
            //删除
            form.on('submit(cmdDelete)', function () {//删除
                var checkStatus = table.checkStatus('wl-table')
                , data = checkStatus.data;
                // console.log(data);
                var sInterID = $('#HInterID').val()
                var sMaterID = data[0].HMaterID
                var sBillType = '1205'
                var sAuxPropID = data[0].HAuxPropID
                //var sMTONo = data[0].HMTONo
                var sMTONo = ''
                var sSourceInterID = data[0].HSourceInterID
                var sSourceEntryID = data[0].HSourceEntryID
                $.ajax(
                   {
                       type: "Get",
                       //url: "http://61.130.49.162:9090/WMSAPI///POStockInBill/Delete_Json", //方法所在页面和方法名
                       url: GetWEBURL() + "/SellOut/Delete_Json",
                       async: true,
                       data: { "HInterID": sInterID, "HMaterID": sMaterID, "HAuxPropID": sAuxPropID, "HMTONo": sMTONo, "HSourceInterID": sSourceInterID, "HSourceEntryID": sSourceEntryID, "sHBillType": sBillType, },
                       dataType: "json",
                       success: function (data) {
                           if (data.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†
                               table.render({
                                   elem: '#wl-table'
                                   , url: GetWEBURL() + '/SellOut/DisBillEntryList_Webs_Json'
                                   , cellMinWidth: 80
                                   , toolbar: '#toolbarDemo'
                                   , defaultToolbar: []
                                   , where: { HBillID: sInterID, HBillType: '1205', sWhere: '' }
                                   , cols: [[
                                      { type: 'radio' }
                                       , { field: 'HQty', title: '数量', width: 80 }
                                       , { field: 'HAuxQty', title: '辅助数量', width: 80 }
                                    , { field: 'HQtyMust', title: '应收数量', width: 80 }
                                    , { field: 'HMaterNumber', title: '物料代码', width: 100 }
                                    , { field: 'HMaterName', title: '物料名称', width: 150 }
                                    , { field: 'HMaterModel', title: '规格型号', width: 100 }
                                    , { field: 'HSourceInterID', title: '源单主内码', width: 100 }
                                    , { field: 'HSourceEntryID', title: '源单子内码', width: 100 }
                                    , { field: 'HSourceBillNo', title: '源单单号', width: 100 }
                                    , { field: 'HBatchNo', title: '批次', width: 100 }
                                    , { field: 'HAuxPropID', title: '辅助属性', width: 100 }
                                    , { field: 'HMTONo', title: '计划跟踪号', width: 100 }
                                    , { field: 'HWHID', title: 'ck', width: 100 }
                                   ]]
                                    //, height: 500
                               })
                           }
                           else {
                               layer.msg(data.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                           }
                       },
                       error: function (err) {
                           layer.msg("错误" + err, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                       }
                   });
                //var checkStatus = table.checkStatus('wl-table')
                //, data = checkStatus.data;
                //// console.log(data);
                //var sInterID = $('#HInterID').val()
                //var sMaterID = data[0].HMaterID
                //var sBillType = '1205'
                //var sAuxPropID = data[0].HAuxPropID
                ////var sMTONo = data[0].HMTONo
                //var sMTONo = ''
                //var sSourceInterID = data[0].HSourceInterID
                //var sSourceEntryID = data[0].HSourceEntryID
                //$.ajax(
                //   {
                //       type: "Get",
                //       //url: "http://61.130.49.162:9090/WMSAPI///POStockInBill/Delete_Json", //方法所在页面和方法名
                //       url: GetWEBURL() + "/SellOut/Delete_Json",
                //       async: true,
                //       data: { "HInterID": sInterID, "HMaterID": sMaterID, "HAuxPropID": sAuxPropID, "HMTONo": sMTONo, "HSourceInterID": sSourceInterID, "HSourceEntryID": sSourceEntryID, "sHBillType": sBillType, },
                //       dataType: "json",
                //       success: function (data) {
                //           if (data.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†
                //               table.render({
                //                   elem: '#wl-table'
                //                   , url: GetWEBURL() + '/SellOut/DisBillEntryList_Webs_Json'
                //                   , cellMinWidth: 80
                //                   , toolbar: '#toolbarDemo'
                //                   , defaultToolbar: []
                //                   , where: { HBillID: sInterID, HBillType: '1205', sWhere: '' }
                //                   , cols: [[
                //                      { type: 'radio' }
                //                       , { field: 'HQty', title: '数量', width: 80 }
                //                       , { field: 'HAuxQty', title: '辅助数量', width: 80 }
                //                    , { field: 'HQtyMust', title: '应收数量', width: 80 }
                //                    , { field: 'HMaterNumber', title: '物料代码', width: 100 }
                //                    , { field: 'HMaterName', title: '物料名称', width: 150 }
                //                    , { field: 'HMaterModel', title: '规格型号', width: 100 }
                //                    , { field: 'HSourceInterID', title: '源单主内码', width: 100 }
                //                    , { field: 'HSourceEntryID', title: '源单子内码', width: 100 }
                //                    , { field: 'HSourceBillNo', title: '源单单号', width: 100 }
                //                    , { field: 'HBatchNo', title: '批次', width: 100 }
                //                    , { field: 'HAuxPropID', title: '辅助属性', width: 100 }
                //                    , { field: 'HMTONo', title: '计划跟踪号', width: 100 }
                //                    , { field: 'HWHID', title: 'ck', width: 100 }
                //                   ]]
                //                    //, height: 500
                //               })
                //           }
                //           else {
                //               layer.msg(data.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                //           }
                //       },
                //       error: function (err) {
                //           layer.msg("错误" + err, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                //       }
                //   });
            });
@@ -864,60 +993,60 @@
                var sSourceType = $("#HBillType").val();
                if (AllowLoadData(sSubStr) != false)//非空验证
                {
                    var flage = true;
                    for (var i = 0; i < sSubStr.length; i++) {
                        if (sSubStr[i].HQty == 0) {
                            flage = false;
                        }
                    }
                    if (!flage) {
                        layer.confirm('实际扫描卷数为0小于找货单数量!是否继续提交?', {
                            btn: ['ç»§ç»­', '取消'], skin: 'layui-layer-lan', title: "温馨提示"
                        }, function () {
                            Saver(sMainStr);
                        }, function () {
                            layer.closeAll("loading");
                        });
                    } else {
                    //var flage = true;
                    //for (var i = 0; i < sSubStr.length; i++) {
                    //    if (sSubStr[i].HQty == 0) {
                    //        flage = false;
                    //    }
                    //}
                    //if (!flage) {
                    //    layer.confirm('实际扫描卷数为0小于找货单数量!是否继续提交?', {
                    //        btn: ['ç»§ç»­', '取消'], skin: 'layui-layer-lan', title: "温馨提示"
                    //    }, function () {
                    //        Saver(sMainStr);
                    //    }, function () {
                    //        layer.closeAll("loading");
                    //    });
                    //} else {
                        Saver(sMainStr);
                    }
                    //}
                }
            });
            //提交方法调用的ajax
            function Saver(sMainStr) {
                layer.load(1);
                $.ajax(
                {
                    type: "POST",
                    // url: "http://61.130.49.162:9090/WMSAPI///SellOut/set_SaveSellOutBill_Json", //方法所在页面和方法名
                    url: GetWEBURL() + "/SellOut/set_SaveSellOutBill_Json",
                    async: true,
                    data: { "oMain": sMainStr },
                    dataType: "json",
                    success: function (data) {
                        if (data.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†
                            layer.confirm(data.Message , {
                                icon: 1, skin: 'layui-layer-lan', title: "温馨提示", closeBtn: 0, btn: ['新增'],
                                btn2: function () {
                                    //parent.layui.admin.events.closeThisTabs();关闭页签
                                    //window.close();//关闭页面,浏览器有效,PDA无效
                                    parent.location.href = "../../../views/index.html";
                                }//关闭
                            }, function () {
                                //sessionStorage["SourceFlag"] = false;
                                window.location.reload();
                            });//新增
                    {
                        type: "POST",
                        // url: "http://61.130.49.162:9090/WMSAPI///SellOut/set_SaveSellOutBill_Json", //方法所在页面和方法名
                        url: GetWEBURL() + "/SellOut/set_SaveSellOutBill_Json",
                        async: true,
                        data: { "oMain": sMainStr },
                        dataType: "json",
                        success: function (data) {
                            if (data.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†
                                layer.confirm(data.Message, {
                                    icon: 1, skin: 'layui-layer-lan', title: "温馨提示", closeBtn: 0, btn: ['新增'],
                                    btn2: function () {
                                        //parent.layui.admin.events.closeThisTabs();关闭页签
                                        //window.close();//关闭页面,浏览器有效,PDA无效
                                        parent.location.href = "../../../views/index.html";
                                    }//关闭
                                }, function () {
                                    //sessionStorage["SourceFlag"] = false;
                                    window.location.reload();
                                });//新增
                            }
                            else {
                                layer.msg(data.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                            }
                            layer.closeAll("loading");
                        },
                        error: function (err) {
                            layer.msg("接口请求失败!" + err, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        }
                        else {
                            layer.msg(data.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        }
                        layer.closeAll("loading");
                    },
                    error: function (err) {
                        layer.msg("接口请求失败!" + err, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    }
                });
                    });
            }
            //监听提交
@@ -942,7 +1071,7 @@
            form.on('submit(QueDin)', function (data) {
                GetMeesageByBarCode();
            });
            $('#HStockPlaceName').on('keydown', function (event) {      //扫仓位
                var HBarCode = $('#HStockPlaceName').val()
@@ -1045,7 +1174,7 @@
            //});
            //扫源单
            $('#HSourceBillNo').on('keydown', function (event) {
            $('#HSourceBillNo').on('keydown', function (event) {
                if (event.keyCode == 13) {
                    GetMeesageBySourceBillNo();
                }
@@ -1061,13 +1190,13 @@
                // , url: 'http://localhost:8083/Web/SellOut/GetHBarCodeShowBillSub'
                //, toolbar: '#toolbarDemo'
                // , where: { sMsg: linterid, sMsg2: lentryid }
             , cols: [[
               , { field: 'HMaterID', title: '物料ID', width: 100, hide: true }
             ]]
             , page: true
             , height: 500
             , done: function () {
             }
                , cols: [[
                    , { field: 'HMaterID', title: '物料ID', width: 100, hide: true }
                ]]
                , page: true
                , height: 500
                , done: function () {
                }
            });
            //扫源单查货
@@ -1120,7 +1249,7 @@
                    }
                });
            }
            //扫条码
            function GetMeesageByBarCode(obj) {  //返回工作中心
                var sOldBarCode = $('#HBarCode').val()
@@ -1133,6 +1262,8 @@
                var sHWHID = $("#HWHID").val();//仓库ID
                var sHSPID = $("#HStockPlaceID").val();//仓位ID
                var sQty = $("#HQty").val()//数量
                var sMouldManagerCtl = 'N'
                var sFIFOCtl = 'N'
                if (sQty == "") {
                    sQty = 0;
                }
@@ -1174,10 +1305,10 @@
                            }
                        });
                }
                else if (HScanStyle =="整托删除") {
                else if (HScanStyle == "整托删除") {
                    var HBarCode = $('#HBarCode').val();
                    var HInterID = $('#HInterID').val();
                    if (HBarCode=="") {
                    if (HBarCode == "") {
                        layer.msg("整托删除条码不能为空", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        return;
                    }
@@ -1238,10 +1369,19 @@
                    if (sBarCode != "") {
                        $('#HBarCode').val("");
                    }
                    //仓位必须录入
                    //if (sHSPID == '' || sHSPID == 0) {
                    //    //
                    //    playSound();
                    //    layer.msg("仓位为空,不能扫描!", { icon: 5, btn: ['确定'], time: 100000, offset: 't' });
                    //    //11
                    //    return false;
                    //}
                    //
                    $.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": HSourceFlag, "sSourceBillNo": sSourceBillNo, "sSourceType": sHBillType, "HOWNERID": sessionStorage["OrganizationID"], "HScanStyle": HScanStyle},
                        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": sessionStorage["OrganizationID"], "HScanStyle": HScanStyle },
                        success: function (result) {
                            playSound1();
                            if (result.count == 1) {
@@ -1317,39 +1457,70 @@
                                //$("#HSupName").val(result.data.HSupName);
                                //$("#HDeptID").val(result.data.HDeptID);
                                //$("#HDeptName").val(result.data.HDeptName);
                                table.render({
                                    elem: '#wl-table'
                                    , url: GetWEBURL() + '/SellOut/DisBillEntryList_Webs_Json'
                                    , toolbar: '#toolbarDemo'
                                    , where: { HBillID: sInterID, HBillType: '1205', sWhere: '' }
                                    , cols: [[
                                        { type: 'radio' }
                                        , { field: 'HSNO', title: '序号', width: 60 }
                                        , { field: 'HQty', title: '数量', width: 80 }
                                        , { field: 'HAuxQty', title: '辅助数量', width: 80 }
                                        , { field: 'HQtyMust', title: '应发数量', width: 80 }
                                        , { field: 'HMaterName', title: '物料名称', width: 90 }
                                        , { field: 'HMaterNumber', title: '物料代码', width: 90 }
                                        , { field: 'HMaterModel', title: '规格型号', width: 90 }
                                        , { field: 'HSourceInterID', title: '源单主内码', width: 90 }
                                        , { field: 'HSourceEntryID', title: '源单子内码', width: 90 }
                                        , { field: 'HSourceBillNo', title: '源单单号', width: 90 }
                                        , { field: 'HBatchNo', title: '批次', width: 90 }
                                    ]]
                                    , height: 500
                                    , done: function () {
                                //table.render({
                                //    elem: '#wl-table'
                                //    , url: GetWEBURL() + '/SellOut/DisBillEntryList_Webs_Json'
                                //    , toolbar: '#toolbarDemo'
                                //    , where: { HBillID: sInterID, HBillType: '1205', sWhere: '' }
                                //    , cols: [[
                                //        { type: 'radio' }
                                //        , { field: 'HSNO', title: '序号', width: 60 }
                                //        , { field: 'HQty', title: '数量', width: 80 }
                                //        , { field: 'HAuxQty', title: '辅助数量', width: 80 }
                                //        , { field: 'HQtyMust', title: '应发数量', width: 80 }
                                //        , { field: 'HMaterName', title: '物料名称', width: 90 }
                                //        , { field: 'HMaterNumber', title: '物料代码', width: 90 }
                                //        , { field: 'HMaterModel', title: '规格型号', width: 90 }
                                //        , { field: 'HSourceInterID', title: '源单主内码', width: 90 }
                                //        , { field: 'HSourceEntryID', title: '源单子内码', width: 90 }
                                //        , { field: 'HSourceBillNo', title: '源单单号', width: 90 }
                                //        , { field: 'HBatchNo', title: '批次', width: 90 }
                                //    ]]
                                //    , height: 500
                                //    , done: function () {
                                //        layer.closeAll("loading");
                                //    }
                                //});
                                $.ajax({
                                    url: GetWEBURL() + '/OtherInStockBill/DisBillEntryList_Webs_New_Json1',
                                    type: "GET",
                                    data: { HBillID: sInterID, HBillNo: sBillNo, HBillType: sBillType, sMouldManagerCtl: sMouldManagerCtl, sFIFOCtl: sFIFOCtl },
                                    success: function (result) {
                                        if (result.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                                            listOption.data = result.data.list;
                                            table.render(listOption);
                                            listOption1.data = result.data.list2;
                                            table.render(listOption1);
                                            //console.log(result.data.list2);
                                            var count = 0;
                                            var count1 = 0;
                                            for (var i = 0; i < result.data.list.length; i++) {
                                                count += result.data.list[i].HQty;
                                                count1 += result.data.list[i].HPieceQty;
                                            }
                                            $("#HSumQtys").val(count);
                                            $("#HBarCodeQtys").val(count1);
                                            //return;
                                        }
                                        else {
                                            layer.msg(result.Message);
                                        }
                                        layer.closeAll("loading");
                                    }
                                });
                                var count = 0;
                                var count1 = 0;
                                for (var i = 0; i < result.data.length; i++) {
                                    count += result.data.HQty;
                                    count1 += result.data.HPieceQty;
                                }
                                $("#HSumQtys").val(count);
                                $("#HBarCodeQtys").val(count1);
                                //var count = 0;
                                //var count1 = 0;
                                //for (var i = 0; i < result.data.length; i++) {
                                //    count += result.data.HQty;
                                //    count1 += result.data.HPieceQty;
                                //}
                                //$("#HSumQtys").val(count);
                                //$("#HBarCodeQtys").val(count1);
                                playSound1();
                            }
                            else {
@@ -1368,6 +1539,58 @@
                            //11
                        }
                    });
                }
            }
            var listOption = {
                elem: '#wl-table'
                , toolbar: '#toolbarDemo'
                , cellMinWidth: 90
                , limit: 3000
                , totalRow: true
                , cols: [[
                    { type: 'radio' }
                    , { field: 'HSNO', title: '序号', width: 60 }
                    , { field: 'HQty', title: '数量', width: 80, totalRow: true }
                    , { field: 'HAuxQty', title: '辅助数量', width: 80, totalRow: true }
                    , { field: 'HQtyMust', title: '应发数量', width: 80 }
                    , { field: 'HMaterName', title: '物料名称', width: 90 }
                    , { field: 'HMaterNumber', title: '物料代码', width: 90 }
                    , { field: 'HMaterModel', title: '规格型号', width: 90 }
                    , { field: 'HSourceInterID', title: '源单主内码', width: 90 }
                    , { field: 'HSourceEntryID', title: '源单子内码', width: 90 }
                    , { field: 'HSourceBillNo', title: '源单单号', width: 90 }
                    , { field: 'HBatchNo', title: '批次', width: 90 }
                    , { field: 'HPieceQty', title: '条码数量', width: 150 }
                ]]
                , height: 500
                , done: function () {
                    layer.closeAll("loading");
                }
            }
            var listOption1 = {
                elem: '#mx-table'
                , toolbar: '#toolbarDemo'
                , cellMinWidth: 90
                , cols: [[
                    { type: 'radio' }
                    , { field: 'HQty', title: '数量', width: 150, totalRow: true }
                    , { field: 'HQtyMust', title: '应发数量', width: 150 }
                    , { field: 'HBarCode', title: '条码编号', width: 150 }
                    , { field: 'HMaterNumber', title: '物料代码', width: 150 }
                    , { field: 'HMaterName', title: '物料名称', width: 150 }
                    , { field: 'HMaterModel', title: '规格型号', width: 150 }
                    , { field: 'HBatchNo', title: '批号', width: 150 }
                    //, { field: 'HSourceInterID', title: '源单主内码', width: 150 }
                    //, { field: 'HSourceEntryID', title: '源单子内码', width: 150 }
                    , { field: 'HSourceBillNo', title: '源单单号', width: 150 }
                ]]
                , height: 500
                , done: function () {
                    layer.closeAll("loading");
                }
            }
            function playSound() {
@@ -1396,6 +1619,10 @@
                var sInterID = $("#HInterID").val()
                var sBillNo = $("#HBillNo").val()
                var HSourceBillType = $("#HBillType").val()
                var HBillType = '1205'
                var HWHID_FIFO = $("#HWHID_FIFO").val();//先进先出仓库ID
                var sMouldManagerCtl = 'N'
                var sFIFOCtl = 'N'
                if (HSourceBillNo == "" || sInterID <= 0) {
                    layer.msg("源单号为空,或者内码不存在!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                    return;
@@ -1403,7 +1630,7 @@
                $.ajax({
                    url: GetWEBURL() + "/SellOut/set_SavePonderationBillMain_Temp_Source_Fast_Json",
                    type: "GET",
                    data: { "HSourceBillType": HSourceBillType, "HSourceBillNo": HSourceBillNo, "sInterID": sInterID, "sBillNo": sBillNo },
                    data: { sInterID: sInterID, sBillNo: sBillNo, HBillType: '1205', "HSourceBillType": HSourceBillType, "HSourceBillNo": HSourceBillNo, "sInterID": sInterID, "sBillNo": sBillNo },
                    success: function (result) {
                        if (result.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                            //GetSellOutFindSP();
@@ -1417,27 +1644,56 @@
                            //    where: { HBillID: sInterID, HBillType: '1205', sWhere: '' }
                            //});
                            table.render({
                                elem: '#wl-table'
                                , url: GetWEBURL() + '/SellOut/DisBillEntryList_Webs_Json'
                                , toolbar: '#toolbarDemo'
                                , where: { HBillID: sInterID, HBillType: '1205', sWhere: '' }
                                , cols: [[
                                    { type: 'radio' }
                                    , { field: 'HSNO', title: '序号', width: 60 }
                                    , { field: 'HQty', title: '数量', width: 80 }
                                    , { field: 'HAuxQty', title: '辅助数量', width: 80 }
                                    , { field: 'HQtyMust', title: '应发数量', width: 80 }
                                    , { field: 'HMaterName', title: '物料名称', width: 90 }
                                    , { field: 'HMaterNumber', title: '物料代码', width: 90 }
                                    , { field: 'HMaterModel', title: '规格型号', width: 90 }
                                    , { field: 'HSourceInterID', title: '源单主内码', width: 90 }
                                    , { field: 'HSourceEntryID', title: '源单子内码', width: 90 }
                                    , { field: 'HSourceBillNo', title: '源单单号', width: 90 }
                                    , { field: 'HBatchNo', title: '批次', width: 90 }
                                ]]
                                , height: 500
                                , done: function () {
                            //table.render({
                            //    elem: '#wl-table'
                            //    , url: GetWEBURL() + '/SellOut/DisBillEntryList_Webs_Json'
                            //    , toolbar: '#toolbarDemo'
                            //    , where: { HBillID: sInterID, HBillType: '1205', sWhere: '' }
                            //    , cols: [[
                            //        { type: 'radio' }
                            //        , { field: 'HSNO', title: '序号', width: 60 }
                            //        , { field: 'HQty', title: '数量', width: 80 }
                            //        , { field: 'HAuxQty', title: '辅助数量', width: 80 }
                            //        , { field: 'HQtyMust', title: '应发数量', width: 80 }
                            //        , { field: 'HMaterName', title: '物料名称', width: 90 }
                            //        , { field: 'HMaterNumber', title: '物料代码', width: 90 }
                            //        , { field: 'HMaterModel', title: '规格型号', width: 90 }
                            //        , { field: 'HSourceInterID', title: '源单主内码', width: 90 }
                            //        , { field: 'HSourceEntryID', title: '源单子内码', width: 90 }
                            //        , { field: 'HSourceBillNo', title: '源单单号', width: 90 }
                            //        , { field: 'HBatchNo', title: '批次', width: 90 }
                            //    ]]
                            //    , height: 500
                            //    , done: function () {
                            //        layer.closeAll("loading");
                            //    }
                            //});
                            $.ajax({
                                url: GetWEBURL() + '/OtherInStockBill/DisBillEntryList_Webs_New_Json1',
                                type: "GET",
                                data: { HBillID: sInterID, HBillNo: sBillNo, HBillType: HBillType, sMouldManagerCtl: sMouldManagerCtl, sFIFOCtl: sFIFOCtl },
                                success: function (result) {
                                    if (result.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                                        listOption.data = result.data.list;
                                        table.render(listOption);
                                        listOption1.data = result.data.list2;
                                        table.render(listOption1);
                                        //console.log(result.data.list2);
                                        var count = 0;
                                        var count1 = 0;
                                        for (var i = 0; i < result.data.list.length; i++) {
                                            count += result.data.list[i].HQty;
                                            count1 += result.data.list[i].HPieceQty;
                                        }
                                        $("#HSumQtys").val(count);
                                        $("#HBarCodeQtys").val(count1);
                                        //return;
                                    }
                                    else {
                                        layer.msg(result.Message);
                                    }
                                    layer.closeAll("loading");
                                }
                            });
@@ -1449,8 +1705,9 @@
                    }
                });
            }
        });
        //以上为layui模块
@@ -1459,6 +1716,11 @@
            $("#HWHNAME").val(obj[0].HName);
            //sessionStorage["HWHID"] = obj[0].HItemID;
            $("#HWHID").val(obj[0].HItemID);
        }
        function GetHFIFOWHNAMEValue(obj)  //返回先进先出仓库
        {
            $("#HWHNAME_FIFO").val(obj[0].HName);
            $("#HWHID_FIFO").val(obj[0].HItemID);
        }
        function GetHSpValue(obj) {  //返回调入仓位
            $("#HStockPlaceName").val(obj[0].HName);
@@ -1483,6 +1745,20 @@
            $("#HDeptID").val(obj[0].HItemID);
        }
        function AllowLoadData(sSubStr) {  //非空验证
            //数字正则(包含小数)
            var reg = /^\d+(\.\d+)?$/;
            //if (reg.test($("#HQty").val()) == false || $("#HQty").val() == '') {
            //    layer.msg("数量必须为数量或小数", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
            //    return false;
            //}
            //if (reg.test($("#HBarcodeQtys").val()) == false || $("#HBarcodeQtys").val() == '') {
            //    layer.msg("条码数量必须为数量或小数", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
            //    return false;
            //}
            //if (reg.test($("#HSumQtys").val()) == false || $("#HSumQtys").val() == '') {
            //    layer.msg("总数量必须为数量或小数", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
            //    return false;
            //}
            //if ($("#HSourceBillNo").val() == '') {
            //    layer.msg("请先扫源单!", { icon: 5 });
            //    return false;