WebTM/views/WMSɨÂëÄ£¿é/ÆäËûÈë¿â/Kf_OtherInBill_PDA.html
@@ -14,7 +14,7 @@
    <script src="../../../layuiadmin/Scripts/json2.js"></script>
    <script src="../../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
    <script src="../../../layuiadmin/Scripts/webConfig.js"></script>
    <script src="../../../layuiadmin/zgqCustom/zgqCustom.js"></script>
    <script src="../../../layuiadmin/PubCustom.js"></script>
    <style>
        .layui-col-xs8 {
            width: 55.666667%;
@@ -105,7 +105,7 @@
                                                <label class="layui-form-label" style="width:60px;padding-left:0px;">制单人</label>
                                            </div>
                                            <div class="layui-col-xs9">
                                                <input type="text" name="HMaker" id="HMaker" lay-verify="HMaker" autocomplete="off" class="layui-input" style="border-radius: 5px;background-color:#efefef4d;" readonly>
                                                <input type="text" name="HMaker" id="HMaker" lay-verify="HMaker" autocomplete="off" class="layui-input" style="border-radius: 5px;background-color:#efefef4d;" disabled>
                                            </div>
                                        </div>
                                        <div class="layui-row">
@@ -113,7 +113,7 @@
                                                <label class="layui-form-label" style="width:60px;padding-left:0px;">单据号</label>
                                            </div>
                                            <div class="layui-col-xs9">
                                                <input type="text" name="HBillNo" id="HBillNo" lay-verify="HBillNo" autocomplete="off" class="layui-input" style="border-radius: 5px;background-color:#efefef4d;" readonly>
                                                <input type="text" name="HBillNo" id="HBillNo" lay-verify="HBillNo" autocomplete="off" class="layui-input" style="border-radius: 5px;background-color:#efefef4d;" disabled>
                                            </div>
                                        </div>
                                        <div class="layui-row">
@@ -121,7 +121,7 @@
                                                <label class="layui-form-label" style="width:60px;padding-left:0px;">单据ID</label>
                                            </div>
                                            <div class="layui-col-xs9">
                                                <input type="text" name="HInterID" id="HInterID" lay-verify="HInterID" value="0" autocomplete="off" class="layui-input" style="border-radius: 5px;background-color:#efefef4d;" readonly>
                                                <input type="text" name="HInterID" id="HInterID" lay-verify="HInterID" value="0" autocomplete="off" class="layui-input" style="border-radius: 5px;background-color:#efefef4d;" disabled>
                                            </div>
                                        </div>
                                    </div>
@@ -230,7 +230,7 @@
                                                <label class="layui-form-label" style="width:30px;padding-left:0px;">组织</label>
                                            </div>
                                            <div class="layui-col-xs10">
                                                <input type="text" name="HStockOrgName" id="HStockOrgName" lay-verify="HStockOrgName" autocomplete="off" class="layui-input" style="border-radius: 5px;background-color:#efefef4d;" readonly>
                                                <input type="text" name="HStockOrgName" id="HStockOrgName" lay-verify="HStockOrgName" autocomplete="off" class="layui-input" style="border-radius: 5px;background-color:#efefef4d;" disabled>
                                                <input type="hidden" name="HStockOrgID" id="HStockOrgID" lay-verify="HStockOrgID" value="0" autocomplete="off" class="layui-input">
                                            </div>
                                        </div>
@@ -253,7 +253,7 @@
                                                <label class="layui-form-label" style="width:40px;padding-left:0px;">条码</label>
                                            </div>
                                            <div class="layui-col-xs10">
                                                <input type="text" name="HBarCode_B" id="HBarCode_B" class="layui-input" style="border-radius: 5px;background-color:#efefef4d;" readonly>
                                                <input type="text" name="HBarCode_B" id="HBarCode_B" class="layui-input" style="border-radius: 5px;background-color:#efefef4d;" disabled>
                                            </div>
                                        </div>
                                    </div>
@@ -263,7 +263,7 @@
                                                <label class="layui-form-label" style="width:40px;padding-left:0px;">物料</label>
                                            </div>
                                            <div class="layui-col-xs10">
                                                <input type="text" name="HMaterName_B" id="HMaterName_B" class="layui-input" style="border-radius: 5px;background-color:#efefef4d;" readonly>
                                                <input type="text" name="HMaterName_B" id="HMaterName_B" class="layui-input" style="border-radius: 5px;background-color:#efefef4d;" disabled>
                                            </div>
                                        </div>
                                    </div>
@@ -273,7 +273,7 @@
                                                <label class="layui-form-label" style="width:40px;padding-left:0px;">规格</label>
                                            </div>
                                            <div class="layui-col-xs10">
                                                <input type="text" name="HMaterModel_B" id="HMaterModel_B" class="layui-input" style="border-radius: 5px;background-color:#efefef4d;" readonly>
                                                <input type="text" name="HMaterModel_B" id="HMaterModel_B" class="layui-input" style="border-radius: 5px;background-color:#efefef4d;" disabled>
                                            </div>
                                        </div>
                                    </div>
@@ -283,7 +283,7 @@
                                                <label class="layui-form-label" style="width:40px;padding-left:0px;">批次</label>
                                            </div>
                                            <div class="layui-col-xs10">
                                                <input type="text" name="HBatchNo_B" id="HBatchNo_B" class="layui-input" style="border-radius: 5px;background-color:#efefef4d;" readonly>
                                                <input type="text" name="HBatchNo_B" id="HBatchNo_B" class="layui-input" style="border-radius: 5px;background-color:#efefef4d;" disabled>
                                            </div>
                                        </div>
                                    </div>
@@ -293,7 +293,7 @@
                                                <label class="layui-form-label" style="width:40px;padding-left:0px;">单位</label>
                                            </div>
                                            <div class="layui-col-xs10">
                                                <input type="text" name="HUnitName_B" id="HUnitName_B" class="layui-input" style="border-radius: 5px;background-color:#efefef4d;" readonly>
                                                <input type="text" name="HUnitName_B" id="HUnitName_B" class="layui-input" style="border-radius: 5px;background-color:#efefef4d;" disabled>
                                            </div>
                                        </div>
                                    </div>
@@ -303,7 +303,7 @@
                                                <label class="layui-form-label" style="width:40px;padding-left:0px;">数量</label>
                                            </div>
                                            <div class="layui-col-xs10">
                                                <input type="text" name="HQty_B" id="HQty_B" class="layui-input" style="border-radius: 5px;background-color:#efefef4d;" readonly>
                                                <input type="text" name="HQty_B" id="HQty_B" class="layui-input" style="border-radius: 5px;background-color:#efefef4d;" disabled>
                                            </div>
                                        </div>
                                    </div>
@@ -313,7 +313,7 @@
                                                <label class="layui-form-label" style="width:40px;padding-left:0px;">容量</label>
                                            </div>
                                            <div class="layui-col-xs10">
                                                <input type="text" name="HTMQty_B" id="HTMQty_B" class="layui-input" style="border-radius: 5px;background-color:#efefef4d;" readonly>
                                                <input type="text" name="HTMQty_B" id="HTMQty_B" class="layui-input" style="border-radius: 5px;background-color:#efefef4d;" disabled>
                                            </div>
                                        </div>
                                    </div>
@@ -323,7 +323,7 @@
                                                <label class="layui-form-label" style="width:40px;padding-left:0px;">仓库</label>
                                            </div>
                                            <div class="layui-col-xs10">
                                                <input type="text" name="HWHName_B" id="HWHName_B" class="layui-input" style="border-radius: 5px;background-color:#efefef4d;" readonly>
                                                <input type="text" name="HWHName_B" id="HWHName_B" class="layui-input" style="border-radius: 5px;background-color:#efefef4d;" disabled>
                                            </div>
                                        </div>
                                    </div>
@@ -333,7 +333,7 @@
                                                <label class="layui-form-label" style="width:40px;padding-left:0px;">仓位</label>
                                            </div>
                                            <div class="layui-col-xs10">
                                                <input type="text" name="HSPName_B" id="HSPName_B" class="layui-input" style="border-radius: 5px;background-color:#efefef4d;" readonly>
                                                <input type="text" name="HSPName_B" id="HSPName_B" class="layui-input" style="border-radius: 5px;background-color:#efefef4d;" disabled>
                                            </div>
                                        </div>
                                    </div>
@@ -392,11 +392,15 @@
            var HBillerID = sessionStorage["HBillerID"]
            var HStockOrgID = sessionStorage["OrganizationID"]  //组织ID
            var HSourceFlag = false     //是否已扫码标志
            var OperationType = 0       //操作类型(1新增、2从缓存列表中返回)
            var OperationType = 1       //操作类型(1新增、2从缓存列表中返回)
            var listOption = [];
            var columns = "";
            var HModName = "Kf_OtherInBill_PDA";
            var titleData = [];     //不需要显示的字段
            var ModRightName = "CE_OtherIn";    //模块权限参数
            var titleData = [];                 //不需要显示的字段
            var params = get_UrlVars();
            var OperationType = params[params[0]] == null ? 1 : params[params[0]];  //从缓存列表中返回数据类型(1新增、2从缓存列表中返回)
            var HInterID_Temp = params[params[1]];      //从缓存列表中返回单据ID
            //#endregion
@@ -404,20 +408,57 @@
            if (sessionStorage.login != "login") {
                layer.confirm("登录失效,请重新登录!", {
                    icon: 4, skin: 'layui-layer-lan', title: "温馨提示", closeBtn: 0, btn: ['重新登录']
                }, function () { window.location.href = "../../user/login.html"; });
                }, function () { window.location.href = "../../user/login_pda.html"; });
            }
            //#region   ç”¨æˆ·æ¨¡å—权限判断
            //用户模块权限判断
            CheckModRight();
            function CheckModRight() {
                layer.load(3);
                $.ajax({
                    type: "GET",
                    url: GetWEBURL() + "/WEBSController/CheckModRight_Json",
                    async: false,    //async用于控制(false)同步和(true)异步,默认的是true,即请求默认的是异步请求
                    data: { "ModRightName": ModRightName, "HUserName": HMaker },
                    success: function (d) {
                        if (d.count == 1) {
                        }
                        else {
                            layer.msg(d.Message, {
                                icon: 0, time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示", btn: ['确认']
                            }, function () { parent.location.href = "../../../views/index_Mobile.html"; });
                        }
                    },
                    complete: function (XHR, TS) { XHR = null }//回收资源
                });
                layer.closeAll("loading");
            }
            //#endregion
            //失败提示音
            function playSound() {
                console.log("playSound");
                var audio = document.getElementById("cs");
                audio.play();
                audio.onended = function () {
                    // å½“音频播报完成时,调用 pause å’Œè®¾ç½® currentTime ä¸º 0 ä»¥åœæ­¢æ’­æŠ¥å¹¶é‡ç½®
                    audio.pause();
                    audio.currentTime = 0;
                };
            }
            //成功提示音
            function playSound_OK() {
                console.log("playSound_OK");
                var audio = document.getElementById("cs2");
                audio.play();
                audio.onended = function () {
                    // å½“音频播报完成时,调用 pause å’Œè®¾ç½® currentTime ä¸º 0 ä»¥åœæ­¢æ’­æŠ¥å¹¶é‡ç½®
                    audio.pause();
                    audio.currentTime = 0;
                };
            }
            //#region åˆå§‹åŒ–界面
@@ -435,7 +476,7 @@
                $("#HKeeperID").val(sessionStorage["HKeeperID"]);
                $("#HKeeperName").val(sessionStorage["HKeeper"]);
                $("#HMaker").val(sessionStorage["HUserName"]);
                $("#HDate").val(Format(new Date(), "yyyy-MM-dd"));
                $("#HDate").val(Pub_Format(new Date(), "yyyy-MM-dd"));
                $("#HBillerID").val(sessionStorage["HBillerID"]);
                $("#HStockOrgID").val(sessionStorage["OrganizationID"]);
                $("#HStockOrgName").val(sessionStorage["Organization"]);
@@ -444,13 +485,13 @@
                if (sessionStorage["HWhSPFlag"]) {
                    $("#HStockPlaceID").val("0");
                    $("#HStockPlaceName").val("");
                    $("#HStockPlaceName").attr("readonly", "readonly");
                    $("#HStockPlaceName").attr("disabled", "disabled");
                    $('#HSpID-BT').addClass("layui-btn-disabled").attr("disabled", true);//按钮禁用
                }
                else {
                    $("#HStockPlaceID").val(sessionStorage["HSPID"]);
                    $("#HStockPlaceName").val(sessionStorage["HSPName"]);
                    $("#HStockPlaceName").removeAttr("readonly");
                    $("#HStockPlaceName").removeAttr("disabled");
                    $('#HSpID-BT').removeClass("layui-btn-disabled").attr("disabled", false);//按钮恢复正常状态
                }
@@ -505,7 +546,8 @@
                            form.render('select');
                        }
                        layer.closeAll("loading");
                    }
                    },
                    complete: function (XHR, TS) { XHR = null }//回收资源
                })
            }
            //初始化表格
@@ -517,24 +559,20 @@
                    , height: 'full-60'
                    , cellMinWidth: 90
                    , limit: 50
                    , done: function () {
                        layer.closeAll("loading");
                    }
                };
            }
            //#region   ä»Žç¼“存列表中返回信息
            function getUrlVars() {
                var vars = [], hash;
                var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
                for (var i = 0; i < hashes.length; i++) {
                    hash = hashes[i].split('=');
                    vars.push(hash[0]);
                    vars[hash[0]] = hash[1];
                }
                return vars;
            }
            var params = getUrlVars();
            var OperationType = params[params[0]];  //从缓存列表中返回数据类型  1新增  2从缓存列表中返回
            var HInterID_Temp = params[params[1]];  //从缓存列表中返回单据ID
            //#region ç‚¹å‡»è¡Œé€‰ä¸­é«˜äº®
            table.on('row(wl-table)', function (obj) {
                //选中行改变颜色
                $(".layui-table-body tr ").attr({ "style": "background:" });    //其他tr恢复原样
                obj.tr.addClass('layui-table-click').siblings().removeClass('layui-table-click');   //选中行样式
                obj.tr.find('i[class="layui-anim layui-icon"]').trigger("click");   //选中radio样式
                $(obj.tr.selector).attr({ "style": "background:#ceedfa;color:black" }); //改变当前tr背景颜色和字体颜色
            })
            //#endregion
            //判断是否新增,获取最大单据号
@@ -552,7 +590,6 @@
                element.tabChange('tab-Kf_OtherInBill_PDA', '2');
            }
            else {
                OperationType = 1;
                //获取最大单据ID、单据号
                $.ajax({
                    type: "GET",
@@ -569,7 +606,8 @@
                        else {
                            layer.msg(d.Message, { icon: 0, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                        }
                    }
                    },
                    complete: function (XHR, TS) { XHR = null }//回收资源
                });
                HSourceFlag = false;
            }
@@ -586,15 +624,19 @@
                        $("#HBillNo").val(d.data[0].HBillNo);
                        HInterID = $('#HInterID').val()
                        HBillNo = $('#HBillNo').val()
                        //$("#HMainSourceBillType").val(d.data[0].HSourceBillType == null ? "1241" : d.data[0].HSourceBillType);
                        //获取源单类型
                        if (d.data[0].HSourceBillType == "1241") {
                            $("#HMainSourceBillType").empty();
                            var optionHtml = '';
                            optionHtml += "<option value = '" + d.data[0].HSourceBillType + "' >" + '入库申请单' + "</option>";
                            $("#HMainSourceBillType").append(optionHtml);
                            $("#HMainSourceBillType").attr("disabled", "disabled");
                            $("#HBillSubType").val("QTRKD01_SYS");   //标准其他入库单
                            $("#HBillSubType").attr("disabled", "disabled");
                            layui.form.render('select');
                            $("#HMainSourceBillType").attr("readonly", "readonly");
                            //供应商不可编辑
                            $("#HSupName").attr("disabled", "disabled");
                            $('#HSupID-BT').addClass("layui-btn-disabled").attr("disabled", true);//按钮禁用
                        }
                        else {
                            $("#HMainSourceBillType").empty();
@@ -602,21 +644,24 @@
                            optionHtml += "<option value = '" + d.data[0].HSourceBillType + "' >" + '手工录入' + "</option>";
                            $("#HMainSourceBillType").append(optionHtml);
                            layui.form.render('select');
                            $("#HMainSourceBillType").attr("readonly", "readonly");
                            $("#HMainSourceBillType").attr("disabled", "disabled");
                        }
                        $("#HSourceBillNo").val(d.data[0].HSourceBillNo);
                        //非多源单模式
                        if (d.data[0].HMulSourceBill == 0) {
                            $("#HSourceBillNo").attr("readonly", "readonly");
                            $("#HSourceBillNo").attr("disabled", "disabled");
                            $('#HSourceBillNo-BT').addClass("layui-btn-disabled").attr("disabled", true);//按钮禁用
                        }
                        if (d.data[0].HDeptID != 0) {
                            $("#HDeptID").val(d.data[0].HDeptID);
                            $("#HDeptName").val(d.data[0].HDeptName);
                        }
                        $("#HDate").val(Format(new Date(), "yyyy-MM-dd"));
                    }
                        $("#HSupID").val(d.data[0].HCusID);
                        $("#HSupName").val(d.data[0].HSupName);
                        $("#HDate").val(Pub_Format(new Date(), "yyyy-MM-dd"));
                    },
                    complete: function (XHR, TS) { XHR = null }//回收资源
                })
            }
@@ -635,7 +680,7 @@
                        $("#HWHName").val("");
                        $("#HStockPlaceID").val("0");
                        $("#HStockPlaceName").val("");
                        $("#HStockPlaceName").removeAttr("readonly");
                        $("#HStockPlaceName").removeAttr("disabled");
                        $('#HSpID-BT').removeClass("layui-btn-disabled").attr("disabled", false);//按钮恢复正常状态
                        layer.msg("仓库条码为空!", {
                            icon: 0, time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示", btn: ['确认']
@@ -659,11 +704,11 @@
                                $("#HStockPlaceID").val("0");
                                $("#HStockPlaceName").val("");
                                if (result.data[0].HSPFlag == 0) {
                                    $("#HStockPlaceName").attr("readonly", "readonly");
                                    $("#HStockPlaceName").attr("disabled", "disabled");
                                    $('#HSpID-BT').addClass("layui-btn-disabled").attr("disabled", true);//按钮禁用
                                }
                                else {
                                    $("#HStockPlaceName").removeAttr("readonly");
                                    $("#HStockPlaceName").removeAttr("disabled");
                                    $('#HSpID-BT').removeClass("layui-btn-disabled").attr("disabled", false);//按钮恢复正常状态
                                }
                                element.tabChange('tab-Kf_OtherInBill_PDA', '2');
@@ -677,7 +722,7 @@
                                $("#HWHName").val("");
                                $("#HStockPlaceID").val("0");
                                $("#HStockPlaceName").val("");
                                $("#HStockPlaceName").removeAttr("readonly");
                                $("#HStockPlaceName").removeAttr("disabled");
                                $('#HSpID-BT').removeClass("layui-btn-disabled").attr("disabled", false);//按钮恢复正常状态
                                layer.msg(result.Message, {
                                    icon: 0, time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示", btn: ['确认']
@@ -687,7 +732,8 @@
                                });
                            }
                            layer.closeAll("loading");
                        }
                        },
                        complete: function (XHR, TS) { XHR = null }//回收资源
                    });
                }
            });
@@ -767,7 +813,8 @@
                                });
                            }
                            layer.closeAll("loading");
                        }
                        },
                        complete: function (XHR, TS) { XHR = null }//回收资源
                    });
                }
            });
@@ -840,7 +887,8 @@
                                });
                            }
                            layer.closeAll("loading");
                        }
                        },
                        complete: function (XHR, TS) { XHR = null }//回收资源
                    });
                }
            });
@@ -909,7 +957,8 @@
                                });
                            }
                            layer.closeAll("loading");
                        }
                        },
                        complete: function (XHR, TS) { XHR = null }//回收资源
                    });
                }
            });
@@ -978,7 +1027,8 @@
                                });
                            }
                            layer.closeAll("loading");
                        }
                        },
                        complete: function (XHR, TS) { XHR = null }//回收资源
                    });
                }
            });
@@ -1047,7 +1097,8 @@
                                });
                            }
                            layer.closeAll("loading");
                        }
                        },
                        complete: function (XHR, TS) { XHR = null }//回收资源
                    });
                }
            });
@@ -1137,6 +1188,7 @@
                                    layer.msg(data.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                                }
                            },
                            complete: function (XHR, TS) { XHR = null },//回收资源
                            error: function (err) {
                                layer.msg("错误:" + err, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                            }
@@ -1213,6 +1265,7 @@
                                        layer.msg(data.Message, { icon: 2, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                                    }
                                },
                                complete: function (XHR, TS) { XHR = null },//回收资源
                                error: function (err) {
                                    layer.msg('错误' + err, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                                }
@@ -1284,11 +1337,16 @@
                            $("#HSourceBillNo").val(result.data.hSourceBillNoField);
                            $("#HMainSourceBillType").attr("disabled", "disabled");
                            form.render('select');
                            if (result.data.hMulSourceFlagField == 0) {
                                $("#HSourceBillNo").attr("readonly", "readonly");
                                $("#HSourceBillNo").attr("disabled", "disabled");
                                $('#HSourceBillNo-BT').addClass("layui-btn-disabled").attr("disabled", true);//按钮禁用
                            }
                            $("#HBillSubType").val("QTRKD01_SYS");   //标准其他入库单
                            $("#HBillSubType").attr("disabled", "disabled");
                            form.render('select');
                            //供应商不可编辑
                            $("#HSupName").attr("disabled", "disabled");
                            $('#HSupID-BT').addClass("layui-btn-disabled").attr("disabled", true);//按钮禁用
                            element.tabChange('tab-Kf_OtherInBill_PDA', '2');
                            $("#HBarCode").select();
                            $("#HBarCode").focus();
@@ -1305,7 +1363,8 @@
                                $("#HSourceBillNo").focus();
                            });
                        }
                    }
                    },
                    complete: function (XHR, TS) { XHR = null }//回收资源
                });
                layer.closeAll("loading");
            }
@@ -1389,6 +1448,7 @@
                                    });
                                }
                            },
                            complete: function (XHR, TS) { XHR = null },//回收资源
                            error: function (err) {
                                playSound();
                                layer.msg('错误' + err, {
@@ -1434,11 +1494,11 @@
                                    $("#HStockPlaceName").val("");
                                    $("#HStockPlaceID").val("0");
                                    if (result.data.hSPFlagField == 0) {
                                        $("#HStockPlaceName").attr("readonly", "readonly");
                                        $("#HStockPlaceName").attr("disabled", "disabled");
                                        $('#HSpID-BT').addClass("layui-btn-disabled").attr("disabled", true);//按钮禁用
                                    }
                                    else {
                                        $("#HStockPlaceName").removeAttr("readonly");
                                        $("#HStockPlaceName").removeAttr("disabled");
                                        $('#HSpID-BT').removeClass("layui-btn-disabled").attr("disabled", false);//按钮恢复正常状态
                                    }
                                    element.tabChange('tab-Kf_OtherInBill_PDA', '2');  //跳转页签
@@ -1474,7 +1534,7 @@
                                        optionHtml += "<option value = '" + result.data.hSourceBillTypeField + "' >" + '入库申请单' + "</option>";
                                        $("#HMainSourceBillType").append(optionHtml);
                                        layui.form.render('select');
                                        $("#HMainSourceBillType").attr("readonly", "readonly");
                                        $("#HMainSourceBillType").attr("disabled", "disabled");
                                    }
                                    else {
                                        $("#HMainSourceBillType").empty();
@@ -1482,12 +1542,18 @@
                                        optionHtml += "<option value = '-1' >" + '手工录入' + "</option>";
                                        $("#HMainSourceBillType").append(optionHtml);
                                        layui.form.render('select');
                                        $("#HMainSourceBillType").attr("readonly", "readonly");
                                        $("#HMainSourceBillType").attr("disabled", "disabled");
                                    }
                                    if (result.data.hMulSourceFlagField == 0) {
                                        $("#HSourceBillNo").attr("readonly", "readonly");
                                        $("#HSourceBillNo").attr("disabled", "disabled");
                                        $('#HSourceBillNo-BT').addClass("layui-btn-disabled").attr("disabled", true);//按钮禁用
                                    }
                                    $("#HBillSubType").val("QTRKD01_SYS");   //标准其他入库单
                                    $("#HBillSubType").attr("disabled", "disabled");
                                    form.render('select');
                                    //供应商不可编辑
                                    $("#HSupName").attr("disabled", "disabled");
                                    $('#HSupID-BT').addClass("layui-btn-disabled").attr("disabled", true);//按钮禁用
                                    element.tabChange('tab-Kf_OtherInBill_PDA', '3');
                                }
                                //物料条码
@@ -1510,8 +1576,10 @@
                                            var optionHtml = '';
                                            optionHtml += "<option value = '" + result.data.hSourceBillTypeField + "' >" + '入库申请单' + "</option>";
                                            $("#HMainSourceBillType").append(optionHtml);
                                            $("#HMainSourceBillType").attr("disabled", "disabled");
                                            $("#HBillSubType").val("QTRKD01_SYS");   //标准其他入库单
                                            $("#HBillSubType").attr("disabled", "disabled");
                                            layui.form.render('select');
                                            $("#HMainSourceBillType").attr("readonly", "readonly");
                                        }
                                        else {
                                            $("#HMainSourceBillType").empty();
@@ -1519,12 +1587,15 @@
                                            optionHtml += "<option value = '-1' >" + '手工录入' + "</option>";
                                            $("#HMainSourceBillType").append(optionHtml);
                                            layui.form.render('select');
                                            $("#HMainSourceBillType").attr("readonly", "readonly");
                                            $("#HMainSourceBillType").attr("disabled", "disabled");
                                        }
                                        if (result.data.hMulSourceFlagField == 0) {
                                            $("#HSourceBillNo").attr("readonly", "readonly");
                                            $("#HSourceBillNo").attr("disabled", "disabled");
                                            $('#HSourceBillNo-BT').addClass("layui-btn-disabled").attr("disabled", true);//按钮禁用
                                        }
                                        //供应商不可编辑
                                        $("#HSupName").attr("disabled", "disabled");
                                        $('#HSupID-BT').addClass("layui-btn-disabled").attr("disabled", true);//按钮禁用
                                        element.tabChange('tab-Kf_OtherInBill_PDA', '3');
                                    }
                                }
@@ -1543,6 +1614,7 @@
                                });
                            }
                        },
                        complete: function (XHR, TS) { XHR = null },//回收资源
                        error: function (err) {
                            playSound();
                            layer.msg("错误!" + err, {
@@ -1584,7 +1656,7 @@
                            }
                            //在列表左边添加勾选框
                            col.push({ type: 'radio', fixed: 'left', totalRowText: '合计' });
                            col.push({ type: 'radio', totalRowText: '合计' });
                            for (var i = 0; i < data.length; i++) {
                                if ($.inArray(data[i].name, titleData) > -1) {
                                    col.push({ field: data[i].id, title: data[i].name, align: 'center', hide: true }); //隐藏id列
@@ -1609,18 +1681,31 @@
                            listOption.cols = [columns];
                            listOption.data = result.data.Materlist;
                            listOption.totalRow = true;
                            table.cache['wl-table'] = null;         //清空表格缓存数据
                            table.render(listOption);
                            //条码信息
                            $("#HBarCode_B").val(result.data.BarCodeDetailslist[0].HBarCode);
                            $("#HMaterName_B").val(result.data.BarCodeDetailslist[0].HMaterName);
                            $("#HMaterModel_B").val(result.data.BarCodeDetailslist[0].HMaterModel);
                            $("#HBatchNo_B").val(result.data.BarCodeDetailslist[0].HBatchNo);
                            $("#HUnitName_B").val(result.data.BarCodeDetailslist[0].HUnitName);
                            $("#HQty_B").val(result.data.BarCodeDetailslist[0].HQty);
                            $("#HTMQty_B").val(result.data.BarCodeDetailslist[0].HTMQty);
                            $("#HWHName_B").val(result.data.BarCodeDetailslist[0].HWHName);
                            $("#HSPName_B").val(result.data.BarCodeDetailslist[0].HSPName);
                            if ($("#HBarCode_B").val() == '') {
                                $("#HMaterName_B").val("");
                                $("#HMaterModel_B").val("");
                                $("#HBatchNo_B").val("");
                                $("#HUnitName_B").val("");
                                $("#HQty_B").val("");
                                $("#HTMQty_B").val("");
                                $("#HWHName_B").val("");
                                $("#HSPName_B").val("");
                            }
                            else {
                                $("#HMaterName_B").val(result.data.BarCodeDetailslist[0].HMaterName);
                                $("#HMaterModel_B").val(result.data.BarCodeDetailslist[0].HMaterModel);
                                $("#HBatchNo_B").val(result.data.BarCodeDetailslist[0].HBatchNo);
                                $("#HUnitName_B").val(result.data.BarCodeDetailslist[0].HUnitName);
                                $("#HQty_B").val(result.data.BarCodeDetailslist[0].HQty);
                                $("#HTMQty_B").val(result.data.BarCodeDetailslist[0].HTMQty);
                                $("#HWHName_B").val(result.data.BarCodeDetailslist[0].HWHName);
                                $("#HSPName_B").val(result.data.BarCodeDetailslist[0].HSPName);
                            }
                        }
                        else {
                            listOption.cols = [[
@@ -1647,7 +1732,8 @@
                            $("#HWHName_B").val("");
                            $("#HSPName_B").val("");
                        }
                    }
                    },
                    complete: function (XHR, TS) { XHR = null }//回收资源
                });
            }
@@ -1669,11 +1755,11 @@
                $("#HStockPlaceName").val("");
                $("#HStockPlaceID").val("0");
                if (obj[0].HSPFlag == 0) {
                    $("#HStockPlaceName").attr("readonly", "readonly");
                    $("#HStockPlaceName").attr("disabled", "disabled");
                    $('#HSpID-BT').addClass("layui-btn-disabled").attr("disabled", true);//按钮禁用
                }
                else {
                    $("#HStockPlaceName").removeAttr("readonly");
                    $("#HStockPlaceName").removeAttr("disabled");
                    $('#HSpID-BT').removeClass("layui-btn-disabled").attr("disabled", false);//按钮恢复正常状态
                }
            }
@@ -1726,14 +1812,15 @@
                layer.msg("单据号获取失败,错误的单据号!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                return false;
            }
            if (typeof (sSubStr) == "undefined") {
            if (sSubStr.length == 0) {
                layer.msg("没有扫码信息,请先扫描条码,确认无误后再提交!", { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
                return false;
            }
            //判断是否已扫描物料条码
            if (!typeof (sSubStr) == "undefined") {
                for (var i = 0; i <= sSubStr.length - 1; i++) {
                    if (parseFloat(sSubStr[i].HQty) > 0) {
            else {
                var s = 0;
                for (var i = 0; i <= sSubStr.length - 1; i++) {
                    if (sSubStr[i].数量 > 0) {
                        s = 1;
                    }
                }
@@ -1742,9 +1829,7 @@
                    return false;
                }
            }
            else {
                return true;
            }
            return true;
        }
    </script>