educode_sales 1.10.48 → 1.10.58

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) 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 +22 -0
  5. data/app/controllers/educode_sales/business_courses_controller.rb +255 -0
  6. data/app/controllers/educode_sales/businesses_controller.rb +43 -7
  7. data/app/controllers/educode_sales/contracts_controller.rb +6 -0
  8. data/app/controllers/educode_sales/home_controller.rb +7 -0
  9. data/app/controllers/educode_sales/money_plan_records_controller.rb +6 -2
  10. data/app/controllers/educode_sales/money_plans_controller.rb +3 -0
  11. data/app/controllers/educode_sales/sale_trends_controller.rb +1 -1
  12. data/app/controllers/educode_sales/shixun_dectects_controller.rb +172 -0
  13. data/app/controllers/educode_sales/shixuns_controller.rb +218 -0
  14. data/app/controllers/educode_sales/subject_trends_controller.rb +144 -0
  15. data/app/controllers/educode_sales/subjects_controller.rb +213 -0
  16. data/app/helpers/educode_sales/application_helper.rb +10 -0
  17. data/app/helpers/educode_sales/business_courses_helper.rb +60 -0
  18. data/app/helpers/educode_sales/sale_trends_helper.rb +52 -52
  19. data/app/helpers/educode_sales/subject_helper.rb +33 -0
  20. data/app/models/educode_sales/business.rb +22 -0
  21. data/app/models/educode_sales/business_deliver_subject.rb +49 -0
  22. data/app/models/educode_sales/business_subject.rb +68 -0
  23. data/app/models/educode_sales/business_subject_shixun.rb +75 -0
  24. data/app/models/educode_sales/business_subject_staff.rb +36 -0
  25. data/app/models/educode_sales/permission.rb +2 -1
  26. data/app/models/educode_sales/shixun_dectect.rb +12 -0
  27. data/app/views/educode_sales/business_courses/edit.html.erb +174 -0
  28. data/app/views/educode_sales/business_courses/index.html.erb +334 -0
  29. data/app/views/educode_sales/business_courses/index.json.jbuilder +16 -0
  30. data/app/views/educode_sales/business_courses/list_shixuns.html.erb +292 -0
  31. data/app/views/educode_sales/business_courses/list_shixuns.json.jbuilder +23 -0
  32. data/app/views/educode_sales/business_courses/list_subjects.html.erb +212 -0
  33. data/app/views/educode_sales/business_courses/list_subjects.json.jbuilder +17 -0
  34. data/app/views/educode_sales/business_courses/new.html.erb +237 -0
  35. data/app/views/educode_sales/businesses/index.html.erb +11 -9
  36. data/app/views/educode_sales/contracts/_list.html.erb +16 -1
  37. data/app/views/educode_sales/contracts/index.html.erb +5 -2
  38. data/app/views/educode_sales/contracts/list.js.erb +4 -1
  39. data/app/views/educode_sales/money_plan_records/_index.html.erb +21 -5
  40. data/app/views/educode_sales/money_plan_records/index.js.erb +4 -1
  41. data/app/views/educode_sales/money_plans/list.html.erb +6 -2
  42. data/app/views/educode_sales/sale_trends/_return_money_forecast.html.erb +1 -1
  43. data/app/views/educode_sales/sale_trends/_user_stat.html.erb +1 -1
  44. data/app/views/educode_sales/sale_trends/_visit_analysis.html.erb +1 -1
  45. data/app/views/educode_sales/sale_trends/return_money_forecast.js.erb +1 -1
  46. data/app/views/educode_sales/sale_trends/trends.html.erb +6 -6
  47. data/app/views/educode_sales/sale_trends/user_stat.js.erb +1 -1
  48. data/app/views/educode_sales/sale_trends/visit_analysis.js.erb +1 -1
  49. data/app/views/educode_sales/shixun_dectects/index.html.erb +516 -0
  50. data/app/views/educode_sales/shixun_dectects/index.json.jbuilder +23 -0
  51. data/app/views/educode_sales/shixun_dectects/markdown.html.erb +60 -0
  52. data/app/views/educode_sales/shixuns/edit.html.erb +208 -0
  53. data/app/views/educode_sales/shixuns/index.html.erb +723 -0
  54. data/app/views/educode_sales/shixuns/index.json.jbuilder +26 -0
  55. data/app/views/educode_sales/shixuns/new.html.erb +261 -0
  56. data/app/views/educode_sales/subject_trends/trends.html.erb +676 -0
  57. data/app/views/educode_sales/subjects/edit.html.erb +86 -0
  58. data/app/views/educode_sales/subjects/index.html.erb +285 -0
  59. data/app/views/educode_sales/subjects/index.json.jbuilder +16 -0
  60. data/app/views/educode_sales/subjects/list_shixuns.html.erb +354 -0
  61. data/app/views/educode_sales/subjects/list_shixuns.json.jbuilder +22 -0
  62. data/app/views/educode_sales/subjects/new.html.erb +254 -0
  63. data/app/views/layouts/educode_sales/application.html.erb +38 -0
  64. data/config/routes.rb +37 -0
  65. data/lib/educode_sales/version.rb +1 -1
  66. metadata +42 -7
  67. data/app/assets/images/educode_sales/indexlogo.png +0 -0
@@ -0,0 +1,334 @@
1
+ <!-- 商机交付课程静态页面-->
2
+
3
+ <div class="min-height-table">
4
+ <div style="margin: 10px 10px 10px 10px">
5
+ <form class="layui-form layui-form-pane" lay-filter="search_bussiness_courses">
6
+ <div class="layui-inline show_item_contract">
7
+ <label class="layui-form-label">交付状态</label>
8
+ <div class="layui-input-inline">
9
+ <%= select_tag "state", options_for_select(
10
+ [["全部", 0], ["待建设", 1], ["已签协议", 2], ["建设中", 3],
11
+ ["已完成", 4], ["已交付", 5], ["已验收", 6]],selected:0
12
+ ), { include_blank: true } %>
13
+ </div>
14
+ </div>
15
+ <div class="layui-inline">
16
+ <label class="layui-form-label">商机名称</label>
17
+ <div class="layui-input-inline">
18
+ <input type="text" class="layui-input" name="name" >
19
+ </div>
20
+ </div>
21
+ <div class="layui-inline">
22
+ <label class="layui-form-label">交付时间</label>
23
+ <div class="layui-input-inline">
24
+ <input type="text" class="layui-input" name="time" id="ID-laydate-demo" placeholder="yyyy-MM-dd">
25
+ </div>
26
+ </div>
27
+ <div class="layui-inline">
28
+ <button type="reset" class="layui-btn layui-btn-primary" lay-submit lay-filter="reset_business_search">重置
29
+ </button>
30
+ <button type="submit" id="search_bt" class="layui-btn layui-btn-primary" lay-submit lay-filter="search_bussiness_courses">搜索
31
+ </button>
32
+ </div>
33
+ </form>
34
+ </div>
35
+
36
+ <div id="contact_table_wraper">
37
+ <table class="layui-hide" id="table" lay-filter="contact_table"></table>
38
+ </div>
39
+
40
+ </div>
41
+ <script type="text/html" id="currentTableBar">
42
+ <a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="edit">编辑</a>
43
+ </script>
44
+
45
+ <script type="text/html" id="bussinessBar">
46
+ <div class="layui-btn-container">
47
+ <span class="table-label">交付课程列表</span>
48
+ <button class="layui-btn layui-btn-sm pull-right" lay-event="add_courses">
49
+ 添加交付课程
50
+ </button>
51
+ <button class="layui-btn layui-btn-primary layui-border-green layui-btn-sm pull-right project_list-btn" lay-event="list">
52
+ 导出数据
53
+ </button>
54
+ </div>
55
+ </script>
56
+ <script type="text/html" id="show_phone_number">
57
+ <!-- <span type="text" id="{{= d.p_sale_staff1 + d.id}}"-->
58
+ <!-- onmouseover="show('手机号:13711111111'+'{{= d.id}}','{{=d.p_sale_staff1 + d.id}}')"-->
59
+ <!-- onmouseleave="close_tips()">-->
60
+ {{= d.subject_manages }}
61
+ <!-- </span>-->
62
+ </script>
63
+
64
+ <!-- constructed:待建设, signed: 已签协议,construction: 建设中,completed: 已完成,delivered: 已交付, accepted: 已验收-->
65
+ <script type="text/html" id="show_state">
66
+ {{# if(d.state === 'constructed'){ }}
67
+ <span style="color: rgb(173,177,184)">待建设</span>
68
+ {{# } else if(d.state === 'signed'){ }}
69
+ <span style="color: rgb(240,158,33)">已签协议</span>
70
+ {{# } else if(d.state === 'construction'){ }}
71
+ <span style="color: rgb(40,161,227)">建设中</span>
72
+ {{# } else if(d.state === 'completed'){ }}
73
+ <span style="color: rgb(40,95,220)">已完成</span>
74
+ {{# } else if(d.state === 'delivered'){ }}
75
+ <span style="color: rgb(0,177,135)">已交付</span>
76
+ {{# } else if(d.state === 'accepted'){ }}
77
+ <span style="color: rgb(0,177,135)">已验收</span>
78
+ {{# } }}
79
+ </script>
80
+
81
+ <script type="text/html" id="show_list_subjects">
82
+ <a lay-event="show_list_subjects" style="color: deepskyblue">{{= d.subject_progress }}</a>
83
+ </script>
84
+ <script type="text/html" id="show_list_shixuns">
85
+ <a lay-event="show_list_shixuns" style="color: deepskyblue">{{= d.shixun_progress }}</a>
86
+ </script>
87
+ <script>
88
+ function show(msg, id) {
89
+ layer.tips('' + msg, '#' + id, {tips: [1, 'black']});
90
+ }
91
+
92
+ function close_tips() {
93
+ layer.closeAll('tips');
94
+ }
95
+
96
+
97
+ layui.use(['form', 'table', 'miniPage', 'element', 'laydate', 'dropdown',"jquery"], function () {
98
+ var laydate = layui.laydate,
99
+ form = layui.form,
100
+ table = layui.table,
101
+ $ = layui.$,
102
+ miniPage = layui.miniPage
103
+
104
+
105
+
106
+ laydate.render({
107
+ elem: '#ID-laydate-demo',
108
+ range: true
109
+ });
110
+
111
+ var cols_table = [
112
+ [
113
+ {
114
+ field: 'id',
115
+ minWidth: 60,
116
+ title: '序号',
117
+ type: 'numbers',
118
+ fixed:'left',
119
+ align: 'center'
120
+ },
121
+ {
122
+ field: 'name',
123
+ title: '商机名称',
124
+ align: 'center',
125
+ minWidth: 100
126
+ },
127
+ {
128
+ field: 'school',
129
+ title: '交付单位',
130
+ align: 'center',
131
+ minWidth: 100
132
+
133
+ },
134
+ {
135
+ field: 'subject_progress',
136
+ title: '实践课程数(已完成数)',
137
+ templet: '#show_list_subjects',
138
+ minWidth: 200,
139
+ align: 'center'
140
+ },
141
+ {
142
+ field: 'shixun_progress',
143
+ title: '实践项目总数(已完成数)',
144
+ templet: '#show_list_shixuns',
145
+ minWidth: 200,
146
+ align: 'center'
147
+ },
148
+ {
149
+ field: 'time',
150
+ title: '交付时间',
151
+ align: 'center'
152
+ },
153
+ {
154
+ field: 'state',
155
+ title: '交付状态',
156
+ templet: '#show_state',
157
+ align: 'center'
158
+ },
159
+ {
160
+ field: 'staff_name',
161
+ title: '销售',
162
+ minWidth: 100,
163
+ align: 'center'
164
+ },
165
+ {
166
+ field: 'subject_manages',
167
+ title: '课程经理',
168
+ align: 'center',
169
+ minWidth: 100,
170
+ templet: '#show_phone_number'
171
+ },
172
+ {
173
+ title: '操作',
174
+ width: 50,
175
+ toolbar: '#currentTableBar',
176
+ align: "center",
177
+ fixed: 'right'
178
+ }
179
+ ]
180
+ ]
181
+ var tableDataCount = 0
182
+ table.render({
183
+ elem: '#table',
184
+ title: '商机交付课程列表',
185
+ where: {q: form.val()},
186
+ url: '/missions/business_courses',
187
+ // data: temp_data,
188
+ cellMinWidth: 80,
189
+ toolbar: '#bussinessBar',
190
+ defaultToolbar: [],
191
+ cols: cols_table,
192
+ limit: 10,
193
+ limits: [10, 15, 20, 30, 40, 50, 60, 70, 80, 90],
194
+ page: true,
195
+ done: function(res, curr, count){
196
+ tableDataCount = count;//记录所有数据数量
197
+ }
198
+ })
199
+ var sort = {}, search = {};
200
+ // 监听搜索操作
201
+ form.on('submit(search_bussiness_courses)', function (data) {
202
+ search = data.field
203
+ console.log(search)
204
+ table.reload('table', {
205
+ page: {
206
+ curr: 1
207
+ },
208
+ where: {q: search, sort: sort}
209
+ }, 'data');
210
+ return false;
211
+ });
212
+
213
+ // 重置
214
+ form.on('submit(reset_business_search)', function (data) {
215
+ table.reload('table', {
216
+ page: {
217
+ curr: 1
218
+ },
219
+ where: {q: {}}
220
+ }, 'data');
221
+ $(".layui-form")[0].reset();
222
+ form.render()
223
+ return false;
224
+ });
225
+ table.on('tool(contact_table)', function (obj) {
226
+ var data = obj.data;
227
+ // 编辑按钮监听
228
+ if (obj.event === 'edit') {
229
+
230
+ var content = miniPage.getHrefContent('/missions/business_courses/' + data.id + '/edit');
231
+ var openWH = miniPage.getOpenWidthHeight();
232
+
233
+ var edit = layer.open({
234
+ title: '编辑商机交付课程',
235
+ type: 1,
236
+ shade: 0.2,
237
+ maxmin: true,
238
+ shadeClose: false,
239
+ area: [openWH[0] + 'px', openWH[1] + 'px'],
240
+ offset: [openWH[2] + 'px', openWH[3] + 'px'],
241
+ content: content
242
+ });
243
+ $(window).on("resize", function () {
244
+ });
245
+ return false;
246
+ } else if (obj.event === 'show_list_subjects') {
247
+ localStorage.setItem("business_delvier_subject_id",data.id)
248
+
249
+ var content = miniPage.getHrefContent('/missions/business_courses/list_subjects?id='+data.id );
250
+ var openWH = miniPage.getOpenWidthHeight();
251
+ list_courses = layer.open({
252
+ title: data.name + '-实践课程列表',
253
+ type: 1,
254
+ shade: 0.2,
255
+ maxmin: true,
256
+ shadeClose: false,
257
+ area: [openWH[0] + 'px', openWH[1] + 'px'],
258
+ offset: [openWH[2] + 'px', openWH[3] + 'px'],
259
+ content: content,
260
+ });
261
+ $(window).on("resize", function () {
262
+ });
263
+ return false;
264
+ } else if (obj.event === 'show_list_shixuns') {
265
+ localStorage.setItem("business_delvier_subject_id_shixuns",data.id)
266
+ var content = miniPage.getHrefContent('/missions/business_courses/list_shixuns?id='+data.id);
267
+ var openWH = miniPage.getOpenWidthHeight();
268
+ list_projects = layer.open({
269
+ title: data.name + '-实践项目列表',
270
+ type: 1,
271
+ shade: 0.2,
272
+ maxmin: true,
273
+ shadeClose: false,
274
+ area: [openWH[0] + 'px', openWH[1] + 'px'],
275
+ offset: [openWH[2] + 'px', openWH[3] + 'px'],
276
+ content: content,
277
+ });
278
+ $(window).on("resize", function () {
279
+ });
280
+ return false;
281
+ }
282
+
283
+ });
284
+
285
+
286
+ table.on('toolbar(contact_table)', function (obj) {
287
+ // 新增按钮监听
288
+ if (obj.event === 'add_courses') {
289
+ var content = miniPage.getHrefContent('/missions/business_courses/new');
290
+ var openWH = miniPage.getOpenWidthHeight();
291
+ console.log(openWH)
292
+ add_courses = layer.open({
293
+ title: '添加商机交付课程',
294
+ type: 1,
295
+ shade: 0.2,
296
+ maxmin: true,
297
+ shadeClose: false,
298
+ area: [openWH[0] + 'px', openWH[1] + 'px'],
299
+ offset: [openWH[2] + 'px', openWH[3] + 'px'],
300
+ content: content,
301
+ });
302
+ $(window).on("resize", function () {
303
+ });
304
+ return false;
305
+ }else if(obj.event === 'list'){
306
+ table.reload('table',{
307
+ page: 1,
308
+ limit:tableDataCount, //加载所有数据
309
+ done:function (){
310
+ //导出所有数据
311
+ table.exportFile("table",false,"xls");
312
+ //恢复数据分页显示
313
+ table.reload('table',{
314
+ page: 1,
315
+ limit:20,
316
+ done:function (res, curr, count){
317
+ tableDataCount = count;
318
+ }
319
+ })
320
+
321
+ }
322
+ })
323
+ }
324
+ });
325
+
326
+ });
327
+ </script>
328
+
329
+ <style>
330
+ .layui-table-tool-temp {
331
+ padding-right: 0px;
332
+ !important;
333
+ }
334
+ </style>
@@ -0,0 +1,16 @@
1
+ json.data do
2
+ json.array! @business_deliver do |deliver|
3
+ b = deliver.business
4
+ json.school handled_data b.school&.name
5
+ json.name handled_data b.name
6
+ json.state deliver.status
7
+ json.time handled_time_data deliver.delvier_date
8
+ json.id deliver.id
9
+ json.staff_name handled_data handled_data b.staff_name
10
+ json.subject_progress deliver.subject_competed_count
11
+ json.shixun_progress deliver.shixun_competed_count
12
+ json.subject_manages handled_data deliver.subject_manages
13
+ end
14
+ end
15
+ json.code 0
16
+ json.count @business_deliver.total_count
@@ -0,0 +1,292 @@
1
+ <style>
2
+ .layui-table-cell{
3
+ height: auto !important;
4
+ width: auto;
5
+ white-space: normal;
6
+ /*line-height: 28px;*/
7
+ }
8
+ </style>
9
+ <div class="min-height-table" style="margin: 20px">
10
+ <div>
11
+ <form class="layui-form layui-form-pane" id="list_shixun_search" lay-filter="list_shixun_search_form">
12
+ <div>
13
+ <div class="layui-inline show_item_contract borders">
14
+ <label class="layui-form-label">任务类型</label>
15
+ <div class="layui-input-inline">
16
+ <%= select_tag "category", options_for_select(
17
+ [["全部", 0], ["管培", 1], ["全职", 2], ["专职", 3]]
18
+ ), { include_blank: true } %>
19
+ </div>
20
+ </div>
21
+ <div class="layui-inline show_item_contract">
22
+ <label class="layui-form-label">项目级别</label>
23
+ <div class="layui-input-inline">
24
+ <%= select_tag "level", options_for_select(
25
+ [["全部", 0], ["不明确", 1], ["重要紧急", 2], ["重要不紧急", 3],
26
+ ["不重要紧急", 4], ["不重要不紧急", 5]], selected: 0
27
+ ), { include_blank: true } %>
28
+ </div>
29
+ </div>
30
+ <div class="layui-inline show_item_contract borders">
31
+ <label class="layui-form-label">项目状态</label>
32
+ <div class="layui-input-inline">
33
+ <%= select_tag "status", options_for_select(
34
+ [["全部", 0], ["待建设", 1], ["已签协议", 2], ["建设中", 3],
35
+ ["审核中", 4], ["返修中", 5], ["已内部发布", 6], ["已公开发布", 7],
36
+ ["已付费用",8],["审核通过",9]], selected: 0
37
+ ), { include_blank: true } %>
38
+ </div>
39
+ </div>
40
+
41
+ </div>
42
+ <div>
43
+ <div class="layui-inline borders">
44
+ <label class="layui-form-label" style="width: 150px">实践项目名称</label>
45
+ <div class="layui-input-inline">
46
+ <input type="text" name="shixun_name" class="layui-input">
47
+ </div>
48
+ </div>
49
+ <div class="layui-inline borders">
50
+ <label class="layui-form-label" style="width: 150px">实践课程名称</label>
51
+ <div class="layui-input-inline">
52
+ <input type="text" name="subject_name" class="layui-input">
53
+ </div>
54
+ </div>
55
+ <div class="layui-inline borders">
56
+ <button type="reset" class="layui-btn layui-btn-primary" lay-submit lay-filter="reset_business_search">重置
57
+ </button>
58
+ <button type="submit" id="search_list_shixuns_contract" class="layui-btn layui-btn-primary" lay-submit lay-filter="search_list_shixuns_contract">搜索
59
+ </button>
60
+ </div>
61
+ </div>
62
+
63
+ </form>
64
+ </div>
65
+
66
+ <div id="contact_table_wraper">
67
+ <table class="layui-hide" id="shixun_table" lay-filter="shixun_table"></table>
68
+ </div>
69
+
70
+ </div>
71
+
72
+
73
+
74
+ <script type="text/html" id="show_level">
75
+ {{# if(d.level === 1){ }}
76
+ <span>不明确</span>
77
+ {{# } else if(d.level === 2){ }}
78
+ <span>重要紧急</span>
79
+ {{# } else if(d.level === 3){ }}
80
+ <span>重要不紧急</span>
81
+ {{# } else if(d.level === 4){ }}
82
+ <span>不重要紧急</span>
83
+ {{# } else if(d.level === 5){ }}
84
+ <span>不重要不紧急</span>
85
+ {{# } }}
86
+ </script>
87
+ <script type="text/html" id="aherf">
88
+ {{# if(d.identifier !== null && d.identifier !== ''){ }}
89
+ <a target="_blank" style="color:deepskyblue" href="<%= @url %>/paths/{{= d.subjects_identifier}}">{{=d.subjects_name}}</a>
90
+ {{# } else { }}
91
+ <a style="color:deepskyblue" >{{=d.subjects_name}}</a>
92
+ {{# } }}
93
+ </script>
94
+ <script type="text/html" id="shixun_name_link">
95
+ {{# if(d.identifier !== null && d.identifier !== ''){ }}
96
+ <a target="_blank" style="color:deepskyblue" href='<%=@url %>/shixuns/{{=d.s_identifier}}/challenges'>{{=d.shixun_name}}</a>
97
+ {{# } else { }}
98
+ <a style="color:deepskyblue" >{{=d.shixun_name}}</a>
99
+ {{# } }}
100
+ </script>
101
+
102
+ <script type="text/html" id="show_type">
103
+ {{# if(d.shixun_type === 1){ }}
104
+ <span>管培</span>
105
+ {{# } else if(d.shixun_type === 2){ }}
106
+ <span>全职</span>
107
+ {{# } else if(d.shixun_type === 3){ }}
108
+ <span>专职</span>
109
+ {{# } }}
110
+ </script>
111
+
112
+
113
+
114
+ <script>
115
+ function extractFirstTenCharsAndImage(markdownText) {
116
+ let firstTenChars = '';
117
+ let imageTag = '';
118
+ // 行内图片的正则表达式
119
+ const inlineImageRegex = /!\[.*?\]\((.*?)\)/g;
120
+ // 处理行内图片
121
+ markdownText = markdownText.replace(inlineImageRegex, (_, imagePath) => {
122
+ // 如果匹配到行内图片,则生成图片标签,并将匹配的图片部分替换为空字符串
123
+ imageTag = `<img style="max-height: 100px" src="${imagePath}" />`;
124
+ return '';
125
+ });
126
+ // 去除Markdown格式,只保留纯文本内容
127
+ const pureText = markdownText.replace(/(^|\n)(\d+\.|)\s*/g, '$1').trim();
128
+ // 获取前十个字符
129
+ firstTenChars = pureText.substring(0, 10);
130
+ // 输出结果
131
+ return `<p>${firstTenChars}</p> ${imageTag}`
132
+ }
133
+ layui.use(['form', 'table', 'miniPage', 'element', 'laydate', 'dropdown'], function () {
134
+ var laydate = layui.laydate,
135
+ form = layui.form,
136
+ table = layui.table,
137
+ miniPage = layui.miniPage
138
+
139
+
140
+ laydate.render({
141
+ elem: '#ID-laydate-demo',
142
+ range:true
143
+ });
144
+
145
+ var data = form.val("search_form");
146
+
147
+ var cols_table = [
148
+ [
149
+ {
150
+ field: 'id',
151
+ width: 60,
152
+ title: '序号', type: 'numbers',
153
+ align: 'center'
154
+ },
155
+ {
156
+ field: 'subjects_name',
157
+ title: '实践课程名称',
158
+ width: 150,
159
+ align: 'center',
160
+ templet: "#aherf"
161
+ },
162
+ {
163
+ field: 'category',
164
+ title: '任务类型',
165
+ width: 150,
166
+ align: 'center',
167
+ },
168
+ {
169
+ field: 'shixun_name',
170
+ title: '实践项目名称',
171
+ width: 150,
172
+ align: 'center',
173
+ templet: '#shixun_name_link'
174
+ },
175
+ {
176
+ field: 'level',
177
+ title: '项目级别',
178
+ width: 150,
179
+ align: 'center',
180
+ // templet: '#show_level'
181
+ },
182
+ {
183
+ field: 'deliver_date',
184
+ title: '制作完成时间',
185
+ width: 150,
186
+ align: 'center'
187
+ },
188
+ {
189
+ field: 'shixun_status',
190
+ title: '项目状态',
191
+ width: 150,
192
+ align: 'center'
193
+ },
194
+ {
195
+ field: 'commit_dectect_time',
196
+ title: '提交审核时间',
197
+ width: 150,
198
+ align: 'center'
199
+ },
200
+ {
201
+ field: 'dectect_feedback',
202
+ title: '审核反馈',
203
+ width: 150,
204
+ align: 'center',
205
+ templet: (d)=>{
206
+ if(d.dectect_feedback){
207
+ return extractFirstTenCharsAndImage(d.dectect_feedback)
208
+ }
209
+ return ''
210
+ },
211
+ },
212
+ {
213
+ field: 'shixun_producer',
214
+ title: '项目制作人',
215
+ width: 150,
216
+ align: 'center'
217
+ },
218
+ {
219
+ field: 'shixun_manages',
220
+ title: '课程负责人',
221
+ width: 150,
222
+ align: 'center'
223
+ },
224
+ {
225
+ field: 'max_manage',
226
+ title: '课程组主管',
227
+ width: 150,
228
+ align: 'center'
229
+ }
230
+ ]
231
+ ]
232
+
233
+
234
+
235
+ var id = localStorage.getItem("business_delvier_subject_id_shixuns")
236
+ localStorage.removeItem("business_delvier_subject_id_shixuns")
237
+ var subject_id = localStorage.getItem("subject_id")
238
+ localStorage.removeItem("subject_id")
239
+ var url = ""
240
+ if(id !== '' && id !== null){
241
+ url = '/missions/business_courses/list_shixuns?id='+id
242
+ }else if(subject_id !== '' && subject_id !== null){
243
+ url = '/missions/business_courses/list_shixuns?subject_id='+subject_id
244
+ }
245
+ console.log(id)
246
+ console.log(subject_id)
247
+ var shixun_table = table.render({
248
+ elem: '#shixun_table',
249
+ url: url,
250
+ data: data,
251
+ autoSort: false,
252
+ where: {q: data},
253
+ title: '实践项目列表',
254
+ cols: cols_table,
255
+ limit: 10,
256
+ limits: [10, 15, 20, 30, 40, 50, 60, 70, 80, 90],
257
+ page: true,
258
+ skin: 'line'
259
+ });
260
+ // 重置
261
+ form.on('submit(reset_business_search)', function (data) {
262
+ table.reload('shixun_table', {
263
+ page: {
264
+ curr: 1
265
+ },
266
+ where: {q: {}}
267
+ }, 'data');
268
+ document.getElementById("list_shixun_search").reset();
269
+ form.render()
270
+ return false;
271
+ });
272
+
273
+ var data = form.val("list_shixun_search_form");
274
+ var sort = {}, search = {};
275
+ form.on('submit(search_list_shixuns_contract)', function (data) {
276
+ search = data.field
277
+ console.log(search)
278
+ table.reload('shixun_table', {
279
+ page: {
280
+ curr: 1
281
+ },
282
+ where: {q: search, sort: sort}
283
+ }, 'data');
284
+ return false;
285
+ });
286
+ });
287
+ </script>
288
+ <style>
289
+ .borders {
290
+ margin: 10px;
291
+ }
292
+ </style>
@@ -0,0 +1,23 @@
1
+ json.data do
2
+ json.array! @shixuns do |d|
3
+ json.shixun_manages handled_data d.shixun_manages
4
+ json.shixun_producer handled_data d.shixun_producer
5
+ json.shixun_staff handled_data d.shixun_staff
6
+ json.category real_shixun_category d.category
7
+ json.deliver_date handled_time_data d.deliver_date
8
+ json.shixun_name handled_data d.s_name
9
+
10
+ json.s_identifier handled_data d.s_identifier
11
+ json.shixun_status real_shixun_status d.shixun_status
12
+ json.level real_shixun_level d.level
13
+ json.deliver_date handled_time_data d.deliver_date
14
+ json.id d.id
15
+ json.subjects_name d.subjects_name
16
+ json.subjects_identifier d.subjects_identifier
17
+ json.max_manage "喻银凤"
18
+ json.dectect_feedback handled_data d.dectect_content
19
+ json.commit_dectect_time handled_time_data_accurate d.dectect_time
20
+ end
21
+ end
22
+ json.code 0
23
+ json.count @count