educode_sales 1.10.46 → 1.10.49

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) 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/modules/easyeditor/easyeditor.css +130 -0
  4. data/app/assets/stylesheets/educode_sales/modules/easyeditor/fangge-style.css +4 -0
  5. data/app/controllers/educode_sales/application_controller.rb +12 -0
  6. data/app/controllers/educode_sales/business_courses_controller.rb +230 -0
  7. data/app/controllers/educode_sales/follow_ups_controller.rb +6 -2
  8. data/app/controllers/educode_sales/home_controller.rb +7 -0
  9. data/app/controllers/educode_sales/shixun_dectects_controller.rb +111 -0
  10. data/app/controllers/educode_sales/shixuns_controller.rb +157 -0
  11. data/app/controllers/educode_sales/subject_trends_controller.rb +937 -0
  12. data/app/controllers/educode_sales/subjects_controller.rb +202 -0
  13. data/app/controllers/educode_sales/teachers_controller.rb +13 -2
  14. data/app/helpers/educode_sales/application_helper.rb +8 -0
  15. data/app/helpers/educode_sales/business_courses_helper.rb +37 -0
  16. data/app/helpers/educode_sales/subject_helper.rb +29 -0
  17. data/app/models/educode_sales/business.rb +22 -0
  18. data/app/models/educode_sales/business_deliver_subject.rb +48 -0
  19. data/app/models/educode_sales/business_subject.rb +62 -0
  20. data/app/models/educode_sales/business_subject_shixun.rb +46 -0
  21. data/app/models/educode_sales/business_subject_staff.rb +35 -0
  22. data/app/models/educode_sales/permission.rb +2 -1
  23. data/app/models/educode_sales/shixun_dectect.rb +12 -0
  24. data/app/views/educode_sales/business_courses/edit.html.erb +148 -0
  25. data/app/views/educode_sales/business_courses/index.html.erb +312 -0
  26. data/app/views/educode_sales/business_courses/index.json.jbuilder +16 -0
  27. data/app/views/educode_sales/business_courses/list_shixuns.html.erb +224 -0
  28. data/app/views/educode_sales/business_courses/list_shixuns.json.jbuilder +17 -0
  29. data/app/views/educode_sales/business_courses/list_subjects.html.erb +217 -0
  30. data/app/views/educode_sales/business_courses/list_subjects.json.jbuilder +12 -0
  31. data/app/views/educode_sales/business_courses/new.html.erb +212 -0
  32. data/app/views/educode_sales/shixun_dectects/index.html.erb +466 -0
  33. data/app/views/educode_sales/shixun_dectects/index.json.jbuilder +22 -0
  34. data/app/views/educode_sales/shixun_dectects/markdown.html.erb +60 -0
  35. data/app/views/educode_sales/shixuns/edit.html.erb +186 -0
  36. data/app/views/educode_sales/shixuns/index.html.erb +513 -0
  37. data/app/views/educode_sales/shixuns/index.json.jbuilder +22 -0
  38. data/app/views/educode_sales/shixuns/new.html.erb +251 -0
  39. data/app/views/educode_sales/subject_trends/trends.html.erb +1074 -0
  40. data/app/views/educode_sales/subjects/edit.html.erb +86 -0
  41. data/app/views/educode_sales/subjects/index.html.erb +247 -0
  42. data/app/views/educode_sales/subjects/index.json.jbuilder +16 -0
  43. data/app/views/educode_sales/subjects/list_shixuns.html.erb +228 -0
  44. data/app/views/educode_sales/subjects/list_shixuns.json.jbuilder +17 -0
  45. data/app/views/educode_sales/subjects/new.html.erb +254 -0
  46. data/app/views/layouts/educode_sales/application.html.erb +38 -0
  47. data/config/routes.rb +37 -0
  48. data/lib/educode_sales/version.rb +1 -1
  49. metadata +43 -6
@@ -0,0 +1,513 @@
1
+ <style>
2
+ .inner_div {
3
+ margin-bottom: 10px;
4
+ margin-right: 10px;
5
+ }
6
+ </style>
7
+ <div class="layui-tab" style="margin: 10px">
8
+ <ul class="layui-tab-title">
9
+ <li id="category_1" class="layui-this" lay-id="11">管培</li>
10
+ <li id="category_2" lay-id="22">全职</li>
11
+ <li id="category_3" lay-id="33">专职</li>
12
+
13
+ </ul>
14
+ <div class="layui-tab-content">
15
+ <div>
16
+ <form class="layui-form layui-form-pane" lay-filter="search_form">
17
+ <div>
18
+ <div class="layui-inline show_item_contract inner_div">
19
+ <label class="layui-form-label">项目级别</label>
20
+ <div class="layui-input-inline">
21
+ <%= select_tag "level", options_for_select(
22
+ [["全部", 0], ["不明确", 1], ["重要紧急", 2], ["重要不紧急", 3],
23
+ ["不重要紧急", 4], ["不重要不紧急", 5]], selected: 0
24
+ ), { include_blank: true } %>
25
+ </div>
26
+ </div>
27
+ <div class="layui-inline show_item_contract borders inner_div">
28
+ <label class="layui-form-label">项目状态</label>
29
+ <div class="layui-input-inline">
30
+ <%= select_tag "status", options_for_select(
31
+ [["全部", 0], ["待建设", 1], ["已签协议", 2], ["建设中", 3],
32
+ ["审核中", 4], ["返修中", 5], ["已内部发布", 6], ["已公开发布", 7]], selected: 0
33
+ ), { include_blank: true } %>
34
+ </div>
35
+ </div>
36
+ <div class="layui-inline inner_div">
37
+ <label class="layui-form-label">交付时间</label>
38
+ <div class="layui-inline" id="ID-laydate-range">
39
+ <input type="text" class="layui-input" name="time" id="ID-laydate-demo" placeholder="yyyy-MM-dd">
40
+ </div>
41
+ </div>
42
+ </div>
43
+ <div>
44
+ <div class="layui-inline borders inner_div">
45
+ <label class="layui-form-label" style="width: 120px">项目名称</label>
46
+ <div class="layui-input-inline">
47
+ <input type="text" class="layui-input" name="shixun_name">
48
+ </div>
49
+ </div>
50
+ <div class="layui-inline borders inner_div">
51
+ <label class="layui-form-label" style="width: 120px">实践课程名称</label>
52
+ <div class="layui-input-inline">
53
+ <input type="text" class="layui-input" name="subject_name">
54
+ </div>
55
+ </div>
56
+ <div class="layui-inline borders inner_div">
57
+ <button type="reset" class="layui-btn layui-btn-primary" lay-submit lay-filter="reset_business_search">重置
58
+ </button>
59
+ <button type="submit" id="search_bt" class="layui-btn layui-btn-primary" lay-submit lay-filter="search_contract">搜索
60
+ </button>
61
+ </div>
62
+ </div>
63
+ </form>
64
+ </div>
65
+
66
+ <div id="contact_table_wraper">
67
+ <table class="layui-hide" id="shixuns_table" lay-filter="shixuns_table"></table>
68
+ </div>
69
+ <input type="text" class="layui-input" name="subject_name" id="shixun_nav_type_id" value="1" style="display: none" >
70
+ </div>
71
+ </div>
72
+
73
+ <script type="text/html" id="bussinessBar">
74
+ <div class="layui-btn-container">
75
+ <span class="table-label">项目列表</span>
76
+ <button class="layui-btn layui-btn-sm pull-right" lay-event="add">
77
+ 添加实践项目
78
+ </button>
79
+ <button class="layui-btn layui-btn-primary layui-border-green layui-btn-sm pull-right project_list-btn" lay-event="list">
80
+ 导出数据
81
+ </button>
82
+ </div>
83
+ </script>
84
+ <script type="text/html" id="show_state">
85
+ {{# if(d.shixun_status === 1){ }}
86
+ <span>待建设</span>
87
+ {{# } else if(d.shixun_status === 2){ }}
88
+ <span>已签协议</span>
89
+ {{# } else if(d.shixun_status === 3){ }}
90
+ <span>建设中</span>
91
+ {{# } else if(d.shixun_status === 4){ }}
92
+ <span>审核中</span>
93
+ {{# } else if(d.shixun_status === 5){ }}
94
+ <span>返修中</span>
95
+ {{# } else if(d.shixun_status === 6){ }}
96
+ <span>已内部发布</span>
97
+ {{# } else if(d.shixun_status === 7){ }}
98
+ <span>已公开发布</span>
99
+ {{# } }}
100
+ </script>
101
+ <script type="text/html" id="show_level">
102
+ {{# if(d.level === 1){ }}
103
+ <span>不明确</span>
104
+ {{# } else if(d.level === 2){ }}
105
+ <span>重要紧急</span>
106
+ {{# } else if(d.level === 3){ }}
107
+ <span>重要不紧急</span>
108
+ {{# } else if(d.level === 4){ }}
109
+ <span>不重要紧急</span>
110
+ {{# } else if(d.level === 5){ }}
111
+ <span>不重要不紧急</span>
112
+ {{# } }}
113
+ </script>
114
+ <script type="text/html" id="shixun_table_bar">
115
+ <a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="edit">编辑</a>
116
+ <a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="examine">提交审核</a>
117
+ </script>
118
+ <script>
119
+ layui.use(['form', 'table', 'miniPage', 'element', 'laydate', 'dropdown', 'jquery'], function () {
120
+ var laydate = layui.laydate,
121
+ form = layui.form,
122
+ table = layui.table,
123
+ $ = layui.jquery,
124
+ miniPage = layui.miniPage
125
+
126
+
127
+ laydate.render({
128
+ elem: '#ID-laydate-demo',
129
+ range: true
130
+ });
131
+
132
+ var data = form.val("search_form");
133
+ // 默认管培
134
+ data.category = 1
135
+ var cols_table = [
136
+ [
137
+ {
138
+ field: 'id',
139
+ width: 60,
140
+ fixed: 'left',
141
+ title: '序号', type: 'numbers',
142
+ align: 'center',
143
+ },
144
+ {
145
+ field: 'school_name',
146
+ title: '交付单位',
147
+ width: 150,
148
+ align: 'center',
149
+ hide: gon.filter.school_name
150
+ },
151
+ {
152
+ field: 'subject_name',
153
+ title: '实践课程名称',
154
+ width: 200,
155
+ align: 'center',
156
+ hide: gon.filter.subject_name
157
+ },
158
+ {
159
+ field: 'reception_at',
160
+ title: '交付时间',
161
+ width: 150,
162
+ align: 'center',
163
+ hide: gon.filter.reception_at
164
+ },
165
+ {
166
+ field: 'shixun_name',
167
+ title: '项目名称',
168
+ width: 150,
169
+ align: 'center',
170
+ hide: gon.filter.shixun_name
171
+ },
172
+ {
173
+ field: 'level',
174
+ title: '项目级别',
175
+ width: 150,
176
+ align: 'center',
177
+ templet: '#show_level',
178
+ hide: gon.filter.level
179
+ },
180
+ {
181
+ field: 'shixun_status',
182
+ title: '项目状态',
183
+ width: 150,
184
+ templet: '#show_state',
185
+ align: 'center',
186
+ hide: gon.filter.shixun_status
187
+ },
188
+ {
189
+ field: 'deliver_date',
190
+ title: '制作完成时间',
191
+ width: 150,
192
+ align: 'center',
193
+ hide: gon.filter.deliver_date
194
+ },
195
+ {
196
+ field: 'commit_dectect_time',
197
+ title: '提交审核时间',
198
+ width: 150,
199
+ align: 'center',
200
+ hide: gon.filter.commit_dectect_time
201
+ },
202
+ {
203
+ field: 'dectect_feedback',
204
+ title: '审核反馈',
205
+ width: 150,
206
+ align: 'center',
207
+ hide: gon.filter.dectect_feedback
208
+ },
209
+ {
210
+ field: 'shixun_producer',
211
+ title: '项目制作人',
212
+ width: 150,
213
+ align: 'center',
214
+ hide: gon.filter.shixun_producer
215
+ },
216
+ {
217
+ field: 'shixun_manages',
218
+ title: '课程组长',
219
+ width: 150,
220
+ align: 'center',
221
+ hide: gon.filter.shixun_manages
222
+ },
223
+ {
224
+ field: 'max_manage',
225
+ title: '课程组主管',
226
+ width: 150,
227
+ align: 'center',
228
+ hide: gon.filter.max_manage
229
+ },
230
+ {
231
+ field: 'shixun_staff',
232
+ title: '销售',
233
+ width: 150,
234
+ align: 'center',
235
+ hide: gon.filter.shixun_staff
236
+ },
237
+ {
238
+ title: '操作',
239
+ align: 'center',
240
+ width: 150,
241
+ fixed: 'right',
242
+ templet: "#shixun_table_bar"
243
+ }
244
+ ]
245
+ ]
246
+
247
+ var id = localStorage.getItem("subjects_id")
248
+ console.log(id)
249
+ var shixuns_table = table.render({
250
+ elem: '#shixuns_table',
251
+ url: '/missions/shixuns',
252
+ autoSort: false,
253
+ where: {q: data},
254
+ title: '实践项目列表',
255
+ toolbar: '#bussinessBar',
256
+ defaultToolbar: ['filter'],
257
+ cols: cols_table,
258
+ limit: 10,
259
+ limits: [10, 15, 20, 30, 40, 50, 60, 70, 80, 90],
260
+ page: true,
261
+ skin: 'line'
262
+ });
263
+
264
+ var sort = {}, search = {};
265
+ // 监听搜索操作
266
+ form.on('submit(search_contract)', function (data) {
267
+ search = data.field
268
+ search.category = document.getElementById('shixun_nav_type_id').value
269
+ console.log(search)
270
+ table.reload('shixuns_table', {
271
+ page: {
272
+ curr: 1
273
+ },
274
+ where: {q: search, sort: sort}
275
+ }, 'data');
276
+ return false;
277
+ });
278
+
279
+ table.on('tool(shixuns_table)', function (obj) {
280
+ var data = obj.data;
281
+ console.log(data)
282
+ // 编辑按钮监听
283
+ if (obj.event === 'edit') {
284
+ var content = miniPage.getHrefContent('/missions/shixuns/' + data.id + '/edit');
285
+ var openWH = miniPage.getOpenWidthHeight();
286
+
287
+ var edit = layer.open({
288
+ title: '编辑实践项目',
289
+ type: 1,
290
+ shade: 0.2,
291
+ maxmin: true,
292
+ shadeClose: true,
293
+ area: [openWH[0] + 'px', openWH[1] + 'px'],
294
+ offset: [openWH[2] + 'px', openWH[3] + 'px'],
295
+ content: content
296
+ });
297
+ $(window).on("resize", function () {
298
+ });
299
+ return false;
300
+ } else if (obj.event === 'examine'){
301
+ var status = data.shixun_status
302
+ console.log(status)
303
+ if (status != 3 && status != 5) {
304
+ layer.confirm("当前状态无法提交审核")
305
+ return false
306
+ }
307
+
308
+ $.ajax('/missions/shixun_dectects/submit', {
309
+ method: 'POST',
310
+ data: data,
311
+ dataType: 'json',
312
+ success: function (res) {
313
+ var data = res.data;
314
+ console.log(res)
315
+ if(res.success){
316
+ layer.msg("提交成功")
317
+ }
318
+ },
319
+ error:(res)=>{
320
+ layer.msg("已经提交过了")
321
+ }
322
+ })
323
+ return false
324
+ }
325
+ });
326
+
327
+
328
+ table.on('toolbar(shixuns_table)', function (obj) {
329
+ // 新增按钮监听
330
+ if (obj.event === 'add') {
331
+ var content = miniPage.getHrefContent('/missions/shixuns/new');
332
+ var openWH = miniPage.getOpenWidthHeight();
333
+ add_courses = layer.open({
334
+ title: '添加实践项目',
335
+ type: 1,
336
+ shade: 0.2,
337
+ maxmin: true,
338
+ shadeClose: true,
339
+ area: [openWH[0] + 'px', openWH[1] + 'px'],
340
+ offset: [openWH[2] + 'px', openWH[3] + 'px'],
341
+ content: content,
342
+ });
343
+ $(window).on("resize", function () {
344
+ });
345
+ }else if(obj.event === 'LAYTABLE_COLS') {
346
+ layui.form.on('checkbox(LAY_TABLE_TOOL_COLS)', function(objs) {
347
+ var value = objs.elem.checked
348
+ var name = objs.elem.attributes[1].value
349
+ $.ajax({
350
+ url: "filter",
351
+ type: "GET",
352
+ data: "type=shixuns&name=" + name + "&check=" + value,
353
+ success: function (data){
354
+ let hide_type = "[data-field='"+name+"']"
355
+ if (data.hidden === 1){
356
+ $(hide_type).addClass('layui-hide');
357
+ }else if (data.hidden === 0){
358
+ $(hide_type).removeClass('layui-hide');
359
+ }
360
+ //(因为触发筛选器出现的checkbox是根据cols的值得到 这里必须修改 cols的值 然后才会出现下次点击筛选器时 checkbox正常显示)
361
+ for (i=1;i<cols_table[0].length;i++){
362
+ if (name === cols_table[0][i].field ){
363
+ cols_table[0][i].hide = !value
364
+ objs.config.cols = cols_table
365
+ }
366
+ }
367
+ },
368
+ error: function (data){
369
+ layer.msg("操作失败")
370
+ },
371
+ dataType: 'Json'
372
+ })
373
+ });
374
+ }
375
+ });
376
+
377
+
378
+ for (let i = 1; i <= 3; i++) {
379
+ if (i !== 3) {
380
+ $("#category_" + i).click(function () {
381
+ data.category = i
382
+ console.log(i)
383
+ table.reload('shixuns_table', {
384
+ page: {
385
+ curr: 1
386
+ },
387
+ cols:cols_table,
388
+ where: {q: data}
389
+ })
390
+ // 更换面包屑后,跟新类型
391
+ document.getElementById('shixun_nav_type_id').value = i
392
+ });
393
+ } else if (i === 3) {
394
+ $("#category_" + i).click(function () {
395
+
396
+ data.category = i
397
+ var arr = [[
398
+ {
399
+ field: 'id',
400
+ width: 60,
401
+ fixed: 'left',
402
+ title: '序号', type: 'numbers',
403
+ align: 'center'
404
+ },
405
+ {
406
+ field: 'school_name',
407
+ title: '交付单位',
408
+ width: 150,
409
+ align: 'center'
410
+ },
411
+ {
412
+ field: 'subject_name',
413
+ title: '实践课程名称',
414
+ width: 200,
415
+ align: 'center'
416
+ },
417
+ {
418
+ field: 'reception_at',
419
+ title: '交付时间',
420
+ width: 150,
421
+ align: 'center'
422
+ },
423
+ {
424
+ field: 'shixun_name',
425
+ title: '项目名称',
426
+ width: 150,
427
+ align: 'center'
428
+ },
429
+ {
430
+ field: 'level',
431
+ title: '项目级别',
432
+ width: 150,
433
+ align: 'center',
434
+ templet: '#show_level'
435
+ },
436
+ {
437
+ field: 'shixun_status',
438
+ title: '项目状态',
439
+ width: 150,
440
+ templet: '#show_state',
441
+ align: 'center'
442
+ },
443
+ {
444
+ field: 'deliver_date',
445
+ title: '制作完成时间',
446
+ width: 150,
447
+ align: 'center'
448
+ },
449
+ {
450
+ field: 'money',
451
+ title: '金额',
452
+ width: 150,
453
+ align: 'center'
454
+ },
455
+ {
456
+ field: 'time2',
457
+ title: '提交审核时间',
458
+ width: 150,
459
+ align: 'center'
460
+ },
461
+ {
462
+ field: 'feedback',
463
+ title: '审核反馈',
464
+ width: 150,
465
+ align: 'center'
466
+ },
467
+ {
468
+ field: 'shixun_producer',
469
+ title: '项目制作人',
470
+ width: 150,
471
+ align: 'center'
472
+ },
473
+ {
474
+ field: 'shixun_manages',
475
+ title: '课程组长',
476
+ width: 150,
477
+ align: 'center'
478
+ },
479
+ {
480
+ field: 'shixun_manages',
481
+ title: '课程组主管',
482
+ width: 150,
483
+ align: 'center'
484
+ },
485
+ {
486
+ field: 'shixun_staff',
487
+ title: '销售',
488
+ width: 150,
489
+ align: 'center'
490
+ },
491
+ {
492
+ title: '操作',
493
+ align: 'center',
494
+ width: 150,
495
+ fixed: 'right',
496
+ templet: "#shixun_table_bar"
497
+ }
498
+ ]]
499
+ table.reload('shixuns_table', {
500
+ page: {
501
+ curr: 1
502
+ },
503
+ cols:arr,
504
+ where: {q: data}
505
+ })
506
+ document.getElementById('shixun_nav_type_id').value = i
507
+ });
508
+ }
509
+
510
+ }
511
+
512
+ });
513
+ </script>
@@ -0,0 +1,22 @@
1
+ json.data do
2
+ json.array! @shixuns do |d|
3
+ json.shixun_manages handled_data d.shixun_manages
4
+ json.shixun_producer d.shixun_producer
5
+ json.shixun_staff handled_data d.shixun_staff
6
+ json.type d.shixun_type
7
+ json.deliver_date handled_time_data d.deliver_date
8
+ json.reception_at handled_time_data d.reception_at
9
+ json.school_name d.school_name
10
+ json.identifier handled_data d.identifier
11
+ json.subject_name handled_data(d.subject_name)
12
+ json.shixun_name handled_data d.name
13
+ json.shixun_status d.shixun_status
14
+ json.level d.level
15
+ json.id d.id
16
+ json.max_manage "喻银凤"
17
+ json.dectect_feedback "审核反馈内容"
18
+ json.commit_dectect_time handled_time_data Time.now
19
+ end
20
+ end
21
+ json.code 0
22
+ json.count @shixuns.total_count