educode_sales 0.4.3 → 0.4.7

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.
Files changed (85) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/images/educode_sales/1./351/224/200/345/224/256/346/264/273/345/212/250.png +0 -0
  3. data/app/assets/images/educode_sales/10./346/225/231/345/270/210/350/277/220/350/220/245.png +0 -0
  4. data/app/assets/images/educode_sales/11./346/264/273/345/212/250/350/277/220/350/220/245.png +0 -0
  5. data/app/assets/images/educode_sales/12./350/277/220/350/220/245/350/256/241/345/210/222.png +0 -0
  6. data/app/assets/images/educode_sales/13./347/263/273/347/273/237/350/256/276/347/275/256.png +0 -0
  7. data/app/assets/images/educode_sales/14./350/247/222/350/211/262/347/256/241/347/220/206.png +0 -0
  8. data/app/assets/images/educode_sales/15./344/272/272/345/221/230/347/256/241/347/220/206.png +0 -0
  9. data/app/assets/images/educode_sales/16./345/255/227/345/205/270/345/210/227/350/241/250.png +0 -0
  10. data/app/assets/images/educode_sales/2./345/270/202/345/234/272/346/200/201/345/212/277.png +0 -0
  11. data/app/assets/images/educode_sales/3./351/224/200/345/224/256/345/210/206/345/267/245.png +0 -0
  12. data/app/assets/images/educode_sales/4./345/225/206/346/234/272/347/256/241/347/220/206.png +0 -0
  13. data/app/assets/images/educode_sales/5./346/270/240/351/201/223/347/256/241/347/220/206.png +0 -0
  14. data/app/assets/images/educode_sales/6./351/224/200/345/224/256/350/256/241/345/210/222.png +0 -0
  15. data/app/assets/images/educode_sales/7./350/277/220/350/220/245/346/264/273/345/212/250.png +0 -0
  16. data/app/assets/images/educode_sales/8./350/277/220/350/220/245/346/200/201/345/212/277.png +0 -0
  17. data/app/assets/images/educode_sales/9./350/277/220/350/220/245/345/210/206/345/267/245.png +0 -0
  18. data/app/assets/images/educode_sales/a.png +0 -0
  19. data/app/assets/images/educode_sales/indexLogo.png +0 -0
  20. data/app/assets/images/educode_sales/logo.png +0 -0
  21. data/app/controllers/educode_sales/businesses_controller.rb +17 -12
  22. data/app/controllers/educode_sales/follow_ups_controller.rb +1 -1
  23. data/app/controllers/educode_sales/home_controller.rb +4 -0
  24. data/app/controllers/educode_sales/operation_plans_controller.rb +6 -2
  25. data/app/controllers/educode_sales/operation_reports_controller.rb +9 -3
  26. data/app/controllers/educode_sales/operations_controller.rb +1 -1
  27. data/app/controllers/educode_sales/plans_controller.rb +18 -6
  28. data/app/controllers/educode_sales/sale_reports_controller.rb +9 -3
  29. data/app/controllers/educode_sales/sale_trends_controller.rb +6 -5
  30. data/app/controllers/educode_sales/teacher_follows_controller.rb +1 -1
  31. data/app/models/educode_sales/teacher.rb +12 -19
  32. data/app/views/educode_sales/activities/index.html.erb +4 -0
  33. data/app/views/educode_sales/activities/index.json.jbuilder +6 -0
  34. data/app/views/educode_sales/activities/show_teachers.html.erb +16 -16
  35. data/app/views/educode_sales/businesses/edit_follow_record.html.erb +1 -1
  36. data/app/views/educode_sales/businesses/index.html.erb +15 -10
  37. data/app/views/educode_sales/businesses/index.json.jbuilder +7 -1
  38. data/app/views/educode_sales/businesses/new_follow_record.html.erb +1 -1
  39. data/app/views/educode_sales/businesses/show_follow.html.erb +2 -2
  40. data/app/views/educode_sales/businesses/show_follow.json.jbuilder +2 -2
  41. data/app/views/educode_sales/businesses/show_follow_record.html.erb +1 -1
  42. data/app/views/educode_sales/home/index.html.erb +1 -1
  43. data/app/views/educode_sales/home/search_operation_teacher.json.jbuilder +12 -0
  44. data/app/views/educode_sales/operation_plans/_monthPlan.html.erb +12 -8
  45. data/app/views/educode_sales/operation_plans/_monthly.html.erb +18 -4
  46. data/app/views/educode_sales/operation_plans/_weekPlan.html.erb +13 -9
  47. data/app/views/educode_sales/operation_plans/_weekly.html.erb +18 -4
  48. data/app/views/educode_sales/operation_plans/index.json.jbuilder +10 -2
  49. data/app/views/educode_sales/operation_plans/new_month.html.erb +34 -3
  50. data/app/views/educode_sales/operation_plans/new_monthly.html.erb +16 -2
  51. data/app/views/educode_sales/operation_plans/new_week.html.erb +32 -4
  52. data/app/views/educode_sales/operation_plans/new_weekly.html.erb +16 -2
  53. data/app/views/educode_sales/operation_reports/audit.html.erb +52 -13
  54. data/app/views/educode_sales/operation_reports/edit.html.erb +16 -2
  55. data/app/views/educode_sales/operation_reports/index.json.jbuilder +7 -0
  56. data/app/views/educode_sales/operation_reports/show.html.erb +58 -15
  57. data/app/views/educode_sales/places/index.html.erb +5 -0
  58. data/app/views/educode_sales/plans/_monthPlan.html.erb +11 -8
  59. data/app/views/educode_sales/plans/_monthly.html.erb +18 -3
  60. data/app/views/educode_sales/plans/_weekPlan.html.erb +10 -7
  61. data/app/views/educode_sales/plans/_weekly.html.erb +19 -3
  62. data/app/views/educode_sales/plans/edit_month.html.erb +1 -1
  63. data/app/views/educode_sales/plans/edit_week.html.erb +1 -1
  64. data/app/views/educode_sales/plans/index.json.jbuilder +4 -0
  65. data/app/views/educode_sales/plans/new_month.html.erb +1 -1
  66. data/app/views/educode_sales/plans/new_monthly.html.erb +16 -2
  67. data/app/views/educode_sales/plans/new_week.html.erb +1 -1
  68. data/app/views/educode_sales/plans/new_weekly.html.erb +16 -2
  69. data/app/views/educode_sales/sale_reports/audit.html.erb +52 -13
  70. data/app/views/educode_sales/sale_reports/edit.html.erb +16 -2
  71. data/app/views/educode_sales/sale_reports/index.json.jbuilder +7 -0
  72. data/app/views/educode_sales/sale_reports/show.html.erb +58 -21
  73. data/app/views/educode_sales/sales/index.html.erb +6 -0
  74. data/app/views/educode_sales/sales/index.json.jbuilder +20 -4
  75. data/app/views/educode_sales/sales/operations.html.erb +4 -4
  76. data/app/views/educode_sales/sales/operations.json.jbuilder +12 -3
  77. data/app/views/educode_sales/teachers/index.html.erb +19 -14
  78. data/app/views/educode_sales/teachers/index.json.jbuilder +12 -2
  79. data/app/views/educode_sales/teachers/show_follow.html.erb +1 -1
  80. data/app/views/layouts/educode_sales/application.html.erb +104 -37
  81. data/config/routes.rb +1 -0
  82. data/db/migrate/20211022085324_add_teacher_used_to_teachers.rb +7 -0
  83. data/lib/educode_sales/version.rb +1 -1
  84. metadata +22 -3
  85. data/app/assets/images/educode_sales/indexlogo.png +0 -0
@@ -4,7 +4,14 @@
4
4
  <button class="layui-btn layui-btn-normal layui-btn-sm data-add-btn pull-right" lay-event="add"> 添加计划</button>
5
5
  </div>
6
6
  </script>
7
- <form class="layui-form layui-form-pane">
7
+ <h1 class="m-t-20 text-center">报告人员:<%=@name %></h1>
8
+ <div class="layui-form-item">
9
+ <div class="layui-inline" style="margin:18px; font-weight: bold">
10
+ <label>负责区域:</label>
11
+ <span><%= @area %></span>
12
+ </div>
13
+ </div>
14
+ <form class="layui-form layui-form-pane" style="padding-right: 20px">
8
15
  <div class="layui-form-item">
9
16
  <div class="layui-inline" style="margin:18px; font-weight: bold">
10
17
  <label>完成率:</label>
@@ -21,6 +28,11 @@
21
28
  <span><%= @total_amount %>万</span>
22
29
  <%= hidden_field_tag 'amount', @total_amount, {id: 'weekly_amount_hide'} %>
23
30
  </div>
31
+ <div class="layui-inline" style="margin:18px; font-weight: bold">
32
+ <label style="margin-left: 100px">提交时间:</label>
33
+ <span><%= Time.now %></span>
34
+ <%= hidden_field_tag 'amount', @total_amount, {id: 'monthly_amount_hide'} %>
35
+ </div>
24
36
  </div>
25
37
  <div class="layui-form-item" style="margin-left: 18px">
26
38
  <div class="layui-form-item layui-form-text">
@@ -40,7 +52,9 @@
40
52
  </form>
41
53
 
42
54
  <!--表格-->
43
- <table class="layui-hide" id="newWeeklyTable" lay-filter="newWeeklyTable"></table>
55
+ <div style="padding: 20px">
56
+ <table class="layui-hide" id="newWeeklyTable" lay-filter="newWeeklyTable"></table>
57
+ </div>
44
58
  <script type="text/html" id="show_follow">
45
59
  <a href="javascript:void(0);" lay-event="show_follow" class="layui-table-link">{{ d.follow_ups_count }}</a>
46
60
  </script>
@@ -1,4 +1,11 @@
1
- <form class="layui-form layui-form-pane" action="">
1
+ <h1 class="m-t-20 text-center">报告人员:<%=@name %></h1>
2
+ <form class="layui-form layui-form-pane" action="" style="padding-right: 20px">
3
+ <div class="layui-form-item">
4
+ <div class="layui-inline" style="margin:18px; font-weight: bold">
5
+ <label>负责区域:</label>
6
+ <span><%= @area%></span>
7
+ </div>
8
+ </div>
2
9
  <div class="layui-form-item">
3
10
  <div class="layui-inline" style="margin:18px; font-weight: bold">
4
11
  <label>完成率:</label>
@@ -13,41 +20,47 @@
13
20
  <label style="margin-left: 100px">项目金额:</label>
14
21
  <span><%= @sale_report.amount %>万</span>
15
22
  </div>
23
+ <div class="layui-inline" style="margin:18px; font-weight: bold">
24
+ <label style="margin-left: 100px">提交时间:</label>
25
+ <span><%= @sale_report.created_at %></span>
26
+ <%= hidden_field_tag 'amount', @total_amount, {id: 'monthly_amount_hide'} %>
27
+ </div>
16
28
  </div>
17
29
  <div class="layui-form-item" style="margin-left: 18px">
18
30
  <div class="layui-form-item layui-form-text">
19
31
  <label class="layui-form-label">个人总结</label>
20
32
  <div class="layui-input-block">
21
- <textarea name="content" placeholder="此处填写要点:
33
+ <textarea name="content" placeholder="此处填写要点:
22
34
  1、一句话概括本周工作的主要成效和主要挫折;
23
35
  2、补充说明收获、经验;
24
- 3、补充说明需要上级解决的问题和挑战。" disabled class="layui-textarea"><%= @sale_report.content %></textarea>
36
+ 3、补充说明需要上级解决的问题和挑战。" disabled class="layui-textarea autosize"><%= @sale_report.content %></textarea>
25
37
  </div>
26
38
  </div>
27
- <div class="layui-form-item layui-form-text">
39
+ <div class="layui-form-item layui-form-text" style="margin-bottom: 0px">
28
40
  <label class="layui-form-label">大区意见</label>
29
41
  <div class="layui-input-block">
30
42
  <textarea name="level1_opinion" placeholder="给出评价、提醒、建议、办法等。"
31
- class="layui-textarea"><%= @sale_report.level1_opinion %></textarea>
43
+ class="layui-textarea autosize"><%= @sale_report.level1_opinion %></textarea>
32
44
  </div>
33
45
  </div>
34
- <div id="weekStar4"></div>
35
- <div class="layui-form-item layui-form-text">
46
+ <div id="weekStar4" style="margin-bottom: 40px"></div>
47
+ <div class="layui-form-item layui-form-text" style="margin-bottom: 0px">
36
48
  <label class="layui-form-label">总监意见</label>
37
49
  <div class="layui-input-block">
38
50
  <textarea name="level2_opinion" placeholder="给出评价、提醒、建议、办法等。"
39
- class="layui-textarea"><%= @sale_report.level2_opinion %></textarea>
51
+ class="layui-textarea autosize"><%= @sale_report.level2_opinion %></textarea>
40
52
  </div>
41
53
  </div>
42
- <div id="weekStar5"></div>
43
- <div class="layui-form-item layui-form-text">
54
+ <div id="weekStar5" style="margin-bottom: 40px"></div>
55
+ <div class="layui-form-item layui-form-text" style="margin-bottom: 0px">
44
56
  <label class="layui-form-label">副总意见</label>
45
57
  <div class="layui-input-block">
46
58
  <textarea name="level3_opinion" placeholder="给出评价、提醒、建议、办法等。"
47
- class="layui-textarea"><%= @sale_report.level3_opinion %></textarea>
59
+ class="layui-textarea autosize"><%= @sale_report.level3_opinion %></textarea>
48
60
  </div>
49
61
  </div>
50
- <div id="weekStar6"></div>
62
+ <div id="weekStar6" style="margin-bottom: 40px"></div>
63
+ <br>
51
64
  <div class="layui-inline m-t-10">
52
65
  <button type="submit" class="layui-btn layui-btn-normal" lay-submit lay-filter="audit_weekly_report"
53
66
  style="margin-left: 18px">提交
@@ -57,7 +70,9 @@
57
70
  </form>
58
71
 
59
72
  <!--表格-->
60
- <table class="layui-hide" id="showWeeklyTable" lay-filter="showWeeklyTable"></table>
73
+ <div style="padding: 20px">
74
+ <table class="layui-hide" id="showWeeklyTable" lay-filter="showWeeklyTable"></table>
75
+ </div>
61
76
  <script type="text/html" id="show_follow">
62
77
  <a href="javascript:void(0);" lay-event="show_follow" class="layui-table-link">{{ d.follow_ups_count }}</a>
63
78
  </script>
@@ -205,5 +220,29 @@
205
220
  ],
206
221
  page: true
207
222
  });
223
+ autosize();
224
+ function autosize(){
225
+ var text = $('.autosize');
226
+
227
+ text.each(function(){
228
+ $(this).attr('rows',1);
229
+ resize($(this));
230
+ });
231
+
232
+ text.on('input', function(){
233
+ resize($(this));
234
+ });
235
+
236
+ function resize ($text) {
237
+ $text.css('height', 'auto');
238
+ $text.css('height', $text[0].scrollHeight+'px');
239
+ }
240
+ }
208
241
  })
209
242
  </script>
243
+ <style>
244
+ .autosize {
245
+ resize: none;
246
+ overflow: hidden;
247
+ }
248
+ </style>
@@ -9,7 +9,14 @@
9
9
  {{# } }}
10
10
  </div>
11
11
  </script>
12
- <form class="layui-form layui-form-pane">
12
+ <h1 class="m-t-20 text-center">报告人员:<%=@name %></h1>
13
+ <form class="layui-form layui-form-pane" style="padding-right: 20px">
14
+ <div class="layui-form-item">
15
+ <div class="layui-inline" style="margin:18px; font-weight: bold">
16
+ <label>负责区域:</label>
17
+ <span><%= @area%></span>
18
+ </div>
19
+ </div>
13
20
  <div class="layui-form-item">
14
21
  <div class="layui-inline" style="margin:18px; font-weight: bold">
15
22
  <label>完成率:</label>
@@ -23,6 +30,11 @@
23
30
  <label style="margin-left: 100px">项目金额:</label>
24
31
  <span><%= @sale_report.amount %>万</span>
25
32
  </div>
33
+ <div class="layui-inline" style="margin:18px; font-weight: bold">
34
+ <label style="margin-left: 100px">提交时间:</label>
35
+ <span><%= @sale_report.created_at %></span>
36
+ <%= hidden_field_tag 'amount', @total_amount, {id: 'monthly_amount_hide'} %>
37
+ </div>
26
38
  </div>
27
39
  <div class="layui-form-item" style="margin-left: 18px">
28
40
  <div class="layui-form-item layui-form-text">
@@ -43,7 +55,9 @@
43
55
  </form>
44
56
 
45
57
  <!--表格-->
46
- <table class="layui-hide" id="newWeeklyTable" lay-filter="newWeeklyTable"></table>
58
+ <div style="padding: 20px">
59
+ <table class="layui-hide" id="newWeeklyTable" lay-filter="newWeeklyTable"></table>
60
+ </div>
47
61
  <script type="text/html" id="show_follow">
48
62
  <a href="javascript:void(0);" lay-event="show_follow" class="layui-table-link">{{ d.follow_ups_count }}</a>
49
63
  </script>
@@ -10,8 +10,15 @@ json.data do
10
10
  json.level2_score d.level2_score || 0
11
11
  json.level3_score d.level3_score || 0
12
12
  json.updated_at d.updated_at.to_s
13
+ json.weekly d.weekly
14
+ json.created_at d.created_at.to_s
15
+ json.month d.month.strftime("%Y-%m")
13
16
  end
14
17
  end
15
18
 
19
+ json.totalRow do
20
+ sum = @sale_reports.inject(0) { |score, i| score + i.finish_rate}
21
+ json.finish_rate ( @sale_reports.size > 0 ? (sum.to_f / @sale_reports.size).round(2).to_s : '0' ) + '%'
22
+ end
16
23
  json.code 0
17
24
  json.count @sale_reports.total_count
@@ -1,4 +1,11 @@
1
- <form class="layui-form layui-form-pane" action="">
1
+ <h1 class="m-t-20 text-center">报告人员:<%=@name %></h1>
2
+ <form class="layui-form layui-form-pane" action="" style="padding-right: 20px">
3
+ <div class="layui-form-item">
4
+ <div class="layui-inline" style="margin:18px; font-weight: bold">
5
+ <label>负责区域:</label>
6
+ <span><%= @area%></span>
7
+ </div>
8
+ </div>
2
9
  <div class="layui-form-item">
3
10
  <div class="layui-inline" style="margin:18px; font-weight: bold">
4
11
  <label>完成率:</label>
@@ -12,6 +19,11 @@
12
19
  <label style="margin-left: 100px">项目金额:</label>
13
20
  <span><%= @sale_report.amount %>万</span>
14
21
  </div>
22
+ <div class="layui-inline" style="margin:18px; font-weight: bold">
23
+ <label style="margin-left: 100px">提交时间:</label>
24
+ <span><%= @sale_report.created_at %></span>
25
+ <%= hidden_field_tag 'amount', @total_amount, {id: 'monthly_amount_hide'} %>
26
+ </div>
15
27
  </div>
16
28
  <div class="layui-form-item" style="margin-left: 18px">
17
29
  <div class="layui-form-item layui-form-text">
@@ -20,39 +32,41 @@
20
32
  <textarea name="desc" placeholder="此处填写要点:
21
33
  1、一句话概括本周工作的主要成效和主要挫折;
22
34
  2、补充说明收获、经验;
23
- 3、补充说明需要上级解决的问题和挑战。" disabled class="layui-textarea"><%= @sale_report.content %></textarea>
35
+ 3、补充说明需要上级解决的问题和挑战。" disabled class="layui-textarea autosize"><%= @sale_report.content %></textarea>
24
36
  </div>
25
37
  </div>
26
- <div class="layui-form-item layui-form-text">
38
+ <div class="layui-form-item layui-form-text" style="margin-bottom: 0px">
27
39
  <label class="layui-form-label">大区意见</label>
28
40
  <div class="layui-input-block">
29
41
  <textarea name="desc" placeholder="给出评价、提醒、建议、办法等。" disabled
30
- class="layui-textarea"><%= @sale_report.level1_opinion %></textarea>
42
+ class="layui-textarea autosize"><%= @sale_report.level1_opinion %></textarea>
31
43
  </div>
32
44
  </div>
33
- <div id="weekStar4"></div>
34
- <div class="layui-form-item layui-form-text">
45
+ <div id="weekStar4" style="margin-bottom: 40px"></div>
46
+ <div class="layui-form-item layui-form-text" style="margin-bottom: 0px">
35
47
  <label class="layui-form-label">总监意见</label>
36
48
  <div class="layui-input-block">
37
49
  <textarea name="desc" placeholder="给出评价、提醒、建议、办法等。" disabled
38
- class="layui-textarea"><%= @sale_report.level2_opinion %></textarea>
50
+ class="layui-textarea autosize"><%= @sale_report.level2_opinion %></textarea>
39
51
  </div>
40
52
  </div>
41
- <div id="weekStar5"></div>
42
- <div class="layui-form-item layui-form-text">
53
+ <div id="weekStar5" style="margin-bottom: 40px"></div>
54
+ <div class="layui-form-item layui-form-text" style="margin-bottom: 0px">
43
55
  <label class="layui-form-label">副总意见</label>
44
56
  <div class="layui-input-block">
45
57
  <textarea name="desc" placeholder="给出评价、提醒、建议、办法等。" disabled
46
- class="layui-textarea"><%= @sale_report.level3_opinion %></textarea>
58
+ class="layui-textarea autosize"><%= @sale_report.level3_opinion %></textarea>
47
59
  </div>
48
60
  </div>
49
- <div id="weekStar6"></div>
61
+ <div id="weekStar6" style="margin-bottom: 40px"></div>
50
62
  <br>
51
63
  </div>
52
64
  </form>
53
65
 
54
66
  <!--表格-->
55
- <table class="layui-hide" id="showWeeklyTable" lay-filter="showWeeklyTable"></table>
67
+ <div style="padding: 20px">
68
+ <table class="layui-hide" id="showWeeklyTable" lay-filter="showWeeklyTable"></table>
69
+ </div>
56
70
  <script type="text/html" id="show_follow">
57
71
  <a href="javascript:void(0);" lay-event="show_follow" class="layui-table-link">{{ d.follow_ups_count }}</a>
58
72
  </script>
@@ -117,43 +131,42 @@
117
131
  },
118
132
  {
119
133
  field: 'staff',
120
- width: 120,
134
+ width: 80,
121
135
  title: '姓名'
122
136
  },
123
137
  {
124
138
  field: 'business_name',
125
- width: 270,
139
+ width: 150,
126
140
  title: '商机名称',
127
141
  },
128
142
  {
129
143
  field: 'school',
130
- width: 200,
144
+ width: 120,
131
145
  title: '单位'
132
146
  },
133
147
  {
134
148
  field: 'department',
135
- width: 190,
149
+ width: 170,
136
150
  title: '部门'
137
151
  },
138
152
  {
139
153
  field: 'weekly',
140
- width: 100,
154
+ width: 80,
141
155
  title: '周次',
142
156
  },
143
157
  {
144
158
  field: 'follow_ups_count',
145
- width: 100,
159
+ width: 80,
146
160
  title: '跟进',
147
161
  templet: '#show_follow'
148
162
  },
149
163
  {
150
164
  field: 'finish_rate',
151
- width: 100,
165
+ width: 80,
152
166
  title: '完成率',
153
167
  },
154
168
  {
155
169
  field: 'content',
156
- width: 300,
157
170
  title: '计划内容',
158
171
  },
159
172
  {
@@ -166,7 +179,31 @@
166
179
  ],
167
180
  page: true
168
181
  });
169
- })
170
182
 
171
183
 
184
+ autosize();
185
+ function autosize(){
186
+ var text = $('.autosize');
187
+
188
+ text.each(function(){
189
+ $(this).attr('rows',1);
190
+ resize($(this));
191
+ });
192
+
193
+ text.on('input', function(){
194
+ resize($(this));
195
+ });
196
+
197
+ function resize ($text) {
198
+ $text.css('height', 'auto');
199
+ $text.css('height', $text[0].scrollHeight+'px');
200
+ }
201
+ }
202
+ })
172
203
  </script>
204
+ <style>
205
+ .autosize {
206
+ resize: none;
207
+ overflow: hidden;
208
+ }
209
+ </style>
@@ -26,10 +26,12 @@
26
26
  elem: '#table',
27
27
  url: '/missions/sales',
28
28
  cellMinWidth: 80,
29
+ totalRow:true,
29
30
  cols: [
30
31
  [{
31
32
  field: 'id',
32
33
  title:'序号',type: 'numbers',
34
+ totalRowText:'合计',
33
35
  width: 80
34
36
  }, {
35
37
  field: 'name',
@@ -42,19 +44,23 @@
42
44
  field: 'business_a',
43
45
  title: 'A类商机',
44
46
  templet: "#business_a",
47
+ totalRow:true,
45
48
  width: 120
46
49
  }, {
47
50
  field: 'business_b',
48
51
  title: 'B类商机',
49
52
  templet: "#business_b",
53
+ totalRow:true,
50
54
  width: 120
51
55
  }, {
52
56
  field: 'goal',
53
57
  title: '中标金额',
58
+ totalRow:true,
54
59
  width: 120
55
60
  }, {
56
61
  field: 'return_money',
57
62
  title: '回款',
63
+ totalRow:true,
58
64
  width: 120
59
65
  }
60
66
  ]
@@ -1,17 +1,33 @@
1
+ businesses_a_count = 0
2
+ businesses_b_count = 0
1
3
  json.data do
2
4
  json.array! @staffs do |d|
5
+ part_a_ids = EducodeSales::Business.where("educode_sales_businesses.last_follow_up_id is null AND staff_id = ?",d.id).ids
6
+ part_b_ids = EducodeSales::Business.where("educode_sales_businesses.last_follow_up_id is not null").joins("
7
+ JOIN educode_sales_follow_ups ON educode_sales_businesses.last_follow_up_id = educode_sales_follow_ups.id
8
+ ").where("educode_sales_follow_ups.staff_id = ?", d.id).pluck(:business_id)
9
+ business_ids = part_a_ids + part_b_ids
10
+ @businesses = EducodeSales::Business.where(id:business_ids)
3
11
  json.id d.id
4
12
  json.name d.user.real_name
5
13
  json.role d.role&.name
6
14
  json.area d.areas.present? ? d.areas.pluck(:name).join("、") : ''
7
- json.business_a d.businesses.joins("JOIN educode_sales_follow_ups on educode_sales_follow_ups.id = educode_sales_businesses.last_follow_up_id").where("educode_sales_follow_ups.clazz_id = ?", @a_clazz&.id).count
8
- json.business_b d.businesses.joins("JOIN educode_sales_follow_ups on educode_sales_follow_ups.id = educode_sales_businesses.last_follow_up_id").where("educode_sales_follow_ups.clazz_id = ?", @b_clazz&.id).count
9
- json.goal d.businesses.joins("JOIN educode_sales_follow_ups on educode_sales_follow_ups.id = educode_sales_businesses.last_follow_up_id").where("educode_sales_follow_ups.clazz_id != ? AND educode_sales_follow_ups.stage_id in (?)", @x, @step_ids).sum(:total_amount).round(2)
10
- json.return_money d.businesses.joins("JOIN educode_sales_follow_ups on educode_sales_follow_ups.id = educode_sales_businesses.last_follow_up_id").where("educode_sales_follow_ups.clazz_id != ?", @x).sum("educode_sales_businesses.return_money").round(2)
15
+ business_a = @businesses.joins("JOIN educode_sales_follow_ups on educode_sales_follow_ups.id = educode_sales_businesses.last_follow_up_id").where("educode_sales_follow_ups.clazz_id = ?", @a_clazz&.id).count
16
+ businesses_a_count += business_a
17
+ json.business_a business_a
18
+ business_b = @businesses.joins("JOIN educode_sales_follow_ups on educode_sales_follow_ups.id = educode_sales_businesses.last_follow_up_id").where("educode_sales_follow_ups.clazz_id = ?", @b_clazz&.id).count
19
+ businesses_b_count += business_b
20
+ json.business_b business_b
21
+ json.goal @businesses.joins("JOIN educode_sales_follow_ups on educode_sales_follow_ups.id = educode_sales_businesses.last_follow_up_id").where("educode_sales_follow_ups.clazz_id != ? AND educode_sales_follow_ups.stage_id in (?)", @x, @step_ids).sum(:total_amount).round(2)
22
+ json.return_money @businesses.joins("JOIN educode_sales_follow_ups on educode_sales_follow_ups.id = educode_sales_businesses.last_follow_up_id").where("educode_sales_follow_ups.clazz_id != ?", @x).sum("educode_sales_businesses.return_money").round(2)
11
23
  json.a_clazz_id @a_clazz&.id
12
24
  json.b_clazz_id @b_clazz&.id
13
25
  end
14
26
  end
15
27
 
28
+ json.totalRow do
29
+ json.business_a businesses_a_count.to_s
30
+ json.business_b businesses_b_count.to_s
31
+ end
16
32
  json.code 0
17
33
  json.count @staffs.total_count
@@ -11,14 +11,10 @@
11
11
  <script type="text/html" id="currentTableBar">
12
12
  </script>
13
13
  <script type="text/html" id="school">
14
- <div class="layui-text">
15
14
  <a href="javascript:void(0);" lay-event="school" class="layui-table-link">{{d.schools}}</a>
16
- </div>
17
15
  </script>
18
16
  <script type="text/html" id="xschool">
19
- <div class="layui-text">
20
17
  <a href="javascript:void(0);" lay-event="xschool" class="layui-table-link">{{d.departments}}</a>
21
- </div>
22
18
  </script>
23
19
  <script>
24
20
  layui.use(['form', 'table', 'miniPage', 'element'], function () {
@@ -32,10 +28,12 @@
32
28
  elem: '#oper_table',
33
29
  url: '/missions/sales/operations',
34
30
  defaultToolbar: [],
31
+ totalRow:true,
35
32
  cols: [
36
33
  [{
37
34
  field: 'id',
38
35
  title:'序号',type: 'numbers',
36
+ totalRowText:'合计',
39
37
  width: 80
40
38
  }, {
41
39
  field: 'name',
@@ -52,11 +50,13 @@
52
50
  field: 'schools',
53
51
  title: '跟进学校',
54
52
  templet: "#school",
53
+ totalRow:true,
55
54
  width: 120
56
55
  }, {
57
56
  field: 'departments',
58
57
  title: '跟进二级学院',
59
58
  templet: "#xschool",
59
+ totalRow:true,
60
60
  width: 120
61
61
  },
62
62
  ]
@@ -1,3 +1,5 @@
1
+ departments_count = 0
2
+ schools_count = 0
1
3
  json.data do
2
4
  json.array! @staffs do |d|
3
5
  json.id d.id
@@ -5,11 +7,18 @@ json.data do
5
7
  json.role d.role&.name
6
8
  json.job_type EducodeSales::Common.job_type_name[d.job_type]
7
9
  json.area d.areas.present? ? d.areas.pluck(:name).join("、") : ''
8
- json.departments EducodeSales::Business.joins(:last_follow_up).where("educode_sales_follow_ups.staff_id = #{d.id}").select("COUNT(educode_sales_follow_ups.staff_id) AS count")[0]&.send('count') + EducodeSales::Teacher.joins(:follow_up).where("educode_sales_teacher_follows.staff_id = #{d.id}").select("COUNT(educode_sales_teacher_follows.staff_id) AS count")[0]&.send('count') || 0
9
- json.schools EducodeSales::Business.joins(:last_follow_up, :department).where("educode_sales_follow_ups.staff_id = #{d.id}").select("COUNT(distinct(departments.school_id)) AS count")[0]['count'] + EducodeSales::Teacher.joins(:follow_up, :department).where("educode_sales_teacher_follows.staff_id = #{d.id}").select("COUNT(distinct(departments.school_id)) AS count")[0]['count']
10
-
10
+ departments = EducodeSales::Business.joins(:last_follow_up).where("educode_sales_follow_ups.staff_id = #{d.id}").select("COUNT(educode_sales_follow_ups.staff_id) AS count")[0]&.send('count') + EducodeSales::Teacher.joins(:follow_up).where("educode_sales_teacher_follows.staff_id = #{d.id}").select("COUNT(educode_sales_teacher_follows.staff_id) AS count")[0]&.send('count') || 0
11
+ json.departments departments
12
+ schools = EducodeSales::Business.joins(:last_follow_up, :department).where("educode_sales_follow_ups.staff_id = #{d.id}").select("COUNT(distinct(departments.school_id)) AS count")[0]['count'] + EducodeSales::Teacher.joins(:follow_up, :department).where("educode_sales_teacher_follows.staff_id = #{d.id}").select("COUNT(distinct(departments.school_id)) AS count")[0]['count']
13
+ json.schools schools
14
+ departments_count += departments
15
+ schools_count += schools
11
16
  end
12
17
  end
13
18
 
19
+ json.totalRow do
20
+ json.departments departments_count.to_s
21
+ json.schools schools_count.to_s
22
+ end
14
23
  json.code 0
15
24
  json.count @staffs.total_count
@@ -139,63 +139,66 @@
139
139
  url: '/missions/teachers',
140
140
  where: {q: form.val('search_form')},
141
141
  toolbar: '#toolbarDemo',
142
- defaultToolbar: [],
142
+ totalRow:true,
143
+ defaultToolbar: ['filter'],
143
144
  cols: [
144
145
  [
145
146
  {
146
147
  field: 'id',
147
- width: 120,
148
+ width: 60,
148
149
  title:'序号',type: 'numbers',
150
+ totalRowText:'合计',
149
151
  },
150
152
  {
151
153
  field: 'name',
152
- width: 120,
154
+ width: 80,
153
155
  title: '姓名',
154
156
  templet: "#name"
155
157
  },
156
158
  {
157
159
  field: 'school',
158
- width: 250,
160
+ width: 160,
159
161
  title: '单位',
160
162
  },
161
163
  {
162
164
  field: 'department',
163
- width: 250,
165
+ width: 130,
164
166
  title: '部门'
165
167
  },
166
168
  {
167
169
  field: 'professional_title',
168
170
  title: '职称',
169
- width: 120,
171
+ width: 80,
170
172
  templet: '#show_follow'
171
173
  },
172
174
  {
173
175
  field: 'job',
174
- width: 120,
176
+ width: 80,
175
177
  title: '职务',
176
178
  templet: '#show_keys'
177
179
 
178
180
  },
179
181
  {
180
182
  field: 'source',
181
- width: 120,
183
+ width: 90,
182
184
  title: '来源',
183
185
  },
184
186
  {
185
187
  field: 'attitude',
186
- width: 120,
188
+ width: 60,
187
189
  title: '态度',
188
190
  },
189
191
  {
190
192
  field: 'course_subjects_count',
191
- width: 120,
193
+ width: 90,
192
194
  title: '课程方向',
193
195
  templet: "#courses"
194
196
  },
195
197
  {
196
198
  field: 'teacher_follows_count',
197
- width: 120,
199
+ width: 90,
198
200
  title: '跟进情况',
201
+ totalRow:true,
199
202
  templet: "#follow"
200
203
  },
201
204
  {
@@ -205,18 +208,20 @@
205
208
  },
206
209
  {
207
210
  field: 'students',
208
- width: 120,
211
+ width: 60,
212
+ totalRow:'{{ parseInt(d.TOTAL_NUMS) }}',
209
213
  title: '学生',
210
214
  },
211
215
  {
212
216
  field: 'courses_count',
213
- width: 120,
217
+ width: 60,
214
218
  title: '课堂',
219
+ totalRow:true,
215
220
  templet: "#class"
216
221
  },
217
222
  {
218
223
  field: 'activities_count',
219
- width: 120,
224
+ width: 100,
220
225
  title: '参与活动',
221
226
  templet: "#event"
222
227
  },
@@ -1,3 +1,5 @@
1
+ teacher_follows_count = 0
2
+ courses_counts = 0
1
3
  json.data do
2
4
  json.array! @teachers do |d|
3
5
  json.id d.id
@@ -13,12 +15,20 @@ json.data do
13
15
  json.activities_count d.activity_teachers_count
14
16
  json.source EducodeSales::Common.teacher_source_name[d.source_id]
15
17
  json.attitude d.follow_up&.attitude&.name
16
- json.courses_count d.user_id ? Course.joins(:course_members).where(course_members: {user_id: d.user_id}).where("is_delete = 0 and role != 4 and excellent = 0 and is_hidden = 0").where("start_date is null or start_date <= '#{Date.today}'").distinct(:course_id).count : 0
18
+ json.courses_count d.courses_count
17
19
  json.actives d.actives
18
20
  json.students d.students_count
19
21
  json.regist_at d.user.present? ? d.user.created_on.to_s(:date) : ''
20
- json.teacher_used d.teacher_used_of_department
22
+ json.teacher_used d.teacher_used
23
+
24
+ teacher_follows_count += d.teacher_follows_count
25
+ courses_counts += d.courses_count
21
26
  end
22
27
  end
28
+
29
+ json.totalRow do
30
+ json.teacher_follows_count teacher_follows_count.to_s
31
+ json.courses_count courses_counts.to_s
32
+ end
23
33
  json.code 0
24
34
  json.count @teachers.total_count
@@ -36,7 +36,7 @@
36
36
  elem: '#sale_plan_follow_table',
37
37
  url: '/missions/teachers/show_follow?id=' + parent.id ,
38
38
  toolbar: '#toolbarDemo_follow',
39
- defaultToolbar: [],
39
+ defaultToolbar: ['filter'],
40
40
  cols: [
41
41
  [
42
42
  {