diff --git a/js/wxscaninvoice/writing.js b/js/wxscaninvoice/writing.js index b7b7b57..dec7ff9 100644 --- a/js/wxscaninvoice/writing.js +++ b/js/wxscaninvoice/writing.js @@ -93,16 +93,17 @@ $(function () { setStorageMsg('bankName', titleInfo.gfyh); //开户银行 setStorageMsg('bankAccount', titleInfo.gfzh); //开户账号 } else { - // $ttType.attr('data-id', "01"); - // $ttType.val("单位") - $ttType.val("个人"); - $ttType.attr('data-id', "03"); - //个人时调整文字示例,头部文字调整为"身份证号码",头部文字后的*不可见,input中的placeholder改为"请输入身份证号码", - $('#title_nsrsbh').text("身份证号码"); - $('#title_nsrsbh_star').css('display', 'none'); - $('#taxpayerId').attr('placeholder', "请输入身份证号码"); + } + //默认其他 + $ttType.val("其他"); + $ttType.attr('data-id', "04"); + //其他时调整文字示例,头部文字调整为"统一社会信用代码",头部文字后的*不可见,input中的placeholder改为"请输入统一社会信用代码" + $('#title_nsrsbh').text("统一社会信用代码"); + $('#title_nsrsbh_star').css('display', 'none'); + $('#taxpayerId').attr('placeholder', "请输入统一社会信用代码"); + //发票类型 if (fpzls.length === 1) { $fpType.val(fpzls[0].value); @@ -569,7 +570,7 @@ function nextStep() { } else if (mpbs === "03") { //个人 //如果为全电票,购方名称需要特别说明以(个人)结尾, - if (getFpzl() === "01" || getFpzl() === "02") { + // if (getFpzl() === "01" || getFpzl() === "02") { //判断购方名称是不是以(个人)结尾 if(!titleName.endsWith("(个人)")){ titleName += "(个人)"; @@ -582,7 +583,7 @@ function nextStep() { $(".titleName").html(titleName); $titleName.val(titleName); } - } + // } //如果确认框显示,需要设置税号对应的文字,个人时调整文字示例为"身份证号码" $('#confirm_nsrsbh').text("身份证号码"); @@ -725,6 +726,7 @@ function sureStep(){ url=config.projectUrl + '/scanInvoice/getAuthUrl' data = JSON.stringify(invoiceMes) } + $.ajax({ url: url, type: "post", @@ -1110,18 +1112,13 @@ function titleOnblur() { alert_timing_open("发票抬头不能为空!"); return false; } - const fpzl = getFpzl(); - const ttlx = $.trim($ttType.val()); - - if((getFpzl()==="02" || getFpzl()==="01") && ttlx ==="个人"){ - console.log(titleName) - // if (titleName.includes('(个人)')) { - // // let name = titleName + "(个人)"; - // // $(".titleName").html(titleName); - // // $titleName.val(titleName); - // alert_timing_open("抬头类型是个人时,发票抬头必须包含(个人)"); - // return false; - // } + var fpzl = $('#fp_type').attr('data-id'); + var ttlx = $.trim($("#tt_type").val()); + if(fpzl=='02' && ttlx =='个人'){ + if(titleName =='(个人)'){ + alert_timing_open("抬头类型是个人时,发票抬头不能是(个人)"); + return false; + } } const length = checkLength(titleName); if (length > 100) { @@ -1129,6 +1126,7 @@ function titleOnblur() { return false; } + const tempStr = "|"; if (titleName.indexOf(tempStr) >= 0) { alert_timing_open("发票抬头不能包含 |");