Sha256: 4326296bbdb313fe9145e60a6620e13e17513ce65f3f18a3cf042889bc3d523c

Contents?: true

Size: 1.12 KB

Versions: 8

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).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

8 entries across 8 versions & 1 rubygems

Version Path
educode_sales-1.10.71 app/views/educode_sales/money_plan_records/index.json.jbuilder
educode_sales-1.10.70 app/views/educode_sales/money_plan_records/index.json.jbuilder
educode_sales-1.10.59 app/views/educode_sales/money_plan_records/index.json.jbuilder
educode_sales-1.10.58 app/views/educode_sales/money_plan_records/index.json.jbuilder
educode_sales-1.10.49 app/views/educode_sales/money_plan_records/index.json.jbuilder
educode_sales-1.10.48 app/views/educode_sales/money_plan_records/index.json.jbuilder
educode_sales-1.10.46 app/views/educode_sales/money_plan_records/index.json.jbuilder
educode_sales-1.10.41 app/views/educode_sales/money_plan_records/index.json.jbuilder