educode_sales 0.1.0 → 0.1.4
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/assets/stylesheets/educode_sales/app.css +2 -1
- data/app/controllers/educode_sales/activities_controller.rb +7 -1
- data/app/controllers/educode_sales/application_controller.rb +0 -1
- data/app/controllers/educode_sales/businesses_controller.rb +16 -9
- data/app/controllers/educode_sales/follow_ups_controller.rb +12 -8
- data/app/controllers/educode_sales/operation_plans_controller.rb +155 -0
- data/app/controllers/educode_sales/operation_reports_controller.rb +125 -0
- data/app/controllers/educode_sales/places_controller.rb +3 -4
- data/app/controllers/educode_sales/plans_controller.rb +12 -10
- data/app/controllers/educode_sales/roles_controller.rb +11 -0
- data/app/controllers/educode_sales/sale_reports_controller.rb +5 -4
- data/app/controllers/educode_sales/sales_controller.rb +4 -1
- data/app/controllers/educode_sales/sessions_controller.rb +2 -1
- data/app/controllers/educode_sales/teacher_follows_controller.rb +146 -0
- data/app/controllers/educode_sales/teachers_controller.rb +113 -11
- data/app/models/ability.rb +0 -1
- data/app/models/educode_sales/activity.rb +2 -1
- data/app/models/educode_sales/business.rb +0 -1
- data/app/models/educode_sales/common.rb +1 -0
- data/app/models/educode_sales/course_subject.rb +1 -1
- data/app/models/educode_sales/money_plan.rb +3 -3
- data/app/models/educode_sales/operation_plan.rb +2 -0
- data/app/models/educode_sales/place.rb +1 -0
- data/app/models/educode_sales/sale_plan.rb +2 -0
- data/app/models/educode_sales/staff.rb +5 -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 +23 -8
- 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_follow_record.html.erb +2 -2
- data/app/views/educode_sales/businesses/edit_plan.html.erb +12 -7
- data/app/views/educode_sales/businesses/index.html.erb +137 -141
- data/app/views/educode_sales/businesses/index.json.jbuilder +2 -1
- data/app/views/educode_sales/businesses/new.html.erb +1 -1
- data/app/views/educode_sales/businesses/show_follow.html.erb +18 -3
- 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 +82 -88
- data/app/views/educode_sales/operation_plans/_monthly.html.erb +126 -97
- data/app/views/educode_sales/operation_plans/_weekPlan.html.erb +103 -90
- data/app/views/educode_sales/operation_plans/_weekly.html.erb +116 -87
- data/app/views/educode_sales/operation_plans/edit_month.html.erb +44 -32
- data/app/views/educode_sales/operation_plans/edit_monthly.html.erb +1 -1
- data/app/views/educode_sales/operation_plans/edit_week.html.erb +49 -39
- data/app/views/educode_sales/operation_plans/edit_weekly.html.erb +1 -1
- data/app/views/educode_sales/operation_plans/index.html.erb +35 -5
- data/app/views/educode_sales/operation_plans/index.json.jbuilder +19 -0
- data/app/views/educode_sales/operation_plans/my_month.json.jbuilder +18 -0
- data/app/views/educode_sales/operation_plans/my_week.json.jbuilder +19 -0
- data/app/views/educode_sales/operation_plans/new_month.html.erb +13 -10
- data/app/views/educode_sales/operation_plans/new_monthly.html.erb +162 -72
- data/app/views/educode_sales/operation_plans/new_week.html.erb +14 -7
- data/app/views/educode_sales/operation_plans/new_weekly.html.erb +205 -120
- data/app/views/educode_sales/operation_plans/show_month.html.erb +4 -10
- data/app/views/educode_sales/operation_plans/show_week.html.erb +20 -25
- data/app/views/educode_sales/operation_plans/show_weekly.html.erb +6 -6
- data/app/views/educode_sales/operation_reports/audit.html.erb +214 -0
- data/app/views/educode_sales/operation_reports/edit.html.erb +234 -0
- data/app/views/educode_sales/operation_reports/index.json.jbuilder +18 -0
- data/app/views/educode_sales/operation_reports/plans.json.jbuilder +19 -0
- data/app/views/educode_sales/operation_reports/show.html.erb +139 -0
- data/app/views/educode_sales/operations/trends.html.erb +8 -0
- data/app/views/educode_sales/places/index.html.erb +6 -0
- data/app/views/educode_sales/places/index.json.jbuilder +1 -1
- data/app/views/educode_sales/plans/_monthPlan.html.erb +9 -1
- data/app/views/educode_sales/plans/_monthly.html.erb +10 -2
- data/app/views/educode_sales/plans/_weekPlan.html.erb +17 -5
- data/app/views/educode_sales/plans/_weekly.html.erb +10 -2
- data/app/views/educode_sales/plans/audit_weekly.html.erb +6 -0
- data/app/views/educode_sales/plans/edit_monthly.html.erb +8 -0
- data/app/views/educode_sales/plans/edit_week.html.erb +8 -2
- data/app/views/educode_sales/plans/edit_weekly.html.erb +8 -0
- data/app/views/educode_sales/plans/index.json.jbuilder +1 -1
- data/app/views/educode_sales/plans/my_month.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_monthly.html.erb +8 -0
- data/app/views/educode_sales/plans/new_week.html.erb +8 -2
- data/app/views/educode_sales/plans/new_weekly.html.erb +7 -1
- data/app/views/educode_sales/roles/index.html.erb +33 -2
- data/app/views/educode_sales/sale_reports/index.json.jbuilder +1 -1
- data/app/views/educode_sales/sale_trends/trends.html.erb +8 -0
- 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 +2 -3
- 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 +20 -11
- data/app/views/educode_sales/teachers/index.json.jbuilder +2 -0
- data/app/views/educode_sales/teachers/new.html.erb +8 -6
- data/app/views/educode_sales/teachers/new_follow_record.html.erb +54 -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/app/views/layouts/educode_sales/application.html.erb +23 -2
- data/config/routes.rb +22 -4
- data/db/migrate/20210915061738_add_students_count_teacher_follow_ups.rb +9 -0
- data/lib/educode_sales/version.rb +1 -1
- metadata +19 -6
@@ -3,58 +3,70 @@
|
|
3
3
|
<div class="layui-inline">
|
4
4
|
<label class="layui-form-label">月份</label>
|
5
5
|
<div class="layui-input-inline">
|
6
|
-
<
|
7
|
-
|
8
|
-
|
9
|
-
<option value="021">上海</option>
|
10
|
-
<option value="0571">杭州</option>
|
11
|
-
</select>
|
6
|
+
<input type="text" class="layui-input" id="edit_month_plan" autocomplete="off" name="month" placeholder="请选择" value="<%=@sale_plan.month.strftime("%Y-%m") %>">
|
7
|
+
|
8
|
+
<%#= select_tag "month", options_for_select(@months, @sale_plan.month.strftime("%Y-%m")), class: 'required' %>
|
12
9
|
</div>
|
13
10
|
</div>
|
14
11
|
<div class="layui-inline">
|
15
12
|
<label class="layui-form-label">教师</label>
|
16
13
|
<div class="layui-input-inline">
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
<option value="021">上海</option>
|
21
|
-
<option value="0571">杭州</option>
|
22
|
-
<option value="人工智能实验室建设1">人工智能实验室建设1</option>
|
23
|
-
</select>
|
14
|
+
<%#= select_tag "teacher_id", options_for_select(@teachers, @sale_plan.teacher_id), class: 'required' %>
|
15
|
+
<%= select_tag "teacher_id", options_for_select(@teachers), class: 'required' %>
|
16
|
+
|
24
17
|
</div>
|
25
18
|
</div>
|
26
19
|
<div class="layui-form-item layui-form-text">
|
27
20
|
<label class="layui-form-label">计划内容</label>
|
28
21
|
<div class="layui-input-block">
|
29
|
-
<textarea name="
|
22
|
+
<textarea name="content" placeholder="简要填写具体的营销计划,例如:
|
30
23
|
1、推动xx老师用起来;
|
31
24
|
2、与xx老师介绍一下我们的方案;
|
32
|
-
3、与xx领导深度沟通一下,以获取到关键建设规划信息等等。" class="layui-textarea"
|
25
|
+
3、与xx领导深度沟通一下,以获取到关键建设规划信息等等。" class="layui-textarea"><%= @sale_plan.content %></textarea>
|
33
26
|
</div>
|
34
27
|
</div>
|
35
28
|
<div class="layui-inline">
|
36
29
|
<label class="layui-form-label">完成率</label>
|
37
30
|
<div class="layui-input-inline">
|
38
|
-
|
39
|
-
<option value="0%">0%</option>
|
40
|
-
<option value="10%">10%</option>
|
41
|
-
<option value="20%">20%</option>
|
42
|
-
<option value="30%">30%</option>
|
43
|
-
<option value="40%">40%</option>
|
44
|
-
<option value="50%">50%</option>
|
45
|
-
<option value="60%">60%</option>
|
46
|
-
<option value="70%">70%</option>
|
47
|
-
<option value="80%">80%</option>
|
48
|
-
<option value="90%">90%</option>
|
49
|
-
<option value="1001%">1001%</option>
|
50
|
-
</select>
|
31
|
+
<%= select_tag "finish_rate", options_for_select(@finish_rates, @sale_plan.finish_rate) %>
|
51
32
|
</div>
|
52
33
|
</div>
|
53
34
|
<div class="layui-inline">
|
54
|
-
<button type="submit" class="layui-btn layui-btn-normal" lay-submit lay-filter="
|
55
|
-
</button>
|
56
|
-
<button type="submit" class="layui-btn layui-btn-primary" lay-submit lay-filter="data-search-btn">取消
|
35
|
+
<button type="submit" class="layui-btn layui-btn-normal" lay-submit lay-filter="update_sale_plan">提交
|
57
36
|
</button>
|
58
37
|
</div>
|
59
38
|
</div>
|
60
|
-
</form>
|
39
|
+
</form>
|
40
|
+
|
41
|
+
|
42
|
+
<script>
|
43
|
+
layui.use(['form', 'table', 'laytpl', 'request'], function () {
|
44
|
+
var form = layui.form,
|
45
|
+
layer = layui.layer,
|
46
|
+
table = layui.table,
|
47
|
+
request = layui.request,
|
48
|
+
laydate = layui.laydate,
|
49
|
+
$ = layui.$;
|
50
|
+
|
51
|
+
form.render();
|
52
|
+
|
53
|
+
laydate.render({
|
54
|
+
elem: '#edit_month_plan',
|
55
|
+
type: 'month'
|
56
|
+
});
|
57
|
+
form.on('submit(update_sale_plan)', function (data) {
|
58
|
+
console.log(data.field);
|
59
|
+
request.authPut("educode_sales/operation_plans/"+ <%= @sale_plan.id %> , data.field, function (res) {
|
60
|
+
if (res.success == false) {
|
61
|
+
layer.alert(res.msg)
|
62
|
+
} else {
|
63
|
+
layer.close(parent.indexOfmonthPlan)
|
64
|
+
layer.close(parent.indexOfmonthly)
|
65
|
+
table.reload('monthPlanTable')
|
66
|
+
table.reload("newMonthlyTable")
|
67
|
+
}
|
68
|
+
})
|
69
|
+
return false;
|
70
|
+
});
|
71
|
+
});
|
72
|
+
</script>
|
@@ -3,70 +3,80 @@
|
|
3
3
|
<div class="layui-inline">
|
4
4
|
<label class="layui-form-label">月份</label>
|
5
5
|
<div class="layui-input-inline">
|
6
|
-
<
|
7
|
-
|
8
|
-
<option value="010">北京</option>
|
9
|
-
<option value="021">上海</option>
|
10
|
-
<option value="0571">杭州</option>
|
11
|
-
</select>
|
6
|
+
<input type="text" class="layui-input" id="edit_week_plan" autocomplete="off" name="month" placeholder="请选择" value="<%=@sale_plan.month.strftime("%Y-%m") %>">
|
7
|
+
<%#= select_tag "month", options_for_select(@months, @sale_plan.month.strftime("%Y-%m")), class: 'required' %>
|
12
8
|
</div>
|
13
9
|
</div>
|
10
|
+
<% if @sale_plan.weekly.present? %>
|
14
11
|
<div class="layui-inline">
|
15
12
|
<label class="layui-form-label">周次</label>
|
16
13
|
<div class="layui-input-inline">
|
17
|
-
|
18
|
-
<option value="">请选择周</option>
|
19
|
-
<option value="010">北京</option>
|
20
|
-
<option value="021">上海</option>
|
21
|
-
<option value="0571">杭州</option>
|
22
|
-
<option value="2021-33周">2021-33周</option>
|
23
|
-
</select>
|
14
|
+
<%= select_tag "weekly", options_for_select(@weeks, @sale_plan.weekly), class: 'required' %>
|
24
15
|
</div>
|
25
16
|
</div>
|
17
|
+
<% end %>
|
18
|
+
|
26
19
|
<div class="layui-inline">
|
27
20
|
<label class="layui-form-label">教师</label>
|
28
21
|
<div class="layui-input-inline">
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
<option value="021">上海</option>
|
33
|
-
<option value="0571">杭州</option>
|
34
|
-
<option value="人工智能实验室建设">人工智能实验室建设</option>
|
35
|
-
</select>
|
22
|
+
<%#= select_tag "teacher_id", options_for_select(@teachers, @sale_plan.teacher_id), class: 'required' %>
|
23
|
+
<%= select_tag "teacher_id", options_for_select(@teachers), class: 'required' %>
|
24
|
+
|
36
25
|
</div>
|
37
26
|
</div>
|
38
27
|
<div class="layui-form-item layui-form-text">
|
39
28
|
<label class="layui-form-label">计划内容</label>
|
40
29
|
<div class="layui-input-block">
|
41
|
-
<textarea name="
|
30
|
+
<textarea name="content" placeholder="简要填写具体的营销计划,例如:
|
42
31
|
1、推动xx老师用起来;
|
43
32
|
2、与xx老师介绍一下我们的方案;
|
44
|
-
3、与xx领导深度沟通一下,以获取到关键建设规划信息等等。" class="layui-textarea"
|
33
|
+
3、与xx领导深度沟通一下,以获取到关键建设规划信息等等。" class="layui-textarea"><%= @sale_plan.content %></textarea>
|
45
34
|
</div>
|
46
35
|
</div>
|
47
36
|
<div class="layui-inline">
|
48
37
|
<label class="layui-form-label">完成率</label>
|
49
38
|
<div class="layui-input-inline">
|
50
|
-
|
51
|
-
<option value="0%">0%</option>
|
52
|
-
<option value="10%">10%</option>
|
53
|
-
<option value="20%">20%</option>
|
54
|
-
<option value="30%">30%</option>
|
55
|
-
<option value="40%">40%</option>
|
56
|
-
<option value="50%">50%</option>
|
57
|
-
<option value="60%">60%</option>
|
58
|
-
<option value="70%">70%</option>
|
59
|
-
<option value="80%">80%</option>
|
60
|
-
<option value="90%">90%</option>
|
61
|
-
<option value="100%">100%</option>
|
62
|
-
</select>
|
39
|
+
<%= select_tag "finish_rate", options_for_select(@finish_rates, @sale_plan.finish_rate) %>
|
63
40
|
</div>
|
64
41
|
</div>
|
65
42
|
<div class="layui-inline">
|
66
|
-
<button type="submit" class="layui-btn layui-btn-normal" lay-submit lay-filter="
|
67
|
-
</button>
|
68
|
-
<button type="submit" class="layui-btn layui-btn-primary" lay-submit lay-filter="data-search-btn">取消
|
43
|
+
<button type="submit" class="layui-btn layui-btn-normal" lay-submit lay-filter="update_sale_plan">提交
|
69
44
|
</button>
|
70
45
|
</div>
|
71
46
|
</div>
|
72
|
-
</form>
|
47
|
+
</form>
|
48
|
+
|
49
|
+
|
50
|
+
<script>
|
51
|
+
layui.use(['form', 'table', 'laytpl', 'request'], function () {
|
52
|
+
var form = layui.form,
|
53
|
+
layer = layui.layer,
|
54
|
+
table = layui.table,
|
55
|
+
request = layui.request,
|
56
|
+
laydate = layui.laydate,
|
57
|
+
$ = layui.$;
|
58
|
+
|
59
|
+
form.render();
|
60
|
+
|
61
|
+
laydate.render({
|
62
|
+
elem: '#edit_week_plan',
|
63
|
+
type: 'month'
|
64
|
+
});
|
65
|
+
|
66
|
+
form.on('submit(update_sale_plan)', function (data) {
|
67
|
+
console.log(data.field);
|
68
|
+
request.authPut("educode_sales/operation_plans/"+ <%= @sale_plan.id %> , data.field, function (res) {
|
69
|
+
if (res.success == false) {
|
70
|
+
layer.alert(res.msg)
|
71
|
+
} else {
|
72
|
+
layer.close(parent.index10)
|
73
|
+
layer.close(parent.editWeek_index)
|
74
|
+
table.reload('weekPlanTable1')
|
75
|
+
table.reload('newWeeklyTable')
|
76
|
+
table.reload('unfinish_table')
|
77
|
+
}
|
78
|
+
})
|
79
|
+
return false;
|
80
|
+
});
|
81
|
+
});
|
82
|
+
</script>
|
@@ -1,9 +1,9 @@
|
|
1
|
-
<div class="layui-tab">
|
1
|
+
<div class="layui-tab" lay-filter="operation_tab">
|
2
2
|
<ul class="layui-tab-title">
|
3
|
-
<li class="layui-this">周计划</li>
|
4
|
-
<li>周报</li>
|
5
|
-
<li>月计划</li>
|
6
|
-
<li>月报</li>
|
3
|
+
<li class="layui-this" data="week">周计划</li>
|
4
|
+
<li data="weekly">周报</li>
|
5
|
+
<li data="month">月计划</li>
|
6
|
+
<li data="monthly">月报</li>
|
7
7
|
</ul>
|
8
8
|
<div class="layui-tab-content">
|
9
9
|
<div class="layui-tab-item layui-show">
|
@@ -20,3 +20,33 @@
|
|
20
20
|
</div>
|
21
21
|
</div>
|
22
22
|
</div>
|
23
|
+
<script>
|
24
|
+
layui.use(['element', 'table', 'jquery'], function () {
|
25
|
+
var $ = layui.jquery,
|
26
|
+
table = layui.table,
|
27
|
+
element = layui.element;
|
28
|
+
element.on('tab(operation_tab)', function (data) {
|
29
|
+
var status = $(this).attr('data')
|
30
|
+
switch (status) {
|
31
|
+
case 'week':
|
32
|
+
$("#o_week_table_wraper .layui-table-fixed-r")[0].classList.remove('layui-hide');
|
33
|
+
$("#o_week_table_wraper .layui-table-fixed-r .layui-table-body")[0].style.height = "auto";
|
34
|
+
break;
|
35
|
+
case 'weekly':
|
36
|
+
$("#o_sales_weelky_table .layui-table-fixed-r")[0].classList.remove('layui-hide');
|
37
|
+
$("#o_sales_weelky_table .layui-table-fixed-r .layui-table-body")[0].style.height = "auto";
|
38
|
+
break;;
|
39
|
+
case 'monthly':
|
40
|
+
$("#o_monthly_table_wraper .layui-table-fixed-r")[0].classList.remove('layui-hide');
|
41
|
+
$("#o_monthly_table_wraper .layui-table-fixed-r .layui-table-body")[0].style.height = "auto";
|
42
|
+
break;
|
43
|
+
case 'month':
|
44
|
+
$("#o_month_table_wraper .layui-table-fixed-r")[0].classList.remove('layui-hide');
|
45
|
+
$("#o_month_table_wraper .layui-table-fixed-r .layui-table-body")[0].style.height = "auto";
|
46
|
+
break;
|
47
|
+
}
|
48
|
+
|
49
|
+
|
50
|
+
})
|
51
|
+
})
|
52
|
+
</script>
|
@@ -0,0 +1,19 @@
|
|
1
|
+
json.data do
|
2
|
+
json.array! @sale_plans do |d|
|
3
|
+
json.id d.id
|
4
|
+
json.staff d.staff.user.real_name
|
5
|
+
json.teacher_name d.teacher.name
|
6
|
+
json.department d.teacher.department&.name
|
7
|
+
json.school d.teacher.department&.school&.name
|
8
|
+
json.month d.month.strftime("%Y-%m")
|
9
|
+
json.week d.weekly
|
10
|
+
json.teacher_id d.teacher_id
|
11
|
+
json.content d.content.truncate(30)
|
12
|
+
json.count d.teacher.teacher_follows_count
|
13
|
+
json.rate "#{d.finish_rate}%"
|
14
|
+
json.updated_at d.updated_at.to_s
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
json.code 0
|
19
|
+
json.count @sale_plans.count
|
@@ -0,0 +1,18 @@
|
|
1
|
+
json.data do
|
2
|
+
json.array! @sale_plans do |d|
|
3
|
+
json.id d.id
|
4
|
+
json.staff d.staff.user.real_name
|
5
|
+
json.teacher_name d.teacher.name
|
6
|
+
json.department d.teacher.department&.name
|
7
|
+
json.school d.teacher.department&.school&.name
|
8
|
+
json.month d.month.strftime("%Y-%m")
|
9
|
+
json.teacher_id d.teacher_id
|
10
|
+
json.content d.content.truncate(30)
|
11
|
+
json.count d.teacher.teacher_follows_count
|
12
|
+
json.rate "#{d.finish_rate}%"
|
13
|
+
json.updated_at d.updated_at.to_s
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
json.code 0
|
18
|
+
json.count @sale_plans.count
|
@@ -0,0 +1,19 @@
|
|
1
|
+
json.data do
|
2
|
+
json.array! @sale_plans do |d|
|
3
|
+
json.id d.id
|
4
|
+
json.staff d.staff.user.real_name
|
5
|
+
json.teacher_name d.teacher.name
|
6
|
+
json.department d.teacher.department&.name
|
7
|
+
json.school d.teacher.department&.school&.name
|
8
|
+
json.month d.month.strftime("%Y-%m")
|
9
|
+
json.week d.weekly
|
10
|
+
json.teacher_id d.teacher_id
|
11
|
+
json.content d.content.truncate(30)
|
12
|
+
json.count d.teacher.teacher_follows_count
|
13
|
+
json.rate "#{d.finish_rate}%"
|
14
|
+
json.updated_at d.updated_at.to_s
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
json.code 0
|
19
|
+
json.count @sale_plans.count
|
@@ -3,13 +3,13 @@
|
|
3
3
|
<div class="layui-inline">
|
4
4
|
<label class="layui-form-label required">月份</label>
|
5
5
|
<div class="layui-input-inline">
|
6
|
-
|
6
|
+
<input type="text" class="layui-input" id="new_month_plan" autocomplete="off" name="month" placeholder="请选择">
|
7
7
|
</div>
|
8
8
|
</div>
|
9
9
|
<div class="layui-inline">
|
10
10
|
<label class="layui-form-label required">教师</label>
|
11
11
|
<div class="layui-input-inline">
|
12
|
-
|
12
|
+
<%= select_tag "teacher_id", options_for_select(@teachers), {"lay-verify": "required", include_blank: true} %>
|
13
13
|
</div>
|
14
14
|
</div>
|
15
15
|
<div class="layui-form-item layui-form-text">
|
@@ -24,7 +24,7 @@
|
|
24
24
|
<div class="layui-inline">
|
25
25
|
<label class="layui-form-label">完成率</label>
|
26
26
|
<div class="layui-input-inline">
|
27
|
-
<select name="
|
27
|
+
<select name="finish_rate">
|
28
28
|
<option value="0">0%</option>
|
29
29
|
<option value="10">10%</option>
|
30
30
|
<option value="20">20%</option>
|
@@ -52,10 +52,16 @@
|
|
52
52
|
layer = layui.layer,
|
53
53
|
table = layui.table,
|
54
54
|
request = layui.request,
|
55
|
+
laydate = layui.laydate,
|
55
56
|
$ = layui.$;
|
56
57
|
|
57
58
|
form.render();
|
58
59
|
|
60
|
+
laydate.render({
|
61
|
+
elem: '#new_month_plan',
|
62
|
+
type: 'month'
|
63
|
+
});
|
64
|
+
|
59
65
|
var parentIndex = layer.index;
|
60
66
|
|
61
67
|
form.on('submit(add_month_plan)', function (data) {
|
@@ -63,17 +69,14 @@
|
|
63
69
|
if (res.success == false) {
|
64
70
|
layer.alert(res.msg)
|
65
71
|
} else {
|
66
|
-
layer.close(parent.
|
67
|
-
|
68
|
-
|
72
|
+
layer.close(parent.new_monthly_index)
|
73
|
+
layer.close(parent.monthPlanIndex)
|
74
|
+
table.reload('monthPlanTable')
|
75
|
+
table.reload("newMonthlyTable")
|
69
76
|
}
|
70
77
|
})
|
71
78
|
return false;
|
72
79
|
});
|
73
80
|
|
74
|
-
form.on('submit(cancel_add_week)', function (data) {
|
75
|
-
layer.closeAll();
|
76
|
-
return false;
|
77
|
-
});
|
78
81
|
});
|
79
82
|
</script>
|
@@ -8,56 +8,34 @@
|
|
8
8
|
<div class="layui-form-item">
|
9
9
|
<div class="layui-inline" style="margin:18px; font-weight: bold">
|
10
10
|
<label>完成率:</label>
|
11
|
-
<span
|
11
|
+
<span><%= @rate %></span>
|
12
|
+
<%= hidden_field_tag 'finish_rate', @rate, {id: 'monthly_rate_hide'} %>
|
12
13
|
</div>
|
13
14
|
<div class="layui-inline" style="margin:18px; font-weight: bold">
|
14
15
|
<label style="margin-left: 100px">运营教师:</label>
|
15
|
-
<span
|
16
|
+
<span><%= @departments_count%></span>
|
17
|
+
<%= hidden_field_tag 'client', @departments_count, {id: 'monthly_client_hide'} %>
|
16
18
|
</div>
|
17
19
|
</div>
|
18
20
|
<div class="layui-form-item" style="margin-left: 18px">
|
19
21
|
<div class="layui-form-item layui-form-text">
|
20
22
|
<label class="layui-form-label">个人总结</label>
|
21
23
|
<div class="layui-input-block">
|
22
|
-
<textarea name="
|
24
|
+
<textarea name="content" placeholder="此处填写要点:
|
23
25
|
1、一句话概括本周工作的主要成效和主要挫折;
|
24
26
|
2、补充说明收获、经验;
|
25
27
|
3、补充说明需要上级解决的问题和挑战。" class="layui-textarea"></textarea>
|
26
28
|
</div>
|
27
29
|
</div>
|
28
|
-
<div class="layui-form-item layui-form-text">
|
29
|
-
<label class="layui-form-label">大区意见</label>
|
30
|
-
<div class="layui-input-block">
|
31
|
-
<textarea name="desc" placeholder="给出评价、提醒、建议、办法等。" class="layui-textarea"></textarea>
|
32
|
-
</div>
|
33
|
-
</div>
|
34
|
-
<div id="weekStar4"></div>
|
35
|
-
<div class="layui-form-item layui-form-text">
|
36
|
-
<label class="layui-form-label">总监意见</label>
|
37
|
-
<div class="layui-input-block">
|
38
|
-
<textarea name="desc" placeholder="给出评价、提醒、建议、办法等。" class="layui-textarea"></textarea>
|
39
|
-
</div>
|
40
|
-
</div>
|
41
|
-
<div id="weekStar5"></div>
|
42
|
-
<div class="layui-form-item layui-form-text">
|
43
|
-
<label class="layui-form-label">副总意见</label>
|
44
|
-
<div class="layui-input-block">
|
45
|
-
<textarea name="desc" placeholder="给出评价、提醒、建议、办法等。" class="layui-textarea"></textarea>
|
46
|
-
</div>
|
47
|
-
</div>
|
48
|
-
<div id="weekStar6"></div>
|
49
|
-
<br>
|
50
30
|
<div class="layui-inline">
|
51
|
-
<button type="submit" class="layui-btn layui-btn-normal" lay-submit lay-filter="
|
52
|
-
</button>
|
53
|
-
<button type="submit" class="layui-btn layui-btn-primary" lay-submit lay-filter="data-search-btn">取消
|
31
|
+
<button type="submit" class="layui-btn layui-btn-normal" lay-submit lay-filter="add_monthly_report" style="margin-left: 18px">提交
|
54
32
|
</button>
|
55
33
|
</div>
|
56
34
|
</div>
|
57
35
|
</form>
|
58
36
|
|
59
37
|
<!--表格-->
|
60
|
-
<table class="layui-hide" id="newMonthlyTable" lay-filter="
|
38
|
+
<table class="layui-hide" id="newMonthlyTable" lay-filter="newMonthlyToolbar"></table>
|
61
39
|
|
62
40
|
<script type="text/html" id="currentMonthly">
|
63
41
|
<a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="show">查看</a>
|
@@ -65,28 +43,38 @@
|
|
65
43
|
<a class="layui-btn layui-btn-xs layui-btn-danger data-count-delete" lay-event="delete">删除</a>
|
66
44
|
</script>
|
67
45
|
|
46
|
+
<script type="text/html" id="show_follow_newMonthly">
|
47
|
+
<a href="javascript:void(0);" lay-event="show_follow_newMonthly" class="layui-table-link">{{ d.count }}</a>
|
48
|
+
</script>
|
49
|
+
|
50
|
+
|
68
51
|
<script>
|
69
52
|
layui.use(['rate', 'table'], function () {
|
70
|
-
var rate = layui.rate
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
53
|
+
var rate = layui.rate,
|
54
|
+
form = layui.form,
|
55
|
+
$ = layui.jquery,
|
56
|
+
miniPage = layui.miniPage,
|
57
|
+
request = layui.request;
|
58
|
+
table = layui.table;
|
59
|
+
|
60
|
+
form.on('submit(add_monthly_report)', function (data) {
|
61
|
+
data.field.month = true;
|
62
|
+
request.authPost("educode_sales/operation_reports", data.field, function (res) {
|
63
|
+
if (res.success == false) {
|
64
|
+
layer.alert(res.msg)
|
65
|
+
} else {
|
66
|
+
layer.closeAll();
|
67
|
+
parent.table.reload('monthlyTable');
|
68
|
+
layer.alert('添加成功')
|
69
|
+
}
|
70
|
+
})
|
71
|
+
return false;
|
72
|
+
});
|
85
73
|
|
86
74
|
|
87
75
|
table.render({
|
88
76
|
elem: '#newMonthlyTable',
|
89
|
-
|
77
|
+
url: '/educode_sales/operation_plans/my_month',
|
90
78
|
toolbar: '#newMonthlyToolbar',
|
91
79
|
defaultToolbar: [],
|
92
80
|
cols: [
|
@@ -97,39 +85,35 @@
|
|
97
85
|
title: '序号'
|
98
86
|
},
|
99
87
|
{
|
100
|
-
field: '
|
88
|
+
field: 'staff',
|
101
89
|
width: 100,
|
102
90
|
title: '姓名'
|
103
91
|
},
|
104
92
|
{
|
105
|
-
field: '
|
93
|
+
field: 'teacher_name',
|
106
94
|
width: 100,
|
107
95
|
title: '教师姓名',
|
108
96
|
},
|
109
97
|
{
|
110
|
-
field: '
|
111
|
-
width:
|
98
|
+
field: 'school',
|
99
|
+
width: 190,
|
112
100
|
title: '单位'
|
113
101
|
},
|
114
102
|
{
|
115
|
-
field: '
|
116
|
-
width:
|
103
|
+
field: 'department',
|
104
|
+
width: 190,
|
117
105
|
title: '部门'
|
118
106
|
},
|
119
107
|
{
|
120
|
-
field: '
|
121
|
-
width:
|
122
|
-
title: '周次',
|
123
|
-
},
|
124
|
-
{
|
125
|
-
field: 'plan',
|
126
|
-
width: 300,
|
108
|
+
field: 'content',
|
109
|
+
width: 400,
|
127
110
|
title: '计划内容',
|
128
111
|
},
|
129
112
|
{
|
130
|
-
field: '
|
113
|
+
field: 'count',
|
131
114
|
width: 100,
|
132
115
|
title: '跟进',
|
116
|
+
templet: '#show_follow_newMonthly'
|
133
117
|
},
|
134
118
|
{
|
135
119
|
field: 'rate',
|
@@ -137,7 +121,7 @@
|
|
137
121
|
title: '完成率',
|
138
122
|
},
|
139
123
|
{
|
140
|
-
field: '
|
124
|
+
field: 'updated_at',
|
141
125
|
width: 150,
|
142
126
|
title: '更新时间',
|
143
127
|
sort: true,
|
@@ -150,24 +134,130 @@
|
|
150
134
|
}
|
151
135
|
]
|
152
136
|
],
|
153
|
-
data: [{
|
154
|
-
"id": "1",
|
155
|
-
"username": "丁亚莲",
|
156
|
-
"chance": "人工智能实验室建设",
|
157
|
-
"company": "中南大学",
|
158
|
-
"dep": "计算机学院",
|
159
|
-
"week": "2021-33周",
|
160
|
-
"plan": "对接决策人",
|
161
|
-
"follow": "120",
|
162
|
-
"rate": "100%",
|
163
|
-
"updateTime": "2021-07-27",
|
164
|
-
}],
|
165
137
|
limits: [10, 15, 20, 25, 50, 100],
|
166
138
|
limit: 15,
|
167
139
|
page: true,
|
168
140
|
skin: 'line'
|
169
141
|
});
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
/**
|
147
|
+
* toolbar事件监听
|
148
|
+
*/
|
149
|
+
table.on('toolbar(newMonthlyToolbar)', function (obj) {
|
150
|
+
if (obj.event === 'add') { // 监听添加操作
|
151
|
+
var content = miniPage.getHrefContent('/educode_sales/operation_plans/new_month');
|
152
|
+
var openWH = miniPage.getOpenWidthHeight();
|
153
|
+
new_monthly_index = layer.open({
|
154
|
+
title: '添加计划',
|
155
|
+
type: 1,
|
156
|
+
shade: 0.2,
|
157
|
+
maxmin: true,
|
158
|
+
shadeClose: true,
|
159
|
+
area: [openWH[0] + 'px', openWH[1] + 'px'],
|
160
|
+
offset: [openWH[2] + 'px', openWH[3] + 'px'],
|
161
|
+
content: content,
|
162
|
+
success: function (layero, index) {
|
163
|
+
// 重新渲染弹层中的下拉选择框select
|
164
|
+
form.render('select');
|
165
|
+
}
|
166
|
+
});
|
167
|
+
$(window).on("resize", function () {
|
168
|
+
layer.full(index);
|
169
|
+
});
|
170
|
+
}
|
171
|
+
});
|
172
|
+
|
173
|
+
|
174
|
+
table.on('tool(newMonthlyToolbar)', function (obj) {
|
175
|
+
var data = obj.data;
|
176
|
+
if (obj.event === 'delete') {
|
177
|
+
layer.confirm('确定删除' + data.id, function (index) {
|
178
|
+
console.log("aaaaa");
|
179
|
+
request.delete('educode_sales/operation_plans/' + data.id, {}, function (res) {
|
180
|
+
layer.close(index);
|
181
|
+
table.reload("newMonthlyTable")
|
182
|
+
})
|
183
|
+
});
|
184
|
+
}
|
185
|
+
else if (obj.event === 'show') {
|
186
|
+
content = miniPage.getHrefContent('/educode_sales/operation_plans/show_week?id='+ data.id);
|
187
|
+
openWH = miniPage.getOpenWidthHeight();
|
188
|
+
index = layer.open({
|
189
|
+
title: '查看',
|
190
|
+
type: 1,
|
191
|
+
shade: 0.2,
|
192
|
+
maxmin: true,
|
193
|
+
shadeClose: true,
|
194
|
+
area: [openWH[0] + 'px', openWH[1] + 'px'],
|
195
|
+
offset: [openWH[2] + 'px', openWH[3] + 'px'],
|
196
|
+
content: content,
|
197
|
+
success: function (layero, index) {
|
198
|
+
form.render('select');
|
199
|
+
},
|
200
|
+
});
|
201
|
+
$(window).on("resize", function () {
|
202
|
+
layer.full(index);
|
203
|
+
});
|
204
|
+
return false;
|
205
|
+
} else if (obj.event === 'edit') {
|
206
|
+
content = miniPage.getHrefContent('/educode_sales/operation_plans/edit_month?id='+data.id);
|
207
|
+
openWH = miniPage.getOpenWidthHeight();
|
208
|
+
indexOfmonthly = layer.open({
|
209
|
+
title: '编辑',
|
210
|
+
type: 1,
|
211
|
+
shade: 0.2,
|
212
|
+
maxmin: true,
|
213
|
+
shadeClose: true,
|
214
|
+
area: [openWH[0] + 'px', openWH[1] + 'px'],
|
215
|
+
offset: [openWH[2] + 'px', openWH[3] + 'px'],
|
216
|
+
content: content,
|
217
|
+
success: function (layero, index) {
|
218
|
+
form.render('select');
|
219
|
+
},
|
220
|
+
});
|
221
|
+
$(window).on("resize", function () {
|
222
|
+
layer.full(index);
|
223
|
+
});
|
224
|
+
return false;
|
225
|
+
}else if (obj.event === 'show_follow_newMonthly') {
|
226
|
+
id = data.teacher_id
|
227
|
+
content = miniPage.getHrefContent('/educode_sales/teachers/show_follow?id=' + data.teacher_id);
|
228
|
+
openWH = miniPage.getOpenWidthHeight();
|
229
|
+
index = layer.open({
|
230
|
+
title: data.teacher_name + '/跟进记录',
|
231
|
+
type: 1,
|
232
|
+
shade: 0.2,
|
233
|
+
maxmin: true,
|
234
|
+
shadeClose: true,
|
235
|
+
area: [openWH[0] + 'px', openWH[1] + 'px'],
|
236
|
+
offset: [openWH[2] + 'px', openWH[3] + 'px'],
|
237
|
+
content: content,
|
238
|
+
success: function (layero, index) {
|
239
|
+
// 重新渲染弹层中的下拉选择框select
|
240
|
+
// form.render('select');
|
241
|
+
}
|
242
|
+
});
|
243
|
+
$(window).on("resize", function () {
|
244
|
+
layer.full(index);
|
245
|
+
});
|
246
|
+
}
|
247
|
+
});
|
248
|
+
|
249
|
+
|
250
|
+
|
251
|
+
|
252
|
+
|
253
|
+
|
254
|
+
|
255
|
+
|
256
|
+
|
257
|
+
|
258
|
+
})
|
170
259
|
</script>
|
260
|
+
|
171
261
|
<style>
|
172
262
|
.layui-form-item {
|
173
263
|
margin-bottom: 0px;
|