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,86 @@
1
+ <%= Gon::Base.render_data %>
2
+ <form class="layui-form" style="width: 90%;margin-top: 20px" lay-filter='test'>
3
+ <input style="display: none" value="<%=@id %>" name="id">
4
+ <input style="display: none" value="<%=@school_id %>" name="school_id">
5
+ <div class="layui-form-item">
6
+ <label class="layui-form-label" style="width: 98px;">实践课程名称:<span style="color: red"> *</span></label>
7
+ <div class="layui-input-block">
8
+ <input type="text" name="name"
9
+ lay-verify="required" disabled
10
+ value="<%= @item.name %>" class="layui-input"
11
+ style="width: 50%">
12
+ </div>
13
+ </div>
14
+ <div class="layui-form-item" >
15
+ <label class="layui-form-label" style="width: 98px">实践项目名称:</label>
16
+ <div class="layui-input-block" >
17
+ <div id="shixun_ids" style="width: 50%;margin-left: 19px"></div>
18
+ </div>
19
+ </div>
20
+
21
+
22
+
23
+ <div class="layui-form-item">
24
+ <label class="layui-form-label"></label>
25
+ <div class="layui-input-block">
26
+ <button class="layui-btn layui-btn-normal" lay-submit lay-filter="saveBtn">确认保存</button>
27
+ </div>
28
+ </div>
29
+ </form>
30
+ <script>
31
+ layui.use(['form', 'layer', 'laytpl', 'xmSelect', 'table'], function () {
32
+ var form = layui.form,
33
+ layer = layui.layer,
34
+ table = layui.table,
35
+ xmSelect = layui.xmSelect,
36
+ $ = layui.$
37
+
38
+
39
+ var shixun_ids = xmSelect.render({
40
+ el: '#shixun_ids',
41
+ name: "shixun_ids",
42
+ autoRow: true,
43
+ delay: 1000,
44
+ tips: '- -',
45
+ data:JSON.parse('<%=raw @select.to_json %>'),
46
+ filterable: true,
47
+ filterMethod: function(val, item, index, prop){
48
+ if(val === item.value){
49
+ return true;
50
+ }else if(item.name.indexOf(val) !== -1){
51
+ return true;
52
+ }
53
+ return false;
54
+ }
55
+ })
56
+ // 判断是否有值
57
+ <% if @default_select.present? %>
58
+ var select_ids = <%= @default_select %>
59
+ shixun_ids.setValue(select_ids)
60
+ <% end %>
61
+
62
+ // 保存编辑
63
+ form.on('submit(saveBtn)', function (data) {
64
+ console.log(form.val())
65
+ let new_data = form.val();
66
+ $.ajax('/missions/subjects/'+new_data.id, {
67
+ method: 'PUT',
68
+ data: new_data,
69
+ dataType: 'json',
70
+ success: function (res) {
71
+ if (res.success) {
72
+ layer.closeAll();
73
+ table.reload('table', {
74
+ done: function () {
75
+ }
76
+ });
77
+ }
78
+ },
79
+ error: function (res) {
80
+ layer.msg('更新失败');
81
+ }
82
+ })
83
+ return false;
84
+ });
85
+ });
86
+ </script>
@@ -0,0 +1,247 @@
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">
7
+ <label class="layui-form-label">交付时间</label>
8
+ <div class="layui-inline" id="ID-laydate-range">
9
+ <input type="text" class="layui-input" name="time" id="ID-laydate-demo" placeholder="yyyy-MM-dd">
10
+ </div>
11
+ </div>
12
+ <div class="layui-inline">
13
+ <label class="layui-form-label" style="width: 120px">实践课程名称</label>
14
+ <div class="layui-input-inline">
15
+ <input type="text" class="layui-input" name="subjects_name">
16
+ </div>
17
+ </div>
18
+ <div class="layui-inline">
19
+ <label class="layui-form-label" style="width: 120px">实践项目名称</label>
20
+ <div class="layui-input-inline">
21
+ <input type="text" class="layui-input" name="shixun">
22
+ </div>
23
+ </div>
24
+ <div class="layui-inline" style="margin-left: 20px">
25
+ <button type="reset" class="layui-btn layui-btn-primary" lay-submit lay-filter="reset_business_search">重置
26
+ </button>
27
+ <button type="submit" id="search_bt" class="layui-btn layui-btn-primary" lay-submit lay-filter="search_bussiness_courses">搜索
28
+ </button>
29
+ </div>
30
+ </form>
31
+ </div>
32
+
33
+ <div id="contact_table_wraper">
34
+ <table class="layui-hide" id="table" lay-filter="table"></table>
35
+ </div>
36
+
37
+ </div>
38
+ <script type="text/html" id="currentTableBar">
39
+ <a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="edit">编辑</a>
40
+ </script>
41
+
42
+ <script type="text/html" id="bussinessBar">
43
+ <div class="layui-btn-container">
44
+ <span class="table-label">实践课程列表</span>
45
+ <button class="layui-btn layui-btn-sm pull-right" lay-event="add">
46
+ 添加实践课程
47
+ </button>
48
+ <button class="layui-btn layui-btn-primary layui-border-green layui-btn-sm pull-right project_list-btn" lay-event="list">
49
+ 导出数据
50
+ </button>
51
+ </div>
52
+ </script>
53
+
54
+ <script type="text/html" id="statusBar">
55
+ {{# if(d.public === 2){ }}
56
+ <span>已公开</span>
57
+ {{# } else if(d.public === 0){ }}
58
+ <span>编辑中</span>
59
+ {{# } else if(d.status === 1){ }}
60
+ <span>审核中</span>
61
+ {{# } else if(d.status === 2) { }}
62
+ <span>已发布</span>
63
+ {{# } }}
64
+ </script>
65
+
66
+ <script type="text/html" id="link_shixuns">
67
+ <a lay-event="link_shixuns" style="color: deepskyblue">{{= d.shixun_progress }}</a>
68
+ </script>
69
+
70
+ <script>
71
+ layui.use(['form', 'table', 'miniPage', 'element', 'laydate', 'dropdown'], function () {
72
+ var laydate = layui.laydate,
73
+ form = layui.form,
74
+ table = layui.table,
75
+ miniPage = layui.miniPage
76
+
77
+
78
+ laydate.render({
79
+ elem: '#ID-laydate-demo',
80
+ range: true
81
+ });
82
+
83
+ var cols_table = [
84
+ [
85
+ {
86
+ field: 'id',
87
+ minWidth: 60,
88
+ title: '序号',
89
+ type: 'numbers',
90
+ fixed: 'left',
91
+ align: 'center'
92
+ },
93
+ {
94
+ field: 's_name',
95
+ title: '实践课程名称',
96
+ align: 'center',
97
+ minWidth: 200
98
+ },
99
+ {
100
+ field: 'shixun_progress',
101
+ title: '实践项目数(已完成数)',
102
+ align: 'center',
103
+ minWidth: 100,
104
+ templet: '#link_shixuns'
105
+
106
+ },
107
+ {
108
+ field: 'deliver_date',
109
+ title: '交付时间',
110
+ minWidth: 80,
111
+ align: 'center'
112
+ },
113
+ {
114
+ field: 'status',
115
+ title: '状态',
116
+ minWidth: 50,
117
+ align: 'center',
118
+ templet: '#statusBar'
119
+ },
120
+ {
121
+ field: 'b_name',
122
+ title: '商机名称',
123
+ minWidth: 200,
124
+ align: 'center'
125
+ },
126
+ {
127
+ field: 'school_name',
128
+ title: '交付单位',
129
+ templet: '#show_state',
130
+ align: 'center'
131
+ },
132
+ {
133
+ field: 'staff_name',
134
+ title: '销售',
135
+ minWidth: 100,
136
+ align: 'center'
137
+ },
138
+ {
139
+ field: 'mange_name',
140
+ title: '课程经理',
141
+ align: 'center',
142
+ minWidth: 100,
143
+ },
144
+ {
145
+ title: '操作',
146
+ width: 50,
147
+ toolbar: '#currentTableBar',
148
+ align: "center",
149
+ fixed: 'right'
150
+ }
151
+ ]
152
+ ]
153
+
154
+ table.render({
155
+ elem: '#table',
156
+ where: {q: form.val()},
157
+ url: '/missions/subjects',
158
+ cellMinWidth: 80,
159
+ toolbar: '#bussinessBar',
160
+ defaultToolbar: [],
161
+ cols: cols_table,
162
+ limit: 10,
163
+ limits: [10, 15, 20, 30, 40, 50, 60, 70, 80, 90],
164
+ page: true
165
+ })
166
+ var sort = {}, search = {};
167
+ // 监听搜索操作
168
+ form.on('submit(search_bussiness_courses)', function (data) {
169
+ search = data.field
170
+ console.log(search)
171
+ table.reload('table', {
172
+ page: {
173
+ curr: 1
174
+ },
175
+ where: {q: search, sort: sort}
176
+ }, 'data');
177
+ return false;
178
+ });
179
+
180
+ table.on('tool(table)', function (obj) {
181
+ var data = obj.data;
182
+ console.log(data)
183
+ // 编辑按钮监听
184
+ if (obj.event === 'edit') {
185
+
186
+ var content = miniPage.getHrefContent('/missions/subjects/' + data.id + '/edit');
187
+ var openWH = miniPage.getOpenWidthHeight();
188
+
189
+ var edit = layer.open({
190
+ title: '编辑实践课程',
191
+ type: 1,
192
+ shade: 0.2,
193
+ maxmin: true,
194
+ shadeClose: true,
195
+ area: [openWH[0] + 'px', openWH[1] + 'px'],
196
+ offset: [openWH[2] + 'px', openWH[3] + 'px'],
197
+ content: content
198
+ });
199
+ $(window).on("resize", function () {
200
+ });
201
+ return false;
202
+ }else if (obj.event === 'link_shixuns') {
203
+ localStorage.setItem("link_shixuns_id",data.id)
204
+ var content = miniPage.getHrefContent('/missions/subjects/list_shixuns?id='+data.id);
205
+ var openWH = miniPage.getOpenWidthHeight();
206
+
207
+ var edit = layer.open({
208
+ title: data.s_name + ' - 实践项目列表',
209
+ type: 1,
210
+ shade: 0.2,
211
+ maxmin: true,
212
+ shadeClose: true,
213
+ area: [openWH[0] + 'px', openWH[1] + 'px'],
214
+ offset: [openWH[2] + 'px', openWH[3] + 'px'],
215
+ content: content
216
+ });
217
+ $(window).on("resize", function () {
218
+ });
219
+ return false;
220
+ }
221
+ });
222
+
223
+
224
+ table.on('toolbar(table)', function (obj) {
225
+ // 新增按钮监听
226
+ if (obj.event === 'add') {
227
+
228
+ var content = miniPage.getHrefContent('/missions/subjects/new');
229
+ var openWH = miniPage.getOpenWidthHeight();
230
+
231
+ var edit = 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
+ });
241
+ $(window).on("resize", function () {
242
+ });
243
+ return false;
244
+ }
245
+ });
246
+ });
247
+ </script>
@@ -0,0 +1,16 @@
1
+ json.data do
2
+ json.array! @business_subject do |d|
3
+ json.s_name handled_data d.s_name
4
+ json.deliver_date handled_time_data d.deliver_date
5
+ json.b_name handled_data d.b_name
6
+ json.status d.status
7
+ json.public d.public
8
+ json.school_name handled_data @business_subject_schools["#{d.id}"]
9
+ json.id d.id
10
+ json.staff_name handled_data @business_subject_staffs["#{d.id}"]
11
+ json.mange_name handled_data @business_subject_manges["#{d.id}"]
12
+ # json.shixun_progress d.shixun_compeled_count
13
+ end
14
+ end
15
+ json.code 0
16
+ json.count @count
@@ -0,0 +1,228 @@
1
+ <div class="min-height-table" style="margin: 20px">
2
+ <div>
3
+ <form class="layui-form layui-form-pane" lay-filter="search_form">
4
+ <div class="layui-inline show_item_contract borders">
5
+ <label class="layui-form-label">任务类型</label>
6
+ <div class="layui-input-inline">
7
+ <%= select_tag "category", options_for_select(
8
+ [["全部", 0], ["管培", 1], ["全职", 2], ["专职", 3]]
9
+ ), { include_blank: true } %>
10
+ </div>
11
+ </div>
12
+ <div class="layui-inline show_item_contract">
13
+ <label class="layui-form-label">项目级别</label>
14
+ <div class="layui-input-inline">
15
+ <%= select_tag "level", options_for_select(
16
+ [["全部", 0], ["不明确", 1], ["重要紧急", 2], ["重要不紧急", 3],
17
+ ["不重要紧急", 4], ["不重要不紧急", 5]], selected: 0
18
+ ), { include_blank: true } %>
19
+ </div>
20
+ </div>
21
+ <div class="layui-inline show_item_contract borders">
22
+ <label class="layui-form-label">项目状态</label>
23
+ <div class="layui-input-inline">
24
+ <%= select_tag "status", options_for_select(
25
+ [["全部", 0], ["待建设", 1], ["已签协议", 2], ["建设中", 3],
26
+ ["审核中", 4], ["返修中", 5], ["已内部发布", 6], ["已公开发布", 7]], selected: 0
27
+ ), { include_blank: true } %>
28
+ </div>
29
+ </div>
30
+
31
+ <br>
32
+ <div class="layui-inline borders">
33
+ <label class="layui-form-label" style="width: 120px">实践项目名称</label>
34
+ <div class="layui-input-inline">
35
+ <input type="text" name="shixun_name" class="layui-input">
36
+ </div>
37
+ </div>
38
+ <div class="layui-inline borders">
39
+ <button type="reset" class="layui-btn layui-btn-primary" lay-submit lay-filter="reset_business_search">重置
40
+ </button>
41
+ <button type="submit" id="search_bt" class="layui-btn layui-btn-primary" lay-submit lay-filter="search_shixun_contract">搜索
42
+ </button>
43
+ </div>
44
+ </form>
45
+ </div>
46
+
47
+ <div id="contact_table_wraper">
48
+ <table class="layui-hide" id="shixun_table" lay-filter="shixun_table"></table>
49
+ </div>
50
+
51
+ </div>
52
+
53
+
54
+ <script type="text/html" id="show_state">
55
+ {{# if(d.shixun_status === 1){ }}
56
+ <span>待建设</span>
57
+ {{# } else if(d.shixun_status === 2){ }}
58
+ <span>已签协议</span>
59
+ {{# } else if(d.shixun_status === 3){ }}
60
+ <span>建设中</span>
61
+ {{# } else if(d.shixun_status === 4){ }}
62
+ <span>审核中</span>
63
+ {{# } else if(d.shixun_status === 5){ }}
64
+ <span>返修中</span>
65
+ {{# } else if(d.shixun_status === 6){ }}
66
+ <span>已内部发布</span>
67
+ {{# } else if(d.shixun_status === 7){ }}
68
+ <span>已公开发布</span>
69
+ {{# } }}
70
+ </script>
71
+ <script type="text/html" id="show_level">
72
+ {{# if(d.level === 1){ }}
73
+ <span>不明确</span>
74
+ {{# } else if(d.level === 2){ }}
75
+ <span>重要紧急</span>
76
+ {{# } else if(d.level === 3){ }}
77
+ <span>重要不紧急</span>
78
+ {{# } else if(d.level === 4){ }}
79
+ <span>不重要紧急</span>
80
+ {{# } else if(d.level === 5){ }}
81
+ <span>不重要不紧急</span>
82
+ {{# } }}
83
+ </script>
84
+
85
+
86
+ <script type="text/html" id="show_type">
87
+ {{# if(d.shixun_type === 1){ }}
88
+ <span>管培</span>
89
+ {{# } else if(d.shixun_type === 2){ }}
90
+ <span>全职</span>
91
+ {{# } else if(d.shixun_type === 3){ }}
92
+ <span>专职</span>
93
+ {{# } }}
94
+ </script>
95
+ <script type="text/html" id="shixun_table_bar">
96
+ <a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="edit">编辑</a>
97
+ <a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="examine">提交审核</a>
98
+ </script>
99
+
100
+ <script>
101
+ layui.use(['form', 'table', 'miniPage', 'element', 'laydate', 'dropdown'], function () {
102
+ var laydate = layui.laydate,
103
+ form = layui.form,
104
+ table = layui.table,
105
+ miniPage = layui.miniPage
106
+
107
+
108
+ laydate.render({
109
+ elem: '#ID-laydate-demo',
110
+ range:true
111
+ });
112
+
113
+ var data = form.val("search_form");
114
+ var cols_table = [
115
+ [
116
+ {
117
+ field: 'id',
118
+ width: 60,
119
+ fixed: 'left',
120
+ title: '序号', type: 'numbers',
121
+ align: 'center'
122
+ },
123
+ {
124
+ field: 'type',
125
+ title: '任务类型',
126
+ width: 150,
127
+ align: 'center',
128
+ templet: '#show_type'
129
+ },
130
+ {
131
+ field: 'name',
132
+ title: '实践项目名称',
133
+ width: 150,
134
+ align: 'center'
135
+ },
136
+ {
137
+ field: 'level',
138
+ title: '项目级别',
139
+ width: 150,
140
+ align: 'center',
141
+ templet: '#show_level'
142
+ },
143
+ {
144
+ field: 'deliver_date',
145
+ title: '制作完成时间',
146
+ width: 150,
147
+ align: 'center'
148
+ },
149
+ {
150
+ field: 'state',
151
+ title: '项目状态',
152
+ width: 150,
153
+ templet: '#show_state',
154
+ align: 'center'
155
+ },
156
+ {
157
+ field: 'time2',
158
+ title: '提交审核时间',
159
+ width: 150,
160
+ align: 'center'
161
+ },
162
+ {
163
+ field: 'feedback',
164
+ title: '审核反馈',
165
+ width: 150,
166
+ align: 'center'
167
+ },
168
+ {
169
+ field: 'shixun_producer',
170
+ title: '项目制作人',
171
+ width: 150,
172
+ align: 'center'
173
+ },
174
+ {
175
+ field: 'shixun_manages',
176
+ title: '课程负责人',
177
+ width: 150,
178
+ align: 'center'
179
+ },
180
+ {
181
+ field: 'shixun_manages',
182
+ title: '课程组主管',
183
+ width: 150,
184
+ align: 'center'
185
+ },
186
+ {
187
+ title: '操作',
188
+ width: 150,
189
+ align: 'center',
190
+ fixed: 'right',
191
+ templet: "#shixun_table_bar"
192
+ }
193
+ ]
194
+ ]
195
+
196
+ var id = localStorage.getItem("link_shixuns_id")
197
+ var shixun_table = table.render({
198
+ elem: '#shixun_table',
199
+ url: '/missions/subjects/list_shixuns?id='+id,
200
+ autoSort: false,
201
+ where: {q: data},
202
+ title: '实践项目列表',
203
+ cols: cols_table,
204
+ limit: 10,
205
+ limits: [10, 15, 20, 30, 40, 50, 60, 70, 80, 90],
206
+ page: true,
207
+ skin: 'line'
208
+ });
209
+
210
+ var sort = {}, search = {};
211
+ form.on('submit(search_shixun_contract)', function (data) {
212
+ search = data.field
213
+ console.log(search)
214
+ table.reload('shixun_table', {
215
+ page: {
216
+ curr: 1
217
+ },
218
+ where: {q: search, sort: sort}
219
+ }, 'data');
220
+ return false;
221
+ });
222
+ });
223
+ </script>
224
+ <style>
225
+ .borders {
226
+ margin: 10px;
227
+ }
228
+ </style>
@@ -0,0 +1,17 @@
1
+ json.data do
2
+ json.array! @shixuns do |d|
3
+ json.shixun_manages d.shixun_manages
4
+ json.shixun_producer d.shixun_producer
5
+ json.shixun_staff d.shixun_staff
6
+ json.shixun_status d.shixun_status
7
+ json.shixun_type d.shixun_type
8
+ json.deliver_date d.deliver_date
9
+ json.school_id d.school_id
10
+ json.shixun_id d.shixun_id
11
+ json.name d.shixun_name
12
+ json.level d.level
13
+ json.id d.id
14
+ end
15
+ end
16
+ json.code 0
17
+ json.count @shixuns.total_count