educode_sales 1.10.0 → 1.10.2

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: 00f95a116861234dd0fca5a1714c085e1bec0bddc43a23eb887d52486ac72d16
4
- data.tar.gz: 771c88244cbf37b3521d6ca60d9571d10bc22d90ae698ebf885608aeb4560a59
3
+ metadata.gz: 8319a1ab978e05583c3bf97bba97c61d872dbb3165d8e7f62888dc43747732fa
4
+ data.tar.gz: 12b16d2e7c5c4d8c0c0e6051625308c1dc50693d5dfc26452cf2336ca796736f
5
5
  SHA512:
6
- metadata.gz: 9a81d2f314ed6071cf408581e4725e337fdfcca85873d90945b6fd2b26016437b497c91e34ddfc41deb0602898d150572b7f4a5cf13e4189fb50d9b7414863aa
7
- data.tar.gz: 5dfc28b6e674a4241e2c2e717d84fc2b6cf3d3825794d96be7edbb771718cab0841ee055a87b6df43a40b6c97ba1b4d61b280d9184c1e8b4cee44d64c19dfb63
6
+ metadata.gz: 3a134e29aa9a9f3543be3edc4e63ee1e9d5f87f4879905a7b166a2cafb6e85ace9b14d2aa736a3e3e0d0797723da19050a590abd6fff4eec7cd56aa012dc983f
7
+ data.tar.gz: baf71ec0ec85d306725c0c75f6445b89c7f8953dabc7914a569cecb963fd183d95eafe92540023739d82c07c32819406a40ff8265c602340ea5239d1587c8ccf
@@ -195,8 +195,6 @@ module EducodeSales
195
195
  LEFT JOIN educode_sales_businesses AS d ON d.department_id = departments.id AND d.deleted_at is NULL
196
196
  GROUP BY schools.id, departments.id
197
197
  ) AS de ON m.id = de.id AND m.department_id = de.department_id
198
-
199
-
200
198
  ) AS s")
201
199
  if @current_admin.is_admin?
202
200
  # @customers = School.all
@@ -230,10 +228,10 @@ module EducodeSales
230
228
  LEFT JOIN departments ON s.department_id = departments.id
231
229
  ")
232
230
 
233
- part_a_ids = CustomerFollow.all.pluck(:school_id)
234
- part_b_ids = Business.pluck(:school_id)
235
- ids = part_a_ids + part_b_ids + CustomerAdd.all.pluck(:school_id)
236
- @customers = @customers.where(id: ids.uniq)
231
+ # part_a_ids = CustomerFollow.all.pluck(:school_id)
232
+ # part_b_ids = Business.pluck(:school_id)
233
+ # ids = part_a_ids + part_b_ids + CustomerAdd.all.pluck(:school_id)
234
+ # @customers = @customers.where(id: ids.uniq)
237
235
  if params[:q].present? && params[:q][:name].present?
238
236
  @customers = @customers.where("schools.name like ?", "%#{params[:q][:name]}%")
239
237
  end
@@ -246,7 +244,7 @@ module EducodeSales
246
244
  end
247
245
  if params[:q].present? && params[:q][:property].present?
248
246
  property = params[:q][:property].split(",").map(&:to_i)
249
- @customers = @customers.joins(:school_tags).where("school_tags.id in (?)", property).distinct
247
+ @customers = @customers.joins("JOIN school_tag_middles ON school_tag_middles.school_id = s.id INNER JOIN school_tags ON school_tags.id = school_tag_middles.school_tag_id").where("school_tags.id in (?)", property).distinct
250
248
  end
251
249
 
252
250
  if params[:q].present? && params[:q][:date].present?
@@ -85,7 +85,12 @@ module EducodeSales
85
85
 
86
86
  def create
87
87
  load_business
88
- follow_up = @business.follow_ups.build(follow_up_params)
88
+ if @business.last_follow_up
89
+ follow_up = @business.last_follow_up.dup
90
+ follow_up.assign_attributes(follow_up_params)
91
+ else
92
+ follow_up = @business.follow_ups.build(follow_up_params)
93
+ end
89
94
  if params[:service_time].present?
90
95
  date = params[:service_time].split(" - ")
91
96
  follow_up.service_start_time = date[0]
@@ -123,7 +128,8 @@ module EducodeSales
123
128
  money.follow_up_id = follow_up.id
124
129
  money.save
125
130
  end
126
-
131
+ # 合同里签到日期全同步到最新跟进
132
+ last_follow_up.contract_date_lists.update_all(follow_up_id: follow_up.id)
127
133
  end
128
134
  @business.update(last_follow_up_id: follow_up.id, clazz_id: follow_up.clazz_id, p_deploy_time: params[:deploy_time])
129
135
  # 增加o商机编号
@@ -144,6 +150,8 @@ module EducodeSales
144
150
  business.clazz_id = business.follow_ups.last&.clazz_id
145
151
  end
146
152
  business.update(last_follow_up: business.follow_ups.last, return_money: MoneyPlan.where(clazz: '实际回款', follow_up_id: business.follow_ups.last&.id).sum(:amount))
153
+ # 合同里签到日期全同步到最新跟进
154
+ follow_up.contract_date_lists.update_all(follow_up: business.follow_ups.last) if business.follow_ups.last.present?
147
155
  end
148
156
  render_success
149
157
  else
@@ -119,7 +119,8 @@ module EducodeSales
119
119
  end
120
120
 
121
121
  def search_money_plans
122
- @data = MoneyPlan.joins(business: :school)
122
+ # @data = MoneyPlan.joins(business: [:school, :last_follow_up])
123
+ @data = MoneyPlan.joins("JOIN educode_sales_businesses ON educode_sales_businesses.last_follow_up_id = educode_sales_money_plans.follow_up_id JOIN schools ON schools.id = educode_sales_businesses.school_id")
123
124
  if params[:q].present?
124
125
  @data = @data.where("educode_sales_businesses.name like :q OR educode_sales_businesses.number like :q OR schools.name like :q ", q: "%#{params[:q]}%").limit(20)
125
126
  end
@@ -23,7 +23,7 @@ module EducodeSales
23
23
  enum status: %w[未完成 已完成]
24
24
  enum types: %w[低定制 非定制 高定制 全定制]
25
25
  enum model: %w[本地版 线上版 混合版]
26
- enum idea_type: %w[售前 售后]
26
+ enum idea_type: %w[建设方案 申报论证 市场调研 课程建设 报价清单 交流汇报 招标参数 资质申报 产品手册 宣传海报 课题论文 投标支持 其他类]
27
27
 
28
28
  serialize :assist_staff_ids,Array
29
29
  serialize :attachment_ids, Array
@@ -46,7 +46,7 @@
46
46
  placeholder="请选择日期">
47
47
  </div>
48
48
  </div>
49
- <div class="layui-inline">
49
+ <div class="layui-inline">
50
50
  <label class="layui-form-label">中标时间</label>
51
51
  <div class="layui-input-inline">
52
52
  <input type="text" class="layui-input" name="bidded_date" autocomplete="off" id="invitation_at_add"
@@ -55,6 +55,7 @@
55
55
  </div>
56
56
  </div>
57
57
  <br>
58
+ <!--
58
59
  <div class="layui-inline">
59
60
  <label class="layui-form-label">签单时间</label>
60
61
  <div class="layui-input-inline">
@@ -62,14 +63,15 @@
62
63
  value="<%= @last_follow_up&.signed_date %>"
63
64
  placeholder="请选择日期">
64
65
  </div>
65
- </div>
66
+ </div> -->
66
67
  <input type="hidden" class="layui-input" name="reception_at" value="<%= @last_follow_up&.reception_at %>">
67
- <div class="layui-inline">
68
+ <input type="hidden" class="layui-input" name="deploy_time" value="<%= @last_follow_up&.deploy_time %>">
69
+ <!-- <div class="layui-inline">
68
70
  <label class="layui-form-label">部署时间</label>
69
71
  <div class="layui-input-inline">
70
72
  <input type="text" class="layui-input" name="deploy_time" value="<%= @last_follow_up&.deploy_time %>" id="p_deploy_time" placeholder="请选择日期">
71
73
  </div>
72
- </div>
74
+ </div> -->
73
75
  <br>
74
76
  <div class="layui-inline service_show layui-hide">
75
77
  <label class="layui-form-label required">服务期</label>
@@ -78,12 +80,12 @@
78
80
  </div>
79
81
  </div>
80
82
 
81
- <div class="layui-inline deployment_type layui-hide">
83
+ <!-- <div class="layui-inline deployment_type layui-hide">
82
84
  <label class="layui-form-label required">部署类型</label>
83
85
  <div class="layui-input-inline">
84
86
  <%= select_tag "o_business_deployment", options_for_select(@deployment_type, @last_follow_up&.o_business_deployment), class: 'required' %>
85
87
  </div>
86
- </div>
88
+ </div> -->
87
89
 
88
90
  <br class="service_show layui-hide">
89
91
  <div class="layui-inline">
@@ -94,8 +96,9 @@
94
96
  </div>
95
97
  客户采购支出的费用。中标额的生命历程:1.在最初阶段,是商机的预算总额;2.在挂网阶段,是项目的挂网预算总额;3.在中标阶段,是项目的中标总额。
96
98
  </div>
97
- <br>
98
- <div class="layui-inline">
99
+ <br>
100
+ <!--
101
+ <div class="layui-inline">
99
102
  <label class="layui-form-label">合同额(万)</label>
100
103
  <div class="layui-input-inline">
101
104
  <input name="actual_amount" type="number" class="layui-input" autocomplete="off" placeholder="本单位的签单金额"
@@ -104,13 +107,15 @@
104
107
  客户签给头歌的费用。合同额的生命历程:1.在中标之前,合同额都是0;2.在中标之后,实际与头歌签合同的金额。
105
108
  </div>
106
109
  <br>
110
+ -->
107
111
  <div class="layui-inline new_place_select">
108
112
  <label class="layui-form-label">渠道</label>
109
113
  <div class="layui-input-inline" style="">
110
114
  <div id="place" style="width: 190px;"></div>
111
115
  </div>
112
116
  </div>
113
- <br>
117
+ <br>
118
+ <!--
114
119
  <div class="layui-inline">
115
120
  <label class="layui-form-label">渠道分成(万)</label>
116
121
  <div class="layui-input-inline">
@@ -119,6 +124,7 @@
119
124
  中标额里,渠道拿到的部分。
120
125
  </div>
121
126
  <br>
127
+ -->
122
128
  <div class="layui-inline">
123
129
  <label class="layui-form-label">预算金额(万)</label>
124
130
  <div class="layui-input-inline">
@@ -269,49 +275,46 @@
269
275
  })
270
276
  }
271
277
  })
272
- var place_list = xmSelect.render({
273
- el: '#place',
274
- remoteSearch: true,
275
- model: {
276
- icon: 'hidden',
277
- label: {
278
- type: 'text',
279
- text: {
280
- //左边拼接的字符
281
- left: '',
282
- //右边拼接的字符
283
- right: '',
284
- //中间的分隔符
285
- separator: ', ',
286
- },
287
- }
288
- },
289
- clickClose: true,
290
- delay: 1000,
291
- paging: true,
292
- radio: true,
293
- pageRemote: true,
294
- filterable: true,
295
- remoteMethod: function (val, cb, show, pageIndex) {
296
- $.ajax('/missions/sales_place', {
297
- method: 'get',
298
- data: {
299
- q: val,
300
- page: pageIndex
301
- },
302
- dataType: 'json',
303
- success: function (res) {
304
- var data = res.data;
305
- if (res.code == 0) {
306
- cb(res.data, res.count);
307
- } else {
308
- layer.msg(res.msg, {time: 2000, icon: 2, shade: 0.01});
309
- }
278
+ var place_list = xmSelect.render({
279
+ el: '#place',
280
+ remoteSearch: true,
281
+ model: {
282
+ icon: 'hidden',
283
+ label: {
284
+ type: 'text',
285
+ text: {
286
+ left: '',
287
+ right: '',
288
+ separator: ', ',
289
+ },
290
+ }
291
+ },
292
+ clickClose: true,
293
+ delay: 1000,
294
+ paging: true,
295
+ radio: true,
296
+ pageRemote: true,
297
+ filterable: true,
298
+ remoteMethod: function (val, cb, show, pageIndex) {
299
+ $.ajax('/missions/sales_place', {
300
+ method: 'get',
301
+ data: {
302
+ q: val,
303
+ page: pageIndex
304
+ },
305
+ dataType: 'json',
306
+ success: function (res) {
307
+ var data = res.data;
308
+ if (res.code == 0) {
309
+ cb(res.data, res.count);
310
+ } else {
311
+ layer.msg(res.msg, {time: 2000, icon: 2, shade: 0.01});
312
+ }
310
313
 
311
- }
312
- })
313
- }
314
- })
314
+ }
315
+ })
316
+ }
317
+ })
315
318
 
316
319
  sales_list.setValue(gon.sales);
317
320
  place_list.setValue(gon.place);
@@ -399,202 +399,7 @@
399
399
  toolbar: '#toolbarDemo',
400
400
  totalRow:true,
401
401
  defaultToolbar: ['filter'],
402
- cols: [
403
- [
404
- {
405
- field: 'id',
406
- width: 60,
407
- title:'序号',type: 'numbers',
408
- totalRowText:'合计',
409
- fixed: 'left'
410
-
411
- },
412
- {
413
- field: 'name',
414
- width: 100,
415
- title: '姓名',
416
- fixed: 'left',
417
- templet: "#name"
418
- },
419
- {
420
- field: 'realname',
421
- width: 100,
422
- title: '真实姓名',
423
- },
424
- {
425
- field: 'school',
426
- width: 160,
427
- title: '单位',
428
- templet:'<div><span title="{{d.school}}">{{d.school}}</span></div>'
429
-
430
- },
431
- {
432
- field: 'department',
433
- width: 130,
434
- title: '部门',
435
- templet:'<div><span title="{{d.department}}">{{d.department}}</span></div>'
436
- },
437
- {
438
- field: 'majors',
439
- width: 160,
440
- title: '专业',
441
- },
442
- {
443
- field: 'area',
444
- width: 80,
445
- title: '区域',
446
- },
447
- {
448
- field: 'business_count',
449
- width: 120,
450
- title: '单位商机数',
451
- },
452
- {
453
- field: 'professional_title',
454
- title: '职称',
455
- width: 80,
456
- templet: '#show_follow'
457
- },
458
- {
459
- field: 'job',
460
- width: 80,
461
- title: '职务',
462
- templet: '#show_keys'
463
-
464
- },
465
- {
466
- field: 'source',
467
- width: 90,
468
- title: '来源',
469
- },
470
- {
471
- field: 'attitude',
472
- width: 60,
473
- title: '态度',
474
- },
475
- {
476
- field: 'course_subjects_count',
477
- width: 90,
478
- title: '课程方向',
479
- templet: "#courses"
480
- },
481
- {
482
- field: 'teacher_follows_count',
483
- width: 90,
484
- title: '跟进情况',
485
- totalRow:true,
486
- templet: "#follow"
487
- },
488
- {
489
- field: 'sales_manage',
490
- width: 160,
491
- title: '销售经理',
492
- },
493
- {
494
- field: 'staff_manage',
495
- width: 160,
496
- title: '生态经理',
497
- },
498
- {
499
- field: 'follow_person',
500
- width: 120,
501
- title: '最新跟进人',
502
- },
503
- {
504
- field: 'followup_at',
505
- width: 180,
506
- title: '最新跟进时间',
507
- },
508
- {
509
- field: 'latest_time',
510
- width: 120,
511
- title: '无跟进天数',
512
- sort: true,
513
- },
514
- {
515
- field: 'teacher_used',
516
- width: 120,
517
- title: '学院渗透率',
518
- },
519
- {
520
- field: 'students',
521
- width: 60,
522
- totalRow:'{{ parseInt(d.TOTAL_NUMS) }}',
523
- title: '学生',
524
- },
525
- {
526
- field: 'courses_count',
527
- width: 60,
528
- title: '课堂',
529
- totalRow:true,
530
- templet: "#class"
531
- },
532
- {
533
- field: 'activities_count',
534
- width: 100,
535
- title: '参与活动',
536
- templet: "#event"
537
- },
538
- {
539
- field: 'created_on',
540
- width: 120,
541
- title: '注册时间',
542
- sort: true,
543
- },
544
- {
545
- field: 'last_login_on',
546
- width: 120,
547
- title: '最近登录',
548
- sort: true,
549
- },
550
- {
551
- field: 'created_at',
552
- width: 120,
553
- title: '添加时间',
554
- sort: true,
555
- },
556
- {
557
- field: 'experience',
558
- width: 120,
559
- title: '经验值',
560
- sort: true,
561
- },
562
- {
563
- field: 'grade',
564
- width: 120,
565
- title: '金币',
566
- sort: true,
567
- },
568
- {
569
- field: 'mobile',
570
- width: 120,
571
- title: '联系电话',
572
- },
573
- {
574
- field: 'wechat',
575
- width: 120,
576
- title: '微信号',
577
- },
578
- {
579
- field: 'teacher_assist',
580
- width: 120,
581
- title: '教研助理',
582
- },
583
- {
584
- field: 'is_contact',
585
- width: 120,
586
- title: '是否联系上'
587
- },
588
- {
589
- title: '操作',
590
- minWidth: 270,
591
- toolbar: '#currentTableBar',
592
- align: "center",
593
- fixed: 'right'
594
- }
595
- ]
596
- ],
597
-
402
+ cols: cols_table,
598
403
  limit: 20,
599
404
  limits: [10,15,20,30,40,50,60,70,80,90],
600
405
  page: true,
@@ -1,3 +1,3 @@
1
1
  module EducodeSales
2
- VERSION = '1.10.0'
2
+ VERSION = '1.10.2'
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: 1.10.0
4
+ version: 1.10.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - anke1460
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-06-09 00:00:00.000000000 Z
11
+ date: 2023-06-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -105,6 +105,7 @@ files:
105
105
  - app/assets/images/educode_sales/icon-login.png
106
106
  - app/assets/images/educode_sales/icon.png
107
107
  - app/assets/images/educode_sales/indexLogo.png
108
+ - app/assets/images/educode_sales/indexlogo.png
108
109
  - app/assets/images/educode_sales/loading-0.gif
109
110
  - app/assets/images/educode_sales/loading-1.gif
110
111
  - app/assets/images/educode_sales/loading-2.gif
@@ -727,7 +728,7 @@ homepage: https://www.educoder.net
727
728
  licenses:
728
729
  - MIT
729
730
  metadata: {}
730
- post_install_message:
731
+ post_install_message:
731
732
  rdoc_options: []
732
733
  require_paths:
733
734
  - lib
@@ -742,8 +743,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
742
743
  - !ruby/object:Gem::Version
743
744
  version: '0'
744
745
  requirements: []
745
- rubygems_version: 3.0.0
746
- signing_key:
746
+ rubygems_version: 3.0.9
747
+ signing_key:
747
748
  specification_version: 4
748
749
  summary: Summary of EducodeSales.
749
750
  test_files: []