Merge branch 'develop' into educoder

dev_library
p31729568 6 years ago
commit c3b48f0fb3

@ -63,10 +63,9 @@ class TrainingsController < ApplicationController
return return
end end
@training.training_payinfo ||= begin if @training.training_payinfo.blank?
payinfo = TrainingPayinfo.new @training.build_training_payinfo
payinfo.fee = @training.registration_fee # 默认值价格不对 @training.training_payinfo.fee = @training.registration_fee
payinfo
end end
end end

@ -142,10 +142,11 @@
// 2 支付宝支付 // 2 支付宝支付
// 3 银行卡支付 // 3 银行卡支付
// payType: <%#= @training.training_payinfo.pay_type.to_i %>, // payType: <%#= @training.training_payinfo.pay_type.to_i %>,
newPayinfo: <%= @training.training_payinfo.new_record? %>,
payType: 3, payType: 3,
//发票抬头 //发票抬头
//为空则代表不需要发票 //为空则代表不需要发票
invoiceTitle: '<%= @training.training_payinfo.invoice_title %>', invoiceTitle: '<%= @training.training_payinfo.invoice_title || @training.school %>',
//税号 //税号
invoiceNo: '<%= @training.training_payinfo.invoice_no %>' invoiceNo: '<%= @training.training_payinfo.invoice_no %>'
}; };
@ -305,13 +306,15 @@
function InitBill(userInfo){ function InitBill(userInfo){
var index=0; var index=0;
$("#billDemand").html("单位").attr("status",0); $("#billDemand").html("单位").attr("status",0);
if(userInfo.invoiceTitle == "" && userInfo.invoiceNo == ""){ if (!userInfo.newPayinfo) {
if(userInfo.invoiceTitle == "" && userInfo.invoiceNo == ""){
index=2; index=2;
$("#billDemand").html("不需要").attr("status",2); $("#billDemand").html("不需要").attr("status",2);
} }
if(userInfo.invoiceTitle != "" && userInfo.invoiceNo == ""){ if(userInfo.invoiceTitle != "" && userInfo.invoiceNo == ""){
index=1; index=1;
$("#billDemand").html("个人").attr("status",1); $("#billDemand").html("个人").attr("status",1);
}
} }
$(".billType li").removeClass("active"); $(".billType li").removeClass("active");
$(".billType li").eq(index).addClass("active"); $(".billType li").eq(index).addClass("active");

Loading…
Cancel
Save