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
@@ -1,654 +1,14 @@
1
- <div style="margin: 10px 10px 10px 10px">
2
- <form class="layui-form layui-form-pane" lay-filter="search_teachers">
3
- <div class="layui-form-item">
4
- <div class="layui-inline">
5
- <label class="layui-form-label">教师姓名</label>
6
- <div class="layui-input-inline">
7
- <input type="text" name="name" class="layui-input">
8
- </div>
9
- </div>
10
- <div class="layui-inline">
11
- <label class="layui-form-label">单位</label>
12
- <div class="layui-input-inline">
13
- <input type="text" name="school" class="layui-input">
14
- </div>
15
- </div>
16
- <div class="layui-inline">
17
- <label class="layui-form-label">职称</label>
18
- <div class="layui-input-inline">
19
- <%= select_tag "professional_title", options_for_select(['教授', '研究员', '副教授', '副研究员', '讲师', '助理研究员', '助理教授'], @person&.professional_title), { include_blank: true } %>
20
- </div>
21
- </div>
22
- <div class="layui-inline show_item" style="display:none;">
23
- <label class="layui-form-label">导流来源</label>
24
- <div class="layui-input-inline">
25
- <%= select_tag "teacher_source", options_for_select(EducodeSales::Common.where(clazz: 'teacher_source').pluck(:name, :id)), { include_blank: true } %>
26
- </div>
27
- </div>
28
- <div class="layui-inline show_item" style="display:none;">
29
- <label class="layui-form-label">态度</label>
30
- <div class="layui-input-inline">
31
-
32
- <%= select_tag "attitude", options_for_select(EducodeSales::Common.where(clazz: 'teacher_attitude').pluck(:name, :id)), { include_blank: true } %>
33
- </div>
34
- </div>
35
- <div class="layui-inline show_item" style="display:none;">
36
- <label class="layui-form-label">注册时间</label>
37
- <div class="layui-input-inline">
38
- <input type="text" class="layui-input" id="time" placeholder="请选择时间" autocomplete="off" name="regist_at">
39
- </div>
40
- </div>
41
- <div class="layui-inline show_item" style="display:none;">
42
- <label class="layui-form-label">注册状态</label>
43
- <div class="layui-input-inline">
44
- <%= select_tag "status", options_for_select([["已注册","1"],["未注册","0"]]), { include_blank: true } %>
45
- </div>
46
- </div>
47
- <div class="layui-inline show_item" style="display:none;">
48
- <label class="layui-form-label">区域</label>
49
- <div class="layui-input-inline">
50
- <%= select_tag "area", options_for_select(EducodeSales::Common.where(clazz: 'area').pluck(:name, :id)), { include_blank: true } %>
51
- </div>
52
- </div>
53
- <div class="layui-inline show_item" style="display:none;">
54
- <label class="layui-form-label">起止时间</label>
55
- <div class="layui-input-inline">
56
- <input type="text" class="layui-input" id="date" name="date" autocomplete="off" placeholder=" - ">
57
- </div>
58
- </div>
59
- <div class="layui-inline show_item" style="display:none;">
60
- <label class="layui-form-label">教研助理</label>
61
- <div class="layui-input-inline">
62
- <%= select_tag "assist", options_for_select(@staffs, params[:assist]), { 'lay-filter': 'assist', include_blank: true } %>
63
- </div>
64
- </div>
65
-
66
- <div class="layui-inline">
67
- <button type="reset" class="layui-btn layui-btn-primary" lay-submit lay-filter="reset_business_search">重置
68
- </button>
69
- <button type="submit" class="layui-btn layui-btn-primary" lay-submit lay-filter="search_teachers">搜 索
70
- </button>
71
- <a style="padding-left: 20px;color: #0000FF" href="javascript:;" type="submit" class="" lay-submit lay-filter="show_hide">高级搜索
72
- </a>
73
- </div>
1
+ <div class="layui-tab" lay-filter="operation_tab">
2
+ <ul class="layui-tab-title">
3
+ <li class="layui-this follows_li">跟进动态</li>
4
+ <li class="businesses_list_li" >教师列表</li>
5
+ </ul>
6
+ <div class="layui-tab-content">
7
+ <div class="layui-tab-item layui-show">
8
+ <%= render 'follows' %>
9
+ </div>
10
+ <div class="layui-tab-item follows_div">
11
+ <%= render 'index' %>
74
12
  </div>
75
- </form>
76
- </div>
77
-
78
- <script type="text/html" id="toolbarDemo">
79
- <div class="layui-btn-container">
80
- <span class="table-label">教师列表</span>
81
- <% if can? :create, EducodeSales::Teacher %>
82
- <button class="layui-btn layui-btn-normal layui-btn-sm data-add-btn pull-right" lay-event="import">导入数据</button>
83
- <button class="layui-btn layui-btn-normal layui-btn-sm data-add-btn pull-right" lay-event="add">添加老师</button>
84
- <% end %>
85
- <!-- <div class="layui-btn-container">
86
- <span class="table-label">跟进动态</span>
87
- <a class="layui-btn layui-btn-normal layui-btn-sm" style="margin-left: 20px;" lay-event="report_day">日报</a>
88
- </div> -->
89
- <!-- <button class="layui-btn layui-btn-normal layui-btn-sm data-add-btn pull-right" lay-event="search_new"> 搜索添加 -->
90
- </button>
91
13
  </div>
92
- </script>
93
- <div class="">
94
- <table class="layui-hide" id="teachers_table" style="min-height: 300px;" lay-filter="teachers_table"></table>
95
14
  </div>
96
- <script type="text/html" id="currentTableBar">
97
- <% if can? :create, EducodeSales::TeacherFollow %>
98
- <a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="add_event">添加跟进记录</a>
99
- <% end %>
100
- <% if @more %>
101
- <a class="layui-btn-xs data-count-edit more-btn" data-name={{d.name}} data-id={{d.id}}>更多<i class="layui-icon layui-icon-down layui-nav-more"></i></a>
102
- <% end %>
103
- </script>
104
- <script type="text/html" id="name">
105
- {{# if (d.login) { }}
106
- <a href="<%= base_url%>/users/{{d.login}}" class="layui-table-link" target="_blank">{{ d.name }}</a>
107
- {{# } else {}}
108
- <a href="javascript:;" class="">{{ d.name }}</a>
109
- {{# }}}
110
- </script>
111
- <script type="text/html" id="courses">
112
- <a href="javascript:void(0);" lay-event="courses" class="layui-table-link">{{ d.course_subjects_count }}</a>
113
- </script>
114
- <script type="text/html" id="event">
115
- <a href="javascript:void(0);" lay-event="event" class="layui-table-link">{{ d.activities_count }}</a>
116
- </script>
117
- <script type="text/html" id="class">
118
- <a href="javascript:void(0);" lay-event="class" class="layui-table-link">{{ d.courses_count }}</a>
119
- </script>
120
- <script type="text/html" id="follow">
121
- <a href="javascript:void(0);" lay-event="follow" class="layui-table-link">{{ d.teacher_follows_count }}</a>
122
- </script>
123
-
124
- <script>
125
- layui.use(['form', 'table', 'miniPage', 'element', 'request', 'laydate'], function () {
126
- var $ = layui.jquery,
127
- form = layui.form,
128
- request = layui.request,
129
- dropdown = layui.dropdown,
130
- miniPage = layui.miniPage,
131
- laydate = layui.laydate;
132
-
133
- var laydate = layui.laydate;
134
-
135
- laydate.render({
136
- elem: '#date',
137
- range: true
138
- });
139
- laydate.render({
140
- elem: '#time',
141
- });
142
-
143
- table = layui.table;
144
- table.render({
145
- elem: '#teachers_table',
146
- url: '/missions/teachers',
147
- where: {q: form.val('search_form')},
148
- toolbar: '#toolbarDemo',
149
- totalRow:true,
150
- defaultToolbar: ['filter'],
151
- cols: [
152
- [
153
- {
154
- field: 'id',
155
- width: 60,
156
- title:'序号',type: 'numbers',
157
- totalRowText:'合计',
158
- fixed: 'left'
159
-
160
- },
161
- {
162
- field: 'name',
163
- width: 80,
164
- title: '姓名',
165
- fixed: 'left',
166
- templet: "#name"
167
- },
168
- {
169
- field: 'school',
170
- width: 160,
171
- title: '单位',
172
- templet:'<div><span title="{{d.school}}">{{d.school}}</span></div>'
173
-
174
- },
175
- {
176
- field: 'department',
177
- width: 130,
178
- title: '部门',
179
- templet:'<div><span title="{{d.department}}">{{d.department}}</span></div>'
180
-
181
- },
182
- {
183
- field: 'professional_title',
184
- title: '职称',
185
- width: 80,
186
- templet: '#show_follow'
187
- },
188
- {
189
- field: 'job',
190
- width: 80,
191
- title: '职务',
192
- templet: '#show_keys'
193
-
194
- },
195
- {
196
- field: 'source',
197
- width: 90,
198
- title: '来源',
199
- },
200
- {
201
- field: 'attitude',
202
- width: 60,
203
- title: '态度',
204
- },
205
- {
206
- field: 'course_subjects_count',
207
- width: 90,
208
- title: '课程方向',
209
- templet: "#courses"
210
- },
211
- {
212
- field: 'teacher_follows_count',
213
- width: 90,
214
- title: '跟进情况',
215
- totalRow:true,
216
- templet: "#follow"
217
- },
218
- {
219
- field: 'teacher_used',
220
- width: 120,
221
- title: '学院渗透率',
222
- },
223
- {
224
- field: 'students',
225
- width: 60,
226
- totalRow:'{{ parseInt(d.TOTAL_NUMS) }}',
227
- title: '学生',
228
- },
229
- {
230
- field: 'courses_count',
231
- width: 60,
232
- title: '课堂',
233
- totalRow:true,
234
- templet: "#class"
235
- },
236
- {
237
- field: 'activities_count',
238
- width: 100,
239
- title: '参与活动',
240
- templet: "#event"
241
- },
242
- {
243
- field: 'created_on',
244
- width: 120,
245
- title: '注册时间',
246
- sort: true,
247
- },
248
- {
249
- field: 'last_login_on',
250
- width: 120,
251
- title: '最近登录',
252
- sort: true,
253
- },
254
- {
255
- field: 'created_at',
256
- width: 120,
257
- title: '添加时间',
258
- sort: true,
259
- },
260
- {
261
- field: 'wechat',
262
- width: 120,
263
- title: '微信号',
264
- },
265
- {
266
- field: 'teacher_assist',
267
- width: 120,
268
- title: '教研助理',
269
- },
270
- {
271
- title: '操作',
272
- minWidth: 170,
273
- toolbar: '#currentTableBar',
274
- align: "center",
275
- fixed: 'right'
276
- }
277
- ]
278
- ],
279
-
280
- limit: 20,
281
- limits: [10,15,20,30,40,50,60,70,80,90],
282
- page: true,
283
- done: function (res) {
284
- drowpdwonRender()
285
- }
286
- });
287
- var dropmenu = gon.menus;
288
-
289
- drowpdwonRender = function() {
290
- dropdown.render({
291
- elem: '.more-btn',
292
- data: dropmenu,
293
- click: function(data, othis){
294
- var elem = $(this.elem);
295
- id = elem.data('id');
296
- switch (data.event) {
297
- case 'week':
298
- week(id);
299
- break;
300
- case 'month':
301
- month(id);
302
- break;
303
- case 'edit':
304
- edit(id);
305
- break;
306
- case 'delete':
307
- deleteBusiness(id, elem.data('name'));
308
- break;
309
- }
310
- }
311
- });
312
- }
313
-
314
- function week(id) {
315
- var content = miniPage.getHrefContent('/missions/operation_plans/new_week?teacher_id=' + id);
316
- var openWH = miniPage.getOpenWidthHeight();
317
-
318
- teacherindex1 = layer.open({
319
- title: '添加周计划',
320
- type: 1,
321
- shade: 0.2,
322
- maxmin: true,
323
- shadeClose: true,
324
- area: [openWH[0] + 'px', openWH[1] + 'px'],
325
- offset: [openWH[2] + 'px', openWH[3] + 'px'],
326
- content: content
327
- });
328
- $(window).on("resize", function () {
329
- layer.full(sindex);
330
- });
331
- }
332
-
333
- function edit(id) {
334
- var content = miniPage.getHrefContent('/missions/teachers/' + id + '/edit');
335
- var openWH = miniPage.getOpenWidthHeight();
336
- sindex = layer.open({
337
- title: '编辑',
338
- type: 1,
339
- shade: 0.2,
340
- maxmin: true,
341
- shadeClose: true,
342
- area: [openWH[0] + 'px', openWH[1] + 'px'],
343
- offset: [openWH[2] + 'px', openWH[3] + 'px'],
344
- content: content
345
- });
346
- $(window).on("resize", function () {
347
- layer.full(sindex);
348
- });
349
- }
350
-
351
- function month(id) {
352
- var content = miniPage.getHrefContent('/missions/operation_plans/new_month?teacher_id=' + id);
353
- var openWH = miniPage.getOpenWidthHeight();
354
- teacherindex2 = layer.open({
355
- title: '添加月计划',
356
- type: 1,
357
- shade: 0.2,
358
- maxmin: true,
359
- shadeClose: true,
360
- area: [openWH[0] + 'px', openWH[1] + 'px'],
361
- offset: [openWH[2] + 'px', openWH[3] + 'px'],
362
- content: content
363
- });
364
- $(window).on("resize", function () {
365
- layer.full(sindex);
366
- });
367
- }
368
-
369
- function deleteBusiness(id, name) {
370
- layer.confirm('确定删除' + name, function (index) {
371
- request.delete('missions/teachers/' + id, {}, function (res) {
372
- layer.close(index);
373
- table.reload("teachers_table")
374
- })
375
- });
376
- }
377
-
378
- var sort = {}, search = {};
379
- table.on('sort(teachers_table)', function (obj) {
380
- sort.field = obj.field;
381
- sort.order = obj.type;
382
- table.reload('teachers_table', {
383
- initSort: obj,
384
- where: {
385
- sort: sort,
386
- q: search
387
- }
388
- });
389
- })
390
-
391
- // 监听搜索操作
392
- form.on('submit(search_teachers)', function (data) {
393
- search = data.field
394
- table.reload('teachers_table', {
395
- page: {
396
- curr: 1
397
- },
398
- where: {q: search, sort: sort}
399
- }, 'data');
400
- return false;
401
- });
402
-
403
- form.on('submit(reset_business_search)', function (data) {
404
- var field = data.field;
405
- form.val('search_teachers', {
406
- area: "",
407
- date: "",
408
- attitude: "",
409
- name: "",
410
- professional_title: "",
411
- regist_at: "",
412
- status: "",
413
- school: "",
414
- assist: "",
415
- teacher_source: ""
416
- })
417
- return false;
418
- });
419
- form.on('submit(show_hide)', function (data) {
420
- $(".show_item").toggle()
421
- return false;
422
- });
423
- /**
424
- * toolbar事件监听
425
- */
426
- table.on('toolbar(teachers_table)', function (obj) {
427
- if (obj.event === 'add') { // 手动添加
428
- var content = miniPage.getHrefContent('/missions/teachers/new');
429
- var openWH = miniPage.getOpenWidthHeight();
430
- index = layer.open({
431
- title: '添加老师',
432
- type: 1,
433
- shade: 0.2,
434
- maxmin: true,
435
- shadeClose: true,
436
- area: [openWH[0] + 'px', openWH[1] + 'px'],
437
- offset: [openWH[2] + 'px', openWH[3] + 'px'],
438
- content: content,
439
- });
440
- $(window).on("resize", function () {
441
- layer.full(index);
442
- });
443
- }else if (obj.event === 'import') { //
444
- var content = miniPage.getHrefContent('/missions/teachers/import');
445
- var openWH = miniPage.getOpenWidthHeight();
446
- import_index = layer.open({
447
- title: '导入数据',
448
- type: 1,
449
- shade: 0.2,
450
- shadeClose: true,
451
- area: ['200px', '100px'],
452
- offset: 'auto',
453
- closeBtn: 0,
454
- content: content,
455
- });
456
- $(window).on("resize", function () {
457
- layer.full(index);
458
- });
459
- } else if (obj.event === 'search_new') { // 搜索添加
460
- content = miniPage.getHrefContent('/missions/teachers/search_new');
461
- openWH = miniPage.getOpenWidthHeight();
462
- index = layer.open({
463
- title: '搜索添加',
464
- type: 1,
465
- shade: 0.2,
466
- maxmin: true,
467
- shadeClose: true,
468
- area: [openWH[0] + 'px', openWH[1] + 'px'],
469
- offset: [openWH[2] + 'px', openWH[3] + 'px'],
470
- content: content,
471
- });
472
- $(window).on("resize", function () {
473
- layer.full(index);
474
- });
475
- } else if (obj.event === 'report_day') {
476
- content = miniPage.getHrefContent('/missions/teachers/daily_paper');
477
- openWH = miniPage.getOpenWidthHeight();
478
- index = layer.open({
479
- title: '',
480
- type: 1,
481
- shade: 0.2,
482
- // maxmin: true,
483
- shadeClose: true,
484
- area: ['600px', '600px'],
485
- content: content
486
- });
487
- $(window).on("resize", function () {
488
- layer.full(index);
489
- });
490
- }
491
- });
492
-
493
- //监听表格复选框选择
494
- table.on('checkbox(teachers_table)', function (obj) {
495
- console.log(obj)
496
- });
497
-
498
- table.on('tool(teachers_table)', function (obj) {
499
- var data = obj.data;
500
- id = data.id
501
- if (obj.event === 'add_event') { // 监听添加操作
502
- teacher_id = data.id
503
- var content = miniPage.getHrefContent('/missions/teachers/new_follow_record?id=' + data.id);
504
- var openWH = miniPage.getOpenWidthHeight();
505
- sale_plan_index = layer.open({
506
- title: '添加教师跟进记录',
507
- type: 1,
508
- shade: 0.2,
509
- maxmin: true,
510
- shadeClose: true,
511
- area: [openWH[0] + 'px', openWH[1] + 'px'],
512
- offset: [openWH[2] + 'px', openWH[3] + 'px'],
513
- content: content,
514
- success: function (layero, index) {
515
- form.render('select');
516
- }
517
- });
518
- $(window).on("resize", function () {
519
- layer.full(sale_plan_index);
520
- });
521
- } else if (obj.event === 'delete') {
522
- layer.confirm('确定删除' + data.name, function (index) {
523
- request.delete('missions/teachers/' + data.id, {}, function (res) {
524
- layer.close(index);
525
- table.reload("teachers_table")
526
- })
527
- });
528
- } else if (obj.event === 'addWeek') {
529
- var content = miniPage.getHrefContent('/missions/operation_plans/new_week?teacher_id=' + obj.data.id);
530
- var openWH = miniPage.getOpenWidthHeight();
531
-
532
- teacherindex1 = layer.open({
533
- title: '添加周计划',
534
- type: 1,
535
- shade: 0.2,
536
- maxmin: true,
537
- shadeClose: true,
538
- area: [openWH[0] + 'px', openWH[1] + 'px'],
539
- offset: [openWH[2] + 'px', openWH[3] + 'px'],
540
- content: content
541
- });
542
- $(window).on("resize", function () {
543
- layer.full(sindex);
544
- });
545
- } else if (obj.event === 'addMonth') {
546
- var content = miniPage.getHrefContent('/missions/operation_plans/new_month?teacher_id=' + obj.data.id);
547
- var openWH = miniPage.getOpenWidthHeight();
548
- teacherindex2 = layer.open({
549
- title: '添加月计划',
550
- type: 1,
551
- shade: 0.2,
552
- maxmin: true,
553
- shadeClose: true,
554
- area: [openWH[0] + 'px', openWH[1] + 'px'],
555
- offset: [openWH[2] + 'px', openWH[3] + 'px'],
556
- content: content
557
- });
558
- $(window).on("resize", function () {
559
- layer.full(sindex);
560
- });
561
-
562
- } else if (obj.event === 'courses') {
563
- teacher_id = data.id
564
- content = miniPage.getHrefContent('/missions/teachers/add_courses?id='+data.id);
565
- openWH = miniPage.getOpenWidthHeight();
566
- index = layer.open({
567
- title: '课程方向',
568
- type: 1,
569
- shade: 0.2,
570
- maxmin: true,
571
- shadeClose: true,
572
- area: [openWH[0] + 'px', openWH[1] + 'px'],
573
- offset: [openWH[2] + 'px', openWH[3] + 'px'],
574
- content: content,
575
- success: function (layero, index) {
576
- // 重新渲染弹层中的下拉选择框select
577
- // form.render('select');
578
- }
579
- });
580
- $(window).on("resize", function () {
581
- layer.full(index);
582
- });
583
- } else if (obj.event === 'event') {
584
- content = miniPage.getHrefContent('/missions/teachers/add_event');
585
- openWH = miniPage.getOpenWidthHeight();
586
- teacher_id = obj.data.id;
587
- index = layer.open({
588
- title: '参与活动',
589
- type: 1,
590
- shade: 0.2,
591
- maxmin: true,
592
- shadeClose: true,
593
- area: [openWH[0] + 'px', openWH[1] + 'px'],
594
- offset: [openWH[2] + 'px', openWH[3] + 'px'],
595
- content: content,
596
- success: function (layero, index) {
597
- // 重新渲染弹层中的下拉选择框select
598
- // form.render('select');
599
- }
600
- });
601
- $(window).on("resize", function () {
602
- layer.full(index);
603
- });
604
- } else if (obj.event === 'class') {
605
- content = miniPage.getHrefContent('/missions/teachers/show_class');
606
- openWH = miniPage.getOpenWidthHeight();
607
- user_id = obj.data.user_id;
608
- index = layer.open({
609
- title: '课堂列表',
610
- type: 1,
611
- shade: 0.2,
612
- maxmin: true,
613
- shadeClose: true,
614
- area: [openWH[0] + 'px', openWH[1] + 'px'],
615
- offset: [openWH[2] + 'px', openWH[3] + 'px'],
616
- content: content,
617
- success: function (layero, index) {
618
- // 重新渲染弹层中的下拉选择框select
619
- // form.render('select');
620
- }
621
- });
622
- $(window).on("resize", function () {
623
- layer.full(index);
624
- });
625
- } else if (obj.event === 'follow') {
626
- content = miniPage.getHrefContent('/missions/teachers/show_follow?id=' + data.id);
627
- openWH = miniPage.getOpenWidthHeight();
628
- index = layer.open({
629
- title: '跟进记录',
630
- type: 1,
631
- shade: 0.2,
632
- maxmin: true,
633
- shadeClose: true,
634
- area: [openWH[0] + 'px', openWH[1] + 'px'],
635
- offset: [openWH[2] + 'px', openWH[3] + 'px'],
636
- content: content,
637
- success: function (layero, index) {
638
- // 重新渲染弹层中的下拉选择框select
639
- // form.render('select');
640
- }
641
- });
642
- $(window).on("resize", function () {
643
- layer.full(index);
644
- });
645
- }
646
- });
647
-
648
- });
649
- </script>
650
- <style>
651
- .layui-table-tool-temp{
652
- padding-right: 30px; !important;
653
- }
654
- </style>
@@ -16,8 +16,18 @@ json.data do
16
16
  json.source EducodeSales::Common.teacher_source_name[d.source_id]
17
17
  json.attitude d.follow_up&.attitude&.name
18
18
  json.courses_count d.courses_count
19
+ json.area d.department&.school&.province
19
20
  json.actives d.actives
21
+ json.experience d['experience'] || 0
22
+ json.grade d['grade'] || 0
23
+ json.mobile d.mobile
20
24
  json.students d.students_count
25
+ json.followup_at d.followup_at.to_s
26
+ json.latest_time (d['latest_time'] ? DateTime.parse(Time.now.strftime("%Y-%m-%d")) - DateTime.parse(d['latest_time'].strftime("%Y-%m-%d")) : DateTime.parse(Time.now.strftime("%Y-%m-%d")) - DateTime.parse(d.created_at.strftime("%Y-%m-%d"))).to_i
27
+
28
+ json.staff_manage @staff_manages[d.department&.school&.province]&.join(",")
29
+
30
+ json.follow_person d.follow_up&.staff&.user&.real_name || ''
21
31
  json.created_on d.user.present? ? d.user.created_on.to_s(:date) : ''
22
32
  json.last_login_on (d.user.present? && d.user.last_login_on.present?) ? d.user.last_login_on.to_s(:date) : ''
23
33
  json.teacher_used d.teacher_used