|
|
|
@ -36,10 +36,20 @@
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="infoBar mb10">
|
|
|
|
|
<p class="clearfix" id="billLine" NavShow>
|
|
|
|
|
<span class="grey fl">发票</span>
|
|
|
|
|
<label class="fr" id="billDemand" status=2 style="margin-right: 24px;">不需要</label>
|
|
|
|
|
<i class="iconfont icon-gengduo1 rightArrow" style="color: #323232;right: 14px"></i>
|
|
|
|
|
<!-- <p class="clearfix" id="billLine" NavShow>-->
|
|
|
|
|
<!-- <span class="grey fl">发票</span>-->
|
|
|
|
|
<!-- <label class="fr" id="billDemand" status=2 style="margin-right: 24px;">不需要</label>-->
|
|
|
|
|
<!-- <i class="iconfont icon-gengduo1 rightArrow" style="color: #323232;right: 14px"></i>-->
|
|
|
|
|
<!-- </p>-->
|
|
|
|
|
<p class="clearfix" id="billRemark">
|
|
|
|
|
<span class="grey fl">发票抬头</span>
|
|
|
|
|
<input type="text" name="invoice_title" class="right_input" placeholder="请填写发票抬头"
|
|
|
|
|
value="<%= @training.training_payinfo.try(:invoice_title) || @training.school %>"/>
|
|
|
|
|
</p>
|
|
|
|
|
<p class="clearfix" id="billRemark">
|
|
|
|
|
<span class="grey fl">税务登记号</span>
|
|
|
|
|
<input type="text" name="invoice_no" class="right_input" placeholder="请填写税务登记号"
|
|
|
|
|
value="<%= @training.training_payinfo.try(:invoice_no) %>"/>
|
|
|
|
|
</p>
|
|
|
|
|
<p class="clearfix" id="billRemark">
|
|
|
|
|
<span class="grey fl">发票内容</span>
|
|
|
|
@ -79,39 +89,38 @@
|
|
|
|
|
</div>
|
|
|
|
|
<p style="height: 44px;"></p>
|
|
|
|
|
<div class="bottomBtn <%= @training.training_payinfo.pay_type.to_i == 1 ? "none" : "" %>" id="offlinePaySubmitBtn">
|
|
|
|
|
<a href="<%= training_path(id: @friendly_id) %>" class="leftbtn">返回</a>
|
|
|
|
|
<a href="<%= training_path(id: @friendly_id, disable_redirect: true) %>" class="leftbtn">返回</a>
|
|
|
|
|
<a href="javascript:void(0)" class="rightbtn" id="submitFormBtn">完成转账</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="bottomBtn <%= @training.training_payinfo.pay_type.to_i == 1 ? "" : "none" %>" id="paySubmitBtn">
|
|
|
|
|
<a href="<%= training_path(id: @friendly_id) %>" class="leftbtn">返回</a>
|
|
|
|
|
<a href="<%= training_path(id: @friendly_id, disable_redirect: true) %>" class="leftbtn">返回</a>
|
|
|
|
|
<a href="javascript:void(0)" class="rightbtn" id="payBtn">立即支付</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="billDownNav downNav">
|
|
|
|
|
<div class="pr billPanel">
|
|
|
|
|
<p class="clearfix mb10">
|
|
|
|
|
<span class="fl billBigTitle">发票抬头</span>
|
|
|
|
|
<a href="javascript:void(0)" class="fr" id="closeTypeNav"><i class="iconfont icon-guanbi billClose"></i></a>
|
|
|
|
|
</p>
|
|
|
|
|
<ul class="clearfix billType">
|
|
|
|
|
<li>单位</li>
|
|
|
|
|
<li>个人</li>
|
|
|
|
|
<li class="active">不需要</li>
|
|
|
|
|
</ul>
|
|
|
|
|
<p class="clearfix needWrite none">
|
|
|
|
|
<span class="fl billSmallTitle mb10">发票抬头</span>
|
|
|
|
|
</p>
|
|
|
|
|
<ul class="clearfix needWrite none">
|
|
|
|
|
<input placeholder="请填写公司单位名称" name="invoice_title" class="billInput billUnit"/>
|
|
|
|
|
<input placeholder="请填写税务登记号" name="invoice_no" class="billInput taxNumber"/>
|
|
|
|
|
</ul>
|
|
|
|
|
<p style="height:48px;"></p>
|
|
|
|
|
<a href="javascript:void(0)" class="submitBillInfo" id="commonSubmit" onclick="submitBillInfo();">确定</a>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- <div class="billDownNav downNav">-->
|
|
|
|
|
<!-- <div class="pr billPanel">-->
|
|
|
|
|
<!-- <p class="clearfix mb10">-->
|
|
|
|
|
<!-- <span class="fl billBigTitle">发票类型</span>-->
|
|
|
|
|
<!-- <a href="javascript:void(0)" class="fr" id="closeTypeNav"><i class="iconfont icon-guanbi billClose"></i></a>-->
|
|
|
|
|
<!-- </p>-->
|
|
|
|
|
<!-- <ul class="clearfix billType">-->
|
|
|
|
|
<!-- <li>个人</li>-->
|
|
|
|
|
<!-- <li>单位</li>-->
|
|
|
|
|
<!-- </ul>-->
|
|
|
|
|
<!-- <p class="clearfix needWrite none">-->
|
|
|
|
|
<!-- <span class="fl billSmallTitle mb10">发票信息</span>-->
|
|
|
|
|
<!-- </p>-->
|
|
|
|
|
<!-- <ul class="clearfix needWrite none">-->
|
|
|
|
|
<!-- <input placeholder="请填写公司单位名称" name="invoice_title" class="billInput billUnit"/>-->
|
|
|
|
|
<!-- <input placeholder="请填写税务登记号" name="invoice_no" class="billInput taxNumber"/>-->
|
|
|
|
|
<!-- </ul>-->
|
|
|
|
|
<!-- <p style="height:48px;"></p>-->
|
|
|
|
|
<!-- <a href="javascript:void(0)" class="submitBillInfo" id="commonSubmit" onclick="submitBillInfo();">确定</a>-->
|
|
|
|
|
<!-- </div>-->
|
|
|
|
|
<!-- </div>-->
|
|
|
|
|
|
|
|
|
|
<div class="payTypeDownNav downNav">
|
|
|
|
|
<div class="pr billPanel">
|
|
|
|
@ -151,24 +160,24 @@
|
|
|
|
|
invoiceNo: '<%= @training.training_payinfo.invoice_no %>'
|
|
|
|
|
};
|
|
|
|
|
//点击弹出发票弹框
|
|
|
|
|
aboutBillType(userInfo);
|
|
|
|
|
// aboutBillType(userInfo);
|
|
|
|
|
|
|
|
|
|
//点击弹出支付方式弹框
|
|
|
|
|
aboutPayType();
|
|
|
|
|
|
|
|
|
|
//初始化发票类型
|
|
|
|
|
InitBill(userInfo);
|
|
|
|
|
// InitBill(userInfo);
|
|
|
|
|
|
|
|
|
|
//切换发票类型
|
|
|
|
|
$(".billType li").on("click", function () {
|
|
|
|
|
$(".billType li").removeClass("active");
|
|
|
|
|
$(this).addClass("active");
|
|
|
|
|
billTypeShowFun(parseInt($(this).index()), userInfo);
|
|
|
|
|
})
|
|
|
|
|
//关闭弹窗
|
|
|
|
|
$(".billClose").on("click", function () {
|
|
|
|
|
hideNav($(".downNav"));
|
|
|
|
|
});
|
|
|
|
|
// $(".billType li").on("click", function () {
|
|
|
|
|
// $(".billType li").removeClass("active");
|
|
|
|
|
// $(this).addClass("active");
|
|
|
|
|
// billTypeShowFun(parseInt($(this).index()), userInfo);
|
|
|
|
|
// })
|
|
|
|
|
// //关闭弹窗
|
|
|
|
|
// $(".billClose").on("click", function () {
|
|
|
|
|
// hideNav($(".downNav"));
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
//延迟支付,直接提交
|
|
|
|
|
$('#delayPayBtn').on('click', function () {
|
|
|
|
@ -298,16 +307,12 @@
|
|
|
|
|
}
|
|
|
|
|
//页面加载时,初始化发票类型
|
|
|
|
|
function InitBill(userInfo){
|
|
|
|
|
var index=0;
|
|
|
|
|
$("#billDemand").html("单位").attr("status",0);
|
|
|
|
|
var index=1;
|
|
|
|
|
$("#billDemand").html("单位").attr("status",1);
|
|
|
|
|
if (!userInfo.newPayinfo) {
|
|
|
|
|
if(userInfo.invoiceTitle == "" && userInfo.invoiceNo == ""){
|
|
|
|
|
index=2;
|
|
|
|
|
$("#billDemand").html("不需要").attr("status",2);
|
|
|
|
|
}
|
|
|
|
|
if(userInfo.invoiceTitle != "" && userInfo.invoiceNo == ""){
|
|
|
|
|
index=1;
|
|
|
|
|
$("#billDemand").html("个人").attr("status",1);
|
|
|
|
|
index=0;
|
|
|
|
|
$("#billDemand").html("个人").attr("status",0);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
$(".billType li").removeClass("active");
|
|
|
|
@ -315,17 +320,14 @@
|
|
|
|
|
billTypeShowFun(index,userInfo);
|
|
|
|
|
}
|
|
|
|
|
function billTypeShowFun(index, userInfo){
|
|
|
|
|
if (parseInt(index) == 0) {
|
|
|
|
|
if (parseInt(index) == 1) {
|
|
|
|
|
$(".needWrite").removeClass("none");
|
|
|
|
|
$(".billUnit").attr("placeholder", "请填写公司单位名称").val(userInfo.invoiceTitle || userInfo.school);
|
|
|
|
|
$(".taxNumber").removeClass("none").val(userInfo.invoiceNo);
|
|
|
|
|
} else if (parseInt(index) == 1) {
|
|
|
|
|
} else if (parseInt(index) == 0) {
|
|
|
|
|
$(".needWrite").removeClass("none");
|
|
|
|
|
$(".billUnit").attr("placeholder", "请填写姓名").val(userInfo.name);
|
|
|
|
|
$(".taxNumber").val('').addClass("none");
|
|
|
|
|
} else {
|
|
|
|
|
$(".needWrite").addClass("none");
|
|
|
|
|
$(".billInput").val('');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -408,23 +410,16 @@
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function checkBillInfo() {
|
|
|
|
|
var bill = $("#billLine");
|
|
|
|
|
var billNav = $(".billDownNav");
|
|
|
|
|
var status = $("#billDemand").attr("status");
|
|
|
|
|
if(status == 2){
|
|
|
|
|
$(".billInput").val('');
|
|
|
|
|
if ($("input[name='invoice_title']").val() == '') {
|
|
|
|
|
alert("请填写发票抬头");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var billUnit = $('.billUnit').val();
|
|
|
|
|
var taxNumber = $('.taxNumber').val();
|
|
|
|
|
if(status == 1 && billUnit == ''){
|
|
|
|
|
alert('请将发票信息填写完整');
|
|
|
|
|
showNav(bill, billNav, "down");
|
|
|
|
|
if ($("input[name='invoice_no']").val() == '') {
|
|
|
|
|
alert("请填写税务登记号");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
if(status == 0 && (billUnit == '' || taxNumber == '')){
|
|
|
|
|
alert('请将发票信息填写完整');
|
|
|
|
|
showNav(bill, billNav, "down");
|
|
|
|
|
if ($("input[name='invoice_content']").val() == '') {
|
|
|
|
|
alert("请填写发票内容");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|