educode_sales 1.10.48 → 1.10.49

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/stylesheets/educode_sales/modules/easyeditor/easyeditor.css +130 -0
  3. data/app/assets/stylesheets/educode_sales/modules/easyeditor/fangge-style.css +4 -0
  4. data/app/controllers/educode_sales/application_controller.rb +12 -0
  5. data/app/controllers/educode_sales/business_courses_controller.rb +230 -0
  6. data/app/controllers/educode_sales/home_controller.rb +7 -0
  7. data/app/controllers/educode_sales/shixun_dectects_controller.rb +111 -0
  8. data/app/controllers/educode_sales/shixuns_controller.rb +157 -0
  9. data/app/controllers/educode_sales/subject_trends_controller.rb +937 -0
  10. data/app/controllers/educode_sales/subjects_controller.rb +202 -0
  11. data/app/helpers/educode_sales/application_helper.rb +8 -0
  12. data/app/helpers/educode_sales/business_courses_helper.rb +37 -0
  13. data/app/helpers/educode_sales/subject_helper.rb +29 -0
  14. data/app/models/educode_sales/business.rb +22 -0
  15. data/app/models/educode_sales/business_deliver_subject.rb +48 -0
  16. data/app/models/educode_sales/business_subject.rb +62 -0
  17. data/app/models/educode_sales/business_subject_shixun.rb +46 -0
  18. data/app/models/educode_sales/business_subject_staff.rb +35 -0
  19. data/app/models/educode_sales/permission.rb +2 -1
  20. data/app/models/educode_sales/shixun_dectect.rb +12 -0
  21. data/app/views/educode_sales/business_courses/edit.html.erb +148 -0
  22. data/app/views/educode_sales/business_courses/index.html.erb +312 -0
  23. data/app/views/educode_sales/business_courses/index.json.jbuilder +16 -0
  24. data/app/views/educode_sales/business_courses/list_shixuns.html.erb +224 -0
  25. data/app/views/educode_sales/business_courses/list_shixuns.json.jbuilder +17 -0
  26. data/app/views/educode_sales/business_courses/list_subjects.html.erb +217 -0
  27. data/app/views/educode_sales/business_courses/list_subjects.json.jbuilder +12 -0
  28. data/app/views/educode_sales/business_courses/new.html.erb +212 -0
  29. data/app/views/educode_sales/shixun_dectects/index.html.erb +466 -0
  30. data/app/views/educode_sales/shixun_dectects/index.json.jbuilder +22 -0
  31. data/app/views/educode_sales/shixun_dectects/markdown.html.erb +60 -0
  32. data/app/views/educode_sales/shixuns/edit.html.erb +186 -0
  33. data/app/views/educode_sales/shixuns/index.html.erb +513 -0
  34. data/app/views/educode_sales/shixuns/index.json.jbuilder +22 -0
  35. data/app/views/educode_sales/shixuns/new.html.erb +251 -0
  36. data/app/views/educode_sales/subject_trends/trends.html.erb +1074 -0
  37. data/app/views/educode_sales/subjects/edit.html.erb +86 -0
  38. data/app/views/educode_sales/subjects/index.html.erb +247 -0
  39. data/app/views/educode_sales/subjects/index.json.jbuilder +16 -0
  40. data/app/views/educode_sales/subjects/list_shixuns.html.erb +228 -0
  41. data/app/views/educode_sales/subjects/list_shixuns.json.jbuilder +17 -0
  42. data/app/views/educode_sales/subjects/new.html.erb +254 -0
  43. data/app/views/layouts/educode_sales/application.html.erb +38 -0
  44. data/config/routes.rb +37 -0
  45. data/lib/educode_sales/version.rb +1 -1
  46. metadata +37 -1
@@ -0,0 +1,466 @@
1
+ <!-- 图标 -->
2
+ <style>
3
+ .markdown_list img{
4
+ max-width: 700px;
5
+ }
6
+ </style>
7
+ <link rel="stylesheet" type="text/css" href="//at.alicdn.com/t/font_1531710_xb357ub1wmg.css"/>
8
+ <style>
9
+ .inner_div {
10
+ margin-bottom: 10px;
11
+ margin-right: 10px;
12
+ }
13
+ </style>
14
+ <div class="layui-tab" style="margin: 10px">
15
+ <ul class="layui-tab-title">
16
+ <li id="index_1" class="layui-this" lay-id="11">待审核</li>
17
+ <li id="index_2" lay-id="22">已审核</li>
18
+
19
+ </ul>
20
+ <div class="layui-tab-content">
21
+ <div>
22
+ <form class="layui-form layui-form-pane" lay-filter="search_form">
23
+ <div class="layui-inline show_item_contract inner_div">
24
+ <label class="layui-form-label">项目级别</label>
25
+ <div class="layui-input-inline">
26
+ <%= select_tag "category", options_for_select(
27
+ [["全部", 0], ["管培", 1], ["全职", 2], ["专职", 3]], selected: 0
28
+ ), { include_blank: true } %>
29
+ </div>
30
+ </div>
31
+ <div class="layui-inline borders inner_div">
32
+ <label class="layui-form-label" style="width: 120px">实践项目名称</label>
33
+ <div class="layui-input-inline">
34
+ <input type="text" class="layui-input" name="shixun_name">
35
+ </div>
36
+ </div>
37
+ <div class="layui-inline borders inner_div">
38
+ <button type="reset" class="layui-btn layui-btn-primary" lay-submit lay-filter="reset_business_search">重置
39
+ </button>
40
+ <button type="submit" id="search_bt" class="layui-btn layui-btn-primary" lay-submit lay-filter="search_contract">搜索
41
+ </button>
42
+ </div>
43
+ </form>
44
+ </div>
45
+
46
+ <div id="contact_table_wraper">
47
+ <table class="layui-hide" id="shixun_dectects_table" lay-filter="shixun_dectects_table"></table>
48
+ </div>
49
+
50
+
51
+ </div>
52
+ </div>
53
+
54
+ <script type="text/html" id="shixun_table_bar">
55
+ <a class="layui-btn layui-btn-xs data-count-edit" lay-event="pass">通过</a>
56
+ <a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit layui-bg-red" lay-event="reject">驳回</a>
57
+ {{# if(d.audit_history.length > 0){ }}
58
+ <a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit layui-bg-blue" lay-event="info">详情</a>
59
+ {{# } }}
60
+ </script>
61
+ <script type="text/html" class="markdown">
62
+ <a lay-event="examine">点击查看</a>
63
+ </script>
64
+ <script type="text/html" id="shixun_dectect_type">
65
+ {{# if(d.dectect_type === 1){ }}
66
+ <span style="color: green">已通过</span>
67
+ {{# } else if(d.dectect_type === 2){ }}
68
+ <span style="color: red">已驳回</span>
69
+
70
+ {{# } }}
71
+ </script>
72
+ <script type="text/html" id="category_list">
73
+ {{# if(d.category === 1){ }}
74
+ <span>管培</span>
75
+ {{# } else if(d.category === 2){ }}
76
+ <span>全职</span>
77
+ {{# } else if(d.category === 3){ }}
78
+ <span>专职</span>
79
+ {{# } }}
80
+ </script>
81
+
82
+ <script type="text/html" id="show_level">
83
+ {{# if(d.level === 1){ }}
84
+ <span>不明确</span>
85
+ {{# } else if(d.level === 2){ }}
86
+ <span>重要紧急</span>
87
+ {{# } else if(d.level === 3){ }}
88
+ <span>重要不紧急</span>
89
+ {{# } else if(d.level === 4){ }}
90
+ <span>不重要紧急</span>
91
+ {{# } else if(d.level === 5){ }}
92
+ <span>不重要不紧急</span>
93
+ {{# } }}
94
+ </script>
95
+ <script type="text/html" id="show_state">
96
+ {{# if(d.shixun_status === 1){ }}
97
+ <span>待建设</span>
98
+ {{# } else if(d.shixun_status === 2){ }}
99
+ <span>已签协议</span>
100
+ {{# } else if(d.shixun_status === 3){ }}
101
+ <span>建设中</span>
102
+ {{# } else if(d.shixun_status === 4){ }}
103
+ <span>审核中</span>
104
+ {{# } else if(d.shixun_status === 5){ }}
105
+ <span>返修中</span>
106
+ {{# } else if(d.shixun_status === 6){ }}
107
+ <span>已内部发布</span>
108
+ {{# } else if(d.shixun_status === 7){ }}
109
+ <span>已公开发布</span>
110
+ {{# } }}
111
+ </script>
112
+ <script src="/markdown/marked.min.js" type="text/javascript" charset="utf-8"></script>
113
+ <script>
114
+ layui.config({
115
+ base: '/markdown/mods/' //存放layui拓展模块的目录位置
116
+ }).use(['form', 'table', 'miniPage', 'element', 'laydate', 'dropdown', 'easyeditor'], function () {
117
+ var laydate = layui.laydate,
118
+ form = layui.form,
119
+ table = layui.table,
120
+ miniPage = layui.miniPage,
121
+ easyeditor = layui.easyeditor
122
+ easyeditor.render({
123
+ elem: ".easyeditor-content"
124
+ });
125
+ var cols_table = [
126
+ [
127
+ {
128
+ field: 'id',
129
+ minWidth: 60,
130
+ title: '序号',
131
+ type: 'numbers',
132
+ fixed: 'left',
133
+ align: 'center'
134
+ },
135
+ {
136
+ field: 'category',
137
+ title: '标签',
138
+ align: 'center',
139
+ templet: '#category_list',
140
+ },
141
+ {
142
+ field: 'school_name',
143
+ title: '交付单位',
144
+ align: 'center',
145
+ minWidth: 100
146
+
147
+ },
148
+ {
149
+ field: 'shixun_name',
150
+ title: '实践项目名称',
151
+ minWidth: 200,
152
+ align: 'center'
153
+ },
154
+ {
155
+ field: 'shixun_producer',
156
+ title: '实训制作人',
157
+ minWidth: 200,
158
+ align: 'center'
159
+ },
160
+ {
161
+ field: 'shixun_manages',
162
+ title: '课程组长',
163
+ minWidth: 200,
164
+ align: 'center'
165
+ },
166
+ {
167
+ field: 'level',
168
+ title: '项目级别',
169
+ width: 150,
170
+ align: 'center',
171
+ templet: '#show_level'
172
+ },
173
+ {
174
+ field: 'deliver_date',
175
+ title: '交付时间',
176
+ width: 180,
177
+ templet: `<span>{{=new Date(d.deliver_date).toLocaleString('zh-CN')}}</span>`,
178
+ align: 'center'
179
+ },
180
+ {
181
+ field: 'deliver_money',
182
+ title: '金额',
183
+ minWidth: 100,
184
+ align: 'center'
185
+ },
186
+ {
187
+ field: 'shixun_status',
188
+ title: '项目状态',
189
+ align: 'center',
190
+ minWidth: 100,
191
+ templet: '#show_state'
192
+ },
193
+ {
194
+ title: '操作',
195
+ width: 200,
196
+ toolbar: '#shixun_table_bar',
197
+ align: "center",
198
+ fixed: 'right'
199
+ }
200
+ ]
201
+ ]
202
+ var data = form.val("search_form");
203
+ //默认显示待审核的
204
+ data.index = 1
205
+ table.render({
206
+ elem: '#shixun_dectects_table',
207
+ where: {q: data},
208
+ url: '/missions/shixun_dectects',
209
+ cellMinWidth: 80,
210
+ cols: cols_table,
211
+ limit: 10,
212
+ limits: [10, 15, 20, 30, 40, 50, 60, 70, 80, 90],
213
+ page: true
214
+ })
215
+ var sort = {}, search = {};
216
+ // 监听搜索操作
217
+ form.on('submit(search_contract)', function (data) {
218
+ search = data.field
219
+ console.log(search)
220
+ table.reload('shixun_dectects_table', {
221
+ page: {
222
+ curr: 1
223
+ },
224
+ where: {q: search, sort: sort}
225
+ }, 'data');
226
+ return false;
227
+ });
228
+
229
+
230
+ table.on('tool(shixun_dectects_table)', function (obj) {
231
+ var data = obj.data;
232
+ // 编辑按钮监听
233
+ if (obj.event === 'pass') {
234
+ data.type = 1
235
+ $.ajax('/missions/shixun_dectects/examine', {
236
+ method: 'PUT',
237
+ data: data,
238
+ dataType: 'json',
239
+ success: function (res) {
240
+ var data = res.data;
241
+ if (res.success) {
242
+ table.reload('shixun_dectects_table', {
243
+ page: {
244
+ curr: 1
245
+ },
246
+ cols: cols_table,
247
+ where: {q: data}
248
+ })
249
+ }
250
+ }
251
+ })
252
+ return false;
253
+ } else if (obj.event === 'reject') {
254
+ data.type = 2
255
+
256
+ localStorage.setItem("reject_id", data.id)
257
+ var content = miniPage.getHrefContent('/missions/shixun_dectects/markdown');
258
+ var openWH = miniPage.getOpenWidthHeight();
259
+
260
+ var edit = layer.open({
261
+ title: '拒绝原因',
262
+ type: 1,
263
+ shade: 0.2,
264
+ maxmin: true,
265
+ shadeClose: true,
266
+ area: ['900px', '550px'],
267
+ // offset: [openWH[2] + 'px', openWH[3] + 'px'],
268
+ content: content
269
+ });
270
+ $(window).on("resize", function () {
271
+ });
272
+ return false;
273
+ } else if (obj.event === 'info') {
274
+ var text = `<div class="layui-timeline" style="margin: 40px">`
275
+ data.audit_history.forEach((item) => {
276
+ text += `<div class="layui-timeline-item">
277
+ <i class="layui-icon layui-timeline-axis"></i>
278
+ <div class="layui-timeline-content layui-text">
279
+ <h3 class="layui-timeline-title">` + new Date(item.created_at).toLocaleString('zh-CN') +
280
+ `-----` + item.examine_name + `</h3>
281
+ <p>
282
+ 审核状态:驳回
283
+ </p>
284
+ <p>
285
+ 拒绝原因:
286
+ <div class="markdown_list" >` + item.content + `</div>
287
+ </p>
288
+ </div>
289
+ </div>`
290
+ })
291
+ text += `</div>`
292
+
293
+ layer.open({
294
+ type: 1,
295
+ title: '审核记录',
296
+ area: ['900px', '500px'], // 宽高
297
+ content: text,
298
+ move: '#ID-test-layer-move'
299
+ });
300
+ easyeditor.render({
301
+ elem: ".markdown_list"
302
+ });
303
+ return false
304
+ } else if (obj.event === "examine") {
305
+ var text = `<div class="layui-timeline" style="margin: 40px"><div class="layui-timeline-item">
306
+ <i class="layui-icon layui-timeline-axis"></i>
307
+ <div class="layui-timeline-content layui-text">
308
+
309
+ <p>
310
+ 审核状态:驳回
311
+ </p>
312
+ <p>
313
+ 拒绝原因:
314
+ <div class="markdown_list" >` + data.content + `</div>
315
+ </p>
316
+ </div>
317
+ </div></div>`
318
+
319
+ layer.open({
320
+ type: 1,
321
+ title: '审核反馈',
322
+ area: ['900px', '500px'], // 宽高
323
+ content: text,
324
+ move: '#ID-test-layer-move'
325
+ });
326
+ easyeditor.render({
327
+ elem: ".markdown_list"
328
+ });
329
+ }
330
+
331
+ });
332
+
333
+ form.on('submit(shixun_dectects_table)', function (data) {
334
+ search = data.field
335
+ console.log(search)
336
+ table.reload('table', {
337
+ page: {
338
+ curr: 1
339
+ },
340
+ where: {q: search, sort: sort}
341
+ }, 'data');
342
+ return false;
343
+ });
344
+
345
+ //控制顶部的待审核 和已审核
346
+ for (let i = 1; i <= 2; i++) {
347
+
348
+ if (i !== 2) {
349
+ $("#index_" + i).click(function () {
350
+ data.index = i
351
+ table.reload('shixun_dectects_table', {
352
+ page: {
353
+ curr: 1
354
+ },
355
+ cols: cols_table,
356
+ where: {q: data}
357
+ })
358
+ });
359
+ } else {
360
+ $("#index_" + i).click(function () {
361
+ var arr = [
362
+ [
363
+ {
364
+ field: 'id',
365
+ minWidth: 60,
366
+ title: '序号',
367
+ type: 'numbers',
368
+ fixed: 'left',
369
+ align: 'center'
370
+ },
371
+ {
372
+ field: 'category',
373
+ title: '标签',
374
+ align: 'center',
375
+ templet: '#category_list',
376
+ },
377
+ {
378
+ field: 'school_name',
379
+ title: '交付单位',
380
+ align: 'center',
381
+ minWidth: 100
382
+
383
+ },
384
+ {
385
+ field: 'shixun_name',
386
+ title: '实践项目名称',
387
+ minWidth: 200,
388
+ align: 'center'
389
+ },
390
+ {
391
+ field: 'shixun_manages',
392
+ title: '课程负责人',
393
+ minWidth: 200,
394
+ align: 'center'
395
+ },
396
+ {
397
+ field: 'shixun_producer',
398
+ title: '实训制作人',
399
+ minWidth: 200,
400
+ align: 'center'
401
+ },
402
+ {
403
+ field: 'level',
404
+ title: '项目级别',
405
+ width: 150,
406
+ align: 'center',
407
+ templet: '#show_level'
408
+ },
409
+ {
410
+ field: 'deliver_date',
411
+ title: '交付时间',
412
+ width: 180,
413
+ templet: `<span>{{=new Date(d.deliver_date).toLocaleString('zh-CN')}}</span>`,
414
+ align: 'center'
415
+ },
416
+ {
417
+ field: 'deliver_money',
418
+ title: '金额',
419
+ minWidth: 100,
420
+ align: 'center'
421
+ },
422
+ {
423
+ field: 'real_name',
424
+ title: '审核人',
425
+ align: 'center',
426
+ minWidth: 100,
427
+ },
428
+ {
429
+ title: '审核反馈',
430
+ templet: ".markdown",
431
+ align: 'center',
432
+ minWidth: 100,
433
+ },
434
+ {
435
+ title: '状态',
436
+ width: 200,
437
+ toolbar: '#shixun_dectect_type',
438
+ align: "center",
439
+ fixed: 'right'
440
+ }
441
+ ]
442
+ ]
443
+
444
+
445
+ data.index = i
446
+ table.reload('shixun_dectects_table', {
447
+ page: {
448
+ curr: 1
449
+ },
450
+ cols: arr,
451
+ where: {q: data},
452
+ success: (res) => {
453
+ easyeditor.render({
454
+ elem: ".markdown_list"
455
+ });
456
+ }
457
+ })
458
+
459
+ });
460
+ }
461
+
462
+ }
463
+
464
+
465
+ });
466
+ </script>
@@ -0,0 +1,22 @@
1
+ json.data do
2
+ json.array! @shixun_dectects do |d|
3
+ json.audit_history d.audit_history
4
+ json.content d.content
5
+ json.shixun_manages d.shixun_manages
6
+ json.shixun_producer d.shixun_producer
7
+ json.shixun_staff d.shixun_staff
8
+ json.type d.shixun_type
9
+ json.deliver_date d.deliver_date
10
+ json.deliver_money d.deliver_money
11
+ json.category d.category
12
+ json.school_name d.school_name
13
+ json.shixun_name d.shixun_name
14
+ json.shixun_status d.shixun_status
15
+ json.real_name d.real_name
16
+ json.dectect_type d.dectect_type
17
+ json.level d.level
18
+ json.id d.id
19
+ end
20
+ end
21
+ json.code 0
22
+ json.count @shixun_dectects.total_count
@@ -0,0 +1,60 @@
1
+ <div style="margin: 20px;margin-bottom: 50px">
2
+ <p style="font-size: 30px;margin-bottom: 10px">原因:</p>
3
+ <div>
4
+ <form class="layui-form layui-form-pane" lay-filter="search_form">
5
+ <textarea id="L_content" name="content" style="" required lay-verify="required" class="layui-textarea editor"></textarea>
6
+ </form>
7
+ </div>
8
+
9
+ <div style="margin: 20px;float: right">
10
+ <button class="layui-btn layui-btn-normal" lay-submit lay-filter="saveBtn">确认</button>
11
+ <button class="layui-btn layui-btn-normal" lay-submit lay-filter="exit">取消</button>
12
+ </div>
13
+ </div>
14
+ <script src="/markdown/marked.min.js" type="text/javascript" charset="utf-8"></script>
15
+ <script>
16
+ layui.config({
17
+ base: '/markdown/mods/' //存放layui拓展模块的目录位置
18
+ }).use(['easyeditor','form','table'], function () {
19
+ var table = layui.table
20
+ var easyeditor = layui.easyeditor;
21
+ var form = layui.form
22
+ //初始化Markdown编辑器
23
+ easyeditor.init({
24
+ elem: '.editor' //textarea 元素class
25
+ , uploadUrl: '/api/attachments/' //图片上传地址
26
+ , uploadSize: '' //限制的上传大小 单位kb 默认 1024k
27
+
28
+ });
29
+ form.on('submit(saveBtn)', function (data) {
30
+ console.log(form.val())
31
+ var id = localStorage.getItem("reject_id")
32
+
33
+ let new_data = form.val();
34
+ new_data.type = 2
35
+ new_data.id = id
36
+ $.ajax('/missions/shixun_dectects/examine', {
37
+ method: 'PUT',
38
+ data: new_data,
39
+ dataType: 'json',
40
+ success: function (res) {
41
+ if (res.success) {
42
+ layer.closeAll();
43
+ table.reload('shixun_dectects_table', {
44
+ done: function () {
45
+ }
46
+ });
47
+ }
48
+ },
49
+ error: function (res) {
50
+ layer.msg('更新失败');
51
+ }
52
+ })
53
+ });
54
+
55
+ form.on('submit(exit)', function (data) {
56
+ layer.closeAll()
57
+ });
58
+
59
+ });
60
+ </script>