dev_trainings
p31729568 6 years ago
parent 8ddfbcc7c7
commit 525b47e36c

@ -4151,7 +4151,7 @@ end
sheet1 = book.create_worksheet :name => "sheet"
blue = Spreadsheet::Format.new :color => :blue, :weight => :bold, :size => 10
sheet1.row(0).default_format = blue
sheet1.row(0).concat(["姓名", "手机号","邮箱","单位名称", "职位","专业", "学号", "支付方式","支付状态","支付时间", "发票类型", "发票抬头","税务登记号", "发票内容", "备注", "微信支付单号", "报名时间"])
sheet1.row(0).concat(["姓名", "手机号","邮箱","单位名称", "职位","专业", "学号", '培训类型', '授课/研究领域' "支付方式","支付状态","支付时间", "发票类型", "发票抬头","税务登记号", "发票内容", "备注", "微信支付单号", "报名时间"])
count_row = 1
trainings.find_each do |t|
sheet1[count_row, 0] = t.name
@ -4161,16 +4161,18 @@ end
sheet1[count_row, 4] = t.position
sheet1[count_row, 5] = t.major
sheet1[count_row, 6] = t.student_id
sheet1[count_row, 7] = t.training_payinfo.try(:pay_type_str)
sheet1[count_row, 8] = t.training_payinfo.try(:pay_status_str)
sheet1[count_row, 9] = format_time t.training_payinfo.try(:pay_time)
sheet1[count_row, 10] = t.training_payinfo.try(:invoice_title).present? ? '需要' : '不需要'
sheet1[count_row, 11] = t.training_payinfo.try(:invoice_title)
sheet1[count_row, 12] = t.training_payinfo.try(:invoice_no)
sheet1[count_row, 13] = t.training_payinfo.try(:invoice_content)
sheet1[count_row, 14] = t.training_payinfo.try(:info)
sheet1[count_row, 15] = t.training_payinfo.try(:out_trade_no)
sheet1[count_row, 16] = format_time t.created_at
sheet1[count_row, 7] = t.training_category
sheet1[count_row, 8] = t.research_field
sheet1[count_row, 9] = t.training_payinfo.try(:pay_type_str)
sheet1[count_row, 10] = t.training_payinfo.try(:pay_status_str)
sheet1[count_row, 11] = format_time t.training_payinfo.try(:pay_time)
sheet1[count_row, 12] = t.training_payinfo.try(:invoice_title).present? ? '需要' : '不需要'
sheet1[count_row, 13] = t.training_payinfo.try(:invoice_title)
sheet1[count_row, 14] = t.training_payinfo.try(:invoice_no)
sheet1[count_row, 15] = t.training_payinfo.try(:invoice_content)
sheet1[count_row, 16] = t.training_payinfo.try(:info)
sheet1[count_row, 17] = t.training_payinfo.try(:out_trade_no)
sheet1[count_row, 18] = format_time t.created_at
count_row += 1
end
book.write xls_report

@ -132,7 +132,9 @@ class TrainingsController < ApplicationController
@training.training_category = params[:training_category]
end
@training.save!
redirect_to pay_training_path(id: @tag_id)
redirect_to enroll_training_path(id: @tag_id)
# redirect_to pay_training_path(id: @tag_id)
end

@ -148,40 +148,30 @@
</li>
<li class="clearfix infoBar">
<span class="left_tag fl">职称</span>
<span class="fr PositionalRight">
<span class="fl mr15">
<input type="radio" name="Positional" value="Positional1" id="Positional_1" class="magic-radio" checked>
<label for="Positional_1" style="top:0px">教师</label>
</span>
<span class="fl">
<input type="radio" name="Positional" value="Positional2" id="Positional_2" class="magic-radio">
<label for="Positional_2" style="top:0px">学生</label>
</span>
</span>
<!--<input type="text" class="right_input" id="userPositional" placeholder="请输入职称"
name="technical_title"
value="<%#= @training.technical_title %>"/>-->
<input type="text" class="right_input" id="userPositional" placeholder="请输入职称"
name="position"
value="<%= @training.position %>"/>
</li>
<% if @training_type == 3 %>
<p class="subtitle">培训类型</p>
<li class="clearfix infoBar">
<span class="left_tag fl">大数据方向</span>
<span class="fr">
<%= radio_button_tag(:training_category, 'large_data', @training.training_category == 'large_data', id: 'type_1', class: 'magic-radio') %>
<%= radio_button_tag(:training_category, '大数据方向', @training.training_category == '大数据方向', id: 'type_1', class: 'magic-radio') %>
<label for="type_1" style="top:8px">&nbsp;</label>
</span>
</li>
<li class="clearfix infoBar">
<span class="left_tag fl">人工智能方向</span>
<span class="fr">
<%= radio_button_tag(:training_category, 'ai', @training.training_category == 'ai', id: 'type_2', class: 'magic-radio') %>
<%= radio_button_tag(:training_category, '人工智能方向', @training.training_category == '人工智能方向', id: 'type_2', class: 'magic-radio') %>
<label for="type_2" style="top:8px">&nbsp;</label>
</span>
</li>
<li class="clearfix infoBar">
<span class="left_tag fl">大数据+人工智能方向</span>
<span class="fr">
<%= radio_button_tag(:training_category, 'large_data_and_ai', @training.training_category == 'large_data_and_ai', id: 'type_3', class: 'magic-radio') %>
<%= radio_button_tag(:training_category, '大数据+人工智能方向', @training.training_category == '大数据+人工智能方向', id: 'type_3', class: 'magic-radio') %>
<label for="type_3" style="top:8px">&nbsp;</label>
</span>
</li>

Loading…
Cancel
Save