duhe
2024-01-19 d0c4ee2d8acfca9c216acb9ee043be0112751069
WebTM/views/ÑéÊÕÈë¿â/²úÆ·Èë¿â/Kf_ProductInBill_Fast.html
@@ -19,7 +19,7 @@
<body>
    <div class="layui-fluid" style="padding:0">
        <div class="layui-card">
            <div class="layui-card-body" style="padding: 5px; height:800px;">
            <div class="layui-card-body" style="padding: 0px; height:800px;">
                <form class="layui-form" action="" lay-filter="component-form-group">
                    <div style="background-color:#0085E8;">
                        <span style="color: white;"><i class="layui-icon layui-icon-form"></i>产品入库单</span>
@@ -40,21 +40,21 @@
                                    <label class="layui-form-label" style="width:60px;padding-left:0px;">数量</label>
                                </div>
                                <div class="layui-col-xs8">
                                    <input type="text" name="HQty" id="HQty" lay-verify="HQty" autocomplete="off" class="layui-input">
                                    <input type="text" name="HQty" id="HQty" lay-verify="HQty" onkeyup="if(!this.value.match(/^[\+\-]?\d*?\.?\d*?$/)){if(!this.t_value>0){this.value=''}else{this.value=this.t_value;}}else this.t_value=this.value;if(this.value.match(/^(?:[\+\-]?\d+(?:\.\d+)?)?$/))this.o_value=this.value" autocomplete="off" class="layui-input" onfocus="this.select();">
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="layui-tab layui-col-xs12" lay-filter="tab-ProductlnBill">
                        <ul class="layui-tab-title" lay-filter="tab-all">
                            <li lay-id="1" style="padding:1px;" class="layui-this">源单信息</li>
                            <li lay-id="2" style="padding:1px;">单据信息</li>
                            <li lay-id="1" style="padding:1px;">源单信息</li>
                            <li lay-id="2" style="padding:1px;" class="layui-this">单据信息</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>
                        </ul>
                        <div class="layui-tab-content">
                            <div class="layui-tab-item layui-show">
                            <div class="layui-tab-item ">
                                <div class="layui-form-item">
                                    <!--<div class="layui-row">
            <div class="layui-col-xs3">
@@ -81,7 +81,7 @@
                                            <select name="HBillType" id="HBillType">
                                                <option value="3714">工序汇报单</option>
                                                <option value="3711">生产汇报单</option>
                                                <option value="3710">生产订单</option>
                                                <option value="3710" selected>生产订单</option>
                                            </select>
                                        </div>
                                    </div>
@@ -95,7 +95,7 @@
                                            <label class="layui-form-label" style="width:60px;padding-left:0px;">源单号</label>
                                        </div>
                                        <div class="layui-col-xs8">
                                            <input type="text" name="HSourceBillNo" id="HSourceBillNo" lay-verify="HSourceBillNo" autocomplete="off" class="layui-input">
                                            <input type="text" name="HSourceBillNo" id="HSourceBillNo" lay-verify="HSourceBillNo" autocomplete="off" class="layui-input" onfocus="this.select();">
                                        </div>
                                        <!--<div class="layui-col-xs2">
                                            <button type="button" lay-submit="" class="layui-btn" lay-filter="QueDin2">确定</button>
@@ -113,14 +113,14 @@
                                    </div>
                                </div>
                            </div>
                            <div class="layui-tab-item">
                            <div class="layui-tab-item layui-show" >
                                <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:30px;padding-left:0px;">仓库</label>
                                        </div>
                                        <div class="layui-col-xs6">
                                            <input type="text" name="HWHNAME" id="HWHNAME" lay-verify="HWHNAME" autocomplete="off" class="layui-input" readonly>
                                            <input type="text" name="HWHNAME" id="HWHNAME" lay-verify="HWHNAME" autocomplete="off" class="layui-input" onfocus="this.select();">
                                            <input type="hidden" name="HWHID" id="HWHID" lay-verify="HWHID" value="0" autocomplete="off" class="layui-input">
                                        </div>
                                        <div class="layui-col-xs3">
@@ -134,7 +134,7 @@
                                            <label class="layui-form-label" style="width:30px;padding-left:0px;">仓位</label>
                                        </div>
                                        <div class="layui-col-xs6">
                                            <input type="text" name="HStockPlaceName" id="HStockPlaceName" autocomplete="off" class="layui-input">
                                            <input type="text" name="HStockPlaceName" id="HStockPlaceName" autocomplete="off" class="layui-input" onfocus="this.select();">
                                            <input type="hidden" name="HStockPlaceID" id="HStockPlaceID" value="0" autocomplete="off" class="layui-input">
                                        </div>
                                        <div class="layui-col-xs3">
@@ -148,7 +148,7 @@
                                            <label class="layui-form-label" style="width:30px;padding-left:0px;">保管</label>
                                        </div>
                                        <div class="layui-col-xs6">
                                            <input type="text" name="HKeeper" id="HKeeper" lay-verify="HKeeper" autocomplete="off" class="layui-input">
                                            <input type="text" name="HKeeper" id="HKeeper" lay-verify="HKeeper" autocomplete="off" class="layui-input" onfocus="this.select();">
                                            <input type="hidden" name="HKeeperID" id="HKeeperID" lay-verify="HKeeperID" value="0" autocomplete="off" class="layui-input">
                                        </div>
                                        <div class="layui-col-xs3">
@@ -162,7 +162,7 @@
                                            <label class="layui-form-label" style="width:30px;padding-left:0px;">验收</label>
                                        </div>
                                        <div class="layui-col-xs6">
                                            <input type="text" name="HSecManager" id="HSecManager" lay-verify="HSecManager" autocomplete="off" class="layui-input">
                                            <input type="text" name="HSecManager" id="HSecManager" lay-verify="HSecManager" autocomplete="off" class="layui-input" onfocus="this.select();">
                                            <input type="hidden" name="HSecManagerID" id="HSecManagerID" lay-verify="HSecManagerID" value="0" autocomplete="off" class="layui-input">
                                        </div>
                                        <div class="layui-col-xs3">
@@ -188,7 +188,7 @@
                                            <label class="layui-form-label" style="width:30px;padding-left:0px;">部门</label>
                                        </div>
                                        <div class="layui-col-xs6">
                                            <input type="text" name="HDeptName" id="HDeptName" lay-verify="HDeptName" autocomplete="off" class="layui-input">
                                            <input type="text" name="HDeptName" id="HDeptName" lay-verify="HDeptName" autocomplete="off" class="layui-input" onfocus="this.select();">
                                            <input type="hidden" name="HDeptID" id="HDeptID" lay-verify="HDeptID" value="0" autocomplete="off" class="layui-input">
                                        </div>
                                        <div class="layui-col-xs3">
@@ -210,13 +210,6 @@
                                    </div>
                                </div>
                            </div>
                            <div class="layui-tab-item">
                                <!--<div class="layui-form-item" style="padding:0px;margin:0px">
            <div class="layui-row">
@@ -250,7 +243,7 @@
                                <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:40px;padding-left:0px;">条码数</label>
                                            <label class="layui-form-label" style="width:50px;padding-left:0px;">条码数</label>
                                        </div>
                                        <div class="layui-col-xs8">
                                            <input type="text" name="HBarCodeQtys" id="HBarCodeQtys" lay-verify="HBarCodeQtys" autocomplete="off" class="layui-input">
@@ -260,7 +253,7 @@
                                <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:40px;padding-left:0px;">总数量</label>
                                            <label class="layui-form-label" style="width:50px;padding-left:0px;">总数量</label>
                                        </div>
                                        <div class="layui-col-xs8">
                                            <input type="text" name="HSumQtys" id="HSumQtys" lay-verify="HSumQtys" autocomplete="off" class="layui-input">
@@ -357,7 +350,7 @@
            var HSourceFlag = sessionStorage["SourceFlag"];
            //默认带入的仓库,如果启用仓位则仓位有效,如果没有启用则仓位灰度 new
            $("#HBarCode").focus();
            $("#HWHNAME").focus();
            // ç¼–辑获取表头时时间格式矫正方式
            function formatDate(date) {
@@ -398,8 +391,8 @@
                option = {
                    id: 'wl-table'
                    , elem: '#wl-table'
                    , toolbar: '#toolbarDemo'
                    , page: false
                    //, toolbar: '#toolbarDemo'
                    , page: true
                    , cellMinWidth: 120
                    , height: 500
                    , cols: [columns]
@@ -421,7 +414,7 @@
                return vars;
            }
            ////判断是否登录 æœªç™»å½•则跳到登录页
            //判断是否登录 æœªç™»å½•则跳到登录页
            //if (sessionStorage.login != "login") {
            //    layer.confirm("登录失效,请重新登录!", {
            //        icon: 4, skin: 'layui-layer-lan', title: "温馨提示", closeBtn: 0, btn: ['重新登录']
@@ -507,7 +500,7 @@
                table.render({
                    elem: '#wl-table' 
                    , url: GetWEBURL() + '/ProductIn/DisBillEntryList_Webs_Json'
                    , toolbar: '#toolbarDemo'
                    //, toolbar: '#toolbarDemo'
                    , defaultToolbar: []
                    , where: { HBillID: sInterID, HBillType: '1202', sWhere: '' }
                    , cols: [[
@@ -523,7 +516,8 @@
                        //, { field: 'HBatchNo', title: '批次', width: 150 }
                    ]]
                    // , data: [linterid]
                    // , page: true
                    , page: true
                    , limie: 100
                    , height: 500
                    , done: function () {
                        layer.closeAll("loading");
@@ -576,7 +570,7 @@
                //获取最大单据号 new
                $("#HInterID").val("");
                $("#HBillNo").val("");
                $("#HBillType").val("3714");
                $("#HBillType").val("3710");
                form.render('select');
                $.ajax({
                    url: GetWEBURL() + "/Web/GetMAXNumPDA",
@@ -629,7 +623,7 @@
                    }
                })
            });
            ////选择仓库
            //选择仓库
            //form.on('submit(HWHID-BT)', function () {//选择仓库
            //    layer.open({
            //        type: 2
@@ -807,9 +801,11 @@
                            elem: '#wl-table'
                            //, url: 'http://61.130.49.162:9090/WMSAPI///ProductIn/DisBillEntryList_Webs_Json'
                            , url: GetWEBURL() + '/ProductIn/DisBillEntryList_Webs_Json'
                            , toolbar: '#toolbarDemo'
                            //, toolbar: '#toolbarDemo'
                            , defaultToolbar: []
                            , where: { HBillID: sInterID, HBillType: '1202', sWhere: '' }
                            , page: true
                            , limit: 100
                            , cols: [[
                                { type: 'radio' }
                                , { field: 'HQty', title: '数量', width: 150 }
@@ -841,7 +837,7 @@
                });
            })
            ////删除
            //删除
            //form.on('submit(cmdDelete)', function () {//删除
            //    var checkStatus = table.checkStatus('wl-table')
            //        , data = checkStatus.data;
@@ -894,7 +890,7 @@
            //                        elem: '#wl-table'
            //                        //, url: 'http://61.130.49.162:9090/WMSAPI///ProductIn/DisBillEntryList_Webs_Json'
            //                        , url: GetWEBURL() + '/ProductIn/DisBillEntryList_Webs_Json'
            //                        , toolbar: '#toolbarDemo'
            //                        //, toolbar: '#toolbarDemo'
            //                        , defaultToolbar: []
            //                        , where: { HBillID: sInterID, HBillType: '1202', sWhere: '' }
            //                        , cols: [[
@@ -1021,7 +1017,8 @@
                            dataType: "json",
                            success: function (data) {
                                if (data.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†
                                    layer.confirm("生成产品入库单" + data.Message + $("#HBillNo").val(), {
                                    layer.confirm(data.Message, {
                                    //layer.confirm("生成产品入库单" + data.Message + $("#HBillNo").val(), {
                                        icon: 1, skin: 'layui-layer-lan', title: "温馨提示", closeBtn: 0, btn: ['新增'],
                                        btn2: function () {
                                            //parent.layui.admin.events.closeThisTabs();关闭页签
@@ -1150,6 +1147,40 @@
                }
            });
            //扫仓库
            $('#HWHNAME').on('keydown', function (event) {
                var HBarCode = $('#HWHNAME').val()
                if (event.keyCode == 13) {
                    if (!HBarCode) {
                        layer.msg('无仓库条码信息!');
                        return;
                    }
                    //判断文本框是否有数据    new
                    $.ajax({
                        url: GetWEBURL() + "/LookingFor/getWHName_Json",
                        type: "GET",
                        data: { "HBarCode": HBarCode },
                        success: function (result) {
                            if (result.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                                //$("#HStockPlaceName").val(result.data[0].HName);
                                //$("#HStockPlaceID").val(result.data[0].HItemID);
                                $("#HBarCode").focus();
                                $("#HWHID").val(result.data[0].HItemID);
                                $("#HWHNAME").val(result.data[0].HName);
                                element.tabChange('tab-POStockInBill', '2');
                            }
                            else {
                                // $("#verifycode").click();
                                //layer.msg(result.Message, { icon: 5 });
                                layer.msg(result.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                            }
                            layer.closeAll("loading");
                        }
                    });
                    // layer.msg($('#HSourceBillNo').val(), { icon: 1 });
                }
            });
            //刷新明细页签
            table.render({
                elem: '#mx-table'
@@ -1160,6 +1191,7 @@
                    , { field: 'HMaterID', title: '物料ID', width: 100, hide: true }
                ]]
                , page: true
                , limit: 100
                , height: 500
                , done: function () {
                }
@@ -1183,10 +1215,13 @@
                var sMouldManagerCtl = "N";  //是否启用器具管理
                var sFIFOCtl = "N";          //是否启用先进先出管理
                if (HDeleteFlag == "*") {
                    if (sBarCode != "") {
                    if (sBarCode == "") {
                        layer.msg("请扫描要删除的条码", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        return;
                    }
                    else {
                        $('#HBarCode').val("");
                    }
                    var sBarCode = sOldBarCode.slice(1);
                    $.ajax(
                        {
                            type: "Get",
@@ -1200,8 +1235,10 @@
                                    table.render({
                                        elem: '#wl-table' 
                                        , url: GetWEBURL() + '/ProductIn/DisBillEntryList_Webs_Json'
                                        , toolbar: '#toolbarDemo'
                                        //, toolbar: '#toolbarDemo'
                                        , defaultToolbar: []
                                        , page: true
                                        , limit: 100
                                        , where: { HBillID: sInterID, HBillType: '1202', sWhere: '' }
                                        , cols: [[
                                            { type: 'radio' }
@@ -1223,6 +1260,8 @@
                                            layer.closeAll("loading");
                                        }
                                    })
                                    //清空数量
                                    $("#HQty").val("");
                                }
                                else {
                                    playSound();
@@ -1270,47 +1309,78 @@
                        //data: { "sCode": sBarCode, "sInterID": sInterID, "sBillNo": sBillNo, "sBillType": sBillType, "sMaker": sessionStorage["HUserName"], "WhID": sHWHID, "SPID": sHSPID, "sQty": sQty, "sRedBlue": false, "SourceFlag": HSourceFlag, "sSourceBillNo": sSourceBillNo, "sSourceType": sHBillType, "HOWNERID": sessionStorage["OrganizationID"] },  //旧
                        success: function (result) {
                            //debugger;
                            playSound1();
                            if (result.count == 1) {
                                if (result.data.HBarType == '仓库条码') {
                                    $("#HWHNAME").val(result.data.HWhName);
                                    $("#HWHID").val(result.data.HWhID);
                                playSound1();
                                if (result.data.hBarTypeField == '仓库条码') {
                                    $("#HWHNAME").val(result.data.hWhNameField);
                                    $("#HWHID").val(result.data.hWhIDField);
                                    $("#HStockPlaceName").val("");
                                    $("#HNote").val(";一键扫码仓库条码");
                                    element.tabChange('tab-ProductlnBill', '2');  //跳转页签
                                    return;
                                }
                                else if (result.data.HBarType == '仓位条码') {
                                    $("#HStockPlaceName").val(result.data.HSPName);
                                    $("#HStockPlaceID").val(result.data.HSPID);
                                    $("#HWHNAME").val(result.data.HWhName);
                                    $("#HWHID").val(result.data.HWhID);
                                else if (result.data.hBarTypeField == '仓位条码') {
                                    $("#HStockPlaceName").val(result.data.hSPNameField);
                                    $("#HStockPlaceID").val(result.data.hSPIDField);
                                    $("#HWHNAME").val(result.data.hWhNameField);
                                    $("#HWHID").val(result.data.hWhIDField);
                                    $("#HNote").val(";一键扫码仓位条码");
                                    element.tabChange('tab-ProductlnBill', '2');//跳转页签
                                    return;
                                }
                                else if (result.data.HBarType == '部门条码') {
                                    $("#HDeptName").val(result.data.HDeptName);
                                    $("#HDeptID").val(result.data.HDeptID);
                                else if (result.data.hBarTypeField == '部门条码') {
                                    $("#HDeptName").val(result.data.hDeptNameField);
                                    $("#HDeptID").val(result.data.hDeptIDField);
                                    $("#HNote").val(";一键扫码部门条码");
                                    element.tabChange('tab-ProductlnBill', '2');//跳转页签
                                    return;
                                }
                                else if (result.data.HBarType == '源单条码') {
                                    //$("#HSupName").val(result.data.HSupName);
                                    //$("#HSupID").val(result.data.HSupID);
                                    //$("#HDeptName").val(result.data.HDeptName);
                                    //$("#HDeptID").val(result.data.HDeptID);
                                else if (result.data.hBarTypeField == '源单条码') {
                                    if (result.data.hDeptIDField != 0) {
                                        $("#HDeptID").val(result.data.hDeptIDField);
                                        $("#HDeptName").val(result.data.hDeptNameField);
                                    }
                                    $("#HSourceBillNo").val(result.data.hSourceBillNoField);
                                    HSourceFlag = true;
                                    $("#HBillType").val(result.data.hSourceBillTypeField == null ? "3714" : result.data.hSourceBillTypeField);
                                    //获取源单类型、源单单号
                                    //if (result.data.HSourceBillType == "3711") {
                                    //    $("#HBillType").val("3711");
                                    //}
                                    //else {
                                    //    $("#HBillType").val("-1");
                                    //}
                                    if (result.data.hSourceBillTypeField == "3711") {
                                        $("#HBillType").empty();
                                        $("#HBillType").val("3711");
                                        var optionHtml = '';
                                        optionHtml += "<option value = '" + result.data.hSourceBillTypeField + "' >" + '生产汇报单' + "</option>";
                                        $("#HBillType").append(optionHtml);
                                        layui.form.render('select');
                                        $("#HBillType").attr("readonly", "readonly");
                                    }
                                    else if (result.data.hSourceBillTypeField == "3710") {
                                        $("#HBillType").empty();
                                        $("#HBillType").val("3710");
                                        var optionHtml = '';
                                        optionHtml += "<option value = '" + result.data.hSourceBillTypeField + "' >" + '生产订单' + "</option>";
                                        $("#HBillType").append(optionHtml);
                                        layui.form.render('select');
                                        $("#HBillType").attr("readonly", "readonly");
                                    }
                                    else if (result.data.hSourceBillTypeField == "3714") {
                                        $("#HBillType").empty();
                                        $("#HBillType").val("3714");
                                        var optionHtml = '';
                                        optionHtml += "<option value = '" + result.data.hSourceBillTypeField + "' >" + '工序汇报单' + "</option>";
                                        $("#HBillType").append(optionHtml);
                                        layui.form.render('select');
                                        $("#HBillType").attr("readonly", "readonly");
                                    }
                                    else {
                                        //$("#HBillType").empty();
                                        $("#HBillType").val("-1");
                                        var optionHtml = '';
                                        optionHtml += "<option value = '" + result.data.hSourceBillTypeField + "' >" + '手工录入' + "</option>";
                                        $("#HBillType").append(optionHtml);
                                        layui.form.render('select');
                                        $("#HBillType").attr("readonly", "readonly");
                                    }
                                    $("#HSourceBillNo").attr("readonly", "readonly");
                                    $("#HNote").val(";一键扫码源单条码");
                                    element.tabChange('tab-ProductlnBill', '3');
                                }
@@ -1360,7 +1430,13 @@
                                            $("#HBillType").attr("readonly", "readonly");
                                        }
                                        else {
                                            //$("#HBillType").val("-1");
                                            //$("#HBillType").empty();
                                            $("#HBillType").val("-1");
                                            var optionHtml = '';
                                            optionHtml += "<option value = '" + result.data.hSourceBillTypeField + "' >" + '手工录入' + "</option>";
                                            $("#HBillType").append(optionHtml);
                                            layui.form.render('select');
                                            $("#HBillType").attr("readonly", "readonly");
                                        }
                                        $("#HSourceBillNo").attr("readonly", "readonly");
                                        $("#HNote").val(";物料条码");
@@ -1376,7 +1452,7 @@
                                //    elem: '#wl-table'
                                //    //, url: 'http://61.130.49.162:9090/WMSAPI///ProductIn/DisBillEntryList_Webs_Json'
                                //    , url: GetWEBURL() + '/ProductIn/DisBillEntryList_Webs_Json'
                                //    , toolbar: '#toolbarDemo'
                                //    //, toolbar: '#toolbarDemo'
                                //    , defaultToolbar: []
                                //    , where: { HBillID: sInterID, HBillType: '1202', sWhere: '' }
                                //    , cols: [[
@@ -1431,6 +1507,8 @@
                                        layer.closeAll("loading");
                                    }
                                });
                                //清空数量
                                $("#HQty").val("");
                            }
                            else {
                                playSound();
@@ -1449,9 +1527,11 @@
            var listOption = {
                elem: '#wl-table'
                , toolbar: '#toolbarDemo'
                //, toolbar: '#toolbarDemo'
                , totalRow: true
                , cellMinWidth: 90
                , page: true
                ,limit: 100
                , cols: [[
                    { type: 'radio' }
                    , { field: 'HQty', title: '数量', width: 150, totalRow: true}
@@ -1472,7 +1552,7 @@
            }
            var listOption1 = {
                elem: '#mx-table'
                , toolbar: '#toolbarDemo'
                //, toolbar: '#toolbarDemo'
                , cellMinWidth: 90
                , cols: [[
                    { type: 'radio' }
@@ -1538,9 +1618,11 @@
                            table.render({
                                elem: '#wl-table' 
                                , url: GetWEBURL() + '/ProductIn/DisBillEntryList_Webs_Json'
                                , toolbar: '#toolbarDemo'
                                //, toolbar: '#toolbarDemo'
                                , totalRow: true
                                , defaultToolbar: []
                                , page: true
                                , limit: 100
                                , where: { HBillID: sInterID, HBillType: '1202', sWhere: '' }
                                , cols: [[
                                    { type: 'radio' }
@@ -1556,7 +1638,6 @@
                                    , { field: 'HPieceQty', title: '条码数量', width: 150 }
                                ]]
                                // , data: [linterid]
                                // , page: true
                                , height: 500
                                , done: function () {
                                    layer.closeAll("loading");