Sha256: a7e3fe90f9412fda4355f6c08c83c67f2bd85ce29e81072e30887a2f5ec823d5

Contents?: true

Size: 1.12 KB

Versions: 3

Compression:

Stored size: 1.12 KB

Contents

total_amount = 0
json.data do
  json.array! @money_plan_records do |d|
    json.id d.id
    json.business_name d.business&.name
    json.date_at d.date_at.to_s(:date)
    json.amount d.amount
    json.business d.business&.name
    json.business_id d.business_id
    json.school d.business&.school&.name
    json.school_id d.business&.school_id
    json.staff d.staff.user.real_name
    json.staff_id d.staff_id
    json.number d.business&.number
    json.payer_name d.payer_name
    json.staff_manages d.business&.last_follow_up&.assign_follow_ups.present? ? (d.business.last_follow_up.assign_follow_ups.map{ |s| s.staff.user.real_name}.join("、")) : d.business&.staff&.user&.real_name
    if d['claim_num'] > 0
      json.state '已认领'
    elsif d.business&.name.nil?
      json.state '无对应合同'
    else
      json.state '待认领'
    end
    if d.business&.department&.school
      json.property d.business.department.school.school_tags.where(for_missions: true).pluck(:name).uniq.join("、")
    else
      json.property ''
    end
  end
end

json.code 0
if params[:page].present?
  json.count @money_plan_records.total_count
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
educode_sales-1.10.74 app/views/educode_sales/money_plan_records/index.json.jbuilder
educode_sales-1.10.73 app/views/educode_sales/money_plan_records/index.json.jbuilder
educode_sales-1.10.72 app/views/educode_sales/money_plan_records/index.json.jbuilder