educode_sales 0.9.48 → 0.9.50

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 (74) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/images/educode_sales/indexlogo.png +0 -0
  3. data/app/controllers/educode_sales/idea_recycles_controller.rb +100 -0
  4. data/app/controllers/educode_sales/ideas_controller.rb +130 -0
  5. data/app/controllers/educode_sales/logs_controller.rb +21 -0
  6. data/app/controllers/educode_sales/teacher_follows_controller.rb +82 -2
  7. data/app/controllers/educode_sales/teachers_controller.rb +18 -3
  8. data/app/models/educode_sales/common.rb +2 -0
  9. data/app/models/educode_sales/idea.rb +87 -0
  10. data/app/models/educode_sales/idea_history.rb +8 -0
  11. data/app/views/educode_sales/idea_recycles/activities.json.jbuilder +9 -0
  12. data/app/views/educode_sales/idea_recycles/add_courses.html.erb +133 -0
  13. data/app/views/educode_sales/idea_recycles/add_event.html.erb +49 -0
  14. data/app/views/educode_sales/idea_recycles/add_keys.html.erb +334 -0
  15. data/app/views/educode_sales/idea_recycles/course_list.json.jbuilder +23 -0
  16. data/app/views/educode_sales/idea_recycles/course_subject.json.jbuilder +10 -0
  17. data/app/views/educode_sales/idea_recycles/daily_paper.html.erb +68 -0
  18. data/app/views/educode_sales/idea_recycles/detail.html.erb +144 -0
  19. data/app/views/educode_sales/idea_recycles/edit.html.erb +193 -0
  20. data/app/views/educode_sales/idea_recycles/edit_follow_record.html.erb +87 -0
  21. data/app/views/educode_sales/idea_recycles/history.html.erb +41 -0
  22. data/app/views/educode_sales/idea_recycles/import.html.erb +41 -0
  23. data/app/views/educode_sales/idea_recycles/index.html.erb +321 -0
  24. data/app/views/educode_sales/idea_recycles/index.json.jbuilder +16 -0
  25. data/app/views/educode_sales/idea_recycles/new.html.erb +204 -0
  26. data/app/views/educode_sales/idea_recycles/new_follow_record.html.erb +93 -0
  27. data/app/views/educode_sales/idea_recycles/search_new.html.erb +138 -0
  28. data/app/views/educode_sales/idea_recycles/show_class.html.erb +107 -0
  29. data/app/views/educode_sales/idea_recycles/show_follow.html.erb +504 -0
  30. data/app/views/educode_sales/idea_recycles/show_follow.json.jbuilder +23 -0
  31. data/app/views/educode_sales/idea_recycles/show_follow_record.html.erb +36 -0
  32. data/app/views/educode_sales/idea_recycles/unfinish_plans.json.jbuilder +14 -0
  33. data/app/views/educode_sales/ideas/activities.json.jbuilder +9 -0
  34. data/app/views/educode_sales/ideas/add_courses.html.erb +133 -0
  35. data/app/views/educode_sales/ideas/add_event.html.erb +49 -0
  36. data/app/views/educode_sales/ideas/add_keys.html.erb +334 -0
  37. data/app/views/educode_sales/ideas/course_list.json.jbuilder +23 -0
  38. data/app/views/educode_sales/ideas/course_subject.json.jbuilder +10 -0
  39. data/app/views/educode_sales/ideas/daily_paper.html.erb +68 -0
  40. data/app/views/educode_sales/ideas/detail.html.erb +144 -0
  41. data/app/views/educode_sales/ideas/edit.html.erb +182 -0
  42. data/app/views/educode_sales/ideas/edit_follow_record.html.erb +87 -0
  43. data/app/views/educode_sales/ideas/history.html.erb +41 -0
  44. data/app/views/educode_sales/ideas/import.html.erb +41 -0
  45. data/app/views/educode_sales/ideas/index.html.erb +335 -0
  46. data/app/views/educode_sales/ideas/index.json.jbuilder +16 -0
  47. data/app/views/educode_sales/ideas/new.html.erb +182 -0
  48. data/app/views/educode_sales/ideas/new_follow_record.html.erb +93 -0
  49. data/app/views/educode_sales/ideas/search_new.html.erb +138 -0
  50. data/app/views/educode_sales/ideas/show_class.html.erb +107 -0
  51. data/app/views/educode_sales/ideas/show_follow.html.erb +504 -0
  52. data/app/views/educode_sales/ideas/show_follow.json.jbuilder +23 -0
  53. data/app/views/educode_sales/ideas/show_follow_record.html.erb +36 -0
  54. data/app/views/educode_sales/ideas/unfinish_plans.json.jbuilder +14 -0
  55. data/app/views/educode_sales/logs/index.html.erb +48 -0
  56. data/app/views/educode_sales/logs/index.json.jbuilder +16 -0
  57. data/app/views/educode_sales/staffs/edit.html.erb +0 -1
  58. data/app/views/educode_sales/teacher_follows/index.json.jbuilder +20 -0
  59. data/app/views/educode_sales/teachers/_follows.html.erb +256 -0
  60. data/app/views/educode_sales/teachers/_index.html.erb +677 -0
  61. data/app/views/educode_sales/teachers/daily_paper.html.erb +22 -22
  62. data/app/views/educode_sales/teachers/index.html.erb +11 -651
  63. data/app/views/educode_sales/teachers/index.json.jbuilder +10 -0
  64. data/app/views/educode_sales/teachers/new.html.erb +9 -3
  65. data/app/views/educode_sales/teachers/new_follow_record.html.erb +6 -0
  66. data/app/views/layouts/educode_sales/application.html.erb +40 -8
  67. data/config/routes.rb +19 -0
  68. data/db/migrate/20230227061043_create_educode_sales_ideas.rb +28 -0
  69. data/db/migrate/20230227070206_change_to_educode_sales_ideas.rb +5 -0
  70. data/db/migrate/20230227125936_add_follow_at_to_teachers.rb +6 -0
  71. data/db/migrate/20230228063555_create_educode_sales_idea_histories.rb +10 -0
  72. data/db/migrate/20230302074324_change_manager_for_ideas.rb +6 -0
  73. data/lib/educode_sales/version.rb +1 -1
  74. metadata +66 -6
@@ -0,0 +1,504 @@
1
+ <script type="text/html" id="toolbarDemo_follow">
2
+ <div class="layui-btn-container">
3
+ <span class="table-label">跟进记录</span>
4
+ <% if can? :create, EducodeSales::TeacherFollow %>
5
+ <button class="layui-btn layui-btn-normal layui-btn-sm data-add-btn pull-right" lay-event="add"> 添加跟进记录</button>
6
+ <% end %>
7
+ </div>
8
+ </script>
9
+ <div class="z-index">
10
+ <table class="layui-hide" id="sale_plan_follow_table" lay-filter="sale_plan_follow_table"></table>
11
+ </div>
12
+
13
+ <script type="text/html" id="currentTableBar_follow">
14
+ <% if can? :read, EducodeSales::TeacherFollow %>
15
+ <a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="show">查看</a>
16
+ <% end %>
17
+ {{# if(d.is_latest){ }}
18
+ <% if can? :update, EducodeSales::TeacherFollow %>
19
+ <a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="edit">编辑</a>
20
+ <% end %>
21
+ <% if can? :destroy, EducodeSales::TeacherFollow %>
22
+ <a class="layui-btn layui-btn-xs layui-btn-danger data-count-delete" lay-event="delete">删除</a>
23
+ <% end %>
24
+ {{# } }}
25
+ </script>
26
+
27
+
28
+ <script>
29
+ layui.use(['form', 'table', 'miniPage', 'element'], function () {
30
+ var $ = layui.jquery,
31
+ form = layui.form,
32
+ request =layui.request,
33
+ miniPage = layui.miniPage;
34
+
35
+ table = layui.table;
36
+ table.render({
37
+ elem: '#sale_plan_follow_table',
38
+ url: '/missions/teachers/show_follow?id=' + parent.id ,
39
+ toolbar: '#toolbarDemo_follow',
40
+ defaultToolbar: ['filter'],
41
+ cols: [
42
+ [
43
+ {
44
+ field: 'id',
45
+ width: 60,
46
+ title:'序号',type: 'numbers',
47
+ },
48
+ {
49
+ field: 'time',
50
+ width: 120,
51
+ title: '时间',
52
+ sort: true
53
+ },
54
+ {
55
+ field: 'teacher_attitude',
56
+ width: 100,
57
+ title: '教师态度',
58
+ },
59
+ {
60
+ field: 'contact',
61
+ width: 100,
62
+ title: '跟进手段',
63
+ // templet: '#showchance'
64
+ },
65
+ {
66
+ field: 'course_plan',
67
+ width: 100,
68
+ title: '开课计划',
69
+ // templet: '#add_keys'
70
+ },
71
+ {
72
+ field: 'course_build',
73
+ width: 100,
74
+ title: '课堂建设',
75
+ },
76
+ {
77
+ field: 'content',
78
+ width: 200,
79
+ title: '跟进小结',
80
+ },
81
+ {
82
+ field: 'students_count',
83
+ width: 120,
84
+ title: '当前学生',
85
+ },
86
+ {
87
+ field: 'courses_count',
88
+ width: 100,
89
+ title: '课堂',
90
+ },
91
+ {
92
+ field: 'evaluates_count',
93
+ width: 100,
94
+ title: '评测次数',
95
+ },
96
+ {
97
+ field: 'course_shixuns_count',
98
+ width: 100,
99
+ title: '使用项目',
100
+ },
101
+ {
102
+ field: 'shixuns_count',
103
+ width: 100,
104
+ title: '创建项目',
105
+ },
106
+ {
107
+ field: 'staff',
108
+ width: 100,
109
+ title: '跟进人',
110
+ },
111
+ {
112
+ title: '操作',
113
+ minWidth: 190,
114
+ toolbar: '#currentTableBar_follow',
115
+ align: "center",
116
+ fixed: 'right'
117
+ }
118
+ ]
119
+ ],
120
+
121
+
122
+ page: true,
123
+ skin: 'line'
124
+ });
125
+
126
+
127
+ /**
128
+ * toolbar事件监听
129
+ */
130
+ table.on('toolbar(sale_plan_follow_table)', function (obj) {
131
+ if (obj.event === 'add') { // 监听添加操作
132
+ var content = miniPage.getHrefContent('/missions/teachers/new_follow_record?id=' +parent.id);
133
+ var openWH = miniPage.getOpenWidthHeight();
134
+ sale_plan_index = layer.open({
135
+ title: '添加教师跟进记录',
136
+ type: 1,
137
+ shade: 0.2,
138
+ maxmin: true,
139
+ shadeClose: true,
140
+ area: [openWH[0] + 'px', openWH[1] + 'px'],
141
+ offset: [openWH[2] + 'px', openWH[3] + 'px'],
142
+ content: content,
143
+ success: function (layero, index) {
144
+ // 重新渲染弹层中的下拉选择框select
145
+ form.render('select');
146
+ }
147
+ });
148
+ $(window).on("resize", function () {
149
+ layer.full(index);
150
+ });
151
+ }
152
+ });
153
+
154
+ table.on('tool(sale_plan_follow_table)', function (obj) {
155
+ var data = obj.data;
156
+ var id = data.id
157
+ if (obj.event === 'delete') {
158
+ layer.confirm('确定删除ID为' + data.id + "的跟进记录", function (index) {
159
+ request.authDelete("missions/teacher_follows/" + data.id, {}, function() {
160
+ obj.del();
161
+ layer.close(index);
162
+ parent.table.reload('sale_plan_follow_table')
163
+ parent.table.reload('teachers_table')
164
+ parent.table.reload('weekPlanTable1')
165
+ parent.table.reload('monthPlanTable')
166
+ })
167
+ });
168
+ } else if (obj.event === 'show') { // 监听添加操作
169
+ var content = miniPage.getHrefContent('/missions/teachers/show_follow_record?id=' + id);
170
+ var openWH = miniPage.getOpenWidthHeight();
171
+ sale_plan_index1 = layer.open({
172
+ title: '查看教师跟进记录',
173
+ type: 1,
174
+ shade: 0.2,
175
+ maxmin: true,
176
+ shadeClose: true,
177
+ area: [openWH[0] + 'px', openWH[1] + 'px'],
178
+ offset: [openWH[2] + 'px', openWH[3] + 'px'],
179
+ content: content,
180
+ success: function (layero, index) {
181
+ // 重新渲染弹层中的下拉选择框select
182
+ form.render('select');
183
+ }
184
+ });
185
+ $(window).on("resize", function () {
186
+ layer.full(index);
187
+ });
188
+ } else if (obj.event === 'edit') {
189
+ content = miniPage.getHrefContent('/missions/teachers/edit_follow_record?id='+ obj.data.id);
190
+ openWH = miniPage.getOpenWidthHeight();
191
+ edit_index1 = layer.open({
192
+ title: '编辑教师跟进记录',
193
+ type: 1,
194
+ shade: 0.2,
195
+ maxmin: true,
196
+ shadeClose: true,
197
+ area: [openWH[0] + 'px', openWH[1] + 'px'],
198
+ offset: [openWH[2] + 'px', openWH[3] + 'px'],
199
+ content: content,
200
+ success: function (layero, index) {
201
+ // 重新渲染弹层中的下拉选择框select
202
+ form.render('select');
203
+ }
204
+ });
205
+ $(window).on("resize", function () {
206
+ layer.full(index);
207
+ });
208
+ } else if (obj.event === 'add_keys') { // 监听添加操作
209
+ content = miniPage.getHrefContent('/missions/businesses/add_keys');
210
+ openWH = miniPage.getOpenWidthHeight();
211
+ index = layer.open({
212
+ title: '关键人',
213
+ type: 1,
214
+ shade: 0.2,
215
+ maxmin: true,
216
+ shadeClose: true,
217
+ area: [openWH[0] + 'px', openWH[1] + 'px'],
218
+ offset: [openWH[2] + 'px', openWH[3] + 'px'],
219
+ content: content,
220
+ success: function (layero, index) {
221
+ // 重新渲染弹层中的下拉选择框select
222
+ form.render('select');
223
+ }
224
+ });
225
+ $(window).on("resize", function () {
226
+ layer.full(index);
227
+ });
228
+ } else if (obj.event === 'edit_plan') {
229
+ content = miniPage.getHrefContent('/missions/businesses/edit_plan');
230
+ openWH = miniPage.getOpenWidthHeight();
231
+ index = layer.open({
232
+ title: '回款计划',
233
+ type: 1,
234
+ shade: 0.2,
235
+ maxmin: true,
236
+ shadeClose: true,
237
+ area: [openWH[0] + 'px', openWH[1] + 'px'],
238
+ offset: [openWH[2] + 'px', openWH[3] + 'px'],
239
+ content: content,
240
+ success: function (layero, index) {
241
+ // 重新渲染弹层中的下拉选择框select
242
+ // form.render('select');
243
+ }
244
+ });
245
+ $(window).on("resize", function () {
246
+ layer.full(index);
247
+ });
248
+ }
249
+ });
250
+
251
+ });
252
+ </script>
253
+
254
+
255
+
256
+
257
+
258
+
259
+
260
+ <!--计划回款计划列表-->
261
+ <script type="text/html" id="unfinish_toolbar">
262
+ <div class="layui-btn-container">
263
+ <span class="table-label">跟进计划列表</span>
264
+ <!-- <button class="layui-btn layui-btn-normal layui-btn-sm data-add-btn pull-right" lay-event="addMonthPlan"> 添加月计划-->
265
+ <!-- </button>-->
266
+ <!-- <button class="layui-btn layui-btn-normal layui-btn-sm data-add-btn pull-right" lay-event="addWeekPlan"> 添加周计划-->
267
+ <!-- </button>-->
268
+ </div>
269
+ </script>
270
+
271
+ <table class="layui-hide" id="unfinish_table" lay-filter="unfinish_table"></table>
272
+
273
+ <script type="text/html" id="currentTableBar1234">
274
+ <% if can? :read, EducodeSales::OperationPlan %>
275
+ <a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="show">查看</a>
276
+ <% end %>
277
+ <% if can? :update, EducodeSales::OperationPlan %>
278
+ <a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="edit">编辑</a>
279
+ <% end %>
280
+ <% if can? :destroy, EducodeSales::OperationPlan %>
281
+ <a class="layui-btn layui-btn-xs layui-btn-danger data-count-delete" lay-event="delete">删除</a>
282
+ <% end %>
283
+ </script>
284
+
285
+
286
+ <script>
287
+ layui.use(['form', 'table', 'miniPage', 'element'], function () {
288
+ var $ = layui.jquery,
289
+ form = layui.form,
290
+ table = layui.table,
291
+ request = layui.request,
292
+ miniPage = layui.miniPage;
293
+
294
+ table.render({
295
+ elem: '#unfinish_table',
296
+ url: '/missions/teachers/' + parent.id + "/unfinish_plans",
297
+ toolbar: '#unfinish_toolbar',
298
+ defaultToolbar: [],
299
+ cols: [
300
+ [
301
+ {
302
+ field: 'id',
303
+ width: 100,
304
+ title:'序号',type: 'numbers',
305
+ },
306
+ {
307
+ field: 'staff',
308
+ width: 100,
309
+ title: '姓名'
310
+ },
311
+ {
312
+ field: 'month',
313
+ width: 100,
314
+ title: '月份',
315
+ },
316
+ {
317
+ field: 'weekly',
318
+ width: 100,
319
+ title: '周次'
320
+ },
321
+ {
322
+ field: 'content',
323
+ width: 300,
324
+ title: '计划内容'
325
+ },
326
+ {
327
+ field: 'finish_rate',
328
+ width: 100,
329
+ title: '完成率',
330
+ },
331
+ {
332
+ field: 'updated_at',
333
+ width: 190,
334
+ title: '更新时间',
335
+ },
336
+ {
337
+ title: '操作',
338
+ minWidth: 190,
339
+ toolbar: '#currentTableBar1234',
340
+ align: "center"
341
+ }
342
+ ]
343
+ ],
344
+
345
+
346
+ page: true,
347
+ skin: 'line'
348
+ });
349
+ // 监听搜索操作
350
+ form.on('submit(data-search-btn)', function (data) {
351
+ var result = JSON.stringify(data.field);
352
+ layer.alert(result, {
353
+ title: '最终的搜索信息'
354
+ });
355
+
356
+ //执行搜索重载
357
+ table.reload('currentTableId', {
358
+ page: {
359
+ curr: 1
360
+ },
361
+ where: {
362
+ searchParams: result
363
+ }
364
+ }, 'data');
365
+
366
+ return false;
367
+ });
368
+
369
+ /**
370
+ * toolbar事件监听
371
+ */
372
+ table.on('toolbar(unfinish_table)', function (obj) {
373
+ if (obj.event === 'addWeekPlan') { // 监听添加操作
374
+
375
+ var content = miniPage.getHrefContent('/missions/operation_plans/new_week');
376
+ var openWH = miniPage.getOpenWidthHeight();
377
+ var index = layer.open({
378
+ title: '添加周计划',
379
+ type: 1,
380
+ shade: 0.2,
381
+ maxmin: true,
382
+ shadeClose: true,
383
+ area: [openWH[0] + 'px', openWH[1] + 'px'],
384
+ offset: [openWH[2] + 'px', openWH[3] + 'px'],
385
+ content: content,
386
+ success: function (layero, index) {
387
+ // 重新渲染弹层中的下拉选择框select
388
+ form.render('select');
389
+ }
390
+ });
391
+ $(window).on("resize", function () {
392
+ layer.full(index);
393
+ });
394
+ } else if (obj.event === 'addMonthPlan') { // 监听添加操作
395
+ var content = miniPage.getHrefContent('/missions/operation_plans/new_month')
396
+ var openWH = miniPage.getOpenWidthHeight();
397
+ var index = layer.open({
398
+ title: '添加月计划',
399
+ type: 1,
400
+ shade: 0.2,
401
+ maxmin: true,
402
+ shadeClose: true,
403
+ area: [openWH[0] + 'px', openWH[1] + 'px'],
404
+ offset: [openWH[2] + 'px', openWH[3] + 'px'],
405
+ content: content,
406
+ success: function (layero, index) {
407
+ // 重新渲染弹层中的下拉选择框select
408
+ form.render('select');
409
+ }
410
+ });
411
+ $(window).on("resize", function () {
412
+ layer.full(index);
413
+ });
414
+ } else if (obj.event === 'delete') { // 监听删除操作
415
+ var checkStatus = table.checkStatus('currentTableId'),
416
+ data = checkStatus.data;
417
+ layer.alert(JSON.stringify(data));
418
+ }
419
+ });
420
+
421
+ //监听表格复选框选择
422
+ table.on('checkbox(unfinish_table)', function (obj) {
423
+ console.log(obj)
424
+ });
425
+
426
+ table.on('tool(unfinish_table)', function (obj) {
427
+ var data = obj.data;
428
+ var id = data.id
429
+ if (obj.event === 'delete') {
430
+ layer.confirm('确定删除ID为' + data.id + "的计划", function (index) {
431
+ request.authDelete("missions/operation_plans/" + data.id, {}, function() {
432
+ obj.del();
433
+ layer.close(index);
434
+ })
435
+
436
+ });
437
+ } else if (obj.event === 'show') {
438
+ content = miniPage.getHrefContent('/missions/operation_plans/show_week?id=' + data.id);
439
+ openWH = miniPage.getOpenWidthHeight();
440
+ index = layer.open({
441
+ title: '查看计划',
442
+ type: 1,
443
+ shade: 0.2,
444
+ maxmin: true,
445
+ shadeClose: true,
446
+ area: [openWH[0] + 'px', openWH[1] + 'px'],
447
+ offset: [openWH[2] + 'px', openWH[3] + 'px'],
448
+ content: content
449
+ });
450
+ $(window).on("resize", function () {
451
+ layer.full(index);
452
+ });
453
+ return false;
454
+ } else if (obj.event === 'edit') {
455
+ content = miniPage.getHrefContent('/missions/operation_plans/edit_week?id=' + data.id);
456
+ openWH = miniPage.getOpenWidthHeight();
457
+ index10 = layer.open({
458
+ title: '编辑',
459
+ type: 1,
460
+ shade: 0.2,
461
+ maxmin: true,
462
+ shadeClose: true,
463
+ area: [openWH[0] + 'px', openWH[1] + 'px'],
464
+ offset: [openWH[2] + 'px', openWH[3] + 'px'],
465
+ content: content,
466
+ success: function (layero, index) {
467
+ // 重新渲染弹层中的下拉选择框select
468
+ form.render('select');
469
+ },
470
+ });
471
+ $(window).on("resize", function () {
472
+ layer.full(sindex);
473
+ });
474
+ return false;
475
+ } else if (obj.event === 'show_follow') {
476
+ content = miniPage.getHrefContent('/missions/teachers/show_follow');
477
+ openWH = miniPage.getOpenWidthHeight();
478
+ index = layer.open({
479
+ title: 'xxxx/跟进记录',
480
+ type: 1,
481
+ shade: 0.2,
482
+ maxmin: true,
483
+ shadeClose: true,
484
+ area: [openWH[0] + 'px', openWH[1] + 'px'],
485
+ offset: [openWH[2] + 'px', openWH[3] + 'px'],
486
+ content: content,
487
+ success: function (layero, index) {
488
+ // 重新渲染弹层中的下拉选择框select
489
+ // form.render('select');
490
+ }
491
+ });
492
+ $(window).on("resize", function () {
493
+ layer.full(index);
494
+ });
495
+ }
496
+ });
497
+
498
+ });
499
+ </script>
500
+ <style>
501
+ .z-index .layui-table-tool{
502
+ z-index: 10000; !important;
503
+ }
504
+ </style>
@@ -0,0 +1,23 @@
1
+ json.data do
2
+ json.array! @follow_ups do |d|
3
+ json.id d.id
4
+ json.created_at d.created_at.to_s
5
+ json.time d.created_at.to_s(:date)
6
+ json.teacher_attitude EducodeSales::Common.find_by(id: d.attitude_id).name
7
+ json.course_plan EducodeSales::Common.find_by(id: d.course_plan_id).name
8
+ json.course_build EducodeSales::Common.find_by(id: d.course_build_id).name
9
+ json.contact EducodeSales::Common.find_by(id: d.follow_id).name
10
+ json.staff d.staff.user.real_name
11
+ json.students_count d.teacher&.students_count
12
+ # json.courses_count Course.joins(:course_members).where(course_members: {user_id: d.teacher&.user_id}).distinct("course_id").count
13
+ json.courses_count Course.joins(:course_members).where(course_members: {user_id: d.teacher&.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
14
+ json.evaluates_count d.evaluates_count
15
+ json.course_shixuns_count d.course_shixuns_count
16
+ json.shixuns_count d.shixuns_count
17
+ json.is_latest d.id == @latest.id
18
+ json.content d.description
19
+ end
20
+ end
21
+
22
+ json.code 0
23
+ json.count @follow_ups.total_count
@@ -0,0 +1,36 @@
1
+ <form class="layui-form form-value" action="">
2
+ <div class="layui-form-item" style="padding: 25px">
3
+ <div class="layui-inline">
4
+ <label class="layui-form-label">教师态度:</label>
5
+ <div class="layui-input-inline">
6
+ <span><%= EducodeSales::Common.find_by(id: @follow_up.attitude_id).name %></span>
7
+ </div>
8
+ </div>
9
+ <div class="layui-inline">
10
+ <label class="layui-form-label">开课计划:</label>
11
+ <div class="layui-input-inline">
12
+ <span><%= EducodeSales::Common.find_by(id: @follow_up.course_plan_id).name %></span>
13
+ </div>
14
+ </div>
15
+ <br>
16
+ <div class="layui-inline">
17
+ <label class="layui-form-label">课堂建设:</label>
18
+ <div class="layui-input-inline">
19
+ <span><%= EducodeSales::Common.find_by(id: @follow_up.course_build_id).name %></span>
20
+ </div>
21
+ </div>
22
+ <div class="layui-inline">
23
+ <label class="layui-form-label">跟进手段:</label>
24
+ <div class="layui-input-inline">
25
+ <span><%= EducodeSales::Common.find_by(id: @follow_up.follow_id).name %></span>
26
+ </div>
27
+ </div>
28
+ <br>
29
+ <div class="layui-form-item layui-form-text">
30
+ <label class="layui-form-label">跟进小结:</label>
31
+ <div class="layui-input-block">
32
+ <span><%= @follow_up.description%></span>
33
+ </div>
34
+ </div>
35
+ </div>
36
+ </form>
@@ -0,0 +1,14 @@
1
+ json.data do
2
+ json.array! @plans do |d|
3
+ json.id d.id
4
+ json.staff d.staff.user.real_name
5
+ json.month d.month.strftime("%Y-%m")
6
+ json.weekly d.weekly
7
+ json.content d.content.truncate(30)
8
+ json.finish_rate "#{d.finish_rate}%"
9
+ json.updated_at d.updated_at.to_s
10
+ end
11
+ end
12
+
13
+ json.code 0
14
+ json.count @plans.total_count
@@ -0,0 +1,48 @@
1
+ <div class="section">
2
+ <h4><span>操作日志</span></h4>
3
+ <hr>
4
+ <table class="layui-hide" id="logs_table" lay-filter="logs_table"></table>
5
+ </div>
6
+
7
+ <script>
8
+ layui.use(['form', 'table'], function () {
9
+ var $ = layui.jquery, form = layui.form, table = layui.table;
10
+
11
+ table.render({
12
+ elem: '#logs_table',
13
+ url: '/missions/logs',
14
+ defaultToolbar: [],
15
+ totalRow:true,
16
+ cols: [
17
+ [{
18
+ field: 'id',
19
+ title:'序号',
20
+ width: 80
21
+ }, {
22
+ field: 'source',
23
+ title: '操作对象',
24
+ width: 120
25
+ }, {
26
+ field: 'action_name',
27
+ title: '动作',
28
+ width: 120
29
+ }, {
30
+ field: 'user',
31
+ title: '操作用户',
32
+ width: 120
33
+ }, {
34
+ field: 'params',
35
+ title: '参数',
36
+ idth: 300
37
+ }, {
38
+ field: 'created_at',
39
+ title: '操作时间',
40
+ sort: true,
41
+ width: 180
42
+ }]
43
+ ],
44
+ limit: 20
45
+ });
46
+
47
+ });
48
+ </script>
@@ -0,0 +1,16 @@
1
+ json.data do
2
+ id = 0
3
+ json.array! @logs do |d|
4
+ id = id + 1
5
+ json.id id
6
+ json.clazz "人员编辑"
7
+ json.action_name d.action_name
8
+ json.source d.impressionable&.user&.real_name
9
+ json.params d.params.to_json
10
+ json.user EducodeSales::Staff.find_by(id: d.user_id)&.user&.real_name
11
+ json.created_at d.created_at.to_s
12
+ end
13
+ end
14
+
15
+ json.code 0
16
+ json.count @logs.total_count
@@ -90,7 +90,6 @@
90
90
  </div>
91
91
  </form>
92
92
 
93
- </div>
94
93
  </div>
95
94
  <script type="text/html" id="edit_currentTableBar">
96
95
  <a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="edit">保存</a>
@@ -0,0 +1,20 @@
1
+ json.data do
2
+ json.array! @follow_ups do |d|
3
+ json.id d.id
4
+ json.staff_manage @staff_manages[d.teacher&.department&.school&.province]&.join(",")
5
+ json.attitude d.attitude.name
6
+ json.staff d.staff&.user.real_name
7
+ json.description d.description
8
+ json.advise d.advise || ''
9
+ json.school d.teacher&.department&.school&.name || ''
10
+ json.school_id d.teacher&.department&.school&.id
11
+ json.created_at d.created_at.to_s
12
+ json.teacher_id d.teacher_id
13
+ json.teacher d.teacher&.name || ''
14
+ json.login d.teacher&.user&.login || ''
15
+ json.mobile d.teacher&.mobile || ''
16
+ end
17
+ end
18
+
19
+ json.code 0
20
+ json.count @follow_ups.total_count