educode_sales 0.9.71 → 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 +27 -0
- data/app/controllers/educode_sales/follow_ups_controller.rb +20 -5
- data/app/controllers/educode_sales/staffs_controller.rb +35 -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 +40 -8
- 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/follow_ups/index.json.jbuilder +2 -0
- 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/config/routes.rb +3 -0
- data/db/migrate/20230428015007_add_deploy_time_follow_ups.rb +6 -0
- data/lib/educode_sales/version.rb +1 -1
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c3ce2eed15225b67592420332087c3ca7284c2908a17643d6199ac829859196f
|
4
|
+
data.tar.gz: eec810ee5dd968d2c0b6af7053138a1ea8649fe57986dd054a91c15aa1f9afc6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2dfefa8e8e30235cdbd3ff7c0e17044788cf76d3d62698455da06d77fe0007571a16ff0dd39cc2e4b60faccede54df20da14dd1cbce40eecc6ebf48c4a87c7b2
|
7
|
+
data.tar.gz: b6765899a3cbeda621f0fa85940e1fec3702b74c88685a90bacff2ac57fdd6b9701fb5f89aaab13e577b5b2bb764ac4050a5a681b56ccf2d1006f381f8e5cb30
|
@@ -299,6 +299,22 @@ module EducodeSales
|
|
299
299
|
@businesses = @businesses.joins("JOIN educode_sales_business_clazz_changes ON educode_sales_business_clazz_changes.business_id = educode_sales_businesses.id").where("educode_sales_business_clazz_changes.clazz_changed in (?)", clazz_changes)
|
300
300
|
end
|
301
301
|
|
302
|
+
if params[:q].present? && params[:q][:property].present?
|
303
|
+
# 客户类型
|
304
|
+
@businesses = @businesses.joins(department: [school: :school_tags]).where("school_tags.id = ?", params[:q][:property])
|
305
|
+
# @businesses = @businesses.joins("JOIN departments ON educode_sales_businesses.department_id = departments.id
|
306
|
+
# JOIN schools ON departments.school_id = schools.id").where("schools.school_property_id = ?", params[:q][:property])
|
307
|
+
end
|
308
|
+
|
309
|
+
if params[:q].present? && params[:q][:staff_manages].present?
|
310
|
+
# 销售经理
|
311
|
+
@businesses = @businesses.joins("LEFT JOIN educode_sales_follow_ups AS last_follow_up ON educode_sales_businesses.last_follow_up_id = last_follow_up.id AND last_follow_up.deleted_at IS NULL
|
312
|
+
LEFT JOIN educode_sales_assign_follow_ups ON educode_sales_assign_follow_ups.follow_up_id = last_follow_up.id").
|
313
|
+
where("(educode_sales_assign_follow_ups.id IS NOT NULL AND educode_sales_assign_follow_ups.staff_id = ?) OR (educode_sales_assign_follow_ups.id IS NULL AND educode_sales_businesses.staff_id = ?)", params[:q][:staff_manages], params[:q][:staff_manages])
|
314
|
+
|
315
|
+
|
316
|
+
end
|
317
|
+
|
302
318
|
if params[:sort].present? && params[:sort][:field]
|
303
319
|
if params[:sort][:field] == "service_end_time"
|
304
320
|
@businesses = @businesses.order("service_time_long #{params[:sort][:order]}")
|
@@ -1188,6 +1204,17 @@ module EducodeSales
|
|
1188
1204
|
end
|
1189
1205
|
end
|
1190
1206
|
|
1207
|
+
def key_person
|
1208
|
+
respond_to do |format|
|
1209
|
+
format.html do
|
1210
|
+
render layout: false
|
1211
|
+
end
|
1212
|
+
format.json do
|
1213
|
+
@teachers = EducodeSales::KeyPerson.where(follow_up_id: params[:follow_up_id]).page(params[:page]).per(params[:limit])
|
1214
|
+
end
|
1215
|
+
end
|
1216
|
+
end
|
1217
|
+
|
1191
1218
|
private
|
1192
1219
|
|
1193
1220
|
def load_business
|
@@ -12,19 +12,34 @@ module EducodeSales
|
|
12
12
|
if @current_admin.is_admin?
|
13
13
|
@follow_ups = FollowUp.all
|
14
14
|
else
|
15
|
+
permissions = @current_admin.permissions.pluck(:name)
|
16
|
+
area_business_ids = []
|
17
|
+
if permissions.include?("专项管理商机")
|
18
|
+
# 按客户类型查看商机下跟进记录
|
19
|
+
school_tag_ids = EducodeSales::StaffSchoolTag.where(staff_id: 10009).pluck :school_tag_id
|
20
|
+
school_ids = SchoolTagMiddle.where(school_tag_id: school_tag_ids).pluck :school_id
|
21
|
+
area_business_ids = Business.joins("JOIN departments ON educode_sales_businesses.department_id = departments.id").where("departments.school_id in (?)", school_ids).pluck(:id)
|
22
|
+
end
|
23
|
+
|
15
24
|
level = @current_admin.role.role_areas.find_by(clazz: '商机管理').level
|
16
25
|
case level
|
17
26
|
when '自己'
|
27
|
+
if permissions.include?("区域管理商机")
|
28
|
+
# 按负责区域查看商机下跟进记录
|
29
|
+
school_ids = School.where(province: @current_admin.areas.pluck(:name)).pluck(:id)
|
30
|
+
area_business_ids += Business.joins("JOIN departments ON educode_sales_businesses.department_id = departments.id").where("departments.school_id in (?)", school_ids).pluck(:id)
|
31
|
+
end
|
32
|
+
|
18
33
|
business_ids = Business.joins(last_follow_up: :assign_follow_ups).where("educode_sales_assign_follow_ups.staff_id = ?", @current_admin.id).pluck(:id)
|
19
34
|
@businesses = Business.where("educode_sales_businesses.staff_id = ? OR educode_sales_businesses.id in (?)", @current_admin.id, business_ids)
|
20
35
|
business_ids = @businesses.pluck(:id)
|
21
|
-
@follow_ups = FollowUp.where(business_id: business_ids)
|
36
|
+
@follow_ups = FollowUp.where(business_id: business_ids + area_business_ids)
|
22
37
|
when '区域'
|
23
38
|
school_ids = School.where(province: @current_admin.areas.pluck(:name)).pluck(:id) + StaffSchool.where(staff_id: @current_admin.id).pluck(:school_id)
|
24
39
|
business_ids = Business.joins(last_follow_up: :assign_follow_ups).where("educode_sales_assign_follow_ups.staff_id = ?", @current_admin.id).pluck(:id)
|
25
40
|
@businesses = Business.joins("JOIN departments ON educode_sales_businesses.department_id = departments.id").where("departments.school_id in (?) OR educode_sales_businesses.staff_id = #{@current_admin.id} OR educode_sales_businesses.id in (?)", school_ids, business_ids)
|
26
41
|
business_ids = @businesses.pluck(:id)
|
27
|
-
@follow_ups = FollowUp.where(business_id: business_ids)
|
42
|
+
@follow_ups = FollowUp.where(business_id: business_ids + area_business_ids)
|
28
43
|
else
|
29
44
|
@follow_ups = FollowUp.all
|
30
45
|
end
|
@@ -110,7 +125,7 @@ module EducodeSales
|
|
110
125
|
end
|
111
126
|
|
112
127
|
end
|
113
|
-
@business.update(last_follow_up_id: follow_up.id, clazz_id: follow_up.clazz_id)
|
128
|
+
@business.update(last_follow_up_id: follow_up.id, clazz_id: follow_up.clazz_id, p_deploy_time: params[:deploy_time])
|
114
129
|
# 增加o商机编号
|
115
130
|
add_business_number
|
116
131
|
update_department
|
@@ -154,7 +169,7 @@ module EducodeSales
|
|
154
169
|
if follow_up.save
|
155
170
|
# 增加o类商机
|
156
171
|
@business = follow_up.business
|
157
|
-
@business.update(clazz_id: follow_up.clazz_id)
|
172
|
+
@business.update(clazz_id: follow_up.clazz_id, p_deploy_time: params[:deploy_time])
|
158
173
|
add_business_number
|
159
174
|
update_department
|
160
175
|
render_success
|
@@ -284,7 +299,7 @@ module EducodeSales
|
|
284
299
|
end
|
285
300
|
|
286
301
|
def follow_up_params
|
287
|
-
params.permit(:clazz_id, :stage_id, :invitation_at, :reception_at, :total_amount, :actual_amount, :divide_amount, :divide_rate, :budget_amount, :description, :advise, :place_id, :bidded_date, :signed_date, :year, :o_business_deployment)
|
302
|
+
params.permit(:clazz_id, :stage_id, :invitation_at, :reception_at, :total_amount, :actual_amount, :divide_amount, :divide_rate, :budget_amount, :description, :advise, :place_id, :bidded_date, :signed_date, :year, :o_business_deployment, :deploy_time, :rival)
|
288
303
|
end
|
289
304
|
|
290
305
|
# 更新部门和部门下老师用户的状态
|
@@ -137,5 +137,40 @@ module EducodeSales
|
|
137
137
|
@schools = (EducodeSales::Business.joins(:follow_ups, [department: :school]).where("educode_sales_follow_ups.staff_id = #{staff.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 = #{staff.id}").select("departments.id, departments.name, schools.name AS school, educode_sales_teacher_follows.updated_at")).uniq { |s| s.id }
|
138
138
|
end
|
139
139
|
|
140
|
+
def list
|
141
|
+
@staffs = EducodeSales::Staff.where.not(id: params[:id]).map { |d| [d.user.real_name, d.id ]}
|
142
|
+
gon.trans_staffs = @staffs.to_h.invert
|
143
|
+
render layout: false
|
144
|
+
end
|
145
|
+
|
146
|
+
def transfer
|
147
|
+
if @current_admin.is_admin?
|
148
|
+
staff = Staff.find(params[:id])
|
149
|
+
to = Staff.find(params[:to_id])
|
150
|
+
staff.businesses.update_all(staff_id: to.id)
|
151
|
+
# 商机
|
152
|
+
staff.follow_ups.update_all(staff_id: to.id)
|
153
|
+
# 销售动态
|
154
|
+
staff.sale_plans.update_all(staff_id: to.id)
|
155
|
+
# 销售计划
|
156
|
+
staff.places.update_all(staff_id: to.id)
|
157
|
+
# 渠道
|
158
|
+
staff.activities.update_all(staff_id: to.id)
|
159
|
+
# 活动
|
160
|
+
staff.teachers.update_all(staff_id: to.id)
|
161
|
+
# 教师
|
162
|
+
staff.teacher_follows.update_all(staff_id: to.id)
|
163
|
+
# 教师动态
|
164
|
+
staff.operation_plans.update_all(staff_id: to.id)
|
165
|
+
# 活动计划
|
166
|
+
|
167
|
+
EducodeSales::Activity.where(sales_id: staff.id).update_all(sales_id: to.id)
|
168
|
+
CustomerExtension.where(staff_id: staff.id).update_all(staff_id: to.id)
|
169
|
+
# 回款计划
|
170
|
+
MoneyPlan.where(staff_id: staff.id).update_all(staff_id: to.id)
|
171
|
+
# 客户
|
172
|
+
end
|
173
|
+
render_success
|
174
|
+
end
|
140
175
|
end
|
141
176
|
end
|
@@ -141,10 +141,20 @@
|
|
141
141
|
},
|
142
142
|
{
|
143
143
|
field: 'key_people',
|
144
|
-
width:
|
144
|
+
width: 100,
|
145
145
|
title: '关键人',
|
146
146
|
templet:'<div><span title="{{d.key_people}}">{{d.key_people}}</span></div>'
|
147
147
|
},
|
148
|
+
{
|
149
|
+
field: 'rival',
|
150
|
+
width: 100,
|
151
|
+
title: '竞争对手',
|
152
|
+
},
|
153
|
+
{
|
154
|
+
field: 'staff_manages',
|
155
|
+
width: 120,
|
156
|
+
title: '销售经理',
|
157
|
+
},
|
148
158
|
{
|
149
159
|
field: 'tel',
|
150
160
|
width: 90,
|
@@ -63,6 +63,14 @@
|
|
63
63
|
id="reception_at_edit" placeholder="请选择日期">
|
64
64
|
</div>
|
65
65
|
</div>
|
66
|
+
<div class="layui-inline">
|
67
|
+
<label class="layui-form-label">部署时间</label>
|
68
|
+
<div class="layui-input-inline">
|
69
|
+
<input type="text" class="layui-input" value="<%= @follow_up.business.p_deploy_time %>" name="deploy_time"
|
70
|
+
id="p_deploy_time" placeholder="请选择日期">
|
71
|
+
</div>
|
72
|
+
</div>
|
73
|
+
|
66
74
|
<br>
|
67
75
|
<div class="layui-inline service_show layui-hide">
|
68
76
|
<label class="layui-form-label required">服务期</label>
|
@@ -133,6 +141,14 @@
|
|
133
141
|
</div>
|
134
142
|
</div>
|
135
143
|
</div>
|
144
|
+
<div class="layui-form-item">
|
145
|
+
<div class="layui-inline">
|
146
|
+
<label class="layui-form-label">竞争对手</label>
|
147
|
+
<div class="layui-input-inline">
|
148
|
+
<input type="text" class="layui-input" name="rival" autocomplete="off" value="<%= @follow_up&.rival%>">
|
149
|
+
</div>
|
150
|
+
</div>
|
151
|
+
</div>
|
136
152
|
<div class="layui-form-item">
|
137
153
|
<label class="layui-form-label">指定跟进人</label>
|
138
154
|
<div class="layui-input-inline" style="">
|
@@ -209,6 +225,9 @@
|
|
209
225
|
laydate.render({
|
210
226
|
elem: '#invitation_at_edit'
|
211
227
|
})
|
228
|
+
laydate.render({
|
229
|
+
elem: '#p_deploy_time'
|
230
|
+
})
|
212
231
|
laydate.render({
|
213
232
|
elem: '#service_time',
|
214
233
|
range: true
|
@@ -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 %>
|
@@ -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,
|
@@ -798,6 +826,7 @@
|
|
798
826
|
data.business_type = business_type.toString();
|
799
827
|
data.business_step = business_step.toString();
|
800
828
|
data.staff_id = staff_list.getValue('valueStr');
|
829
|
+
data.staff_manages = staff_manages_list.getValue('valueStr');
|
801
830
|
<% if params[:year].present? %>
|
802
831
|
data.year = "<%= params[:year] %>";
|
803
832
|
<% end %>
|
@@ -813,6 +842,7 @@
|
|
813
842
|
place_id: data.place_id,
|
814
843
|
select: data.select,
|
815
844
|
staff_id: data.staff_id,
|
845
|
+
staff_manages: data.staff_manages,
|
816
846
|
signed_date: data.signed_date,
|
817
847
|
date_at: data.date_at,
|
818
848
|
bidded_date: data.bidded_date,
|
@@ -1047,6 +1077,7 @@
|
|
1047
1077
|
})
|
1048
1078
|
data.field.place_id = index_place_list.getValue('valueStr');
|
1049
1079
|
data.field.staff_id = staff_list.getValue('valueStr');
|
1080
|
+
data.field.staff_manages = staff_manages_list.getValue('valueStr');
|
1050
1081
|
data.field.business_type = business_type.toString();
|
1051
1082
|
data.field.business_step = business_step.toString();
|
1052
1083
|
<% if params[:year].present? %>
|
@@ -1096,6 +1127,7 @@
|
|
1096
1127
|
business_step_list.setValue([])
|
1097
1128
|
index_place_list.setValue([])
|
1098
1129
|
staff_list.setValue([])
|
1130
|
+
staff_manages_list.setValue([]);
|
1099
1131
|
|
1100
1132
|
return false;
|
1101
1133
|
});
|
@@ -1367,7 +1399,7 @@
|
|
1367
1399
|
} else if (obj.event === 'show_keys') {
|
1368
1400
|
business_id = obj.data.id
|
1369
1401
|
follow_up_id = obj.data.follow_up_id;
|
1370
|
-
content = miniPage.getHrefContent('/missions/businesses/
|
1402
|
+
content = miniPage.getHrefContent('/missions/businesses/' + business_id + '/key_person');
|
1371
1403
|
openWH = miniPage.getOpenWidthHeight();
|
1372
1404
|
index = layer.open({
|
1373
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)
|
@@ -11,6 +11,8 @@ json.data do
|
|
11
11
|
json.created_at d.created_at.to_s
|
12
12
|
json.business d.business.name
|
13
13
|
json.business_id d.business.id
|
14
|
+
json.rival d.rival || ''
|
15
|
+
json.staff_manages d.business.last_follow_up&.assign_follow_ups.present? ? (d.business.last_follow_up.assign_follow_ups.map{ |d| d.staff.user.real_name}.join("、")) : d.business.staff&.user&.real_name
|
14
16
|
# teacher_ids = d.key_person.pluck(:teacher_id)
|
15
17
|
json.tel d.key_person.pluck(:tel).select { |d| d.present? }.join("、")
|
16
18
|
json.key_people d.key_person.map { |d| d.teacher.name }.join("、")# key_people(teacher_ids)
|
@@ -5,7 +5,7 @@
|
|
5
5
|
<div class="layui-form-item">
|
6
6
|
<label class="layui-form-label required">姓名</label>
|
7
7
|
<div class="layui-input-block" style="line-height: 36px;">
|
8
|
-
<%= @staff.user.real_name %>
|
8
|
+
<%= "#{@staff.user.real_name} - #{@staff.user.phone}" %>
|
9
9
|
</div>
|
10
10
|
</div>
|
11
11
|
<div class="layui-form-item">
|
@@ -42,6 +42,9 @@
|
|
42
42
|
<table class="layui-hide" id="staff_filter" lay-filter="staff_filter"></table>
|
43
43
|
</div>
|
44
44
|
<script type="text/html" id="staff_bar">
|
45
|
+
<% if @current_admin.is_admin? %>
|
46
|
+
<a class="layui-btn layui-btn-default layui-btn-xs data-count-edit" lay-event="transfer"> 一键转移</a>
|
47
|
+
<% end %>
|
45
48
|
<a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="edit">编辑</a>
|
46
49
|
<a class="layui-btn layui-btn-xs layui-btn-warm data-count-delete" lay-event="disable">禁用</a>
|
47
50
|
<a class="layui-btn layui-btn-xs layui-btn-danger data-count-delete" lay-event="delete">删除</a>
|
@@ -111,7 +114,7 @@
|
|
111
114
|
},
|
112
115
|
{
|
113
116
|
title: '操作',
|
114
|
-
|
117
|
+
width: 260,
|
115
118
|
toolbar: '#staff_bar',
|
116
119
|
align: "center"
|
117
120
|
}
|
@@ -210,6 +213,22 @@
|
|
210
213
|
table.reload("staff_filter")
|
211
214
|
})
|
212
215
|
});
|
216
|
+
} else if (obj.event == 'transfer') {
|
217
|
+
var content = miniPage.getHrefContent('/missions/staffs/'+ data.id + '/list');
|
218
|
+
var openWH = miniPage.getOpenWidthHeight();
|
219
|
+
name = data.name;
|
220
|
+
index = layer.open({
|
221
|
+
title: '转移该人员数据到其它人员上',
|
222
|
+
type: 1,
|
223
|
+
shade: 0.2,
|
224
|
+
maxmin: false,
|
225
|
+
shadeClose: true,
|
226
|
+
area: ['700px', '600px'],
|
227
|
+
content: content,
|
228
|
+
});
|
229
|
+
$(window).on("resize", function () {
|
230
|
+
layer.full(index);
|
231
|
+
});
|
213
232
|
}
|
214
233
|
});
|
215
234
|
|
@@ -0,0 +1,39 @@
|
|
1
|
+
|
2
|
+
<%= Gon::Base.render_data %>
|
3
|
+
<div class="layui-form layuimini-form" style="padding:30px">
|
4
|
+
<div class="layui-form-item">
|
5
|
+
<label class="layui-form-label required">人员</label>
|
6
|
+
<div class="layui-input-block" style="width: 300px">
|
7
|
+
<%= select_tag "staff_id", options_for_select(@staffs), { 'lay-filter': 'staff_id' } %>
|
8
|
+
</div>
|
9
|
+
</div>
|
10
|
+
<hr>
|
11
|
+
<div class="layui-form-item">
|
12
|
+
<div class="layui-input-block">
|
13
|
+
<button class="layui-btn layui-btn-normal" lay-submit lay-filter="saveBtn">确认保存</button>
|
14
|
+
</div>
|
15
|
+
</div>
|
16
|
+
</div>
|
17
|
+
|
18
|
+
<script>
|
19
|
+
layui.use(['form', 'table', 'upload', 'laytpl', 'request', 'selectInput'], function () {
|
20
|
+
var form = layui.form,
|
21
|
+
layer = layui.layer,
|
22
|
+
table = layui.table,
|
23
|
+
laytpl = layui.laytpl,
|
24
|
+
request = layui.request,
|
25
|
+
$ = layui.$;
|
26
|
+
|
27
|
+
form.render();
|
28
|
+
var parentIndex = layer.index;
|
29
|
+
form.on('submit(saveBtn)', function (data) {
|
30
|
+
layer.confirm('确定转移 ' + parent.name + " 的数据到 " + gon.trans_staffs[data.field.staff_id] + " ?", function (index) {
|
31
|
+
request.post('missions/staffs/' + parent.staff_id +"/transfer", {to_id: data.field.staff_id}, function (res) {
|
32
|
+
layer.close(index);
|
33
|
+
layer.close(parentIndex)
|
34
|
+
})
|
35
|
+
});
|
36
|
+
return false;
|
37
|
+
});
|
38
|
+
});
|
39
|
+
</script>
|
data/config/routes.rb
CHANGED
@@ -135,6 +135,7 @@ EducodeSales::Engine.routes.draw do
|
|
135
135
|
put :update_follow_up
|
136
136
|
put :audit
|
137
137
|
put :update_advise
|
138
|
+
get :key_person
|
138
139
|
end
|
139
140
|
end
|
140
141
|
|
@@ -332,6 +333,8 @@ EducodeSales::Engine.routes.draw do
|
|
332
333
|
delete :disable
|
333
334
|
get :follow_up_schools
|
334
335
|
get :follow_up_departments
|
336
|
+
get :list
|
337
|
+
post :transfer
|
335
338
|
end
|
336
339
|
end
|
337
340
|
|
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.9.
|
4
|
+
version: 0.9.72
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- anke1460
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-04-
|
11
|
+
date: 2023-04-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -280,6 +280,8 @@ files:
|
|
280
280
|
- app/views/educode_sales/businesses/get_export_data.json.jbuilder
|
281
281
|
- app/views/educode_sales/businesses/index.html.erb
|
282
282
|
- app/views/educode_sales/businesses/index.json.jbuilder
|
283
|
+
- app/views/educode_sales/businesses/key_person.html.erb
|
284
|
+
- app/views/educode_sales/businesses/key_person.json.jbuilder
|
283
285
|
- app/views/educode_sales/businesses/new.html.erb
|
284
286
|
- app/views/educode_sales/businesses/new_follow_record.html.erb
|
285
287
|
- app/views/educode_sales/businesses/no_permission.html.erb
|
@@ -499,6 +501,7 @@ files:
|
|
499
501
|
- app/views/educode_sales/staffs/follow_up_schools.json.jbuilder
|
500
502
|
- app/views/educode_sales/staffs/index.html.erb
|
501
503
|
- app/views/educode_sales/staffs/index.json.jbuilder
|
504
|
+
- app/views/educode_sales/staffs/list.html.erb
|
502
505
|
- app/views/educode_sales/staffs/new.html.erb
|
503
506
|
- app/views/educode_sales/teacher_follows/index.json.jbuilder
|
504
507
|
- app/views/educode_sales/teachers/_follows.html.erb
|
@@ -615,6 +618,7 @@ files:
|
|
615
618
|
- db/migrate/20230413031029_add_pre_time_to_businesses.rb
|
616
619
|
- db/migrate/20230414031409_add_major_educode_sales_customer_follows.rb
|
617
620
|
- db/migrate/20230414035655_create_educode_sales_eco_staffs.rb
|
621
|
+
- db/migrate/20230428015007_add_deploy_time_follow_ups.rb
|
618
622
|
- lib/educode_sales.rb
|
619
623
|
- lib/educode_sales/engine.rb
|
620
624
|
- lib/educode_sales/version.rb
|