educode_sales 0.1.2 → 0.1.7

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.
Files changed (88) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/stylesheets/educode_sales/app.css +3 -1
  3. data/app/controllers/educode_sales/activities_controller.rb +1 -1
  4. data/app/controllers/educode_sales/businesses_controller.rb +14 -9
  5. data/app/controllers/educode_sales/commons_controller.rb +1 -1
  6. data/app/controllers/educode_sales/follow_ups_controller.rb +6 -2
  7. data/app/controllers/educode_sales/operation_plans_controller.rb +11 -11
  8. data/app/controllers/educode_sales/operation_reports_controller.rb +2 -2
  9. data/app/controllers/educode_sales/places_controller.rb +3 -5
  10. data/app/controllers/educode_sales/plans_controller.rb +7 -7
  11. data/app/controllers/educode_sales/roles_controller.rb +12 -1
  12. data/app/controllers/educode_sales/sale_reports_controller.rb +2 -2
  13. data/app/controllers/educode_sales/sales_controller.rb +2 -2
  14. data/app/controllers/educode_sales/sessions_controller.rb +1 -0
  15. data/app/controllers/educode_sales/staffs_controller.rb +3 -3
  16. data/app/controllers/educode_sales/teacher_follows_controller.rb +2 -2
  17. data/app/controllers/educode_sales/teachers_controller.rb +5 -5
  18. data/app/models/educode_sales/common.rb +4 -0
  19. data/app/models/educode_sales/follow_up.rb +1 -1
  20. data/app/models/educode_sales/money_plan.rb +3 -3
  21. data/app/models/educode_sales/operation_plan.rb +2 -0
  22. data/app/models/educode_sales/place.rb +1 -0
  23. data/app/models/educode_sales/sale_plan.rb +2 -0
  24. data/app/models/educode_sales/teacher.rb +11 -2
  25. data/app/views/educode_sales/activities/index.html.erb +1 -9
  26. data/app/views/educode_sales/activities/index.json.jbuilder +1 -1
  27. data/app/views/educode_sales/businesses/edit_follow_record.html.erb +3 -2
  28. data/app/views/educode_sales/businesses/edit_plan.html.erb +9 -5
  29. data/app/views/educode_sales/businesses/index.html.erb +1 -1
  30. data/app/views/educode_sales/businesses/index.json.jbuilder +1 -0
  31. data/app/views/educode_sales/businesses/show_follow.html.erb +1 -0
  32. data/app/views/educode_sales/businesses/show_follow.json.jbuilder +1 -1
  33. data/app/views/educode_sales/businesses/unfinish_plans.json.jbuilder +1 -1
  34. data/app/views/educode_sales/commons/index.json.jbuilder +1 -1
  35. data/app/views/educode_sales/follow_ups/money_plans.json.jbuilder +1 -1
  36. data/app/views/educode_sales/follow_ups/teachers.json.jbuilder +1 -1
  37. data/app/views/educode_sales/operation_plans/_monthPlan.html.erb +5 -4
  38. data/app/views/educode_sales/operation_plans/_monthly.html.erb +4 -4
  39. data/app/views/educode_sales/operation_plans/_weekPlan.html.erb +9 -4
  40. data/app/views/educode_sales/operation_plans/_weekly.html.erb +4 -5
  41. data/app/views/educode_sales/operation_plans/edit_month.html.erb +3 -1
  42. data/app/views/educode_sales/operation_plans/index.html.erb +35 -5
  43. data/app/views/educode_sales/operation_plans/index.json.jbuilder +1 -1
  44. data/app/views/educode_sales/operation_plans/my_month.json.jbuilder +2 -2
  45. data/app/views/educode_sales/operation_plans/my_week.json.jbuilder +1 -1
  46. data/app/views/educode_sales/operation_plans/new_month.html.erb +3 -1
  47. data/app/views/educode_sales/operation_plans/new_monthly.html.erb +136 -30
  48. data/app/views/educode_sales/operation_plans/new_week.html.erb +4 -3
  49. data/app/views/educode_sales/operation_plans/new_weekly.html.erb +173 -81
  50. data/app/views/educode_sales/operation_reports/audit.html.erb +1 -1
  51. data/app/views/educode_sales/operation_reports/edit.html.erb +1 -1
  52. data/app/views/educode_sales/operation_reports/index.json.jbuilder +2 -1
  53. data/app/views/educode_sales/operation_reports/plans.json.jbuilder +1 -1
  54. data/app/views/educode_sales/operation_reports/show.html.erb +1 -1
  55. data/app/views/educode_sales/places/index.json.jbuilder +2 -2
  56. data/app/views/educode_sales/plans/_monthPlan.html.erb +10 -7
  57. data/app/views/educode_sales/plans/_monthly.html.erb +2 -2
  58. data/app/views/educode_sales/plans/_weekPlan.html.erb +7 -2
  59. data/app/views/educode_sales/plans/_weekly.html.erb +2 -2
  60. data/app/views/educode_sales/plans/edit_week.html.erb +1 -1
  61. data/app/views/educode_sales/plans/index.json.jbuilder +1 -1
  62. data/app/views/educode_sales/plans/my_month.json.jbuilder +2 -2
  63. data/app/views/educode_sales/plans/my_week.json.jbuilder +1 -1
  64. data/app/views/educode_sales/plans/new_monthly.html.erb +1 -1
  65. data/app/views/educode_sales/plans/new_week.html.erb +3 -1
  66. data/app/views/educode_sales/plans/new_weekly.html.erb +2 -1
  67. data/app/views/educode_sales/roles/index.html.erb +33 -2
  68. data/app/views/educode_sales/roles/index.json.jbuilder +1 -1
  69. data/app/views/educode_sales/sale_reports/audit.html.erb +1 -1
  70. data/app/views/educode_sales/sale_reports/edit.html.erb +1 -1
  71. data/app/views/educode_sales/sale_reports/index.json.jbuilder +2 -2
  72. data/app/views/educode_sales/sale_reports/plans.json.jbuilder +1 -1
  73. data/app/views/educode_sales/sale_reports/show.html.erb +1 -1
  74. data/app/views/educode_sales/sale_trends/trends.html.erb +1 -1
  75. data/app/views/educode_sales/sales/index.json.jbuilder +1 -1
  76. data/app/views/educode_sales/sales/operations.json.jbuilder +1 -1
  77. data/app/views/educode_sales/staffs/edit.html.erb +1 -1
  78. data/app/views/educode_sales/staffs/follow_up_departments.json.jbuilder +1 -1
  79. data/app/views/educode_sales/staffs/index.json.jbuilder +1 -1
  80. data/app/views/educode_sales/teachers/edit.html.erb +1 -1
  81. data/app/views/educode_sales/teachers/index.html.erb +3 -3
  82. data/app/views/educode_sales/teachers/index.json.jbuilder +3 -2
  83. data/app/views/educode_sales/teachers/new_follow_record.html.erb +2 -0
  84. data/app/views/educode_sales/teachers/show_follow.json.jbuilder +1 -1
  85. data/app/views/educode_sales/teachers/unfinish_plans.json.jbuilder +1 -1
  86. data/config/routes.rb +1 -0
  87. data/lib/educode_sales/version.rb +1 -1
  88. metadata +2 -2
@@ -60,8 +60,10 @@
60
60
  if (res.success == false) {
61
61
  layer.alert(res.msg)
62
62
  } else {
63
- layer.closeAll()
63
+ layer.close(parent.indexOfmonthPlan)
64
+ layer.close(parent.indexOfmonthly)
64
65
  table.reload('monthPlanTable')
66
+ table.reload("newMonthlyTable")
65
67
  }
66
68
  })
67
69
  return false;
@@ -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>
@@ -16,4 +16,4 @@ json.data do
16
16
  end
17
17
 
18
18
  json.code 0
19
- json.count @sale_plans.count
19
+ json.count @sale_plans.total_count
@@ -8,11 +8,11 @@ json.data do
8
8
  json.month d.month.strftime("%Y-%m")
9
9
  json.teacher_id d.teacher_id
10
10
  json.content d.content.truncate(30)
11
- # json.follow_ups_count d.teacher.follow_ups_count
11
+ json.count d.teacher.teacher_follows_count
12
12
  json.rate "#{d.finish_rate}%"
13
13
  json.updated_at d.updated_at.to_s
14
14
  end
15
15
  end
16
16
 
17
17
  json.code 0
18
- json.count @sale_plans.count
18
+ json.count @sale_plans.total_count
@@ -16,4 +16,4 @@ json.data do
16
16
  end
17
17
 
18
18
  json.code 0
19
- json.count @sale_plans.count
19
+ json.count @sale_plans.total_count
@@ -69,8 +69,10 @@
69
69
  if (res.success == false) {
70
70
  layer.alert(res.msg)
71
71
  } else {
72
- layer.closeAll()
72
+ layer.close(parent.new_monthly_index)
73
+ layer.close(parent.monthPlanIndex)
73
74
  table.reload('monthPlanTable')
75
+ table.reload("newMonthlyTable")
74
76
  }
75
77
  })
76
78
  return false;
@@ -8,7 +8,7 @@
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><%= @rate %></span>
11
+ <span><%= @rate %>%</span>
12
12
  <%= hidden_field_tag 'finish_rate', @rate, {id: 'monthly_rate_hide'} %>
13
13
  </div>
14
14
  <div class="layui-inline" style="margin:18px; font-weight: bold">
@@ -35,7 +35,7 @@
35
35
  </form>
36
36
 
37
37
  <!--表格-->
38
- <table class="layui-hide" id="newMonthlyTable" lay-filter="currentMonthly"></table>
38
+ <table class="layui-hide" id="newMonthlyTable" lay-filter="newMonthlyToolbar"></table>
39
39
 
40
40
  <script type="text/html" id="currentMonthly">
41
41
  <a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="show">查看</a>
@@ -43,6 +43,11 @@
43
43
  <a class="layui-btn layui-btn-xs layui-btn-danger data-count-delete" lay-event="delete">删除</a>
44
44
  </script>
45
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
+
46
51
  <script>
47
52
  layui.use(['rate', 'table'], function () {
48
53
  var rate = layui.rate,
@@ -69,7 +74,7 @@
69
74
 
70
75
  table.render({
71
76
  elem: '#newMonthlyTable',
72
- // url: 'api/table.json',
77
+ url: '/educode_sales/operation_plans/my_month',
73
78
  toolbar: '#newMonthlyToolbar',
74
79
  defaultToolbar: [],
75
80
  cols: [
@@ -80,39 +85,35 @@
80
85
  title: '序号'
81
86
  },
82
87
  {
83
- field: 'username',
88
+ field: 'staff',
84
89
  width: 100,
85
90
  title: '姓名'
86
91
  },
87
92
  {
88
- field: 'chance',
93
+ field: 'teacher_name',
89
94
  width: 100,
90
95
  title: '教师姓名',
91
96
  },
92
97
  {
93
- field: 'company',
94
- width: 100,
98
+ field: 'school',
99
+ width: 190,
95
100
  title: '单位'
96
101
  },
97
102
  {
98
- field: 'dep',
99
- width: 100,
103
+ field: 'department',
104
+ width: 190,
100
105
  title: '部门'
101
106
  },
102
107
  {
103
- field: 'week',
104
- width: 100,
105
- title: '周次',
106
- },
107
- {
108
- field: 'plan',
109
- width: 300,
108
+ field: 'content',
109
+ width: 400,
110
110
  title: '计划内容',
111
111
  },
112
112
  {
113
- field: 'follow',
113
+ field: 'count',
114
114
  width: 100,
115
115
  title: '跟进',
116
+ templet: '#show_follow_newMonthly'
116
117
  },
117
118
  {
118
119
  field: 'rate',
@@ -120,7 +121,7 @@
120
121
  title: '完成率',
121
122
  },
122
123
  {
123
- field: 'updateTime',
124
+ field: 'updated_at',
124
125
  width: 150,
125
126
  title: '更新时间',
126
127
  sort: true,
@@ -133,25 +134,130 @@
133
134
  }
134
135
  ]
135
136
  ],
136
- data: [{
137
- "id": "1",
138
- "username": "丁亚莲",
139
- "chance": "人工智能实验室建设",
140
- "company": "中南大学",
141
- "dep": "计算机学院",
142
- "week": "2021-33周",
143
- "plan": "对接决策人",
144
- "follow": "120",
145
- "rate": "100%",
146
- "updateTime": "2021-07-27",
147
- }],
148
137
  limits: [10, 15, 20, 25, 50, 100],
149
138
  limit: 15,
150
139
  page: true,
151
140
  skin: 'line'
152
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
+
153
258
  })
154
259
  </script>
260
+
155
261
  <style>
156
262
  .layui-form-item {
157
263
  margin-bottom: 0px;
@@ -16,7 +16,6 @@
16
16
  <label class="layui-form-label required">教师</label>
17
17
  <div class="layui-input-inline">
18
18
 
19
- <%#= select_tag "teacher_id", options_for_select(@teachers, @teacher&.id), {"lay-verify": "required", include_blank: true} %>
20
19
  <%= select_tag "teacher_id", options_for_select(@teachers), {"lay-verify": "required", include_blank: true} %>
21
20
  </div>
22
21
  </div>
@@ -76,8 +75,10 @@
76
75
  if (res.success == false) {
77
76
  layer.alert(res.msg)
78
77
  } else {
79
- layer.closeAll()
80
- table.reload('weekPlanTable1')
78
+ layer.close(parent.add_new_weeklyIndex)
79
+ layer.close(parent.new_weelPlan_index)
80
+ table.reload("weekPlanTable1")
81
+ table.reload("newWeeklyTable")
81
82
  }
82
83
  })
83
84
  return false;
@@ -8,7 +8,7 @@
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><%= @rate %></span>
11
+ <span><%= @rate %>%</span>
12
12
  <%= hidden_field_tag 'finish_rate', @rate, {id: 'weekly_rate_hide'} %>
13
13
  </div>
14
14
  <div class="layui-inline" style="margin:18px; font-weight: bold">
@@ -35,13 +35,16 @@
35
35
  </form>
36
36
 
37
37
  <!--表格-->
38
- <table class="layui-hide" id="newWeeklyTable" lay-filter="currentWeekly"></table>
38
+ <table class="layui-hide" id="newWeeklyTable" lay-filter="newWeeklyToolbar"></table>
39
39
 
40
40
  <script type="text/html" id="currentWeekly">
41
41
  <a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="show">查看</a>
42
42
  <a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="edit">编辑</a>
43
43
  <a class="layui-btn layui-btn-xs layui-btn-danger data-count-delete" lay-event="delete">删除</a>
44
44
  </script>
45
+ <script type="text/html" id="show_follow_newWeekly">
46
+ <a href="javascript:void(0);" lay-event="show_follow_newWeekly" class="layui-table-link">{{ d.count }}</a>
47
+ </script>
45
48
  <script>
46
49
  layui.use(['rate', 'table', 'request', 'form', 'miniPage', 'jquery'], function () {
47
50
  var rate = layui.rate,
@@ -56,7 +59,7 @@
56
59
  if (res.success == false) {
57
60
  layer.alert(res.msg)
58
61
  } else {
59
- // layer.closeAll();
62
+ layer.closeAll();
60
63
  parent.table.reload('weeklyTable');
61
64
  layer.alert('添加成功')
62
65
  }
@@ -67,62 +70,63 @@
67
70
 
68
71
  table.render({
69
72
  elem: '#newWeeklyTable',
70
- // url: 'api/table.json',
73
+ url: '/educode_sales/operation_plans/my_week',
71
74
  toolbar: '#newWeeklyToolbar',
72
75
  defaultToolbar: [],
73
- cols: [
74
- [
75
- {
76
- field: 'id',
77
- width: 80,
78
- title: '序号'
79
- },
80
- {
81
- field: 'username',
82
- width: 100,
83
- title: '姓名'
84
- },
85
- {
86
- field: 'chance',
87
- width: 100,
88
- title: '教师姓名',
89
- },
90
- {
91
- field: 'company',
92
- width: 100,
93
- title: '单位'
94
- },
95
- {
96
- field: 'dep',
97
- width: 100,
98
- title: '部门'
99
- },
100
- {
101
- field: 'week',
102
- width: 100,
103
- title: '周次',
104
- },
105
- {
106
- field: 'plan',
107
- width: 300,
108
- title: '计划内容',
109
- },
110
- {
111
- field: 'follow',
112
- width: 100,
113
- title: '跟进',
114
- },
115
- {
116
- field: 'rate',
117
- width: 100,
118
- title: '完成率',
119
- },
120
- {
121
- field: 'updateTime',
122
- width: 150,
123
- title: '更新时间',
124
- sort: true,
125
- },
76
+ cols: [
77
+ [
78
+ {
79
+ field: 'id',
80
+ width: 80,
81
+ title: '序号'
82
+ },
83
+ {
84
+ field: 'staff',
85
+ width: 100,
86
+ title: '姓名'
87
+ },
88
+ {
89
+ field: 'teacher_name',
90
+ width: 100,
91
+ title: '教师姓名',
92
+ },
93
+ {
94
+ field: 'school',
95
+ width: 190,
96
+ title: '单位'
97
+ },
98
+ {
99
+ field: 'department',
100
+ width: 190,
101
+ title: '部门'
102
+ },
103
+ {
104
+ field: 'week',
105
+ width: 100,
106
+ title: '周次',
107
+ },
108
+ {
109
+ field: 'content',
110
+ width: 300,
111
+ title: '计划内容',
112
+ },
113
+ {
114
+ field: 'count',
115
+ width: 100,
116
+ title: '跟进',
117
+ templet: '#show_follow_newWeekly'
118
+ },
119
+ {
120
+ field: 'rate',
121
+ width: 100,
122
+ title: '完成率',
123
+ },
124
+ {
125
+ field: 'updated_at',
126
+ width: 150,
127
+ title: '更新时间',
128
+ sort: true,
129
+ },
126
130
  {
127
131
  title: '操作',
128
132
  minWidth: 150,
@@ -131,18 +135,6 @@
131
135
  }
132
136
  ]
133
137
  ],
134
- data: [{
135
- "id": "1",
136
- "username": "丁亚莲",
137
- "chance": "人工智能实验室建设",
138
- "company": "中南大学",
139
- "dep": "计算机学院",
140
- "week": "2021-33周",
141
- "plan": "对接决策人",
142
- "follow": "120",
143
- "rate": "100%",
144
- "updateTime": "2021-07-27",
145
- }],
146
138
  limits: [10, 15, 20, 25, 50, 100],
147
139
  limit: 15,
148
140
  page: true,
@@ -150,18 +142,118 @@
150
142
  });
151
143
 
152
144
 
145
+ /**
146
+ * toolbar事件监听
147
+ */
148
+ table.on('toolbar(newWeeklyToolbar)', function (obj) {
149
+ var data = obj.data;
150
+ if (obj.event === 'add') { // 监听添加操作
151
+ var content = miniPage.getHrefContent('/educode_sales/operation_plans/new_week');
152
+ var openWH = miniPage.getOpenWidthHeight();
153
+ add_new_weeklyIndex = 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
+
175
+
176
+
177
+
178
+ table.on('tool(newWeeklyToolbar)', function (obj) {
179
+ var data = obj.data;
180
+ id = data.id
181
+ if (obj.event === 'delete') {
182
+ layer.confirm('确定删除' + data.id, function (index) {
183
+ request.delete('educode_sales/operation_plans/' + data.id, {}, function (res) {
184
+ layer.close(index);
185
+ table.reload("weekPlanTable1")
186
+ table.reload("newWeeklyTable")
187
+ })
188
+ });
189
+ }
190
+ else if (obj.event === 'show') {
191
+ console.log("a");
192
+ content = miniPage.getHrefContent('/educode_sales/operation_plans/show_week?id='+id);
193
+ openWH = miniPage.getOpenWidthHeight();
194
+ index = layer.open({
195
+ title: '查看',
196
+ type: 1,
197
+ shade: 0.2,
198
+ maxmin: true,
199
+ shadeClose: true,
200
+ area: [openWH[0] + 'px', openWH[1] + 'px'],
201
+ offset: [openWH[2] + 'px', openWH[3] + 'px'],
202
+ content: content,
203
+ success: function (layero, index) {
204
+ form.render('select');
205
+ },
206
+ });
207
+ $(window).on("resize", function () {
208
+ layer.full(index);
209
+ });
210
+ return false;
211
+ } else if (obj.event === 'edit') {
212
+ content = miniPage.getHrefContent('/educode_sales/operation_plans/edit_week?id='+id);
213
+ openWH = miniPage.getOpenWidthHeight();
214
+ editWeek_index = layer.open({
215
+ title: '编辑',
216
+ type: 1,
217
+ shade: 0.2,
218
+ maxmin: true,
219
+ shadeClose: true,
220
+ area: [openWH[0] + 'px', openWH[1] + 'px'],
221
+ offset: [openWH[2] + 'px', openWH[3] + 'px'],
222
+ content: content,
223
+ success: function (layero, index) {
224
+ form.render('select');
225
+ },
226
+ });
227
+ $(window).on("resize", function () {
228
+ layer.full(index);
229
+ });
230
+ return false;
231
+ }
232
+ else if (obj.event === 'show_follow_newWeekly') {
233
+ id = data.teacher_id
234
+ content = miniPage.getHrefContent('/educode_sales/teachers/show_follow?id=' + data.teacher_id);
235
+ openWH = miniPage.getOpenWidthHeight();
236
+ index = layer.open({
237
+ title: data.teacher_name + '/跟进记录',
238
+ type: 1,
239
+ shade: 0.2,
240
+ maxmin: true,
241
+ shadeClose: true,
242
+ area: [openWH[0] + 'px', openWH[1] + 'px'],
243
+ offset: [openWH[2] + 'px', openWH[3] + 'px'],
244
+ content: content,
245
+ success: function (layero, index) {
246
+ // 重新渲染弹层中的下拉选择框select
247
+ // form.render('select');
248
+ }
249
+ });
250
+ $(window).on("resize", function () {
251
+ layer.full(index);
252
+ });
253
+ }
254
+ });
255
+
256
+
153
257
 
154
- // form.on('submit(add_weekly_report)', function (data) {
155
- // request.authPost("educode_sales/operation_reports", data.field, function (res) {
156
- // if (res.success == false) {
157
- // layer.alert(res.msg)
158
- // } else {
159
- // layer.closeAll()
160
- // table.reload('newWeeklyTable');
161
- // layer.alert('添加成功')
162
- // }
163
- // })
164
- // return false;
165
- // });
166
258
  })
167
259
  </script>