educode_sales 0.1.1 → 0.1.2
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/follow_ups_controller.rb +8 -8
- data/app/controllers/educode_sales/operation_plans_controller.rb +7 -7
- data/app/controllers/educode_sales/plans_controller.rb +8 -8
- data/app/controllers/educode_sales/sale_reports_controller.rb +3 -3
- data/app/controllers/educode_sales/sessions_controller.rb +1 -1
- data/app/controllers/educode_sales/teacher_follows_controller.rb +140 -0
- data/app/controllers/educode_sales/teachers_controller.rb +95 -5
- data/app/models/ability.rb +0 -4
- data/app/models/educode_sales/activity.rb +2 -1
- data/app/models/educode_sales/business.rb +0 -1
- data/app/models/educode_sales/course_subject.rb +1 -1
- data/app/models/educode_sales/staff.rb +3 -3
- data/app/models/educode_sales/teacher.rb +20 -1
- data/app/views/educode_sales/activities/edit.html.erb +4 -4
- data/app/views/educode_sales/activities/index.html.erb +6 -0
- data/app/views/educode_sales/activities/index.json.jbuilder +1 -1
- data/app/views/educode_sales/activities/new.html.erb +4 -3
- data/app/views/educode_sales/businesses/edit_plan.html.erb +3 -2
- data/app/views/educode_sales/businesses/index.json.jbuilder +1 -1
- data/app/views/educode_sales/businesses/new.html.erb +1 -1
- data/app/views/educode_sales/businesses/show_follow_record.html.erb +1 -1
- data/app/views/educode_sales/home/search_users.json.jbuilder +1 -1
- data/app/views/educode_sales/operation_plans/_monthPlan.html.erb +17 -8
- data/app/views/educode_sales/operation_plans/_monthly.html.erb +13 -5
- data/app/views/educode_sales/operation_plans/_weekPlan.html.erb +30 -21
- data/app/views/educode_sales/operation_plans/_weekly.html.erb +12 -4
- data/app/views/educode_sales/operation_plans/edit_month.html.erb +8 -1
- data/app/views/educode_sales/operation_plans/edit_monthly.html.erb +1 -1
- data/app/views/educode_sales/operation_plans/edit_week.html.erb +12 -3
- data/app/views/educode_sales/operation_plans/edit_weekly.html.erb +1 -1
- data/app/views/educode_sales/operation_plans/index.json.jbuilder +2 -2
- data/app/views/educode_sales/operation_plans/my_month.json.jbuilder +1 -1
- data/app/views/educode_sales/operation_plans/my_week.json.jbuilder +2 -2
- data/app/views/educode_sales/operation_plans/new_month.html.erb +7 -1
- data/app/views/educode_sales/operation_plans/new_monthly.html.erb +1 -1
- data/app/views/educode_sales/operation_plans/new_week.html.erb +8 -2
- data/app/views/educode_sales/operation_reports/audit.html.erb +9 -9
- data/app/views/educode_sales/operation_reports/edit.html.erb +14 -17
- data/app/views/educode_sales/operation_reports/plans.json.jbuilder +1 -1
- data/app/views/educode_sales/plans/edit_week.html.erb +8 -2
- data/app/views/educode_sales/plans/index.json.jbuilder +1 -1
- data/app/views/educode_sales/plans/my_week.json.jbuilder +1 -1
- data/app/views/educode_sales/plans/new_month.html.erb +7 -3
- data/app/views/educode_sales/plans/new_week.html.erb +8 -2
- data/app/views/educode_sales/sales/index.html.erb +2 -1
- data/app/views/educode_sales/sales/operations.html.erb +5 -2
- data/app/views/educode_sales/sessions/login.html.erb +1 -1
- data/app/views/educode_sales/staffs/edit.html.erb +1 -2
- data/app/views/educode_sales/staffs/index.html.erb +4 -4
- data/app/views/educode_sales/staffs/new.html.erb +1 -1
- data/app/views/educode_sales/teachers/add_courses.html.erb +100 -19
- data/app/views/educode_sales/teachers/course_subject.json.jbuilder +10 -0
- data/app/views/educode_sales/teachers/edit.html.erb +54 -18
- data/app/views/educode_sales/teachers/edit_follow_record.html.erb +49 -30
- data/app/views/educode_sales/teachers/index.html.erb +15 -4
- data/app/views/educode_sales/teachers/index.json.jbuilder +1 -0
- data/app/views/educode_sales/teachers/new.html.erb +8 -6
- data/app/views/educode_sales/teachers/new_follow_record.html.erb +52 -29
- data/app/views/educode_sales/teachers/show_follow.html.erb +150 -170
- data/app/views/educode_sales/teachers/show_follow.json.jbuilder +20 -0
- data/app/views/educode_sales/teachers/show_follow_record.html.erb +11 -42
- data/app/views/educode_sales/teachers/unfinish_plans.json.jbuilder +14 -0
- data/config/routes.rb +10 -0
- data/db/migrate/20210915061738_add_students_count_teacher_follow_ups.rb +9 -0
- data/lib/educode_sales/version.rb +1 -1
- metadata +6 -2
data/app/models/ability.rb
CHANGED
@@ -6,14 +6,10 @@
|
|
6
6
|
#
|
7
7
|
# user ||= User.new # guest user (not logged in)
|
8
8
|
alias_action :index, :trends, :show, :to => :read
|
9
|
-
p "----------"
|
10
|
-
p staff.is_admin
|
11
9
|
if staff.is_admin
|
12
10
|
can :manage, :all
|
13
11
|
else
|
14
12
|
staff.role.permissions.each do |ps|
|
15
|
-
p ps.action
|
16
|
-
p "EducodeSales::#{ps.subject}".constantize
|
17
13
|
can ps.action.to_sym, "EducodeSales::#{ps.subject}".constantize
|
18
14
|
# level = @current_admin.role.role_areas.find_by(clazz: 'name')&.level
|
19
15
|
# if level == '自己'
|
@@ -4,7 +4,7 @@ module EducodeSales
|
|
4
4
|
belongs_to :role, optional: true
|
5
5
|
|
6
6
|
has_many :market_areas, dependent: :destroy
|
7
|
-
has_many :
|
7
|
+
has_many :follow_ups, dependent: :restrict_with_exception
|
8
8
|
has_many :operation_plans, dependent: :restrict_with_exception
|
9
9
|
has_many :operation_reports, dependent: :restrict_with_exception
|
10
10
|
has_many :sale_reports, dependent: :restrict_with_exception
|
@@ -14,7 +14,7 @@ module EducodeSales
|
|
14
14
|
has_many :places, dependent: :restrict_with_exception
|
15
15
|
has_many :businesses
|
16
16
|
has_many :activities
|
17
|
-
has_many :
|
17
|
+
has_many :sale_plans, dependent: :destroy
|
18
18
|
|
19
19
|
has_many :areas, through: :market_areas
|
20
20
|
validates :user_id, uniqueness: { message: '已存在' }
|
@@ -33,7 +33,7 @@ module EducodeSales
|
|
33
33
|
end
|
34
34
|
|
35
35
|
def month
|
36
|
-
if expired_at.present?
|
36
|
+
if expired_at.present? && enabled_at.present?
|
37
37
|
(expired_at.year * 12 + expired_at.month) - (enabled_at.year * 12 + enabled_at.month)
|
38
38
|
else
|
39
39
|
nil
|
@@ -2,11 +2,30 @@ module EducodeSales
|
|
2
2
|
class Teacher < ApplicationRecord
|
3
3
|
has_many :activity_teachers
|
4
4
|
has_many :activities, through: :activity_teachers
|
5
|
+
has_many :teacher_follows, dependent: :destroy
|
6
|
+
has_many :operation_plans, dependent: :destroy
|
7
|
+
has_many :course_subjects, dependent: :destroy
|
5
8
|
belongs_to :department, optional: true
|
6
9
|
belongs_to :staff
|
7
10
|
belongs_to :user, optional: true
|
8
11
|
belongs_to :follow_up, counter_cache: true, optional: true
|
9
12
|
|
10
13
|
validates :user_id, uniqueness: { allow_blank: true, message: '已存在老师列表'}
|
14
|
+
|
15
|
+
|
16
|
+
def teacher_used_of_department
|
17
|
+
if user_id.present?
|
18
|
+
user_ids = User.joins(:user_extension).where(user_extensions: {department_id: self.department_id, identity: 0}).pluck(:id)
|
19
|
+
course_ids = CourseMember.where(role: "CREATOR", user_id: user_ids).pluck(:course_id)
|
20
|
+
if course_ids.present?
|
21
|
+
else
|
22
|
+
0
|
23
|
+
end
|
24
|
+
course_members = CourseMember.joins(course: :practice_homework_shixuns).where(course_id: course_ids).group("course_id").having("COUNT(homework_commons_shixuns.id) > 100 AND COUNT(course_members.user_id) > 30").select("COUNT(*) AS count")
|
25
|
+
course_members.present? ? course_members[0]['count'] : 0
|
26
|
+
else
|
27
|
+
0
|
28
|
+
end
|
29
|
+
end
|
11
30
|
end
|
12
|
-
end
|
31
|
+
end
|
@@ -1,5 +1,6 @@
|
|
1
1
|
<%#= Gon::Base.render_data %>
|
2
|
-
<
|
2
|
+
<div class="layuimini-main">
|
3
|
+
<form class="layui-form layuimini-form" action="">
|
3
4
|
<div class="layui-form-item" style="padding: 25px">
|
4
5
|
<div class="layui-inline">
|
5
6
|
<label class="layui-form-label required">活动名称</label>
|
@@ -28,8 +29,7 @@
|
|
28
29
|
</div>
|
29
30
|
</div>
|
30
31
|
</form>
|
31
|
-
|
32
|
-
|
32
|
+
</div>
|
33
33
|
<script>
|
34
34
|
|
35
35
|
layui.use(['form', 'table', 'upload', 'laytpl', 'request', 'selectInput', 'transfer'], function () {
|
@@ -73,7 +73,7 @@
|
|
73
73
|
layer.alert(res.msg)
|
74
74
|
} else {
|
75
75
|
layer.closeAll(); //关闭所有层
|
76
|
-
table.reload('
|
76
|
+
table.reload('activities_table')
|
77
77
|
}
|
78
78
|
})
|
79
79
|
return false;
|
@@ -1,15 +1,21 @@
|
|
1
1
|
<script type="text/html" id="activity_toolbar">
|
2
2
|
<div class="layui-btn-container">
|
3
3
|
<span class="table-label">活动列表</span>
|
4
|
+
<% if can? :create, EducodeSales::Activity %>
|
4
5
|
<button class="layui-btn layui-btn-normal layui-btn-sm data-add-btn pull-right" lay-event="add"> 添加活动</button>
|
6
|
+
<% end %>
|
5
7
|
</div>
|
6
8
|
</script>
|
7
9
|
|
8
10
|
<table class="layui-hide" id="activities_table" lay-filter="activities_table"></table>
|
9
11
|
|
10
12
|
<script type="text/html" id="currentTableBar">
|
13
|
+
<% if can? :update, EducodeSales::Activity %>
|
11
14
|
<a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="edit">编辑</a>
|
15
|
+
<% end %>
|
16
|
+
<% if can? :destroy, EducodeSales::Activity %>
|
12
17
|
<a class="layui-btn layui-btn-xs layui-btn-danger data-count-delete" lay-event="delete">删除</a>
|
18
|
+
<% end %>
|
13
19
|
</script>
|
14
20
|
|
15
21
|
<script type="text/html" id="teachers">
|
@@ -5,7 +5,7 @@ json.data do
|
|
5
5
|
json.days d.days
|
6
6
|
json.teachers_count d.activity_teachers_count
|
7
7
|
json.return_rate d.return_rate
|
8
|
-
json.students_count d.students_count
|
8
|
+
json.students_count d.students_count || 0
|
9
9
|
json.course_rate d.course_rate
|
10
10
|
json.start_at d.start_at ? d.start_at.to_s(:date) : ''
|
11
11
|
end
|
@@ -1,5 +1,6 @@
|
|
1
1
|
<%#= Gon::Base.render_data %>
|
2
|
-
<
|
2
|
+
<div class="layuimini-main">
|
3
|
+
<form class="layui-form layuimini-form" action="">
|
3
4
|
<div class="layui-form-item" style="padding: 25px">
|
4
5
|
<div class="layui-inline">
|
5
6
|
<label class="layui-form-label required">活动名称</label>
|
@@ -27,7 +28,7 @@
|
|
27
28
|
</div>
|
28
29
|
</div>
|
29
30
|
</form>
|
30
|
-
|
31
|
+
</div>
|
31
32
|
|
32
33
|
<script>
|
33
34
|
|
@@ -72,7 +73,7 @@
|
|
72
73
|
layer.alert(res.msg)
|
73
74
|
} else {
|
74
75
|
layer.closeAll(); //关闭所有层
|
75
|
-
table.reload('
|
76
|
+
table.reload('activities_table')
|
76
77
|
}
|
77
78
|
})
|
78
79
|
return false;
|
@@ -152,9 +152,10 @@
|
|
152
152
|
request.authPut('educode_sales/follow_ups/' + parent.follow_up_id + "/update_money", data,
|
153
153
|
function (res) {
|
154
154
|
if (res.success) {
|
155
|
-
|
155
|
+
layer.alert('保存成功');
|
156
|
+
table.reload('return_money_list');
|
156
157
|
} else {
|
157
|
-
layer.alert(res.msg)
|
158
|
+
layer.alert(res.msg);
|
158
159
|
}
|
159
160
|
|
160
161
|
})
|
@@ -3,7 +3,7 @@
|
|
3
3
|
<div class="layui-inline">
|
4
4
|
<label class="layui-form-label required">名称</label>
|
5
5
|
<div class="layui-input-block">
|
6
|
-
<input type="text" name="name" autocomplete="off" lay-verify="required" class="layui-input" style="width:
|
6
|
+
<input type="text" name="name" autocomplete="off" lay-verify="required" class="layui-input" style="width: 300px;">
|
7
7
|
</div>
|
8
8
|
</div>
|
9
9
|
<div class="layui-inline">
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<h1 class="text-center m-t-20"><%= @follow_up.business.name %></h1>
|
2
|
-
<
|
2
|
+
<form class="layui-form form-value">
|
3
3
|
<div class="layui-form-item" style="padding: 25px">
|
4
4
|
<div class="layui-inline">
|
5
5
|
<label class="layui-form-label">单位:</label>
|
@@ -1,7 +1,9 @@
|
|
1
1
|
<script type="text/html" id="monthPlanToolbar">
|
2
2
|
<div class="layui-btn-container">
|
3
3
|
<span class="table-label">月计划列表</span>
|
4
|
+
<% if can? :create, EducodeSales::OperationPlan %>
|
4
5
|
<button class="layui-btn layui-btn-normal layui-btn-sm data-add-btn pull-right" lay-event="add"> 添加计划</button>
|
6
|
+
<% end %>
|
5
7
|
</div>
|
6
8
|
</script>
|
7
9
|
<!--搜索-->
|
@@ -36,13 +38,19 @@
|
|
36
38
|
<table class="layui-hide" id="monthPlanTable" lay-filter="currentTableFilter3"></table>
|
37
39
|
|
38
40
|
<script type="text/html" id="currentTableBar">
|
41
|
+
<% if can? :read, EducodeSales::OperationPlan %>
|
39
42
|
<a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="show">查看</a>
|
43
|
+
<% end %>
|
44
|
+
<% if can? :update, EducodeSales::OperationPlan %>
|
40
45
|
<a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="edit">编辑</a>
|
46
|
+
<% end %>
|
47
|
+
<% if can? :destroy, EducodeSales::OperationPlan %>
|
41
48
|
<a class="layui-btn layui-btn-xs layui-btn-danger data-count-delete" lay-event="delete">删除</a>
|
49
|
+
<% end %>
|
42
50
|
</script>
|
43
51
|
|
44
|
-
<script type="text/html" id="
|
45
|
-
<a href="javascript:void(0);" lay-event="
|
52
|
+
<script type="text/html" id="show_follow2">
|
53
|
+
<a href="javascript:void(0);" lay-event="show_follow2" class="layui-table-link">{{ d.count }}</a>
|
46
54
|
</script>
|
47
55
|
|
48
56
|
<script>
|
@@ -88,12 +96,12 @@
|
|
88
96
|
},
|
89
97
|
{
|
90
98
|
field: 'school',
|
91
|
-
width:
|
99
|
+
width: 190,
|
92
100
|
title: '单位'
|
93
101
|
},
|
94
102
|
{
|
95
103
|
field: 'department',
|
96
|
-
width:
|
104
|
+
width: 190,
|
97
105
|
title: '部门'
|
98
106
|
},
|
99
107
|
{
|
@@ -102,10 +110,10 @@
|
|
102
110
|
title: '计划内容',
|
103
111
|
},
|
104
112
|
{
|
105
|
-
field: '
|
113
|
+
field: 'count',
|
106
114
|
width: 100,
|
107
115
|
title: '跟进',
|
108
|
-
templet: '#
|
116
|
+
templet: '#show_follow2'
|
109
117
|
},
|
110
118
|
{
|
111
119
|
field: 'rate',
|
@@ -245,8 +253,9 @@
|
|
245
253
|
layer.full(index);
|
246
254
|
});
|
247
255
|
return false;
|
248
|
-
} else if (obj.event === '
|
249
|
-
|
256
|
+
} else if (obj.event === 'show_follow2') {
|
257
|
+
id = data.teacher_id
|
258
|
+
content = miniPage.getHrefContent('/educode_sales/teachers/show_follow?id=' + data.teacher_id);
|
250
259
|
openWH = miniPage.getOpenWidthHeight();
|
251
260
|
index = layer.open({
|
252
261
|
title: 'xxxx/跟进记录',
|
@@ -1,7 +1,9 @@
|
|
1
1
|
<script type="text/html" id="monthlyToolbar">
|
2
2
|
<div class="layui-btn-container">
|
3
3
|
<span class="table-label">月报列表</span>
|
4
|
+
<% if can? :create, EducodeSales::OperationPlan %>
|
4
5
|
<button class="layui-btn layui-btn-normal layui-btn-sm data-add-btn pull-right" lay-event="add"> 添加月报</button>
|
6
|
+
<% end %>
|
5
7
|
</div>
|
6
8
|
</script>
|
7
9
|
<!--搜索-->
|
@@ -38,12 +40,18 @@
|
|
38
40
|
<table class="layui-hide" id="monthlyTable" lay-filter="currentTableFilter4"></table>
|
39
41
|
</div>
|
40
42
|
<script type="text/html" id="monthlyTableBar">
|
43
|
+
<% if can? :read, EducodeSales::OperationPlan %>
|
41
44
|
<a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="show">查看</a>
|
45
|
+
<% end %>
|
46
|
+
<% if can? :create, EducodeSales::OperationPlan %>
|
42
47
|
<a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="edit">编辑</a>
|
43
|
-
|
48
|
+
<% end %>
|
49
|
+
<% if can? :audit, EducodeSales::OperationReport %>
|
44
50
|
<a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="audit">审查</a>
|
45
|
-
|
51
|
+
<% end %>
|
52
|
+
<% if can? :destroy, EducodeSales::OperationPlan %>
|
46
53
|
<a class="layui-btn layui-btn-xs layui-btn-danger data-count-delete" lay-event="delete">删除</a>
|
54
|
+
<% end %>
|
47
55
|
</script>
|
48
56
|
|
49
57
|
|
@@ -228,11 +236,11 @@
|
|
228
236
|
var data = obj.data;
|
229
237
|
if (obj.event === 'edit') {
|
230
238
|
|
231
|
-
var content = miniPage.getHrefContent('/educode_sales/operation_reports/' + data.id +
|
239
|
+
var content = miniPage.getHrefContent('/educode_sales/operation_reports/' + data.id + '/edit');
|
232
240
|
var openWH = miniPage.getOpenWidthHeight();
|
233
241
|
|
234
|
-
|
235
|
-
title: '
|
242
|
+
MonthlyIndex = layer.open({
|
243
|
+
title: '编辑',
|
236
244
|
type: 1,
|
237
245
|
shade: 0.2,
|
238
246
|
maxmin: true,
|
@@ -1,7 +1,9 @@
|
|
1
1
|
<script type="text/html" id="weekPlanToolbar">
|
2
2
|
<div class="layui-btn-container">
|
3
3
|
<span class="table-label">周计划列表</span>
|
4
|
+
<% if can? :create, EducodeSales::OperationPlan %>
|
4
5
|
<button class="layui-btn layui-btn-normal layui-btn-sm data-add-btn pull-right" lay-event="add"> 添加计划</button>
|
6
|
+
<% end %>
|
5
7
|
</div>
|
6
8
|
</script>
|
7
9
|
<!--搜索-->
|
@@ -34,16 +36,22 @@
|
|
34
36
|
</div>
|
35
37
|
</div>
|
36
38
|
</div>
|
37
|
-
<table class="layui-hide" id="
|
39
|
+
<table class="layui-hide" id="weekPlanTable1" lay-filter="weekPlanTable1"></table>
|
38
40
|
</div>
|
39
41
|
<script type="text/html" id="week_plan_currentTableBar">
|
42
|
+
<% if can? :read, EducodeSales::OperationPlan %>
|
40
43
|
<a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="show">查看</a>
|
44
|
+
<% end %>
|
45
|
+
<% if can? :update, EducodeSales::OperationPlan %>
|
41
46
|
<a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="edit">编辑</a>
|
47
|
+
<% end %>
|
48
|
+
<% if can? :destroy, EducodeSales::OperationPlan %>
|
42
49
|
<a class="layui-btn layui-btn-xs layui-btn-danger data-count-delete" lay-event="delete">删除</a>
|
50
|
+
<% end %>
|
43
51
|
</script>
|
44
52
|
|
45
|
-
<script type="text/html" id="
|
46
|
-
<a href="javascript:void(0);" lay-event="
|
53
|
+
<script type="text/html" id="show_follow1">
|
54
|
+
<a href="javascript:void(0);" lay-event="show_follow1" class="layui-table-link">{{ d.count }}</a>
|
47
55
|
</script>
|
48
56
|
|
49
57
|
<script>
|
@@ -67,7 +75,7 @@
|
|
67
75
|
|
68
76
|
|
69
77
|
table.render({
|
70
|
-
elem: '#
|
78
|
+
elem: '#weekPlanTable1',
|
71
79
|
url: '/educode_sales/operation_plans?clazz=week',
|
72
80
|
toolbar: '#weekPlanToolbar',
|
73
81
|
defaultToolbar: [],
|
@@ -90,12 +98,12 @@
|
|
90
98
|
},
|
91
99
|
{
|
92
100
|
field: 'school',
|
93
|
-
width:
|
101
|
+
width: 190,
|
94
102
|
title: '单位'
|
95
103
|
},
|
96
104
|
{
|
97
105
|
field: 'department',
|
98
|
-
width:
|
106
|
+
width: 190,
|
99
107
|
title: '部门'
|
100
108
|
},
|
101
109
|
{
|
@@ -109,10 +117,10 @@
|
|
109
117
|
title: '计划内容',
|
110
118
|
},
|
111
119
|
{
|
112
|
-
field: '
|
120
|
+
field: 'count',
|
113
121
|
width: 100,
|
114
122
|
title: '跟进',
|
115
|
-
templet: '#
|
123
|
+
templet: '#show_follow1'
|
116
124
|
},
|
117
125
|
{
|
118
126
|
field: 'rate',
|
@@ -140,10 +148,10 @@
|
|
140
148
|
skin: 'line'
|
141
149
|
});
|
142
150
|
var sort = {}, search = {};
|
143
|
-
table.on('sort(
|
151
|
+
table.on('sort(weekPlanTable1)', function(obj) {
|
144
152
|
sort.field = obj.field;
|
145
153
|
sort.order = obj.type;
|
146
|
-
table.reload('
|
154
|
+
table.reload('weekPlanTable1', {
|
147
155
|
initSort: obj,
|
148
156
|
where: {
|
149
157
|
sort: sort,
|
@@ -155,7 +163,7 @@
|
|
155
163
|
// 监听搜索操作
|
156
164
|
form.on('submit(week_plan_search)', function (data) {
|
157
165
|
search = data.field
|
158
|
-
table.reload('
|
166
|
+
table.reload('weekPlanTable1', {
|
159
167
|
page: {
|
160
168
|
curr: 1
|
161
169
|
},
|
@@ -174,7 +182,7 @@
|
|
174
182
|
/**
|
175
183
|
* toolbar事件监听
|
176
184
|
*/
|
177
|
-
table.on('toolbar(
|
185
|
+
table.on('toolbar(weekPlanTable1)', function (obj) {
|
178
186
|
var data = obj.data;
|
179
187
|
if (obj.event === 'add') { // 监听添加操作
|
180
188
|
var content = miniPage.getHrefContent('/educode_sales/operation_plans/new_week');
|
@@ -200,7 +208,7 @@
|
|
200
208
|
});
|
201
209
|
|
202
210
|
|
203
|
-
table.on('tool(
|
211
|
+
table.on('tool(weekPlanTable1)', function (obj) {
|
204
212
|
var data = obj.data;
|
205
213
|
id = data.id
|
206
214
|
if (obj.event === 'delete') {
|
@@ -208,7 +216,7 @@
|
|
208
216
|
console.log("aaaaa");
|
209
217
|
request.delete('educode_sales/operation_plans/' + data.id, {}, function (res) {
|
210
218
|
layer.close(index);
|
211
|
-
table.reload("
|
219
|
+
table.reload("weekPlanTable1")
|
212
220
|
})
|
213
221
|
});
|
214
222
|
}
|
@@ -241,7 +249,7 @@
|
|
241
249
|
} else if (obj.event === 'edit') {
|
242
250
|
content = miniPage.getHrefContent('/educode_sales/operation_plans/edit_week?id='+id);
|
243
251
|
openWH = miniPage.getOpenWidthHeight();
|
244
|
-
|
252
|
+
editWeek_index = layer.open({
|
245
253
|
title: '编辑',
|
246
254
|
type: 1,
|
247
255
|
shade: 0.2,
|
@@ -251,10 +259,10 @@
|
|
251
259
|
offset: [openWH[2] + 'px', openWH[3] + 'px'],
|
252
260
|
content: content,
|
253
261
|
success: function (layero, index) {
|
254
|
-
$("#edit_chance1").val(data.chance);
|
255
|
-
$("#edit_plan1").val(data.plan);
|
256
|
-
$("#edit_rate1").val(data.rate);
|
257
|
-
$("#edit_week1").val(data.week);
|
262
|
+
// $("#edit_chance1").val(data.chance);
|
263
|
+
// $("#edit_plan1").val(data.plan);
|
264
|
+
// $("#edit_rate1").val(data.rate);
|
265
|
+
// $("#edit_week1").val(data.week);
|
258
266
|
// 重新渲染弹层中的下拉选择框select
|
259
267
|
form.render('select');
|
260
268
|
},
|
@@ -263,8 +271,9 @@
|
|
263
271
|
layer.full(index);
|
264
272
|
});
|
265
273
|
return false;
|
266
|
-
} else if (obj.event === '
|
267
|
-
|
274
|
+
} else if (obj.event === 'show_follow1') {
|
275
|
+
id = data.teacher_id
|
276
|
+
content = miniPage.getHrefContent('/educode_sales/teachers/show_follow?id=' + data.teacher_id);
|
268
277
|
openWH = miniPage.getOpenWidthHeight();
|
269
278
|
index = layer.open({
|
270
279
|
title: 'xxxx/跟进记录',
|