educode_sales 0.6.0 → 0.6.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 +4 -4
- data/app/views/educode_sales/customers/index.html.erb +3 -2
- data/app/views/educode_sales/customers/new_department.html.erb +1 -0
- data/app/views/educode_sales/customers/show_follow.html.erb +5 -2
- data/app/views/educode_sales/customers/show_follow_record.html.erb +2 -1
- data/app/views/educode_sales/sales/index.json.jbuilder +10 -2
- data/lib/educode_sales/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 88c76bb62d36b9922c99d80e365218b4dbde3bfe9632773d71ba40bdda28ef2f
|
4
|
+
data.tar.gz: 4ba6723ac69f19bb92c57a876b1e7c7299fc15bf1d213eede7ce215e12a932bc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 608ee9cf6238d241410cb879004c9d18d5ee4e2fa346f285a6f81e3391b3438b905997dbc03c5b37c83c1c9dbd5f2cda1c7f11c3c831c3f986ceda2b443fe925
|
7
|
+
data.tar.gz: 0f5c04324244916fe4a6fd75625076b8ae56bf6398f04676d168b41af251dd66b0db586f53881bbb68ddfaebef7d0ef95d0b47f790b64ed34729c57b5533d856
|
@@ -112,11 +112,11 @@
|
|
112
112
|
defaultToolbar: ['filter'],
|
113
113
|
cols: [
|
114
114
|
[
|
115
|
-
{type:'checkbox'},
|
115
|
+
{type: 'checkbox'},
|
116
116
|
{
|
117
117
|
field: 'id',
|
118
118
|
width: 60,
|
119
|
-
title:'序号',type: 'numbers',
|
119
|
+
title: '序号', type: 'numbers',
|
120
120
|
|
121
121
|
},
|
122
122
|
{
|
@@ -151,6 +151,7 @@
|
|
151
151
|
field: 'last_follow_time',
|
152
152
|
width: 170,
|
153
153
|
title: '最后跟进时间',
|
154
|
+
sort: true
|
154
155
|
},
|
155
156
|
{
|
156
157
|
field: 'staff',
|
@@ -252,7 +252,8 @@
|
|
252
252
|
{
|
253
253
|
field: 'created_at',
|
254
254
|
width: 180,
|
255
|
-
title: '时间'
|
255
|
+
title: '时间',
|
256
|
+
sort: true
|
256
257
|
},
|
257
258
|
{
|
258
259
|
field: 'staff',
|
@@ -266,7 +267,8 @@
|
|
266
267
|
},
|
267
268
|
{
|
268
269
|
field: 'content',
|
269
|
-
title: '跟进内容'
|
270
|
+
title: '跟进内容',
|
271
|
+
templet:'<div><span title="{{d.content}}">{{d.content}}</span></div>'
|
270
272
|
},
|
271
273
|
{
|
272
274
|
title: '操作',
|
@@ -365,6 +367,7 @@
|
|
365
367
|
layer.confirm('确定删除ID为' + data.id + "的记录", function (index) {
|
366
368
|
request.authDelete("missions/customer_follows/" + data.id, {}, function() {
|
367
369
|
obj.del();
|
370
|
+
parent.table.reload('customers_table')
|
368
371
|
layer.close(index);
|
369
372
|
})
|
370
373
|
|
@@ -7,10 +7,11 @@
|
|
7
7
|
<span><%= @follow_up.content%></span>
|
8
8
|
</div>
|
9
9
|
</div>
|
10
|
+
<br>
|
10
11
|
<div class="layui-inline">
|
11
12
|
<label class="layui-form-label">跟进部门:</label>
|
12
13
|
<div class="layui-input-inline">
|
13
|
-
<span><%=
|
14
|
+
<span><%= Department.find(@follow_up.department_id)&.name if @follow_up.department_id.present? %></span>
|
14
15
|
</div>
|
15
16
|
</div>
|
16
17
|
</div>
|
@@ -38,7 +38,11 @@ json.data do
|
|
38
38
|
json.goal @businesses.joins("JOIN educode_sales_follow_ups on educode_sales_follow_ups.id = educode_sales_businesses.last_follow_up_id").where("educode_sales_follow_ups.clazz_id != ? AND educode_sales_follow_ups.stage_id in (?)", @x, @step_ids).sum(:total_amount).round(2)
|
39
39
|
json.return_money @businesses.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)
|
40
40
|
json.school_count school_count
|
41
|
-
|
41
|
+
follow_school_count = EducodeSales::CustomerFollow.where(staff_id: d.id).pluck(:school_id).uniq.size
|
42
|
+
json.follow_school_count follow_school_count
|
43
|
+
json.follow_school_counts EducodeSales::CustomerFollow.where(staff_id: d.id).size + EducodeSales::FollowUp.where(staff_id: d.id).size
|
44
|
+
json.follow_school_rate follow_school_count!=0 ? school_count.to_f * 100 / follow_school_count : 0
|
45
|
+
json.follow_department_rate follow_school_count!=0 ? school_count.to_f * 100 / follow_school_count : 0
|
42
46
|
else
|
43
47
|
business_a = @businesses.joins("JOIN educode_sales_follow_ups on educode_sales_follow_ups.id = educode_sales_businesses.last_follow_up_id").where("educode_sales_follow_ups.clazz_id = ?", @a_clazz&.id).where("educode_sales_follow_ups.year = ?", @year).count
|
44
48
|
business_b = @businesses.joins("JOIN educode_sales_follow_ups on educode_sales_follow_ups.id = educode_sales_businesses.last_follow_up_id").where("educode_sales_follow_ups.clazz_id = ?", @b_clazz&.id).where("educode_sales_follow_ups.year = ?", @year).count
|
@@ -50,7 +54,11 @@ json.data do
|
|
50
54
|
json.goal @businesses.joins("JOIN educode_sales_follow_ups on educode_sales_follow_ups.id = educode_sales_businesses.last_follow_up_id").where("educode_sales_follow_ups.clazz_id != ? AND educode_sales_follow_ups.stage_id in (?)", @x, @step_ids).where("educode_sales_follow_ups.bidded_date >= ? AND educode_sales_follow_ups.bidded_date <= ?", "#{@year}-01-01", "#{@year}-12-31").sum(:total_amount).round(2)
|
51
55
|
json.return_money @businesses.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 >= ? AND educode_sales_money_plans.date_at <= ? ", "#{@year}-01-01 00:00:00", "#{@year}-12-31 23:59:59").sum(:amount).round(2)
|
52
56
|
json.school_count school_count
|
53
|
-
|
57
|
+
follow_school_count = EducodeSales::CustomerFollow.where(staff_id: d.id).where("created_at >= ? AND created_at <= ?", "#{@year}-01-01", "#{@year}-12-31").pluck(:school_id).uniq.size || 0
|
58
|
+
json.follow_school_count follow_school_count
|
59
|
+
json.follow_school_counts EducodeSales::CustomerFollow.where(staff_id: d.id).where("created_at >= ? AND created_at <= ?", "#{@year}-01-01", "#{@year}-12-31").size + EducodeSales::FollowUp.where(staff_id: d.id).where("created_at >= ? AND created_at <= ?", "#{@year}-01-01", "#{@year}-12-31").size
|
60
|
+
json.follow_school_rate follow_school_count!=0 ? school_count.to_f * 100 / follow_school_count : 0
|
61
|
+
json.follow_department_rate follow_school_count!=0 ? school_count.to_f * 100 / follow_school_count : 0
|
54
62
|
end
|
55
63
|
|
56
64
|
json.business_a business_a
|