educode_sales 0.9.67 → 0.9.69

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 (76) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/images/educode_sales/indexlogo.png +0 -0
  3. data/app/assets/javascripts/educode_sales/extent/treeTable.js +235 -0
  4. data/app/controllers/educode_sales/activities_controller.rb +52 -38
  5. data/app/controllers/educode_sales/businesses_controller.rb +1 -1
  6. data/app/controllers/educode_sales/customers_controller.rb +107 -0
  7. data/app/controllers/educode_sales/follow_ups_controller.rb +6 -0
  8. data/app/controllers/educode_sales/operation_plans_controller.rb +8 -4
  9. data/app/controllers/educode_sales/plans_controller.rb +173 -11
  10. data/app/controllers/educode_sales/projects_controller.rb +420 -0
  11. data/app/controllers/educode_sales/recycles_controller.rb +11 -1
  12. data/app/controllers/educode_sales/roles_controller.rb +4 -1
  13. data/app/controllers/educode_sales/teachers_controller.rb +42 -17
  14. data/app/controllers/educode_sales/upload_files_controller.rb +9 -2
  15. data/app/helpers/educode_sales/application_helper.rb +1 -0
  16. data/app/models/educode_sales/activity.rb +4 -0
  17. data/app/models/educode_sales/assessments_setting.rb +2 -2
  18. data/app/models/educode_sales/business.rb +21 -5
  19. data/app/models/educode_sales/business_history.rb +8 -0
  20. data/app/models/educode_sales/business_info.rb +9 -0
  21. data/app/models/educode_sales/permission.rb +2 -1
  22. data/app/models/educode_sales/project.rb +53 -0
  23. data/app/models/educode_sales/role_area.rb +2 -1
  24. data/app/models/educode_sales/sale_plan.rb +3 -1
  25. data/app/models/educode_sales/staff.rb +2 -0
  26. data/app/views/educode_sales/activities/_follows.html.erb +50 -36
  27. data/app/views/educode_sales/activities/_index.html.erb +82 -9
  28. data/app/views/educode_sales/activities/edit.html.erb +25 -68
  29. data/app/views/educode_sales/activities/files.html.erb +157 -0
  30. data/app/views/educode_sales/activities/files.json.jbuilder +13 -0
  31. data/app/views/educode_sales/activities/follow_ups.json.jbuilder +1 -1
  32. data/app/views/educode_sales/activities/index.json.jbuilder +2 -2
  33. data/app/views/educode_sales/activities/new.html.erb +21 -60
  34. data/app/views/educode_sales/activities/show_teachers.html.erb +1 -1
  35. data/app/views/educode_sales/activities/upload_file.html.erb +43 -0
  36. data/app/views/educode_sales/businesses/get_export_data.json.jbuilder +3 -0
  37. data/app/views/educode_sales/businesses/index.html.erb +5 -0
  38. data/app/views/educode_sales/businesses/index.json.jbuilder +3 -0
  39. data/app/views/educode_sales/businesses/new.html.erb +1 -1
  40. data/app/views/educode_sales/businesses/time_line.html.erb +9 -5
  41. data/app/views/educode_sales/customers/edit_major.html.erb +872 -0
  42. data/app/views/educode_sales/customers/list.html.erb +602 -0
  43. data/app/views/educode_sales/customers/list.json.jbuilder +33 -0
  44. data/app/views/educode_sales/follow_ups/index.json.jbuilder +2 -2
  45. data/app/views/educode_sales/plans/_yearPlan.html.erb +234 -0
  46. data/app/views/educode_sales/plans/business_infos.json.jbuilder +23 -0
  47. data/app/views/educode_sales/plans/edit_bussiness_info.html.erb +79 -0
  48. data/app/views/educode_sales/plans/edit_bussiness_info_extra.html.erb +260 -0
  49. data/app/views/educode_sales/plans/edit_year_plan.html.erb +237 -0
  50. data/app/views/educode_sales/plans/index.html.erb +8 -0
  51. data/app/views/educode_sales/plans/new_year.html.erb +204 -0
  52. data/app/views/educode_sales/plans/plan_business_infos.json.jbuilder +42 -0
  53. data/app/views/educode_sales/plans/years_plan.json.jbuilder +17 -0
  54. data/app/views/educode_sales/projects/detail.html.erb +269 -0
  55. data/app/views/educode_sales/projects/edit.html.erb +246 -0
  56. data/app/views/educode_sales/projects/history.html.erb +41 -0
  57. data/app/views/educode_sales/projects/index.html.erb +688 -0
  58. data/app/views/educode_sales/projects/index.json.jbuilder +69 -0
  59. data/app/views/educode_sales/recycles/_monthly.html.erb +1 -1
  60. data/app/views/educode_sales/recycles/_yearPlan.html.erb +118 -0
  61. data/app/views/educode_sales/recycles/index.html.erb +26 -22
  62. data/app/views/educode_sales/recycles/monthPlan.json.jbuilder +0 -1
  63. data/app/views/educode_sales/recycles/yearPlan.json.jbuilder +14 -0
  64. data/app/views/educode_sales/teachers/_index.html.erb +17 -1
  65. data/app/views/educode_sales/teachers/index.json.jbuilder +2 -0
  66. data/app/views/layouts/educode_sales/application.html.erb +25 -0
  67. data/config/routes.rb +31 -0
  68. data/db/migrate/20230330141213_create_educode_sales_activity_follow_ups.rb +6 -0
  69. data/db/migrate/20230405074036_add_year_to_sale_plans.rb +38 -0
  70. data/db/migrate/20230411134203_add_realname_to_teacher.rb +5 -0
  71. data/db/migrate/20230412083510_add_p_staff_id_to_businesses.rb +20 -0
  72. data/db/migrate/20230412092000_create_business_histories.rb +10 -0
  73. data/db/migrate/20230413015619_add_permissions_to_projects.rb +11 -0
  74. data/db/migrate/20230413031029_add_pre_time_to_businesses.rb +5 -0
  75. data/lib/educode_sales/version.rb +1 -1
  76. metadata +38 -5
@@ -0,0 +1,69 @@
1
+ follow_up_ids = EducodeSales::AssignFollowUp.where(staff_id: @current_admin.id).pluck(:follow_up_id)
2
+ follow_count = 0
3
+ json.data do
4
+ json.array! @businesses do |d|
5
+ json.(d, :p_stage, :p_difficulty, :p_special, :p_status, :p_staff_id, :p_sale_staff_id, :p_course_time, :p_platform_time, :p_deploy_time, :p_accept_time, :p_pre_money_time, :p_actual_money_time, :p_money, :p_content, :p_deleted_at, :p_deleter_id)
6
+ json.p_staff d.p_staff&.user&.real_name
7
+ json.p_sale_staff d.p_sale_staff&.user&.real_name
8
+ json.p_deleter d.p_deleter&.user&.real_name
9
+ bidded_date = d.last_follow_up&.bidded_date
10
+ stage = d.last_follow_up&.stage&.name
11
+
12
+ json.p_state (bidded_date.present? && Time.now > bidded_date + 1.month && d.p_stage.blank? && stage == '已中标') || (d.p_pre_money_time.present? && Time.now > d.p_pre_money_time && d.p_actual_money_time.blank?) || (d.p_pre_accept_time.present? && Time.now > d.p_pre_accept_time && d.p_accept_time.blank?) ? "延期" : "正常"
13
+ json.id d.id
14
+ json.number d.number
15
+ json.name d.name
16
+ json.department d.department&.name
17
+ json.school d.department&.school&.name
18
+ json.school_id d.department&.school_id
19
+ follow_ups_count = d['follow_ups_counts'] || 0
20
+ json.follow_ups_count follow_ups_count
21
+ follow_count += follow_ups_count
22
+ json.follow_up_id d.last_follow_up_id
23
+ json.clazz d.clazz&.name || ""
24
+ json.clazz_changed d.last_follow_up&.clazz_changed || false
25
+ json.stage d.last_follow_up&.stage&.name
26
+ json.invitation_at d.last_follow_up&.invitation_at.to_s
27
+ json.reception_at d.last_follow_up&.reception_at.to_s
28
+ json.bidded_date d.last_follow_up&.bidded_date.to_s
29
+ json.signed_date d.last_follow_up&.signed_date.to_s
30
+ json.o_business_deployment EducodeSales::FollowUp::BUSINESS_DEPLOYMENT[1..-1].to_h.invert[d.last_follow_up&.o_business_deployment]
31
+ json.service_end_time d.last_follow_up&.service_start_time.to_s + "-" + d.last_follow_up&.service_end_time.to_s
32
+ json.created_at d.created_at.to_s
33
+ json.no_followup_days (d['latest_time'] ? DateTime.parse(Time.now.strftime("%Y-%m-%d")) - DateTime.parse(d['latest_time'].strftime("%Y-%m-%d")) : DateTime.parse(Time.now.strftime("%Y-%m-%d")) - DateTime.parse(d.created_at.strftime("%Y-%m-%d"))).to_i
34
+ json.staff_manages d.last_follow_up&.assign_follow_ups.present? ? (d.last_follow_up.assign_follow_ups.map{ |d| d.staff.user.real_name}.join("、")) : d.staff&.user&.real_name
35
+ json.divide_rate d.divide_rate
36
+ json.divide_money d.divide_amount.to_f.round(2)
37
+ json.budget_amount d.budget_amount.to_f.round(2) #d.follow_ups.where(stage_id: @budget_stage_ids).order("created_at desc").first&.total_amount&.round(2) || 0
38
+ json.area d.department&.school&.province
39
+ if d.department&.school
40
+ json.property d.department.school.school_tags.where(for_missions: true).pluck(:name).join("、")
41
+ else
42
+ json.property ''
43
+ end
44
+ json.sale_way d.last_follow_up&.place&.name.present? ? '渠道' : '直销'
45
+ json.year d.last_follow_up&.year.to_s
46
+ json.total_amount d.last_follow_up&.total_amount.to_f.round(2)
47
+ json.actual_amount d.last_follow_up&.actual_amount.to_f.round(2)
48
+ json.return_money d.return_money
49
+ json.wait_return_money d.wait_return_money.to_f.round(2)
50
+ json.return_money_days d.last_follow_up&.reception_at.present? && d.last_follow_up.money_plans.where(clazz: '实际回款').present? ? (d.last_follow_up.money_plans.where(clazz: '实际回款').order(created_at: :asc).first.date_at.to_s(:date).to_date - d.last_follow_up&.reception_at).to_i : ''
51
+ json.place d.last_follow_up&.place&.name
52
+ json.last_follow_person d.last_follow_up.present? ? d.last_follow_up.staff&.user&.real_name : d.staff&.user&.real_name
53
+ json.source d.source
54
+ json.assign_follow_ups d.last_follow_up.present? ? d.last_follow_up.assign_follow_ups.pluck(:staff_id) : []
55
+ json.current_staff_id @current_admin.id
56
+ json.staff_id d.staff_id
57
+ json.latest_time d.last_follow_up.present? ? d.last_follow_up.created_at.to_s : ''
58
+ json.self_flag (d.staff_id == @current_admin.id) || (d.last_follow_up_id.in? follow_up_ids)
59
+ json.followed d.users.pluck(:user_id).include?(@current_admin.user.id) ? 1 : 0 # d.users.where(user_id:@current_admin.user.id).first ? 1 : 0
60
+ json.is_deleted @is_deleted
61
+ end
62
+ end
63
+
64
+ json.totalRow do
65
+ json.follow_ups_count follow_count.to_i.to_s
66
+ end
67
+ json.code 0
68
+ json.count @businesses.total_count
69
+ json.msg 'succcess'
@@ -1,6 +1,6 @@
1
1
  <script type="text/html" id="toolbarDemo4">
2
2
  <div class="layui-btn-container">
3
- <span class="table-label">周报列表</span>
3
+ <span class="table-label">月报列表</span>
4
4
  </div>
5
5
  </script>
6
6
 
@@ -0,0 +1,118 @@
1
+ <script type="text/html" id="toolbarDemo6">
2
+ <div class="layui-btn-container">
3
+ <span class="table-label">年计划列表</span>
4
+ </div>
5
+ </script>
6
+
7
+ <table class="layui-hide" id="yearPlan" lay-filter="yearPlan"></table>
8
+
9
+ <script type="text/html" id="currentTableBar6">
10
+ <a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="restore">还原</a>
11
+ <a class="layui-btn layui-btn-xs layui-btn-danger data-count-delete" lay-event="delete">删除</a>
12
+ </script>
13
+
14
+ <script type="text/html" id="showchance">
15
+ <a href="/missions/businesses" class="layui-table-link">{{ d.chance }}</a>
16
+ </script>
17
+
18
+ <script>
19
+ layui.use(['form', 'table', 'miniPage', 'element', 'request'], function () {
20
+ var $ = layui.jquery,
21
+ form = layui.form,
22
+ table = layui.table,
23
+ request = layui.request,
24
+ miniPage = layui.miniPage;
25
+
26
+ table.render({
27
+ elem: '#yearPlan',
28
+ url: '/missions/recycles/yearPlan',
29
+ toolbar: '#toolbarDemo6',
30
+ totalRow:true,
31
+ defaultToolbar: [],
32
+ cols: [
33
+ [
34
+ {
35
+ field: 'id',
36
+ width: 60,
37
+ title:'序号',type: 'numbers',
38
+ },
39
+ {
40
+ field: 'name',
41
+ width: 90,
42
+ title: '姓名'
43
+ },
44
+ {
45
+ field: 'year',
46
+ width: 90,
47
+ title: '年度',
48
+ },
49
+ {
50
+ field: 'plan',
51
+ title: '计划内容'
52
+ },
53
+ {
54
+ field: 'update_at',
55
+ width: 160,
56
+ title: '更新时间',
57
+ sort: true,
58
+ },
59
+ {
60
+ field: 'deleter',
61
+ width: 90,
62
+ title: '删除人',
63
+ },
64
+ {
65
+ field: 'delete_time',
66
+ width: 160,
67
+ title: '删除时间',
68
+ sort: true,
69
+ },
70
+ {
71
+ title: '操作',
72
+ width: 120,
73
+ toolbar: '#currentTableBar6',
74
+ align: "center"
75
+ }
76
+ ]
77
+ ],
78
+ limit: 20,
79
+ limits: [10,15,20,30,40,50,60,70,80,90],
80
+ page: true
81
+ });
82
+
83
+ var sort = {}, search = {};
84
+ table.on('sort(yearPlan)', function (obj) {
85
+ sort.field = obj.field;
86
+ sort.order = obj.type;
87
+ table.reload('yearPlan', {
88
+ initSort: obj,
89
+ where: {
90
+ sort: sort,
91
+ q: search
92
+ }
93
+ });
94
+ })
95
+
96
+
97
+ table.on('tool(yearPlan)', function (obj) {
98
+ var data = obj.data;
99
+ var id = data.id
100
+ if (obj.event === 'restore') {
101
+ layer.confirm('确定恢复' + data.name, function (index) {
102
+ request.get('missions/recycles/' + data.id + '/restore_plans', {}, function (res) {
103
+ layer.close(index);
104
+ table.reload("yearPlan")
105
+ })
106
+ });
107
+ } else if (obj.event === 'delete') {
108
+ layer.confirm('确定删除' + data.name, function (index) {
109
+ request.delete('missions/recycles/' + data.id, {}, function (res) {
110
+ layer.close(index);
111
+ table.reload("yearPlan")
112
+ })
113
+ });
114
+ }
115
+ });
116
+
117
+ });
118
+ </script>
@@ -5,6 +5,7 @@
5
5
  <li data="weekly">周报</li>
6
6
  <li data="month">月计划</li>
7
7
  <li data="monthly">月报</li>
8
+ <li data="year">年计划</li>
8
9
  </ul>
9
10
  <div class="layui-tab-content">
10
11
  <div class="layui-tab-item layui-show">
@@ -22,6 +23,9 @@
22
23
  <div class="layui-tab-item">
23
24
  <%= render 'monthly' %>
24
25
  </div>
26
+ <div class="layui-tab-item">
27
+ <%= render 'yearPlan' %>
28
+ </div>
25
29
  </div>
26
30
  </div>
27
31
 
@@ -30,29 +34,29 @@
30
34
  var $ = layui.jquery,
31
35
  table = layui.table,
32
36
  element = layui.element;
33
- element.on('tab(sale_tab)', function (data) {
34
- var status = $(this).attr('data')
35
- switch (status) {
36
- case 'week':
37
- $("#week_table_wraper .layui-table-fixed-r")[0].classList.remove('layui-hide');
38
- $("#week_table_wraper .layui-table-fixed-r .layui-table-body")[0].style.height="auto";
39
- break;
40
- case 'weekly':
41
- $("#sales_weelky_table .layui-table-fixed-r")[0].classList.remove('layui-hide');
42
- $("#sales_weelky_table .layui-table-fixed-r .layui-table-body")[0].style.height="auto";
43
- break;
44
- ;
45
- case 'monthly':
46
- $("#monthly_table_wraper .layui-table-fixed-r")[0].classList.remove('layui-hide');
47
- $("#monthly_table_wraper .layui-table-fixed-r .layui-table-body")[0].style.height="auto";
48
- break;
49
- case 'month':
50
- $("#month_table_wraper .layui-table-fixed-r")[0].classList.remove('layui-hide');
51
- $("#month_table_wraper .layui-table-fixed-r .layui-table-body")[0].style.height="auto";
52
- break;
53
- }
37
+ // element.on('tab(sale_tab)', function (data) {
38
+ // var status = $(this).attr('data')
39
+ // switch (status) {
40
+ // case 'week':
41
+ // $("#week_table_wraper .layui-table-fixed-r")[0].classList.remove('layui-hide');
42
+ // $("#week_table_wraper .layui-table-fixed-r .layui-table-body")[0].style.height="auto";
43
+ // break;
44
+ // case 'weekly':
45
+ // $("#sales_weelky_table .layui-table-fixed-r")[0].classList.remove('layui-hide');
46
+ // $("#sales_weelky_table .layui-table-fixed-r .layui-table-body")[0].style.height="auto";
47
+ // break;
48
+ // ;
49
+ // case 'monthly':
50
+ // $("#monthly_table_wraper .layui-table-fixed-r")[0].classList.remove('layui-hide');
51
+ // $("#monthly_table_wraper .layui-table-fixed-r .layui-table-body")[0].style.height="auto";
52
+ // break;
53
+ // case 'month':
54
+ // $("#month_table_wraper .layui-table-fixed-r")[0].classList.remove('layui-hide');
55
+ // $("#month_table_wraper .layui-table-fixed-r .layui-table-body")[0].style.height="auto";
56
+ // break;
57
+ // }
54
58
 
55
59
 
56
- })
60
+ // })
57
61
  })
58
62
  </script>
@@ -1,6 +1,5 @@
1
1
  json.data do
2
2
  json.array! @monthPlans do |d|
3
- next if EducodeSales::SalePlan.unscoped.find(d.source_id).weekly.present?
4
3
  json.id d.id
5
4
  json.name EducodeSales::SalePlan.unscoped.find(d.source_id).staff.user.real_name
6
5
  json.month EducodeSales::SalePlan.unscoped.find(d.source_id).month.strftime("%Y-%m")
@@ -0,0 +1,14 @@
1
+ json.data do
2
+ json.array! @plans do |d|
3
+ json.id d.id
4
+ json.name EducodeSales::SalePlan.unscoped.find(d.source_id).staff.user.real_name
5
+ json.year EducodeSales::SalePlan.unscoped.find(d.source_id).year
6
+ json.plan EducodeSales::SalePlan.unscoped.find(d.source_id).content
7
+ json.update_at EducodeSales::SalePlan.unscoped.find(d.source_id).updated_at.to_s
8
+ json.deleter EducodeSales::Staff.find(d.deleter_id).user.real_name
9
+ json.delete_time d.created_at.to_s
10
+ end
11
+ end
12
+
13
+ json.code 0
14
+ json.count @plans.total_count
@@ -19,6 +19,18 @@
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">
23
+ <label class="layui-form-label">生态经理</label>
24
+ <div class="layui-input-inline">
25
+ <%= select_tag "staff_manage", options_for_select(@staff_manage), { 'lay-filter': 'staff_manage', include_blank: true } %>
26
+ </div>
27
+ </div>
28
+ <div class="layui-inline">
29
+ <label class="layui-form-label">最新跟进人</label>
30
+ <div class="layui-input-inline">
31
+ <%= select_tag "staff_id", options_for_select(@follow_upers), { 'lay-filter': 'staff_id', include_blank: true } %>
32
+ </div>
33
+ </div>
22
34
  <div class="layui-inline show_item" style="display:none;">
23
35
  <label class="layui-form-label">导流来源</label>
24
36
  <div class="layui-input-inline">
@@ -183,7 +195,11 @@
183
195
  width: 130,
184
196
  title: '部门',
185
197
  templet:'<div><span title="{{d.department}}">{{d.department}}</span></div>'
186
-
198
+ },
199
+ {
200
+ field: 'majors',
201
+ width: 160,
202
+ title: '专业',
187
203
  },
188
204
  {
189
205
  field: 'professional_title',
@@ -27,6 +27,8 @@ json.data do
27
27
 
28
28
  json.staff_manage @staff_manages[d.department&.school&.province]&.join(",")
29
29
 
30
+ json.majors d.department&.department_majors&.pluck(:name).present? ? d.department&.department_majors&.pluck(:name).join(",") : ""
31
+
30
32
  json.follow_person d.follow_up&.staff&.user&.real_name || ''
31
33
  json.created_on d.user.present? ? d.user.created_on.to_s(:date) : ''
32
34
  json.last_login_on (d.user.present? && d.user.last_login_on.present?) ? d.user.last_login_on.to_s(:date) : ''
@@ -92,6 +92,16 @@
92
92
  <% end %>
93
93
  </dl>
94
94
  </li>
95
+ <% if can? :read, EducodeSales::Customer %>
96
+ <li class="layui-nav-item layui-nav-itemed menu-li">
97
+ <a class="" href="javascript:;"><b><%= image_tag "educode_sales/客户管理.png", size: "15" %>
98
+ <i style="padding-right: 25px"></i>客户管理</b></a>
99
+ <dl class="layui-nav-child">
100
+ <dd><a href="/missions/customers/list" class="<%= current?('layui-this', list_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>
101
+ </dd>
102
+ </dl>
103
+ </li>
104
+ <% end %>
95
105
  <li class="layui-nav-item layui-nav-itemed menu-li">
96
106
  <a class="" href="javascript:;"><b><%= image_tag "educode_sales/7.运营活动.png", size: "15" %>
97
107
  <i style="font-size: 25px; padding-right: 25px"></i>运营活动</b></a>
@@ -145,6 +155,21 @@
145
155
  </li>
146
156
  <% end %>
147
157
 
158
+ <% if can?(:read, EducodeSales::Project) %>
159
+ <li class="layui-nav-item layui-nav-itemed menu-li">
160
+ <a class="" href="javascript:;"><b><%= image_tag "educode_sales/5.渠道管理.png", size: "15" %>
161
+ <i style="font-size: 25px; padding-right: 25px"></i>项目管理</b></a>
162
+ <dl class="layui-nav-child">
163
+ <dd>
164
+ <a href="/missions/projects" class="<%= current?('layui-this', projects_path) %>"><i style="padding-right: 35px"></i><%= image_tag "educode_sales/7.运营活动.png", size: "15" %>
165
+ <i style="font-size: 25px; padding-right: 15px"></i>项目交付管理</a></dd>
166
+ <!-- <dd>-->
167
+ <!-- <a href="/missions/idea_recycles" class="<%#= current?('layui-this', idea_recycles_path) %>"><i style="padding-right: 35px"></i><%#= image_tag "educode_sales/回收站.png", size: "15" %>-->
168
+ <!-- <i style="font-size: 25px; padding-right: 15px"></i>方案回收站</a></dd>-->
169
+ </dl>
170
+ </li>
171
+ <% end %>
172
+
148
173
  <% if @current_admin.is_admin || @current_admin.code == 'userbe' %>
149
174
  <li class="layui-nav-item layui-nav-itemed menu-li">
150
175
  <a class="" href="javascript:;"><b><%= image_tag "educode_sales/13.系统设置.png", size: "15" %>
data/config/routes.rb CHANGED
@@ -44,6 +44,7 @@ EducodeSales::Engine.routes.draw do
44
44
  post :batch_update_school_tags
45
45
  get :majors
46
46
  get :new_major
47
+ get :list
47
48
  end
48
49
 
49
50
  member do
@@ -54,6 +55,7 @@ EducodeSales::Engine.routes.draw do
54
55
  post :major
55
56
  put :update_major
56
57
  delete :delete_major
58
+ get :edit_major
57
59
  end
58
60
  end
59
61
 
@@ -84,6 +86,7 @@ EducodeSales::Engine.routes.draw do
84
86
  put :update_money
85
87
  delete :delete_money
86
88
  put :update_advise
89
+ put :comment
87
90
  end
88
91
  end
89
92
 
@@ -143,6 +146,7 @@ EducodeSales::Engine.routes.draw do
143
146
  get :monthPlan
144
147
  get :weekPlan
145
148
  get :business
149
+ get :yearPlan
146
150
  end
147
151
  member do
148
152
  get :restore_plans
@@ -167,6 +171,20 @@ EducodeSales::Engine.routes.draw do
167
171
  get :edit_monthly
168
172
  get :my_week
169
173
  get :my_month
174
+ get :new_year
175
+ get :years_plan
176
+ post :create_business_info
177
+ get :business_infos
178
+ get :edit_bussiness_info
179
+ post :update_business_info
180
+ post :create_sales_plan
181
+ get :edit_year_plan
182
+ get :plan_business_infos
183
+ get :edit_bussiness_info_extra
184
+ post :update_business_info_extra
185
+ end
186
+ member do
187
+ delete :delete_business_info
170
188
  end
171
189
  end
172
190
 
@@ -245,6 +263,15 @@ EducodeSales::Engine.routes.draw do
245
263
  end
246
264
  end
247
265
 
266
+ resources :projects do
267
+ collection do
268
+ get :detail
269
+ get :history
270
+ post :recycle
271
+ end
272
+ member do
273
+ end
274
+ end
248
275
  resources :ideas do
249
276
  collection do
250
277
  get :detail
@@ -267,10 +294,14 @@ EducodeSales::Engine.routes.draw do
267
294
  get :show_teachers
268
295
  get :new_follow_up
269
296
  get :follow_ups
297
+ post :add_advise
298
+ get :upload_file
270
299
  end
271
300
  member do
272
301
  get :show_schools
273
302
  post :follow_up
303
+ put :update_advise
304
+ get :files
274
305
  end
275
306
  end
276
307
 
@@ -21,5 +21,11 @@ class CreateEducodeSalesActivityFollowUps < ActiveRecord::Migration[5.2]
21
21
  EducodeSales::Permission.find_or_create_by(name: '添加跟进记录', subject: 'ActivityFollowUp', action: 'create', clazz: 'activity')
22
22
  EducodeSales::Permission.find_or_create_by(name: '团队建议', subject: 'ActivityFollowUp', action: 'advise', clazz: 'activity')
23
23
  # EducodeSales::Permission.find_or_create_by(name: '附件', subject: 'ActivityFollowUp', action: 'upload', clazz: 'activity')
24
+
25
+
26
+ EducodeSales::Permission.find_or_create_by(name: '上传文件', subject: 'Activity', action: 'upload_file', clazz: 'activity')
27
+ EducodeSales::Permission.find_or_create_by(name: '下载附件', subject: 'Activity', action: 'download_file', clazz: 'activity')
28
+ EducodeSales::Permission.find_or_create_by(name: '删除附件', subject: 'Activity', action: 'delete_file', clazz: 'activity')
29
+ EducodeSales::Permission.find_or_create_by(name: '查看附件', subject: 'Activity', action: 'show_file', clazz: 'activity')
24
30
  end
25
31
  end
@@ -0,0 +1,38 @@
1
+ class AddYearToSalePlans < ActiveRecord::Migration[5.2]
2
+ def change
3
+ add_column :educode_sales_sale_plans, :year, :string
4
+ add_column :educode_sales_sale_plans, :clazz, :integer
5
+
6
+ create_table :educode_sales_business_infos do |t|
7
+ t.references :business
8
+ t.references :staff
9
+ t.references :sale_plan
10
+ t.string :year, comment: '年份'
11
+ t.integer :clazz, comment: '目标类型'
12
+ t.date :plan_bid_on, comment: '计划投标时间'
13
+ t.date :actual_bidded_on, comment: '实际投标时间'
14
+ t.float :bidded_amount, comment: '中标额'
15
+ t.date :plan_sign_on, comment: '计划签单时间'
16
+ t.date :actual_sign_on, comment: '实际签单时间'
17
+ t.float :sign_amount, comment: '签单额'
18
+ t.date :plan_deploy_on, comment: '计划部署时间'
19
+ t.date :actual_deploy_on, comment: '实际部署时间'
20
+ t.date :plan_check_on, comment: '计划验收时间'
21
+ t.date :actual_check_on, comment: '实际验收时间'
22
+ t.date :prepayment_plan_on, comment: '预收款计划回款时间'
23
+ t.date :prepayment_actual_on, comment: '预收款实际回款时间'
24
+ t.float :prepayment_amount, comment: '预收款'
25
+ t.date :check_fee_plan_on, comment: '验收款计划回款时间'
26
+ t.date :check_fee_actual_on, comment: '验收款实际回款时间'
27
+ t.float :check_fee, comment: '验收款'
28
+ t.date :qa_plan_on, comment: '质保金计划回款时间'
29
+ t.date :qa_actual_on, comment: '质保金实际回款时间'
30
+ t.float :qa_amount, comment: '质保金'
31
+ t.float :account_receivable, comment: '应收款'
32
+ t.integer :account_receivable_clazz, comment: '应收款类型'
33
+ t.float :invoice_amount, comment: '开票金额'
34
+
35
+ t.timestamps
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,5 @@
1
+ class AddRealnameToTeacher < ActiveRecord::Migration[5.2]
2
+ def change
3
+ add_column :teachers, :realname, :string
4
+ end
5
+ end
@@ -0,0 +1,20 @@
1
+ class AddPStaffIdToBusinesses < ActiveRecord::Migration[5.2]
2
+ def change
3
+ add_column :educode_sales_businesses, :p_stage, :integer, comment: '项目阶段'
4
+ add_column :educode_sales_businesses, :p_difficulty, :integer, comment: '项目难度'
5
+ add_column :educode_sales_businesses, :p_special, :integer, comment: '定制'
6
+ add_column :educode_sales_businesses, :p_status, :integer, comment: '交付'
7
+ add_column :educode_sales_businesses, :p_staff_id, :integer, comment: '指派人'
8
+ add_column :educode_sales_businesses, :p_sale_staff_id, :integer, comment: '销售经理'
9
+ add_column :educode_sales_businesses, :p_course_time, :date, comment: '课程交付时间'
10
+ add_column :educode_sales_businesses, :p_platform_time, :date, comment: '平台交付时间'
11
+ add_column :educode_sales_businesses, :p_deploy_time, :date, comment: '现场部署时间'
12
+ add_column :educode_sales_businesses, :p_accept_time, :date, comment: '实际验收时间'
13
+ add_column :educode_sales_businesses, :p_pre_money_time, :date, comment: '拟定回款时间'
14
+ add_column :educode_sales_businesses, :p_actual_money_time, :date, comment: '实际回款时间'
15
+ add_column :educode_sales_businesses, :p_money, :float, default: 0, comment: '回款'
16
+ add_column :educode_sales_businesses, :p_content, :text, comment: '问题备注'
17
+ add_column :educode_sales_businesses, :p_deleted_at, :datetime, comment: '删除时间'
18
+ add_column :educode_sales_businesses, :p_deleter_id, :integer, comment: '删除人'
19
+ end
20
+ end
@@ -0,0 +1,10 @@
1
+ class CreateBusinessHistories < ActiveRecord::Migration[5.2]
2
+ def change
3
+ create_table :educode_sales_business_histories do |t|
4
+ t.references :business, index: true
5
+ t.references :staff, index: true
6
+ t.text :content
7
+ t.timestamps
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,11 @@
1
+ class AddPermissionsToProjects < ActiveRecord::Migration[5.2]
2
+ def change
3
+ last_position = EducodeSales::Permission.all.order(position: :asc).last&.position.to_i
4
+ EducodeSales::Permission.create(name: '查看项目', subject: 'Project', action: 'read', clazz: 'project', position: last_position + 1)
5
+ # EducodeSales::Permission.create(name: '添加项目', subject: 'Project', action: 'create', clazz: 'project', position: last_position + 2)
6
+ EducodeSales::Permission.create(name: '编辑项目', subject: 'Project', action: 'update', clazz: 'project', position: last_position + 3)
7
+ EducodeSales::Permission.create(name: '移除项目', subject: 'Project', action: 'destroy', clazz: 'project', position: last_position + 4)
8
+ EducodeSales::Permission.create(name: '恢复项目', subject: 'Project', action: 'recycle', clazz: 'project', position: last_position + 5)
9
+ EducodeSales::Permission.create(name: '查看历史记录', subject: 'Project', action: 'read_history', clazz: 'project', position: last_position + 6)
10
+ end
11
+ end
@@ -0,0 +1,5 @@
1
+ class AddPreTimeToBusinesses < ActiveRecord::Migration[5.2]
2
+ def change
3
+ add_column :educode_sales_businesses, :p_pre_accept_time, :date, comment: '拟定验收时间'
4
+ end
5
+ end
@@ -1,3 +1,3 @@
1
1
  module EducodeSales
2
- VERSION = '0.9.67'
2
+ VERSION = '0.9.69'
3
3
  end