educode_sales 0.9.15 → 0.9.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dd9571c825586b6b901720a7acfd9ac401a2e84f1b3bb98224833b5de7578fa7
4
- data.tar.gz: 7a6765a20f54183d0381f712b6ec5252ad3ccc23f9878dccd319e554196a3b34
3
+ metadata.gz: 25adbf60cef4844eae70e6e5bc5dc4756989309574883b2fccb71a20e39a50f3
4
+ data.tar.gz: 1a341b258119a4f3b0ca9a86b7d9692597dd8c864f1e1088b09e37328ce0b76b
5
5
  SHA512:
6
- metadata.gz: 3e2896e169cefb432bff39d3c7939ede157dc7b8afdc93e47819eeed88f724153b3687aa6abff9fc97497d724aed80673b3be15c51999abd493fa37aa4303db9
7
- data.tar.gz: f3ab93cbdece2c12457716f81a7d0b69f8e1b00d87c8abb68b079ad5c2e98294e0c83162acfca3e391337e326c17fd5883d976e664f12ea339cfa366efb240d4
6
+ metadata.gz: c0a73d5ee2658c4ae2060bd13fe73c7b1fa3241f3dcb916ba1a6f72635f2b84f5da13da60ecb9aac42d89f37939a8ba6cb5473a8bf9ed80d84efa4b5e6970988
7
+ data.tar.gz: 8162a366501a3c35816c51ee1ec0415548a46e45d6800db1d27d9bd7634a7d5511f4a99d44e8b359654caf09d35abb19be18a9b6b357cfec7d4c08218ce29f00
@@ -314,4 +314,9 @@ td .layui-table-cell .layui-form-select {
314
314
  position: absolute;
315
315
  top: 5px;
316
316
  left: -10px;
317
+ }
318
+
319
+ .layui-btn.selected-btn {
320
+ color: #fff !important;
321
+ background: #009688;
317
322
  }
@@ -10,7 +10,7 @@ module EducodeSales
10
10
  respond_to do |format|
11
11
  format.html do
12
12
  common = Common.find_by(clazz: 'staff_type', name: '销售')
13
- @staffs = Staff.joins(:user).where(job_type: common.id).map { |d| [d.user.real_name, d.id]} # [[], [], ............]
13
+ @staffs = Staff.joins(:user).where(job_type: common.id).where.not(role_id: 11).map { |d| [d.user.real_name, d.id]} # [[], [], ............]
14
14
  # @more = can?(:create, EducodeSales::SalePlan) || can?(:update, EducodeSales::Business) || can?(:destroy, EducodeSales::Business) || can?(:show_file, EducodeSales::Business)
15
15
  @more = true
16
16
  gon.menus = []
@@ -97,7 +97,7 @@ module EducodeSales
97
97
 
98
98
  end
99
99
 
100
- if params[:q].present? && params[:q][:name].present? && (params[:q][:name] == "(销售态势-" + @year + "-已中标商机)" || params[:q][:name] == "(销售态势-" + @year + "-应收款商机)")
100
+ if params[:q].present? && params[:q][:name].present? && params[:q][:name] == "(销售态势-" + @year + "-已中标商机)"
101
101
  stage_ids = Common.where(clazz: '商机阶段', name: ['已中标','已签单','已验收','回款中', '服务中','已结束']).pluck(:id)
102
102
  if @year == '全部'
103
103
  @businesses = @businesses.joins("
@@ -136,17 +136,25 @@ module EducodeSales
136
136
  end
137
137
  end
138
138
 
139
- if params[:q].present? && params[:q][:all].present?
140
- @businesses = @businesses
139
+ if params[:q].present? && params[:q][:name].present? && params[:q][:name] == "(销售态势-" + @year + "-应收款商机)"
140
+ stage_ids = Common.where(clazz: '商机阶段', name: ['已中标','已签单','已验收','回款中', '服务中','已结束']).pluck(:id)
141
+ if @year == '全部'
142
+ @businesses = @businesses.joins("
143
+ JOIN educode_sales_follow_ups ON educode_sales_businesses.last_follow_up_id = educode_sales_follow_ups.id
144
+ ").where("educode_sales_follow_ups.stage_id IN (?)", stage_ids)
145
+ else
146
+ @businesses = @businesses.joins("
147
+ JOIN educode_sales_follow_ups ON educode_sales_businesses.last_follow_up_id = educode_sales_follow_ups.id
148
+ ").where("educode_sales_follow_ups.bidded_date <= ? AND educode_sales_follow_ups.stage_id IN (?)", "#{@year}-12-31", stage_ids)
149
+ end
150
+
141
151
  end
142
152
 
143
- if params[:q].present? && params[:q][:mine].present?
144
- ids = AssignFollowUp.where(staff_id: @current_admin.id).pluck(:follow_up_id)
145
- ids1 = FollowUp.where(id: ids).pluck(:business_id)
146
- @businesses =@businesses.where("educode_sales_businesses.id in (?) or educode_sales_businesses.staff_id = ?", ids1, @current_admin.id)
153
+
154
+ if params[:q].present? && params[:q][:all].present?
155
+ @businesses = @businesses
147
156
  end
148
157
 
149
- @businesses = @businesses
150
158
  if params[:q].present? && params[:q][:name].present? && params[:q][:name] != "(销售态势-" + @year + "-已中标商机)" && params[:q][:name] != "(销售态势-" + @year + "-已签单商机)" && params[:q][:name] != "(销售态势-" + @year + "-已回款商机)" && params[:q][:name] != "(销售态势-" + @year + "-现有商机)" && params[:q][:name] != "(销售态势-" + @year + "-应收款商机)"
151
159
  @businesses = @businesses.where("educode_sales_businesses.name like ?", "%#{params[:q][:name]}%")
152
160
  end
@@ -222,8 +230,19 @@ module EducodeSales
222
230
  @businesses = @businesses.where("number like :data", data: "%#{params[:q][:number].strip}%")
223
231
  end
224
232
 
233
+ if params[:q][:clazz].present?
234
+ # 我的关注
235
+ if params[:q][:clazz] == 'followes'
236
+ my_ids = BusinessRelationShip.where(user_id:@current_admin.user_id).pluck(:business_id)
237
+ @businesses = @businesses.where(id: my_ids)
238
+ elsif params[:q][:clazz] == 'me'
239
+ ids = AssignFollowUp.joins("JOIN educode_sales_follow_ups ON educode_sales_follow_ups.id = educode_sales_assign_follow_ups.follow_up_id").where(staff_id: @current_admin.id).pluck(:business_id)
240
+ @businesses = @businesses.where("educode_sales_businesses.id in (?) or educode_sales_businesses.staff_id = ?", ids, @current_admin.id)
241
+ end
242
+ end
243
+
225
244
  if params[:sort].present? && params[:sort][:field]
226
- if params[:sort][:field] = "service_end_time"
245
+ if params[:sort][:field] == "service_end_time"
227
246
  @businesses = @businesses.order("service_time_long #{params[:sort][:order]}")
228
247
  else
229
248
  @businesses = @businesses.order("#{params[:sort][:field]} #{params[:sort][:order]}")
@@ -249,7 +268,7 @@ module EducodeSales
249
268
  (last_follow.actual_amount - educode_sales_businesses.return_money) as wait_return_money,
250
269
  last_follow.total_amount
251
270
  ").joins("
252
- LEFT JOIN educode_sales_follow_ups AS last_follow ON educode_sales_businesses.last_follow_up_id = last_follow.id
271
+ LEFT JOIN educode_sales_follow_ups AS last_follow ON educode_sales_businesses.last_follow_up_id = last_follow.id AND last_follow.deleted_at IS NULL
253
272
  ").page(params[:page]).per(params[:limit])
254
273
 
255
274
  end
@@ -259,6 +278,17 @@ module EducodeSales
259
278
 
260
279
  def daily_paper
261
280
  @followups = EducodeSales::FollowUp.where(staff_id: @current_admin.id).where("updated_at > ?", Time.now.beginning_of_day).order("updated_at")
281
+ ab = EducodeSales::Common.where(extras: [EducodeSales::Common::ATYPE, EducodeSales::Common::BTYPE]).pluck(:id)
282
+ business = EducodeSales::FollowUp.joins("
283
+ JOIN educode_sales_businesses ON educode_sales_businesses.id = educode_sales_follow_ups.business_id
284
+ JOIN educode_sales_follow_ups AS last_up ON last_up.id = educode_sales_businesses.last_follow_up_id
285
+ ").where("educode_sales_businesses.staff_id = ? AND educode_sales_follow_ups.staff_id = ? AND last_up.clazz_id IN (?)", @current_admin.id, @current_admin.id, ab)
286
+
287
+
288
+ @month = business.where("educode_sales_follow_ups.created_at >= ?", Time.now.beginning_of_month).group("educode_sales_follow_ups.business_id").select("COUNT(DISTINCT(educode_sales_follow_ups.business_id)) AS num")
289
+ @quarter = business.where("educode_sales_follow_ups.created_at >= ?", Time.now.beginning_of_quarter).group("educode_sales_follow_ups.business_id").select("COUNT(DISTINCT(educode_sales_follow_ups.business_id)) AS num")
290
+ @year = business.where("educode_sales_follow_ups.created_at >= ?", Time.now.beginning_of_year).group("educode_sales_follow_ups.business_id").select("COUNT(DISTINCT(educode_sales_follow_ups.business_id)) AS num")
291
+
262
292
  render layout: false
263
293
  end
264
294
 
@@ -480,7 +510,7 @@ module EducodeSales
480
510
 
481
511
  end
482
512
 
483
- if params[:name].present? && (params[:name] == "(销售态势-" + @year + "-已中标商机)" || params[:name] == "(销售态势-" + @year + "-应收款商机)")
513
+ if params[:name].present? && params[:name] == "(销售态势-" + @year + "-已中标商机)"
484
514
  stage_ids = Common.where(clazz: '商机阶段', name: ['已中标','已签单','已验收','回款中', '服务中','已结束']).pluck(:id)
485
515
  if @year == '全部'
486
516
  @businesses = @businesses.joins("
@@ -494,6 +524,20 @@ module EducodeSales
494
524
 
495
525
  end
496
526
 
527
+ if params[:name].present? && params[:name] == "(销售态势-" + @year + "-应收款商机)"
528
+ stage_ids = Common.where(clazz: '商机阶段', name: ['已中标','已签单','已验收','回款中', '服务中','已结束']).pluck(:id)
529
+ if @year == '全部'
530
+ @businesses = @businesses.joins("
531
+ JOIN educode_sales_follow_ups ON educode_sales_businesses.last_follow_up_id = educode_sales_follow_ups.id
532
+ ").where("educode_sales_follow_ups.stage_id IN (?)",stage_ids)
533
+ else
534
+ @businesses = @businesses.joins("
535
+ JOIN educode_sales_follow_ups ON educode_sales_businesses.last_follow_up_id = educode_sales_follow_ups.id
536
+ ").where("educode_sales_follow_ups.bidded_date <= ? AND educode_sales_follow_ups.stage_id IN (?)", "#{@year}-12-31", stage_ids)
537
+ end
538
+
539
+ end
540
+
497
541
  if params[:name].present? && params[:name] == "(销售态势-" + @year + "-已签单商机)"
498
542
  s_stage_ids = Common.where(clazz: '商机阶段', name: ['已签单','已验收','回款中', '服务中','已结束']).pluck(:id)
499
543
  if @year == '全部'
@@ -615,7 +659,7 @@ module EducodeSales
615
659
  last_follow.actual_amount,
616
660
  (last_follow.actual_amount - educode_sales_businesses.return_money) as wait_return_money,
617
661
  last_follow.total_amount").joins("
618
- LEFT JOIN educode_sales_follow_ups AS last_follow ON educode_sales_businesses.last_follow_up_id = last_follow.id
662
+ LEFT JOIN educode_sales_follow_ups AS last_follow ON educode_sales_businesses.last_follow_up_id = last_follow.id AND last_follow.deleted_at IS NULL
619
663
  ")
620
664
  end
621
665
  end
@@ -243,7 +243,7 @@ module EducodeSales
243
243
  # o类商机增加编号
244
244
  def add_business_number
245
245
  # test数据库中 o类商机id=74 pre与线上o类商机=77
246
- if ( @business.number.blank?) && Common.find_by(extras: "o_class")
246
+ if ( @business.number.blank?) && params[:clazz_id].to_i == Common.find_by(extras: "o_class").id
247
247
  totual_count = EducodeSales::Business.unscoped.where("number like :data",data: "#{Time.now.year}%").count + 1 + Time.now.year*1000.to_i
248
248
  @business_number_record = BusinessNumberRecord.find_or_create_by(id: 1)
249
249
  while @business_number_record.value.include?(totual_count) || Business.pluck(:number).include?(totual_count.to_s)
@@ -21,9 +21,13 @@ module EducodeSales
21
21
  s_stage_ids = Common.where(clazz: '商机阶段', name: ['已签单', '已验收', '回款中', '服务中', '已结束']).pluck(:id)
22
22
  @service_amount = Business.joins(:last_follow_up).where("educode_sales_follow_ups.clazz_id != ?", x).where("educode_sales_follow_ups.stage_id IN (?)", s_stage_ids).sum(:total_amount).round(2)
23
23
  @actual_service_amount = Business.joins(:last_follow_up).where("educode_sales_follow_ups.clazz_id != ?", x).where("educode_sales_follow_ups.stage_id IN (?)", s_stage_ids).sum(:actual_amount).round(2)
24
- @return_amount = Business.joins(last_follow_up: :money_plans).where("educode_sales_follow_ups.clazz_id != ?", x).where.not("educode_sales_money_plans.clazz!= ?", 1).sum(:amount).round(2)
25
- # @return_amount = total_return[0]['return_money']&.round(2) || 0
26
- @receivable_amount = @goal_amount - @return_amount
24
+
25
+ # @return_amount = Business.joins(last_follow_up: :money_plans).where("educode_sales_follow_ups.clazz_id != ?", x).where.not("educode_sales_money_plans.clazz!= ?", 1).sum(:amount).round(2)
26
+ # # @return_amount = total_return[0]['return_money']&.round(2) || 0
27
+ # @receivable_amount = @goal_amount - @return_amount
28
+
29
+ @receivable_amount = Business.joins(:last_follow_up).where("educode_sales_follow_ups.clazz_id != ?", x).where("educode_sales_follow_ups.stage_id IN (?)", stage_ids).select("(SUM(educode_sales_follow_ups.actual_amount) - SUM(educode_sales_businesses.return_money)) AS num")
30
+ @receivable_amount = @receivable_amount.present? && @receivable_amount[0]['num'] ? @receivable_amount[0]['num'].round(2) : 0
27
31
 
28
32
  a = Common.where(clazz: '商机类型', name: Common.find_by(extras: EducodeSales::Common::ATYPE)&.name).pluck(:id)
29
33
  @a_amount = Business.joins(:last_follow_up).where("educode_sales_follow_ups.clazz_id IN (?)", a).sum(:total_amount).round(2)
@@ -48,10 +52,13 @@ module EducodeSales
48
52
  @return_amount = Business.joins(last_follow_up: :money_plans).where("educode_sales_follow_ups.clazz_id != ?", x).where.not("educode_sales_money_plans.clazz!= ?", 1).where("educode_sales_money_plans.date_at >= ? AND educode_sales_money_plans.date_at <= ? ", year_time, year_over_time).sum(:amount).round(2)
49
53
 
50
54
  # 往年累计已中标合同
51
- @former_goal_amount = Business.joins(:last_follow_up).where("educode_sales_follow_ups.clazz_id != ?", x).where("educode_sales_follow_ups.bidded_date <= ? AND educode_sales_follow_ups.stage_id IN (?)", "#{@year}-12-31", stage_ids).sum(:actual_amount).round(2)
52
- # 往年累计已回款
53
- @former_return_amount = Business.joins(last_follow_up: :money_plans).where("educode_sales_follow_ups.clazz_id != ?", x).where.not("educode_sales_money_plans.clazz!= ?", 1).where("educode_sales_money_plans.date_at <= ? ", year_over_time).sum(:amount).round(2)
54
- @receivable_amount = @former_goal_amount - @former_return_amount
55
+ # @former_goal_amount = Business.joins(:last_follow_up).where("educode_sales_follow_ups.clazz_id != ?", x).where("educode_sales_follow_ups.bidded_date <= ? AND educode_sales_follow_ups.stage_id IN (?)", "#{@year}-12-31", stage_ids).sum(:actual_amount).round(2)
56
+ # # 往年累计已回款
57
+ # @former_return_amount = Business.joins(last_follow_up: :money_plans).where("educode_sales_follow_ups.clazz_id != ?", x).where.not("educode_sales_money_plans.clazz!= ?", 1).where("educode_sales_money_plans.date_at <= ? ", year_over_time).sum(:amount).round(2)
58
+ # @receivable_amount = @former_goal_amount - @former_return_amount
59
+
60
+ @receivable_amount = Business.joins(:last_follow_up).where("educode_sales_follow_ups.clazz_id != ?", x).where("educode_sales_follow_ups.bidded_date <= ? AND educode_sales_follow_ups.stage_id IN (?)", "#{@year}-12-31", stage_ids).select("(SUM(educode_sales_follow_ups.actual_amount) - SUM(educode_sales_businesses.return_money)) AS num")
61
+ @receivable_amount = @receivable_amount.present? && @receivable_amount[0]['num'] ? @receivable_amount[0]['num'].round(2) : 0
55
62
 
56
63
  a = Common.where(clazz: '商机类型', name: Common.find_by(extras: EducodeSales::Common::ATYPE)&.name).pluck(:id)
57
64
  @a_amount = Business.joins(:last_follow_up).where("educode_sales_follow_ups.clazz_id IN (?)", a).where("educode_sales_follow_ups.year = ?", @year).sum(:total_amount).round(2)
@@ -176,7 +183,7 @@ module EducodeSales
176
183
 
177
184
  goal_default_dates = ("#{Time.now.year}-01-01".to_date.."#{Time.now.year}-#{Time.now.month}-01".to_date).map { |d| d.strftime("%Y-%m") }.uniq
178
185
  sale_names = ['已中标', '已签单', '已回款']
179
-
186
+
180
187
  if params[:goal_count_range].present?
181
188
  case params[:goal_count_range]
182
189
  when "week"
@@ -407,7 +414,7 @@ module EducodeSales
407
414
  if last_month != month.split("-")[0]
408
415
  last_sum = 0
409
416
  end
410
- data_1_total_hash[month] = (data_1_hash[month] || 0) + last_sum
417
+ data_1_total_hash[month] = ((data_1_hash[month] || 0) + last_sum).round(2)
411
418
  last_sum += data_1_hash[month] || 0
412
419
  last_month = month.split("-")[0]
413
420
  end
@@ -432,7 +439,7 @@ module EducodeSales
432
439
  if last_month != month.split("-")[0]
433
440
  last_sum = 0
434
441
  end
435
- data_2_total_hash[month] = (data_2_hash[month] || 0) + last_sum
442
+ data_2_total_hash[month] = ((data_2_hash[month] || 0) + last_sum).round(2)
436
443
  last_sum += data_2_hash[month] || 0
437
444
  last_month = month.split("-")[0]
438
445
  end
@@ -457,7 +464,7 @@ module EducodeSales
457
464
  if last_month != month.split("-")[0]
458
465
  last_sum = 0
459
466
  end
460
- data_3_total_hash[month] = (data_3_hash[month] || 0) + last_sum
467
+ data_3_total_hash[month] = ((data_3_hash[month] || 0) + last_sum).round(2)
461
468
  last_sum += data_3_hash[month] || 0
462
469
  last_month = month.split("-")[0]
463
470
  end
@@ -522,7 +529,7 @@ module EducodeSales
522
529
  if last_month != month.split("-")[0]
523
530
  last_sum = 0
524
531
  end
525
- data_1_total_hash[month] = (data_1_hash[month] || 0) + last_sum
532
+ data_1_total_hash[month] = ((data_1_hash[month] || 0) + last_sum).round(2)
526
533
  last_sum += data_1_hash[month] || 0
527
534
  last_month = month.split("-")[0]
528
535
  end
@@ -547,7 +554,7 @@ module EducodeSales
547
554
  if last_month != month.split("-")[0]
548
555
  last_sum = 0
549
556
  end
550
- data_2_total_hash[month] = (data_2_hash[month] || 0) + last_sum
557
+ data_2_total_hash[month] = ((data_2_hash[month] || 0) + last_sum).round(2)
551
558
  last_sum += data_2_hash[month] || 0
552
559
  last_month = month.split("-")[0]
553
560
  end
@@ -572,8 +579,8 @@ module EducodeSales
572
579
  if last_month != month.split("-")[0]
573
580
  last_sum = 0
574
581
  end
575
-
576
- data_3_total_hash[month] = (data_3_hash[month] || 0) + last_sum
582
+
583
+ data_3_total_hash[month] = ((data_3_hash[month] || 0) + last_sum).round(2)
577
584
  last_sum += data_3_hash[month] || 0
578
585
  last_month = month.split("-")[0]
579
586
  end
@@ -1,15 +1,23 @@
1
1
  <div style="padding: 15px;" id="day_content">
2
- <h2>今日跟进动态</h2>
2
+ <h2>今日工作报告</h2>
3
3
  <hr>
4
- <div style="height: 480px;overflow: auto;">
4
+ <div style="height: 450px;overflow: auto;">
5
5
  <% text = "\n" %>
6
6
  <% @followups.each_with_index do |d, i| %>
7
7
  <% text += "#{i+1}、**学校--**商机:#{d .description}\n" %>
8
8
  <p style="margin-bottom: 10px;"><%= i+1 %>、**学校--**商机:<%= d .description%></p>
9
9
  <% end %>
10
+ <% text += "本月开拓A、B类商机数:#{@month[0]&.[]('num') || 0 } \n"%>
11
+ <% text += "本季开拓A、B类商机数:#{@quarter[0]&.[]('num') || 0 } \n"%>
12
+ <% text += "本年开拓A、B类商机数:#{@year[0]&.[]('num') || 0 } \n"%>
13
+ <p style="margin-bottom: 10px;">本月开拓A、B类商机数:<span style="color: rgb(56, 150, 243);font-weight: bold;"><%= @month[0]&.[]('num') || 0 %></span></p>
14
+ <p style="margin-bottom: 10px;">本季开拓A、B类商机数:<span style="color: rgb(56, 150, 243);font-weight: bold;"><%= @quarter[0]&.[]('num') || 0 %></span></p>
15
+ <p style="margin-bottom: 10px;">本年开拓A、B类商机数:<span style="color: rgb(56, 150, 243);font-weight: bold;"><%= @year[0]&.[]('num') || 0 %></span></p>
10
16
  </div>
11
17
 
12
18
  <div id="content" style="display: none;" data-content="今日跟进动态<%=text %>"></div>
19
+ <p>头歌营销系统</p>
20
+ <p><%= Time.now.to_s %></p>
13
21
  <button type="button" onclick="copy()" style=" margin-right: 20px; float: right;" class="layui-btn layui-btn-primary">复制</button>
14
22
  </div>
15
23
  <script>
@@ -110,9 +110,9 @@
110
110
  <% if can? :create, EducodeSales::Business %>
111
111
  <button class="layui-btn layui-btn-normal layui-btn-sm data-add-btn pull-right" lay-event="add"> 添加商机</button>
112
112
  <% end %>
113
- <button class="layui-btn layui-btn-primary layui-border-green layui-btn-sm pull-right" lay-event="followes"> 我的关注</button>
114
- <button class="layui-btn layui-btn-primary layui-border-green layui-btn-sm pull-right" lay-event="mine"> 我的商机</button>
115
- <button class="layui-btn layui-btn-primary layui-border-green layui-btn-sm pull-right" lay-event="all"> 全部商机</button>
113
+ <button class="layui-btn layui-btn-primary layui-border-green layui-btn-sm pull-right at-btn" lay-event="followes"> 我的关注</button>
114
+ <button class="layui-btn layui-btn-primary layui-border-green layui-btn-sm pull-right my-btn" lay-event="mine"> 我的商机</button>
115
+ <button class="layui-btn layui-btn-primary layui-border-green layui-btn-sm pull-right all-btn" lay-event="all"> 全部商机</button>
116
116
  </div>
117
117
  </script>
118
118
  <script type="text/html" id="currentTableBar">
@@ -375,13 +375,6 @@
375
375
  sort: true,
376
376
  hide: gon.filter.bidded_date
377
377
  },
378
- {
379
- field: 'budget_money',
380
- width: 105,
381
- title: '预算金额',
382
- sort: true,
383
- hide: gon.filter.budget_money
384
- },
385
378
  {
386
379
  field: 'signed_date',
387
380
  width: 105,
@@ -410,6 +403,13 @@
410
403
  sort: true,
411
404
  hide: gon.filter.o_business_deployment
412
405
  },
406
+ {
407
+ field: 'budget_money',
408
+ width: 105,
409
+ title: '预算金额',
410
+ sort: true,
411
+ hide: gon.filter.budget_money
412
+ },
413
413
  {
414
414
  field: 'total_amount',
415
415
  width: 100,
@@ -867,6 +867,9 @@
867
867
  data.field.place_id = index_place_list.getValue('valueStr');
868
868
  data.field.business_type = business_type.toString();
869
869
  data.field.business_step = business_step.toString();
870
+ if (search['clazz']) {
871
+ data.field['clazz'] = search['clazz']
872
+ }
870
873
  search = data.field
871
874
  table.reload('businesses_table', {
872
875
  url: '/missions/businesses',
@@ -884,6 +887,13 @@
884
887
  form.val('search_follows', {
885
888
  name: data.field.name, department: data.field.department, staff_id: data.field.staff_id, area: data.field.area
886
889
  })
890
+ if (search['clazz'] == 'me') {
891
+ $(".my-btn").addClass("selected-btn");
892
+ } else if (search['clazz'] == 'followes') {
893
+ $(".at-btn").addClass("selected-btn");
894
+ } else {
895
+ $(".all-btn").addClass("selected-btn");
896
+ }
887
897
  return false;
888
898
  });
889
899
 
@@ -966,11 +976,13 @@
966
976
  name: '', department: '', staff_id: '', business_type: '', business_step: '',
967
977
  place_id: '', date: '', area: ''
968
978
  })
979
+ $(".all-btn").addClass("selected-btn");
969
980
  return false;
970
981
  } else if (obj.event === 'followes') {
971
- search = {"all":"1"}
982
+ search = {"all":"1", clazz: 'followes'}
983
+ business_type_list.setValue([])
972
984
  table.reload('businesses_table', {
973
- url: '/missions/businesses/following_businesses',
985
+ url: '/missions/businesses',
974
986
  page: {
975
987
  curr: 1
976
988
  },
@@ -980,10 +992,12 @@
980
992
  name: '', department: '', staff_id: '', business_type: '', business_step: '',
981
993
  place_id: '', date: '', area: ''
982
994
  })
995
+ $(".at-btn").addClass("selected-btn");
983
996
  return false;
984
997
  }
985
998
  else if (obj.event === 'mine') {
986
- search = {"mine":"1"}
999
+ search = {"clazz":"me"}
1000
+ business_type_list.setValue([])
987
1001
  table.reload('businesses_table', {
988
1002
  url: '/missions/businesses',
989
1003
  page: {
@@ -995,6 +1009,7 @@
995
1009
  name: '', department: '', staff_id: '', business_type: '', business_step: '',
996
1010
  place_id: '', date: '', area: ''
997
1011
  })
1012
+ $(".my-btn").addClass("selected-btn");
998
1013
  return false;
999
1014
  }
1000
1015
  else if (obj.event === 'delete') {
@@ -0,0 +1,5 @@
1
+ class DeleteBusinessNumber < ActiveRecord::Migration[5.2]
2
+ def change
3
+ EducodeSales::Business.joins(:last_follow_up).where("educode_sales_follow_ups.clazz_id != 77").update_all("educode_sales_businesses.number = null")
4
+ end
5
+ end
@@ -1,3 +1,3 @@
1
1
  module EducodeSales
2
- VERSION = '0.9.15'
2
+ VERSION = '0.9.17'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: educode_sales
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.15
4
+ version: 0.9.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - anke1460
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-10-20 00:00:00.000000000 Z
11
+ date: 2022-10-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -105,7 +105,6 @@ files:
105
105
  - app/assets/images/educode_sales/icon-login.png
106
106
  - app/assets/images/educode_sales/icon.png
107
107
  - app/assets/images/educode_sales/indexLogo.png
108
- - app/assets/images/educode_sales/indexlogo.png
109
108
  - app/assets/images/educode_sales/loading-0.gif
110
109
  - app/assets/images/educode_sales/loading-1.gif
111
110
  - app/assets/images/educode_sales/loading-2.gif
@@ -479,6 +478,7 @@ files:
479
478
  - db/migrate/20220920080302_add_column_number_to_educode_sales_businesses.rb
480
479
  - db/migrate/20220921131116_add_change_clazz_to_follow_up.rb
481
480
  - db/migrate/20220923084102_create_table_to_busines_number_recoreds.rb
481
+ - db/migrate/20221025094655_delete_business_number.rb
482
482
  - lib/educode_sales.rb
483
483
  - lib/educode_sales/engine.rb
484
484
  - lib/educode_sales/version.rb
@@ -487,7 +487,7 @@ homepage: https://www.educoder.net
487
487
  licenses:
488
488
  - MIT
489
489
  metadata: {}
490
- post_install_message:
490
+ post_install_message:
491
491
  rdoc_options: []
492
492
  require_paths:
493
493
  - lib
@@ -502,8 +502,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
502
502
  - !ruby/object:Gem::Version
503
503
  version: '0'
504
504
  requirements: []
505
- rubygems_version: 3.0.9
506
- signing_key:
505
+ rubygems_version: 3.0.0
506
+ signing_key:
507
507
  specification_version: 4
508
508
  summary: Summary of EducodeSales.
509
509
  test_files: []