educode_sales 0.9.25 → 0.9.26

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: 7326e12d52dc97f7f251f63b033f3c470591be1100f6f9bd06ab057e9a21bd14
4
- data.tar.gz: 80817718f3efdcb1a247095f468123ad1111d996dffe3f858cd6b29aab0f52ad
3
+ metadata.gz: 23546de4bbb1afb063c383c9284ac5df3851a0b5b80ff1156b4a395d3bacdbdb
4
+ data.tar.gz: a4e1a21cab776582c8e5659778b81073ee5cd397e7544e8508e7d373a37fa99f
5
5
  SHA512:
6
- metadata.gz: 4430c0f16dac2deda9e833d7962020fd8727a60d43b3823b631ac7cc5196d40c0bbd66b8170ac114e6cdf5dc197978f3674dfe2d5dad720963baefce8537f76a
7
- data.tar.gz: 34fb199238d1d1181e1b07fb8f2e00371e271aa9cc3689af2a916dbeb089f9a2624a0c14140de4cbc550d9faa04a03525db1c9407e9b5d3ae439e8d8152946f9
6
+ metadata.gz: 952ec86ff8bd23312b8b5e439c1adfebaa3547c59f5bc8f35553699f59ebc2163b64401a971a29207ceb29e3fb586f698a94d07c028fcf3ee7ed2d2fcf8d8aba
7
+ data.tar.gz: 16b22885432f18349e35abb396db51aad96b55ff882fbda645410e6fb7d1fc2bb59688aadebc5aab1e2ebf02a6b02417f3d55b99ebc2258850d005fb7d7e2046
@@ -34,7 +34,7 @@ module EducodeSales
34
34
  end
35
35
 
36
36
  if params[:bidded_date_year].present? && params[:bidded_date_year] != '全部'
37
- 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")
37
+ gon.bidded_date = "2015-01-01" + " - " + Time.new(params[:bidded_date_year]).end_of_year.strftime("%Y-%m-%d")
38
38
  end
39
39
 
40
40
  if params[:signed_date_year].present? && params[:signed_date_year] != '全部'
@@ -45,8 +45,7 @@ module EducodeSales
45
45
  end
46
46
  if params[:q].present? && params[:q][:area].present?
47
47
  p = EducodeSales::Common.find(params[:q][:area]).name
48
- @follow_ups = @follow_ups.joins(:business).joins("
49
- JOIN departments ON educode_sales_businesses.department_id = departments.id
48
+ @follow_ups = @follow_ups.joins(business: :department).joins("
50
49
  JOIN schools ON departments.school_id = schools.id
51
50
  ").where("province = ?", p)
52
51
  end
@@ -57,6 +56,8 @@ module EducodeSales
57
56
 
58
57
  end
59
58
 
59
+ @follow_ups = @follow_ups.includes(:staff, :clazz, :stage, key_person: :teacher, business: [department: :school])
60
+
60
61
  if params[:sort].present? && params[:sort][:field]
61
62
  @follow_ups = @follow_ups.order("#{params[:sort][:field]} #{params[:sort][:order]}")
62
63
  else
@@ -22,7 +22,7 @@ module EducodeSales
22
22
  @service_amount = Business.joins(:last_follow_up).where("educode_sales_follow_ups.clazz_id != ?", x).where("educode_sales_follow_ups.stage_id IN (?)", s_stage_ids).sum(:total_amount).round(2)
23
23
  @actual_service_amount = Business.joins(:last_follow_up).where("educode_sales_follow_ups.clazz_id != ?", x).where("educode_sales_follow_ups.stage_id IN (?)", s_stage_ids).sum(:actual_amount).round(2)
24
24
 
25
- # @return_amount = Business.joins(last_follow_up: :money_plans).where("educode_sales_follow_ups.clazz_id != ?", x).where.not("educode_sales_money_plans.clazz!= ?", 1).sum(:amount).round(2)
25
+ @return_amount = Business.joins(last_follow_up: :money_plans).where("educode_sales_follow_ups.clazz_id != ?", x).where.not("educode_sales_money_plans.clazz!= ?", 1).sum(:amount).round(2)
26
26
  # # @return_amount = total_return[0]['return_money']&.round(2) || 0
27
27
  # @receivable_amount = @goal_amount - @return_amount
28
28
 
@@ -57,7 +57,7 @@ module EducodeSales
57
57
  # @former_return_amount = Business.joins(last_follow_up: :money_plans).where("educode_sales_follow_ups.clazz_id != ?", x).where.not("educode_sales_money_plans.clazz!= ?", 1).where("educode_sales_money_plans.date_at <= ? ", year_over_time).sum(:amount).round(2)
58
58
  # @receivable_amount = @former_goal_amount - @former_return_amount
59
59
 
60
- @receivable_amount = Business.joins(:last_follow_up).where("educode_sales_follow_ups.clazz_id != ?", x).where("educode_sales_follow_ups.bidded_date >= ? AND educode_sales_follow_ups.bidded_date <= ? AND educode_sales_follow_ups.stage_id IN (?)", "#{@year}-01-01", "#{@year}-12-31", stage_ids).select("(SUM(educode_sales_follow_ups.actual_amount) - SUM(educode_sales_businesses.return_money)) AS num")
60
+ @receivable_amount = Business.joins(:last_follow_up).where("educode_sales_follow_ups.clazz_id != ?", x).where("educode_sales_follow_ups.bidded_date <= ? AND educode_sales_follow_ups.stage_id IN (?)", "#{@year}-12-31", stage_ids).select("(SUM(educode_sales_follow_ups.actual_amount) - SUM(educode_sales_businesses.return_money)) AS num")
61
61
  @receivable_amount = @receivable_amount.present? && @receivable_amount[0]['num'] ? @receivable_amount[0]['num'].round(2) : 0
62
62
 
63
63
  a = Common.where(clazz: '商机类型', name: Common.find_by(extras: EducodeSales::Common::ATYPE)&.name).pluck(:id)
@@ -142,6 +142,12 @@
142
142
  title: '关键人',
143
143
  templet:'<div><span title="{{d.key_people}}">{{d.key_people}}</span></div>'
144
144
  },
145
+ {
146
+ field: 'tel',
147
+ width: 90,
148
+ title: '联系方式',
149
+ templet:'<div><span title="{{d.tel}}">{{d.tel}}</span></div>'
150
+ },
145
151
  {
146
152
  field: 'staff',
147
153
  width: 90,
@@ -1,4 +1,4 @@
1
- <form class="layui-form layuimini-form " id="custom_data" data-required="true" action="">
1
+ <div class="layui-form layuimini-form " id="custom_data" data-required="true">
2
2
  <div class="layui-form-item" style="padding: 25px">
3
3
  <div class="layui-inline">
4
4
  <label class="layui-form-label required">客户:</label>
@@ -30,7 +30,7 @@
30
30
  </div>
31
31
  </div>
32
32
  <div class="layui-form-item">
33
- <label class="layui-form-label">学校性质:</label>
33
+ <label class="layui-form-label required">学校性质:</label>
34
34
  <div class="layui-input-block">
35
35
  <input type="checkbox" name="project_985" lay-skin="primary" value="1" <%= 'checked' if @school_property&.project_985 %> title="985工程">
36
36
  <input type="checkbox" name="project_211" lay-skin="primary" value="1" <%= 'checked' if @school_property&.project_211 %> title="211工程" >
@@ -54,7 +54,7 @@
54
54
  </button>
55
55
  </div>
56
56
  </div>
57
- </form>
57
+ </div>
58
58
 
59
59
 
60
60
  <script>
@@ -339,6 +339,13 @@
339
339
  form.on('submit(data-reset-btn)', function (data) {
340
340
  data.field.province = $("#province option:selected").text(); //获取选中的项
341
341
  data.field.city = $("#city option:selected").text(); //获取选中的项
342
+ if (data.field.enterprise == undefined && data.field.junior_college == undefined &&
343
+ data.field.military_school == undefined && data.field.project_211 == undefined && data.field.project_985 == undefined
344
+ && data.field.regular_college == undefined && data.field.secondary_school == undefined) {
345
+ layer.alert("请选择学校性质");
346
+ return false;
347
+ }
348
+
342
349
  request.authPut("missions/customers/" + <%= @school.id %>, data.field, function (res) {
343
350
  if (res.success === false) {
344
351
  layer.alert(res.msg)
@@ -11,8 +11,9 @@ json.data do
11
11
  json.created_at d.created_at.to_s
12
12
  json.business d.business.name
13
13
  json.business_id d.business.id
14
- teacher_ids = d.key_person.pluck(:teacher_id)
15
- json.key_people key_people(teacher_ids)
14
+ # teacher_ids = d.key_person.pluck(:teacher_id)
15
+ json.tel d.key_person.pluck(:tel).select { |d| d.present? }.join("、")
16
+ json.key_people d.key_person.map { |d| d.teacher.name }.join("、")# key_people(teacher_ids)
16
17
 
17
18
  end
18
19
  end
@@ -54,9 +54,9 @@
54
54
  </div>
55
55
  </div>
56
56
  <div class="layui-input-inline" style="width: 300px;">
57
- <label class="layui-form-label ">联系方式</label>
57
+ <label class="layui-form-label required">联系方式</label>
58
58
  <div class="layui-input-block">
59
- <input type="text" class="layui-input" name="tel" autocomplete="off" value=""
59
+ <input type="text" class="layui-input" name="tel" autocomplete="off" value="" lay-verify="required"
60
60
  id="tel" placeholder="请输入联系方式">
61
61
  </div>
62
62
  </div>
@@ -1,3 +1,3 @@
1
1
  module EducodeSales
2
- VERSION = '0.9.25'
2
+ VERSION = '0.9.26'
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.25
4
+ version: 0.9.26
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-08 00:00:00.000000000 Z
11
+ date: 2022-12-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails