educode_sales 0.9.70 → 0.9.72
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/businesses_controller.rb +43 -2
- data/app/controllers/educode_sales/customers_controller.rb +45 -13
- data/app/controllers/educode_sales/follow_ups_controller.rb +20 -5
- data/app/controllers/educode_sales/plans_controller.rb +69 -19
- data/app/controllers/educode_sales/staffs_controller.rb +35 -0
- data/app/controllers/educode_sales/teachers_controller.rb +7 -0
- data/app/models/educode_sales/customer_follow.rb +1 -0
- data/app/models/educode_sales/sale_plan.rb +2 -0
- data/app/views/educode_sales/businesses/_follows.html.erb +11 -1
- data/app/views/educode_sales/businesses/edit_follow_record.html.erb +19 -0
- data/app/views/educode_sales/businesses/index.html.erb +77 -20
- data/app/views/educode_sales/businesses/index.json.jbuilder +3 -0
- data/app/views/educode_sales/businesses/key_person.html.erb +56 -0
- data/app/views/educode_sales/businesses/key_person.json.jbuilder +17 -0
- data/app/views/educode_sales/businesses/new_follow_record.html.erb +23 -9
- data/app/views/educode_sales/customers/list.html.erb +67 -23
- data/app/views/educode_sales/customers/list.json.jbuilder +22 -10
- data/app/views/educode_sales/customers/show_customer_follow.html.erb +175 -0
- data/app/views/educode_sales/customers/show_customer_follow.json.jbuilder +13 -0
- data/app/views/educode_sales/customers/show_majors.html.erb +146 -0
- data/app/views/educode_sales/follow_ups/index.json.jbuilder +2 -0
- data/app/views/educode_sales/plans/_yearPlan.html.erb +6 -3
- data/app/views/educode_sales/plans/business_infos.json.jbuilder +10 -4
- data/app/views/educode_sales/plans/edit_bussiness_info.html.erb +13 -8
- data/app/views/educode_sales/plans/edit_bussiness_info_extra.html.erb +16 -73
- data/app/views/educode_sales/plans/edit_year_plan.html.erb +64 -5
- data/app/views/educode_sales/plans/new_year.html.erb +51 -3
- data/app/views/educode_sales/plans/plan_business_infos.json.jbuilder +7 -0
- data/app/views/educode_sales/plans/years_plan.json.jbuilder +43 -3
- data/app/views/educode_sales/staffs/edit.html.erb +1 -1
- data/app/views/educode_sales/staffs/index.html.erb +20 -1
- data/app/views/educode_sales/staffs/list.html.erb +39 -0
- data/app/views/educode_sales/teachers/_index.html.erb +15 -5
- data/app/views/educode_sales/teachers/index.json.jbuilder +7 -0
- data/config/routes.rb +6 -0
- data/db/migrate/20230428015007_add_deploy_time_follow_ups.rb +6 -0
- data/lib/educode_sales/version.rb +1 -1
- metadata +13 -7
- data/app/assets/images/educode_sales/indexlogo.png +0 -0
@@ -130,6 +130,18 @@
|
|
130
130
|
</select>
|
131
131
|
</div>
|
132
132
|
</div>
|
133
|
+
<div class="layui-inline show_item" style="<%= params[:name] || params[:type] ? '' : 'display:none;' %>">
|
134
|
+
<label class="layui-form-label">销售经理</label>
|
135
|
+
<div class="layui-input-inline">
|
136
|
+
<div id="staff_manages" style="width: 190px;"></div>
|
137
|
+
</div>
|
138
|
+
</div>
|
139
|
+
<div class="layui-inline show_item" style="<%= params[:name] || params[:type] ? '' : 'display:none;' %>">
|
140
|
+
<label class="layui-form-label">客户类型</label>
|
141
|
+
<div class="layui-input-inline">
|
142
|
+
<%= select_tag "property", options_for_select(SchoolTag.where(for_missions: true).pluck(:name, :id)), { include_blank: true } %>
|
143
|
+
</div>
|
144
|
+
</div>
|
133
145
|
<div class="layui-inline">
|
134
146
|
<button type="reset" class="layui-btn layui-btn-primary" lay-submit lay-filter="reset_business_search">重置
|
135
147
|
</button>
|
@@ -228,7 +240,7 @@
|
|
228
240
|
</script>
|
229
241
|
|
230
242
|
<script type="text/html" id="show_keys">
|
231
|
-
<a href="javascript:void(0);" lay-event="show_keys" class="layui-table-link">{{ d.
|
243
|
+
<a href="javascript:void(0);" lay-event="show_keys" class="layui-table-link">{{ d.keys_person_count }}</a>
|
232
244
|
</script>
|
233
245
|
<script type="text/html" id="show_follow">
|
234
246
|
<a href="javascript:void(0);" lay-event="show_follow" class="layui-table-link">{{ d.follow_ups_count }}</a>
|
@@ -306,6 +318,14 @@
|
|
306
318
|
radio: true,
|
307
319
|
})
|
308
320
|
|
321
|
+
var staff_manages_list = xmSelect.render({
|
322
|
+
el: '#staff_manages',
|
323
|
+
data: gon.staffs,
|
324
|
+
filterable: true,
|
325
|
+
radio: true,
|
326
|
+
})
|
327
|
+
|
328
|
+
|
309
329
|
var business_step_list = xmSelect.render({
|
310
330
|
el: '#business_step',
|
311
331
|
data: gon.business_step
|
@@ -361,6 +381,8 @@
|
|
361
381
|
data.business_type = business_type_list.getValue('valueStr')
|
362
382
|
data.business_step = business_step_list.getValue('valueStr');
|
363
383
|
data.staff_id = staff_list.getValue('valueStr');
|
384
|
+
data.staff_manages = staff_manages_list.getValue('valueStr');
|
385
|
+
|
364
386
|
<% if params[:year].present? %>
|
365
387
|
data.year = "<%= params[:year] %>";
|
366
388
|
<% end %>
|
@@ -390,12 +412,6 @@
|
|
390
412
|
fixed: 'left',
|
391
413
|
hide: gon.filter.name
|
392
414
|
},
|
393
|
-
{
|
394
|
-
field: 'area',
|
395
|
-
width: 100,
|
396
|
-
title: '地域',
|
397
|
-
hide: gon.filter.area
|
398
|
-
},
|
399
415
|
{
|
400
416
|
field: 'school',
|
401
417
|
width: 150,
|
@@ -403,12 +419,6 @@
|
|
403
419
|
templet: '#school_name',
|
404
420
|
hide: gon.filter.school
|
405
421
|
},
|
406
|
-
{
|
407
|
-
field: 'property',
|
408
|
-
width: 150,
|
409
|
-
title: '客户类型',
|
410
|
-
hide: gon.filter.property
|
411
|
-
},
|
412
422
|
{
|
413
423
|
field: 'department',
|
414
424
|
width: 150,
|
@@ -421,6 +431,18 @@
|
|
421
431
|
width: 160,
|
422
432
|
title: '专业',
|
423
433
|
},
|
434
|
+
{
|
435
|
+
field: 'area',
|
436
|
+
width: 100,
|
437
|
+
title: '地域',
|
438
|
+
hide: gon.filter.area
|
439
|
+
},
|
440
|
+
{
|
441
|
+
field: 'property',
|
442
|
+
width: 150,
|
443
|
+
title: '客户类型',
|
444
|
+
hide: gon.filter.property
|
445
|
+
},
|
424
446
|
{
|
425
447
|
field: 'follow_ups_count',
|
426
448
|
title: '跟进',
|
@@ -429,12 +451,18 @@
|
|
429
451
|
totalRow: true,
|
430
452
|
hide: gon.filter.follow_ups_count
|
431
453
|
},
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
454
|
+
{
|
455
|
+
field: 'keys_person_count',
|
456
|
+
width: 100,
|
457
|
+
title: '关键人',
|
458
|
+
templet: '#show_keys'
|
459
|
+
},
|
460
|
+
{
|
461
|
+
field: 'rival',
|
462
|
+
width: 100,
|
463
|
+
title: '竞争对手',
|
464
|
+
hide: gon.filter.rival
|
465
|
+
},
|
438
466
|
{
|
439
467
|
field: 'clazz',
|
440
468
|
width: 80,
|
@@ -705,6 +733,9 @@
|
|
705
733
|
case 'month':
|
706
734
|
month(id);
|
707
735
|
break;
|
736
|
+
case 'year':
|
737
|
+
year(id);
|
738
|
+
break;
|
708
739
|
case 'edit':
|
709
740
|
edit(id);
|
710
741
|
break;
|
@@ -737,6 +768,9 @@
|
|
737
768
|
case 'month':
|
738
769
|
month(id);
|
739
770
|
break;
|
771
|
+
case 'year':
|
772
|
+
year(id);
|
773
|
+
break;
|
740
774
|
case 'edit':
|
741
775
|
edit(id);
|
742
776
|
break;
|
@@ -792,6 +826,7 @@
|
|
792
826
|
data.business_type = business_type.toString();
|
793
827
|
data.business_step = business_step.toString();
|
794
828
|
data.staff_id = staff_list.getValue('valueStr');
|
829
|
+
data.staff_manages = staff_manages_list.getValue('valueStr');
|
795
830
|
<% if params[:year].present? %>
|
796
831
|
data.year = "<%= params[:year] %>";
|
797
832
|
<% end %>
|
@@ -807,6 +842,7 @@
|
|
807
842
|
place_id: data.place_id,
|
808
843
|
select: data.select,
|
809
844
|
staff_id: data.staff_id,
|
845
|
+
staff_manages: data.staff_manages,
|
810
846
|
signed_date: data.signed_date,
|
811
847
|
date_at: data.date_at,
|
812
848
|
bidded_date: data.bidded_date,
|
@@ -861,6 +897,25 @@
|
|
861
897
|
layer.full(sindex);
|
862
898
|
});
|
863
899
|
}
|
900
|
+
|
901
|
+
function year(id) {
|
902
|
+
var content = miniPage.getHrefContent('/missions/plans/new_year?business_id=' + id);
|
903
|
+
var openWH = miniPage.getOpenWidthHeight();
|
904
|
+
|
905
|
+
yindex = layer.open({
|
906
|
+
title: '添加年计划',
|
907
|
+
type: 1,
|
908
|
+
shade: 0.2,
|
909
|
+
maxmin: true,
|
910
|
+
shadeClose: true,
|
911
|
+
area: [openWH[0] + 'px', openWH[1] + 'px'],
|
912
|
+
offset: [openWH[2] + 'px', openWH[3] + 'px'],
|
913
|
+
content: content
|
914
|
+
});
|
915
|
+
$(window).on("resize", function () {
|
916
|
+
layer.full(sindex);
|
917
|
+
});
|
918
|
+
}
|
864
919
|
function following(id) {
|
865
920
|
$.ajax({
|
866
921
|
type: "get",
|
@@ -1022,6 +1077,7 @@
|
|
1022
1077
|
})
|
1023
1078
|
data.field.place_id = index_place_list.getValue('valueStr');
|
1024
1079
|
data.field.staff_id = staff_list.getValue('valueStr');
|
1080
|
+
data.field.staff_manages = staff_manages_list.getValue('valueStr');
|
1025
1081
|
data.field.business_type = business_type.toString();
|
1026
1082
|
data.field.business_step = business_step.toString();
|
1027
1083
|
<% if params[:year].present? %>
|
@@ -1071,6 +1127,7 @@
|
|
1071
1127
|
business_step_list.setValue([])
|
1072
1128
|
index_place_list.setValue([])
|
1073
1129
|
staff_list.setValue([])
|
1130
|
+
staff_manages_list.setValue([]);
|
1074
1131
|
|
1075
1132
|
return false;
|
1076
1133
|
});
|
@@ -1342,7 +1399,7 @@
|
|
1342
1399
|
} else if (obj.event === 'show_keys') {
|
1343
1400
|
business_id = obj.data.id
|
1344
1401
|
follow_up_id = obj.data.follow_up_id;
|
1345
|
-
content = miniPage.getHrefContent('/missions/businesses/
|
1402
|
+
content = miniPage.getHrefContent('/missions/businesses/' + business_id + '/key_person');
|
1346
1403
|
openWH = miniPage.getOpenWidthHeight();
|
1347
1404
|
index = layer.open({
|
1348
1405
|
title: '关键人',
|
@@ -34,6 +34,9 @@ json.data do
|
|
34
34
|
|
35
35
|
json.majors d.department&.department_majors&.pluck(:name).present? ? d.department&.department_majors&.pluck(:name).join(",") : ""
|
36
36
|
|
37
|
+
json.keys_person_count d.last_follow_up.present? ? EducodeSales::KeyPerson.where("follow_up_id = #{d.last_follow_up.id}").count : 0
|
38
|
+
json.rival d.last_follow_up&.rival || ''
|
39
|
+
|
37
40
|
# school_property = d.department.school.school_property
|
38
41
|
# property = []
|
39
42
|
|
@@ -0,0 +1,56 @@
|
|
1
|
+
<table class="layui-hide" id="keyTable"></table>
|
2
|
+
<script>
|
3
|
+
layui.use(['table'], function () {
|
4
|
+
var table = layui.table
|
5
|
+
table.render({
|
6
|
+
elem: '#keyTable',
|
7
|
+
url: '/missions/businesses/' + parent.business_id + "/key_person?follow_up_id=" + parent.follow_up_id,
|
8
|
+
defaultToolbar: [],
|
9
|
+
cols: [
|
10
|
+
[
|
11
|
+
{
|
12
|
+
field: 'id',
|
13
|
+
width: 80,
|
14
|
+
title:'序号',type: 'numbers',
|
15
|
+
},
|
16
|
+
{
|
17
|
+
field: 'name',
|
18
|
+
width: 140,
|
19
|
+
title: '姓名'
|
20
|
+
},
|
21
|
+
{
|
22
|
+
field: 'job',
|
23
|
+
width: 140,
|
24
|
+
title: '职务',
|
25
|
+
},
|
26
|
+
{
|
27
|
+
field: 'attitude',
|
28
|
+
width: 140,
|
29
|
+
title: '态度'
|
30
|
+
},
|
31
|
+
{
|
32
|
+
field: 'professional_title',
|
33
|
+
width: 140,
|
34
|
+
title: '职称'
|
35
|
+
},
|
36
|
+
{
|
37
|
+
field: 'sex',
|
38
|
+
width: 100,
|
39
|
+
title: '性别'
|
40
|
+
},
|
41
|
+
{
|
42
|
+
field: 'birth_date',
|
43
|
+
width: 200,
|
44
|
+
title: '生日',
|
45
|
+
},
|
46
|
+
{
|
47
|
+
field: 'remark',
|
48
|
+
width: 300,
|
49
|
+
title: '其他信息',
|
50
|
+
}
|
51
|
+
]
|
52
|
+
],
|
53
|
+
skin: 'line'
|
54
|
+
});
|
55
|
+
});
|
56
|
+
</script>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
json.data do
|
2
|
+
json.array! @teachers do |d|
|
3
|
+
json.id d.id
|
4
|
+
json.name d.teacher.name
|
5
|
+
json.professional_title d.professional_title
|
6
|
+
json.job d.job
|
7
|
+
json.attitude_id d.attitude_id.present? ? d.attitude_id : ''
|
8
|
+
json.attitude d.attitude&.name
|
9
|
+
json.sex d.sex
|
10
|
+
json.birth_date d.birth_date
|
11
|
+
json.remark d.remark
|
12
|
+
json.tel d.tel
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
json.code 0
|
17
|
+
json.count @teachers.total_count
|
@@ -67,6 +67,12 @@
|
|
67
67
|
placeholder="请选择日期">
|
68
68
|
</div>
|
69
69
|
</div>
|
70
|
+
<div class="layui-inline">
|
71
|
+
<label class="layui-form-label">部署时间</label>
|
72
|
+
<div class="layui-input-inline">
|
73
|
+
<input type="text" class="layui-input" name="deploy_time" value="<%= @last_follow_up&.deploy_time %>" id="p_deploy_time" placeholder="请选择日期">
|
74
|
+
</div>
|
75
|
+
</div>
|
70
76
|
<br>
|
71
77
|
<div class="layui-inline service_show layui-hide">
|
72
78
|
<label class="layui-form-label required">服务期</label>
|
@@ -132,13 +138,21 @@
|
|
132
138
|
</div>
|
133
139
|
</div>
|
134
140
|
<div class="layui-form-item">
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
+
<div class="layui-inline">
|
142
|
+
<label class="layui-form-label required">所属年度</label>
|
143
|
+
<div class="layui-input-inline">
|
144
|
+
<input type="text" class="layui-input" name="year" autocomplete="off" lay-verify="required" id="year"
|
145
|
+
value="<%= @last_follow_up&.year%>"
|
146
|
+
placeholder="请选择年度"> </div>
|
147
|
+
</div>
|
141
148
|
</div>
|
149
|
+
<div class="layui-form-item">
|
150
|
+
<div class="layui-inline">
|
151
|
+
<label class="layui-form-label">竞争对手</label>
|
152
|
+
<div class="layui-input-inline">
|
153
|
+
<input type="text" class="layui-input" name="rival" autocomplete="off" value="<%= @last_follow_up&.rival%>">
|
154
|
+
</div>
|
155
|
+
</div>
|
142
156
|
</div>
|
143
157
|
<div class="layui-form-item">
|
144
158
|
<label class="layui-form-label">指定跟进人</label>
|
@@ -223,7 +237,9 @@
|
|
223
237
|
laydate.render({
|
224
238
|
elem: '#invitation_at_add'
|
225
239
|
})
|
226
|
-
|
240
|
+
laydate.render({
|
241
|
+
elem: '#p_deploy_time'
|
242
|
+
})
|
227
243
|
laydate.render({
|
228
244
|
elem: '#reception_at_add'
|
229
245
|
});
|
@@ -322,8 +338,6 @@
|
|
322
338
|
data.field.assign_follow_up = assign_follow;
|
323
339
|
data.field.business_id = "<%= @business.id %>";
|
324
340
|
data.field.place_id = place_list.getValue('valueStr');
|
325
|
-
console.log("start")
|
326
|
-
console.log(data.field)
|
327
341
|
request.authPost("missions/follow_ups", data.field, function (res) {
|
328
342
|
if (res.success == false) {
|
329
343
|
layer.alert(res.msg)
|
@@ -72,13 +72,20 @@
|
|
72
72
|
<% end %>
|
73
73
|
</script>
|
74
74
|
<script type="text/html" id="business">
|
75
|
-
<a href="/missions/businesses?school={{d.
|
75
|
+
<a href="/missions/businesses?school={{d.unit}}" class="layui-table-link">{{ d.business }}</a>
|
76
76
|
</script>
|
77
77
|
<script type="text/html" id="name">
|
78
78
|
<a href="<%= base_url %>/colleges/{{d.id}}/statistics" class="layui-table-link" target="_blank">{{ d.name }}</a>
|
79
79
|
</script>
|
80
80
|
<script type="text/html" id="department">
|
81
|
-
<a href="javascript:void(0);" lay-event="department" class="layui-table-link">{{ d.department }}</a>
|
81
|
+
<a href="javascript:void(0);" lay-event="department" class="layui-table-link">{{ d.department || '--' }}</a>
|
82
|
+
</script>
|
83
|
+
<script type="text/html" id="major">
|
84
|
+
{{# if (d.department_id) { }}
|
85
|
+
<a href="javascript:void(0);" lay-event="major" class="layui-table-link">{{ d.major_count }}</a>
|
86
|
+
{{# } else { }}
|
87
|
+
{{ d.major_count }}
|
88
|
+
{{# }}}
|
82
89
|
</script>
|
83
90
|
<script type="text/html" id="follow">
|
84
91
|
<a href="javascript:void(0);" lay-event="follow" class="layui-table-link">{{ d.follow }}</a>
|
@@ -145,22 +152,24 @@
|
|
145
152
|
field: 'department',
|
146
153
|
width: 160,
|
147
154
|
title: '部门',
|
155
|
+
templet: "#department"
|
148
156
|
},
|
149
157
|
{
|
150
|
-
field: '
|
158
|
+
field: 'major_count',
|
151
159
|
width: 160,
|
152
160
|
title: '专业',
|
161
|
+
templet: "#major"
|
153
162
|
},
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
163
|
+
{
|
164
|
+
field: 'teacher_counts',
|
165
|
+
width: 100,
|
166
|
+
title: '教师数',
|
167
|
+
},
|
168
|
+
{
|
169
|
+
field: 'student_counts',
|
170
|
+
width: 100,
|
171
|
+
title: '学生数',
|
172
|
+
},
|
164
173
|
|
165
174
|
{
|
166
175
|
field: 'area',
|
@@ -192,7 +201,7 @@
|
|
192
201
|
},
|
193
202
|
{
|
194
203
|
field: 'staff',
|
195
|
-
width:
|
204
|
+
width: 150,
|
196
205
|
title: '负责人',
|
197
206
|
},
|
198
207
|
{
|
@@ -399,7 +408,6 @@
|
|
399
408
|
table.on('tool(customers_table)', function (obj) {
|
400
409
|
var data = obj.data;
|
401
410
|
id = data.id;
|
402
|
-
console.log(data)
|
403
411
|
department_id = data.department_id;
|
404
412
|
major_id = data.major_id;
|
405
413
|
if (obj.event === 'edit') { // 监听添加操作
|
@@ -476,8 +484,6 @@
|
|
476
484
|
offset: [openWH[2] + 'px', openWH[3] + 'px'],
|
477
485
|
content: content,
|
478
486
|
success: function (layero, index) {
|
479
|
-
// 重新渲染弹层中的下拉选择框select
|
480
|
-
// form.render('select');
|
481
487
|
}
|
482
488
|
});
|
483
489
|
$(window).on("resize", function () {
|
@@ -497,8 +503,7 @@
|
|
497
503
|
offset: [openWH[2] + 'px', openWH[3] + 'px'],
|
498
504
|
content: content,
|
499
505
|
success: function (layero, index) {
|
500
|
-
|
501
|
-
form.render('select');
|
506
|
+
form.render('select');
|
502
507
|
}
|
503
508
|
});
|
504
509
|
$(window).on("resize", function () {
|
@@ -517,15 +522,56 @@
|
|
517
522
|
offset: [openWH[2] + 'px', openWH[3] + 'px'],
|
518
523
|
content: content,
|
519
524
|
success: function (layero, index) {
|
520
|
-
// 重新渲染弹层中的下拉选择框select
|
521
525
|
form.render('select');
|
522
526
|
}
|
523
527
|
});
|
524
528
|
$(window).on("resize", function () {
|
525
529
|
layer.full(index);
|
526
530
|
});
|
527
|
-
} else if (obj.event === 'follow' || obj.event === 'name'
|
531
|
+
} else if (obj.event === 'follow' || obj.event === 'name') {
|
532
|
+
id = data.id
|
533
|
+
department_id = data.department_id;
|
534
|
+
time = data.last_follow_time || ''
|
535
|
+
content = miniPage.getHrefContent('/missions/customers/show_customer_follow?id=' + data.id + "&department_id=" + data.department_id);
|
536
|
+
openWH = miniPage.getOpenWidthHeight();
|
537
|
+
index = layer.open({
|
538
|
+
title: '客户列表/' + data.name,
|
539
|
+
type: 1,
|
540
|
+
shade: 0.2,
|
541
|
+
maxmin: true,
|
542
|
+
shadeClose: true,
|
543
|
+
area: [openWH[0] + 'px', openWH[1] + 'px'],
|
544
|
+
offset: [openWH[2] + 'px', openWH[3] + 'px'],
|
545
|
+
content: content,
|
546
|
+
success: function (layero, index) {
|
547
|
+
}
|
548
|
+
});
|
549
|
+
$(window).on("resize", function () {
|
550
|
+
layer.full(index);
|
551
|
+
});
|
552
|
+
} else if (obj.event == 'major') {
|
553
|
+
department_id = obj.data.department_id;
|
554
|
+
content = miniPage.getHrefContent('/missions/customers/show_majors?id='+ department_id);
|
555
|
+
openWH = miniPage.getOpenWidthHeight();
|
556
|
+
edit_index1 = layer.open({
|
557
|
+
title: '专业',
|
558
|
+
type: 1,
|
559
|
+
shade: 0.2,
|
560
|
+
maxmin: true,
|
561
|
+
shadeClose: true,
|
562
|
+
area: [openWH[0] + 'px', openWH[1] + 'px'],
|
563
|
+
offset: [openWH[2] + 'px', openWH[3] + 'px'],
|
564
|
+
content: content,
|
565
|
+
success: function (layero, index) {
|
566
|
+
form.render('select');
|
567
|
+
}
|
568
|
+
});
|
569
|
+
$(window).on("resize", function () {
|
570
|
+
layer.full(index);
|
571
|
+
});
|
572
|
+
} else if (obj.event == 'department') {
|
528
573
|
id = data.id
|
574
|
+
department_id = data.department_id;
|
529
575
|
time = data.last_follow_time || ''
|
530
576
|
content = miniPage.getHrefContent('/missions/customers/show_follow?id=' + data.id);
|
531
577
|
openWH = miniPage.getOpenWidthHeight();
|
@@ -539,8 +585,6 @@
|
|
539
585
|
offset: [openWH[2] + 'px', openWH[3] + 'px'],
|
540
586
|
content: content,
|
541
587
|
success: function (layero, index) {
|
542
|
-
// 重新渲染弹层中的下拉选择框select
|
543
|
-
// form.render('select');
|
544
588
|
}
|
545
589
|
});
|
546
590
|
$(window).on("resize", function () {
|
@@ -1,9 +1,15 @@
|
|
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
|
-
|
4
|
+
if d['department_id']
|
5
|
+
business_ids = EducodeSales::Business.where(department_id: d['department_id']).ids
|
6
|
+
customer_follows = EducodeSales::CustomerFollow.where(department_id: d['department_id'])
|
7
|
+
else
|
8
|
+
business_ids = EducodeSales::Business.where(school_id: d.id).ids
|
9
|
+
customer_follows = EducodeSales::CustomerFollow.where(school_id: d.id)
|
10
|
+
end
|
5
11
|
follow_ups = EducodeSales::FollowUp.where(business_id: business_ids)
|
6
|
-
|
12
|
+
|
7
13
|
a_last_follow_time = follow_ups.last&.created_at&.to_s
|
8
14
|
b_last_follow_time = customer_follows.last&.created_at&.to_s
|
9
15
|
if a_last_follow_time.present? && b_last_follow_time.present?
|
@@ -15,15 +21,21 @@ json.data do
|
|
15
21
|
json.name d.name
|
16
22
|
json.area d.province
|
17
23
|
json.property d.school_tags.where(for_missions: true).pluck(:name).join("、")
|
18
|
-
|
19
|
-
|
20
|
-
|
24
|
+
if d['department_id']
|
25
|
+
json.business EducodeSales::Business.joins(:last_follow_up).where("educode_sales_follow_ups.clazz_id != ?", x).where("educode_sales_businesses.department_id = ?", d['department_id']).size
|
26
|
+
else
|
27
|
+
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
|
28
|
+
end
|
29
|
+
json.unit "#{d.name}---#{d['department_name']}"
|
30
|
+
|
31
|
+
# json.follow follow_ups.size + customer_follows.size
|
32
|
+
json.follow customer_follows.size
|
33
|
+
json.staff EducodeSales::CustomerExtension.where(school_id: d.id).map { |d| d.customer_staff&.user&.real_name }.join("、")
|
21
34
|
json.department d['department_name'] || ''
|
22
|
-
json.
|
23
|
-
json.
|
24
|
-
json.department_id d.department_id
|
25
|
-
|
26
|
-
#json.student_counts UserExtension.where(department_id: d.department_id, identity: 'student').size
|
35
|
+
json.major_count d['major_count']
|
36
|
+
json.department_id d['department_id'] || ''
|
37
|
+
json.teacher_counts UserExtension.where(department_id: d.department_id, identity: 'teacher').size
|
38
|
+
json.student_counts UserExtension.where(department_id: d.department_id, identity: 'student').size
|
27
39
|
end
|
28
40
|
end
|
29
41
|
|