educode_sales 0.9.42 → 0.9.43
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/controllers/educode_sales/customers_controller.rb +6 -0
- data/app/controllers/educode_sales/staffs_controller.rb +3 -2
- data/app/views/educode_sales/customers/index.html.erb +33 -30
- data/app/views/educode_sales/customers/index.json.jbuilder +11 -8
- data/lib/educode_sales/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 392c1371a9b0cb569b25de476461924555a2d8b077a2864f1bc33145ae65bc61
|
4
|
+
data.tar.gz: 250898b5906ea9b92a41eb4bef8b9ecba8e254bcd574d37d4cdc8cdd11f25811
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b66b2ee6d89ef9f63bd035843df5c6724bb34108320dbd9c2af6d3706ccc91e5a3af9940bd22eca06779e2f6ecebeb9e816beea8fb78c967cfb620666e45df9d
|
7
|
+
data.tar.gz: 2d0f88851293f938355a04ed9c8c90dceaf126dd8df3b4cd8a18c675dbd158203132dbd9e3f504c2803c25c4bb3fc57c0086372871bd3b193fc4f3ddc55cba08
|
@@ -91,6 +91,12 @@ module EducodeSales
|
|
91
91
|
school_property_ids += SchoolProperty.where(military_school: true).ids
|
92
92
|
when 6
|
93
93
|
school_property_ids += SchoolProperty.where(enterprise: true).ids
|
94
|
+
when 7
|
95
|
+
school_property_ids += SchoolProperty.where(mid_school: true).ids
|
96
|
+
when 8
|
97
|
+
school_property_ids += SchoolProperty.where(ele_school: true).ids
|
98
|
+
when 9
|
99
|
+
school_property_ids += SchoolProperty.where(other: true).ids
|
94
100
|
else
|
95
101
|
end
|
96
102
|
end
|
@@ -54,7 +54,8 @@ module EducodeSales
|
|
54
54
|
# gon.schools = School.all.first(100).map { |d| { value: d.id, title: d.name } } #.unshift({value: -1, title: '全国'})
|
55
55
|
@staff_types = Common.where(clazz: 'staff_type').pluck(:name, :id)
|
56
56
|
tag_ids = @staff.staff_school_tags.pluck(:school_tag_id)
|
57
|
-
|
57
|
+
names = %w[本科院校 军事院校 高职院校 中职院校 中学 小学 企业 其他]
|
58
|
+
gon.school_properties = SchoolTag.where(for_missions: true).sort_by { |tag| names.index(tag.name) }.map { |d| { value: d.id, name: d.name, selected: tag_ids.include?(d.id) } }
|
58
59
|
render layout: false
|
59
60
|
end
|
60
61
|
|
@@ -113,7 +114,7 @@ module EducodeSales
|
|
113
114
|
end
|
114
115
|
staff.staff_permissions.delete_all
|
115
116
|
permissions.each do |permission|
|
116
|
-
staff.staff_permissions.create(staff_id:staff.id, permission_id:permission.id)
|
117
|
+
staff.staff_permissions.create(staff_id: staff.id, permission_id: permission.id)
|
117
118
|
end
|
118
119
|
staff.staff_school_tags = tags
|
119
120
|
params[:current_admin] = @current_admin.id
|
@@ -16,15 +16,15 @@
|
|
16
16
|
<div class="layui-inline">
|
17
17
|
<label class="layui-form-label">负责人</label>
|
18
18
|
<div class="layui-input-inline">
|
19
|
-
<%= select_tag "staff_id", options_for_select(@staffs,params[:staff_id]), { include_blank: true } %>
|
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
|
<div class="layui-inline">
|
29
29
|
<label class="layui-form-label">性质</label>
|
30
30
|
<div class="layui-input-inline">
|
@@ -34,7 +34,8 @@
|
|
34
34
|
<div class="layui-inline">
|
35
35
|
<button type="reset" class="layui-btn layui-btn-primary" lay-submit lay-filter="reset_business_search">重置
|
36
36
|
</button>
|
37
|
-
<button type="submit" class="layui-btn layui-btn-primary" id="search_bt" lay-submit lay-filter="search_teachers">搜
|
37
|
+
<button type="submit" class="layui-btn layui-btn-primary" id="search_bt" lay-submit lay-filter="search_teachers">搜
|
38
|
+
索
|
38
39
|
</button>
|
39
40
|
</div>
|
40
41
|
</div>
|
@@ -48,7 +49,7 @@
|
|
48
49
|
<button class="layui-btn layui-btn-normal layui-btn-sm data-add-btn pull-right" lay-event="add">添加客户</button>
|
49
50
|
<% end %>
|
50
51
|
<% if can? :give, EducodeSales::Customer %>
|
51
|
-
|
52
|
+
<button class="layui-btn layui-btn-normal layui-btn-sm data-add-btn pull-right" lay-event="give">分配/移交</button>
|
52
53
|
<% end %>
|
53
54
|
</button>
|
54
55
|
</div>
|
@@ -61,17 +62,17 @@
|
|
61
62
|
<a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="add_department">添加部门</a>
|
62
63
|
<% end %>
|
63
64
|
<% if can? :create_follow, EducodeSales::Customer %>
|
64
|
-
<a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="add_follow">添加跟进记录</a>
|
65
|
+
<a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="add_follow">添加跟进记录</a>
|
65
66
|
<% end %>
|
66
67
|
<% if can? :update, EducodeSales::Customer %>
|
67
|
-
<a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="edit">编辑</a>
|
68
|
+
<a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="edit">编辑</a>
|
68
69
|
<% end %>
|
69
70
|
</script>
|
70
71
|
<script type="text/html" id="business">
|
71
|
-
<a href="/missions/businesses?school={{d.name}}"
|
72
|
+
<a href="/missions/businesses?school={{d.name}}" class="layui-table-link">{{ d.business }}</a>
|
72
73
|
</script>
|
73
74
|
<script type="text/html" id="name">
|
74
|
-
<a href="<%= base_url%>/colleges/{{d.id}}/statistics" class="layui-table-link" target="_blank">{{ d.name }}</a>
|
75
|
+
<a href="<%= base_url %>/colleges/{{d.id}}/statistics" class="layui-table-link" target="_blank">{{ d.name }}</a>
|
75
76
|
</script>
|
76
77
|
<script type="text/html" id="department">
|
77
78
|
<a href="javascript:void(0);" lay-event="department" class="layui-table-link">{{ d.department }}</a>
|
@@ -102,13 +103,16 @@
|
|
102
103
|
var property_list = xmSelect.render({
|
103
104
|
el: '#property',
|
104
105
|
data: [
|
105
|
-
{value: 0, name: '985工程'},
|
106
|
-
{value: 1, name: '211工程'},
|
106
|
+
// {value: 0, name: '985工程'},
|
107
|
+
// {value: 1, name: '211工程'},
|
107
108
|
{value: 2, name: '本科院校'},
|
108
|
-
{value: 3, name: '大专院校'},
|
109
|
-
{value: 4, name: '中专学校'},
|
110
109
|
{value: 5, name: '军事院校'},
|
111
|
-
{value:
|
110
|
+
{value: 3, name: '高职院校'},
|
111
|
+
{value: 4, name: '中职院校'},
|
112
|
+
{value: 7, name: '中学'},
|
113
|
+
{value: 8, name: '小学'},
|
114
|
+
{value: 6, name: '企业'},
|
115
|
+
{value: 9, name: '其他'},
|
112
116
|
]
|
113
117
|
})
|
114
118
|
|
@@ -191,7 +195,7 @@
|
|
191
195
|
],
|
192
196
|
|
193
197
|
limit: 20,
|
194
|
-
limits: [10,15,20,30,40,50,60,70,80,90],
|
198
|
+
limits: [10, 15, 20, 30, 40, 50, 60, 70, 80, 90],
|
195
199
|
page: true,
|
196
200
|
});
|
197
201
|
|
@@ -200,7 +204,6 @@
|
|
200
204
|
});
|
201
205
|
|
202
206
|
|
203
|
-
|
204
207
|
function edit(id) {
|
205
208
|
var content = miniPage.getHrefContent('/missions/teachers/' + id + '/edit');
|
206
209
|
var openWH = miniPage.getOpenWidthHeight();
|
@@ -262,7 +265,7 @@
|
|
262
265
|
// 监听搜索操作
|
263
266
|
form.on('submit(search_teachers)', function (data) {
|
264
267
|
var property = [];
|
265
|
-
property_list.getValue().forEach(function(d) {
|
268
|
+
property_list.getValue().forEach(function (d) {
|
266
269
|
property.push(d.value);
|
267
270
|
})
|
268
271
|
data.field.property = property.toString();
|
@@ -314,15 +317,15 @@
|
|
314
317
|
$(window).on("resize", function () {
|
315
318
|
layer.full(index);
|
316
319
|
});
|
317
|
-
}else if (obj.event === 'give') { //
|
320
|
+
} else if (obj.event === 'give') { //
|
318
321
|
var school_ids = []
|
319
322
|
var checkStatus = table.checkStatus('customers_table')
|
320
|
-
,data = checkStatus.data;
|
321
|
-
for (var i=0,len=data.length; i<len; i++){
|
323
|
+
, data = checkStatus.data;
|
324
|
+
for (var i = 0, len = data.length; i < len; i++) {
|
322
325
|
school_ids.push(data[i].id)
|
323
326
|
}
|
324
327
|
ids = school_ids
|
325
|
-
if(ids.length == 0){
|
328
|
+
if (ids.length == 0) {
|
326
329
|
layer.msg('请选择客户')
|
327
330
|
return
|
328
331
|
}
|
@@ -361,7 +364,6 @@
|
|
361
364
|
});
|
362
365
|
|
363
366
|
|
364
|
-
|
365
367
|
table.on('tool(customers_table)', function (obj) {
|
366
368
|
var data = obj.data;
|
367
369
|
id = data.id
|
@@ -427,7 +429,7 @@
|
|
427
429
|
|
428
430
|
} else if (obj.event === 'courses') {
|
429
431
|
teacher_id = data.id
|
430
|
-
content = miniPage.getHrefContent('/missions/teachers/add_courses?id='+data.id);
|
432
|
+
content = miniPage.getHrefContent('/missions/teachers/add_courses?id=' + data.id);
|
431
433
|
openWH = miniPage.getOpenWidthHeight();
|
432
434
|
index = layer.open({
|
433
435
|
title: '课程方向',
|
@@ -487,7 +489,7 @@
|
|
487
489
|
$(window).on("resize", function () {
|
488
490
|
layer.full(index);
|
489
491
|
});
|
490
|
-
}
|
492
|
+
} else if (obj.event === 'follow' || obj.event === 'name' || obj.event === 'department') {
|
491
493
|
id = data.id
|
492
494
|
time = data.last_follow_time || ''
|
493
495
|
content = miniPage.getHrefContent('/missions/customers/show_follow?id=' + data.id);
|
@@ -515,7 +517,8 @@
|
|
515
517
|
});
|
516
518
|
</script>
|
517
519
|
<style>
|
518
|
-
.layui-table-tool-temp{
|
519
|
-
padding-right: 30px;
|
520
|
+
.layui-table-tool-temp {
|
521
|
+
padding-right: 30px;
|
522
|
+
!important;
|
520
523
|
}
|
521
524
|
</style>
|
@@ -1,7 +1,7 @@
|
|
1
1
|
x = EducodeSales::Common.find_by(extras: EducodeSales::Common::XTYPE)&.id
|
2
2
|
json.data do
|
3
3
|
json.array! @customers do |d|
|
4
|
-
business_ids = EducodeSales::Business.where(school_id:
|
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
|
@@ -17,13 +17,16 @@ json.data do
|
|
17
17
|
school_property = d.school_property
|
18
18
|
property = []
|
19
19
|
if school_property.present?
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
20
|
+
# property << '985工程' if school_property.project_985
|
21
|
+
# property << '211工程' if school_property.project_211
|
22
|
+
property << '本科院校' if school_property.regular_college
|
23
|
+
property << '大专院校' if school_property.junior_college
|
24
|
+
property << '中专学校' if school_property.secondary_school
|
25
|
+
property << '军事院校' if school_property.military_school
|
26
|
+
property << '企业' if school_property.enterprise
|
27
|
+
property << '小学' if school_property.ele_school
|
28
|
+
property << '中学' if school_property.mid_school
|
29
|
+
property << '其他' if school_property.other
|
27
30
|
end
|
28
31
|
json.property property.join("、")
|
29
32
|
json.department d.departments.size
|