educode_sales 0.4.8 → 0.4.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/controllers/educode_sales/businesses_controller.rb +67 -2
- data/app/controllers/educode_sales/follow_ups_controller.rb +1 -1
- data/app/controllers/educode_sales/home_controller.rb +1 -1
- data/app/controllers/educode_sales/operation_plans_controller.rb +11 -4
- data/app/controllers/educode_sales/operations_controller.rb +1 -1
- data/app/controllers/educode_sales/plans_controller.rb +15 -8
- data/app/controllers/educode_sales/sale_trends_controller.rb +5 -5
- data/app/controllers/educode_sales/sales_controller.rb +2 -2
- data/app/controllers/educode_sales/upload_files_controller.rb +99 -0
- data/app/models/educode_sales/common.rb +4 -0
- data/app/views/educode_sales/businesses/edit_follow_record.html.erb +15 -0
- data/app/views/educode_sales/businesses/file.html.erb +140 -0
- data/app/views/educode_sales/businesses/index.html.erb +55 -1
- data/app/views/educode_sales/businesses/index.json.jbuilder +3 -1
- data/app/views/educode_sales/businesses/new_follow_record.html.erb +17 -0
- data/app/views/educode_sales/businesses/show_follow.html.erb +38 -7
- data/app/views/educode_sales/businesses/show_follow.json.jbuilder +2 -0
- data/app/views/educode_sales/businesses/show_follow_record.html.erb +79 -1
- data/app/views/educode_sales/businesses/time_line.html.erb +58 -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/new_month.html.erb +15 -1
- data/app/views/educode_sales/operation_plans/new_week.html.erb +19 -4
- data/app/views/educode_sales/operation_reports/audit.html.erb +9 -9
- data/app/views/educode_sales/operation_reports/edit.html.erb +9 -9
- data/app/views/educode_sales/operation_reports/show.html.erb +9 -9
- 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/sale_reports/audit.html.erb +7 -7
- data/app/views/educode_sales/sale_reports/edit.html.erb +7 -7
- data/app/views/educode_sales/sale_reports/show.html.erb +2 -2
- data/app/views/educode_sales/sale_trends/trends.html.erb +6 -6
- data/app/views/educode_sales/upload_files/index.json.jbuilder +13 -0
- data/config/routes.rb +12 -0
- data/db/migrate/20211102085743_add_bidded_date_educode_sales_follow_ups.rb +6 -0
- data/lib/educode_sales/version.rb +1 -1
- metadata +8 -2
@@ -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">
|
@@ -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>
|
@@ -109,11 +110,27 @@
|
|
109
110
|
title: '关键人',
|
110
111
|
templet: '#add_keys'
|
111
112
|
},
|
113
|
+
{
|
114
|
+
field: 'money_plans_count',
|
115
|
+
width: 120,
|
116
|
+
title: '回款计划',
|
117
|
+
templet: '#edit_plan'
|
118
|
+
},
|
112
119
|
{
|
113
120
|
field: 'invitation_at',
|
114
121
|
width: 110,
|
115
122
|
title: '招标时间',
|
116
123
|
},
|
124
|
+
{
|
125
|
+
field: 'bidded_date',
|
126
|
+
width: 110,
|
127
|
+
title: '中标时间',
|
128
|
+
},
|
129
|
+
{
|
130
|
+
field: 'signed_date',
|
131
|
+
width: 110,
|
132
|
+
title: '签单时间',
|
133
|
+
},
|
117
134
|
{
|
118
135
|
field: 'reception_at',
|
119
136
|
width: 110,
|
@@ -139,12 +156,7 @@
|
|
139
156
|
width: 100,
|
140
157
|
title: '已回款',
|
141
158
|
},
|
142
|
-
|
143
|
-
field: 'money_plans_count',
|
144
|
-
width: 120,
|
145
|
-
title: '回款计划',
|
146
|
-
templet: '#edit_plan'
|
147
|
-
},
|
159
|
+
|
148
160
|
{
|
149
161
|
field: 'place',
|
150
162
|
width: 200,
|
@@ -203,6 +215,25 @@
|
|
203
215
|
$(window).on("resize", function () {
|
204
216
|
layer.full(index);
|
205
217
|
});
|
218
|
+
} else if (obj.event === 'time_line') { // 监听添加操作
|
219
|
+
layer.closeAll()
|
220
|
+
business_id = parent.business_id
|
221
|
+
business_name = parent.business_name
|
222
|
+
var content = miniPage.getHrefContent('/missions/businesses/time_line?business_id=' + id);
|
223
|
+
var openWH = miniPage.getOpenWidthHeight();
|
224
|
+
sindex = layer.open({
|
225
|
+
title: '商机列表/'+ parent.business_name +'的跟进时间线',
|
226
|
+
type: 1,
|
227
|
+
shade: 0.2,
|
228
|
+
maxmin: true,
|
229
|
+
shadeClose: true,
|
230
|
+
area: [openWH[0] + 'px', openWH[1] + 'px'],
|
231
|
+
offset: [openWH[2] + 'px', openWH[3] + 'px'],
|
232
|
+
content: content
|
233
|
+
});
|
234
|
+
$(window).on("resize", function () {
|
235
|
+
layer.full(sindex);
|
236
|
+
});
|
206
237
|
}
|
207
238
|
});
|
208
239
|
|
@@ -221,7 +252,7 @@
|
|
221
252
|
} else if (obj.event === 'show') { // 监听添加操作
|
222
253
|
var content = miniPage.getHrefContent('/missions/businesses/show_follow_record?follow_up_id=' + data.id);
|
223
254
|
var openWH = miniPage.getOpenWidthHeight();
|
224
|
-
|
255
|
+
show_index = layer.open({
|
225
256
|
title: '查看商机跟进记录',
|
226
257
|
type: 1,
|
227
258
|
shade: 0.2,
|
@@ -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 : ""
|
@@ -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,58 @@
|
|
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
|
+
<%@follow_ups.each do |f| %>
|
7
|
+
<li class="layui-timeline-item">
|
8
|
+
<i class="layui-icon layui-timeline-axis"></i>
|
9
|
+
<div class="layui-timeline-content layui-text">
|
10
|
+
<h3 class="layui-timeline-title"><%=f.created_at %>---<%=f.staff.user.real_name %></h3>
|
11
|
+
<p>
|
12
|
+
最新进展:<%=f.description %>
|
13
|
+
<br>
|
14
|
+
团队建议:<%=f.advise %>
|
15
|
+
<br>
|
16
|
+
项目类型:<%=f.clazz.name %>
|
17
|
+
<br>
|
18
|
+
项目阶段:<%=f.stage.name %>
|
19
|
+
<br>
|
20
|
+
关键人:<% teacher_ids = f.key_person.present? ? f.key_person.pluck(:teacher_id) : [] %>
|
21
|
+
<%= EducodeSales::Teacher.where(id: teacher_ids).pluck(:name).join("、") %>
|
22
|
+
</p>
|
23
|
+
</div>
|
24
|
+
</li>
|
25
|
+
<%end %>
|
26
|
+
</ul>
|
27
|
+
</div>
|
28
|
+
|
29
|
+
<script type="text/javascript" charset="utf-8">
|
30
|
+
|
31
|
+
layui.use(['form', 'table', 'miniPage', 'element', 'request'], function () {
|
32
|
+
var $ = layui.jquery,
|
33
|
+
form = layui.form,
|
34
|
+
table = layui.table,
|
35
|
+
request = layui.request,
|
36
|
+
miniPage = layui.miniPage;
|
37
|
+
|
38
|
+
});
|
39
|
+
function demo(){
|
40
|
+
layer.closeAll()
|
41
|
+
business_id = parent.business_id
|
42
|
+
var content = miniPage.getHrefContent('/missions/businesses/show_follow?id=' + id);
|
43
|
+
var openWH = miniPage.getOpenWidthHeight();
|
44
|
+
sindex = layer.open({
|
45
|
+
title: '商机列表/'+ parent.business_name +'的跟进时间线',
|
46
|
+
type: 1,
|
47
|
+
shade: 0.2,
|
48
|
+
maxmin: true,
|
49
|
+
shadeClose: true,
|
50
|
+
area: [openWH[0] + 'px', openWH[1] + 'px'],
|
51
|
+
offset: [openWH[2] + 'px', openWH[3] + 'px'],
|
52
|
+
content: content
|
53
|
+
});
|
54
|
+
$(window).on("resize", function () {
|
55
|
+
layer.full(sindex);
|
56
|
+
});
|
57
|
+
}
|
58
|
+
</script>
|
@@ -0,0 +1,43 @@
|
|
1
|
+
<div style="padding-left: 50px">
|
2
|
+
<button type="button" class="layui-btn" id="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: '#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('place');
|
32
|
+
layer.closeAll('loading'); //关闭loading
|
33
|
+
layer.close(parent.import_index)
|
34
|
+
}
|
35
|
+
,error: function(index, upload){
|
36
|
+
table.reload('place');
|
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)
|
@@ -12,10 +12,19 @@
|
|
12
12
|
<%= select_tag "weekly", options_for_select(@weeks), class: 'required' %>
|
13
13
|
</div>
|
14
14
|
</div>
|
15
|
-
|
15
|
+
<%if @teacher.present? %>
|
16
|
+
<div class="layui-inline">
|
16
17
|
<label class="layui-form-label required">教师</label>
|
17
|
-
<div class="layui-input-
|
18
|
-
|
18
|
+
<div class="layui-input-inline">
|
19
|
+
<%= select_tag "teacher_id", options_for_select(@teachers, @teacher&.id), {"lay-verify": "required", include_blank: true} %>
|
20
|
+
</div>
|
21
|
+
</div>
|
22
|
+
<%else %>
|
23
|
+
<div class="layui-inline">
|
24
|
+
<label class="layui-form-label required">教师</label>
|
25
|
+
<div class="layui-input-block" id="add_teacher" style="width: 400px"></div>
|
26
|
+
</div>
|
27
|
+
<%end %>
|
19
28
|
<div class="layui-form-item layui-form-text">
|
20
29
|
<label class="layui-form-label required">计划内容</label>
|
21
30
|
<div class="layui-input-block">
|
@@ -52,6 +61,7 @@
|
|
52
61
|
</div>
|
53
62
|
|
54
63
|
<script>
|
64
|
+
flag = false
|
55
65
|
layui.use(['form', 'table', 'laytpl', 'request'], function () {
|
56
66
|
var form = layui.form,
|
57
67
|
layer = layui.layer,
|
@@ -86,6 +96,7 @@
|
|
86
96
|
});
|
87
97
|
|
88
98
|
add_teacher.on('itemSelect(add_teacher)', function (obj) {
|
99
|
+
flag = true
|
89
100
|
teacher_id = obj.data;
|
90
101
|
var name = obj.textContent
|
91
102
|
add_teacher.setValue(name)
|
@@ -99,7 +110,11 @@
|
|
99
110
|
|
100
111
|
|
101
112
|
form.on('submit(add_week_plan)', function (data) {
|
102
|
-
|
113
|
+
console.log(flag);
|
114
|
+
if (flag){
|
115
|
+
data.field.teacher_id = teacher_id
|
116
|
+
}
|
117
|
+
console.log(data.field.teacher_id);
|
103
118
|
request.authPost("missions/operation_plans", data.field, function (res) {
|
104
119
|
if (res.success == false) {
|
105
120
|
layer.alert(res.msg)
|
@@ -165,32 +165,32 @@
|
|
165
165
|
cols: [
|
166
166
|
[{
|
167
167
|
field: 'id',
|
168
|
-
width:
|
168
|
+
width: 60,
|
169
169
|
title:'序号',type: 'numbers',
|
170
170
|
},
|
171
171
|
{
|
172
172
|
field: 'staff',
|
173
|
-
width:
|
173
|
+
width: 80,
|
174
174
|
title: '姓名'
|
175
175
|
},
|
176
176
|
{
|
177
177
|
field: 'teacher_name',
|
178
|
-
width:
|
178
|
+
width: 120,
|
179
179
|
title: '教师姓名',
|
180
180
|
},
|
181
181
|
{
|
182
182
|
field: 'school',
|
183
|
-
width:
|
183
|
+
width: 170,
|
184
184
|
title: '单位'
|
185
185
|
},
|
186
186
|
{
|
187
187
|
field: 'department',
|
188
|
-
width:
|
188
|
+
width: 170,
|
189
189
|
title: '部门'
|
190
190
|
},
|
191
191
|
{
|
192
192
|
field: 'week',
|
193
|
-
width:
|
193
|
+
width: 80,
|
194
194
|
title: '周次',
|
195
195
|
},
|
196
196
|
{
|
@@ -200,18 +200,18 @@
|
|
200
200
|
},
|
201
201
|
{
|
202
202
|
field: 'count',
|
203
|
-
width:
|
203
|
+
width: 80,
|
204
204
|
title: '跟进',
|
205
205
|
templet: '#show_follow_audit'
|
206
206
|
},
|
207
207
|
{
|
208
208
|
field: 'rate',
|
209
|
-
width:
|
209
|
+
width: 80,
|
210
210
|
title: '完成率',
|
211
211
|
},
|
212
212
|
{
|
213
213
|
field: 'updated_at',
|
214
|
-
width:
|
214
|
+
width: 170,
|
215
215
|
title: '更新时间',
|
216
216
|
sort: true,
|
217
217
|
},
|
@@ -97,32 +97,32 @@
|
|
97
97
|
cols: [
|
98
98
|
[{
|
99
99
|
field: 'id',
|
100
|
-
width:
|
100
|
+
width: 60,
|
101
101
|
title:'序号',type: 'numbers',
|
102
102
|
},
|
103
103
|
{
|
104
104
|
field: 'staff',
|
105
|
-
width:
|
105
|
+
width: 80,
|
106
106
|
title: '姓名'
|
107
107
|
},
|
108
108
|
{
|
109
109
|
field: 'teacher_name',
|
110
|
-
width:
|
110
|
+
width: 120,
|
111
111
|
title: '教师姓名',
|
112
112
|
},
|
113
113
|
{
|
114
114
|
field: 'school',
|
115
|
-
width:
|
115
|
+
width: 170,
|
116
116
|
title: '单位'
|
117
117
|
},
|
118
118
|
{
|
119
119
|
field: 'department',
|
120
|
-
width:
|
120
|
+
width: 170,
|
121
121
|
title: '部门'
|
122
122
|
},
|
123
123
|
{
|
124
124
|
field: 'week',
|
125
|
-
width:
|
125
|
+
width: 80,
|
126
126
|
title: '周次',
|
127
127
|
},
|
128
128
|
{
|
@@ -132,18 +132,18 @@
|
|
132
132
|
},
|
133
133
|
{
|
134
134
|
field: 'count',
|
135
|
-
width:
|
135
|
+
width: 80,
|
136
136
|
title: '跟进',
|
137
137
|
templet: '#show_follow_edit'
|
138
138
|
},
|
139
139
|
{
|
140
140
|
field: 'rate',
|
141
|
-
width:
|
141
|
+
width: 80,
|
142
142
|
title: '完成率',
|
143
143
|
},
|
144
144
|
{
|
145
145
|
field: 'updated_at',
|
146
|
-
width:
|
146
|
+
width: 170,
|
147
147
|
title: '更新时间',
|
148
148
|
sort: true,
|
149
149
|
},
|