educode_sales 0.3.8 → 0.3.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.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/educode_sales/extent/xm-select.js +8 -0
  3. data/app/controllers/educode_sales/businesses_controller.rb +5 -2
  4. data/app/controllers/educode_sales/follow_ups_controller.rb +9 -0
  5. data/app/controllers/educode_sales/home_controller.rb +10 -1
  6. data/app/controllers/educode_sales/import_teachers_controller.rb +68 -0
  7. data/app/controllers/educode_sales/places_controller.rb +1 -0
  8. data/app/controllers/educode_sales/sale_trends_controller.rb +8 -6
  9. data/app/controllers/educode_sales/sales_controller.rb +1 -0
  10. data/app/controllers/educode_sales/teachers_controller.rb +4 -4
  11. data/app/models/educode_sales/assign_follow_up.rb +6 -0
  12. data/app/models/educode_sales/follow_up.rb +1 -0
  13. data/app/views/educode_sales/activities/edit.html.erb +0 -1
  14. data/app/views/educode_sales/activities/index.html.erb +20 -1
  15. data/app/views/educode_sales/businesses/edit_follow_record.html.erb +43 -1
  16. data/app/views/educode_sales/businesses/index.html.erb +10 -3
  17. data/app/views/educode_sales/businesses/index.json.jbuilder +3 -0
  18. data/app/views/educode_sales/businesses/new_follow_record.html.erb +44 -13
  19. data/app/views/educode_sales/businesses/show_follow.html.erb +12 -5
  20. data/app/views/educode_sales/businesses/show_follow_record.html.erb +6 -0
  21. data/app/views/educode_sales/commons/edit.html.erb +0 -1
  22. data/app/views/educode_sales/commons/index.html.erb +1 -0
  23. data/app/views/educode_sales/home/sales_staff.json.jbuilder +9 -0
  24. data/app/views/educode_sales/operation_plans/_monthPlan.html.erb +2 -2
  25. data/app/views/educode_sales/operation_plans/_monthly.html.erb +3 -2
  26. data/app/views/educode_sales/operation_plans/_weekPlan.html.erb +2 -1
  27. data/app/views/educode_sales/operation_plans/_weekly.html.erb +4 -2
  28. data/app/views/educode_sales/operation_plans/edit_week.html.erb +1 -0
  29. data/app/views/educode_sales/operation_reports/edit.html.erb +27 -1
  30. data/app/views/educode_sales/places/edit.html.erb +0 -2
  31. data/app/views/educode_sales/places/index.html.erb +1 -0
  32. data/app/views/educode_sales/places/index.json.jbuilder +3 -3
  33. data/app/views/educode_sales/places/new.html.erb +0 -1
  34. data/app/views/educode_sales/plans/_monthPlan.html.erb +2 -2
  35. data/app/views/educode_sales/plans/_monthly.html.erb +2 -1
  36. data/app/views/educode_sales/plans/_weekPlan.html.erb +2 -1
  37. data/app/views/educode_sales/plans/_weekly.html.erb +3 -1
  38. data/app/views/educode_sales/roles/edit.html.erb +0 -1
  39. data/app/views/educode_sales/roles/index.html.erb +1 -1
  40. data/app/views/educode_sales/sale_reports/edit.html.erb +26 -0
  41. data/app/views/educode_sales/sales/index.html.erb +1 -0
  42. data/app/views/educode_sales/sales/index.json.jbuilder +2 -2
  43. data/app/views/educode_sales/sales/operations.html.erb +1 -0
  44. data/app/views/educode_sales/sales/trends.html.erb +0 -4
  45. data/app/views/educode_sales/staffs/index.html.erb +1 -0
  46. data/app/views/educode_sales/teachers/add_courses.html.erb +0 -1
  47. data/app/views/educode_sales/teachers/import.html.erb +40 -0
  48. data/app/views/educode_sales/teachers/index.html.erb +20 -3
  49. data/app/views/educode_sales/teachers/new.html.erb +0 -1
  50. data/config/routes.rb +5 -0
  51. data/db/migrate/20211013060712_create_educode_sales_assign_follow_ups.rb +10 -0
  52. data/lib/educode_sales/version.rb +1 -1
  53. metadata +8 -2
@@ -1,3 +1,4 @@
1
+ <%= Gon::Base.render_data %>
1
2
  <h1 class="m-t-20 text-center"><%= @follow_up.business.name %></h1>
2
3
  <div class="layui-form layuimini-form">
3
4
  <div class="layui-form-item" style="padding: 25px">
@@ -74,6 +75,12 @@
74
75
  </div>
75
76
  <span style="margin-top: 10px; float:left;">%</span>
76
77
  </div>
78
+ <div class="layui-form-item">
79
+ <label class="layui-form-label">指定跟进人</label>
80
+ <div class="layui-input-inline">
81
+ <div id="edit_assign_follow" style="width: 512px;"></div>
82
+ </div>
83
+ </div>
77
84
  <div class="layui-form-item layui-form-text">
78
85
  <label class="layui-form-label required">商机说明</label>
79
86
  <div class="layui-input-block">
@@ -107,10 +114,11 @@
107
114
  </div>
108
115
 
109
116
  <script>
110
- layui.use(['form', 'table', 'upload', 'layer', 'laytpl', 'request', 'laydate'], function () {
117
+ layui.use(['form', 'table', 'upload', 'layer', 'laytpl', 'request', 'laydate', 'xmSelect'], function () {
111
118
  var form = layui.form,
112
119
  layer = layui.layer,
113
120
  table = layui.table,
121
+ xmSelect = layui.xmSelect,
114
122
  laytpl = layui.laytpl,
115
123
  request = layui.request,
116
124
  laydate = layui.laydate,
@@ -124,8 +132,42 @@
124
132
  elem: '#reception_at_edit'
125
133
  });
126
134
 
135
+ var sales_list = xmSelect.render({
136
+ el: '#edit_assign_follow',
137
+ remoteSearch: true,
138
+ clickClose: true,
139
+ delay: 1000,
140
+ paging: true,
141
+ pageRemote: true,
142
+ filterable: true,
143
+ remoteMethod: function (val, cb, show, pageIndex) {
144
+ $.ajax( '/missions/sales_staff', {
145
+ method: 'get',
146
+ data: {
147
+ q: val,
148
+ page: pageIndex
149
+ },
150
+ dataType: 'json',
151
+ success: function (res) {
152
+ var data = res.data;
153
+ if (res.code == 0) {
154
+ cb(res.data, res.count);
155
+ } else {
156
+ layer.msg(res.msg, {time: 2000, icon: 2, shade: 0.01});
157
+ }
158
+ }
159
+ })
160
+ }
161
+ })
162
+ sales_list.setValue(gon.sales)
163
+
127
164
  form.render();
128
165
  form.on('submit(update_follow_up)', function (data) {
166
+ var assign_follow = [];
167
+ sales_list.getValue().forEach(function(d) {
168
+ assign_follow.push(d.value);
169
+ })
170
+ data.field.assign_follow_up = assign_follow;
129
171
  request.authPut("missions/follow_ups/<%= @follow_up.id%>", data.field, function (res) {
130
172
  if (res.success == false) {
131
173
  layer.alert(res.msg)
@@ -50,7 +50,7 @@
50
50
  <input type="text" class="layui-input" id="date" name="date" placeholder=" - ">
51
51
  </div>
52
52
  </div>
53
- <div class="layui-form-item m-t-10">
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
56
  <button type="submit" class="layui-btn layui-btn-primary" lay-submit lay-filter="search_bussiness">搜索
@@ -72,7 +72,14 @@
72
72
  </script>
73
73
  <script type="text/html" id="currentTableBar">
74
74
  <% if can? :add_follow, EducodeSales::Business %>
75
- <a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="add_event">添加跟进记录</a>
75
+ <% if @current_admin.is_admin %>
76
+ <a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="add_event">添加跟进记录</a>
77
+ <% else %>
78
+ {{# if ( d.assign_follow_ups.length > 0 && d.assign_follow_ups.indexOf(d.current_staff_id) >=0 || (d.assign_follow_ups.length == 0) || (d.current_staff_id == d.staff_id) ) {}}
79
+ <a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="add_event">添加跟进记录</a>
80
+ {{# }}}
81
+ <% end %>
82
+
76
83
  <% end %>
77
84
  <% if @more %>
78
85
  <a class="layui-btn-xs data-count-edit more-btn" data-name={{d.name}} data-id={{d.id}}>更多<i class="layui-icon layui-icon-down layui-nav-more"></i></a>
@@ -201,6 +208,7 @@
201
208
  ],
202
209
 
203
210
  limit: 20,
211
+ limits: [10,15,20,30,40,50,60,70,80,90],
204
212
  page: true,
205
213
  skin: 'line',
206
214
  done: function (res) {
@@ -408,7 +416,6 @@
408
416
  })
409
417
  });
410
418
  }else if (obj.event === 'add_follow') { // 监听添加操作
411
- console.log(parent.business_id);
412
419
  business_id = parent.business_id
413
420
  var content = miniPage.getHrefContent('/missions/businesses/new_follow_record?id=' + parent.id);
414
421
  var openWH = miniPage.getOpenWidthHeight();
@@ -17,6 +17,9 @@ json.data do
17
17
  json.place d.last_follow_up&.place&.name
18
18
  json.last_follow_person d.last_follow_up.present? ? d.last_follow_up.staff.user.real_name : ''
19
19
  json.source d.source
20
+ json.assign_follow_ups d.last_follow_up.present? ? d.last_follow_up.assign_follow_ups.pluck(:staff_id) : []
21
+ json.current_staff_id @current_admin.id
22
+ json.staff_id d.staff_id
20
23
  end
21
24
  end
22
25
  json.code 0
@@ -77,6 +77,12 @@
77
77
  <input name="divide_rate" class="layui-input" value="<%= @last_follow_up&.divide_rate%>">
78
78
  </div>
79
79
  <span style="margin-top: 10px; float:left;">%</span>
80
+ </div>
81
+ <div class="layui-form-item">
82
+ <label class="layui-form-label">指定跟进人</label>
83
+ <div class="layui-input-inline">
84
+ <div id="assign_follow" style="width: 512px;"></div>
85
+ </div>
80
86
  </div>
81
87
  <div class="layui-form-item layui-form-text">
82
88
  <label class="layui-form-label required">商机说明</label>
@@ -110,13 +116,14 @@
110
116
  </div>
111
117
 
112
118
  <script>
113
- layui.use(['form', 'table', 'upload', 'layer', 'laytpl', 'request', 'laydate'], function () {
119
+ layui.use(['form', 'table', 'upload', 'layer', 'laytpl', 'request', 'laydate', 'xmSelect'], function () {
114
120
  var form = layui.form,
115
121
  layer = layui.layer,
116
122
  table = layui.table,
117
123
  laytpl = layui.laytpl,
118
124
  request = layui.request,
119
125
  laydate = layui.laydate,
126
+ xmSelect = layui.xmSelect,
120
127
  $ = layui.$;
121
128
 
122
129
  laydate.render({
@@ -126,22 +133,46 @@
126
133
  laydate.render({
127
134
  elem: '#reception_at_add'
128
135
  });
136
+ var sales_list = xmSelect.render({
137
+ el: '#assign_follow',
138
+ remoteSearch: true,
139
+ clickClose: true,
140
+ delay: 1000,
141
+ paging: true,
142
+ pageRemote: true,
143
+ filterable: true,
144
+ remoteMethod: function (val, cb, show, pageIndex) {
145
+ $.ajax( '/missions/sales_staff', {
146
+ method: 'get',
147
+ data: {
148
+ q: val,
149
+ page: pageIndex
150
+ },
151
+ dataType: 'json',
152
+ success: function (res) {
153
+ var data = res.data;
154
+ if (res.code == 0) {
155
+ cb(res.data, res.count);
156
+ } else {
157
+ layer.msg(res.msg, {time: 2000, icon: 2, shade: 0.01});
158
+ }
159
+
160
+ }
161
+ })
162
+ }
163
+ })
164
+
129
165
 
130
166
  form.render();
131
167
 
132
168
  form.on('submit(add_follow_up)', function (data) {
133
- console.log(data);
134
- data.field.business_id = "<%= @business.id %>";
135
- console.log(data.field.business_id);
136
- // request.authPut("missions/businesses/" + data.field.business_id +"/updateMoney/", {
137
- // return_money: 0
138
- // }, function (res) {
139
- // if (res.success == false) {
140
- // layer.alert(res.msg)
141
- // } else {
142
- // }
143
- // })
144
- request.authPost("missions/follow_ups", data.field, function (res) {
169
+ var assign_follow = [];
170
+ sales_list.getValue().forEach(function(d) {
171
+ assign_follow.push(d.value);
172
+ })
173
+ data.field.assign_follow_up = assign_follow;
174
+ data.field.business_id = "<%= @business.id %>";
175
+ request.authPost("missions/follow_ups", data.field, function (res) {
145
176
  if (res.success == false) {
146
177
  layer.alert(res.msg)
147
178
  } else {
@@ -2,7 +2,11 @@
2
2
  <div class="layui-btn-container">
3
3
  <span class="table-label">跟进记录</span>
4
4
  <% if can? :add_follow, EducodeSales::Business %>
5
- <button class="layui-btn layui-btn-normal layui-btn-sm data-add-btn pull-right" lay-event="add"> 添加跟进记录</button>
5
+ <% if @current_admin.is_admin %>
6
+ <button class="layui-btn layui-btn-normal layui-btn-sm data-add-btn pull-right" lay-event="add"> 添加跟进记录</button>
7
+ <% elsif @business.staff_id == @current_admin.id || @business.last_follow_up.nil? || @business.last_follow_up.assign_follow_ups.blank? || (@business.last_follow_up.assign_follow_ups.pluck(:staff_id).include?(@current_admin.id)) %>
8
+ <button class="layui-btn layui-btn-normal layui-btn-sm data-add-btn pull-right" lay-event="add"> 添加跟进记录</button>
9
+ <% end %>
6
10
  <% end %>
7
11
  </div>
8
12
  </script>
@@ -16,7 +20,11 @@
16
20
  <% end %>
17
21
  {{# if(d.is_latest){ }}
18
22
  <% if can? :update_follow, EducodeSales::Business %>
19
- <a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="edit">编辑</a>
23
+ <% if @current_admin.is_admin %>
24
+ <a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="edit">编辑</a>
25
+ <% elsif @business.staff_id == @current_admin.id || @business.last_follow_up.nil? || @business.last_follow_up.assign_follow_ups.blank? || (@business.last_follow_up.assign_follow_ups.pluck(:staff_id).include?(@current_admin.id)) %>
26
+ <a class="layui-btn layui-btn-normal layui-btn-xs data-count-edit" lay-event="edit">编辑</a>
27
+ <% end %>
20
28
  <% end %>
21
29
  <% if can? :destroy_follow, EducodeSales::Business %>
22
30
  <a class="layui-btn layui-btn-xs layui-btn-danger data-count-delete" lay-event="delete">删除</a>
@@ -142,7 +150,7 @@
142
150
  },
143
151
  {
144
152
  title: '操作',
145
- minWidth: 250,
153
+ minWidth: 200,
146
154
  toolbar: '#currentTableBar_follow',
147
155
  align: "center",
148
156
  fixed: 'right'
@@ -150,6 +158,7 @@
150
158
  ]
151
159
  ],
152
160
  limit: 20,
161
+ limits: [10,15,20,30,40,50,60,70,80,90],
153
162
  page: true,
154
163
  skin: 'line',
155
164
  // done: function (obj, first) {
@@ -173,7 +182,6 @@
173
182
 
174
183
  table.on('toolbar(sale_plan_follow_table)', function (obj) {
175
184
  if (obj.event === 'add') { // 监听添加操作
176
- console.log(parent.business_id);
177
185
  business_id = parent.business_id
178
186
  var content = miniPage.getHrefContent('/missions/businesses/new_follow_record?id=' + parent.id);
179
187
  var openWH = miniPage.getOpenWidthHeight();
@@ -200,7 +208,6 @@
200
208
  var data = obj.data;
201
209
  follow_up_id = obj.data.id;
202
210
  if (obj.event === 'delete') {
203
- console.log(data);
204
211
  layer.confirm('确定删除ID为' + data.id + "的跟进记录", function (index) {
205
212
  request.authDelete("missions/follow_ups/" + data.id, {}, function() {
206
213
  obj.del();
@@ -65,6 +65,12 @@
65
65
  <%= @follow_up.divide_rate %>%
66
66
  </div>
67
67
  </div>
68
+ <div class="ayui-form-item">
69
+ <label class="layui-form-label" style="width: 85px;">指定跟进人:</label>
70
+ <div class="layui-input-inline">
71
+ <%= @follow_up.assign_follow_ups.map{|d| d.staff.user.full_name}.join("、") %>
72
+ </div>
73
+ </div>
68
74
  <div class="layui-form-item layui-form-text">
69
75
  <label class="layui-form-label">商机说明:</label>
70
76
  <div class="layui-input-block" style="padding-right: 20px;">
@@ -50,7 +50,6 @@
50
50
  form.on('submit(saveBtn)', function(data) {
51
51
 
52
52
  request.authPost("missions/commons", data.field, function(res) {
53
- console.log(res.success == false)
54
53
  if (res.success == false) {
55
54
  layer.alert(res.msg)
56
55
  } else {
@@ -50,6 +50,7 @@
50
50
  ]
51
51
  ],
52
52
  limit: 20,
53
+ limits: [10,15,20,30,40,50,60,70,80,90],
53
54
  page: true,
54
55
  skin: 'line'
55
56
  });
@@ -0,0 +1,9 @@
1
+ json.data do
2
+ json.array! @staffs do |d|
3
+ json.value d.id
4
+ json.name d.user.full_name
5
+ end
6
+ end
7
+ json.count (@staffs.total_count/10 + 1)
8
+ json.code 0
9
+ json.msg "success"
@@ -129,7 +129,7 @@
129
129
  },
130
130
  {
131
131
  title: '操作',
132
- minWidth: 300,
132
+ minWidth: 200,
133
133
  toolbar: '#currentTableBar',
134
134
  align: "center",
135
135
  fixed: 'right'
@@ -138,6 +138,7 @@
138
138
  ],
139
139
 
140
140
  limit: 20,
141
+ limits: [10,15,20,30,40,50,60,70,80,90],
141
142
  page: true,
142
143
  skin: 'line'
143
144
  });
@@ -179,7 +180,6 @@
179
180
  */
180
181
  table.on('toolbar(currentTableFilter3)', function (obj) {
181
182
  if (obj.event === 'add') { // 监听添加操作
182
- console.log("a");
183
183
  var content = miniPage.getHrefContent('/missions/operation_plans/new_month');
184
184
  var openWH = miniPage.getOpenWidthHeight();
185
185
  monthPlanIndex = layer.open({
@@ -132,7 +132,7 @@
132
132
  },
133
133
  {
134
134
  title: '操作',
135
- minWidth: 350,
135
+ minWidth: 220,
136
136
  toolbar: '#monthlyTableBar',
137
137
  align: "center",
138
138
  fixed: 'right'
@@ -166,6 +166,7 @@
166
166
  },
167
167
 
168
168
  limit: 20,
169
+ limits: [10,15,20,30,40,50,60,70,80,90],
169
170
  page: true
170
171
  });
171
172
 
@@ -240,7 +241,7 @@
240
241
 
241
242
  var content = miniPage.getHrefContent('/missions/operation_reports/' + data.id + '/edit');
242
243
  var openWH = miniPage.getOpenWidthHeight();
243
-
244
+ from_edit_monthly = true
244
245
  MonthlyIndex = layer.open({
245
246
  title: '编辑',
246
247
  type: 1,
@@ -140,7 +140,7 @@
140
140
  },
141
141
  {
142
142
  title: '操作',
143
- minWidth: 280,
143
+ minWidth: 200,
144
144
  toolbar: '#week_plan_currentTableBar',
145
145
  align: "center",
146
146
  fixed: 'right'
@@ -149,6 +149,7 @@
149
149
  ],
150
150
 
151
151
  limit: 20,
152
+ limits: [10,15,20,30,40,50,60,70,80,90],
152
153
  page: true,
153
154
  skin: 'line'
154
155
  });
@@ -133,7 +133,7 @@
133
133
  },
134
134
  {
135
135
  title: '操作',
136
- width: 300,
136
+ minWidth: 220,
137
137
  toolbar: '#currentWeekTableBar',
138
138
  align: "center",
139
139
  fixed: 'right'
@@ -167,6 +167,7 @@
167
167
  },
168
168
 
169
169
  limit: 20,
170
+ limits: [10,15,20,30,40,50,60,70,80,90],
170
171
  page: true,
171
172
  });
172
173
 
@@ -243,7 +244,8 @@
243
244
  if (obj.event === 'edit') {
244
245
  var content = miniPage.getHrefContent('/missions/operation_reports/' + data.id + '/edit')
245
246
  var openWH = miniPage.getOpenWidthHeight();
246
- WeeklyIndex = layer.open({
247
+ from_edit_monthly = false
248
+ WeeklyIndex = layer.open({
247
249
  title: '编辑周报',
248
250
  type: 1,
249
251
  shade: 0.2,
@@ -70,6 +70,7 @@
70
70
  } else {
71
71
  layer.close(parent.index10)
72
72
  layer.close(parent.editWeek_index)
73
+ layer.close(parent.edit_week_index)
73
74
  table.reload('weekPlanTable1')
74
75
  table.reload('newWeeklyTable')
75
76
  table.reload('unfinish_table')
@@ -1,7 +1,12 @@
1
1
  <script type="text/html" id="newWeeklyToolbar">
2
2
  <div class="layui-btn-container">
3
+ {{# if(parent.from_edit_monthly){ }}
4
+ <span class="table-label">本月计划列表</span>
5
+ <button class="layui-btn layui-btn-normal layui-btn-sm data-add-btn pull-right" lay-event="add_month"> 添加计划</button>
6
+ {{# } else { }}
3
7
  <span class="table-label">本周计划列表</span>
4
8
  <button class="layui-btn layui-btn-normal layui-btn-sm data-add-btn pull-right" lay-event="add"> 添加计划</button>
9
+ {{# } }}
5
10
  </div>
6
11
  </script>
7
12
  <form class="layui-form layui-form-pane">
@@ -162,6 +167,27 @@
162
167
  $(window).on("resize", function () {
163
168
  layer.full(sindex);
164
169
  });
170
+ }else if (obj.event === 'add_month') { // 监听添加操作
171
+ from_weekly = true;
172
+ var content = miniPage.getHrefContent('/missions/operation_plans/new_month');
173
+ var openWH = miniPage.getOpenWidthHeight();
174
+ sindex = layer.open({
175
+ title: '添加计划',
176
+ type: 1,
177
+ shade: 0.2,
178
+ maxmin: true,
179
+ shadeClose: true,
180
+ area: [openWH[0] + 'px', openWH[1] + 'px'],
181
+ offset: [openWH[2] + 'px', openWH[3] + 'px'],
182
+ content: content,
183
+ success: function (layero, index) {
184
+ // 重新渲染弹层中的下拉选择框select
185
+ form.render('select');
186
+ }
187
+ });
188
+ $(window).on("resize", function () {
189
+ layer.full(sindex);
190
+ });
165
191
  }
166
192
  });
167
193
  table.on('tool(newWeeklyTable)', function (obj) {
@@ -196,7 +222,7 @@
196
222
  from_sales = true;
197
223
  content = miniPage.getHrefContent('/missions/operation_plans/edit_week?id=' + id);
198
224
  openWH = miniPage.getOpenWidthHeight();
199
- sindex = layer.open({
225
+ edit_week_index = layer.open({
200
226
  title: '编辑',
201
227
  type: 1,
202
228
  shade: 0.2,
@@ -75,9 +75,7 @@
75
75
  return false;
76
76
  }
77
77
  data.field['area_ids'] = area_ids;
78
- console.log(data.field);
79
78
  request.authPut("missions/places/" + data.field.id, data.field, function (res) {
80
- console.log(res.success == false)
81
79
  if (res.success == false) {
82
80
  layer.alert(res.msg)
83
81
  } else {
@@ -75,6 +75,7 @@
75
75
  ]
76
76
  ],
77
77
  limit: 20,
78
+ limits: [10,15,20,30,40,50,60,70,80,90],
78
79
  page: true
79
80
  });
80
81
 
@@ -3,9 +3,9 @@ json.data do
3
3
  json.id d.id
4
4
  json.name d.name
5
5
  json.area_id d.areas.present? ? d.areas.pluck(:name).join("、") : ''
6
- json.businesses_count EducodeSales::Business.joins(:last_follow_up).where("educode_sales_follow_ups.place_id = #{d.id}").count
7
- json.amount EducodeSales::Business.joins(:last_follow_up).where("educode_sales_follow_ups.place_id = #{d.id} AND educode_sales_follow_ups.stage_id IN (?)", @stage_ids).sum(:profit_amount).round(2)
8
- json.return_mount EducodeSales::Business.joins(:last_follow_up).where("educode_sales_follow_ups.place_id = #{d.id}").sum(:return_money)
6
+ json.businesses_count EducodeSales::Business.joins(:last_follow_up).where("educode_sales_follow_ups.clazz_id != ?", @x).where("educode_sales_follow_ups.place_id = #{d.id}").count
7
+ json.amount EducodeSales::Business.joins(:last_follow_up).where("educode_sales_follow_ups.clazz_id != ?", @x).where("educode_sales_follow_ups.place_id = #{d.id} AND educode_sales_follow_ups.stage_id IN (?)", @stage_ids).sum(:profit_amount).round(2)
8
+ json.return_mount EducodeSales::Business.joins(:last_follow_up).where("educode_sales_follow_ups.clazz_id != ?", @x).where("educode_sales_follow_ups.place_id = #{d.id}").sum(:return_money).round(2)
9
9
  end
10
10
  end
11
11
 
@@ -63,7 +63,6 @@
63
63
  return false;
64
64
  }
65
65
  data.field['area_ids'] = area_ids;
66
- console.log(data.field);
67
66
  request.authPost("missions/places", data.field, function (res) {
68
67
  if (res.success === false) {
69
68
  layer.alert(res.msg)
@@ -133,7 +133,7 @@
133
133
  },
134
134
  {
135
135
  title: '操作',
136
- minWidth: 280,
136
+ minWidth: 200,
137
137
  toolbar: '#week_plan_currentTableBar',
138
138
  align: "center",
139
139
  fixed: 'right'
@@ -142,6 +142,7 @@
142
142
  ],
143
143
 
144
144
  limit: 20,
145
+ limits: [10,15,20,30,40,50,60,70,80,90],
145
146
  page: true,
146
147
  });
147
148
 
@@ -258,7 +259,6 @@
258
259
  });
259
260
  } else if (obj.event === 'delete') {
260
261
  layer.confirm('确定删除' + data.id, function (index) {
261
- console.log("aaaaa");
262
262
  request.delete('missions/plans/' + data.id, {}, function (res) {
263
263
  layer.close(index);
264
264
  table.reload("monthPlanTable")
@@ -136,7 +136,7 @@
136
136
  },
137
137
  {
138
138
  title: '操作',
139
- width: 300,
139
+ minWidth: 220,
140
140
  toolbar: '#currentmonthlyTableBar',
141
141
  align: "center",
142
142
  fixed: 'right'
@@ -171,6 +171,7 @@
171
171
  },
172
172
 
173
173
  limit: 20,
174
+ limits: [10,15,20,30,40,50,60,70,80,90],
174
175
  page: true
175
176
  });
176
177
 
@@ -138,7 +138,7 @@
138
138
  },
139
139
  {
140
140
  title: '操作',
141
- minWidth: 280,
141
+ minWidth: 200,
142
142
  toolbar: '#week_plan_currentTableBar',
143
143
  align: "center",
144
144
  fixed: 'right'
@@ -147,6 +147,7 @@
147
147
  ],
148
148
 
149
149
  limit: 20,
150
+ limits: [10,15,20,30,40,50,60,70,80,90],
150
151
  page: true,
151
152
  skin: 'line'
152
153
  });
@@ -138,7 +138,7 @@
138
138
  },
139
139
  {
140
140
  title: '操作',
141
- minWidth: 300,
141
+ minWidth: 220,
142
142
  toolbar: '#currentWeeklyTableBar',
143
143
  align: "center",
144
144
  fixed: 'right'
@@ -172,6 +172,7 @@
172
172
  },
173
173
 
174
174
  limit: 20,
175
+ limits: [10,15,20,30,40,50,60,70,80,90],
175
176
  page: true
176
177
  });
177
178
 
@@ -243,6 +244,7 @@
243
244
  if (obj.event === 'edit') {
244
245
  var content = miniPage.getHrefContent('/missions/sale_reports/' + data.id + "/edit");
245
246
  var openWH = miniPage.getOpenWidthHeight();
247
+ from_edit_monthly = false
246
248
  sindex = layer.open({
247
249
  title: '编辑周报',
248
250
  type: 1,
@@ -101,7 +101,6 @@
101
101
  return false;
102
102
  })
103
103
  form.on('submit(data)', function (data) {
104
- console.log('data', data)
105
104
  Rails.ajax({
106
105
  url: '/missions/roles/'+ parent.role_id + "/view",
107
106
  type: 'PUT',
@@ -48,6 +48,7 @@
48
48
  }]
49
49
  ],
50
50
  limit: 20,
51
+ limits: [10,15,20,30,40,50,60,70,80,90],
51
52
  page: true
52
53
  })
53
54
 
@@ -60,7 +61,6 @@
60
61
  var value = obj.value //得到修改后的值
61
62
  ,data = obj.data //得到所在行所有键值
62
63
  ,field = obj.field; //得到字段
63
- console.log(obj.data);
64
64
  request.authPut('missions/roles/' + data.id + '/update_role/', data,
65
65
  function(res) {
66
66
  if (res.success) {