educode_sales 0.2.0 → 0.2.1

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 (84) 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/app.css +23 -0
  4. data/app/assets/stylesheets/educode_sales/public.css +4 -0
  5. data/app/controllers/educode_sales/businesses_controller.rb +12 -1
  6. data/app/controllers/educode_sales/follow_ups_controller.rb +13 -0
  7. data/app/controllers/educode_sales/home_controller.rb +7 -7
  8. data/app/controllers/educode_sales/operation_reports_controller.rb +3 -3
  9. data/app/controllers/educode_sales/staffs_controller.rb +3 -2
  10. data/app/controllers/educode_sales/teacher_follows_controller.rb +1 -0
  11. data/app/controllers/educode_sales/teachers_controller.rb +1 -0
  12. data/app/models/educode_sales/activity.rb +1 -1
  13. data/app/models/educode_sales/staff.rb +3 -3
  14. data/app/models/educode_sales/teacher.rb +3 -2
  15. data/app/views/educode_sales/activities/index.html.erb +11 -11
  16. data/app/views/educode_sales/activities/show_teachers.html.erb +1 -5
  17. data/app/views/educode_sales/businesses/edit_plan.html.erb +7 -2
  18. data/app/views/educode_sales/businesses/index.html.erb +18 -10
  19. data/app/views/educode_sales/businesses/index.json.jbuilder +3 -1
  20. data/app/views/educode_sales/businesses/new.html.erb +1 -1
  21. data/app/views/educode_sales/businesses/new_follow_record.html.erb +12 -2
  22. data/app/views/educode_sales/businesses/show_follow.html.erb +23 -19
  23. data/app/views/educode_sales/businesses/show_follow.json.jbuilder +1 -0
  24. data/app/views/educode_sales/businesses/show_keys.html.erb +1 -1
  25. data/app/views/educode_sales/commons/edit.html.erb +1 -1
  26. data/app/views/educode_sales/commons/index.html.erb +2 -3
  27. data/app/views/educode_sales/home/index.html.erb +1 -1
  28. data/app/views/educode_sales/home/search_teacher.json.jbuilder +2 -2
  29. data/app/views/educode_sales/home/statistics.html.erb +1 -0
  30. data/app/views/educode_sales/operation_plans/_monthPlan.html.erb +2 -3
  31. data/app/views/educode_sales/operation_plans/_monthly.html.erb +2 -2
  32. data/app/views/educode_sales/operation_plans/_weekPlan.html.erb +2 -3
  33. data/app/views/educode_sales/operation_plans/_weekly.html.erb +2 -1
  34. data/app/views/educode_sales/operation_plans/edit_monthly.html.erb +3 -3
  35. data/app/views/educode_sales/operation_plans/edit_weekly.html.erb +3 -3
  36. data/app/views/educode_sales/operation_plans/new_month.html.erb +1 -1
  37. data/app/views/educode_sales/operation_plans/new_monthly.html.erb +3 -3
  38. data/app/views/educode_sales/operation_plans/new_week.html.erb +1 -1
  39. data/app/views/educode_sales/operation_plans/new_weekly.html.erb +3 -3
  40. data/app/views/educode_sales/operation_plans/show_monthly.html.erb +3 -3
  41. data/app/views/educode_sales/operation_plans/show_weekly.html.erb +3 -3
  42. data/app/views/educode_sales/operation_reports/audit.html.erb +2 -2
  43. data/app/views/educode_sales/operation_reports/edit.html.erb +3 -3
  44. data/app/views/educode_sales/operation_reports/show.html.erb +139 -27
  45. data/app/views/educode_sales/places/index.html.erb +6 -6
  46. data/app/views/educode_sales/plans/_monthPlan.html.erb +2 -1
  47. data/app/views/educode_sales/plans/_monthly.html.erb +2 -1
  48. data/app/views/educode_sales/plans/_weekPlan.html.erb +2 -1
  49. data/app/views/educode_sales/plans/_weekly.html.erb +2 -1
  50. data/app/views/educode_sales/plans/audit_weekly.html.erb +3 -3
  51. data/app/views/educode_sales/plans/edit_monthly.html.erb +3 -3
  52. data/app/views/educode_sales/plans/edit_weekly.html.erb +1 -1
  53. data/app/views/educode_sales/plans/new_monthly.html.erb +1 -1
  54. data/app/views/educode_sales/plans/new_weekly.html.erb +1 -1
  55. data/app/views/educode_sales/plans/show_monthly.html.erb +3 -3
  56. data/app/views/educode_sales/plans/show_weekly.html.erb +1 -1
  57. data/app/views/educode_sales/roles/index.html.erb +2 -1
  58. data/app/views/educode_sales/sale_reports/audit.html.erb +1 -1
  59. data/app/views/educode_sales/sale_reports/edit.html.erb +3 -3
  60. data/app/views/educode_sales/sale_reports/show.html.erb +1 -1
  61. data/app/views/educode_sales/sale_trends/operations.html.erb +1 -1
  62. data/app/views/educode_sales/sales/index.html.erb +12 -7
  63. data/app/views/educode_sales/sales/index.json.jbuilder +1 -1
  64. data/app/views/educode_sales/sales/operations.html.erb +7 -5
  65. data/app/views/educode_sales/sales/operations.json.jbuilder +3 -2
  66. data/app/views/educode_sales/sales/school.html.erb +1 -2
  67. data/app/views/educode_sales/sales/xschool.html.erb +1 -2
  68. data/app/views/educode_sales/staffs/follow_up_departments.json.jbuilder +1 -2
  69. data/app/views/educode_sales/staffs/follow_up_schools.json.jbuilder +1 -2
  70. data/app/views/educode_sales/staffs/index.html.erb +6 -8
  71. data/app/views/educode_sales/staffs/new.html.erb +1 -1
  72. data/app/views/educode_sales/teachers/add_courses.html.erb +3 -3
  73. data/app/views/educode_sales/teachers/add_event.html.erb +1 -1
  74. data/app/views/educode_sales/teachers/add_keys.html.erb +11 -5
  75. data/app/views/educode_sales/teachers/index.html.erb +8 -6
  76. data/app/views/educode_sales/teachers/new_follow_record.html.erb +1 -0
  77. data/app/views/educode_sales/teachers/search_new.html.erb +2 -2
  78. data/app/views/educode_sales/teachers/show_class.html.erb +1 -1
  79. data/app/views/educode_sales/teachers/show_follow.html.erb +11 -9
  80. data/app/views/educode_sales/teachers/show_follow.json.jbuilder +1 -0
  81. data/app/views/layouts/educode_sales/application.html.erb +6 -9
  82. data/config/routes.rb +1 -0
  83. data/lib/educode_sales/version.rb +1 -1
  84. metadata +3 -2
@@ -7,19 +7,21 @@
7
7
  </div>
8
8
  </script>
9
9
  <div class="edit-table">
10
- <table class="layui-hide" id="sale_plan_follow_table" lay-filter="sale_plan_follow_table" style="min-height: 300px;"></table>
10
+ <table class="layui-hide" id="sale_plan_follow_table" lay-filter="sale_plan_follow_table"></table>
11
11
  <table class="layui-hide" id="unfinish_table" lay-filter="unfinish_table" style="min-height: 300px;"></table>
12
12
  </div>
13
13
  <script type="text/html" id="currentTableBar_follow">
14
14
  <% if can? :follow, EducodeSales::Business %>
15
15
  <a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="show">查看</a>
16
16
  <% end %>
17
+ {{# if(d.is_latest){ }}
17
18
  <% if can? :update_follow, EducodeSales::Business %>
18
19
  <a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="edit">编辑</a>
19
20
  <% end %>
20
21
  <% if can? :destroy_follow, EducodeSales::Business %>
21
22
  <a class="layui-btn layui-btn-xs layui-btn-danger data-count-delete" lay-event="delete">删除</a>
22
23
  <% end %>
24
+ {{# } }}
23
25
  </script>
24
26
 
25
27
  <!--关键人-->
@@ -34,7 +36,7 @@
34
36
  <!--未完成计划列表-->
35
37
  <script type="text/html" id="unfinish_table_tabar">
36
38
  <div class="layui-btn-container">
37
- <span class="table-label">未完成计划列表</span>
39
+ <span class="table-label">跟进计划列表</span>
38
40
  </div>
39
41
  </script>
40
42
 
@@ -68,7 +70,7 @@
68
70
  {
69
71
  field: 'id',
70
72
  width: 80,
71
- title: '序号'
73
+ title:'序号',type: 'numbers',
72
74
  },
73
75
  {
74
76
  field: 'created_at',
@@ -78,12 +80,12 @@
78
80
  },
79
81
  {
80
82
  field: 'clazz',
81
- width: 80,
83
+ width: 60,
82
84
  title: '类型',
83
85
  },
84
86
  {
85
87
  field: 'stage',
86
- width: 120,
88
+ width: 100,
87
89
  title: '阶段',
88
90
  },
89
91
  {
@@ -94,12 +96,12 @@
94
96
  },
95
97
  {
96
98
  field: 'invitation_at',
97
- width: 120,
99
+ width: 110,
98
100
  title: '招标时间',
99
101
  },
100
102
  {
101
103
  field: 'reception_at',
102
- width: 120,
104
+ width: 110,
103
105
  title: '验收时间',
104
106
  },
105
107
  {
@@ -147,8 +149,8 @@
147
149
  }
148
150
  ]
149
151
  ],
150
- limits: [10, 15, 20, 25, 50, 100],
151
- limit: 15,
152
+ height: 400,
153
+ limit: 20,
152
154
  page: true,
153
155
  skin: 'line'
154
156
  });
@@ -165,7 +167,9 @@
165
167
 
166
168
  table.on('toolbar(sale_plan_follow_table)', function (obj) {
167
169
  if (obj.event === 'add') { // 监听添加操作
168
- var content = miniPage.getHrefContent('/educode_sales/businesses/new_follow_record?id=' + parent.id);
170
+ console.log(parent.business_id);
171
+ business_id = parent.business_id
172
+ var content = miniPage.getHrefContent('/educode_sales/businesses/new_follow_record?id=' + parent.id);
169
173
  var openWH = miniPage.getOpenWidthHeight();
170
174
  sale_plan_index = layer.open({
171
175
  title: '添加',
@@ -190,11 +194,13 @@
190
194
  var data = obj.data;
191
195
  follow_up_id = obj.data.id;
192
196
  if (obj.event === 'delete') {
193
- layer.confirm('确定删除序号为' + data.id + "的跟进记录", function (index) {
197
+ console.log(data);
198
+ layer.confirm('确定删除ID为' + data.id + "的跟进记录", function (index) {
194
199
  request.authDelete("educode_sales/follow_ups/" + data.id, {}, function() {
195
200
  obj.del();
196
201
  layer.close(index);
197
202
  table.reload("businesses_table");
203
+ table.reload("sale_plan_follow_table");
198
204
  })
199
205
  });
200
206
  } else if (obj.event === 'show') { // 监听添加操作
@@ -235,6 +241,7 @@
235
241
  } else if (obj.event === 'add_keys') { // 监听添加操作
236
242
  content = miniPage.getHrefContent('/educode_sales/teachers/add_keys?follow_up_id=' + obj.data.id);
237
243
  openWH = miniPage.getOpenWidthHeight();
244
+ is_latest = obj.data.is_latest
238
245
  keyindex = layer.open({
239
246
  title: '关键人',
240
247
  type: 1,
@@ -255,6 +262,7 @@
255
262
  } else if (obj.event === 'edit_plan') {
256
263
  content = miniPage.getHrefContent('/educode_sales/businesses/edit_plan');
257
264
  openWH = miniPage.getOpenWidthHeight();
265
+ is_latest = obj.data.is_latest
258
266
  plan_index = layer.open({
259
267
  title: '回款计划',
260
268
  type: 1,
@@ -286,7 +294,7 @@
286
294
  {
287
295
  field: 'id',
288
296
  width: 80,
289
- title: '序号'
297
+ title:'序号',type: 'numbers',
290
298
  },
291
299
  {
292
300
  field: 'staff',
@@ -326,8 +334,8 @@
326
334
  }
327
335
  ]
328
336
  ],
329
- limits: [10, 15, 20, 25, 50, 100],
330
- limit: 15,
337
+
338
+
331
339
  page: true,
332
340
  skin: 'line'
333
341
  });
@@ -395,10 +403,6 @@
395
403
  $(window).on("resize", function () {
396
404
  layer.full(index);
397
405
  });
398
- } else if (obj.event === 'delete') { // 监听删除操作
399
- var checkStatus = table.checkStatus('currentTableId'),
400
- data = checkStatus.data;
401
- layer.alert(JSON.stringify(data));
402
406
  }
403
407
  });
404
408
 
@@ -406,7 +410,7 @@
406
410
  var data = obj.data;
407
411
  plan_id = data.id;
408
412
  if (obj.event === 'delete') {
409
- layer.confirm('确定删除序号为' + data.id + "的计划", function (index) {
413
+ layer.confirm('确定删除ID为' + data.id + "的计划", function (index) {
410
414
  request.authDelete("educode_sales/plans/" + data.id, {}, function() {
411
415
  obj.del();
412
416
  layer.close(index);
@@ -14,6 +14,7 @@ json.data do
14
14
  json.place d.place&.name
15
15
  json.money_plans_count d.money_plans_count
16
16
  json.money d.money_plans.where(clazz: 1).sum(:amount)
17
+ json.is_latest d.id == @latest&.id
17
18
  end
18
19
  end
19
20
 
@@ -11,7 +11,7 @@
11
11
  {
12
12
  field: 'id',
13
13
  width: 80,
14
- title: '序号'
14
+ title:'序号',type: 'numbers',
15
15
  },
16
16
  {
17
17
  field: 'name',
@@ -73,7 +73,7 @@
73
73
  [{
74
74
  field: 'id',
75
75
  width: 80,
76
- title: 'ID',
76
+ title:'序号',type: 'numbers',
77
77
  sort: true
78
78
  }, {
79
79
  field: 'name',
@@ -29,7 +29,7 @@
29
29
  {
30
30
  field: 'i',
31
31
  width: 80,
32
- title: 'ID',
32
+ title:'序号',type: 'numbers',
33
33
  sort: true
34
34
  },
35
35
  {
@@ -49,8 +49,7 @@
49
49
  }
50
50
  ]
51
51
  ],
52
- limits: [10, 15, 20, 25, 50, 100],
53
- limit: 15,
52
+ limit: 20,
54
53
  page: true,
55
54
  skin: 'line'
56
55
  });
@@ -1 +1 @@
1
- <h4>欢迎使用头歌营销支撑系统</h4>
1
+ <div style="text-align:center;"><%= image_tag "educode_sales/indexlogo.png", width: "900" %></div>
@@ -3,9 +3,9 @@ json.data do
3
3
  if d.is_a? EducodeSales::Teacher
4
4
  json.value "t-#{d.id}"
5
5
  if d.department.present?
6
- json.name "#{d.name}--(#{d.department&.school&.name}--#{d.department&.name}) (来源教师列表)"
6
+ json.name "#{d.name}--(#{d.department&.school&.name}--#{d.department&.name}) (来源运营教师列表)"
7
7
  else
8
- json.name "#{d.name}--(来源教师列表)"
8
+ json.name "#{d.name}--(来源运营教师列表)"
9
9
  end
10
10
  json.extras [d.professional_title, d.job]
11
11
 
@@ -65,4 +65,5 @@
65
65
  </div>
66
66
  </div>
67
67
  </div>
68
+ </div>
68
69
  </div>
@@ -83,7 +83,7 @@
83
83
  {
84
84
  field: 'id',
85
85
  width: 80,
86
- title: '序号'
86
+ title:'序号',type: 'numbers',
87
87
  },
88
88
  {
89
89
  field: 'staff',
@@ -136,8 +136,7 @@
136
136
  }
137
137
  ]
138
138
  ],
139
- limits: [10, 15, 20, 25, 50, 100],
140
- limit: 15,
139
+ limit: 20,
141
140
  page: true,
142
141
  skin: 'line'
143
142
  });
@@ -84,7 +84,7 @@
84
84
  {
85
85
  field: 'id',
86
86
  width: 80,
87
- title: '序号'
87
+ title:'序号',type: 'numbers',
88
88
  },
89
89
  {
90
90
  field: 'staff',
@@ -164,6 +164,7 @@
164
164
  });
165
165
  })
166
166
  },
167
+ limit: 20,
167
168
  page: true
168
169
  });
169
170
 
@@ -258,7 +259,6 @@
258
259
  });
259
260
  return false;
260
261
  }else if (obj.event === 'show') {
261
-
262
262
  content = miniPage.getHrefContent('/educode_sales/operation_reports/' + data.id);
263
263
  openWH = miniPage.getOpenWidthHeight();
264
264
  index = layer.open({
@@ -84,7 +84,7 @@
84
84
  {
85
85
  field: 'id',
86
86
  width: 80,
87
- title: '序号'
87
+ title:'序号',type: 'numbers',
88
88
  },
89
89
  {
90
90
  field: 'staff',
@@ -147,8 +147,7 @@
147
147
  }
148
148
  ]
149
149
  ],
150
- limits: [10, 15, 20, 25, 50, 100],
151
- limit: 15,
150
+ limit: 20,
152
151
  page: true,
153
152
  skin: 'line'
154
153
  });
@@ -85,7 +85,7 @@
85
85
  {
86
86
  field: 'id',
87
87
  width: 80,
88
- title: '序号'
88
+ title:'序号',type: 'numbers',
89
89
  },
90
90
  {
91
91
  field: 'staff',
@@ -165,6 +165,7 @@
165
165
  });
166
166
  })
167
167
  },
168
+ limit: 20,
168
169
  page: true,
169
170
  });
170
171
 
@@ -93,7 +93,7 @@
93
93
  {
94
94
  field: 'id',
95
95
  width: 80,
96
- title: '序号'
96
+ title:'序号',type: 'numbers',
97
97
  },
98
98
  {
99
99
  field: 'username',
@@ -161,8 +161,8 @@
161
161
  "rate": "100%",
162
162
  "updateTime": "2021-07-27",
163
163
  }],
164
- limits: [10, 15, 20, 25, 50, 100],
165
- limit: 15,
164
+
165
+
166
166
  page: true,
167
167
  skin: 'line'
168
168
  });
@@ -91,7 +91,7 @@
91
91
  {
92
92
  field: 'id',
93
93
  width: 80,
94
- title: '序号'
94
+ title:'序号',type: 'numbers',
95
95
  },
96
96
  {
97
97
  field: 'username',
@@ -159,8 +159,8 @@
159
159
  "rate": "100%",
160
160
  "updateTime": "2021-07-27",
161
161
  }],
162
- limits: [10, 15, 20, 25, 50, 100],
163
- limit: 15,
162
+
163
+
164
164
  page: true,
165
165
  skin: 'line'
166
166
  });
@@ -9,7 +9,7 @@
9
9
  <div class="layui-inline">
10
10
  <label class="layui-form-label required">教师</label>
11
11
  <div class="layui-input-inline">
12
- <%= select_tag "teacher_id", options_for_select(@teachers), {"lay-verify": "required", include_blank: true} %>
12
+ <%= select_tag "teacher_id", options_for_select(@teachers, @teacher&.id), {"lay-verify": "required", include_blank: true} %>
13
13
  </div>
14
14
  </div>
15
15
  <div class="layui-form-item layui-form-text">
@@ -82,7 +82,7 @@
82
82
  {
83
83
  field: 'id',
84
84
  width: 80,
85
- title: '序号'
85
+ title:'序号',type: 'numbers',
86
86
  },
87
87
  {
88
88
  field: 'staff',
@@ -134,8 +134,8 @@
134
134
  }
135
135
  ]
136
136
  ],
137
- limits: [10, 15, 20, 25, 50, 100],
138
- limit: 15,
137
+
138
+
139
139
  page: true,
140
140
  skin: 'line'
141
141
  });
@@ -16,7 +16,7 @@
16
16
  <label class="layui-form-label required">教师</label>
17
17
  <div class="layui-input-inline">
18
18
 
19
- <%= select_tag "teacher_id", options_for_select(@teachers), {"lay-verify": "required", include_blank: true} %>
19
+ <%= select_tag "teacher_id", options_for_select(@teachers, @teacher&.id), {"lay-verify": "required", include_blank: true} %>
20
20
  </div>
21
21
  </div>
22
22
  <div class="layui-form-item layui-form-text">
@@ -78,7 +78,7 @@
78
78
  {
79
79
  field: 'id',
80
80
  width: 80,
81
- title: '序号'
81
+ title:'序号',type: 'numbers',
82
82
  },
83
83
  {
84
84
  field: 'staff',
@@ -135,8 +135,8 @@
135
135
  }
136
136
  ]
137
137
  ],
138
- limits: [10, 15, 20, 25, 50, 100],
139
- limit: 15,
138
+
139
+
140
140
  page: true,
141
141
  skin: 'line'
142
142
  });
@@ -89,7 +89,7 @@
89
89
  {
90
90
  field: 'id',
91
91
  width: 80,
92
- title: '序号'
92
+ title:'序号',type: 'numbers',
93
93
  },
94
94
  {
95
95
  field: 'username',
@@ -157,8 +157,8 @@
157
157
  "rate": "100%",
158
158
  "updateTime": "2021-07-27",
159
159
  }],
160
- limits: [10, 15, 20, 25, 50, 100],
161
- limit: 15,
160
+
161
+
162
162
  page: true,
163
163
  skin: 'line'
164
164
  });
@@ -88,7 +88,7 @@
88
88
  {
89
89
  field: 'id',
90
90
  width: 80,
91
- title: '序号'
91
+ title:'序号',type: 'numbers',
92
92
  },
93
93
  {
94
94
  field: 'username',
@@ -156,8 +156,8 @@
156
156
  "rate": "100%",
157
157
  "updateTime": "2021-07-27",
158
158
  }],
159
- limits: [10, 15, 20, 25, 50, 100],
160
- limit: 15,
159
+
160
+
161
161
  page: true,
162
162
  skin: 'line'
163
163
  });
@@ -128,7 +128,7 @@
128
128
  content = miniPage.getHrefContent('/educode_sales/teachers/show_follow?id=' + data.teacher_id);
129
129
  openWH = miniPage.getOpenWidthHeight();
130
130
  index = layer.open({
131
- title: '教师列表/' + data.business_name + '的跟进记录',
131
+ title: '教师列表/' + data.teache_name + '的跟进记录',
132
132
  type: 1,
133
133
  shade: 0.2,
134
134
  maxmin: true,
@@ -151,7 +151,7 @@
151
151
  [{
152
152
  field: 'id',
153
153
  width: 80,
154
- title: '序号'
154
+ title:'序号',type: 'numbers',
155
155
  },
156
156
  {
157
157
  field: 'staff',
@@ -72,14 +72,14 @@
72
72
 
73
73
  table.render({
74
74
  elem: '#newWeeklyTable',
75
- url: '/educode_sales/operation_plans/my_week',
75
+ url: '/educode_sales/operation_reports/' + "<%= @sale_report.id%>" + '/plans',
76
76
  toolbar: '#newWeeklyToolbar',
77
77
  defaultToolbar: [],
78
78
  cols: [
79
79
  [{
80
80
  field: 'id',
81
81
  width: 80,
82
- title: '序号'
82
+ title:'序号',type: 'numbers',
83
83
  },
84
84
  {
85
85
  field: 'staff',
@@ -215,7 +215,7 @@
215
215
  content = miniPage.getHrefContent('/educode_sales/teachers/show_follow?id=' + data.teacher_id);
216
216
  openWH = miniPage.getOpenWidthHeight();
217
217
  index = layer.open({
218
- title: '教师列表/' + data.business_name + '的跟进记录',
218
+ title: '教师列表/' + data.teacher_name + '的跟进记录',
219
219
  type: 1,
220
220
  shade: 0.2,
221
221
  maxmin: true,