educode_sales 0.7.0 → 0.7.1

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: 7c243136aa29c06071bc7f5178e7c6eab7a7711c29a664ed12b4141b823102e1
4
- data.tar.gz: db224456ae6c27346fadb5ae65b2ed6973ba11e1c384f2b833f994e6371540cb
3
+ metadata.gz: fd1dede8ec609b98a19dcd71c21bac7b6024098a7cdb8bad5c600784bd9a649e
4
+ data.tar.gz: 34bdddc9c368c11588d2d9dc0a3307f8cfbc4568489f539e344b13f32bf41702
5
5
  SHA512:
6
- metadata.gz: a5df7256338dc4a0bcc7f3ef6933c573f79b186a77ba12fcb10bcbfc80a11cfb3253d57ae2ea2325346a76c089fe9c9a71751407697bb4e3706ee6b58e11abf1
7
- data.tar.gz: fa152803f2738331a1324e530275b6c31ff0420f5f725c537587b754555ae6eaeb0ce4bf5e522ef81ae109224e74b65effdf4435e7cb71e88fd11d6409c42580
6
+ metadata.gz: 372e451790e777e0c9df20e7bdd9bc133e4d15351c6ae5b541c53a9761b14c2cbd5645c7517d0ae20ea4301872592fd43de82013ae90166546b5ae647b59db32
7
+ data.tar.gz: f9a5c5518474de3e1aa03e2fe1fae7bbede839df9649227e1c0c0ddba1f4aaaf62e3e903c813c3115dd7d792d56e48e9c6659226cf0ed4b29169ac1198dda8a4
@@ -206,6 +206,7 @@ module EducodeSales
206
206
  last_follow.reception_at,
207
207
  last_follow.bidded_date,
208
208
  last_follow.signed_date,
209
+ last_follow.year,
209
210
  last_follow.created_at as latest_time,
210
211
  last_follow.actual_amount,
211
212
  (last_follow.actual_amount - educode_sales_businesses.return_money) as wait_return_money,
@@ -370,7 +371,7 @@ module EducodeSales
370
371
  render layout: false
371
372
  end
372
373
  format.json do
373
- @records = BusinessExportRecord.all.page(params[:page]).per(params[:limit])
374
+ @records = BusinessExportRecord.all.order(id: :desc).page(params[:page]).per(params[:limit])
374
375
  end
375
376
  end
376
377
  end
@@ -20,7 +20,7 @@ module EducodeSales
20
20
  business_ids = @businesses.pluck(:id)
21
21
  @follow_ups = FollowUp.where(business_id: business_ids)
22
22
  when '区域'
23
- school_ids = School.where(province: @current_admin.areas.pluck(:name)).pluck(:id)
23
+ school_ids = School.where(province: @current_admin.areas.pluck(:name)).pluck(:id) + StaffSchool.where(staff_id: @current_admin.id).pluck(:school_id)
24
24
  business_ids = Business.joins(last_follow_up: :assign_follow_ups).where("educode_sales_assign_follow_ups.staff_id = ?", @current_admin.id).pluck(:id)
25
25
  @businesses = Business.joins("JOIN departments ON educode_sales_businesses.department_id = departments.id").where("departments.school_id in (?) OR educode_sales_businesses.staff_id = #{@current_admin.id} OR educode_sales_businesses.id in (?)", school_ids, business_ids)
26
26
  business_ids = @businesses.pluck(:id)
@@ -21,11 +21,11 @@ module EducodeSales
21
21
  when '自己'
22
22
  @money_plans = MoneyPlan.joins(:follow_up).where("educode_sales_follow_ups.clazz_id != ?", x_id).where(follow_up_id: follow_up_ids).where(staff_id: @current_admin.id)
23
23
  when '区域'
24
- a_ids = MoneyPlan.where(follow_up_id: follow_up_ids).where(staff_id: @current_admin.id).ids
24
+ a_ids = MoneyPlan.where(follow_up_id: follow_up_ids).where(staff_id: @current_admin.id).pluck(:follow_up_id)
25
25
  school_ids = School.where(province: @current_admin.areas.pluck(:name)).pluck(:id) + StaffSchool.where(staff_id: @current_admin.id).pluck(:school_id)
26
26
  b_ids = Business.where(school_id: school_ids).pluck(:last_follow_up_id)
27
27
  ids = a_ids + b_ids
28
- @money_plans = MoneyPlan.joins(:follow_up).where("educode_sales_follow_ups.clazz_id != ?", x_id).where(id: ids)
28
+ @money_plans = MoneyPlan.joins(:follow_up).where("educode_sales_follow_ups.clazz_id != ?", x_id).where(follow_up_id: ids)
29
29
  else
30
30
  @money_plans = MoneyPlan.joins(:follow_up).where("educode_sales_follow_ups.clazz_id != ?", x_id).where(follow_up_id: follow_up_ids)
31
31
  end
@@ -20,8 +20,11 @@ module EducodeSales
20
20
  when '自己'
21
21
  @sale_plans = OperationPlan.where(staff_id: @current_admin.id)
22
22
  when '区域'
23
- staff_ids = Staff.joins(user: [user_extension: [department: :school]]).where("schools.province in (?) OR schools.id in (?)", @current_admin.areas.pluck(:name), StaffSchool.where(staff_id: @current_admin.id).pluck(:school_id)).pluck(:id)
24
- @sale_plans = OperationPlan.where("staff_id in (?) OR educode_sales_operation_plans.staff_id = ?", staff_ids, @current_admin.id)
23
+ staff_ids = Staff.joins(user: [user_extension: [department: :school]]).where("schools.province in (?)", @current_admin.areas.pluck(:name)).pluck(:id)
24
+ school_ids = StaffSchool.where(staff_id: @current_admin.id).pluck(:school_id)
25
+ department_ids = Department.where(school_id: school_ids).pluck(:id)
26
+ teacher_ids = Teacher.where(department_id: department_ids).pluck(:id)
27
+ @sale_plans = OperationPlan.where("staff_id in (?) OR educode_sales_operation_plans.staff_id = ? OR educode_sales_operation_plans.teacher_id in (?)", staff_ids, @current_admin.id,teacher_ids)
25
28
  else
26
29
  @sale_plans = OperationPlan
27
30
  end
@@ -21,8 +21,9 @@ module EducodeSales
21
21
  when '自己'
22
22
  @sale_plans = SalePlan.where(staff_id: @current_admin.id)
23
23
  when '区域'
24
- staff_ids = Staff.joins(user: [user_extension: [department: :school]]).where("schools.province in (?) OR schools.id in (?)", @current_admin.areas.pluck(:name),StaffSchool.where(staff_id: @current_admin.id).pluck(:school_id)).pluck(:id)
25
- @sale_plans = SalePlan.where("staff_id in (?) OR educode_sales_sale_plans.staff_id = ?", staff_ids, @current_admin.id)
24
+ staff_ids = Staff.joins(user: [user_extension: [department: :school]]).where("schools.province in (?)", @current_admin.areas.pluck(:name)).pluck(:id)
25
+ business_ids = Business.where(school_id: StaffSchool.where(staff_id: @current_admin.id).pluck(:school_id)).pluck(:id)
26
+ @sale_plans = SalePlan.where("staff_id in (?) OR educode_sales_sale_plans.staff_id = ? OR educode_sales_sale_plans.business_id in (?)", staff_ids, @current_admin.id,business_ids)
26
27
  else
27
28
  @sale_plans = SalePlan
28
29
  end
@@ -86,6 +86,8 @@ module EducodeSales
86
86
  params[:school_ids].each do |d|
87
87
  staff.staff_schools.create(school_id: d)
88
88
  end
89
+ else
90
+ staff.staff_schools.destroy_all
89
91
  end
90
92
  if staff.save
91
93
  render_success
@@ -368,6 +368,7 @@
368
368
  field: 'year',
369
369
  width: 105,
370
370
  title: '所属年度',
371
+ sort: true
371
372
  },
372
373
  {
373
374
  title: '操作',
@@ -196,9 +196,15 @@
196
196
 
197
197
  {
198
198
  field: 'place',
199
- width: 400,
199
+ width: 120,
200
200
  title: '渠道',
201
201
  },
202
+ {
203
+ field: 'year',
204
+ width: 120,
205
+ title: '所属年度',
206
+ sort: true
207
+ },
202
208
  {
203
209
  title: '操作',
204
210
  minWidth: 200,
@@ -19,6 +19,7 @@ json.data do
19
19
  json.is_latest d.id == @latest&.id
20
20
  json.flag d.created_at.present? ? (Time.now - d.created_at).to_f/3600 < 24 : false
21
21
  json.description d.description
22
+ json.year d.year
22
23
  json.self_flag d.staff_id == @current_admin.id
23
24
  end
24
25
  end
@@ -140,7 +140,7 @@
140
140
  {
141
141
  field: 'name',
142
142
  title: '客户名称',
143
- width: 100,
143
+ width: 150,
144
144
  templet: "#name"
145
145
  },
146
146
  {
@@ -150,7 +150,6 @@
150
150
  },
151
151
  {
152
152
  field: 'property',
153
- width: 200,
154
153
  title: '性质',
155
154
  },
156
155
  {
@@ -37,7 +37,7 @@
37
37
  </div>
38
38
  </div>
39
39
  <div class="layui-form-item" style="border-top: 1px solid #ddd;">
40
- <label class="layui-form-label">回款管理</label>
40
+ <label class="layui-form-label">回款计划</label>
41
41
  <div class="layui-input-block">
42
42
  <%= radio_button_tag("money_plan", "自己", @areas.include?("回款管理-自己"), {title: '本人负责列表', id: 16}) %>
43
43
  <%= radio_button_tag("money_plan", "区域", @areas.include?("回款管理-区域"), {title: '本人负责区域及监管院校列表', id: 17}) %>
@@ -1,3 +1,3 @@
1
1
  module EducodeSales
2
- VERSION = '0.7.0'
2
+ VERSION = '0.7.1'
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.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - anke1460
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-01-26 00:00:00.000000000 Z
11
+ date: 2022-01-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails