educode_sales 0.6.0 → 0.6.4
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.
- checksums.yaml +4 -4
- data/app/assets/images/educode_sales/money_plans.png +0 -0
- data/app/controllers/educode_sales/businesses_controller.rb +7 -4
- data/app/controllers/educode_sales/customers_controller.rb +45 -34
- data/app/controllers/educode_sales/follow_ups_controller.rb +1 -1
- data/app/controllers/educode_sales/money_plans_controller.rb +64 -0
- data/app/controllers/educode_sales/places_controller.rb +5 -1
- data/app/controllers/educode_sales/roles_controller.rb +4 -1
- data/app/controllers/educode_sales/sale_trends_controller.rb +44 -1
- data/app/controllers/educode_sales/staffs_controller.rb +3 -4
- data/app/controllers/educode_sales/teachers_controller.rb +13 -2
- data/app/models/educode_sales/permission.rb +3 -2
- data/app/models/educode_sales/role_area.rb +1 -0
- data/app/views/educode_sales/businesses/_follows.html.erb +18 -15
- data/app/views/educode_sales/businesses/edit.html.erb +3 -0
- data/app/views/educode_sales/businesses/index.html.erb +28 -18
- data/app/views/educode_sales/businesses/index.json.jbuilder +1 -0
- data/app/views/educode_sales/businesses/show_follow.html.erb +2 -1
- data/app/views/educode_sales/businesses/time_line.html.erb +1 -1
- data/app/views/educode_sales/customers/edit.html.erb +732 -22
- data/app/views/educode_sales/customers/index.html.erb +19 -19
- data/app/views/educode_sales/customers/index.json.jbuilder +3 -3
- data/app/views/educode_sales/customers/new.html.erb +710 -27
- data/app/views/educode_sales/customers/new_department.html.erb +1 -0
- data/app/views/educode_sales/customers/show_follow.html.erb +5 -2
- data/app/views/educode_sales/customers/show_follow_record.html.erb +5 -4
- data/app/views/educode_sales/follow_ups/index.json.jbuilder +1 -0
- data/app/views/educode_sales/money_plans/index.html.erb +183 -0
- data/app/views/educode_sales/money_plans/index.json.jbuilder +20 -0
- data/app/views/educode_sales/places/index.html.erb +64 -0
- data/app/views/educode_sales/plans/_monthPlan.html.erb +2 -1
- data/app/views/educode_sales/plans/_weekPlan.html.erb +2 -1
- data/app/views/educode_sales/roles/edit.html.erb +9 -1
- data/app/views/educode_sales/sale_trends/trends.html.erb +93 -13
- data/app/views/educode_sales/sale_trends/trends.json.jbuilder +3 -14
- data/app/views/educode_sales/sales/index.html.erb +25 -17
- data/app/views/educode_sales/sales/index.json.jbuilder +20 -2
- data/app/views/educode_sales/sales/operations.json.jbuilder +2 -2
- data/app/views/educode_sales/teachers/index.html.erb +4 -11
- data/app/views/educode_sales/teachers/index.json.jbuilder +1 -1
- data/app/views/layouts/educode_sales/application.html.erb +13 -2
- data/config/routes.rb +2 -0
- data/db/migrate/20210902064109_create_educode_sales_role_permissions.rb +3 -0
- data/db/migrate/20211220102720_add_position_to_commons.rb +12 -0
- data/db/migrate/20211221075146_add_school_id_to_educode_sales_businesses.rb +8 -0
- data/lib/educode_sales/version.rb +1 -1
- metadata +8 -2
@@ -19,12 +19,12 @@
|
|
19
19
|
<%= select_tag "staff_id", options_for_select(@staffs,params[:staff_id]), { 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
|
-
<input type="text" class="layui-input" id="date" name="date" placeholder=" - "
|
26
|
-
</div
|
27
|
-
</div
|
22
|
+
<!-- <div class="layui-inline">-->
|
23
|
+
<!-- <label class="layui-form-label">最后跟进</label>-->
|
24
|
+
<!-- <div class="layui-input-inline">-->
|
25
|
+
<!-- <input type="text" class="layui-input" id="date" name="date" placeholder=" - ">-->
|
26
|
+
<!-- </div>-->
|
27
|
+
<!-- </div>-->
|
28
28
|
|
29
29
|
<div class="layui-inline">
|
30
30
|
<button type="reset" class="layui-btn layui-btn-primary" lay-submit lay-filter="reset_business_search">重置
|
@@ -40,7 +40,7 @@
|
|
40
40
|
<div class="layui-btn-container">
|
41
41
|
<span class="table-label">客户列表</span>
|
42
42
|
<% if can? :create, EducodeSales::Customer %>
|
43
|
-
|
43
|
+
<button class="layui-btn layui-btn-normal layui-btn-sm data-add-btn pull-right" lay-event="add">添加客户</button>
|
44
44
|
<% end %>
|
45
45
|
<% if can? :give, EducodeSales::Customer %>
|
46
46
|
<button class="layui-btn layui-btn-normal layui-btn-sm data-add-btn pull-right" lay-event="give">分配/移交</button>
|
@@ -59,14 +59,14 @@
|
|
59
59
|
<a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="add_follow">添加跟进记录</a>
|
60
60
|
<% end %>
|
61
61
|
<% if can? :update, EducodeSales::Customer %>
|
62
|
-
|
62
|
+
<a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="edit">编辑</a>
|
63
63
|
<% end %>
|
64
64
|
</script>
|
65
65
|
<script type="text/html" id="business">
|
66
66
|
<a href="/missions/businesses?school={{d.name}}" class="layui-table-link">{{ d.business }}</a>
|
67
67
|
</script>
|
68
68
|
<script type="text/html" id="name">
|
69
|
-
<a href="
|
69
|
+
<a href="<%= base_url%>/colleges/{{d.id}}/statistics" class="layui-table-link" target="_blank">{{ d.name }}</a>
|
70
70
|
</script>
|
71
71
|
<script type="text/html" id="department">
|
72
72
|
<a href="javascript:void(0);" lay-event="department" class="layui-table-link">{{ d.department }}</a>
|
@@ -87,12 +87,12 @@
|
|
87
87
|
|
88
88
|
var laydate = layui.laydate;
|
89
89
|
|
90
|
-
function hn(){
|
91
|
-
|
92
|
-
}
|
93
|
-
$(document).ready(function(){
|
94
|
-
|
95
|
-
});
|
90
|
+
// function hn(){
|
91
|
+
// $("#search_bt").trigger("click");
|
92
|
+
// }
|
93
|
+
// $(document).ready(function(){
|
94
|
+
// window.onload=hn;
|
95
|
+
// });
|
96
96
|
|
97
97
|
laydate.render({
|
98
98
|
elem: '#date',
|
@@ -106,17 +106,17 @@
|
|
106
106
|
table.render({
|
107
107
|
elem: '#customers_table',
|
108
108
|
url: '/missions/customers',
|
109
|
-
|
109
|
+
where: {q: form.val('search_teachers')},
|
110
110
|
toolbar: '#toolbarDemo',
|
111
111
|
// totalRow:true,
|
112
112
|
defaultToolbar: ['filter'],
|
113
113
|
cols: [
|
114
114
|
[
|
115
|
-
{type:'checkbox'},
|
115
|
+
{type: 'checkbox'},
|
116
116
|
{
|
117
117
|
field: 'id',
|
118
118
|
width: 60,
|
119
|
-
title:'序号',type: 'numbers',
|
119
|
+
title: '序号', type: 'numbers',
|
120
120
|
|
121
121
|
},
|
122
122
|
{
|
@@ -337,7 +337,7 @@
|
|
337
337
|
var data = obj.data;
|
338
338
|
id = data.id
|
339
339
|
if (obj.event === 'edit') { // 监听添加操作
|
340
|
-
var content = miniPage.getHrefContent('/missions/customers' + data.id + '/edit');
|
340
|
+
var content = miniPage.getHrefContent('/missions/customers/' + data.id + '/edit');
|
341
341
|
var openWH = miniPage.getOpenWidthHeight();
|
342
342
|
sale_plan_index = layer.open({
|
343
343
|
title: '编辑客户',
|
@@ -1,7 +1,7 @@
|
|
1
|
+
x = EducodeSales::Common.find_by(extras: EducodeSales::Common::XTYPE)&.id
|
1
2
|
json.data do
|
2
3
|
json.array! @customers do |d|
|
3
|
-
|
4
|
-
business_ids = EducodeSales::Business.where(department_id: department_ids).ids
|
4
|
+
business_ids = EducodeSales::Business.where(school_id: d.id).ids
|
5
5
|
follow_ups = EducodeSales::FollowUp.where(business_id: business_ids)
|
6
6
|
customer_follows = EducodeSales::CustomerFollow.where(school_id: d.id)
|
7
7
|
a_last_follow_time = follow_ups.last&.created_at&.to_s
|
@@ -15,7 +15,7 @@ json.data do
|
|
15
15
|
json.name d.name
|
16
16
|
json.area d.province
|
17
17
|
json.department d.departments.size
|
18
|
-
json.business
|
18
|
+
json.business EducodeSales::Business.joins(:last_follow_up).where("educode_sales_follow_ups.clazz_id != ?", x).where("educode_sales_businesses.school_id = ?", d.id).size
|
19
19
|
json.follow follow_ups.size + customer_follows.size
|
20
20
|
json.staff EducodeSales::CustomerExtension.find_by(school_id: d.id)&.customer_staff&.user&.real_name
|
21
21
|
end
|