educode_sales 0.4.8 → 0.5.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/assets/images/educode_sales//345/233/236/346/224/266/347/253/231.png +0 -0
- data/app/controllers/educode_sales/businesses_controller.rb +84 -5
- data/app/controllers/educode_sales/follow_ups_controller.rb +4 -3
- data/app/controllers/educode_sales/home_controller.rb +1 -1
- data/app/controllers/educode_sales/operation_plans_controller.rb +34 -6
- data/app/controllers/educode_sales/operation_reports_controller.rb +33 -3
- data/app/controllers/educode_sales/operations_controller.rb +1 -1
- data/app/controllers/educode_sales/plans_controller.rb +43 -15
- data/app/controllers/educode_sales/recycles_controller.rb +95 -0
- data/app/controllers/educode_sales/roles_controller.rb +5 -0
- data/app/controllers/educode_sales/sale_reports_controller.rb +34 -4
- data/app/controllers/educode_sales/sale_trends_controller.rb +176 -5
- data/app/controllers/educode_sales/sales_controller.rb +6 -2
- data/app/controllers/educode_sales/staffs_controller.rb +4 -4
- data/app/controllers/educode_sales/upload_files_controller.rb +112 -0
- data/app/models/concerns/deletable.rb +8 -0
- data/app/models/educode_sales/application_record.rb +2 -0
- data/app/models/educode_sales/business.rb +15 -2
- data/app/models/educode_sales/common.rb +6 -1
- data/app/models/educode_sales/follow_up.rb +4 -2
- data/app/models/educode_sales/recycle.rb +5 -0
- data/app/models/educode_sales/sale_plan.rb +3 -0
- data/app/models/educode_sales/sale_report.rb +2 -0
- data/app/views/educode_sales/businesses/edit_follow_record.html.erb +15 -0
- data/app/views/educode_sales/businesses/edit_plan.html.erb +2 -2
- data/app/views/educode_sales/businesses/file.html.erb +155 -0
- data/app/views/educode_sales/businesses/index.html.erb +71 -4
- data/app/views/educode_sales/businesses/index.json.jbuilder +3 -1
- data/app/views/educode_sales/businesses/new_follow_record.html.erb +22 -1
- data/app/views/educode_sales/businesses/show_follow.html.erb +46 -9
- data/app/views/educode_sales/businesses/show_follow.json.jbuilder +3 -0
- data/app/views/educode_sales/businesses/show_follow_record.html.erb +80 -2
- data/app/views/educode_sales/businesses/time_line.html.erb +62 -0
- data/app/views/educode_sales/businesses/upload_file.html.erb +43 -0
- data/app/views/educode_sales/operation_plans/_monthly.html.erb +4 -4
- data/app/views/educode_sales/operation_plans/_weekly.html.erb +4 -4
- data/app/views/educode_sales/operation_plans/index.html.erb +6 -1
- data/app/views/educode_sales/operation_plans/new_month.html.erb +15 -1
- data/app/views/educode_sales/operation_plans/new_week.html.erb +20 -5
- data/app/views/educode_sales/operation_reports/audit.html.erb +23 -15
- data/app/views/educode_sales/operation_reports/edit.html.erb +9 -9
- data/app/views/educode_sales/operation_reports/show.html.erb +22 -19
- data/app/views/educode_sales/places/index.html.erb +6 -1
- data/app/views/educode_sales/places/index.json.jbuilder +11 -1
- data/app/views/educode_sales/plans/_monthly.html.erb +4 -4
- data/app/views/educode_sales/plans/_weekly.html.erb +4 -4
- data/app/views/educode_sales/plans/index.html.erb +6 -1
- data/app/views/educode_sales/plans/new_monthly.html.erb +6 -6
- data/app/views/educode_sales/plans/new_week.html.erb +1 -1
- data/app/views/educode_sales/plans/new_weekly.html.erb +7 -7
- data/app/views/educode_sales/recycles/_business.html.erb +122 -0
- data/app/views/educode_sales/recycles/_monthPlan.html.erb +123 -0
- data/app/views/educode_sales/recycles/_monthly.html.erb +121 -0
- data/app/views/educode_sales/recycles/_weekPlan.html.erb +128 -0
- data/app/views/educode_sales/recycles/_weekly.html.erb +122 -0
- data/app/views/educode_sales/recycles/business.json.jbuilder +16 -0
- data/app/views/educode_sales/recycles/index.html.erb +58 -0
- data/app/views/educode_sales/recycles/monthPlan.json.jbuilder +16 -0
- data/app/views/educode_sales/recycles/monthly.json.jbuilder +15 -0
- data/app/views/educode_sales/recycles/weekPlan.json.jbuilder +16 -0
- data/app/views/educode_sales/recycles/weekly.json.jbuilder +15 -0
- data/app/views/educode_sales/roles/index.html.erb +19 -1
- data/app/views/educode_sales/roles/rename.html.erb +50 -0
- data/app/views/educode_sales/sale_reports/audit.html.erb +24 -13
- data/app/views/educode_sales/sale_reports/edit.html.erb +7 -7
- data/app/views/educode_sales/sale_reports/show.html.erb +13 -10
- data/app/views/educode_sales/sale_trends/trends.html.erb +228 -8
- data/app/views/educode_sales/sale_trends/trends.json.jbuilder +14 -0
- data/app/views/educode_sales/sales/index.html.erb +72 -6
- data/app/views/educode_sales/sales/index.json.jbuilder +35 -1
- data/app/views/educode_sales/sales/operations.json.jbuilder +11 -1
- data/app/views/educode_sales/staffs/index.html.erb +6 -1
- data/app/views/educode_sales/staffs/index.json.jbuilder +11 -1
- data/app/views/educode_sales/teachers/add_keys.html.erb +3 -3
- data/app/views/educode_sales/teachers/index.html.erb +7 -2
- data/app/views/educode_sales/teachers/new.html.erb +1 -0
- data/app/views/educode_sales/upload_files/index.json.jbuilder +13 -0
- data/app/views/layouts/educode_sales/application.html.erb +3 -0
- data/config/routes.rb +30 -0
- data/db/migrate/20210902064109_create_educode_sales_role_permissions.rb +6 -0
- data/db/migrate/20211102085743_add_bidded_date_educode_sales_follow_ups.rb +6 -0
- data/db/migrate/20211109015617_create_educode_sales_recycles.rb +25 -0
- data/lib/educode_sales/version.rb +1 -1
- metadata +26 -2
@@ -5,7 +5,7 @@
|
|
5
5
|
<div class="layui-inline">
|
6
6
|
<label class="layui-form-label">商机名称</label>
|
7
7
|
<div class="layui-input-inline">
|
8
|
-
<input type="text" name="name" autocomplete="off" class="layui-input">
|
8
|
+
<input type="text" name="name" autocomplete="off" class="layui-input" value="<%=params[:name] %>">
|
9
9
|
</div>
|
10
10
|
</div>
|
11
11
|
<div class="layui-inline">
|
@@ -53,7 +53,7 @@
|
|
53
53
|
<div class="layui-inline">
|
54
54
|
<button type="reset" class="layui-btn layui-btn-primary" lay-submit lay-filter="reset_business_search">重置
|
55
55
|
</button>
|
56
|
-
<button type="submit" class="layui-btn layui-btn-primary" lay-submit lay-filter="search_bussiness">搜索
|
56
|
+
<button type="submit" id="search_bt" class="layui-btn layui-btn-primary" lay-submit lay-filter="search_bussiness">搜索
|
57
57
|
</button>
|
58
58
|
</div>
|
59
59
|
</div>
|
@@ -169,6 +169,18 @@
|
|
169
169
|
title: '招标时间',
|
170
170
|
sort: true
|
171
171
|
},
|
172
|
+
{
|
173
|
+
field: 'bidded_date',
|
174
|
+
width: 105,
|
175
|
+
title: '中标时间',
|
176
|
+
sort: true
|
177
|
+
},
|
178
|
+
{
|
179
|
+
field: 'signed_date',
|
180
|
+
width: 105,
|
181
|
+
title: '签单时间',
|
182
|
+
sort: true
|
183
|
+
},
|
172
184
|
{
|
173
185
|
field: 'reception_at',
|
174
186
|
width: 105,
|
@@ -248,6 +260,12 @@
|
|
248
260
|
case 'edit':
|
249
261
|
edit(id);
|
250
262
|
break;
|
263
|
+
case 'file':
|
264
|
+
file(id, elem.data('name'));
|
265
|
+
break;
|
266
|
+
case 'time_line':
|
267
|
+
time_line(id, elem.data('name'));
|
268
|
+
break;
|
251
269
|
case 'delete':
|
252
270
|
deleteBusiness(id, elem.data('name'));
|
253
271
|
break;
|
@@ -292,6 +310,41 @@
|
|
292
310
|
layer.full(sindex);
|
293
311
|
});
|
294
312
|
}
|
313
|
+
function time_line(id,name) {
|
314
|
+
var content = miniPage.getHrefContent('/missions/businesses/time_line?business_id=' + id);
|
315
|
+
var openWH = miniPage.getOpenWidthHeight();
|
316
|
+
sindex = layer.open({
|
317
|
+
title: '商机列表/'+name+'的跟进时间线',
|
318
|
+
type: 1,
|
319
|
+
shade: 0.2,
|
320
|
+
maxmin: true,
|
321
|
+
shadeClose: true,
|
322
|
+
area: [openWH[0] + 'px', openWH[1] + 'px'],
|
323
|
+
offset: [openWH[2] + 'px', openWH[3] + 'px'],
|
324
|
+
content: content
|
325
|
+
});
|
326
|
+
$(window).on("resize", function () {
|
327
|
+
layer.full(sindex);
|
328
|
+
});
|
329
|
+
}
|
330
|
+
function file(id, name) {
|
331
|
+
id = id
|
332
|
+
var content = miniPage.getHrefContent('/missions/businesses/file?business_id=' + id);
|
333
|
+
var openWH = miniPage.getOpenWidthHeight();
|
334
|
+
sindex = layer.open({
|
335
|
+
title: '商机列表/'+name+'的附件信息',
|
336
|
+
type: 1,
|
337
|
+
shade: 0.2,
|
338
|
+
// maxmin: true,
|
339
|
+
shadeClose: true,
|
340
|
+
area: [openWH[0] + 'px', openWH[1] + 'px'],
|
341
|
+
offset: [openWH[2] + 'px', openWH[3] + 'px'],
|
342
|
+
content: content
|
343
|
+
});
|
344
|
+
$(window).on("resize", function () {
|
345
|
+
// layer.full(sindex);
|
346
|
+
});
|
347
|
+
}
|
295
348
|
|
296
349
|
function month(id) {
|
297
350
|
var content = miniPage.getHrefContent('/missions/plans/new_month?business_id=' + id);
|
@@ -320,6 +373,13 @@
|
|
320
373
|
});
|
321
374
|
}
|
322
375
|
|
376
|
+
function hn(){
|
377
|
+
$("#search_bt").trigger("click");
|
378
|
+
}
|
379
|
+
$(document).ready(function(){
|
380
|
+
window.onload=hn;
|
381
|
+
});
|
382
|
+
|
323
383
|
|
324
384
|
var sort = {}, search = {};
|
325
385
|
table.on('sort(businesses_table)', function (obj) {
|
@@ -337,7 +397,8 @@
|
|
337
397
|
// 监听搜索操作
|
338
398
|
form.on('submit(search_bussiness)', function (data) {
|
339
399
|
search = data.field
|
340
|
-
|
400
|
+
console.log(search);
|
401
|
+
table.reload('businesses_table', {
|
341
402
|
page: {
|
342
403
|
curr: 1
|
343
404
|
},
|
@@ -533,6 +594,7 @@
|
|
533
594
|
});
|
534
595
|
} else if (obj.event === 'show_follow') {
|
535
596
|
business_id = obj.data.id
|
597
|
+
business_name = data.name
|
536
598
|
content = miniPage.getHrefContent('/missions/businesses/show_follow?id=' + id);
|
537
599
|
openWH = miniPage.getOpenWidthHeight();
|
538
600
|
index = layer.open({
|
@@ -552,4 +614,9 @@
|
|
552
614
|
});
|
553
615
|
|
554
616
|
});
|
555
|
-
</script>
|
617
|
+
</script>
|
618
|
+
<style>
|
619
|
+
.layui-table-tool-temp{
|
620
|
+
padding-right: 30px; !important;
|
621
|
+
}
|
622
|
+
</style>
|
@@ -14,6 +14,8 @@ json.data do
|
|
14
14
|
json.stage d.last_follow_up&.stage&.name
|
15
15
|
json.invitation_at d.last_follow_up&.invitation_at.to_s
|
16
16
|
json.reception_at d.last_follow_up&.reception_at.to_s
|
17
|
+
json.bidded_date d.last_follow_up&.bidded_date.to_s
|
18
|
+
json.signed_date d.last_follow_up&.signed_date.to_s
|
17
19
|
json.total_amount d.last_follow_up&.total_amount
|
18
20
|
json.return_money d.return_money
|
19
21
|
json.place d.last_follow_up&.place&.name
|
@@ -22,7 +24,7 @@ json.data do
|
|
22
24
|
json.assign_follow_ups d.last_follow_up.present? ? d.last_follow_up.assign_follow_ups.pluck(:staff_id) : []
|
23
25
|
json.current_staff_id @current_admin.id
|
24
26
|
json.staff_id d.staff_id
|
25
|
-
json.latest_time d.last_follow_up.present? ? d.last_follow_up.created_at.to_s :
|
27
|
+
json.latest_time d.last_follow_up.present? ? d.last_follow_up.created_at.to_s : d.created_at.to_s
|
26
28
|
end
|
27
29
|
end
|
28
30
|
|
@@ -42,6 +42,23 @@
|
|
42
42
|
placeholder="请选择日期">
|
43
43
|
</div>
|
44
44
|
</div>
|
45
|
+
<div class="layui-inline">
|
46
|
+
<label class="layui-form-label">中标时间</label>
|
47
|
+
<div class="layui-input-inline">
|
48
|
+
<input type="text" class="layui-input" name="bidded_date" autocomplete="off" id="invitation_at_add"
|
49
|
+
value="<%= @last_follow_up&.bidded_date%>"
|
50
|
+
placeholder="请选择日期">
|
51
|
+
</div>
|
52
|
+
</div>
|
53
|
+
<br>
|
54
|
+
<div class="layui-inline">
|
55
|
+
<label class="layui-form-label">签单时间</label>
|
56
|
+
<div class="layui-input-inline">
|
57
|
+
<input type="text" class="layui-input" name="signed_date" autocomplete="off" id="invitation_at_add"
|
58
|
+
value="<%= @last_follow_up&.signed_date%>"
|
59
|
+
placeholder="请选择日期">
|
60
|
+
</div>
|
61
|
+
</div>
|
45
62
|
<div class="layui-inline">
|
46
63
|
<label class="layui-form-label">验收时间</label>
|
47
64
|
<div class="layui-input-inline">
|
@@ -80,9 +97,13 @@
|
|
80
97
|
</div>
|
81
98
|
<div class="layui-form-item">
|
82
99
|
<label class="layui-form-label">指定跟进人</label>
|
83
|
-
<div class="layui-input-inline">
|
100
|
+
<div class="layui-input-inline" style="z-index: 100">
|
84
101
|
<div id="assign_follow" style="width: 512px;"></div>
|
85
102
|
</div>
|
103
|
+
<div class="layui-inline" style="padding: 9px 15px">
|
104
|
+
<label class="layui-form-label" style="padding-left: 220px"></label>
|
105
|
+
指定跟进人和商机创建者,同时拥有对该商机的管理权限
|
106
|
+
</div>
|
86
107
|
</div>
|
87
108
|
<div class="layui-form-item layui-form-text">
|
88
109
|
<label class="layui-form-label required">最新进展</label>
|
@@ -1,6 +1,7 @@
|
|
1
1
|
<script type="text/html" id="toolbarDemo_follow">
|
2
2
|
<div class="layui-btn-container">
|
3
3
|
<span class="table-label">跟进记录</span>
|
4
|
+
<button class="layui-btn layui-btn-normal layui-btn-sm data-add-btn pull-right" lay-event="time_line"> 时间线视图>></button>
|
4
5
|
<% if can? :add_follow, EducodeSales::Business %>
|
5
6
|
<% if @current_admin.is_admin %>
|
6
7
|
<button class="layui-btn layui-btn-normal layui-btn-sm data-add-btn pull-right" lay-event="add"> 添加跟进记录</button>
|
@@ -8,9 +9,10 @@
|
|
8
9
|
<button class="layui-btn layui-btn-normal layui-btn-sm data-add-btn pull-right" lay-event="add"> 添加跟进记录</button>
|
9
10
|
<% end %>
|
10
11
|
<% end %>
|
12
|
+
<span class="table-label pull-right" style="padding-right: 20px">温馨提示:仅可以在24小时之内,编辑/删除最新的跟进记录</span>
|
11
13
|
</div>
|
12
14
|
</script>
|
13
|
-
<div class="edit-table">
|
15
|
+
<div class="edit-table tool">
|
14
16
|
<div class="z-index">
|
15
17
|
<table class="layui-hide" id="sale_plan_follow_table" lay-filter="sale_plan_follow_table"></table>
|
16
18
|
</div>
|
@@ -20,7 +22,7 @@
|
|
20
22
|
<% if can? :follow, EducodeSales::Business %>
|
21
23
|
<a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="show">查看</a>
|
22
24
|
<% end %>
|
23
|
-
{{# if(d.is_latest){ }}
|
25
|
+
{{# if(d.is_latest && d.flag){ }}
|
24
26
|
<% if can? :update_follow, EducodeSales::Business %>
|
25
27
|
<% if @current_admin.is_admin %>
|
26
28
|
<a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="edit">编辑</a>
|
@@ -109,11 +111,27 @@
|
|
109
111
|
title: '关键人',
|
110
112
|
templet: '#add_keys'
|
111
113
|
},
|
114
|
+
{
|
115
|
+
field: 'money_plans_count',
|
116
|
+
width: 120,
|
117
|
+
title: '回款计划',
|
118
|
+
templet: '#edit_plan'
|
119
|
+
},
|
112
120
|
{
|
113
121
|
field: 'invitation_at',
|
114
122
|
width: 110,
|
115
123
|
title: '招标时间',
|
116
124
|
},
|
125
|
+
{
|
126
|
+
field: 'bidded_date',
|
127
|
+
width: 110,
|
128
|
+
title: '中标时间',
|
129
|
+
},
|
130
|
+
{
|
131
|
+
field: 'signed_date',
|
132
|
+
width: 110,
|
133
|
+
title: '签单时间',
|
134
|
+
},
|
117
135
|
{
|
118
136
|
field: 'reception_at',
|
119
137
|
width: 110,
|
@@ -139,12 +157,7 @@
|
|
139
157
|
width: 100,
|
140
158
|
title: '已回款',
|
141
159
|
},
|
142
|
-
|
143
|
-
field: 'money_plans_count',
|
144
|
-
width: 120,
|
145
|
-
title: '回款计划',
|
146
|
-
templet: '#edit_plan'
|
147
|
-
},
|
160
|
+
|
148
161
|
{
|
149
162
|
field: 'place',
|
150
163
|
width: 200,
|
@@ -203,6 +216,25 @@
|
|
203
216
|
$(window).on("resize", function () {
|
204
217
|
layer.full(index);
|
205
218
|
});
|
219
|
+
} else if (obj.event === 'time_line') { // 监听添加操作
|
220
|
+
layer.closeAll()
|
221
|
+
business_id = parent.business_id
|
222
|
+
business_name = parent.business_name
|
223
|
+
var content = miniPage.getHrefContent('/missions/businesses/time_line?business_id=' + id);
|
224
|
+
var openWH = miniPage.getOpenWidthHeight();
|
225
|
+
sindex = layer.open({
|
226
|
+
title: '商机列表/'+ parent.business_name +'的跟进时间线',
|
227
|
+
type: 1,
|
228
|
+
shade: 0.2,
|
229
|
+
maxmin: true,
|
230
|
+
shadeClose: true,
|
231
|
+
area: [openWH[0] + 'px', openWH[1] + 'px'],
|
232
|
+
offset: [openWH[2] + 'px', openWH[3] + 'px'],
|
233
|
+
content: content
|
234
|
+
});
|
235
|
+
$(window).on("resize", function () {
|
236
|
+
layer.full(sindex);
|
237
|
+
});
|
206
238
|
}
|
207
239
|
});
|
208
240
|
|
@@ -221,7 +253,7 @@
|
|
221
253
|
} else if (obj.event === 'show') { // 监听添加操作
|
222
254
|
var content = miniPage.getHrefContent('/missions/businesses/show_follow_record?follow_up_id=' + data.id);
|
223
255
|
var openWH = miniPage.getOpenWidthHeight();
|
224
|
-
|
256
|
+
show_index = layer.open({
|
225
257
|
title: '查看商机跟进记录',
|
226
258
|
type: 1,
|
227
259
|
shade: 0.2,
|
@@ -257,6 +289,7 @@
|
|
257
289
|
content = miniPage.getHrefContent('/missions/teachers/add_keys?follow_up_id=' + obj.data.id);
|
258
290
|
openWH = miniPage.getOpenWidthHeight();
|
259
291
|
is_latest = obj.data.is_latest
|
292
|
+
flag = obj.data.flag
|
260
293
|
keyindex = layer.open({
|
261
294
|
title: '关键人',
|
262
295
|
type: 1,
|
@@ -278,6 +311,7 @@
|
|
278
311
|
content = miniPage.getHrefContent('/missions/businesses/edit_plan');
|
279
312
|
openWH = miniPage.getOpenWidthHeight();
|
280
313
|
is_latest = obj.data.is_latest
|
314
|
+
flag = obj.data.flag
|
281
315
|
plan_index = layer.open({
|
282
316
|
title: '回款计划',
|
283
317
|
type: 1,
|
@@ -501,4 +535,7 @@
|
|
501
535
|
.z-index .layui-table-tool{
|
502
536
|
z-index: 10000; !important;
|
503
537
|
}
|
538
|
+
.tool .layui-table-tool-temp{
|
539
|
+
padding-right: 30px; !important;
|
540
|
+
}
|
504
541
|
</style>
|
@@ -7,6 +7,8 @@ json.data do
|
|
7
7
|
json.teachers_count d.key_people_count
|
8
8
|
json.invitation_at d.invitation_at&.to_s(:date)
|
9
9
|
json.reception_at d.reception_at&.to_s(:date)
|
10
|
+
json.bidded_date d.bidded_date&.to_s(:date)
|
11
|
+
json.signed_date d.signed_date&.to_s(:date)
|
10
12
|
json.total_amount d.total_amount
|
11
13
|
json.actual_amount d.actual_amount
|
12
14
|
json.divide_amount d.divide_amount ? d.divide_amount : ""
|
@@ -15,6 +17,7 @@ json.data do
|
|
15
17
|
json.money_plans_count d.money_plans_count
|
16
18
|
json.money d.money_plans.where(clazz: 1).sum(:amount).round(2)
|
17
19
|
json.is_latest d.id == @latest&.id
|
20
|
+
json.flag d.created_at.present? ? (Time.now - d.created_at).to_f/3600 < 24 : false
|
18
21
|
end
|
19
22
|
end
|
20
23
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<h1 class="text-center m-t-20"><%= @follow_up.business.name %></h1>
|
2
2
|
<form class="layui-form form-value">
|
3
|
-
<div class="layui-form-item" style="padding: 25px">
|
3
|
+
<div class="layui-form-item" style="padding: 10px 25px 0;">
|
4
4
|
<div class="layui-inline">
|
5
5
|
<label class="layui-form-label">单位:</label>
|
6
6
|
<div class="layui-input-inline">
|
@@ -33,6 +33,19 @@
|
|
33
33
|
<%= @follow_up.invitation_at.to_s %>
|
34
34
|
</div>
|
35
35
|
</div>
|
36
|
+
<div class="layui-inline">
|
37
|
+
<label class="layui-form-label">中标时间:</label>
|
38
|
+
<div class="layui-input-inline">
|
39
|
+
<%= @follow_up.bidded_date.to_s %>
|
40
|
+
</div>
|
41
|
+
</div>
|
42
|
+
<br>
|
43
|
+
<div class="layui-inline">
|
44
|
+
<label class="layui-form-label">签单时间:</label>
|
45
|
+
<div class="layui-input-inline">
|
46
|
+
<%= @follow_up.signed_date.to_s %>
|
47
|
+
</div>
|
48
|
+
</div>
|
36
49
|
<div class="layui-inline">
|
37
50
|
<label class="layui-form-label">验收时间:</label>
|
38
51
|
<div class="layui-input-inline">
|
@@ -96,4 +109,69 @@
|
|
96
109
|
</div>
|
97
110
|
</div>
|
98
111
|
</div>
|
99
|
-
</form>
|
112
|
+
</form>
|
113
|
+
<div style=" text-align:center;">
|
114
|
+
<div class="layui-btn-group">
|
115
|
+
|
116
|
+
<%if @pre_id != 0 %>
|
117
|
+
<button type="button" class="layui-btn" onclick="pre_follow()">上一条</button>
|
118
|
+
<%else %>
|
119
|
+
<button type="button" class="layui-btn layui-btn-disabled layui-btn-radius">上一条</button>
|
120
|
+
<%end %>
|
121
|
+
|
122
|
+
<%if @next_id != 0 %>
|
123
|
+
<button type="button" class="layui-btn" onclick="next_follow()">下一条</button>
|
124
|
+
<%else %>
|
125
|
+
<button type="button" class="layui-btn layui-btn-disabled layui-btn-radius">下一条</button>
|
126
|
+
<%end %>
|
127
|
+
|
128
|
+
</div>
|
129
|
+
</div>
|
130
|
+
|
131
|
+
<script type="text/javascript" charset="utf-8">
|
132
|
+
|
133
|
+
layui.use(['form', 'table', 'miniPage', 'element', 'request'], function () {
|
134
|
+
var $ = layui.jquery,
|
135
|
+
form = layui.form,
|
136
|
+
table = layui.table,
|
137
|
+
request = layui.request,
|
138
|
+
miniPage = layui.miniPage;
|
139
|
+
|
140
|
+
});
|
141
|
+
function pre_follow(){
|
142
|
+
layer.close(parent.show_index)
|
143
|
+
var content = miniPage.getHrefContent('/missions/businesses/show_follow_record?follow_up_id=' + <%=@pre_id %>);
|
144
|
+
var openWH = miniPage.getOpenWidthHeight();
|
145
|
+
show_index = layer.open({
|
146
|
+
title: '查看商机跟进记录',
|
147
|
+
type: 1,
|
148
|
+
shade: 0.2,
|
149
|
+
maxmin: true,
|
150
|
+
shadeClose: true,
|
151
|
+
area: [openWH[0] + 'px', openWH[1] + 'px'],
|
152
|
+
offset: [openWH[2] + 'px', openWH[3] + 'px'],
|
153
|
+
content: content
|
154
|
+
});
|
155
|
+
$(window).on("resize", function () {
|
156
|
+
layer.full(index);
|
157
|
+
});
|
158
|
+
}
|
159
|
+
function next_follow(){
|
160
|
+
layer.close(parent.show_index)
|
161
|
+
var content = miniPage.getHrefContent('/missions/businesses/show_follow_record?follow_up_id=' + <%=@next_id %>);
|
162
|
+
var openWH = miniPage.getOpenWidthHeight();
|
163
|
+
show_index = layer.open({
|
164
|
+
title: '查看商机跟进记录',
|
165
|
+
type: 1,
|
166
|
+
shade: 0.2,
|
167
|
+
maxmin: true,
|
168
|
+
shadeClose: true,
|
169
|
+
area: [openWH[0] + 'px', openWH[1] + 'px'],
|
170
|
+
offset: [openWH[2] + 'px', openWH[3] + 'px'],
|
171
|
+
content: content
|
172
|
+
});
|
173
|
+
$(window).on("resize", function () {
|
174
|
+
layer.full(index);
|
175
|
+
});
|
176
|
+
}
|
177
|
+
</script>
|
@@ -0,0 +1,62 @@
|
|
1
|
+
<div class="layui-btn-container" style="padding-right: 200px;padding-top: 10px">
|
2
|
+
<button class="layui-btn layui-btn-normal layui-btn-sm data-add-btn pull-right" onclick="demo()" >跟进记录列表>></button>
|
3
|
+
</div>
|
4
|
+
<div style="padding: 50px">
|
5
|
+
<ul class="layui-timeline">
|
6
|
+
<%if @follow_ups.present? %>
|
7
|
+
<%@follow_ups.each do |f| %>
|
8
|
+
<li class="layui-timeline-item">
|
9
|
+
<i class="layui-icon layui-timeline-axis"></i>
|
10
|
+
<div class="layui-timeline-content layui-text">
|
11
|
+
<h3 class="layui-timeline-title"><%=f.created_at %>---<%=f.staff.user.real_name %></h3>
|
12
|
+
<p>
|
13
|
+
最新进展:<%=f.description %>
|
14
|
+
<br>
|
15
|
+
团队建议:<%=f.advise %>
|
16
|
+
<br>
|
17
|
+
项目类型:<%=f.clazz.name %>
|
18
|
+
<br>
|
19
|
+
项目阶段:<%=f.stage.name %>
|
20
|
+
<br>
|
21
|
+
关键人:<% teacher_ids = f.key_person.present? ? f.key_person.pluck(:teacher_id) : [] %>
|
22
|
+
<%= EducodeSales::Teacher.where(id: teacher_ids).pluck(:name).join("、") %>
|
23
|
+
</p>
|
24
|
+
</div>
|
25
|
+
</li>
|
26
|
+
<%end %>
|
27
|
+
<%else %>
|
28
|
+
<h1 class="layui-timeline-title" style="text-align: center">暂无跟进记录</h1>
|
29
|
+
<%end %>
|
30
|
+
</ul>
|
31
|
+
</div>
|
32
|
+
|
33
|
+
<script type="text/javascript" charset="utf-8">
|
34
|
+
|
35
|
+
layui.use(['form', 'table', 'miniPage', 'element', 'request'], function () {
|
36
|
+
var $ = layui.jquery,
|
37
|
+
form = layui.form,
|
38
|
+
table = layui.table,
|
39
|
+
request = layui.request,
|
40
|
+
miniPage = layui.miniPage;
|
41
|
+
|
42
|
+
});
|
43
|
+
function demo(){
|
44
|
+
layer.closeAll()
|
45
|
+
business_id = parent.business_id
|
46
|
+
var content = miniPage.getHrefContent('/missions/businesses/show_follow?id=' + id);
|
47
|
+
var openWH = miniPage.getOpenWidthHeight();
|
48
|
+
sindex = layer.open({
|
49
|
+
title: '商机列表/'+ parent.business_name +'的跟进记录',
|
50
|
+
type: 1,
|
51
|
+
shade: 0.2,
|
52
|
+
maxmin: true,
|
53
|
+
shadeClose: true,
|
54
|
+
area: [openWH[0] + 'px', openWH[1] + 'px'],
|
55
|
+
offset: [openWH[2] + 'px', openWH[3] + 'px'],
|
56
|
+
content: content
|
57
|
+
});
|
58
|
+
$(window).on("resize", function () {
|
59
|
+
layer.full(sindex);
|
60
|
+
});
|
61
|
+
}
|
62
|
+
</script>
|
@@ -0,0 +1,43 @@
|
|
1
|
+
<div style="padding-left: 50px">
|
2
|
+
<button type="button" class="layui-btn" id="get_file"><i class="layui-icon"></i>选择文件</button>
|
3
|
+
</div>
|
4
|
+
<script>
|
5
|
+
layui.use(['form', 'table', 'upload', 'layer', 'laytpl', 'request', 'selectInput'], function () {
|
6
|
+
var form = layui.form,
|
7
|
+
layer = layui.layer,
|
8
|
+
table = layui.table,
|
9
|
+
laytpl = layui.laytpl,
|
10
|
+
upload = layui.upload,
|
11
|
+
request = layui.request,
|
12
|
+
$ = layui.$;
|
13
|
+
selectInput = layui.selectInput;
|
14
|
+
|
15
|
+
form.render();
|
16
|
+
|
17
|
+
//指定允许上传的文件类型
|
18
|
+
var business_id = parent.id
|
19
|
+
var renderObj = upload.render({
|
20
|
+
elem: '#get_file'
|
21
|
+
,url: '/missions/upload_files?business_id='+business_id //此处配置你自己的上传接口即可
|
22
|
+
,accept: 'file' //普通文件
|
23
|
+
,headers: {
|
24
|
+
'X-CSRF-Token': $('meta[name=csrf-token]').attr('content')
|
25
|
+
}
|
26
|
+
,before: function(obj){ //obj参数包含的信息,跟 choose回调完全一致,可参见上文。
|
27
|
+
layer.load(); //上传loading
|
28
|
+
}
|
29
|
+
,done: function(res){
|
30
|
+
layer.msg('导入成功');
|
31
|
+
table.reload('file');
|
32
|
+
layer.closeAll('loading'); //关闭loading
|
33
|
+
layer.close(parent.import_index)
|
34
|
+
}
|
35
|
+
,error: function(index, upload){
|
36
|
+
table.reload('file');
|
37
|
+
layer.closeAll('loading'); //关闭loading
|
38
|
+
layer.alert('导入失败,请检查文件格式')
|
39
|
+
layer.close(parent.import_index)
|
40
|
+
}
|
41
|
+
});
|
42
|
+
});
|
43
|
+
</script>
|
@@ -117,7 +117,7 @@
|
|
117
117
|
},
|
118
118
|
{
|
119
119
|
field: 'level1_score',
|
120
|
-
width:
|
120
|
+
width: 120,
|
121
121
|
title: '大区',
|
122
122
|
templet: function (d) {
|
123
123
|
return '<div class="star1"></div>'
|
@@ -125,7 +125,7 @@
|
|
125
125
|
},
|
126
126
|
{
|
127
127
|
field: 'level2_score',
|
128
|
-
width:
|
128
|
+
width: 120,
|
129
129
|
title: '总监',
|
130
130
|
templet: function (d) {
|
131
131
|
return '<div class="star2"></div>'
|
@@ -133,7 +133,7 @@
|
|
133
133
|
},
|
134
134
|
{
|
135
135
|
field: 'level3_score',
|
136
|
-
width:
|
136
|
+
width: 120,
|
137
137
|
title: '副总',
|
138
138
|
templet: function (d) {
|
139
139
|
return '<div class="star3"></div>'
|
@@ -141,7 +141,7 @@
|
|
141
141
|
},
|
142
142
|
{
|
143
143
|
field: 'created_at',
|
144
|
-
width:
|
144
|
+
width: 200,
|
145
145
|
title: '提交时间',
|
146
146
|
},
|
147
147
|
{
|
@@ -118,7 +118,7 @@
|
|
118
118
|
},
|
119
119
|
{
|
120
120
|
field: 'level1_score',
|
121
|
-
width:
|
121
|
+
width: 120,
|
122
122
|
title: '大区',
|
123
123
|
templet: function (d) {
|
124
124
|
return '<div class="star1"></div>'
|
@@ -126,7 +126,7 @@
|
|
126
126
|
},
|
127
127
|
{
|
128
128
|
field: 'level2_score',
|
129
|
-
width:
|
129
|
+
width: 120,
|
130
130
|
title: '总监',
|
131
131
|
templet: function (d) {
|
132
132
|
return '<div class="star2"></div>'
|
@@ -134,7 +134,7 @@
|
|
134
134
|
},
|
135
135
|
{
|
136
136
|
field: 'level3_score',
|
137
|
-
width:
|
137
|
+
width: 120,
|
138
138
|
title: '副总',
|
139
139
|
templet: function (d) {
|
140
140
|
return '<div class="star3"></div>'
|
@@ -142,7 +142,7 @@
|
|
142
142
|
},
|
143
143
|
{
|
144
144
|
field: 'created_at',
|
145
|
-
width:
|
145
|
+
width: 200,
|
146
146
|
title: '提交时间',
|
147
147
|
},
|
148
148
|
{
|
@@ -6,10 +6,19 @@
|
|
6
6
|
<input type="text" lay-verify="required" class="layui-input" id="new_month_plan" autocomplete="off" name="month" placeholder="请选择">
|
7
7
|
</div>
|
8
8
|
</div>
|
9
|
+
<%if @teacher.present? %>
|
10
|
+
<div class="layui-inline">
|
11
|
+
<label class="layui-form-label required">教师</label>
|
12
|
+
<div class="layui-input-inline">
|
13
|
+
<%= select_tag "teacher_id", options_for_select(@teachers, @teacher&.id), {"lay-verify": "required", include_blank: true} %>
|
14
|
+
</div>
|
15
|
+
</div>
|
16
|
+
<%else %>
|
9
17
|
<div class="layui-inline">
|
10
18
|
<label class="layui-form-label required">教师</label>
|
11
19
|
<div class="layui-input-block" id="add_teacher" style="width: 400px"></div>
|
12
20
|
</div>
|
21
|
+
<%end %>
|
13
22
|
<div class="layui-form-item layui-form-text">
|
14
23
|
<label class="layui-form-label">计划内容</label>
|
15
24
|
<div class="layui-input-block">
|
@@ -46,6 +55,7 @@
|
|
46
55
|
</div>
|
47
56
|
|
48
57
|
<script>
|
58
|
+
flag2 = false
|
49
59
|
layui.use(['form', 'table', 'laytpl', 'request'], function () {
|
50
60
|
var form = layui.form,
|
51
61
|
layer = layui.layer,
|
@@ -81,6 +91,7 @@
|
|
81
91
|
});
|
82
92
|
|
83
93
|
add_teacher.on('itemSelect(add_teacher)', function (obj) {
|
94
|
+
flag2 = true
|
84
95
|
teacher_id = obj.data;
|
85
96
|
var name = obj.textContent
|
86
97
|
add_teacher.setValue(name)
|
@@ -97,7 +108,10 @@
|
|
97
108
|
var parentIndex = layer.index;
|
98
109
|
|
99
110
|
form.on('submit(add_month_plan)', function (data) {
|
100
|
-
|
111
|
+
console.log(flag2);
|
112
|
+
if(flag2){
|
113
|
+
data.field.teacher_id = teacher_id
|
114
|
+
}
|
101
115
|
request.authPost("missions/operation_plans", data.field, function (res) {
|
102
116
|
if (res.success == false) {
|
103
117
|
layer.alert(res.msg)
|