educode_sales 0.2.0 → 0.2.1

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 (84) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/images/educode_sales/indexlogo.png +0 -0
  3. data/app/assets/stylesheets/educode_sales/app.css +23 -0
  4. data/app/assets/stylesheets/educode_sales/public.css +4 -0
  5. data/app/controllers/educode_sales/businesses_controller.rb +12 -1
  6. data/app/controllers/educode_sales/follow_ups_controller.rb +13 -0
  7. data/app/controllers/educode_sales/home_controller.rb +7 -7
  8. data/app/controllers/educode_sales/operation_reports_controller.rb +3 -3
  9. data/app/controllers/educode_sales/staffs_controller.rb +3 -2
  10. data/app/controllers/educode_sales/teacher_follows_controller.rb +1 -0
  11. data/app/controllers/educode_sales/teachers_controller.rb +1 -0
  12. data/app/models/educode_sales/activity.rb +1 -1
  13. data/app/models/educode_sales/staff.rb +3 -3
  14. data/app/models/educode_sales/teacher.rb +3 -2
  15. data/app/views/educode_sales/activities/index.html.erb +11 -11
  16. data/app/views/educode_sales/activities/show_teachers.html.erb +1 -5
  17. data/app/views/educode_sales/businesses/edit_plan.html.erb +7 -2
  18. data/app/views/educode_sales/businesses/index.html.erb +18 -10
  19. data/app/views/educode_sales/businesses/index.json.jbuilder +3 -1
  20. data/app/views/educode_sales/businesses/new.html.erb +1 -1
  21. data/app/views/educode_sales/businesses/new_follow_record.html.erb +12 -2
  22. data/app/views/educode_sales/businesses/show_follow.html.erb +23 -19
  23. data/app/views/educode_sales/businesses/show_follow.json.jbuilder +1 -0
  24. data/app/views/educode_sales/businesses/show_keys.html.erb +1 -1
  25. data/app/views/educode_sales/commons/edit.html.erb +1 -1
  26. data/app/views/educode_sales/commons/index.html.erb +2 -3
  27. data/app/views/educode_sales/home/index.html.erb +1 -1
  28. data/app/views/educode_sales/home/search_teacher.json.jbuilder +2 -2
  29. data/app/views/educode_sales/home/statistics.html.erb +1 -0
  30. data/app/views/educode_sales/operation_plans/_monthPlan.html.erb +2 -3
  31. data/app/views/educode_sales/operation_plans/_monthly.html.erb +2 -2
  32. data/app/views/educode_sales/operation_plans/_weekPlan.html.erb +2 -3
  33. data/app/views/educode_sales/operation_plans/_weekly.html.erb +2 -1
  34. data/app/views/educode_sales/operation_plans/edit_monthly.html.erb +3 -3
  35. data/app/views/educode_sales/operation_plans/edit_weekly.html.erb +3 -3
  36. data/app/views/educode_sales/operation_plans/new_month.html.erb +1 -1
  37. data/app/views/educode_sales/operation_plans/new_monthly.html.erb +3 -3
  38. data/app/views/educode_sales/operation_plans/new_week.html.erb +1 -1
  39. data/app/views/educode_sales/operation_plans/new_weekly.html.erb +3 -3
  40. data/app/views/educode_sales/operation_plans/show_monthly.html.erb +3 -3
  41. data/app/views/educode_sales/operation_plans/show_weekly.html.erb +3 -3
  42. data/app/views/educode_sales/operation_reports/audit.html.erb +2 -2
  43. data/app/views/educode_sales/operation_reports/edit.html.erb +3 -3
  44. data/app/views/educode_sales/operation_reports/show.html.erb +139 -27
  45. data/app/views/educode_sales/places/index.html.erb +6 -6
  46. data/app/views/educode_sales/plans/_monthPlan.html.erb +2 -1
  47. data/app/views/educode_sales/plans/_monthly.html.erb +2 -1
  48. data/app/views/educode_sales/plans/_weekPlan.html.erb +2 -1
  49. data/app/views/educode_sales/plans/_weekly.html.erb +2 -1
  50. data/app/views/educode_sales/plans/audit_weekly.html.erb +3 -3
  51. data/app/views/educode_sales/plans/edit_monthly.html.erb +3 -3
  52. data/app/views/educode_sales/plans/edit_weekly.html.erb +1 -1
  53. data/app/views/educode_sales/plans/new_monthly.html.erb +1 -1
  54. data/app/views/educode_sales/plans/new_weekly.html.erb +1 -1
  55. data/app/views/educode_sales/plans/show_monthly.html.erb +3 -3
  56. data/app/views/educode_sales/plans/show_weekly.html.erb +1 -1
  57. data/app/views/educode_sales/roles/index.html.erb +2 -1
  58. data/app/views/educode_sales/sale_reports/audit.html.erb +1 -1
  59. data/app/views/educode_sales/sale_reports/edit.html.erb +3 -3
  60. data/app/views/educode_sales/sale_reports/show.html.erb +1 -1
  61. data/app/views/educode_sales/sale_trends/operations.html.erb +1 -1
  62. data/app/views/educode_sales/sales/index.html.erb +12 -7
  63. data/app/views/educode_sales/sales/index.json.jbuilder +1 -1
  64. data/app/views/educode_sales/sales/operations.html.erb +7 -5
  65. data/app/views/educode_sales/sales/operations.json.jbuilder +3 -2
  66. data/app/views/educode_sales/sales/school.html.erb +1 -2
  67. data/app/views/educode_sales/sales/xschool.html.erb +1 -2
  68. data/app/views/educode_sales/staffs/follow_up_departments.json.jbuilder +1 -2
  69. data/app/views/educode_sales/staffs/follow_up_schools.json.jbuilder +1 -2
  70. data/app/views/educode_sales/staffs/index.html.erb +6 -8
  71. data/app/views/educode_sales/staffs/new.html.erb +1 -1
  72. data/app/views/educode_sales/teachers/add_courses.html.erb +3 -3
  73. data/app/views/educode_sales/teachers/add_event.html.erb +1 -1
  74. data/app/views/educode_sales/teachers/add_keys.html.erb +11 -5
  75. data/app/views/educode_sales/teachers/index.html.erb +8 -6
  76. data/app/views/educode_sales/teachers/new_follow_record.html.erb +1 -0
  77. data/app/views/educode_sales/teachers/search_new.html.erb +2 -2
  78. data/app/views/educode_sales/teachers/show_class.html.erb +1 -1
  79. data/app/views/educode_sales/teachers/show_follow.html.erb +11 -9
  80. data/app/views/educode_sales/teachers/show_follow.json.jbuilder +1 -0
  81. data/app/views/layouts/educode_sales/application.html.erb +6 -9
  82. data/config/routes.rb +1 -0
  83. data/lib/educode_sales/version.rb +1 -1
  84. metadata +3 -2
@@ -47,17 +47,25 @@
47
47
  </div>
48
48
  </form>
49
49
 
50
- <!--表格-->
51
- <table class="layui-hide" id="showWeeklyTable" lay-filter="currentShowWeekly"></table>
52
- <script type="text/html" id="currentShowWeekly">
53
- <a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="show">查看</a>
54
- <a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="edit">编辑</a>
55
- <a class="layui-btn layui-btn-xs layui-btn-danger data-count-delete" lay-event="delete">删除</a>
50
+ <script type="text/html" id="show_follow_show">
51
+ <a href="javascript:void(0);" lay-event="show_follow_show" class="layui-table-link">{{ d.count }}</a>
56
52
  </script>
53
+ <!--表格-->
54
+ <table class="layui-hide" id="showWeeklyTable" lay-filter="showWeeklyTable"></table>
55
+ <!--<script type="text/html" id="currentShowWeekly">-->
56
+ <!-- <a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="show">查看</a>-->
57
+ <!-- <a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="edit">编辑</a>-->
58
+ <!-- <a class="layui-btn layui-btn-xs layui-btn-danger data-count-delete" lay-event="delete">删除</a>-->
59
+ <!--</script>-->
57
60
  <script>
58
61
  layui.use(['rate', 'table'], function () {
59
- var rate = layui.rate;
60
- table = layui.table
62
+ var rate = layui.rate,
63
+ form = layui.form,
64
+ $ = layui.jquery,
65
+ miniPage = layui.miniPage,
66
+ request = layui.request;
67
+ table = layui.table;
68
+
61
69
  rate.render({
62
70
  elem: '#weekStar4',
63
71
  half: true,
@@ -73,36 +81,36 @@
73
81
  half: true,
74
82
  readonly: true
75
83
  })
76
- })
84
+
77
85
 
78
86
  table.render({
79
87
  elem: '#showWeeklyTable',
80
- // url: 'api/table.json',
88
+ url: '/educode_sales/operation_reports/' + "<%= @sale_report.id%>" + '/plans',
89
+
81
90
  defaultToolbar: [],
82
91
  cols: [
83
- [
84
- {
85
- field: 'id',
86
- width: 80,
87
- title: '序号'
88
- },
92
+ [{
93
+ field: 'id',
94
+ width: 80,
95
+ title:'序号',type: 'numbers',
96
+ },
89
97
  {
90
- field: 'username',
98
+ field: 'staff',
91
99
  width: 100,
92
100
  title: '姓名'
93
101
  },
94
102
  {
95
- field: 'chance',
96
- width: 300,
97
- title: '商机名称',
103
+ field: 'teacher_name',
104
+ width: 100,
105
+ title: '教师姓名',
98
106
  },
99
107
  {
100
- field: 'company',
108
+ field: 'school',
101
109
  width: 100,
102
110
  title: '单位'
103
111
  },
104
112
  {
105
- field: 'dep',
113
+ field: 'department',
106
114
  width: 100,
107
115
  title: '部门'
108
116
  },
@@ -112,14 +120,15 @@
112
120
  title: '周次',
113
121
  },
114
122
  {
115
- field: 'plan',
123
+ field: 'content',
116
124
  width: 300,
117
125
  title: '计划内容',
118
126
  },
119
127
  {
120
- field: 'follow',
128
+ field: 'count',
121
129
  width: 100,
122
130
  title: '跟进',
131
+ templet: '#show_follow_show'
123
132
  },
124
133
  {
125
134
  field: 'rate',
@@ -127,13 +136,116 @@
127
136
  title: '完成率',
128
137
  },
129
138
  {
130
- field: 'updateTime',
131
- width: 150,
139
+ field: 'updated_at',
140
+ width: 190,
132
141
  title: '更新时间',
133
142
  sort: true,
134
- }
143
+ },
144
+ // {
145
+ // title: '操作',
146
+ // minWidth: 190,
147
+ // toolbar: '#currentShowWeekly',
148
+ // align: "center",
149
+ // fixed: 'right'
150
+ // }
135
151
  ]
136
152
  ],
137
153
  page: true
138
154
  });
155
+
156
+
157
+
158
+ table.on('toolbar(showWeeklyTable)', function (obj) {
159
+ if (obj.event === 'add') { // 监听添加操作
160
+ from_weekly = true;
161
+ var content = miniPage.getHrefContent('/educode_sales/operation_plans/new_week');
162
+ var openWH = miniPage.getOpenWidthHeight();
163
+ sindex = layer.open({
164
+ title: '添加计划',
165
+ type: 1,
166
+ shade: 0.2,
167
+ maxmin: true,
168
+ shadeClose: true,
169
+ area: [openWH[0] + 'px', openWH[1] + 'px'],
170
+ offset: [openWH[2] + 'px', openWH[3] + 'px'],
171
+ content: content,
172
+ success: function (layero, index) {
173
+ // 重新渲染弹层中的下拉选择框select
174
+ form.render('select');
175
+ }
176
+ });
177
+ $(window).on("resize", function () {
178
+ layer.full(sindex);
179
+ });
180
+ }
181
+ });
182
+ table.on('tool(showWeeklyTable)', function (obj) {
183
+ var data = obj.data;
184
+ id = data.id
185
+ if (obj.event === 'delete') {
186
+ layer.confirm('确定删除ID为' + id + " 的周计划", function (index) {
187
+ request.delete('educode_sales/operation_plans/' + id, {}, function (res) {
188
+ layer.close(index);
189
+ table.reload("showWeeklyTable")
190
+ })
191
+ });
192
+ } else if (obj.event === 'show') {
193
+ content = miniPage.getHrefContent('/educode_sales/operation_plans/show_week?id=' + id);
194
+ openWH = miniPage.getOpenWidthHeight();
195
+ index = layer.open({
196
+ title: '查看',
197
+ type: 1,
198
+ shade: 0.2,
199
+ maxmin: true,
200
+ shadeClose: true,
201
+ area: [openWH[0] + 'px', openWH[1] + 'px'],
202
+ offset: [openWH[2] + 'px', openWH[3] + 'px'],
203
+ content: content
204
+ });
205
+ $(window).on("resize", function () {
206
+ layer.full(index);
207
+ });
208
+ return false;
209
+ } else if (obj.event === 'edit') {
210
+ plan_id = id;
211
+ from_sales = true;
212
+ content = miniPage.getHrefContent('/educode_sales/operation_plans/edit_week?id=' + id);
213
+ openWH = miniPage.getOpenWidthHeight();
214
+ sindex = layer.open({
215
+ title: '编辑',
216
+ type: 1,
217
+ shade: 0.2,
218
+ maxmin: true,
219
+ shadeClose: true,
220
+ area: [openWH[0] + 'px', openWH[1] + 'px'],
221
+ offset: [openWH[2] + 'px', openWH[3] + 'px'],
222
+ content: content
223
+ });
224
+ $(window).on("resize", function () {
225
+ layer.full(sindex);
226
+ });
227
+ return false;
228
+ } else if (obj.event === 'show_follow_show') {
229
+ id = data.teacher_id
230
+ content = miniPage.getHrefContent('/educode_sales/teachers/show_follow?id=' + data.teacher_id);
231
+ openWH = miniPage.getOpenWidthHeight();
232
+ index = layer.open({
233
+ title: '教师列表/' + data.teacher_name + '的跟进记录',
234
+ type: 1,
235
+ shade: 0.2,
236
+ maxmin: true,
237
+ shadeClose: true,
238
+ area: [openWH[0] + 'px', openWH[1] + 'px'],
239
+ offset: [openWH[2] + 'px', openWH[3] + 'px'],
240
+ content: content
241
+ });
242
+ $(window).on("resize", function () {
243
+ layer.full(index);
244
+ });
245
+ }
246
+ });
247
+
248
+
249
+
250
+ })
139
251
  </script>
@@ -40,7 +40,7 @@
40
40
  {
41
41
  field: 'id',
42
42
  width: 80,
43
- title: '序号'
43
+ title:'序号',type: 'numbers',
44
44
  },
45
45
  {
46
46
  field: 'name',
@@ -49,32 +49,32 @@
49
49
  },
50
50
  {
51
51
  field: 'area_id',
52
- width: 300,
53
52
  title: '负责区域',
54
53
  },
55
54
  {
56
55
  field: 'businesses_count',
57
- width: 80,
56
+ width: 120,
58
57
  title: '商机'
59
58
  },
60
59
  {
61
60
  field: 'amount',
62
- width: 100,
61
+ width: 120,
63
62
  title: '中标(万)'
64
63
  },
65
64
  {
66
65
  field: 'return_mount',
67
- width: 100,
66
+ width: 120,
68
67
  title: '回款(万)',
69
68
  },
70
69
  {
71
70
  title: '操作',
72
- minWidth: 150,
71
+ width: 120,
73
72
  toolbar: '#currentTableBar',
74
73
  align: "center"
75
74
  }
76
75
  ]
77
76
  ],
77
+ limit: 20,
78
78
  page: true
79
79
  });
80
80
 
@@ -82,7 +82,7 @@
82
82
  {
83
83
  field: 'id',
84
84
  width: 80,
85
- title: '序号'
85
+ title:'序号',type: 'numbers',
86
86
  },
87
87
  {
88
88
  field: 'staff',
@@ -140,6 +140,7 @@
140
140
  }
141
141
  ]
142
142
  ],
143
+ limit: 20,
143
144
  page: true,
144
145
  });
145
146
 
@@ -83,7 +83,7 @@
83
83
  [{
84
84
  field: 'id',
85
85
  width: 60,
86
- title: '序号'
86
+ title:'序号',type: 'numbers',
87
87
  },
88
88
  {
89
89
  field: 'staff',
@@ -169,6 +169,7 @@
169
169
  });
170
170
  })
171
171
  },
172
+ limit: 20,
172
173
  page: true
173
174
  });
174
175
 
@@ -82,7 +82,7 @@
82
82
  {
83
83
  field: 'id',
84
84
  width: 80,
85
- title: '序号'
85
+ title:'序号',type: 'numbers',
86
86
  },
87
87
  {
88
88
  field: 'staff',
@@ -145,6 +145,7 @@
145
145
  }
146
146
  ]
147
147
  ],
148
+ limit: 20,
148
149
  page: true,
149
150
  skin: 'line'
150
151
  });
@@ -85,7 +85,7 @@
85
85
  {
86
86
  field: 'id',
87
87
  width: 60,
88
- title: '序号'
88
+ title:'序号',type: 'numbers',
89
89
  },
90
90
  {
91
91
  field: 'staff',
@@ -170,6 +170,7 @@
170
170
  });
171
171
  })
172
172
  },
173
+ limit: 20,
173
174
  page: true
174
175
  });
175
176
 
@@ -101,7 +101,7 @@
101
101
  {
102
102
  field: 'id',
103
103
  width: 80,
104
- title: '序号'
104
+ title:'序号',type: 'numbers',
105
105
  },
106
106
  {
107
107
  field: 'username',
@@ -169,8 +169,8 @@
169
169
  "rate": "100%",
170
170
  "updateTime": "2021-07-27",
171
171
  }],
172
- limits: [10, 15, 20, 25, 50, 100],
173
- limit: 15,
172
+
173
+
174
174
  page: true,
175
175
  skin: 'line'
176
176
  });
@@ -105,7 +105,7 @@
105
105
  {
106
106
  field: 'id',
107
107
  width: 80,
108
- title: '序号'
108
+ title:'序号',type: 'numbers',
109
109
  },
110
110
  {
111
111
  field: 'username',
@@ -173,8 +173,8 @@
173
173
  "rate": "100%",
174
174
  "updateTime": "2021-07-27",
175
175
  }],
176
- limits: [10, 15, 20, 25, 50, 100],
177
- limit: 15,
176
+
177
+
178
178
  page: true,
179
179
  skin: 'line'
180
180
  });
@@ -91,7 +91,7 @@
91
91
  [{
92
92
  field: 'id',
93
93
  width: 60,
94
- title: '序号'
94
+ title:'序号',type: 'numbers',
95
95
  },
96
96
  {
97
97
  field: 'staff',
@@ -92,7 +92,7 @@
92
92
  {
93
93
  field: 'id',
94
94
  width: 60,
95
- title: '序号'
95
+ title:'序号',type: 'numbers',
96
96
  },
97
97
  {
98
98
  field: 'staff',
@@ -114,7 +114,7 @@
114
114
  {
115
115
  field: 'id',
116
116
  width: 60,
117
- title: '序号'
117
+ title:'序号',type: 'numbers',
118
118
  },
119
119
  {
120
120
  field: 'staff',
@@ -93,7 +93,7 @@
93
93
  {
94
94
  field: 'id',
95
95
  width: 80,
96
- title: '序号'
96
+ title:'序号',type: 'numbers',
97
97
  },
98
98
  {
99
99
  field: 'username',
@@ -161,8 +161,8 @@
161
161
  "rate": "100%",
162
162
  "updateTime": "2021-07-27",
163
163
  }],
164
- limits: [10, 15, 20, 25, 50, 100],
165
- limit: 15,
164
+
165
+
166
166
  page: true,
167
167
  skin: 'line'
168
168
  });
@@ -88,7 +88,7 @@
88
88
  {
89
89
  field: 'id',
90
90
  width: 80,
91
- title: '序号'
91
+ title:'序号',type: 'numbers',
92
92
  },
93
93
  {
94
94
  field: 'username',
@@ -29,7 +29,7 @@
29
29
  cols: [
30
30
  [{
31
31
  field: 'id',
32
- title: 'ID',
32
+ title:'序号',type: 'numbers',
33
33
  width: 80
34
34
  }, {
35
35
  field: 'name',
@@ -47,6 +47,7 @@
47
47
  align: "center"
48
48
  }]
49
49
  ],
50
+ limit: 20,
50
51
  page: true
51
52
  })
52
53
 
@@ -152,7 +152,7 @@
152
152
  [{
153
153
  field: 'id',
154
154
  width: 60,
155
- title: '序号'
155
+ title:'序号',type: 'numbers',
156
156
  },
157
157
  {
158
158
  field: 'staff',
@@ -78,14 +78,14 @@
78
78
 
79
79
  table.render({
80
80
  elem: '#newWeeklyTable',
81
- url: '/educode_sales/plans/my_week',
82
- toolbar: '#newWeeklyToolbar',
81
+ url: '/educode_sales/sale_reports/' + "<%= @sale_report.id%>" + '/plans',
82
+ toolbar: '#newWeeklyToolbar',
83
83
  defaultToolbar: [],
84
84
  cols: [
85
85
  [{
86
86
  field: 'id',
87
87
  width: 60,
88
- title: '序号'
88
+ title:'序号',type: 'numbers',
89
89
  },
90
90
  {
91
91
  field: 'staff',
@@ -113,7 +113,7 @@
113
113
  {
114
114
  field: 'id',
115
115
  width: 60,
116
- title: '序号'
116
+ title:'序号',type: 'numbers',
117
117
  },
118
118
  {
119
119
  field: 'staff',
@@ -19,7 +19,7 @@
19
19
  cols: [
20
20
  [{
21
21
  field: 'id',
22
- title: 'ID'
22
+ title:'序号',type: 'numbers',
23
23
  }, {
24
24
  field: 'name',
25
25
  title: '姓名'
@@ -29,32 +29,37 @@
29
29
  cols: [
30
30
  [{
31
31
  field: 'id',
32
- title: 'ID',
32
+ title:'序号',type: 'numbers',
33
33
  width: 80
34
34
  }, {
35
35
  field: 'name',
36
- title: '姓名'
36
+ title: '姓名',
37
+ width: 100
37
38
  }, {
38
39
  field: 'area',
39
40
  title: '负责区域',
40
- width: 400,
41
41
  }, {
42
42
  field: 'business_a',
43
43
  title: 'A类商机',
44
- templet: "#business_a"
44
+ templet: "#business_a",
45
+ width: 120
45
46
  }, {
46
47
  field: 'business_b',
47
48
  title: 'B类商机',
48
- templet: "#business_b"
49
+ templet: "#business_b",
50
+ width: 120
49
51
  }, {
50
52
  field: 'goal',
51
- title: '中标金额(万)'
53
+ title: '中标金额(万)',
54
+ width: 120
52
55
  }, {
53
56
  field: 'return_money',
54
- title: '回款'
57
+ title: '回款(万)',
58
+ width: 120
55
59
  }
56
60
  ]
57
61
  ],
62
+ limit: 20,
58
63
  page: true
59
64
  });
60
65
  });
@@ -7,7 +7,7 @@ json.data do
7
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
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
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.stage_id in (?)", @step_ids).sum(:total_amount)
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").sum("educode_sales_follow_ups.return_money")
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").sum("educode_sales_businesses.return_money")
11
11
  json.a_clazz_id @a_clazz&.id
12
12
  json.b_clazz_id @b_clazz&.id
13
13
  end
@@ -35,12 +35,12 @@
35
35
  cols: [
36
36
  [{
37
37
  field: 'id',
38
- title: 'ID',
38
+ title:'序号',type: 'numbers',
39
39
  width: 80
40
40
  }, {
41
41
  field: 'name',
42
42
  title: '姓名',
43
- width: 150
43
+ width: 120
44
44
  }, {
45
45
  field: 'job_type',
46
46
  title: '岗位类型',
@@ -48,18 +48,20 @@
48
48
  }, {
49
49
  field: 'area',
50
50
  title: '负责区域',
51
- width: 400,
52
51
  }, {
53
52
  field: 'schools',
54
53
  title: '跟进学校',
55
- templet: "#school"
54
+ templet: "#school",
55
+ width: 120
56
56
  }, {
57
57
  field: 'departments',
58
58
  title: '跟进二级学院',
59
- templet: "#xschool"
59
+ templet: "#xschool",
60
+ width: 120
60
61
  },
61
62
  ]
62
63
  ],
64
+ limit: 20,
63
65
  page: true
64
66
  });
65
67
 
@@ -5,8 +5,9 @@ json.data do
5
5
  json.role d.role&.name
6
6
  json.job_type EducodeSales::Common.job_type_name[d.job_type]
7
7
  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') || 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']
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
11
  end
11
12
  end
12
13
 
@@ -11,7 +11,7 @@
11
11
  [
12
12
  {
13
13
  field: 'id',
14
- title: '序号'
14
+ title:'序号',type: 'numbers',
15
15
  },
16
16
  {
17
17
  field: 'name',
@@ -23,7 +23,6 @@
23
23
  }
24
24
  ]
25
25
  ],
26
- page: true
27
26
  });
28
27
  });
29
28
  </script>
@@ -13,7 +13,7 @@
13
13
  [
14
14
  {
15
15
  field: 'id',
16
- title: '序号'
16
+ title:'序号',type: 'numbers',
17
17
  },
18
18
  {
19
19
  field: 'name',
@@ -29,7 +29,6 @@
29
29
  }
30
30
  ]
31
31
  ],
32
- page: true
33
32
  });
34
33
  });
35
34
  </script>
@@ -9,5 +9,4 @@ json.data do
9
9
  end
10
10
  end
11
11
 
12
- json.code 0
13
- json.count @schools.total_count
12
+ json.code 0