educode_sales 0.1.0 → 0.1.1
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/activities_controller.rb +7 -1
- data/app/controllers/educode_sales/application_controller.rb +0 -1
- data/app/controllers/educode_sales/businesses_controller.rb +3 -2
- 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 +1 -0
- data/app/controllers/educode_sales/plans_controller.rb +3 -1
- data/app/controllers/educode_sales/sale_reports_controller.rb +2 -1
- data/app/controllers/educode_sales/sales_controller.rb +4 -1
- data/app/controllers/educode_sales/teacher_follows_controller.rb +6 -0
- data/app/controllers/educode_sales/teachers_controller.rb +17 -5
- data/app/models/ability.rb +4 -1
- data/app/models/educode_sales/common.rb +1 -0
- data/app/models/educode_sales/staff.rb +2 -0
- data/app/views/educode_sales/activities/index.html.erb +17 -8
- data/app/views/educode_sales/businesses/index.html.erb +136 -140
- data/app/views/educode_sales/businesses/show_follow.html.erb +18 -3
- data/app/views/educode_sales/operation_plans/_monthPlan.html.erb +60 -76
- data/app/views/educode_sales/operation_plans/_monthly.html.erb +116 -95
- data/app/views/educode_sales/operation_plans/_weekPlan.html.erb +73 -74
- data/app/views/educode_sales/operation_plans/_weekly.html.erb +108 -86
- data/app/views/educode_sales/operation_plans/edit_month.html.erb +35 -32
- data/app/views/educode_sales/operation_plans/edit_week.html.erb +40 -39
- 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 +5 -10
- data/app/views/educode_sales/operation_plans/new_monthly.html.erb +27 -43
- data/app/views/educode_sales/operation_plans/new_week.html.erb +7 -7
- data/app/views/educode_sales/operation_plans/new_weekly.html.erb +46 -53
- 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 +237 -0
- data/app/views/educode_sales/operation_reports/index.json.jbuilder +17 -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/plans/_monthPlan.html.erb +8 -0
- data/app/views/educode_sales/plans/_monthly.html.erb +8 -0
- data/app/views/educode_sales/plans/_weekPlan.html.erb +10 -3
- data/app/views/educode_sales/plans/_weekly.html.erb +8 -0
- 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_weekly.html.erb +8 -0
- data/app/views/educode_sales/plans/new_monthly.html.erb +8 -0
- data/app/views/educode_sales/plans/new_weekly.html.erb +7 -1
- data/app/views/educode_sales/sale_trends/trends.html.erb +8 -0
- data/app/views/educode_sales/teachers/index.html.erb +3 -5
- data/app/views/layouts/educode_sales/application.html.erb +23 -2
- data/config/routes.rb +11 -4
- data/lib/educode_sales/version.rb +1 -1
- metadata +14 -5
@@ -5,54 +5,38 @@
|
|
5
5
|
</div>
|
6
6
|
</script>
|
7
7
|
<!--搜索-->
|
8
|
-
<
|
8
|
+
<div class="layuimini-main edit-table" id="week_table_wraper">
|
9
|
+
<div class="layui-form layui-form-pane edit-table" lay-filter="week_plan_form_filter">
|
9
10
|
<div class="layui-form-item">
|
10
11
|
<div class="layui-inline">
|
11
12
|
<label class="layui-form-label">人员</label>
|
12
13
|
<div class="layui-input-inline">
|
13
|
-
|
14
|
-
<option value="">请选择</option>
|
15
|
-
<option value="010">A类</option>
|
16
|
-
<option value="021">B类</option>
|
17
|
-
<option value="0571">C类</option>
|
18
|
-
<option value="0572">D类</option>
|
19
|
-
</select>
|
14
|
+
<%= select_tag "staff_id", options_for_select(@staffs), {'lay-filter': 'staff_id', include_blank: true} %>
|
20
15
|
</div>
|
21
16
|
</div>
|
22
17
|
<div class="layui-inline">
|
23
18
|
<label class="layui-form-label">年度</label>
|
24
19
|
<div class="layui-input-inline">
|
25
|
-
<
|
26
|
-
<option value="">请选择</option>
|
27
|
-
<option value="010">北京</option>
|
28
|
-
<option value="021">上海</option>
|
29
|
-
<option value="0571">杭州</option>
|
30
|
-
</select>
|
20
|
+
<input type="text" class="layui-input" id="week_plan_year" autocomplete="off" name="year">
|
31
21
|
</div>
|
32
22
|
</div>
|
33
23
|
<div class="layui-inline">
|
34
24
|
<label class="layui-form-label">月份</label>
|
35
25
|
<div class="layui-input-inline">
|
36
|
-
<
|
37
|
-
<option value="">请选择</option>
|
38
|
-
<option value="010">北京</option>
|
39
|
-
<option value="021">上海</option>
|
40
|
-
<option value="0571">杭州</option>
|
41
|
-
</select>
|
26
|
+
<input type="text" class="layui-input" id="week_plan_month" autocomplete="off" name="month">
|
42
27
|
</div>
|
43
28
|
</div>
|
44
29
|
<div class="layui-inline">
|
45
|
-
<button type="submit" class="layui-btn layui-btn-primary" lay-submit lay-filter="
|
30
|
+
<button type="submit" class="layui-btn layui-btn-primary" lay-submit lay-filter="week_plan_reset">重置
|
46
31
|
</button>
|
47
|
-
<button type="submit" class="layui-btn layui-btn-primary" lay-submit lay-filter="
|
32
|
+
<button type="submit" class="layui-btn layui-btn-primary" lay-submit lay-filter="week_plan_search">检索
|
48
33
|
</button>
|
49
34
|
</div>
|
50
35
|
</div>
|
51
|
-
</
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
<script type="text/html" id="currentTableBar">
|
36
|
+
</div>
|
37
|
+
<table class="layui-hide" id="weekPlanTable" lay-filter="weekPlanTable"></table>
|
38
|
+
</div>
|
39
|
+
<script type="text/html" id="week_plan_currentTableBar">
|
56
40
|
<a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="show">查看</a>
|
57
41
|
<a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="edit">编辑</a>
|
58
42
|
<a class="layui-btn layui-btn-xs layui-btn-danger data-count-delete" lay-event="delete">删除</a>
|
@@ -66,12 +50,25 @@
|
|
66
50
|
layui.use(['form', 'table', 'miniPage', 'element'], function () {
|
67
51
|
var $ = layui.jquery,
|
68
52
|
form = layui.form,
|
53
|
+
laydate = layui.laydate,
|
69
54
|
table = layui.table,
|
55
|
+
request = layui.request,
|
70
56
|
miniPage = layui.miniPage;
|
71
57
|
|
58
|
+
|
59
|
+
laydate.render({
|
60
|
+
elem: '#week_plan_year',
|
61
|
+
type: 'year'
|
62
|
+
});
|
63
|
+
laydate.render({
|
64
|
+
elem: '#week_plan_month',
|
65
|
+
type: 'month'
|
66
|
+
});
|
67
|
+
|
68
|
+
|
72
69
|
table.render({
|
73
70
|
elem: '#weekPlanTable',
|
74
|
-
|
71
|
+
url: '/educode_sales/operation_plans?clazz=week',
|
75
72
|
toolbar: '#weekPlanToolbar',
|
76
73
|
defaultToolbar: [],
|
77
74
|
cols: [
|
@@ -82,22 +79,22 @@
|
|
82
79
|
title: '序号'
|
83
80
|
},
|
84
81
|
{
|
85
|
-
field: '
|
82
|
+
field: 'staff',
|
86
83
|
width: 100,
|
87
84
|
title: '姓名'
|
88
85
|
},
|
89
86
|
{
|
90
|
-
field: '
|
87
|
+
field: 'teacher_name',
|
91
88
|
width: 100,
|
92
89
|
title: '教师姓名',
|
93
90
|
},
|
94
91
|
{
|
95
|
-
field: '
|
92
|
+
field: 'school',
|
96
93
|
width: 100,
|
97
94
|
title: '单位'
|
98
95
|
},
|
99
96
|
{
|
100
|
-
field: '
|
97
|
+
field: 'department',
|
101
98
|
width: 100,
|
102
99
|
title: '部门'
|
103
100
|
},
|
@@ -107,7 +104,7 @@
|
|
107
104
|
title: '周次',
|
108
105
|
},
|
109
106
|
{
|
110
|
-
field: '
|
107
|
+
field: 'content',
|
111
108
|
width: 300,
|
112
109
|
title: '计划内容',
|
113
110
|
},
|
@@ -123,7 +120,7 @@
|
|
123
120
|
title: '完成率',
|
124
121
|
},
|
125
122
|
{
|
126
|
-
field: '
|
123
|
+
field: 'updated_at',
|
127
124
|
width: 150,
|
128
125
|
title: '更新时间',
|
129
126
|
sort: true,
|
@@ -131,53 +128,54 @@
|
|
131
128
|
{
|
132
129
|
title: '操作',
|
133
130
|
minWidth: 280,
|
134
|
-
toolbar: '#
|
131
|
+
toolbar: '#week_plan_currentTableBar',
|
135
132
|
align: "center",
|
136
133
|
fixed: 'right'
|
137
134
|
}
|
138
135
|
]
|
139
136
|
],
|
140
|
-
data: [{
|
141
|
-
"id": "1",
|
142
|
-
"username": "丁亚莲",
|
143
|
-
"chance": "老王",
|
144
|
-
"company": "中南大学",
|
145
|
-
"dep": "计算机学院",
|
146
|
-
"week": "2021-33周",
|
147
|
-
"plan": "对接决策人",
|
148
|
-
"follow": "120",
|
149
|
-
"rate": "100%",
|
150
|
-
"updateTime": "2021-07-27",
|
151
|
-
}],
|
152
137
|
limits: [10, 15, 20, 25, 50, 100],
|
153
138
|
limit: 15,
|
154
139
|
page: true,
|
155
140
|
skin: 'line'
|
156
141
|
});
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
142
|
+
var sort = {}, search = {};
|
143
|
+
table.on('sort(weekPlanTable)', function(obj) {
|
144
|
+
sort.field = obj.field;
|
145
|
+
sort.order = obj.type;
|
146
|
+
table.reload('weekPlanTable', {
|
147
|
+
initSort: obj,
|
148
|
+
where: {
|
149
|
+
sort: sort,
|
150
|
+
q: search
|
151
|
+
}
|
162
152
|
});
|
153
|
+
})
|
163
154
|
|
164
|
-
|
165
|
-
|
155
|
+
// 监听搜索操作
|
156
|
+
form.on('submit(week_plan_search)', function (data) {
|
157
|
+
search = data.field
|
158
|
+
table.reload('weekPlanTable', {
|
166
159
|
page: {
|
167
160
|
curr: 1
|
168
161
|
},
|
169
|
-
where: {
|
170
|
-
searchParams: result
|
171
|
-
}
|
162
|
+
where: {q: search, sort : sort}
|
172
163
|
}, 'data');
|
173
164
|
|
174
165
|
return false;
|
175
166
|
});
|
176
167
|
|
168
|
+
form.on('submit(week_plan_reset)', function(data){
|
169
|
+
var field = data.field;
|
170
|
+
form.val('week_plan_form_filter', {staff_id: '', year: '', month: ''})
|
171
|
+
return false;
|
172
|
+
});
|
173
|
+
|
177
174
|
/**
|
178
175
|
* toolbar事件监听
|
179
176
|
*/
|
180
|
-
table.on('toolbar(
|
177
|
+
table.on('toolbar(weekPlanTable)', function (obj) {
|
178
|
+
var data = obj.data;
|
181
179
|
if (obj.event === 'add') { // 监听添加操作
|
182
180
|
var content = miniPage.getHrefContent('/educode_sales/operation_plans/new_week');
|
183
181
|
var openWH = miniPage.getOpenWidthHeight();
|
@@ -198,24 +196,25 @@
|
|
198
196
|
$(window).on("resize", function () {
|
199
197
|
layer.full(index);
|
200
198
|
});
|
201
|
-
} else if (obj.event === 'delete') { // 监听删除操作
|
202
|
-
var checkStatus = table.checkStatus('currentTableId'),
|
203
|
-
data = checkStatus.data;
|
204
|
-
layer.alert(JSON.stringify(data));
|
205
199
|
}
|
206
200
|
});
|
207
201
|
|
208
202
|
|
209
|
-
table.on('tool(
|
203
|
+
table.on('tool(weekPlanTable)', function (obj) {
|
210
204
|
var data = obj.data;
|
211
|
-
|
205
|
+
id = data.id
|
212
206
|
if (obj.event === 'delete') {
|
213
|
-
layer.confirm('
|
214
|
-
|
215
|
-
|
207
|
+
layer.confirm('确定删除' + data.id, function (index) {
|
208
|
+
console.log("aaaaa");
|
209
|
+
request.delete('educode_sales/operation_plans/' + data.id, {}, function (res) {
|
210
|
+
layer.close(index);
|
211
|
+
table.reload("weekPlanTable")
|
212
|
+
})
|
216
213
|
});
|
217
|
-
}
|
218
|
-
|
214
|
+
}
|
215
|
+
else if (obj.event === 'show') {
|
216
|
+
console.log("a");
|
217
|
+
content = miniPage.getHrefContent('/educode_sales/operation_plans/show_week?id='+id);
|
219
218
|
openWH = miniPage.getOpenWidthHeight();
|
220
219
|
index = layer.open({
|
221
220
|
title: '查看',
|
@@ -227,10 +226,10 @@
|
|
227
226
|
offset: [openWH[2] + 'px', openWH[3] + 'px'],
|
228
227
|
content: content,
|
229
228
|
success: function (layero, index) {
|
230
|
-
$("#show_chance1").val(data.chance);
|
231
|
-
$("#show_plan1").val(data.plan);
|
232
|
-
$("#show_rate1").val(data.rate);
|
233
|
-
$("#show_week1").val(data.week);
|
229
|
+
// $("#show_chance1").val(data.chance);
|
230
|
+
// $("#show_plan1").val(data.plan);
|
231
|
+
// $("#show_rate1").val(data.rate);
|
232
|
+
// $("#show_week1").val(data.week);
|
234
233
|
// 重新渲染弹层中的下拉选择框select
|
235
234
|
form.render('select');
|
236
235
|
},
|
@@ -240,7 +239,7 @@
|
|
240
239
|
});
|
241
240
|
return false;
|
242
241
|
} else if (obj.event === 'edit') {
|
243
|
-
content = miniPage.getHrefContent('/educode_sales/operation_plans/edit_week');
|
242
|
+
content = miniPage.getHrefContent('/educode_sales/operation_plans/edit_week?id='+id);
|
244
243
|
openWH = miniPage.getOpenWidthHeight();
|
245
244
|
index = layer.open({
|
246
245
|
title: '编辑',
|
@@ -5,46 +5,32 @@
|
|
5
5
|
</div>
|
6
6
|
</script>
|
7
7
|
<!--搜索-->
|
8
|
-
<
|
8
|
+
<div class="layuimini-main edit-table" id="sales_weelky_table">
|
9
|
+
|
10
|
+
<form class="layui-form layui-form-pane" lay-filter="weekly_plan_form_filter">
|
9
11
|
<div class="layui-form-item">
|
10
12
|
<div class="layui-inline">
|
11
13
|
<label class="layui-form-label">人员</label>
|
12
14
|
<div class="layui-input-inline">
|
13
|
-
|
14
|
-
<option value="">请选择</option>
|
15
|
-
<option value="010">A类</option>
|
16
|
-
<option value="021">B类</option>
|
17
|
-
<option value="0571">C类</option>
|
18
|
-
<option value="0572">D类</option>
|
19
|
-
</select>
|
15
|
+
<%= select_tag "staff_id", options_for_select(@staffs), {'lay-filter': 'staff_id', include_blank: true} %>
|
20
16
|
</div>
|
21
17
|
</div>
|
22
18
|
<div class="layui-inline">
|
23
19
|
<label class="layui-form-label">年度</label>
|
24
20
|
<div class="layui-input-inline">
|
25
|
-
<
|
26
|
-
<option value="">请选择</option>
|
27
|
-
<option value="010">北京</option>
|
28
|
-
<option value="021">上海</option>
|
29
|
-
<option value="0571">杭州</option>
|
30
|
-
</select>
|
21
|
+
<input type="text" class="layui-input" id="weekly_plan_year" autocomplete="off" name="year">
|
31
22
|
</div>
|
32
23
|
</div>
|
33
24
|
<div class="layui-inline">
|
34
25
|
<label class="layui-form-label">月份</label>
|
35
26
|
<div class="layui-input-inline">
|
36
|
-
<
|
37
|
-
<option value="">请选择</option>
|
38
|
-
<option value="010">北京</option>
|
39
|
-
<option value="021">上海</option>
|
40
|
-
<option value="0571">杭州</option>
|
41
|
-
</select>
|
27
|
+
<input type="text" class="layui-input" id="weekly_plan_month" autocomplete="off" name="month">
|
42
28
|
</div>
|
43
29
|
</div>
|
44
30
|
<div class="layui-inline">
|
45
|
-
<button type="submit" class="layui-btn layui-btn-primary" lay-submit lay-filter="
|
31
|
+
<button type="submit" class="layui-btn layui-btn-primary" lay-submit lay-filter="weekly_plan_reset">重置
|
46
32
|
</button>
|
47
|
-
<button type="submit" class="layui-btn layui-btn-primary" lay-submit lay-filter="
|
33
|
+
<button type="submit" class="layui-btn layui-btn-primary" lay-submit lay-filter="weekly_plan_search">检索
|
48
34
|
</button>
|
49
35
|
</div>
|
50
36
|
</div>
|
@@ -52,10 +38,13 @@
|
|
52
38
|
|
53
39
|
<!--表格-->
|
54
40
|
<table class="layui-hide" id="weeklyTable" lay-filter="currentTableFilter2"></table>
|
55
|
-
|
41
|
+
</div>
|
56
42
|
<script type="text/html" id="currentWeekTableBar">
|
57
43
|
<a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="show">查看</a>
|
58
44
|
<a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="edit">编辑</a>
|
45
|
+
<%# if can? :audit, EducodeSales::SaleReport %>
|
46
|
+
<a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="audit">审查</a>
|
47
|
+
<%# end %>
|
59
48
|
<a class="layui-btn layui-btn-xs layui-btn-danger data-count-delete" lay-event="delete">删除</a>
|
60
49
|
</script>
|
61
50
|
|
@@ -66,11 +55,22 @@
|
|
66
55
|
form = layui.form,
|
67
56
|
table = layui.table,
|
68
57
|
rate = layui.rate,
|
58
|
+
laydate = layui.laydate,
|
59
|
+
request = layui.request,
|
69
60
|
miniPage = layui.miniPage;
|
70
61
|
|
62
|
+
laydate.render({
|
63
|
+
elem: '#weekly_plan_year',
|
64
|
+
type: 'year'
|
65
|
+
});
|
66
|
+
laydate.render({
|
67
|
+
elem: '#weekly_plan_month',
|
68
|
+
type: 'month'
|
69
|
+
});
|
70
|
+
|
71
71
|
table.render({
|
72
72
|
elem: '#weeklyTable',
|
73
|
-
|
73
|
+
url: '/educode_sales/operation_reports?clazz=week',
|
74
74
|
toolbar: '#weeklyToolbar',
|
75
75
|
defaultToolbar: [],
|
76
76
|
cols: [
|
@@ -81,47 +81,47 @@
|
|
81
81
|
title: '序号'
|
82
82
|
},
|
83
83
|
{
|
84
|
-
field: '
|
84
|
+
field: 'staff',
|
85
85
|
width: 100,
|
86
86
|
title: '姓名'
|
87
87
|
},
|
88
88
|
{
|
89
|
-
field: '
|
89
|
+
field: 'finish_rate',
|
90
90
|
width: 100,
|
91
91
|
title: '完成率',
|
92
92
|
},
|
93
93
|
{
|
94
|
-
field: '
|
94
|
+
field: 'client',
|
95
95
|
width: 100,
|
96
96
|
title: '运营教师'
|
97
97
|
},
|
98
98
|
{
|
99
|
-
field: '
|
99
|
+
field: 'content',
|
100
100
|
width: 300,
|
101
101
|
title: '个人总结',
|
102
102
|
},
|
103
103
|
{
|
104
|
-
field: '
|
104
|
+
field: 'level1_score',
|
105
105
|
width: 180,
|
106
106
|
title: '大区',
|
107
107
|
templet: function (d) {
|
108
|
-
return '<div
|
108
|
+
return '<div class="star1"></div>'
|
109
109
|
}
|
110
110
|
},
|
111
111
|
{
|
112
|
-
field: '
|
112
|
+
field: 'level2_score',
|
113
113
|
width: 180,
|
114
114
|
title: '总监',
|
115
115
|
templet: function (d) {
|
116
|
-
return '<div
|
116
|
+
return '<div class="star2"></div>'
|
117
117
|
}
|
118
118
|
},
|
119
119
|
{
|
120
|
-
field: '
|
120
|
+
field: 'level3_score',
|
121
121
|
width: 180,
|
122
122
|
title: '副总',
|
123
123
|
templet: function (d) {
|
124
|
-
return '<div
|
124
|
+
return '<div class="star3"></div>'
|
125
125
|
}
|
126
126
|
},
|
127
127
|
{
|
@@ -133,64 +133,66 @@
|
|
133
133
|
}
|
134
134
|
]
|
135
135
|
], done: function (res) {
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
136
|
+
$("#sales_weelky_table .star1").each(function (i) {
|
137
|
+
rate.render({
|
138
|
+
elem: this,
|
139
|
+
value: res.data[i].level1_score,
|
140
|
+
half: true,
|
141
|
+
readonly: true
|
142
|
+
});
|
143
|
+
})
|
144
|
+
$("#sales_weelky_table .star2").each(function (i) {
|
145
|
+
rate.render({
|
146
|
+
elem: this,
|
147
|
+
value: res.data[i].level2_score,
|
148
|
+
half: true,
|
149
|
+
readonly: true
|
150
|
+
});
|
151
|
+
})
|
152
|
+
$("#sales_weelky_table .star3").each(function (i) {
|
153
|
+
rate.render({
|
154
|
+
elem: this,
|
155
|
+
value: res.data[i].level3_score,
|
156
|
+
half: true,
|
157
|
+
readonly: true
|
158
|
+
});
|
159
|
+
})
|
156
160
|
},
|
157
|
-
data: [{
|
158
|
-
"id": "1",
|
159
|
-
"username": "段小龙",
|
160
|
-
"rate": "90%",
|
161
|
-
"customer": "12",
|
162
|
-
"money": "128",
|
163
|
-
"sumUp": "院长当面汇报一次",
|
164
|
-
"area": "※",
|
165
|
-
"zong": "※",
|
166
|
-
"fu": "※",
|
167
|
-
}],
|
168
|
-
limits: [10, 15, 20, 25, 50, 100],
|
169
|
-
limit: 15,
|
170
161
|
page: true,
|
171
|
-
skin: 'line'
|
172
162
|
});
|
173
163
|
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
164
|
+
var sort = {}, search = {};
|
165
|
+
table.on('sort(weeklyTable)', function(obj) {
|
166
|
+
sort.field = obj.field;
|
167
|
+
sort.order = obj.type;
|
168
|
+
table.reload('weeklyTable', {
|
169
|
+
initSort: obj,
|
170
|
+
where: {
|
171
|
+
sort: sort,
|
172
|
+
q: search
|
173
|
+
}
|
179
174
|
});
|
175
|
+
})
|
180
176
|
|
181
|
-
|
182
|
-
|
177
|
+
// 监听搜索操作
|
178
|
+
form.on('submit(weekly_plan_search)', function (data) {
|
179
|
+
search = data.field
|
180
|
+
table.reload('weeklyTable', {
|
183
181
|
page: {
|
184
182
|
curr: 1
|
185
183
|
},
|
186
|
-
where: {
|
187
|
-
searchParams: result
|
188
|
-
}
|
184
|
+
where: {q: search, sort : sort}
|
189
185
|
}, 'data');
|
190
186
|
|
191
187
|
return false;
|
192
188
|
});
|
193
189
|
|
190
|
+
form.on('submit(weekly_plan_reset)', function(data){
|
191
|
+
var field = data.field;
|
192
|
+
form.val('weekly_plan_form_filter', {staff_id: '', year: '', month: ''})
|
193
|
+
return false;
|
194
|
+
});
|
195
|
+
|
194
196
|
/**
|
195
197
|
* toolbar事件监听
|
196
198
|
*/
|
@@ -230,7 +232,7 @@
|
|
230
232
|
table.on('tool(currentTableFilter2)', function (obj) {
|
231
233
|
var data = obj.data;
|
232
234
|
if (obj.event === 'edit') {
|
233
|
-
var content = miniPage.getHrefContent('/educode_sales/
|
235
|
+
var content = miniPage.getHrefContent('/educode_sales/operation_reports/' + data.id + "/edit")
|
234
236
|
var openWH = miniPage.getOpenWidthHeight();
|
235
237
|
var index = layer.open({
|
236
238
|
title: '编辑周报',
|
@@ -246,13 +248,8 @@
|
|
246
248
|
layer.full(index);
|
247
249
|
});
|
248
250
|
return false;
|
249
|
-
}
|
250
|
-
|
251
|
-
obj.del();
|
252
|
-
layer.close(index);
|
253
|
-
});
|
254
|
-
} else if (obj.event === 'show') {
|
255
|
-
content = miniPage.getHrefContent('/educode_sales/operation_plans/show_weekly');
|
251
|
+
} else if (obj.event === 'show') {
|
252
|
+
content = miniPage.getHrefContent('/educode_sales/operation_reports/' + data.id);
|
256
253
|
openWH = miniPage.getOpenWidthHeight();
|
257
254
|
index = layer.open({
|
258
255
|
title: '查看周报',
|
@@ -268,6 +265,31 @@
|
|
268
265
|
layer.full(index);
|
269
266
|
});
|
270
267
|
return false;
|
268
|
+
}else if (obj.event === 'delete') {
|
269
|
+
layer.confirm('确定删除' + data.id, function (index) {
|
270
|
+
request.delete('educode_sales/operation_reports/' + data.id, {}, function (res) {
|
271
|
+
layer.close(index);
|
272
|
+
table.reload("weeklyTable")
|
273
|
+
})
|
274
|
+
});
|
275
|
+
}else if (obj.event === 'audit') {
|
276
|
+
content = miniPage.getHrefContent('/educode_sales/operation_reports/' + data.id + "/audit");
|
277
|
+
openWH = miniPage.getOpenWidthHeight();
|
278
|
+
report_id = data.id;
|
279
|
+
sindex = layer.open({
|
280
|
+
title: '审查'+ data.staff +'的周报',
|
281
|
+
type: 1,
|
282
|
+
shade: 0.2,
|
283
|
+
maxmin: true,
|
284
|
+
shadeClose: true,
|
285
|
+
area: [openWH[0] + 'px', openWH[1] + 'px'],
|
286
|
+
offset: [openWH[2] + 'px', openWH[3] + 'px'],
|
287
|
+
content: content,
|
288
|
+
});
|
289
|
+
$(window).on("resize", function () {
|
290
|
+
layer.full(sindex);
|
291
|
+
});
|
292
|
+
return false;
|
271
293
|
}
|
272
294
|
});
|
273
295
|
|