educode_sales 0.6.1 → 0.6.5

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 (53) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/images/educode_sales/money_plans.png +0 -0
  3. data/app/controllers/educode_sales/businesses_controller.rb +29 -8
  4. data/app/controllers/educode_sales/customers_controller.rb +45 -34
  5. data/app/controllers/educode_sales/follow_ups_controller.rb +1 -1
  6. data/app/controllers/educode_sales/money_plans_controller.rb +65 -0
  7. data/app/controllers/educode_sales/places_controller.rb +5 -1
  8. data/app/controllers/educode_sales/roles_controller.rb +4 -1
  9. data/app/controllers/educode_sales/sale_trends_controller.rb +44 -1
  10. data/app/controllers/educode_sales/staffs_controller.rb +3 -4
  11. data/app/controllers/educode_sales/teachers_controller.rb +13 -2
  12. data/app/models/educode_sales/permission.rb +3 -2
  13. data/app/models/educode_sales/role_area.rb +1 -0
  14. data/app/views/educode_sales/businesses/_follows.html.erb +18 -15
  15. data/app/views/educode_sales/businesses/edit.html.erb +3 -0
  16. data/app/views/educode_sales/businesses/edit_follow_record.html.erb +11 -2
  17. data/app/views/educode_sales/businesses/file.html.erb +8 -4
  18. data/app/views/educode_sales/businesses/index.html.erb +117 -26
  19. data/app/views/educode_sales/businesses/index.json.jbuilder +4 -2
  20. data/app/views/educode_sales/businesses/new_follow_record.html.erb +7 -2
  21. data/app/views/educode_sales/businesses/show_follow.html.erb +2 -1
  22. data/app/views/educode_sales/businesses/time_line.html.erb +1 -1
  23. data/app/views/educode_sales/customers/edit.html.erb +735 -22
  24. data/app/views/educode_sales/customers/edit_follow_record.html.erb +1 -1
  25. data/app/views/educode_sales/customers/index.html.erb +17 -18
  26. data/app/views/educode_sales/customers/index.json.jbuilder +3 -3
  27. data/app/views/educode_sales/customers/new.html.erb +713 -27
  28. data/app/views/educode_sales/customers/new_follow_record.html.erb +1 -1
  29. data/app/views/educode_sales/customers/show_follow.html.erb +1 -1
  30. data/app/views/educode_sales/customers/show_follow_record.html.erb +3 -3
  31. data/app/views/educode_sales/follow_ups/index.json.jbuilder +1 -0
  32. data/app/views/educode_sales/money_plans/index.html.erb +222 -0
  33. data/app/views/educode_sales/money_plans/index.json.jbuilder +21 -0
  34. data/app/views/educode_sales/places/index.html.erb +80 -2
  35. data/app/views/educode_sales/places/index.json.jbuilder +3 -1
  36. data/app/views/educode_sales/plans/_monthPlan.html.erb +2 -1
  37. data/app/views/educode_sales/plans/_weekPlan.html.erb +2 -1
  38. data/app/views/educode_sales/recycles/business.json.jbuilder +2 -2
  39. data/app/views/educode_sales/roles/edit.html.erb +9 -1
  40. data/app/views/educode_sales/sale_trends/trends.html.erb +93 -13
  41. data/app/views/educode_sales/sale_trends/trends.json.jbuilder +3 -14
  42. data/app/views/educode_sales/sales/index.html.erb +25 -17
  43. data/app/views/educode_sales/sales/index.json.jbuilder +17 -7
  44. data/app/views/educode_sales/sales/operations.json.jbuilder +2 -2
  45. data/app/views/educode_sales/teachers/index.html.erb +19 -18
  46. data/app/views/educode_sales/teachers/index.json.jbuilder +1 -1
  47. data/app/views/layouts/educode_sales/application.html.erb +13 -2
  48. data/config/routes.rb +2 -0
  49. data/db/migrate/20210902064109_create_educode_sales_role_permissions.rb +8 -0
  50. data/db/migrate/20211220102720_add_position_to_commons.rb +12 -0
  51. data/db/migrate/20211221075146_add_school_id_to_educode_sales_businesses.rb +8 -0
  52. data/lib/educode_sales/version.rb +1 -1
  53. metadata +8 -2
@@ -1,6 +1,6 @@
1
1
  <div class="section">
2
2
  <form class="layui-form select_year" action="">
3
- <span>销售人员列表</span>
3
+ <!-- <span>销售人员列表</span>-->
4
4
  <div class="layui-input-inline" style="float: right">
5
5
  <%= select_tag "years", options_for_select(@years,@year), {'lay-filter': 'year' } %>
6
6
  </div>
@@ -49,6 +49,11 @@
49
49
  <a href="/missions/customers?staff_id={{d.id}}">{{d.school_count}}</a>
50
50
  </div>
51
51
  </script>
52
+ <script type="text/html" id="bussinessBar">
53
+ <span>销售人员列表</span>
54
+ <div class="layui-btn-container">
55
+ </div>
56
+ </script>
52
57
  <script>
53
58
  layui.use('table', function () {
54
59
  var form = layui.form,
@@ -63,22 +68,25 @@
63
68
  table.render({
64
69
  elem: '#table',
65
70
  url: '/missions/sales?year=<%= @year %>',
66
- cellMinWidth: 80,
71
+ defaultToolbar: ['filter'],
72
+ cellMinWidth: 80,
73
+ toolbar: '#bussinessBar',
67
74
  totalRow:true,
68
75
  cols: [
69
76
  [{
70
77
  field: 'id',
71
78
  title:'序号',type: 'numbers',
72
79
  totalRowText:'合计',
80
+ fixed: 'left',
73
81
  width: 80
74
82
  }, {
75
83
  field: 'name',
76
84
  title: '姓名',
85
+ fixed: 'left',
77
86
  width: 100
78
87
  }, {
79
88
  field: 'area',
80
89
  title: '负责区域',
81
- width: 100,
82
90
  templet:'<div><span title="{{d.area}}">{{d.area}}</span></div>'
83
91
  }, {
84
92
  field: 'business_a',
@@ -157,20 +165,20 @@
157
165
  totalRow:'{{ parseInt(d.TOTAL_NUMS) }}',
158
166
  width: 130
159
167
  },
160
- {
161
- field: 'follow_school_rate',
162
- title: '学校覆盖率',
163
- sort:true,
164
- totalRow:'{{ parseInt(d.TOTAL_NUMS) }}',
165
- width: 120
166
- },
167
- {
168
- field: 'follow_department_rate',
169
- title: '学院覆盖率',
170
- sort:true,
171
- totalRow:'{{ parseInt(d.TOTAL_NUMS) }}',
172
- width: 120
173
- },
168
+ // {
169
+ // field: 'follow_school_rate',
170
+ // title: '学校覆盖率',
171
+ // sort:true,
172
+ // totalRow:true,
173
+ // width: 120
174
+ // },
175
+ // {
176
+ // field: 'follow_department_rate',
177
+ // title: '学院覆盖率',
178
+ // sort:true,
179
+ // totalRow:true,
180
+ // width: 120
181
+ // },
174
182
  ]
175
183
  ],
176
184
  limit: 20,
@@ -5,6 +5,8 @@ businesses_d_count = 0
5
5
  businesses_e_count = 0
6
6
  businesses_o_count = 0
7
7
  school_counts = 0
8
+ follow_school_rates = 0
9
+ follow_department_rates = 0
8
10
  area_ids = EducodeSales::Common.where(clazz: 'area').ids.sort.to_s
9
11
  json.data do
10
12
  json.array! @staffs do |d|
@@ -34,15 +36,17 @@ json.data do
34
36
  business_d = @businesses.joins("JOIN educode_sales_follow_ups on educode_sales_follow_ups.id = educode_sales_businesses.last_follow_up_id").where("educode_sales_follow_ups.clazz_id = ?", @d_clazz&.id).count
35
37
  business_e = @businesses.joins("JOIN educode_sales_follow_ups on educode_sales_follow_ups.id = educode_sales_businesses.last_follow_up_id").where("educode_sales_follow_ups.clazz_id = ?", @e_clazz&.id).count
36
38
  business_o = @businesses.joins("JOIN educode_sales_follow_ups on educode_sales_follow_ups.id = educode_sales_businesses.last_follow_up_id").where("educode_sales_follow_ups.clazz_id = ?", @o_clazz&.id).count
37
- school_count = EducodeSales::CustomerExtension.where(customer_staff_id: d.id).size
39
+ school_count = EducodeSales::CustomerExtension.joins(:school).where(customer_staff_id: d.id).size
38
40
  json.goal @businesses.joins("JOIN educode_sales_follow_ups on educode_sales_follow_ups.id = educode_sales_businesses.last_follow_up_id").where("educode_sales_follow_ups.clazz_id != ? AND educode_sales_follow_ups.stage_id in (?)", @x, @step_ids).sum(:total_amount).round(2)
39
41
  json.return_money @businesses.joins(last_follow_up: :money_plans).where("educode_sales_follow_ups.clazz_id != ?", @x).where.not("educode_sales_money_plans.clazz!= ?", 1).sum(:amount).round(2)
40
42
  json.school_count school_count
41
- follow_school_count = EducodeSales::CustomerFollow.where(staff_id: d.id).pluck(:school_id).uniq.size
43
+ follow_school_count = (EducodeSales::CustomerFollow.where(staff_id: d.id).pluck(:school_id) + EducodeSales::Business.where(id: EducodeSales::FollowUp.where(staff_id: d.id).pluck(:business_id).uniq).pluck(:school_id)).uniq.size
42
44
  json.follow_school_count follow_school_count
43
45
  json.follow_school_counts EducodeSales::CustomerFollow.where(staff_id: d.id).size + EducodeSales::FollowUp.where(staff_id: d.id).size
44
- json.follow_school_rate follow_school_count!=0 ? school_count.to_f * 100 / follow_school_count : 0
45
- json.follow_department_rate follow_school_count!=0 ? school_count.to_f * 100 / follow_school_count : 0
46
+ follow_school_rate = (follow_school_count!=0 ? school_count.to_f * 100 / follow_school_count : 0).round(2)
47
+ json.follow_school_rate follow_school_rate.to_s + '%'
48
+ follow_department_rate = (follow_school_count!=0 ? school_count.to_f * 110 / follow_school_count : 0).round(2)
49
+ json.follow_department_rate follow_department_rate.to_s + '%'
46
50
  else
47
51
  business_a = @businesses.joins("JOIN educode_sales_follow_ups on educode_sales_follow_ups.id = educode_sales_businesses.last_follow_up_id").where("educode_sales_follow_ups.clazz_id = ?", @a_clazz&.id).where("educode_sales_follow_ups.year = ?", @year).count
48
52
  business_b = @businesses.joins("JOIN educode_sales_follow_ups on educode_sales_follow_ups.id = educode_sales_businesses.last_follow_up_id").where("educode_sales_follow_ups.clazz_id = ?", @b_clazz&.id).where("educode_sales_follow_ups.year = ?", @year).count
@@ -54,11 +58,13 @@ json.data do
54
58
  json.goal @businesses.joins("JOIN educode_sales_follow_ups on educode_sales_follow_ups.id = educode_sales_businesses.last_follow_up_id").where("educode_sales_follow_ups.clazz_id != ? AND educode_sales_follow_ups.stage_id in (?)", @x, @step_ids).where("educode_sales_follow_ups.bidded_date >= ? AND educode_sales_follow_ups.bidded_date <= ?", "#{@year}-01-01", "#{@year}-12-31").sum(:total_amount).round(2)
55
59
  json.return_money @businesses.joins(last_follow_up: :money_plans).where("educode_sales_follow_ups.clazz_id != ?", @x).where.not("educode_sales_money_plans.clazz!= ?", 1).where("educode_sales_money_plans.date_at >= ? AND educode_sales_money_plans.date_at <= ? ", "#{@year}-01-01 00:00:00", "#{@year}-12-31 23:59:59").sum(:amount).round(2)
56
60
  json.school_count school_count
57
- follow_school_count = EducodeSales::CustomerFollow.where(staff_id: d.id).where("created_at >= ? AND created_at <= ?", "#{@year}-01-01", "#{@year}-12-31").pluck(:school_id).uniq.size || 0
61
+ follow_school_count = (EducodeSales::CustomerFollow.where(staff_id: d.id).where("created_at >= ? AND created_at <= ?", "#{@year}-01-01 00:00:00", "#{@year}-12-31 23:59:59").pluck(:school_id) + EducodeSales::Business.where(id: EducodeSales::FollowUp.where("created_at >= ? AND created_at <= ?", "#{@year}-01-01 00:00:00", "#{@year}-12-31 23:59:59").where(staff_id: d.id).pluck(:business_id).uniq).pluck(:school_id)).uniq.size
58
62
  json.follow_school_count follow_school_count
59
63
  json.follow_school_counts EducodeSales::CustomerFollow.where(staff_id: d.id).where("created_at >= ? AND created_at <= ?", "#{@year}-01-01", "#{@year}-12-31").size + EducodeSales::FollowUp.where(staff_id: d.id).where("created_at >= ? AND created_at <= ?", "#{@year}-01-01", "#{@year}-12-31").size
60
- json.follow_school_rate follow_school_count!=0 ? school_count.to_f * 100 / follow_school_count : 0
61
- json.follow_department_rate follow_school_count!=0 ? school_count.to_f * 100 / follow_school_count : 0
64
+ follow_school_rate = (follow_school_count!=0 ? school_count.to_f * 100 / follow_school_count : 0).round(2)
65
+ json.follow_school_rate follow_school_rate.to_s + '%'
66
+ follow_department_rate = (follow_school_count!=0 ? school_count.to_f * 110 / follow_school_count : 0).round(2)
67
+ json.follow_department_rate follow_department_rate.to_s + '%'
62
68
  end
63
69
 
64
70
  json.business_a business_a
@@ -81,6 +87,8 @@ json.data do
81
87
  businesses_e_count += business_e
82
88
  businesses_o_count += business_o
83
89
  school_counts += school_count
90
+ follow_school_rates += follow_school_rate
91
+ follow_department_rates += follow_department_rate
84
92
  end
85
93
  end
86
94
 
@@ -92,6 +100,8 @@ json.totalRow do
92
100
  json.business_e businesses_e_count.to_s
93
101
  json.business_o businesses_o_count.to_s
94
102
  json.school_count school_counts.to_s
103
+ json.follow_school_rate (follow_school_rates.to_f / @staffs.size).round(2).to_s + '%'
104
+ json.follow_department_rate (follow_department_rates.to_f / @staffs.size).round(2).to_s + '%'
95
105
  end
96
106
  json.code 0
97
107
  json.count @staffs.total_count
@@ -17,9 +17,9 @@ json.data do
17
17
  else
18
18
  json.area ''
19
19
  end
20
- departments = EducodeSales::Business.joins(:last_follow_up).where("educode_sales_follow_ups.staff_id = #{d.id}").select("COUNT(educode_sales_follow_ups.staff_id) AS count")[0]&.send('count') + EducodeSales::Teacher.joins(:follow_up).where("educode_sales_teacher_follows.staff_id = #{d.id}").select("COUNT(educode_sales_teacher_follows.staff_id) AS count")[0]&.send('count') || 0
20
+ departments = (EducodeSales::Business.joins(:follow_ups, [department: :school]).where("educode_sales_follow_ups.staff_id = #{d.id}").select("departments.id, departments.name, schools.name AS school, educode_sales_follow_ups.updated_at") + EducodeSales::Teacher.joins(:follow_up, [department: :school]).where("educode_sales_teacher_follows.staff_id = #{d.id}").select("departments.id, departments.name, schools.name AS school, educode_sales_teacher_follows.updated_at")).uniq{|s| s.id}.size
21
21
  json.departments departments
22
- schools = EducodeSales::Business.joins(:last_follow_up, :department).where("educode_sales_follow_ups.staff_id = #{d.id}").select("COUNT(distinct(departments.school_id)) AS count")[0]['count'] + EducodeSales::Teacher.joins(:follow_up, :department).where("educode_sales_teacher_follows.staff_id = #{d.id}").select("COUNT(distinct(departments.school_id)) AS count")[0]['count']
22
+ schools = EducodeSales::Business.joins(:follow_ups, :department).where("educode_sales_follow_ups.staff_id = #{d.id}").select("COUNT(distinct(departments.school_id)) AS count")[0]['count'] + EducodeSales::Teacher.joins(:follow_up, :department).where("educode_sales_teacher_follows.staff_id = #{d.id}").select("COUNT(distinct(departments.school_id)) AS count")[0]['count']
23
23
  json.schools schools
24
24
  departments_count += departments
25
25
  schools_count += schools
@@ -19,44 +19,44 @@
19
19
  <%= select_tag "professional_title", options_for_select(['教授', '研究员', '副教授', '副研究员', '讲师', '助理研究员', '助理教授'], @person&.professional_title), { include_blank: true } %>
20
20
  </div>
21
21
  </div>
22
- <div class="layui-inline">
22
+ <div class="layui-inline show_item" style="display:none;">
23
23
  <label class="layui-form-label">导流来源</label>
24
24
  <div class="layui-input-inline">
25
25
  <%= select_tag "teacher_source", options_for_select(EducodeSales::Common.where(clazz: 'teacher_source').pluck(:name, :id)), { include_blank: true } %>
26
26
  </div>
27
27
  </div>
28
- <div class="layui-inline">
28
+ <div class="layui-inline show_item" style="display:none;">
29
29
  <label class="layui-form-label">态度</label>
30
30
  <div class="layui-input-inline">
31
31
 
32
32
  <%= select_tag "attitude", options_for_select(EducodeSales::Common.where(clazz: 'teacher_attitude').pluck(:name, :id)), { include_blank: true } %>
33
33
  </div>
34
34
  </div>
35
- <div class="layui-inline">
35
+ <div class="layui-inline show_item" style="display:none;">
36
36
  <label class="layui-form-label">注册时间</label>
37
37
  <div class="layui-input-inline">
38
38
  <input type="text" class="layui-input" id="time" placeholder="请选择时间" autocomplete="off" name="regist_at">
39
39
  </div>
40
40
  </div>
41
- <div class="layui-inline">
41
+ <div class="layui-inline show_item" style="display:none;">
42
42
  <label class="layui-form-label">注册状态</label>
43
43
  <div class="layui-input-inline">
44
44
  <%= select_tag "status", options_for_select([["已注册","1"],["未注册","0"]]), { include_blank: true } %>
45
45
  </div>
46
46
  </div>
47
- <div class="layui-inline">
47
+ <div class="layui-inline show_item" style="display:none;">
48
48
  <label class="layui-form-label">区域</label>
49
49
  <div class="layui-input-inline">
50
50
  <%= select_tag "area", options_for_select(EducodeSales::Common.where(clazz: 'area').pluck(:name, :id)), { include_blank: true } %>
51
51
  </div>
52
52
  </div>
53
- <div class="layui-inline">
53
+ <div class="layui-inline show_item" style="display:none;">
54
54
  <label class="layui-form-label">起止时间</label>
55
55
  <div class="layui-input-inline">
56
56
  <input type="text" class="layui-input" id="date" name="date" autocomplete="off" placeholder=" - ">
57
57
  </div>
58
58
  </div>
59
- <div class="layui-inline">
59
+ <div class="layui-inline show_item" style="display:none;">
60
60
  <label class="layui-form-label">教研助理</label>
61
61
  <div class="layui-input-inline">
62
62
  <%= select_tag "assist", options_for_select(@staffs, params[:assist]), { 'lay-filter': 'assist', include_blank: true } %>
@@ -68,6 +68,8 @@
68
68
  </button>
69
69
  <button type="submit" class="layui-btn layui-btn-primary" lay-submit lay-filter="search_teachers">搜 索
70
70
  </button>
71
+ <button type="submit" class="layui-btn layui-btn-normal" lay-submit lay-filter="show_hide">展开/收起
72
+ </button>
71
73
  </div>
72
74
  </div>
73
75
  </form>
@@ -88,16 +90,6 @@
88
90
  <table class="layui-hide" id="teachers_table" style="min-height: 300px;" lay-filter="teachers_table"></table>
89
91
  </div>
90
92
  <script type="text/html" id="currentTableBar">
91
- <%# if can? :create, EducodeSales::OperationPlan %>
92
- <!-- <a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="addWeek">添加周计划</a>-->
93
- <!-- <a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="addMonth">添加月计划</a>-->
94
- <%# end %>
95
- <%# if can? :update, EducodeSales::Teacher %>
96
- <!-- <a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="edit">编辑</a>-->
97
- <%# end %>
98
- <%# if can? :destroy, EducodeSales::Teacher %>
99
- <!-- <a class="layui-btn layui-btn-xs layui-btn-danger data-count-delete" lay-event="delete">删除</a>-->
100
- <%# end %>
101
93
  <% if can? :create, EducodeSales::TeacherFollow %>
102
94
  <a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="add_event">添加跟进记录</a>
103
95
  <% end %>
@@ -160,12 +152,14 @@
160
152
  width: 60,
161
153
  title:'序号',type: 'numbers',
162
154
  totalRowText:'合计',
155
+ fixed: 'left'
163
156
 
164
157
  },
165
158
  {
166
159
  field: 'name',
167
160
  width: 80,
168
161
  title: '姓名',
162
+ fixed: 'left',
169
163
  templet: "#name"
170
164
  },
171
165
  {
@@ -243,19 +237,22 @@
243
237
  templet: "#event"
244
238
  },
245
239
  {
246
- field: 'regist_at',
240
+ field: 'created_on',
247
241
  width: 120,
248
242
  title: '注册时间',
243
+ sort: true,
249
244
  },
250
245
  {
251
246
  field: 'last_login_on',
252
247
  width: 120,
253
248
  title: '最近登录',
249
+ sort: true,
254
250
  },
255
251
  {
256
252
  field: 'created_at',
257
253
  width: 120,
258
254
  title: '添加时间',
255
+ sort: true,
259
256
  },
260
257
  {
261
258
  field: 'wechat',
@@ -416,6 +413,10 @@
416
413
  })
417
414
  return false;
418
415
  });
416
+ form.on('submit(show_hide)', function (data) {
417
+ $(".show_item").toggle()
418
+ return false;
419
+ });
419
420
  /**
420
421
  * toolbar事件监听
421
422
  */
@@ -18,7 +18,7 @@ json.data do
18
18
  json.courses_count d.courses_count
19
19
  json.actives d.actives
20
20
  json.students d.students_count
21
- json.regist_at d.user.present? ? d.user.created_on.to_s(:date) : ''
21
+ json.created_on d.user.present? ? d.user.created_on.to_s(:date) : ''
22
22
  json.last_login_on (d.user.present? && d.user.last_login_on.present?) ? d.user.last_login_on.to_s(:date) : ''
23
23
  json.teacher_used d.teacher_used
24
24
  json.wechat d.wechat
@@ -9,12 +9,15 @@
9
9
  <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
10
10
  <%= stylesheet_link_tag "educode_sales/application", media: "all" %>
11
11
  <%= javascript_include_tag "educode_sales/application" %>
12
+ <script src="https://cdn.jsdelivr.net/npm/cxselect@1.4.0/js/jquery.cxselect.js"></script>
13
+ <script src="https://cdn.jsdelivr.net/npm/cxselect@1.4.0/js/jquery.cxselect.min.js"></script>
14
+ <script src="https://cdn.jsdelivr.net/npm/jquery@3.6.0/dist/jquery.js"></script>
12
15
  </head>
13
16
  <body class="" id="body">
14
17
  <div class="layui-layout layui-layout-admin " >
15
18
  <div class="layui-header">
16
19
  <a href="/missions">
17
- <div class="layui-hide-xs layui-bg-black layuimini-logo layui-logo">
20
+ <div class="layui-bg-black layuimini-logo layui-logo" id="head_a">
18
21
  <%= image_tag "educode_sales/logo.png", class: 'header-logo' %>
19
22
  <span class="app-title">营销系统</span>
20
23
  </div>
@@ -45,7 +48,7 @@
45
48
  </ul>
46
49
  </div>
47
50
 
48
- <div class="layui-side layui-bg-black">
51
+ <div class="layui-side layui-bg-black" id="head_b">
49
52
  <div class="layui-side-scroll ">
50
53
  <!-- 左侧导航区域(可配合layui已有的垂直导航) -->
51
54
  <ul class="layui-nav layui-nav-tree ul"
@@ -66,6 +69,10 @@
66
69
  <dd><a href="/missions/businesses" class="<%= current?('layui-this', businesses_path) %>"><i style="padding-right: 35px"></i><%= image_tag "educode_sales/4.商机管理.png",size:"15"%><i style="font-size: 25px; padding-right: 15px"></i>商机管理</a>
67
70
  </dd>
68
71
  <% end %>
72
+ <% if can? :read, EducodeSales::MoneyPlan %>
73
+ <dd><a href="/missions/money_plans" class="<%= current?('layui-this', money_plans_path) %>"><i style="padding-right: 35px"></i><%= image_tag "educode_sales/money_plans.png",size:"15"%><i style="font-size: 25px; padding-right: 15px"></i>回款管理</a>
74
+ </dd>
75
+ <% end %>
69
76
  <% if can? :read, EducodeSales::Customer %>
70
77
  <dd><a href="/missions/customers" class="<%= current?('layui-this', customers_path) %>"><i style="padding-right: 35px"></i><%= image_tag "educode_sales/客户管理.png",size:"15"%><i style="font-size: 25px; padding-right: 15px"></i>客户管理</a>
71
78
  </dd>
@@ -205,6 +212,8 @@
205
212
  $(".i_class").animate({left: '200px'},"fast");
206
213
  $(".layui-nav-item").addClass('layui-nav-itemed')
207
214
  $("#logout").removeClass('layui-nav-itemed')
215
+ $("#head_b").removeClass('layui-hide-xs')
216
+ $("#head_a").removeClass('layui-hide-xs')
208
217
  }
209
218
 
210
219
  function menuHide(btn) {
@@ -212,6 +221,8 @@
212
221
  btn.removeClass('layui-icon-shrink-right').addClass('layui-icon-spread-left');
213
222
  body.addClass('layuimini-mini');
214
223
  $(".i_class").animate({left: '60px'});
224
+ $("#head_b").addClass('layui-hide-xs')
225
+ $("#head_a").addClass('layui-hide-xs')
215
226
  }
216
227
  }
217
228
  });
data/config/routes.rb CHANGED
@@ -20,6 +20,8 @@ EducodeSales::Engine.routes.draw do
20
20
  end
21
21
  resources :customer_follows do
22
22
  end
23
+ resources :money_plans do
24
+ end
23
25
 
24
26
  resources :customers do
25
27
  collection do
@@ -8,6 +8,14 @@ class CreateEducodeSalesRolePermissions < ActiveRecord::Migration[5.2]
8
8
  end
9
9
  if EducodeSales::Permission.last.nil?
10
10
 
11
+ #附件管理权限
12
+ EducodeSales::Permission.create(name: '查看附件', subject: 'Business', action: 'show_file', clazz: 'business', position: '11')
13
+ EducodeSales::Permission.create(name: '上传附件', subject: 'Business', action: 'upload_file', clazz: 'business', position: '11')
14
+ EducodeSales::Permission.create(name: '下载附件', subject: 'Business', action: 'download_file', clazz: 'business', position: '11')
15
+ EducodeSales::Permission.create(name: '删除附件', subject: 'Business', action: 'delete_file', clazz: 'business', position: '11')
16
+ #回款管理权限
17
+ EducodeSales::Permission.create(name: '查看回款列表', subject: 'MoneyPlan', action: 'read', clazz: 'money_plan', position: '15')
18
+
11
19
  #客户管理权限
12
20
  EducodeSales::Permission.create(name: '查看客户', subject: 'Customer', action: 'read', clazz: 'customer')
13
21
  EducodeSales::Permission.create(name: '添加客户', subject: 'Customer', action: 'create', clazz: 'customer')
@@ -0,0 +1,12 @@
1
+ class AddPositionToCommons < ActiveRecord::Migration[5.2]
2
+ def change
3
+ add_column :educode_sales_permissions, :position, :integer
4
+ EducodeSales::Permission.all.each_with_index do |d,index|
5
+ if d.clazz == '销售态势' || d.clazz == '销售分工' || d.clazz == '商机管理' || d.clazz == '客户管理'
6
+ d.update(position: index)
7
+ else
8
+ d.update(position: index * 10)
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,8 @@
1
+ class AddSchoolIdToEducodeSalesBusinesses < ActiveRecord::Migration[5.2]
2
+ def change
3
+ add_column :educode_sales_businesses, :school_id, :integer
4
+ EducodeSales::Business.all.each do |business|
5
+ business.update(school_id: business.department.school.id)
6
+ end
7
+ end
8
+ end
@@ -1,3 +1,3 @@
1
1
  module EducodeSales
2
- VERSION = '0.6.1'
2
+ VERSION = '0.6.5'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: educode_sales
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - anke1460
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-12-17 00:00:00.000000000 Z
11
+ date: 2022-01-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -109,6 +109,7 @@ files:
109
109
  - app/assets/images/educode_sales/loading-2.gif
110
110
  - app/assets/images/educode_sales/loginbg.png
111
111
  - app/assets/images/educode_sales/logo.png
112
+ - app/assets/images/educode_sales/money_plans.png
112
113
  - app/assets/images/educode_sales/回收站.png
113
114
  - app/assets/images/educode_sales/客户管理.png
114
115
  - app/assets/javascripts/educode_sales/application.js
@@ -145,6 +146,7 @@ files:
145
146
  - app/controllers/educode_sales/home_controller.rb
146
147
  - app/controllers/educode_sales/import_teachers_controller.rb
147
148
  - app/controllers/educode_sales/key_person_controller.rb
149
+ - app/controllers/educode_sales/money_plans_controller.rb
148
150
  - app/controllers/educode_sales/operation_plans_controller.rb
149
151
  - app/controllers/educode_sales/operation_reports_controller.rb
150
152
  - app/controllers/educode_sales/operations_controller.rb
@@ -253,6 +255,8 @@ files:
253
255
  - app/views/educode_sales/home/search_teacher.json.jbuilder
254
256
  - app/views/educode_sales/home/search_users.json.jbuilder
255
257
  - app/views/educode_sales/home/statistics.html.erb
258
+ - app/views/educode_sales/money_plans/index.html.erb
259
+ - app/views/educode_sales/money_plans/index.json.jbuilder
256
260
  - app/views/educode_sales/operation_plans/_monthPlan.html.erb
257
261
  - app/views/educode_sales/operation_plans/_monthly.html.erb
258
262
  - app/views/educode_sales/operation_plans/_weekPlan.html.erb
@@ -405,6 +409,8 @@ files:
405
409
  - db/migrate/20211206054756_add_year_to_follow_ups.rb
406
410
  - db/migrate/20211214100803_create_customer_extensions.rb
407
411
  - db/migrate/20211215025029_create_educode_sales_customer_follows.rb
412
+ - db/migrate/20211220102720_add_position_to_commons.rb
413
+ - db/migrate/20211221075146_add_school_id_to_educode_sales_businesses.rb
408
414
  - lib/educode_sales.rb
409
415
  - lib/educode_sales/engine.rb
410
416
  - lib/educode_sales/version.rb