初审

<style>
.am-selected-list{
    font-size:1.4rem;
}
.am-selected-list .li{
    padding:5px 10px 0px 10px;
}
.am-factoringDocOnlineCheck_payother_dt .am-selected {
    100%;
    max-280px;
}
    .am-modal {
        1200px;
    }
    .am-selected-content {300px;}
</style>
<section data-am-widget="accordion" 】还没有上传,请上传后再提交 ";
                                alertMsg(alertNum);
                                return false;
                            }
                        }
                    });
                }

                if(!isUpLoad){
                    return;
                }

                var otherUpload = true;
                $("#factoringDocOnlineCheck_payother_dt tr:gt(0)").each(function(index){
                    var $currentRow = $("#factoringDocOnlineCheck_payother_dt tr:gt(0):eq("+index+")");
                    var uploadId = $currentRow.find("td").eq(5).find("#uploadId").val();
                    var fileSource = $currentRow.find("#fileSource").val();
                    if(fileSource == 3){
                        if(!isNotBlank(uploadId)){
                            otherUpload = false;
                            alertMsg("请在另需添加文件处为选择的保理商文件进行上传");
                            return false;
                        }
                    }
                });

                if(!otherUpload){
                    return;
                }

                //循环表格审核意见是否为空-end
                if(isPassed)
                {
                    var flag = true;
                    //发票信息验证
                    $("#factoringDocOnlineCheck").find("#fdocInvoiceinfo_dt tr").each(function(trIndex, trItem) {
                        if(trIndex == 0)
                            return;
                        $(trItem).find("input").each(function(tdIndex, tdItem) {
                            var rowData = getDtRowInfo(factoringDocOnlineCheckAdminEdit.fdocInvoiceinfo_dt, null, trIndex - 1);
                            var invType = rowData[0].data.invoiceType;
                            if(!isNotBlank($(tdItem).val())) {
                                if($(tdItem).parent("td").index() == 1) {
                                    getAlertInfo("FP001W003", "发票号码");
                                    $(tdItem).focus();
                                    flag = false;
                                    return false;
                                }
                                if($(tdItem).parent("td").index() == 2) {
                                    getAlertInfo("FP001W003", "开票日期");
                                    $(tdItem).focus();
                                    flag = false;
                                    return false;
                                }
                                if($(tdItem).parent("td").index() == 3) {
                                    getAlertInfo("FP001W003", "发票金额");
                                    $(tdItem).focus();
                                    flag = false;
                                    return false;
                                }
                                if($(tdItem).parent("td").index() == 4) {
                                    alertMsg("发票代码不能为空");
                                    $(tdItem).focus();
                                    flag = false;
                                    return false;
                                }
                                if($(tdItem).parent("td").index() == 5) {
                                    if(invType == "01" || invType == "02" || invType == "03" || invType == "15") {
                                        $(tdItem).focus();
                                        alertMsg("请输入不含税金额");
                                        flag = false;
                                        return false;
                                    }
                                }
                                if($(tdItem).parent("td").index() == 6) {
                                    if(invType == "04" || invType == "10" || invType == "11" || invType == "14") {
                                        $(tdItem).focus();
                                        alertMsg("请输入校验码(后六位)");
                                        flag = false;
                                        return false;
                                    }
                                }

                            }
                        });
                    });

                    if(!flag) {
                        return;
                    }
                }
                //循环表格审核意见是否为空-end

                //验证表单
                var formResult = $form.validator('isFormValid');
                if (!formResult) {
                    return false; // 表单未能通过校验,不允许提交
                }
                //获取发票信息列表的第一行数据,如果不存在,则没有发票信息
                var rowData = getDtRowInfo(factoringDocOnlineCheckAdminEdit.fdocInvoiceinfo_dt, null, 0);
                if(rowData[0].data == undefined){
                    //发票信息不存在
                    alertMsg("发票信息不能为空,请添加发票信息");
                    $("#invoice_total_Div").find("#invoiceAmount").focus();
                    return;
                }

                var suppliersNameVal = $("#div-payComfirmInfo").find("#suppliersName").val();
                var payUuid = $form.find('#payUuid').val();
                var _cordysTaskId = $form.find('#_cordysTaskId').val();
                var baseContractName = $('#fdoc-invoiceinfo').find("#baseContractName").val();
                var baseContractNo = $('#fdoc-invoiceinfo').find("#baseContractNo").val();
                var contractType = $('#fdoc-invoiceinfo').find("#contractType").val();
                var accountReceivable = $('#factoringDocOnlineCheck').find('#accountReceivable').val();
                var totalInvoiceAmount = $('#invoice_total_Div').find("#totalInvoiceAmount").val();
                var data = {"payId":payUuid,"_cordysTaskId":_cordysTaskId,
                    "baseContractName":baseContractName,"baseContractNo":baseContractNo,
                    "totalInvoiceAmount":totalInvoiceAmount,"contractType":contractType,
                    "accountReceivable":accountReceivable,"certificatesNo":certificatesNo,
                    "businessLicenceNo":businessLicenceNo,"orgcodeLicenseNo":orgcodeLicenseNo,
                    "dateFrom":dateFrom,"dateTo":dateTo,"certificatesFlag":certificatesFlag};
                //审核意见信息
                var approvedefineDt = getDtRowInfo(factoringDocOnlineCheckAdminEdit.factoringDocOnlineCheck_approvedefine_dt);
                if(isNotNull(approvedefineDt) && approvedefineDt.length > 0){
                    data["jsonApprovedefineDt"] = JSON.stringify(approvedefineDt);
                }
                //发票信息
                var invoiceInfoDt = getDtRowInfo(factoringDocOnlineCheckAdminEdit.fdocInvoiceinfo_dt);
                if(isNotNull(invoiceInfoDt)&& invoiceInfoDt.length > 0){
                    data["jsonInvoiceInfoDt"] = JSON.stringify(invoiceInfoDt);
                }
                //其他文件信息
                var payotherDt = getDtRowInfo(factoringDocOnlineCheckAdminEdit.factoringDocOnlineCheck_payother_dt);

                //其它文件信息列表去掉空行
                var payotherCommitDt = new Array();
                $.each(payotherDt,function(index,curRowData){
                    //不是空行时
                    if(isNotBlank(curRowData.documentId) && curRowData.documentId != "undefined" && isNotBlank(curRowData.fileName)){
                        payotherCommitDt.push(curRowData);
                    }
                });

                if(isNotNull(payotherDt) && payotherDt.length > 0){
                    data["jsonPayotherDt"] = JSON.stringify(payotherCommitDt);
                }
                openLoading("提交中,请稍候...");

                //提交
                // 获取当前审核通过的文件数量
                var selectData = getSelectedData(factoringDocOnlineCheckAdminEdit.factoringDocOnlineCheck_approvedefine_dt, 0);
                var directCommit = true;
                var commitFlag = true;
                var passFlag = true;
                var passFlag2 = false;
                if (null == selectData) { // 添加为空情况判断,因为可能全部不通过,selectData会为空,取空的length属性会报错
                    directCommit = false;
                }else if((approvedefineDt.length == selectData.length) && (payotherDt.length == 0)){
                    directCommit = false;
                }
                if(directCommit){
                    if(approvedefineDt.length == selectData.length){
                        if(payotherDt.length == 0){
                            commitFlag = alertMsg("审核通过,是否提交至复审",'COMFIR');
                        } else {
                            $.each(payotherDt,function(index,curRowData){
                                var fileSource = curRowData.fileSource;
                                var uploadId = curRowData.uploadId;
                                var suppliersSealType =curRowData.suppliersSealType;
                                var itemCompanySealType = curRowData.itemCompanySealType;
                                if((fileSource == "0" && suppliersSealType == "1" && !isNotBlank(uploadId))||(fileSource == "1" && itemCompanySealType == "1" && !isNotBlank(uploadId))){
                                    commitFlag = alertMsg("审核通过,但是有另需文件未上传,是否提交至联系供应商/项目公司修改错误信息",'COMFIR');
                                    passFlag2 = true;
                                    return false;
                                }else{
                                    passFlag = false;
                                    return true;
                                }
                            });
                            if(!passFlag && !passFlag2){
                                commitFlag = alertMsg("审核通过,是否提交至复审",'COMFIR');
                            }
                        }
                    } else {
                        commitFlag = alertMsg("审核不通过,是否提交至联系供应商/项目公司修改错误信息",'COMFIR');
                    }
                } else {
                    commitFlag = alertMsg("审核通过,是否提交至复审",'COMFIR');
                }
                if(commitFlag){
                    ajax_jsonp("/app/bl/factoringDocOnlineCheckService/bizapproveresult/",data,function(res){
                        if (!checkResponseData(res)) {
                            closeLoading();
                            return;
                        }
                        // 提交后清除临时表缓存的数据
                        ajax_jsonp_sync("/app/bl/factoringOtherApproveCommit/bizapproveresult/", {"payId":payUuid},"PUT");
                        closeModal(thisClzz.modal);
                        closeLoading();
                    },null,"POST");
                }
                else {
                    return false;
                }
            }//commit() end
        });
    // 文件份数输入内容check
    function intCheck(obj) {
        var value = obj.value;
        var reg = /^(0|+?[1-9][0-9]*)$/;
        if(!reg.test(value)||value>2147483647){
            obj.value = "";
        }
    }
    //校验金额
    function moneyCheck(obj){

        var value = obj.value;
        var reg = /^d+(?:.d{0,2})?$/;
        if(!reg.test(value)||value>2147483647){
            obj.value = "";
        }

    }
    //校验日期
    function isDate(object)
    {
        var str = object.value;
        var flag = false;
        if(!/^(d{4})-(d{1,2})-(d{1,2})$/.test(str))
            flag = false;
        var year = RegExp.$1-0;
        var month = RegExp.$2-1;
        var date = RegExp.$3-0;
        var obj = new Date(year,month,date);
        flag =  !!(obj.getFullYear()==year && obj.getMonth()==month && obj.getDate()==date);
        if(!flag){
            object.value = "";
        }
    }
    function contractType_change(select) {
        //add by lzh start
        //合同类别下拉框改变事件删除临时表的数据
        var thisClzz = factoringDocOnlineCheckAdminEdit;
        var $form = $("#" + thisClzz.formId);
        var payUuid = $form.find('#payUuid').val();
        var contractTypeTemp2 = $("#factoringDocOnlineCheckAdminEditForm").find("#contractType").val() // 页面上selected的值
        // 清空审核列表缓存信息
        // ajax_jsonp_sync("/app/bl/factoringOtherApproveCommit/clearDifferentApproveInfo/", {"payId":payUuid},"PUT");
        // approvedefines.responseJSON.data[0].jsonApprovedefineDt = null;
        /*var tempApprove = approvedefines.responseJSON.data[0].jsonApprovedefineDt
        for(var i=0;i<tempApprove.length;i++){debugger
            if(tempApprove[i].fileId!='BLCS1009'&&tempApprove[i].fileId!='BLCS1006'&&tempApprove[i].fileId!='BLCS1007'&&tempApprove[i].fileId!='BLCS1017'&&tempApprove[i].fileId!='BLCS1088'){
                // tempApprove.remove(tempApprove[i]);
                tempApprove.splice(i,1)
                i = -1;
            }
        }*/
        approvedefines =  ajax_jsonp_sync( "/app/bl/factoringDocOnlineCheckService/getSaveInfo", {"payId":payUuid,"contractType":contractTypeTemp2});
        //add by lzh end
        factoringDocOnlineCheckAdminEdit.initFactoringDocOnlineCheckDt($("#factoringDocOnlineCheckAdminEditForm").find("#contractType").val());

    }
    function certificatesFlag_change(select) {
        //三证合一为'是':显示三证合一编号, 三证合一为'否',显示营业执照号码
        var val = $(select).children('option:selected').val();
        $("#div-certificatesNo").find("#certificatesNo").removeAttr("required");
        $("#div-businessLicenceNo").find("#businessLicenceNo").removeAttr("required");
        $("#div-orgcodeLicenseNo").find("#orgcodeLicenseNo").removeAttr("required");
        if (val == '1') {
            $("#div-suppliersInfo").find("#div-certificatesNo").css("display", "block");
            $("#div-suppliersInfo").find("#div-businessLicenceNo").css("display", "none");
            $("#div-suppliersInfo").find("#div-orgcodeLicenseNo").css("display","none");
        } else {
            $("#div-suppliersInfo").find("#div-certificatesNo").css("display", "none");
            $("#div-suppliersInfo").find("#div-businessLicenceNo").css("display", "block");
            $("#div-suppliersInfo").find("#div-orgcodeLicenseNo").css("display","block");
        }
    }
    // 随机生成uuid    add by zyt start
    function randomUuid (){
        //生成uuid
        var s = [];
        var hexDigits = "0123456789abcdef";
        for (var i = 0; i < 36; i++) {
            s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);
        }
        s[14] = "4";  // bits 12-15 of the time_hi_and_version field to 0010
        s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1);  // bits 6-7 of the clock_seq_hi_and_reserved to 01
        // s[8] = s[13] = s[18] = s[23] = "-";
        var uuid = s.join("");
        return uuid;
    }// add by zyt end
</script>

<style>
.am-selected-list{
    font-size:1.4rem;
}
.am-selected-list .li{
    padding:5px 10px 0px 10px;
}
.am-factoringDocOnlineCheck_payother_dt .am-selected {
    100%;
    max-280px;
}
    .am-modal {
         1200px;
    }
    .am-selected-content {300px;}
</style>
<section data-am-widget="accordion" 】还没有上传,请上传后再提交 ";
                                alertMsg(alertNum);
                                return false;
                            }
                        }
                    });
                }

                if(!isUpLoad){
                    return;
                }

                var otherUpload = true;
                $("#factoringDocOnlineCheck_payother_dt tr:gt(0)").each(function(index){
                    var $currentRow = $("#factoringDocOnlineCheck_payother_dt tr:gt(0):eq("+index+")");
                    var uploadId = $currentRow.find("td").eq(5).find("#uploadId").val();
                    var fileSource = $currentRow.find("#fileSource").val();
                    if(fileSource == 3){
                        if(!isNotBlank(uploadId)){
                            otherUpload = false;
                            alertMsg("请在另需添加文件处为选择的保理商文件进行上传");
                            return false;
                        }
                    }
                });

                if(!otherUpload){
                    return;
                }

                //循环表格审核意见是否为空-end
                if(isPassed)
                {
                    var flag = true;
                    //发票信息验证
                    $("#factoringDocOnlineCheck").find("#fdocInvoiceinfo_dt tr").each(function(trIndex, trItem) {
                        if(trIndex == 0)
                            return;
                        $(trItem).find("input").each(function(tdIndex, tdItem) {
                            var rowData = getDtRowInfo(factoringDocOnlineCheckAdminEdit.fdocInvoiceinfo_dt, null, trIndex - 1);
                            var invType = rowData[0].data.invoiceType;
                            if(!isNotBlank($(tdItem).val())) {
                                if($(tdItem).parent("td").index() == 1) {
                                    getAlertInfo("FP001W003", "发票号码");
                                    $(tdItem).focus();
                                    flag = false;
                                    return false;
                                }
                                if($(tdItem).parent("td").index() == 2) {
                                    getAlertInfo("FP001W003", "开票日期");
                                    $(tdItem).focus();
                                    flag = false;
                                    return false;
                                }
                                if($(tdItem).parent("td").index() == 3) {
                                    getAlertInfo("FP001W003", "发票金额");
                                    $(tdItem).focus();
                                    flag = false;
                                    return false;
                                }
                                if($(tdItem).parent("td").index() == 4) {
                                    alertMsg("发票代码不能为空");
                                    $(tdItem).focus();
                                    flag = false;
                                    return false;
                                }
                                if($(tdItem).parent("td").index() == 5) {
                                    if(invType == "01" || invType == "02" || invType == "03" || invType == "15") {
                                        $(tdItem).focus();
                                        alertMsg("请输入不含税金额");
                                        flag = false;
                                        return false;
                                    }
                                }
                                if($(tdItem).parent("td").index() == 6) {
                                    if(invType == "04" || invType == "10" || invType == "11" || invType == "14") {
                                        $(tdItem).focus();
                                        alertMsg("请输入校验码(后六位)");
                                        flag = false;
                                        return false;
                                    }
                                }

                            }
                        });
                    });

                    if(!flag) {
                        return;
                    }
                }
                //循环表格审核意见是否为空-end

                //验证表单
                var formResult = $form.validator('isFormValid');
                if (!formResult) {
                    return false; // 表单未能通过校验,不允许提交
                }
                //获取发票信息列表的第一行数据,如果不存在,则没有发票信息
                var rowData = getDtRowInfo(factoringDocOnlineCheckAdminEdit.fdocInvoiceinfo_dt, null, 0);
                if(rowData[0].data == undefined){
                    //发票信息不存在
                    alertMsg("发票信息不能为空,请添加发票信息");
                    $("#invoice_total_Div").find("#invoiceAmount").focus();
                    return;
                }

                var suppliersNameVal = $("#div-payComfirmInfo").find("#suppliersName").val();
                var payUuid = $form.find('#payUuid').val();
                var _cordysTaskId = $form.find('#_cordysTaskId').val();
                var baseContractName = $('#fdoc-invoiceinfo').find("#baseContractName").val();
                var baseContractNo = $('#fdoc-invoiceinfo').find("#baseContractNo").val();
                var contractType = $('#fdoc-invoiceinfo').find("#contractType").val();
                var accountReceivable = $('#factoringDocOnlineCheck').find('#accountReceivable').val();
                var totalInvoiceAmount = $('#invoice_total_Div').find("#totalInvoiceAmount").val();
                var data = {"payId":payUuid,"_cordysTaskId":_cordysTaskId,
                    "baseContractName":baseContractName,"baseContractNo":baseContractNo,
                    "totalInvoiceAmount":totalInvoiceAmount,"contractType":contractType,
                    "accountReceivable":accountReceivable,"certificatesNo":certificatesNo,
                    "businessLicenceNo":businessLicenceNo,"orgcodeLicenseNo":orgcodeLicenseNo,
                    "dateFrom":dateFrom,"dateTo":dateTo,"certificatesFlag":certificatesFlag};
                //审核意见信息
                var approvedefineDt = getDtRowInfo(factoringDocOnlineCheckAdminEdit.factoringDocOnlineCheck_approvedefine_dt);
                if(isNotNull(approvedefineDt) && approvedefineDt.length > 0){
                    data["jsonApprovedefineDt"] = JSON.stringify(approvedefineDt);
                }
                //发票信息
                var invoiceInfoDt = getDtRowInfo(factoringDocOnlineCheckAdminEdit.fdocInvoiceinfo_dt);
                if(isNotNull(invoiceInfoDt)&& invoiceInfoDt.length > 0){
                    data["jsonInvoiceInfoDt"] = JSON.stringify(invoiceInfoDt);
                }
                //其他文件信息
                var payotherDt = getDtRowInfo(factoringDocOnlineCheckAdminEdit.factoringDocOnlineCheck_payother_dt);

                //其它文件信息列表去掉空行
                var payotherCommitDt = new Array();
                $.each(payotherDt,function(index,curRowData){
                    //不是空行时
                    if(isNotBlank(curRowData.documentId) && curRowData.documentId != "undefined" && isNotBlank(curRowData.fileName)){
                        payotherCommitDt.push(curRowData);
                    }
                });

                if(isNotNull(payotherDt) && payotherDt.length > 0){
                    data["jsonPayotherDt"] = JSON.stringify(payotherCommitDt);
                }
                openLoading("提交中,请稍候...");

                //提交
                // 获取当前审核通过的文件数量
                var selectData = getSelectedData(factoringDocOnlineCheckAdminEdit.factoringDocOnlineCheck_approvedefine_dt, 0);
                var directCommit = true;
                var commitFlag = true;
                var passFlag = true;
                var passFlag2 = false;
                if (null == selectData) { // 添加为空情况判断,因为可能全部不通过,selectData会为空,取空的length属性会报错
                    directCommit = false;
                }else if((approvedefineDt.length == selectData.length) && (payotherDt.length == 0)){
                    directCommit = false;
                }
                if(directCommit){
                    if(approvedefineDt.length == selectData.length){
                        if(payotherDt.length == 0){
                            commitFlag = alertMsg("审核通过,是否提交至复审",'COMFIR');
                        } else {
                            $.each(payotherDt,function(index,curRowData){
                                var fileSource = curRowData.fileSource;
                                var uploadId = curRowData.uploadId;
                                var suppliersSealType =curRowData.suppliersSealType;
                                var itemCompanySealType = curRowData.itemCompanySealType;
                                if((fileSource == "0" && suppliersSealType == "1" && !isNotBlank(uploadId))||(fileSource == "1" && itemCompanySealType == "1" && !isNotBlank(uploadId))){
                                    commitFlag = alertMsg("审核通过,但是有另需文件未上传,是否提交至联系供应商/项目公司修改错误信息",'COMFIR');
                                    passFlag2 = true;
                                    return false;
                                }else{
                                    passFlag = false;
                                    return true;
                                }
                            });
                            if(!passFlag && !passFlag2){
                                commitFlag = alertMsg("审核通过,是否提交至复审",'COMFIR');
                            }
                        }
                    } else {
                        commitFlag = alertMsg("审核不通过,是否提交至联系供应商/项目公司修改错误信息",'COMFIR');
                    }
                } else {
                    commitFlag = alertMsg("审核通过,是否提交至复审",'COMFIR');
                }
                if(commitFlag){
                    ajax_jsonp("/app/bl/factoringDocOnlineCheckService/bizapproveresult/",data,function(res){
                        if (!checkResponseData(res)) {
                            closeLoading();
                            return;
                        }
                        // 提交后清除临时表缓存的数据
                        ajax_jsonp_sync("/app/bl/factoringOtherApproveCommit/bizapproveresult/", {"payId":payUuid},"PUT");
                        closeModal(thisClzz.modal);
                        closeLoading();
                    },null,"POST");
                }
                else {
                    return false;
                }
            }//commit() end
        });
    // 文件份数输入内容check
    function intCheck(obj) {
        var value = obj.value;
        var reg = /^(0|+?[1-9][0-9]*)$/;
        if(!reg.test(value)||value>2147483647){
            obj.value = "";
        }
    }
    //校验金额
    function moneyCheck(obj){

        var value = obj.value;
        var reg = /^d+(?:.d{0,2})?$/;
        if(!reg.test(value)||value>2147483647){
            obj.value = "";
        }

    }
    //校验日期
    function isDate(object)
    {
        var str = object.value;
        var flag = false;
        if(!/^(d{4})-(d{1,2})-(d{1,2})$/.test(str))
            flag = false;
        var year = RegExp.$1-0;
        var month = RegExp.$2-1;
        var date = RegExp.$3-0;
        var obj = new Date(year,month,date);
        flag =  !!(obj.getFullYear()==year && obj.getMonth()==month && obj.getDate()==date);
        if(!flag){
            object.value = "";
        }
    }
    function contractType_change(select) {
        //add by lzh start
        //合同类别下拉框改变事件删除临时表的数据
        var thisClzz = factoringDocOnlineCheckAdminEdit;
        var $form = $("#" + thisClzz.formId);
        var payUuid = $form.find('#payUuid').val();
        var contractTypeTemp2 = $("#factoringDocOnlineCheckAdminEditForm").find("#contractType").val() // 页面上selected的值
        // 清空审核列表缓存信息
        // ajax_jsonp_sync("/app/bl/factoringOtherApproveCommit/clearDifferentApproveInfo/", {"payId":payUuid},"PUT");
        // approvedefines.responseJSON.data[0].jsonApprovedefineDt = null;
        /*var tempApprove = approvedefines.responseJSON.data[0].jsonApprovedefineDt
        for(var i=0;i<tempApprove.length;i++){debugger
            if(tempApprove[i].fileId!='BLCS1009'&&tempApprove[i].fileId!='BLCS1006'&&tempApprove[i].fileId!='BLCS1007'&&tempApprove[i].fileId!='BLCS1017'&&tempApprove[i].fileId!='BLCS1088'){
                // tempApprove.remove(tempApprove[i]);
                tempApprove.splice(i,1)
                i = -1;
            }
        }*/
        approvedefines =  ajax_jsonp_sync( "/app/bl/factoringDocOnlineCheckService/getSaveInfo", {"payId":payUuid,"contractType":contractTypeTemp2});
        //add by lzh end
        factoringDocOnlineCheckAdminEdit.initFactoringDocOnlineCheckDt($("#factoringDocOnlineCheckAdminEditForm").find("#contractType").val());

    }
    function certificatesFlag_change(select) {
        //三证合一为'是':显示三证合一编号, 三证合一为'否',显示营业执照号码
        var val = $(select).children('option:selected').val();
        $("#div-certificatesNo").find("#certificatesNo").removeAttr("required");
        $("#div-businessLicenceNo").find("#businessLicenceNo").removeAttr("required");
        $("#div-orgcodeLicenseNo").find("#orgcodeLicenseNo").removeAttr("required");
        if (val == '1') {
            $("#div-suppliersInfo").find("#div-certificatesNo").css("display", "block");
            $("#div-suppliersInfo").find("#div-businessLicenceNo").css("display", "none");
            $("#div-suppliersInfo").find("#div-orgcodeLicenseNo").css("display","none");
        } else {
            $("#div-suppliersInfo").find("#div-certificatesNo").css("display", "none");
            $("#div-suppliersInfo").find("#div-businessLicenceNo").css("display", "block");
            $("#div-suppliersInfo").find("#div-orgcodeLicenseNo").css("display","block");
        }
    }
    // 随机生成uuid    add by zyt start
    function randomUuid (){
        //生成uuid
        var s = [];
        var hexDigits = "0123456789abcdef";
        for (var i = 0; i < 36; i++) {
            s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);
        }
        s[14] = "4";  // bits 12-15 of the time_hi_and_version field to 0010
        s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1);  // bits 6-7 of the clock_seq_hi_and_reserved to 01
        // s[8] = s[13] = s[18] = s[23] = "-";
        var uuid = s.join("");
        return uuid;
    }// add by zyt end
</script>