educode_sales 0.9.69 → 0.9.71
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 +16 -2
- data/app/controllers/educode_sales/customers_controller.rb +51 -14
- data/app/controllers/educode_sales/plans_controller.rb +69 -19
- data/app/controllers/educode_sales/projects_controller.rb +3 -0
- data/app/controllers/educode_sales/teachers_controller.rb +11 -1
- data/app/models/educode_sales/customer_follow.rb +1 -0
- data/app/models/educode_sales/eco_staff.rb +6 -0
- data/app/models/educode_sales/sale_plan.rb +2 -0
- data/app/views/educode_sales/businesses/index.html.erb +45 -12
- data/app/views/educode_sales/businesses/index.json.jbuilder +2 -1
- data/app/views/educode_sales/businesses/time_line.html.erb +2 -1
- data/app/views/educode_sales/customers/edit_major.html.erb +5 -1
- data/app/views/educode_sales/customers/list.html.erb +66 -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/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/projects/detail.html.erb +10 -6
- data/app/views/educode_sales/projects/index.html.erb +38 -8
- data/app/views/educode_sales/teachers/_index.html.erb +26 -5
- data/app/views/educode_sales/teachers/edit.html.erb +10 -3
- data/app/views/educode_sales/teachers/index.json.jbuilder +8 -0
- data/config/routes.rb +3 -0
- data/db/migrate/20230414031409_add_major_educode_sales_customer_follows.rb +12 -0
- data/db/migrate/20230414035655_create_educode_sales_eco_staffs.rb +11 -0
- data/lib/educode_sales/version.rb +1 -1
- metadata +12 -8
- data/app/assets/images/educode_sales/indexlogo.png +0 -0
- data/db/migrate/20230411134203_add_realname_to_teacher.rb +0 -5
@@ -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>
|
@@ -148,20 +155,21 @@
|
|
148
155
|
templet: "#department"
|
149
156
|
},
|
150
157
|
{
|
151
|
-
field: '
|
158
|
+
field: 'major_count',
|
152
159
|
width: 160,
|
153
160
|
title: '专业',
|
161
|
+
templet: "#major"
|
154
162
|
},
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
163
|
+
{
|
164
|
+
field: 'teacher_counts',
|
165
|
+
width: 100,
|
166
|
+
title: '教师数',
|
167
|
+
},
|
168
|
+
{
|
169
|
+
field: 'student_counts',
|
170
|
+
width: 100,
|
171
|
+
title: '学生数',
|
172
|
+
},
|
165
173
|
|
166
174
|
{
|
167
175
|
field: 'area',
|
@@ -193,7 +201,7 @@
|
|
193
201
|
},
|
194
202
|
{
|
195
203
|
field: 'staff',
|
196
|
-
width:
|
204
|
+
width: 150,
|
197
205
|
title: '负责人',
|
198
206
|
},
|
199
207
|
{
|
@@ -400,7 +408,6 @@
|
|
400
408
|
table.on('tool(customers_table)', function (obj) {
|
401
409
|
var data = obj.data;
|
402
410
|
id = data.id;
|
403
|
-
console.log(data)
|
404
411
|
department_id = data.department_id;
|
405
412
|
major_id = data.major_id;
|
406
413
|
if (obj.event === 'edit') { // 监听添加操作
|
@@ -477,8 +484,6 @@
|
|
477
484
|
offset: [openWH[2] + 'px', openWH[3] + 'px'],
|
478
485
|
content: content,
|
479
486
|
success: function (layero, index) {
|
480
|
-
// 重新渲染弹层中的下拉选择框select
|
481
|
-
// form.render('select');
|
482
487
|
}
|
483
488
|
});
|
484
489
|
$(window).on("resize", function () {
|
@@ -498,8 +503,7 @@
|
|
498
503
|
offset: [openWH[2] + 'px', openWH[3] + 'px'],
|
499
504
|
content: content,
|
500
505
|
success: function (layero, index) {
|
501
|
-
|
502
|
-
form.render('select');
|
506
|
+
form.render('select');
|
503
507
|
}
|
504
508
|
});
|
505
509
|
$(window).on("resize", function () {
|
@@ -518,15 +522,56 @@
|
|
518
522
|
offset: [openWH[2] + 'px', openWH[3] + 'px'],
|
519
523
|
content: content,
|
520
524
|
success: function (layero, index) {
|
521
|
-
// 重新渲染弹层中的下拉选择框select
|
522
525
|
form.render('select');
|
523
526
|
}
|
524
527
|
});
|
525
528
|
$(window).on("resize", function () {
|
526
529
|
layer.full(index);
|
527
530
|
});
|
528
|
-
} 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') {
|
529
573
|
id = data.id
|
574
|
+
department_id = data.department_id;
|
530
575
|
time = data.last_follow_time || ''
|
531
576
|
content = miniPage.getHrefContent('/missions/customers/show_follow?id=' + data.id);
|
532
577
|
openWH = miniPage.getOpenWidthHeight();
|
@@ -540,8 +585,6 @@
|
|
540
585
|
offset: [openWH[2] + 'px', openWH[3] + 'px'],
|
541
586
|
content: content,
|
542
587
|
success: function (layero, index) {
|
543
|
-
// 重新渲染弹层中的下拉选择框select
|
544
|
-
// form.render('select');
|
545
588
|
}
|
546
589
|
});
|
547
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
|
|
@@ -0,0 +1,175 @@
|
|
1
|
+
<h1 style="padding: 20px">客户:<%=@school_name %></h1>
|
2
|
+
<div style="padding-left: 20px">
|
3
|
+
<span>区域:<%=@area %></span>
|
4
|
+
<span style="padding-left: 100px" id="demo"></span>
|
5
|
+
<span style="padding-left: 100px">负责人:<%=@staff %></span>
|
6
|
+
</div>
|
7
|
+
|
8
|
+
<!--计划回款计划列表-->
|
9
|
+
<script type="text/html" id="unfinish_toolbar">
|
10
|
+
<div class="layui-btn-container">
|
11
|
+
<span class="table-label">跟进记录</span>
|
12
|
+
<% if can? :create_follow, EducodeSales::Customer %>
|
13
|
+
<button class="layui-btn layui-btn-normal layui-btn-sm data-add-btn pull-right" lay-event="addFollow"> 添加跟进记录
|
14
|
+
<%end %>
|
15
|
+
</button>
|
16
|
+
</div>
|
17
|
+
</script>
|
18
|
+
|
19
|
+
<table class="layui-hide" id="unfinish_table" lay-filter="unfinish_table"></table>
|
20
|
+
|
21
|
+
<script type="text/html" id="currentTableBar1234">
|
22
|
+
<% if can? :read_follow, EducodeSales::Customer %>
|
23
|
+
<a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="show">查看</a>
|
24
|
+
<% end %>
|
25
|
+
<% if can? :update_follow, EducodeSales::Customer %>
|
26
|
+
<a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="edit">编辑</a>
|
27
|
+
<% end %>
|
28
|
+
<% if can? :destroy_follow, EducodeSales::Customer %>
|
29
|
+
<a class="layui-btn layui-btn-xs layui-btn-danger data-count-delete" lay-event="delete">删除</a>
|
30
|
+
<% end %>
|
31
|
+
</script>
|
32
|
+
|
33
|
+
|
34
|
+
<script>
|
35
|
+
document.getElementById("demo").innerHTML = "最后跟进时间:" + parent.time;
|
36
|
+
layui.use(['form', 'table', 'miniPage', 'element'], function () {
|
37
|
+
var $ = layui.jquery,
|
38
|
+
form = layui.form,
|
39
|
+
table = layui.table,
|
40
|
+
request = layui.request,
|
41
|
+
miniPage = layui.miniPage;
|
42
|
+
|
43
|
+
table.render({
|
44
|
+
elem: '#unfinish_table',
|
45
|
+
url: '/missions/customers/show_customer_follow?id=' + parent.id + "&department_id=" + parent.department_id ,
|
46
|
+
toolbar: '#unfinish_toolbar',
|
47
|
+
defaultToolbar: [],
|
48
|
+
cols: [
|
49
|
+
[
|
50
|
+
{
|
51
|
+
field: 'id',
|
52
|
+
width: 100,
|
53
|
+
title:'序号',type: 'numbers',
|
54
|
+
},
|
55
|
+
{
|
56
|
+
field: 'created_at',
|
57
|
+
width: 180,
|
58
|
+
title: '时间',
|
59
|
+
sort: true
|
60
|
+
},
|
61
|
+
{
|
62
|
+
field: 'staff',
|
63
|
+
width: 100,
|
64
|
+
title: '跟进人'
|
65
|
+
},
|
66
|
+
{
|
67
|
+
field: 'department',
|
68
|
+
width: 100,
|
69
|
+
title: '跟进部门'
|
70
|
+
},
|
71
|
+
{
|
72
|
+
field: 'content',
|
73
|
+
title: '跟进内容',
|
74
|
+
templet:'<div><span title="{{d.content}}">{{d.content}}</span></div>'
|
75
|
+
},
|
76
|
+
{
|
77
|
+
title: '操作',
|
78
|
+
width: 300,
|
79
|
+
toolbar: '#currentTableBar1234',
|
80
|
+
align: "center"
|
81
|
+
}
|
82
|
+
]
|
83
|
+
],
|
84
|
+
page: true,
|
85
|
+
skin: 'line'
|
86
|
+
});
|
87
|
+
table.on('toolbar(unfinish_table)', function (obj) {
|
88
|
+
if (obj.event === 'addFollow') { // 监听添加操作
|
89
|
+
var content = miniPage.getHrefContent('/missions/customers/new_follow_record?id=' + parent.id)
|
90
|
+
var openWH = miniPage.getOpenWidthHeight();
|
91
|
+
addFollowIndex = layer.open({
|
92
|
+
title: '添加跟进记录',
|
93
|
+
type: 1,
|
94
|
+
shade: 0.2,
|
95
|
+
maxmin: true,
|
96
|
+
shadeClose: true,
|
97
|
+
area: [openWH[0] + 'px', openWH[1] + 'px'],
|
98
|
+
offset: [openWH[2] + 'px', openWH[3] + 'px'],
|
99
|
+
content: content,
|
100
|
+
success: function (layero, index) {
|
101
|
+
// 重新渲染弹层中的下拉选择框select
|
102
|
+
form.render('select');
|
103
|
+
}
|
104
|
+
});
|
105
|
+
$(window).on("resize", function () {
|
106
|
+
layer.full(index);
|
107
|
+
});
|
108
|
+
} else if (obj.event === 'delete') { // 监听删除操作
|
109
|
+
var checkStatus = table.checkStatus('currentTableId'),
|
110
|
+
data = checkStatus.data;
|
111
|
+
layer.alert(JSON.stringify(data));
|
112
|
+
}
|
113
|
+
});
|
114
|
+
|
115
|
+
|
116
|
+
table.on('tool(unfinish_table)', function (obj) {
|
117
|
+
var data = obj.data;
|
118
|
+
var id = data.id
|
119
|
+
if (obj.event === 'delete') {
|
120
|
+
layer.confirm('确定删除ID为' + data.id + "的记录", function (index) {
|
121
|
+
request.authDelete("missions/customer_follows/" + data.id, {}, function() {
|
122
|
+
obj.del();
|
123
|
+
parent.table.reload('customers_table')
|
124
|
+
layer.close(index);
|
125
|
+
})
|
126
|
+
|
127
|
+
});
|
128
|
+
} else if (obj.event === 'show') {
|
129
|
+
content = miniPage.getHrefContent('/missions/customers/show_follow_record?id=' + data.id);
|
130
|
+
openWH = miniPage.getOpenWidthHeight();
|
131
|
+
index = layer.open({
|
132
|
+
title: '查看跟进记录',
|
133
|
+
type: 1,
|
134
|
+
shade: 0.2,
|
135
|
+
maxmin: true,
|
136
|
+
shadeClose: true,
|
137
|
+
area: [openWH[0] + 'px', openWH[1] + 'px'],
|
138
|
+
offset: [openWH[2] + 'px', openWH[3] + 'px'],
|
139
|
+
content: content
|
140
|
+
});
|
141
|
+
$(window).on("resize", function () {
|
142
|
+
layer.full(index);
|
143
|
+
});
|
144
|
+
return false;
|
145
|
+
} else if (obj.event === 'edit') {
|
146
|
+
content = miniPage.getHrefContent('/missions/customers/edit_follow_record?id=' + data.id);
|
147
|
+
openWH = miniPage.getOpenWidthHeight();
|
148
|
+
editFollowIndex = layer.open({
|
149
|
+
title: '编辑跟进记录',
|
150
|
+
type: 1,
|
151
|
+
shade: 0.2,
|
152
|
+
maxmin: true,
|
153
|
+
shadeClose: true,
|
154
|
+
area: [openWH[0] + 'px', openWH[1] + 'px'],
|
155
|
+
offset: [openWH[2] + 'px', openWH[3] + 'px'],
|
156
|
+
content: content,
|
157
|
+
success: function (layero, index) {
|
158
|
+
// 重新渲染弹层中的下拉选择框select
|
159
|
+
form.render('select');
|
160
|
+
},
|
161
|
+
});
|
162
|
+
$(window).on("resize", function () {
|
163
|
+
layer.full(sindex);
|
164
|
+
});
|
165
|
+
return false;
|
166
|
+
}
|
167
|
+
});
|
168
|
+
|
169
|
+
});
|
170
|
+
</script>
|
171
|
+
<style>
|
172
|
+
.z-index .layui-table-tool{
|
173
|
+
z-index: 10000; !important;
|
174
|
+
}
|
175
|
+
</style>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
json.data do
|
2
|
+
json.array! @follow_ups do |d|
|
3
|
+
json.id d.id
|
4
|
+
json.created_at d.created_at.to_s
|
5
|
+
json.staff d.staff.user.real_name
|
6
|
+
json.department d.department&.name || ''
|
7
|
+
json.content d.content
|
8
|
+
json.is_latest d.id == @latest.id
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
json.code 0
|
13
|
+
json.count @follow_ups.total_count
|
@@ -0,0 +1,146 @@
|
|
1
|
+
<div class="layuimini-main">
|
2
|
+
<form class="layui-form layuimini-form" action="">
|
3
|
+
<div class="layui-form-item" style="padding: 25px">
|
4
|
+
部门:<%=@department.name %>
|
5
|
+
</div>
|
6
|
+
</form>
|
7
|
+
<div>
|
8
|
+
<table class="layui-hide" id="major_table" lay-filter="major_table"></table>
|
9
|
+
</div>
|
10
|
+
</div>
|
11
|
+
<script type="text/html" id="add_major">
|
12
|
+
<div class="layui-btn-container">
|
13
|
+
<span class="table-label">专业列表</span>
|
14
|
+
<% if can? :create_department, EducodeSales::Customer %>
|
15
|
+
<button class="layui-btn layui-btn-normal layui-btn-sm data-add-btn pull-right" lay-event="add">添加专业</button>
|
16
|
+
<% end %>
|
17
|
+
</div>
|
18
|
+
</script>
|
19
|
+
<script type="text/html" id="tab_major">
|
20
|
+
<% if can? :update_department, EducodeSales::Customer %>
|
21
|
+
<a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="edit">编辑</a>
|
22
|
+
<a class="layui-btn layui-btn-normal layui-btn-xs layui-btn-danger data-count-delete" lay-event="del">删除</a>
|
23
|
+
<% end %>
|
24
|
+
</script>
|
25
|
+
|
26
|
+
<script>
|
27
|
+
|
28
|
+
layui.use(['form', 'table', 'upload', 'laytpl', 'request', 'selectInput', 'transfer'], function () {
|
29
|
+
var form = layui.form,
|
30
|
+
layer = layui.layer,
|
31
|
+
table = layui.table,
|
32
|
+
transfer = layui.transfer,
|
33
|
+
laytpl = layui.laytpl,
|
34
|
+
request = layui.request,
|
35
|
+
laydate = layui.laydate,
|
36
|
+
$ = layui.$;
|
37
|
+
|
38
|
+
|
39
|
+
|
40
|
+
form.render();
|
41
|
+
|
42
|
+
// 当前弹出层,防止ID被覆盖
|
43
|
+
var parentIndex = layer.index;
|
44
|
+
|
45
|
+
table.render({
|
46
|
+
elem: '#major_table',
|
47
|
+
url: '/missions/customers/majors?id=' + parent.department_id ,
|
48
|
+
toolbar: '#add_major',
|
49
|
+
defaultToolbar: [],
|
50
|
+
cols: [
|
51
|
+
[
|
52
|
+
{
|
53
|
+
field: 'id',
|
54
|
+
width: 100,
|
55
|
+
title:'序号',type: 'numbers',
|
56
|
+
},
|
57
|
+
{
|
58
|
+
field: 'name',
|
59
|
+
title: '专业',
|
60
|
+
},
|
61
|
+
{
|
62
|
+
title: '操作',
|
63
|
+
width: 190,
|
64
|
+
toolbar: '#tab_major',
|
65
|
+
align: "center",
|
66
|
+
fixed: 'right'
|
67
|
+
}
|
68
|
+
]
|
69
|
+
],
|
70
|
+
});
|
71
|
+
|
72
|
+
table.on('toolbar(major_table)', function (obj) {
|
73
|
+
if (obj.event === 'add') {
|
74
|
+
department_id = parent.department_id;
|
75
|
+
var content = miniPage.getHrefContent('/missions/customers/new_major?id=' + parent.department_id);
|
76
|
+
var openWH = miniPage.getOpenWidthHeight();
|
77
|
+
new_major_index = layer.open({
|
78
|
+
title: '添加专业',
|
79
|
+
type: 1,
|
80
|
+
shade: 0.2,
|
81
|
+
maxmin: true,
|
82
|
+
shadeClose: true,
|
83
|
+
area: [openWH[0] + 'px', openWH[1] + 'px'],
|
84
|
+
offset: [openWH[2] + 'px', openWH[3] + 'px'],
|
85
|
+
content: content,
|
86
|
+
success: function (layero, index) {
|
87
|
+
form.render('select');
|
88
|
+
}
|
89
|
+
});
|
90
|
+
$(window).on("resize", function () {
|
91
|
+
layer.full(index);
|
92
|
+
});
|
93
|
+
}
|
94
|
+
});
|
95
|
+
table.on('tool(major_table)', function (obj) {
|
96
|
+
if (obj.event == 'edit') {
|
97
|
+
var index = layer.open({
|
98
|
+
title: '修改专业名称',
|
99
|
+
closeBtn: 0,
|
100
|
+
type: 1,
|
101
|
+
area: '400px;',
|
102
|
+
id: 'LAY_layuipro',
|
103
|
+
content: '<div class="layui-form" lay-filter="edit_data" style="padding: 20px;"><input autocomplete="off" type="text" name="name" lay-verify="required" class="layui-input" value="' + obj.data.name +'"/></div>' ,
|
104
|
+
btn: ['保存', '取消'],
|
105
|
+
btn1: function(index, l) {
|
106
|
+
if (l.find("input").val().trim() == '') {
|
107
|
+
layer.msg('名称不能为空')
|
108
|
+
return false;
|
109
|
+
} else {
|
110
|
+
request.authPut("missions/customers/" + parent.department_id + "/update_major", {name: l.find("input").val().trim(), major_id: obj.data.id}, function(res) {
|
111
|
+
if (res.success == false) {
|
112
|
+
layer.alert(res.msg);
|
113
|
+
} else {
|
114
|
+
table.reload('major_table');
|
115
|
+
parent.table.reload('customers_table');
|
116
|
+
layer.close(index);
|
117
|
+
}
|
118
|
+
})
|
119
|
+
}
|
120
|
+
|
121
|
+
return false
|
122
|
+
},
|
123
|
+
btn2: function(index, l) {
|
124
|
+
layer.close(index)
|
125
|
+
}
|
126
|
+
});
|
127
|
+
} else if (obj.event == 'del') {
|
128
|
+
var index = layer.open({
|
129
|
+
content: '确定删除该专业 ' + obj.data.name + ' 吗',
|
130
|
+
yes: function(index, layero){
|
131
|
+
request.authDelete("missions/customers/" + parent.department_id + "/delete_major?major_id=" + obj.data.id, {}, function(res) {
|
132
|
+
if (res.success == false) {
|
133
|
+
layer.alert(res.msg)
|
134
|
+
} else {
|
135
|
+
table.reload('major_table');
|
136
|
+
parent.table.reload('customers_table');
|
137
|
+
layer.close(index);
|
138
|
+
}
|
139
|
+
})
|
140
|
+
}
|
141
|
+
});
|
142
|
+
}
|
143
|
+
})
|
144
|
+
|
145
|
+
});
|
146
|
+
</script>
|
@@ -51,6 +51,7 @@
|
|
51
51
|
rate = layui.rate,
|
52
52
|
miniPage = layui.miniPage;
|
53
53
|
|
54
|
+
|
54
55
|
laydate.render({
|
55
56
|
elem: '#year_plan_date',
|
56
57
|
type: 'year'
|
@@ -122,16 +123,15 @@
|
|
122
123
|
},
|
123
124
|
{
|
124
125
|
title: '操作',
|
125
|
-
width:
|
126
|
+
width: 300,
|
126
127
|
toolbar: '#currentYearTableBar',
|
127
128
|
align: "center",
|
128
129
|
fixed: 'right'
|
129
130
|
}
|
130
131
|
]
|
131
132
|
],
|
132
|
-
|
133
133
|
limit: 20,
|
134
|
-
|
134
|
+
limits: [10,15,20,30,40,50,60,70,80,90],
|
135
135
|
page: true,
|
136
136
|
});
|
137
137
|
|
@@ -197,6 +197,9 @@
|
|
197
197
|
var data = obj.data;
|
198
198
|
if (obj.event === 'edit') {
|
199
199
|
year = data.year;
|
200
|
+
sale_id = data.id;
|
201
|
+
staff_id = data.staff_id;
|
202
|
+
clazz = data.clazz_id;
|
200
203
|
content = miniPage.getHrefContent('/missions/plans/edit_year_plan?id=' + data.id);
|
201
204
|
openWH = miniPage.getOpenWidthHeight();
|
202
205
|
from_sales = true;
|
@@ -12,10 +12,16 @@ json.data do
|
|
12
12
|
json.created_at d.created_at.to_s
|
13
13
|
json.sale_way d.business.last_follow_up&.place&.name.present? ? '渠道' : '直销'
|
14
14
|
json.budget_amount d.business&.last_follow_up ? d.business.last_follow_up.budget_amount.to_f.round(2) : 0
|
15
|
-
json.plan_bid_on d.plan_bid_on
|
16
|
-
json.plan_sign_on d.plan_sign_on
|
17
|
-
json.prepayment_plan_on d.prepayment_plan_on
|
18
|
-
json.prepayment_amount d.prepayment_amount
|
15
|
+
json.plan_bid_on d.plan_bid_on || ''
|
16
|
+
json.plan_sign_on d.plan_sign_on || ''
|
17
|
+
json.prepayment_plan_on d.prepayment_plan_on || ''
|
18
|
+
json.prepayment_amount d.prepayment_amount || ''
|
19
|
+
json.business_clazz d.business.clazz&.name || ""
|
20
|
+
if d.business&.department&.school
|
21
|
+
json.property d.business.department.school.school_tags.where(for_missions: true).pluck(:name).join("、")
|
22
|
+
else
|
23
|
+
json.property ''
|
24
|
+
end
|
19
25
|
end
|
20
26
|
end
|
21
27
|
|
@@ -3,25 +3,25 @@
|
|
3
3
|
<div class="layui-inline">
|
4
4
|
<label class="layui-form-label required" style="width: 180px;">计划投标时间</label>
|
5
5
|
<div class="layui-input-inline">
|
6
|
-
<input type="text" class="layui-input" id="
|
6
|
+
<input type="text" class="layui-input" id="plan_bid_on_date" autocomplete="off" name="plan_bid_on" <%= ['回款目标', '签单目标', '商机目标'].include?(EducodeSales::SalePlan::CLAZZ_NAME.invert[@business_info.clazz]) ? 'disabled' : '' %>>
|
7
7
|
</div>
|
8
8
|
</div>
|
9
9
|
<div class="layui-inline">
|
10
10
|
<label class="layui-form-label required" style="width: 180px;">计划签单时间</label>
|
11
11
|
<div class="layui-input-inline">
|
12
|
-
<input type="text" class="layui-input" id="
|
12
|
+
<input type="text" class="layui-input" id="plan_sign_on_date" autocomplete="off" name="plan_sign_on" <%= ['回款目标', '中标目标', '商机目标'].include?(EducodeSales::SalePlan::CLAZZ_NAME.invert[@business_info.clazz]) ? 'disabled' : '' %>>
|
13
13
|
</div>
|
14
14
|
</div>
|
15
15
|
<div class="layui-inline">
|
16
16
|
<label class="layui-form-label required" style="width: 180px;">计划回款时间</label>
|
17
17
|
<div class="layui-input-inline">
|
18
|
-
<input type="text" class="layui-input" id="
|
18
|
+
<input type="text" class="layui-input" id="prepayment_plan_on_date" autocomplete="off" name="prepayment_plan_on" <%= ['中标目标', '签单目标', '商机目标'].include?(EducodeSales::SalePlan::CLAZZ_NAME.invert[@business_info.clazz]) ? 'disabled' : '' %>>
|
19
19
|
</div>
|
20
20
|
</div>
|
21
21
|
<div class="layui-inline">
|
22
|
-
<label class="layui-form-label required"
|
22
|
+
<label class="layui-form-label required" style="width: 180px;">计划回款额</label>
|
23
23
|
<div class="layui-input-inline">
|
24
|
-
<input type="text" class="layui-input"
|
24
|
+
<input type="text" class="layui-input" autocomplete="off" name="prepayment_amount" value="<%= @business_info.prepayment_amount %>" <%= ['中标目标', '签单目标', '商机目标'].include?(EducodeSales::SalePlan::CLAZZ_NAME.invert[@business_info.clazz]) ? 'disabled' : '' %>>
|
25
25
|
</div>
|
26
26
|
</div>
|
27
27
|
|
@@ -32,6 +32,11 @@
|
|
32
32
|
</div>
|
33
33
|
</div>
|
34
34
|
</form>
|
35
|
+
<style>
|
36
|
+
input:disabled {
|
37
|
+
background: #eee;
|
38
|
+
}
|
39
|
+
</style>
|
35
40
|
<script>
|
36
41
|
layui.use(['form', 'table', 'laytpl', 'request', 'laydate'], function () {
|
37
42
|
var form = layui.form,
|
@@ -42,18 +47,18 @@
|
|
42
47
|
$ = layui.$;
|
43
48
|
|
44
49
|
laydate.render({
|
45
|
-
elem: '#
|
50
|
+
elem: '#plan_bid_on_date',
|
46
51
|
value: "<%= @business_info.plan_bid_on.to_s %>",
|
47
52
|
type: 'date'
|
48
53
|
});
|
49
54
|
|
50
55
|
laydate.render({
|
51
|
-
elem: '#
|
56
|
+
elem: '#plan_sign_on_date',
|
52
57
|
value: "<%= @business_info.plan_sign_on.to_s %>",
|
53
58
|
type: 'date'
|
54
59
|
});
|
55
60
|
laydate.render({
|
56
|
-
elem: '#
|
61
|
+
elem: '#prepayment_plan_on_date',
|
57
62
|
value: "<%= @business_info.prepayment_plan_on.to_s %>",
|
58
63
|
type: 'date'
|
59
64
|
});
|