educode_sales 1.10.59 → 1.10.70

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/educode_sales/application.js +1 -0
  3. data/app/assets/javascripts/educode_sales/functions.js +24 -0
  4. data/app/controllers/educode_sales/application_controller.rb +11 -3
  5. data/app/controllers/educode_sales/business_courses_controller.rb +19 -8
  6. data/app/controllers/educode_sales/follow_ups_controller.rb +4 -0
  7. data/app/controllers/educode_sales/plans_controller.rb +448 -124
  8. data/app/controllers/educode_sales/shixuns_controller.rb +20 -10
  9. data/app/controllers/educode_sales/subjects_controller.rb +10 -6
  10. data/app/controllers/educode_sales/teacher_follows_controller.rb +4 -0
  11. data/app/controllers/educode_sales/teachers_controller.rb +3 -0
  12. data/app/models/educode_sales/business.rb +5 -5
  13. data/app/models/educode_sales/sales_target.rb +10 -0
  14. data/app/models/educode_sales/sales_target_log.rb +11 -0
  15. data/app/views/educode_sales/business_courses/index.html.erb +1 -1
  16. data/app/views/educode_sales/business_courses/new.html.erb +2 -2
  17. data/app/views/educode_sales/businesses/_follows.html.erb +107 -100
  18. data/app/views/educode_sales/businesses/index.html.erb +6 -3
  19. data/app/views/educode_sales/businesses/index.json.jbuilder +2 -2
  20. data/app/views/educode_sales/businesses/show_follow.json.jbuilder +1 -1
  21. data/app/views/educode_sales/contracts/_follows.html.erb +75 -69
  22. data/app/views/educode_sales/contracts/_list.html.erb +283 -249
  23. data/app/views/educode_sales/contracts/index.json.jbuilder +1 -1
  24. data/app/views/educode_sales/follow_ups/index.json.jbuilder +1 -1
  25. data/app/views/educode_sales/plans/_year_execute.html.erb +294 -159
  26. data/app/views/educode_sales/plans/_year_target.html.erb +330 -215
  27. data/app/views/educode_sales/plans/index.html.erb +3 -4
  28. data/app/views/educode_sales/plans/staff_year_business.html.erb +96 -0
  29. data/app/views/educode_sales/plans/staff_year_business.json.jbuilder +22 -0
  30. data/app/views/educode_sales/plans/staff_year_target.json.jbuilder +35 -0
  31. data/app/views/educode_sales/plans/staff_year_target_log.html.erb +62 -0
  32. data/app/views/educode_sales/plans/staff_year_target_log.json.jbuilder +34 -0
  33. data/app/views/educode_sales/plans/years_all_target.json.jbuilder +5 -4
  34. data/app/views/educode_sales/sales_details/_index.html.erb +6 -3
  35. data/app/views/educode_sales/shixun_dectects/markdown.html.erb +40 -1
  36. data/app/views/educode_sales/shixuns/index.html.erb +106 -97
  37. data/app/views/educode_sales/shixuns/new.html.erb +2 -2
  38. data/app/views/educode_sales/staffs/index.json.jbuilder +1 -1
  39. data/app/views/educode_sales/subjects/index.html.erb +1 -1
  40. data/app/views/educode_sales/subjects/new.html.erb +2 -2
  41. data/app/views/educode_sales/teachers/_follows.html.erb +24 -17
  42. data/app/views/educode_sales/teachers/_index.html.erb +6 -0
  43. data/app/views/layouts/educode_sales/application.html.erb +6 -3
  44. data/config/environments/development.rb +16 -0
  45. data/config/routes.rb +7 -0
  46. data/db/migrate/20230729085359_create_educode_sales_sales_target_histories.rb +1 -1
  47. data/lib/educode_sales/version.rb +1 -1
  48. metadata +11 -2
@@ -4,21 +4,29 @@
4
4
  module EducodeSales
5
5
  class ShixunsController < ApplicationController
6
6
  before_action :subject_members, :subject_staffs, :create_filter, :subject_url
7
- def index
7
+ before_action :have_permission?, only: %i(index new create edit)
8
+
9
+ # 查看cancancan Gem优化代码
10
+ def have_permission?
11
+ have_permission = can?(:shixun, EducodeSales::BusinessDeliverSubject) || can?(:all_shixun, EducodeSales::BusinessDeliverSubject)
12
+
13
+ have_permission || @current_admin.is_admin ? "" : authorize!(:shixun, BusinessDeliverSubject)
14
+ end
15
+
8
16
 
9
- authorize! :shixun, BusinessDeliverSubject
17
+ def index
10
18
 
11
19
  # 判断类型是否存在 1 管培 2 全职 3 专职 如果不存在就默认为1
12
20
  category = params[:q].present? ? params[:q][:category].to_i : BusinessSubjectShixun::CATEGORY_TYPE::TRAINING
13
21
  trends_category = params[:trends_category]
14
22
 
15
23
  gon.category = trends_category.present? ? trends_category.to_i : 1
16
- gon.is_admin = is_commissioner_above?
24
+ gon.is_admin = @current_admin.is_admin || ["销售总监", "副总", "生态运营总监", "方案总监", "售后总监", "课程组总监"].include?(@current_admin.role.name)
17
25
 
18
26
  business_subject_shixuns = BusinessSubjectShixun
19
27
 
20
28
  # 根据身份获取对应数据
21
- business_subject_shixuns = if is_commissioner_above?
29
+ business_subject_shixuns = if is_commissioner_above?("shixun")
22
30
  business_subject_shixuns
23
31
  else
24
32
  # 实训本身的成员
@@ -66,8 +74,14 @@ module EducodeSales
66
74
  if params[:q].present? && params[:q][:subject_name].present?
67
75
  @shixuns = @shixuns.where("subjects.name like '%#{params[:q][:subject_name]}%'")
68
76
  end
69
-
70
-
77
+ if params[:q].present? && params[:q][:shixun_type].present? && params[:q][:shixun_type].to_i != 0
78
+ @shixuns = @shixuns.where(shixun_type:params[:q][:shixun_type])
79
+ end
80
+ if params[:q] && params[:q][:deliver_date].present?
81
+ start_time = params[:q][:deliver_date].split(" - ")[0]
82
+ end_time = params[:q][:deliver_date].split(" - ")[-1]
83
+ @shixuns = @shixuns.where("educode_sales_business_subject_shixuns.deliver_date BETWEEN '#{start_time}' AND '#{end_time}' ")
84
+ end
71
85
  shixun_staffs = {}
72
86
  BusinessSubjectShixun.includes(business_subject:[ business_deliver_subject: [:manages, business: [:school, last_follow_up: :assign_follow_ups]] ]).find_each do |d|
73
87
  b_d_s = d.business_subject
@@ -96,7 +110,6 @@ module EducodeSales
96
110
  end
97
111
 
98
112
  def edit
99
- authorize! :shixun, BusinessDeliverSubject
100
113
  @item = BusinessSubjectShixun.find(params[:id])
101
114
  @last_dectect = ''
102
115
  if @item.last_dectect.present?
@@ -118,7 +131,6 @@ module EducodeSales
118
131
  end
119
132
 
120
133
  def update
121
- authorize! :shixun, BusinessDeliverSubject
122
134
  ActiveRecord::Base.transaction do
123
135
 
124
136
  if params[:id].present?
@@ -151,14 +163,12 @@ module EducodeSales
151
163
  end
152
164
 
153
165
  def new
154
- authorize! :shixun, BusinessDeliverSubject
155
166
  gon.manage = @manages
156
167
  gon.staffs = @staffs
157
168
  render layout: false
158
169
  end
159
170
 
160
171
  def create
161
- authorize! :shixun, BusinessDeliverSubject
162
172
  begin
163
173
  ActiveRecord::Base.transaction do
164
174
 
@@ -6,15 +6,23 @@ module EducodeSales
6
6
  # 实践课程管理
7
7
  class SubjectsController < ApplicationController
8
8
  before_action :subject_members, :subject_url
9
+ before_action :have_permission?, only: %i(index new create edit)
10
+
11
+ # 查看cancancan Gem优化代码
12
+ def have_permission?
13
+ have_permission = can?(:subject, EducodeSales::BusinessDeliverSubject) || can?(:all_subject, EducodeSales::BusinessDeliverSubject)
14
+
15
+ have_permission || @current_admin.is_admin ? "" : authorize!(:subject, BusinessDeliverSubject)
16
+ end
17
+
9
18
 
10
19
  def index
11
- authorize! :subject, BusinessDeliverSubject
12
20
  respond_to do |format|
13
21
  format.html do
14
22
  end
15
23
  format.json do
16
24
 
17
- if is_commissioner_above?
25
+ if is_commissioner_above?("subject")
18
26
  business_subject = BusinessSubject
19
27
  else
20
28
  deliver_staffs = BusinessSubject.joins(business_deliver_subject: [manages: :staff])
@@ -69,14 +77,12 @@ module EducodeSales
69
77
  end
70
78
 
71
79
  def new
72
- authorize! :subject, BusinessDeliverSubject
73
80
  # staffs = Staff.where.not(role_id: 11).includes(:user)
74
81
  gon.staffs = @manages
75
82
  render layout: false
76
83
  end
77
84
 
78
85
  def edit
79
- authorize! :subject, BusinessDeliverSubject
80
86
  if params[:id]
81
87
  business_subject = BusinessSubject.find(params[:id])
82
88
  @item = business_subject.subject
@@ -91,7 +97,6 @@ module EducodeSales
91
97
  end
92
98
 
93
99
  def create
94
- authorize! :subject, BusinessDeliverSubject
95
100
  # 开启事务
96
101
  ActiveRecord::Base.transaction do
97
102
  subject = Subject.where.not(id: BusinessSubject.pluck(:subject_id) ).find_by(id: params[:subject_id])
@@ -123,7 +128,6 @@ module EducodeSales
123
128
  end
124
129
 
125
130
  def update
126
- authorize! :subject, BusinessDeliverSubject
127
131
  # 开启事务
128
132
  ActiveRecord::Base.transaction do
129
133
  business_subject = BusinessSubject.find_by(id: params[:id])
@@ -116,6 +116,10 @@ module EducodeSales
116
116
  @follow_ups = @follow_ups.where("educode_sales_teacher_follows.created_at > ? AND educode_sales_teacher_follows.created_at < ?", date[0], date[1] + ' 23:59:59')
117
117
  end
118
118
 
119
+ if params[:q].present? && params[:q][:staff].present?
120
+ @follow_ups = @follow_ups.joins(staff: :user).where("CONCAT(users.lastname,users.firstname) like ?", "%#{params[:q][:staff]}%")
121
+ end
122
+
119
123
  @follow_ups = @follow_ups.includes(:teacher, :attitude, :staff)
120
124
  if params[:sort].present? && params[:sort][:field]
121
125
  @follow_ups = @follow_ups.order("#{params[:sort][:field]} #{params[:sort][:order]}")
@@ -119,6 +119,9 @@ module EducodeSales
119
119
  if params[:q].present? && params[:q][:professional_title].present?
120
120
  @teachers = @teachers.where("educode_sales_teachers.professional_title = ?", "#{params[:q][:professional_title]}")
121
121
  end
122
+ if params[:q].present? && params[:q][:job].present?
123
+ @teachers = @teachers.where("educode_sales_teachers.job = ?", "#{params[:q][:job]}")
124
+ end
122
125
  # if params[:q].present? && params[:q][:regist_at].present?
123
126
  # @teachers = @teachers.where("educode_sales_teachers.regist_at like ?", "%#{params[:q][:regist_at]}%")
124
127
  # end
@@ -82,11 +82,11 @@ module EducodeSales
82
82
  # 创建商机交付课程数据
83
83
  def change_diliver
84
84
 
85
- # if previous_changes["last_follow_up_id"].present?
86
- # last_clazz_id = previous_changes["last_follow_up_id"][-1]
87
- # common_type = FollowUp.find_by(id: last_clazz_id)&.stage&.name == "已中标"
88
- # BusinessDeliverSubject.find_or_create_by(business_id: self.id) if common_type
89
- # end
85
+ if previous_changes["last_follow_up_id"].present?
86
+ last_clazz_id = previous_changes["last_follow_up_id"][-1]
87
+ common_type = FollowUp.find_by(id: last_clazz_id)&.stage&.name == "已中标"
88
+ BusinessDeliverSubject.find_or_create_by(business_id: self.id) if common_type
89
+ end
90
90
  end
91
91
 
92
92
  def school_name
@@ -0,0 +1,10 @@
1
+ module EducodeSales
2
+ class SalesTarget < ApplicationRecord
3
+ belongs_to :staff
4
+ belongs_to :reviewer, class_name: 'Staff', optional: true
5
+ belongs_to :school_tag
6
+
7
+ enum target_clazz: { '中标': 18, '回款': 2, '商机': 7 }
8
+ enum state: %w[待审核 已通过 已驳回]
9
+ end
10
+ end
@@ -0,0 +1,11 @@
1
+ module EducodeSales
2
+ class SalesTargetLog < ApplicationRecord
3
+ belongs_to :staff
4
+ belongs_to :reviewer, class_name: 'Staff', optional: true
5
+ belongs_to :school_tag
6
+
7
+ enum target_clazz: { '中标': 18, '回款': 2, '商机': 7 }
8
+ enum state: %w[待审核 已通过 已驳回]
9
+
10
+ end
11
+ end
@@ -164,7 +164,7 @@
164
164
  },
165
165
  {
166
166
  field: 'subject_manages',
167
- title: '课程经理',
167
+ title: '课程组组长',
168
168
  align: 'center',
169
169
  minWidth: 100,
170
170
  templet: '#show_phone_number'
@@ -39,9 +39,9 @@
39
39
  </div>
40
40
  </div>
41
41
  <div class="layui-form-item">
42
- <label class="layui-form-label">课程经理:<span style="color: red"> *</span></label>
42
+ <label class="layui-form-label" style="width: 96px">课程组组长:<span style="color: red"> *</span></label>
43
43
  <div class="layui-input-block">
44
- <div id="manage_id" style="width: 50%"></div>
44
+ <div id="manage_id" style="width: 49%;margin-left: 12px"></div>
45
45
  </div>
46
46
  </div>
47
47
 
@@ -43,6 +43,12 @@
43
43
  <input type="text" name="description" class="layui-input">
44
44
  </div>
45
45
  </div>
46
+ <div class="layui-inline">
47
+ <label class="layui-form-label">跟进人</label>
48
+ <div class="layui-input-inline">
49
+ <input type="text" name="staff" class="layui-input">
50
+ </div>
51
+ </div>
46
52
 
47
53
  <div class="layui-inline">
48
54
  <button type="reset" class="layui-btn layui-btn-primary" lay-submit lay-filter="reset_follows_search">重置
@@ -77,14 +83,14 @@
77
83
 
78
84
 
79
85
  <script>
80
- layui.use(['form', 'table', 'miniPage', 'element', 'request', 'laydate'], function () {
86
+ layui.use(['form', 'table', 'miniPage', 'element', 'request', 'laydate', 'functions'], function () {
81
87
  var $ = layui.jquery,
82
88
  form = layui.form,
83
89
  request = layui.request,
84
90
  dropdown = layui.dropdown,
85
91
  miniPage = layui.miniPage,
86
92
  laydate = layui.laydate;
87
-
93
+ var functions = layui.functions;
88
94
  var laydate = layui.laydate;
89
95
 
90
96
  laydate.render({
@@ -93,6 +99,96 @@
93
99
  });
94
100
 
95
101
  table = layui.table;
102
+ let columns = [
103
+ {
104
+ field: 'id',
105
+ width: 60,
106
+ title:'序号',type: 'numbers',
107
+ },
108
+ {
109
+ field: 'description',
110
+ title: '最新进展',
111
+ templet:'<div><span title="{{d.description}}">{{d.description}}</span></div>'
112
+ },
113
+ {
114
+ field: 'business',
115
+ width: 120,
116
+ title: '所属商机',
117
+ templet:'#business'
118
+ },
119
+ {
120
+ field: 'school',
121
+ width: 120,
122
+ title: '单位',
123
+ templet:'#school'
124
+ },
125
+ {
126
+ field: 'property',
127
+ width: 150,
128
+ title: '客户类型',
129
+ },
130
+ {
131
+ field: 'clazz',
132
+ width: 80,
133
+ title: '类型',
134
+ templet:'<div><span title="{{d.clazz}}">{{d.clazz}}</span></div>'
135
+ },
136
+ {
137
+ field: 'stage',
138
+ title: '阶段',
139
+ width: 90,
140
+ templet:'<div><span title="{{d.stage}}">{{d.stage}}</span></div>'
141
+ },
142
+ {
143
+ field: 'advise',
144
+ width: 120,
145
+ title: '团队建议',
146
+ templet:'<div><span title="{{d.advise}}">{{d.advise}}</span></div>'
147
+ },
148
+ {
149
+ field: 'key_people',
150
+ width: 100,
151
+ title: '关键人',
152
+ templet:'<div><span title="{{d.key_people}}">{{d.key_people}}</span></div>'
153
+ },
154
+ {
155
+ field: 'rival',
156
+ width: 100,
157
+ title: '竞争对手',
158
+ },
159
+ {
160
+ field: 'staff_manages',
161
+ width: 120,
162
+ title: '销售经理',
163
+ },
164
+ {
165
+ field: 'tel',
166
+ width: 90,
167
+ title: '联系方式',
168
+ templet:'<div><span title="{{d.tel}}">{{d.tel}}</span></div>'
169
+ },
170
+ {
171
+ field: 'staff',
172
+ width: 90,
173
+ title: '跟进人',
174
+ },
175
+ {
176
+ field: 'created_at',
177
+ width: 120,
178
+ title: '跟进时间',
179
+ sort: true,
180
+ templet:'<div><span title="{{d.created_at}}">{{d.created_at}}</span></div>'
181
+
182
+ },
183
+ {
184
+ title: '操作',
185
+ width: 160,
186
+ toolbar: '#currentTableBar_follows',
187
+ align: "center",
188
+ fixed: 'right'
189
+ }
190
+ ];
191
+ columns = functions.initTableColumnsFilter('teachers_table', columns);
96
192
  table.render({
97
193
  elem: '#teachers_table',
98
194
  url: '/missions/follow_ups',
@@ -103,106 +199,16 @@
103
199
  field: 'created_at' //排序字段,对应 cols 设定的各字段名
104
200
  ,type: 'desc' //排序方式 asc: 升序、desc: 降序、null: 默认排序
105
201
  },
106
- cols: [
107
- [
108
- {
109
- field: 'id',
110
- width: 60,
111
- title:'序号',type: 'numbers',
112
- },
113
- {
114
- field: 'description',
115
- title: '最新进展',
116
- templet:'<div><span title="{{d.description}}">{{d.description}}</span></div>'
117
- },
118
- {
119
- field: 'business',
120
- width: 120,
121
- title: '所属商机',
122
- templet:'#business'
123
- },
124
- {
125
- field: 'school',
126
- width: 120,
127
- title: '单位',
128
- templet:'#school'
129
- },
130
- {
131
- field: 'property',
132
- width: 150,
133
- title: '客户类型',
134
- },
135
- {
136
- field: 'clazz',
137
- width: 80,
138
- title: '类型',
139
- templet:'<div><span title="{{d.clazz}}">{{d.clazz}}</span></div>'
140
- },
141
- {
142
- field: 'stage',
143
- title: '阶段',
144
- width: 90,
145
- templet:'<div><span title="{{d.stage}}">{{d.stage}}</span></div>'
146
- },
147
- {
148
- field: 'advise',
149
- width: 120,
150
- title: '团队建议',
151
- templet:'<div><span title="{{d.advise}}">{{d.advise}}</span></div>'
152
- },
153
- {
154
- field: 'key_people',
155
- width: 100,
156
- title: '关键人',
157
- templet:'<div><span title="{{d.key_people}}">{{d.key_people}}</span></div>'
158
- },
159
- {
160
- field: 'rival',
161
- width: 100,
162
- title: '竞争对手',
163
- },
164
- {
165
- field: 'staff_manages',
166
- width: 120,
167
- title: '销售经理',
168
- },
169
- {
170
- field: 'tel',
171
- width: 90,
172
- title: '联系方式',
173
- templet:'<div><span title="{{d.tel}}">{{d.tel}}</span></div>'
174
- },
175
- {
176
- field: 'staff',
177
- width: 90,
178
- title: '跟进人',
179
- },
180
- {
181
- field: 'created_at',
182
- width: 120,
183
- title: '跟进时间',
184
- sort: true,
185
- templet:'<div><span title="{{d.created_at}}">{{d.created_at}}</span></div>'
186
-
187
- },
188
- {
189
- title: '操作',
190
- width: 160,
191
- toolbar: '#currentTableBar_follows',
192
- align: "center",
193
- fixed: 'right'
194
- }
195
- ]
196
- ],
202
+ cols: [columns],
197
203
  limit: 20,
198
204
  limits: [10,15,20,30,40,50,60,70,80,90],
199
205
  page: true,
206
+ done: function () {
207
+ var that = this;
208
+ functions.observerTableColumnFilter(that);
209
+ }
200
210
  });
201
211
 
202
-
203
-
204
-
205
-
206
212
  var sort = {}, search = {};
207
213
  table.on('sort(teachers_table)', function (obj) {
208
214
  sort.field = obj.field;
@@ -245,8 +251,9 @@
245
251
  name: "",
246
252
  department: "",
247
253
  description: "",
248
- staff_id: ""
249
- })
254
+ staff_id: "",
255
+ staff: ""
256
+ });
250
257
  return false;
251
258
  });
252
259
  table.on('toolbar(teachers_table)', function(obj){
@@ -327,7 +334,7 @@
327
334
  }
328
335
  })
329
336
  }
330
-
337
+
331
338
  return false
332
339
  },
333
340
  btn2: function(index, l) {
@@ -28,7 +28,7 @@
28
28
  </div>
29
29
  </div>
30
30
  <div class="layui-inline">
31
- <label class="layui-form-label">最新跟进人</label>
31
+ <label class="layui-form-label" style="width: 130px">最新跟进人</label>
32
32
  <div class="layui-input-inline">
33
33
  <div id="staffs_id" style="width: 190px;"></div>
34
34
  </div>
@@ -256,13 +256,14 @@
256
256
 
257
257
 
258
258
  <script>
259
- layui.use(['form', 'table', 'miniPage', 'element', 'request', 'laydate', 'dropdown','laytpl'], function () {
259
+ layui.use(['form', 'table', 'miniPage', 'element', 'request', 'laydate', 'dropdown','laytpl', 'functions'], function () {
260
260
  var $ = layui.jquery,
261
261
  form = layui.form,
262
262
  request = layui.request,
263
263
  miniPage = layui.miniPage,
264
264
  dropdown = layui.dropdown,
265
265
  laydate = layui.laydate;
266
+ var functions = layui.functions;
266
267
  var openWH = miniPage.getOpenWidthHeight();
267
268
  laydate.render({
268
269
  elem: '#date',
@@ -664,7 +665,7 @@
664
665
  }
665
666
  ]
666
667
  ]
667
-
668
+ cols_table[0] = functions.initTableColumnsFilter('businesses_table', cols_table[0]);
668
669
  var delete_business_cols = [cols_table[0].slice(0, -1).concat(
669
670
  {
670
671
  field: 'delete_reason',
@@ -707,6 +708,8 @@
707
708
  // $('#businesses_table_wraper .layui-table-header').removeClass('table-header-fixed'); //移除样式
708
709
  // }
709
710
  // });
711
+ var that = this;
712
+ functions.observerTableColumnFilter(that);
710
713
  }
711
714
  });
712
715
 
@@ -26,7 +26,7 @@ json.data do
26
26
  json.created_at d.created_at.to_s
27
27
  json.no_followup_days (d['latest_time'] ? DateTime.parse(Time.now.strftime("%Y-%m-%d")) - DateTime.parse(d['latest_time'].strftime("%Y-%m-%d")) : DateTime.parse(Time.now.strftime("%Y-%m-%d")) - DateTime.parse(d.created_at.strftime("%Y-%m-%d"))).to_i
28
28
 
29
- json.staff_manages d.last_follow_up&.assign_follow_ups.present? ? (d.last_follow_up.assign_follow_ups.map{ |d| d.staff.user.real_name}.join("、")) : d.staff&.user&.real_name
29
+ json.staff_manages d.last_follow_up&.assign_follow_ups.present? ? (d.last_follow_up.assign_follow_ups.map{ |d| d.staff&.user&.real_name}.join("、")) : d.staff&.user&.real_name
30
30
  json.divide_rate d.divide_rate
31
31
  json.divide_money d.divide_amount.to_f.round(2)
32
32
  json.budget_amount d.budget_amount.to_f.round(2) #d.follow_ups.where(stage_id: @budget_stage_ids).order("created_at desc").first&.total_amount&.round(2) || 0
@@ -47,7 +47,7 @@ json.data do
47
47
  # property << '企业' if school_property.enterprise
48
48
  # end
49
49
  if d.department&.school
50
- json.property d.department.school.school_tags.where(for_missions: true).pluck(:name).join("、")
50
+ json.property d.department.school.school_tags.where(for_missions: true).pluck(:name).uniq.join("、")
51
51
  else
52
52
  json.property ''
53
53
  end
@@ -4,7 +4,7 @@ json.data do
4
4
  json.created_at d.created_at.to_s
5
5
  json.clazz d.clazz.name
6
6
  json.stage d.stage.name
7
- json.teachers_count d.key_people_count
7
+ json.teachers_count d.key_person.size
8
8
  json.invitation_at d.invitation_at&.to_s(:date)
9
9
  json.reception_at d.reception_at&.to_s(:date)
10
10
  json.bidded_date d.bidded_date&.to_s(:date)