educode_sales 0.9.24 → 0.9.25

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8c2b7f37f4b1fda07383d7cca772b7ee22fab18ca21a73ea6865f3d09e208dbc
4
- data.tar.gz: 92ab5c8bd9aa56c678d3f54e7720ba6d851d4745f16c55c6b841dd9810128471
3
+ metadata.gz: 7326e12d52dc97f7f251f63b033f3c470591be1100f6f9bd06ab057e9a21bd14
4
+ data.tar.gz: 80817718f3efdcb1a247095f468123ad1111d996dffe3f858cd6b29aab0f52ad
5
5
  SHA512:
6
- metadata.gz: 0f823e988d77eb4aff8ad1999a4ef058beb639bba844948144e444cd70065d0835e6865801537aabe4d03c3835f7db686edec6844de218afd925a14a2134801d
7
- data.tar.gz: 6009835052d5b11ce9d9609d16e2cb5e26d0cda5afb6f9bbeb3c2d8b7acd61e4a1ea1be955e9d6873143e25d5ec48e79903d3485ed42d7c4e7a8a348546f79f4
6
+ metadata.gz: 4430c0f16dac2deda9e833d7962020fd8727a60d43b3823b631ac7cc5196d40c0bbd66b8170ac114e6cdf5dc197978f3674dfe2d5dad720963baefce8537f76a
7
+ data.tar.gz: 34fb199238d1d1181e1b07fb8f2e00371e271aa9cc3689af2a916dbeb089f9a2624a0c14140de4cbc550d9faa04a03525db1c9407e9b5d3ae439e8d8152946f9
@@ -173,6 +173,12 @@ module EducodeSales
173
173
  ").where("educode_sales_follow_ups.year = ?", params[:q][:business_year])
174
174
  end
175
175
 
176
+ if params[:q].present? && params[:q][:o_business_deployment].present?
177
+ @businesses = @businesses.joins("
178
+ JOIN educode_sales_follow_ups ON educode_sales_businesses.last_follow_up_id = educode_sales_follow_ups.id
179
+ ").where("educode_sales_follow_ups.o_business_deployment = ?", params[:q][:o_business_deployment])
180
+ end
181
+
176
182
  if params[:q].present? && params[:q][:area].present?
177
183
  p = EducodeSales::Common.find(params[:q][:area]).name
178
184
  if @current_admin.is_admin?
@@ -239,6 +245,7 @@ module EducodeSales
239
245
  educode_sales_businesses.*,
240
246
  last_follow.invitation_at,
241
247
  last_follow.budget_amount,
248
+ last_follow.o_business_deployment,
242
249
  last_follow.service_time_long,
243
250
  last_follow.service_end_time,
244
251
  last_follow.service_start_time,
@@ -195,15 +195,15 @@
195
195
  },
196
196
  where: {q: search, sort: sort}
197
197
  }, 'data');
198
- table.reload('businesses_table', {
199
- page: {
200
- curr: 1
201
- },
202
- where: {q: search, sort: sort}
203
- }, 'data');
204
- form.val('search_form', {
205
- name: data.field.name, department: data.field.department, staff_id: data.field.staff_id, area: data.field.area , description: data.field.description
206
- })
198
+ // table.reload('businesses_table', {
199
+ // page: {
200
+ // curr: 1
201
+ // },
202
+ // where: {q: search, sort: sort}
203
+ // }, 'data');
204
+ // form.val('search_form', {
205
+ // name: data.field.name, department: data.field.department, staff_id: data.field.staff_id, area: data.field.area , description: data.field.description
206
+ // })
207
207
  return false;
208
208
  });
209
209
 
@@ -19,8 +19,8 @@
19
19
  <% text += "二、本月已组织会议 \n\n"%>
20
20
  <% text += "三、客户跟进情况 \n"%>
21
21
  <% @followups.each_with_index do |d, i| %>
22
- <% text += "#{i+1}、**学校--**商机:#{d .description}\n" %>
23
- <p><%= i+1 %>、**学校--**商机:<%= d .description%></p>
22
+ <% text += "#{i+1}、#{d.business&.department&.school&.name}--**商机:#{d.description}\n" %>
23
+ <p><%= i+1 %>、<%= d.business&.department&.school&.name %>--**商机:<%= d.description%></p>
24
24
  <% end %>
25
25
 
26
26
  <% text += "\n四、需要协助支持事宜 \n\n"%>
@@ -94,9 +94,14 @@
94
94
  </div>
95
95
  </div>
96
96
  <div class="layui-inline show_item" style="<%= params[:name] || params[:type] ? '' : 'display:none;' %>">
97
- <label class="layui-form-label">编号</label>
97
+ <label class="layui-form-label">部署类型</label>
98
98
  <div class="layui-input-inline">
99
- <input type="text" class="layui-input" id="number" name="number" placeholder=" - " autocomplete="off">
99
+ <select name="o_business_deployment">
100
+ <option value=""></option>
101
+ <option value="1">公有云</option>
102
+ <option value="2">私有云</option>
103
+ <option value="3">混合云</option>
104
+ </select>
100
105
  </div>
101
106
  </div>
102
107
  <div class="layui-inline">
@@ -225,8 +230,8 @@
225
230
  value: gon.date_at
226
231
  });
227
232
 
228
-
229
-
233
+
234
+
230
235
  // $('#businesses_table_wraper .layui-table-body').on('scroll', function(e) {
231
236
  // var leftPx = $(e.target).scrollLeft(); //获取表格body,滚动条距离左边的长度
232
237
  // var left = 'translateX(-' + leftPx + 'px)';
@@ -246,7 +251,7 @@
246
251
  el: '#business_type',
247
252
  data: gon.business_type
248
253
  })
249
-
254
+
250
255
  var business_step_list = xmSelect.render({
251
256
  el: '#business_step',
252
257
  data: gon.business_step
@@ -299,7 +304,6 @@
299
304
 
300
305
  var data = form.val("search_form");
301
306
  data.business_year = gon.business_year;
302
-
303
307
  data.business_type = business_type_list.getValue('valueStr')
304
308
  data.business_step = business_step_list.getValue('valueStr');
305
309
 
@@ -547,6 +551,7 @@
547
551
  var business_table = table.render({
548
552
  elem: '#businesses_table',
549
553
  url: '/missions/businesses',
554
+ autoSort: false,
550
555
  where: {q: data},
551
556
  toolbar: '#bussinessBar',
552
557
  defaultToolbar: ['filter'],
@@ -864,11 +869,10 @@
864
869
 
865
870
 
866
871
 
867
- var sort = {}, search = {};
868
- <% if params[:name].present? %>
869
- search.name = "<%= params[:name] %>";
870
- <% end %>
872
+ var sort = {}, search = data;
873
+
871
874
  table.on('sort(businesses_table)', function (obj) {
875
+ var data = form.val("search_form");
872
876
  sort.field = obj.field;
873
877
  sort.order = obj.type;
874
878
  table.reload('businesses_table', {
@@ -905,15 +909,15 @@
905
909
  },
906
910
  where: {q: search, sort: sort}
907
911
  }, 'data');
908
- table.reload('teachers_table', {
909
- page: {
910
- curr: 1
911
- },
912
- where: {q: search, sort: sort}
913
- }, 'data');
914
- form.val('search_follows', {
915
- name: data.field.name, department: data.field.department, staff_id: data.field.staff_id, area: data.field.area
916
- })
912
+ // table.reload('teachers_table', {
913
+ // page: {
914
+ // curr: 1
915
+ // },
916
+ // where: {q: search, sort: sort}
917
+ // }, 'data');
918
+ // form.val('search_follows', {
919
+ // name: data.field.name, department: data.field.department, staff_id: data.field.staff_id, area: data.field.area
920
+ // })
917
921
  if (search['clazz'] == 'me') {
918
922
  $(".my-btn").addClass("selected-btn");
919
923
  } else if (search['clazz'] == 'followes') {
@@ -19,13 +19,9 @@ json.data do
19
19
  json.reception_at d.last_follow_up&.reception_at.to_s
20
20
  json.bidded_date d.last_follow_up&.bidded_date.to_s
21
21
  json.signed_date d.last_follow_up&.signed_date.to_s
22
+ json.o_business_deployment EducodeSales::FollowUp::BUSINESS_DEPLOYMENT[1..-1].to_h.invert[d.last_follow_up&.o_business_deployment]
22
23
  json.service_end_time d.last_follow_up&.service_start_time.to_s + "-" + d.last_follow_up&.service_end_time.to_s
23
- EducodeSales::FollowUp::BUSINESS_DEPLOYMENT[1..-1].each do |m|
24
- if d.last_follow_up&.o_business_deployment == m[1]
25
- json.o_business_deployment m[0]
26
- break
27
- end
28
- end
24
+
29
25
  json.divide_rate d.divide_rate
30
26
  json.divide_money d.divide_amount
31
27
  json.budget_amount d.budget_amount #d.follow_ups.where(stage_id: @budget_stage_ids).order("created_at desc").first&.total_amount&.round(2) || 0
@@ -25,15 +25,20 @@
25
25
  </form>
26
26
  </div>
27
27
  <canvas id="myChart" width="960" height="400"></canvas>
28
+ <div class="two-header" style="margin-top: 30px;">
29
+ <table id="followup_table" lay-filter="followup_table"></table>
30
+ </div>
28
31
  </div>
29
32
  </div>
30
33
  <script>
31
- layui.use(['form', 'jquery', 'request', 'element'], function () {
32
- form = layui.form;
34
+ layui.use(['form', 'jquery', 'request', 'element', 'table'], function () {
35
+ var table = layui.table,
36
+ form = layui.form;
37
+ chart_data = <%=raw @follow_count_data.to_json %>;
33
38
  var ctx = document.getElementById('myChart');
34
39
  myChart = new Chart(ctx, {
35
40
  type: 'line',
36
- data: <%=raw @follow_count_data.to_json %>,
41
+ data: chart_data,
37
42
  options: {
38
43
  elements: {
39
44
  line: {
@@ -42,12 +47,46 @@
42
47
  }
43
48
  }
44
49
  });
50
+
51
+
45
52
  form.render();
53
+
54
+ function renderTable(chart_data) {
55
+ var labels = [];
56
+ fields = [
57
+ {field: 'col0', title: '姓名', width:100}
58
+ ];
59
+ chart_data.labels.forEach(function(d, i) {
60
+ labels.push(d);
61
+ fields.push({title: d.split("(").join("<br/>").replace(")", ""), field: 'col' + (i + 1), width:160, align: 'center'})
62
+ })
63
+ var table_data = [];
64
+ chart_data.datasets.forEach(function(d, i) {
65
+ var value = {}
66
+ value['col0'] = d.label;
67
+ d.data.forEach(function(v, i1) {
68
+ value['col' + (i1 + 1)] = v;
69
+ })
70
+ table_data.push(value);
71
+ })
72
+ table.render({
73
+ elem: '#followup_table',
74
+ height: 312,
75
+ url: '',
76
+ limit: 30,
77
+ page: true,
78
+ data: table_data,
79
+ cols: [fields]
80
+ });
81
+ }
82
+
83
+ renderTable(chart_data);
46
84
  laydate.render({
47
85
  elem: '#date',
48
86
  range: true
49
87
  });
50
88
 
89
+
51
90
  laydate.render({
52
91
  elem: '#date_week',
53
92
  range: true
@@ -101,7 +140,8 @@
101
140
  } else {
102
141
  myChart.data.datasets = res.data.datasets;
103
142
  myChart.data.labels = res.data.labels;
104
- myChart.update()
143
+ myChart.update();
144
+ renderTable(res.data);
105
145
  }
106
146
  }
107
147
  });
@@ -297,4 +297,7 @@
297
297
  .ul-down .layui-icon-down{
298
298
  display: none;!important;
299
299
  }
300
+ .two-header thead .layui-table-cell {
301
+ height: auto;
302
+ }
300
303
  </style>
@@ -1,3 +1,3 @@
1
1
  module EducodeSales
2
- VERSION = '0.9.24'
2
+ VERSION = '0.9.25'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: educode_sales
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.24
4
+ version: 0.9.25
5
5
  platform: ruby
6
6
  authors:
7
7
  - anke1460
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-12-06 00:00:00.000000000 Z
11
+ date: 2022-12-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails