educode_sales 0.9.39 → 0.9.40

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: '0488628c96716313e1eea256035cfdb1d8cf279a5260b24637ce11f9d4bad0da'
4
- data.tar.gz: b5706f45f7360c978624378e74ede31f1a429868a8b5574b413dc9932f679784
3
+ metadata.gz: 41be1a85301a5d440bb31501f01a0ff9db5158f0890c5096916ff238ffc34e38
4
+ data.tar.gz: 81a70162b88c7d09eaf90b4181177f757d993264761d65ec376e7719307da53e
5
5
  SHA512:
6
- metadata.gz: 584eed74e015e9c2f9d9e90deb17d2ff45b8b255fb4886ffa7244834b2fe661d49731606a3c2daa5b7d9f1f2e12097a4590cdfd1fe9df3c2534650c6d122a56a
7
- data.tar.gz: 36c75432a6286b056b4f4eee4a34ba68a12ab23265a92d41fb7d6a437385fb544fb33efa31d8d9fbac5db42d9df4ec979c477d53325857510eb5fa439e2c259f
6
+ metadata.gz: 99f2999ebcb569c813f3251d060e0347a5a2e488ae1f778d4a51b594ff03416854f7ef9ae8cc0fe5a433f95417801a7549c16e56f1c8a96d0e031a6ec2b9539b
7
+ data.tar.gz: 62a7671b59dbb8ffb5ad827d310ead46aecf6c5de76b6151d4d6c0c56a81c6835a490c4171d4ee55e40317af0098e30ad87ebab6e9be0be112442a0c15747ddc
@@ -10,7 +10,8 @@ module EducodeSales
10
10
  respond_to do |format|
11
11
  format.html do
12
12
  common = Common.find_by(clazz: 'staff_type', name: '销售')
13
- @staffs = Staff.joins(:user).where(job_type: common.id).where.not(role_id: 11).map { |d| [d.user.real_name, d.id]} # [[], [], ............]
13
+ @staffs = Staff.joins(:user).where(job_type: common.id).where.not(role_id: 11).map { |d| [d.user.real_name, d.id]}
14
+ gon.staffs = Staff.joins(:user).where(job_type: common.id).where.not(role_id: 11).map { |d| {name: d.user.real_name, value: d.id } }
14
15
  # @more = can?(:create, EducodeSales::SalePlan) || can?(:update, EducodeSales::Business) || can?(:destroy, EducodeSales::Business) || can?(:show_file, EducodeSales::Business)
15
16
  @more = true
16
17
  gon.menus = []
@@ -40,7 +41,7 @@ module EducodeSales
40
41
  gon.bidded_date = Time.new(params[:bidded_date_year]).strftime("%Y-%m-%d") + " - " + Time.new(params[:bidded_date_year]).end_of_year.strftime("%Y-%m-%d")
41
42
  end
42
43
  end
43
-
44
+
44
45
  if params[:signed_date_year].present? && params[:signed_date_year] != '全部'
45
46
  gon.signed_date = Time.new(params[:signed_date_year]).strftime("%Y-%m-%d") + " - " + Time.new(params[:signed_date_year]).end_of_year.strftime("%Y-%m-%d")
46
47
  end
@@ -30,7 +30,7 @@
30
30
  <div class="layui-inline">
31
31
  <label class="layui-form-label">最新跟进人</label>
32
32
  <div class="layui-input-inline">
33
- <%= select_tag "staff_id", options_for_select(@staffs, params[:staff_id]), { 'lay-filter': 'staff_id', include_blank: true } %>
33
+ <div id="staffs_id" style="width: 190px;"></div>
34
34
  </div>
35
35
  </div>
36
36
  <div class="layui-inline">
@@ -268,6 +268,13 @@
268
268
  data: gon.business_type
269
269
  })
270
270
 
271
+ var staff_list = xmSelect.render({
272
+ el: '#staffs_id',
273
+ data: gon.staffs,
274
+ filterable: true,
275
+ radio: true,
276
+ })
277
+
271
278
  var business_step_list = xmSelect.render({
272
279
  el: '#business_step',
273
280
  data: gon.business_step
@@ -322,6 +329,7 @@
322
329
  data.business_year = gon.business_year;
323
330
  data.business_type = business_type_list.getValue('valueStr')
324
331
  data.business_step = business_step_list.getValue('valueStr');
332
+ data.staff_id = staff_list.getValue('valueStr');
325
333
 
326
334
  table = layui.table;
327
335
  var cols_table = [
@@ -413,6 +421,19 @@
413
421
  title: '最新跟进人',
414
422
  hide: gon.filter.last_follow_person
415
423
  },
424
+ {
425
+ field: 'no_followup_days',
426
+ width: 100,
427
+ title: '无跟进天数',
428
+ hide: gon.filter.no_followup_days
429
+ },
430
+ {
431
+ field: 'created_at',
432
+ width: 200,
433
+ title: '商机创建时间',
434
+ sort: true,
435
+ hide: gon.filter.created_at
436
+ },
416
437
  {
417
438
  field: 'latest_time',
418
439
  width: 200,
@@ -701,6 +722,7 @@
701
722
  data.place_id = index_place_list.getValue('valueStr');
702
723
  data.business_type = business_type.toString();
703
724
  data.business_step = business_step.toString();
725
+ data.staff_id = staff_list.getValue('valueStr');
704
726
  layer.load(0, {});
705
727
  request.authPost("/missions/businesses/get_export_data", {
706
728
  name: data.name,
@@ -912,6 +934,7 @@
912
934
  business_step.push(d.value);
913
935
  })
914
936
  data.field.place_id = index_place_list.getValue('valueStr');
937
+ data.field.staff_id = staff_list.getValue('valueStr');
915
938
  data.field.business_type = business_type.toString();
916
939
  data.field.business_step = business_step.toString();
917
940
  if (search['clazz']) {
@@ -958,6 +981,7 @@
958
981
  business_type_list.setValue([])
959
982
  business_step_list.setValue([])
960
983
  index_place_list.setValue([])
984
+ staff_list.setValue([])
961
985
 
962
986
  return false;
963
987
  });
@@ -21,7 +21,9 @@ json.data do
21
21
  json.signed_date d.last_follow_up&.signed_date.to_s
22
22
  json.o_business_deployment EducodeSales::FollowUp::BUSINESS_DEPLOYMENT[1..-1].to_h.invert[d.last_follow_up&.o_business_deployment]
23
23
  json.service_end_time d.last_follow_up&.service_start_time.to_s + "-" + d.last_follow_up&.service_end_time.to_s
24
-
24
+ json.created_at d.created_at.to_s
25
+ json.no_followup_days (d['latest_time'] ? DateTime.parse(Time.now.strftime("%Y-%m-%d")) - DateTime.parse(d['latest_time'].strftime("%Y-%m-%d")) : DateTime.parse(Time.now.strftime("%Y-%m-%d")) - DateTime.parse(d.created_at.strftime("%Y-%m-%d"))).to_i
26
+
25
27
  json.divide_rate d.divide_rate
26
28
  json.divide_money d.divide_amount.to_f.round(2)
27
29
  json.budget_amount d.budget_amount.to_f.round(2) #d.follow_ups.where(stage_id: @budget_stage_ids).order("created_at desc").first&.total_amount&.round(2) || 0
@@ -1,3 +1,3 @@
1
1
  module EducodeSales
2
- VERSION = '0.9.39'
2
+ VERSION = '0.9.40'
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.39
4
+ version: 0.9.40
5
5
  platform: ruby
6
6
  authors:
7
7
  - anke1460
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-29 00:00:00.000000000 Z
11
+ date: 2023-02-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails