educode_sales 0.8.2 → 0.8.3
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/controllers/educode_sales/assessments_controller.rb +2 -0
- data/app/controllers/educode_sales/businesses_controller.rb +8 -0
- data/app/controllers/educode_sales/follow_ups_controller.rb +1 -1
- data/app/controllers/educode_sales/money_plans_controller.rb +0 -2
- data/app/models/educode_sales/filter.rb +0 -3
- data/app/models/educode_sales/follow_up.rb +7 -0
- data/app/views/educode_sales/assessments/_setup.html.erb +140 -159
- data/app/views/educode_sales/businesses/edit_follow_record.html.erb +9 -0
- data/app/views/educode_sales/businesses/index.html.erb +206 -187
- data/app/views/educode_sales/businesses/index.json.jbuilder +8 -0
- data/app/views/educode_sales/businesses/new_follow_record.html.erb +13 -3
- data/app/views/educode_sales/businesses/show_follow.html.erb +5 -0
- data/app/views/educode_sales/businesses/show_follow.json.jbuilder +7 -0
- data/app/views/educode_sales/businesses/show_follow_record.html.erb +15 -5
- data/db/migrate/20220512031715_add_column_o_business_deployment_to_follow_ups.rb +5 -0
- data/lib/educode_sales/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c2693da2ea5d023a9703a21550dceaf68b5795f052201e6ccce8b16d506e0079
|
4
|
+
data.tar.gz: da956ba153a3b5d72841e40d578766b389b1d296ac0d81efbdb279adaba1e131
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a20abc2ed0a9a0dd161d33e3ae9d41507721a5940c5db87bba4570ad1ec573bd602fdd654398b870140ca8f432b7b3391b8b2ca234d7379de6397026f4761d6b
|
7
|
+
data.tar.gz: 5254ba05ec825566dbcedef4d4d5208c137b1aba10bb7505355cb815ff4c1f926bfa5e54e3f13406def8bdf90a525d032f2cc52f8c7651906c99d1b41244079e
|
@@ -26,6 +26,8 @@ module EducodeSales
|
|
26
26
|
end
|
27
27
|
end
|
28
28
|
format.json do
|
29
|
+
@year2 = params[:q]&[:assessment_year] || '2022'
|
30
|
+
p @year2
|
29
31
|
@year = params[:q].present? && params[:q][:assessment_year].present? ? params[:q][:assessment_year]:'2022'
|
30
32
|
@assessments_id = params[:q].present? && params[:q][:assessment_id].present? ? params[:q][:assessment_id]: '1'
|
31
33
|
@assessments = AssessmentsSetting.where("assessment_year >= ? and assessment_year <= ?", "#{@year}-01-01 00:00:00".to_date, "#{@year}-12-31 23:59:00".to_date)
|
@@ -323,6 +323,7 @@ module EducodeSales
|
|
323
323
|
@o_name = EducodeSales::Common.find_by(extras: EducodeSales::Common::OTYPE)&.name
|
324
324
|
@clazz = Common.where(clazz: 'business_type').order("position").pluck(:name, :id)
|
325
325
|
@stages = Common.where(clazz: 'business_step').order("position").pluck(:name, :id)
|
326
|
+
@deployment_type = EducodeSales::FollowUp::BUSINESS_DEPLOYMENT
|
326
327
|
@places = Place.order("created_at desc").pluck(:name, :id)
|
327
328
|
@last_follow_up = @business.last_follow_up
|
328
329
|
if @last_follow_up
|
@@ -349,6 +350,12 @@ module EducodeSales
|
|
349
350
|
size = ids.size
|
350
351
|
ids = ids.reverse
|
351
352
|
index = ids.index(id)
|
353
|
+
EducodeSales::FollowUp::BUSINESS_DEPLOYMENT.each do |m|
|
354
|
+
if @follow_up.o_business_deployment == m[1]
|
355
|
+
@show_follow_recored_deployment = m[0]
|
356
|
+
break
|
357
|
+
end
|
358
|
+
end
|
352
359
|
@next_id = (index != size - 1 && size > 1) ? ids[index + 1] : 0
|
353
360
|
@pre_id = (index != 0 && size > 1) ? ids[index - 1] : 0
|
354
361
|
render layout: false
|
@@ -357,6 +364,7 @@ module EducodeSales
|
|
357
364
|
def edit_follow_record
|
358
365
|
@years = (2015..Time.now.year).to_a.reverse
|
359
366
|
@o_name = EducodeSales::Common.find_by(extras: EducodeSales::Common::OTYPE)&.name
|
367
|
+
@deployment_type = EducodeSales::FollowUp::BUSINESS_DEPLOYMENT
|
360
368
|
@follow_up = FollowUp.find(params[:follow_up_id])
|
361
369
|
@clazz = Common.where(clazz: 'business_type').order("position").pluck(:name, :id)
|
362
370
|
@stages = Common.where(clazz: 'business_step').order("position").pluck(:name, :id)
|
@@ -226,7 +226,7 @@ module EducodeSales
|
|
226
226
|
end
|
227
227
|
|
228
228
|
def follow_up_params
|
229
|
-
params.permit(:clazz_id, :stage_id, :invitation_at, :reception_at, :total_amount, :actual_amount, :divide_amount, :description, :advise, :place_id, :bidded_date, :signed_date, :year)
|
229
|
+
params.permit(:clazz_id, :stage_id, :invitation_at, :reception_at, :total_amount, :actual_amount, :divide_amount, :description, :advise, :place_id, :bidded_date, :signed_date, :year, :o_business_deployment)
|
230
230
|
end
|
231
231
|
|
232
232
|
def teacher_params
|
@@ -13,8 +13,6 @@ module EducodeSales
|
|
13
13
|
end
|
14
14
|
format.json do
|
15
15
|
x_id = Common.find_by(extras: EducodeSales::Common::XTYPE)&.id
|
16
|
-
p "================================================================================"
|
17
|
-
p x_id
|
18
16
|
if @current_admin.is_admin?
|
19
17
|
@money_plans = MoneyPlan.joins(:follow_up).where("educode_sales_follow_ups.clazz_id != ?", x_id).where(follow_up_id: follow_up_ids)
|
20
18
|
else
|
@@ -1,5 +1,12 @@
|
|
1
1
|
module EducodeSales
|
2
2
|
class FollowUp < ApplicationRecord
|
3
|
+
# todo O类商机特有字段-部署类型(因此不写入common表中)
|
4
|
+
BUSINESS_DEPLOYMENT =[
|
5
|
+
["公有云", 1],
|
6
|
+
["私有云", 2],
|
7
|
+
["混合云", 3]
|
8
|
+
]
|
9
|
+
|
3
10
|
include ::Deletable
|
4
11
|
belongs_to :business, counter_cache: true # counter_cache(自动计算 business对应follow_up表中对应的个数)
|
5
12
|
belongs_to :place, optional: true
|
@@ -79,140 +79,141 @@
|
|
79
79
|
value: '2022',
|
80
80
|
})
|
81
81
|
|
82
|
-
|
82
|
+
var cols_table = [//表头
|
83
|
+
[
|
84
|
+
{
|
85
|
+
type: 'numbers',
|
86
|
+
title: '序号',
|
87
|
+
width: 100,
|
88
|
+
sort: true,
|
89
|
+
fixed: 'left',
|
90
|
+
},
|
91
|
+
{
|
92
|
+
field: 'username',
|
93
|
+
title: '考核人员',
|
94
|
+
width: 100,
|
95
|
+
fixed: 'left',
|
96
|
+
hide: gon.filter["username"],
|
97
|
+
},
|
98
|
+
{
|
99
|
+
field: 'annual',
|
100
|
+
title: '全年',
|
101
|
+
width: 100,
|
102
|
+
hide: gon.filter["annual"],
|
103
|
+
},
|
104
|
+
{
|
105
|
+
field: 'first_quarter',
|
106
|
+
title: '第1季度',
|
107
|
+
width: 100,
|
108
|
+
hide: gon.filter["first_quarter"],
|
109
|
+
},
|
110
|
+
{
|
111
|
+
field: 'january',
|
112
|
+
title: '1月',
|
113
|
+
width: 100,
|
114
|
+
hide: gon.filter.january,
|
115
|
+
},
|
116
|
+
{
|
117
|
+
field: 'february',
|
118
|
+
title: '2月',
|
119
|
+
width: 100,
|
120
|
+
hide: gon.filter.february,
|
121
|
+
},
|
122
|
+
{
|
123
|
+
field: 'march',
|
124
|
+
title: '3月',
|
125
|
+
width: 100,
|
126
|
+
hide: gon.filter.march,
|
127
|
+
},
|
128
|
+
{
|
129
|
+
field: 'second_quarter',
|
130
|
+
title: '第2季度',
|
131
|
+
width: 100,
|
132
|
+
hide: gon.filter.second_quarter,
|
133
|
+
},
|
134
|
+
{
|
135
|
+
field: 'april',
|
136
|
+
title: '4月',
|
137
|
+
width: 100,
|
138
|
+
hide: gon.filter.april,
|
139
|
+
},
|
140
|
+
{
|
141
|
+
field: 'may',
|
142
|
+
title: '5月',
|
143
|
+
width: 100,
|
144
|
+
hide: gon.filter.may,
|
145
|
+
},
|
146
|
+
{
|
147
|
+
field: 'june',
|
148
|
+
title: '6月',
|
149
|
+
width: 100,
|
150
|
+
hide: gon.filter.june,
|
151
|
+
},
|
152
|
+
{
|
153
|
+
field: 'third_quarter',
|
154
|
+
title: '第3季度',
|
155
|
+
width: 100,
|
156
|
+
hide: gon.filter.third_quarter,
|
157
|
+
},
|
158
|
+
{
|
159
|
+
field: 'july',
|
160
|
+
title: '7月',
|
161
|
+
width: 100,
|
162
|
+
hide: gon.filter.july,
|
163
|
+
},
|
164
|
+
{
|
165
|
+
field: 'august',
|
166
|
+
title: '8月',
|
167
|
+
width: 100,
|
168
|
+
hide: gon.filter.august,
|
169
|
+
},
|
170
|
+
{
|
171
|
+
field: 'september',
|
172
|
+
title: '9月',
|
173
|
+
width: 100,
|
174
|
+
hide: gon.filter.september,
|
175
|
+
},
|
176
|
+
{
|
177
|
+
field: 'fourth_quarter',
|
178
|
+
title: '第4季度',
|
179
|
+
width: 100,
|
180
|
+
hide: gon.filter.fourth_quarter,
|
181
|
+
},
|
182
|
+
{
|
183
|
+
field: 'october',
|
184
|
+
title: '10月',
|
185
|
+
width: 100,
|
186
|
+
hide: gon.filter.october,
|
187
|
+
},
|
188
|
+
{
|
189
|
+
field: 'november',
|
190
|
+
title: '11月',
|
191
|
+
width: 100,
|
192
|
+
hide: gon.filter.november,
|
193
|
+
},
|
194
|
+
{
|
195
|
+
field: 'december',
|
196
|
+
title: '12月',
|
197
|
+
width: 100,
|
198
|
+
hide: gon.filter.december,
|
199
|
+
},
|
200
|
+
{
|
201
|
+
field: 'option',
|
202
|
+
title: '操作',
|
203
|
+
align: 'center',
|
204
|
+
fixed: 'right',
|
205
|
+
width: 200,
|
206
|
+
toolbar: '#human_task_indicatorsTableBar'
|
207
|
+
},
|
208
|
+
]
|
209
|
+
]
|
83
210
|
table.render({
|
84
211
|
elem: '#assessments',
|
85
212
|
url: '/missions/assessments',
|
86
213
|
toolbar: '#toolbarDemo5',
|
87
214
|
totalRow: true,
|
88
215
|
defaultToolbar: ['filter'],
|
89
|
-
cols:
|
90
|
-
[
|
91
|
-
{
|
92
|
-
type: 'numbers',
|
93
|
-
title: '序号',
|
94
|
-
width: 100,
|
95
|
-
sort: true,
|
96
|
-
fixed: 'left',
|
97
|
-
},
|
98
|
-
{
|
99
|
-
field: 'username',
|
100
|
-
title: '考核人员',
|
101
|
-
width: 100,
|
102
|
-
fixed: 'left',
|
103
|
-
hide: gon.filter["username"],
|
104
|
-
},
|
105
|
-
{
|
106
|
-
field: 'annual',
|
107
|
-
title: '全年',
|
108
|
-
width: 100,
|
109
|
-
hide: gon.filter["annual"],
|
110
|
-
},
|
111
|
-
{
|
112
|
-
field: 'first_quarter',
|
113
|
-
title: '第1季度',
|
114
|
-
width: 100,
|
115
|
-
hide: gon.filter["first_quarter"],
|
116
|
-
},
|
117
|
-
{
|
118
|
-
field: 'january',
|
119
|
-
title: '1月',
|
120
|
-
width: 70,
|
121
|
-
hide: gon.filter.january,
|
122
|
-
},
|
123
|
-
{
|
124
|
-
field: 'february',
|
125
|
-
title: '2月',
|
126
|
-
width: 70,
|
127
|
-
hide: gon.filter.february,
|
128
|
-
},
|
129
|
-
{
|
130
|
-
field: 'march',
|
131
|
-
title: '3月',
|
132
|
-
width: 70,
|
133
|
-
hide: gon.filter.march,
|
134
|
-
},
|
135
|
-
{
|
136
|
-
field: 'second_quarter',
|
137
|
-
title: '第2季度',
|
138
|
-
width: 100,
|
139
|
-
hide: gon.filter.second_quarter,
|
140
|
-
},
|
141
|
-
{
|
142
|
-
field: 'april',
|
143
|
-
title: '4月',
|
144
|
-
hide: gon.filter.april,
|
145
|
-
},
|
146
|
-
{
|
147
|
-
field: 'may',
|
148
|
-
title: '5月',
|
149
|
-
width: 70,
|
150
|
-
hide: gon.filter.may,
|
151
|
-
},
|
152
|
-
{
|
153
|
-
field: 'june',
|
154
|
-
title: '6月',
|
155
|
-
width: 70,
|
156
|
-
hide: gon.filter.june,
|
157
|
-
},
|
158
|
-
{
|
159
|
-
field: 'third_quarter',
|
160
|
-
title: '第3季度',
|
161
|
-
width: 100,
|
162
|
-
hide: gon.filter.third_quarter,
|
163
|
-
},
|
164
|
-
{
|
165
|
-
field: 'july',
|
166
|
-
title: '7月',
|
167
|
-
width: 70,
|
168
|
-
hide: gon.filter.july,
|
169
|
-
},
|
170
|
-
{
|
171
|
-
field: 'august',
|
172
|
-
title: '8月',
|
173
|
-
width: 70,
|
174
|
-
hide: gon.filter.august,
|
175
|
-
},
|
176
|
-
{
|
177
|
-
field: 'september',
|
178
|
-
title: '9月',
|
179
|
-
width: 70,
|
180
|
-
hide: gon.filter.september,
|
181
|
-
},
|
182
|
-
{
|
183
|
-
field: 'fourth_quarter',
|
184
|
-
title: '第4季度',
|
185
|
-
width: 100,
|
186
|
-
hide: gon.filter.fourth_quarter,
|
187
|
-
},
|
188
|
-
{
|
189
|
-
field: 'october',
|
190
|
-
title: '10月',
|
191
|
-
width: 70,
|
192
|
-
hide: gon.filter.october,
|
193
|
-
},
|
194
|
-
{
|
195
|
-
field: 'november',
|
196
|
-
title: '11月',
|
197
|
-
width: 70,
|
198
|
-
hide: gon.filter.november,
|
199
|
-
},
|
200
|
-
{
|
201
|
-
field: 'december',
|
202
|
-
title: '12月',
|
203
|
-
width: 70,
|
204
|
-
hide: gon.filter.december,
|
205
|
-
},
|
206
|
-
{
|
207
|
-
field: 'option',
|
208
|
-
title: '操作',
|
209
|
-
align: 'center',
|
210
|
-
fixed: 'right',
|
211
|
-
width: 200,
|
212
|
-
toolbar: '#human_task_indicatorsTableBar'
|
213
|
-
},
|
214
|
-
]
|
215
|
-
],
|
216
|
+
cols:cols_table,
|
216
217
|
done : function () {
|
217
218
|
$('.layui-table-fixed-r').removeClass('layui-hide'); // 与底部的css文件解决fixed第一次加载无法实现问题
|
218
219
|
},
|
@@ -258,12 +259,8 @@
|
|
258
259
|
|
259
260
|
|
260
261
|
table.on('tool(assessments)', function (obj) {
|
261
|
-
|
262
262
|
var data = obj.data;
|
263
|
-
console.log(obj)
|
264
|
-
console.log(data)
|
265
263
|
var id = data.id
|
266
|
-
console.log(id)
|
267
264
|
// 有些地方还要多看--------!!!!!!!
|
268
265
|
if (obj.event === 'edit') {
|
269
266
|
var content = miniPage.getHrefContent('/missions/assessments/' + id + '/edit');
|
@@ -297,34 +294,11 @@
|
|
297
294
|
|
298
295
|
// * toolbar事件监听
|
299
296
|
table.on('toolbar(assessments)', function (obj) {
|
300
|
-
|
301
|
-
// case 'LAYTABLE_COLS':
|
302
|
-
// layui.form.on('checkbox(LAY_TABLE_TOOL_COLS)', function(obj) {
|
303
|
-
// var value = obj.elem.checked
|
304
|
-
// var name = obj.elem.attributes[1].value
|
305
|
-
// $.ajax({
|
306
|
-
// url: "filter",
|
307
|
-
// type: "GET",
|
308
|
-
// data: "type=assessments_setup&name=" + name + "&hidden=" + value,
|
309
|
-
// success: function (data){
|
310
|
-
// let hide_type = "[data-field='"+name+"']"
|
311
|
-
// if (data.hidden === '1'){
|
312
|
-
// $(hide_type).addClass('layui-hide');
|
313
|
-
// }else{
|
314
|
-
// $(hide_type).removeClass('layui-hide');
|
315
|
-
// }
|
316
|
-
// },
|
317
|
-
// dataType: 'Json'
|
318
|
-
// })
|
319
|
-
// });
|
320
|
-
// break;
|
321
|
-
//
|
322
|
-
// }
|
323
|
-
|
297
|
+
console.log(obj)
|
324
298
|
if (obj.event === 'LAYTABLE_COLS'){
|
325
|
-
layui.form.on('checkbox(LAY_TABLE_TOOL_COLS)', function(
|
326
|
-
var value =
|
327
|
-
var name =
|
299
|
+
layui.form.on('checkbox(LAY_TABLE_TOOL_COLS)', function(objs) {
|
300
|
+
var value = objs.elem.checked
|
301
|
+
var name = objs.elem.attributes[1].value
|
328
302
|
$.ajax({
|
329
303
|
url: "filter",
|
330
304
|
type: "GET",
|
@@ -336,6 +310,13 @@
|
|
336
310
|
}else if (data.hidden === 0){
|
337
311
|
$(hide_type).removeClass('layui-hide');
|
338
312
|
}
|
313
|
+
//(因为触发筛选器出现的checkbox是根据cols的值得到 这里必须修改 cols的值 然后才会出现下次点击筛选器时 checkbox正常显示)
|
314
|
+
for (i=1;i<cols_table[0].length;i++){
|
315
|
+
if (name === cols_table[0][i].field ){
|
316
|
+
cols_table[0][i].hide = !value
|
317
|
+
obj.config.cols = cols_table
|
318
|
+
}
|
319
|
+
}
|
339
320
|
},
|
340
321
|
error: function (data){
|
341
322
|
layer.msg("操作失败")
|
@@ -70,6 +70,12 @@
|
|
70
70
|
<input type="text" class="layui-input required" id="service_time" name="service_time" placeholder=" - " autocomplete="off" value="<%= (@follow_up.service_start_time.present? && @follow_up.service_end_time.present?) ? (@follow_up.service_start_time.to_s + ' - ' + @follow_up.service_end_time.to_s) : '' %>">
|
71
71
|
</div>
|
72
72
|
</div>
|
73
|
+
<div class="layui-inline deployment_type layui-hide">
|
74
|
+
<label class="layui-form-label required">部署类型</label>
|
75
|
+
<div class="layui-input-inline">
|
76
|
+
<%= select_tag "o_business_deployment", options_for_select(@deployment_type, @follow_up&.o_business_deployment), class: 'required' %>
|
77
|
+
</div>
|
78
|
+
</div>
|
73
79
|
<br class="service_show layui-hide">
|
74
80
|
<div class="layui-inline">
|
75
81
|
<label class="layui-form-label">总额(万)</label>
|
@@ -168,6 +174,7 @@
|
|
168
174
|
<%=@follow_up&.clazz_id == EducodeSales::Common.where(extras: EducodeSales::Common::OTYPE).first&.id %>
|
169
175
|
if (flag) {
|
170
176
|
$(".service_show").removeClass('layui-hide')
|
177
|
+
$(".deployment_type").removeClass('layui-hide')
|
171
178
|
}
|
172
179
|
|
173
180
|
form.on('select(clazz_id)', function (data) {
|
@@ -175,8 +182,10 @@
|
|
175
182
|
const value = data.value;
|
176
183
|
if (value == <%= EducodeSales::Common.where(extras: EducodeSales::Common::OTYPE).first&.id %>) {
|
177
184
|
$(".service_show").removeClass('layui-hide')
|
185
|
+
$(".deployment_type").removeClass('layui-hide')
|
178
186
|
} else {
|
179
187
|
console.log(data.value)
|
188
|
+
$(".deployment_type").addClass('layui-hide')
|
180
189
|
$(".service_show").addClass('layui-hide')
|
181
190
|
}
|
182
191
|
})
|
@@ -257,72 +257,64 @@
|
|
257
257
|
console.log(data);
|
258
258
|
|
259
259
|
table = layui.table;
|
260
|
-
var
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
hide: gon.filter.clazz
|
319
|
-
},
|
320
|
-
{
|
321
|
-
field: 'stage',
|
322
|
-
width: 90,
|
323
|
-
title: '阶段',
|
324
|
-
hide: gon.filter.stage
|
325
|
-
},
|
260
|
+
var cols_table = [
|
261
|
+
[
|
262
|
+
{
|
263
|
+
field: 'id',
|
264
|
+
width: 60,
|
265
|
+
title: '序号', type: 'numbers',
|
266
|
+
totalRowText: '合计',
|
267
|
+
fixed: "left"
|
268
|
+
},
|
269
|
+
{
|
270
|
+
field: 'name',
|
271
|
+
width: 170,
|
272
|
+
title: '商机名称',
|
273
|
+
templet: '<div><span title="{{d.name}}">{{d.name}}</span></div>',
|
274
|
+
fixed: 'left',
|
275
|
+
hide: gon.filter.name
|
276
|
+
},
|
277
|
+
{
|
278
|
+
field: 'school',
|
279
|
+
width: 150,
|
280
|
+
title: '单位',
|
281
|
+
templet: '#school_name',
|
282
|
+
hide: gon.filter.school
|
283
|
+
},
|
284
|
+
{
|
285
|
+
field: 'department',
|
286
|
+
width: 150,
|
287
|
+
title: '部门',
|
288
|
+
templet: '<div><span title="{{d.department}}">{{d.department}}</span></div>',
|
289
|
+
hide: gon.filter.department
|
290
|
+
},
|
291
|
+
{
|
292
|
+
field: 'follow_ups_count',
|
293
|
+
title: '跟进',
|
294
|
+
width: 60,
|
295
|
+
templet: '#show_follow',
|
296
|
+
totalRow: true,
|
297
|
+
hide: gon.filter.follow_ups_count
|
298
|
+
},
|
299
|
+
// {
|
300
|
+
// field: 'teachers_count',
|
301
|
+
// width: 100,
|
302
|
+
// title: '关键人',
|
303
|
+
// templet: '#show_keys'
|
304
|
+
// },
|
305
|
+
{
|
306
|
+
field: 'clazz',
|
307
|
+
width: 80,
|
308
|
+
title: '类型',
|
309
|
+
templet: '<div><span title="{{d.clazz}}">{{d.clazz}}</span></div>',
|
310
|
+
hide: gon.filter.clazz
|
311
|
+
},
|
312
|
+
{
|
313
|
+
field: 'stage',
|
314
|
+
width: 90,
|
315
|
+
title: '阶段',
|
316
|
+
hide: gon.filter.stage
|
317
|
+
},
|
326
318
|
{
|
327
319
|
field: 'source',
|
328
320
|
width: 90,
|
@@ -342,117 +334,133 @@
|
|
342
334
|
sort: true,
|
343
335
|
hide: gon.filter.latest_time
|
344
336
|
},
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
337
|
+
{
|
338
|
+
field: 'invitation_at',
|
339
|
+
width: 105,
|
340
|
+
title: '招标时间',
|
341
|
+
sort: true,
|
342
|
+
hide: gon.filter.invitation_at
|
343
|
+
},
|
344
|
+
{
|
345
|
+
field: 'bidded_date',
|
346
|
+
width: 105,
|
347
|
+
title: '中标时间',
|
348
|
+
sort: true,
|
349
|
+
hide: gon.filter.bidded_date
|
350
|
+
},
|
351
|
+
{
|
352
|
+
field: 'signed_date',
|
353
|
+
width: 105,
|
354
|
+
title: '签单时间',
|
355
|
+
sort: true,
|
356
|
+
hide: gon.filter.signed_date
|
357
|
+
},
|
358
|
+
{
|
359
|
+
field: 'reception_at',
|
360
|
+
width: 105,
|
361
|
+
title: '验收时间',
|
362
|
+
sort: true,
|
363
|
+
hide: gon.filter.reception_at
|
364
|
+
},
|
365
|
+
{
|
366
|
+
field: 'service_end_time',
|
367
|
+
width: 200,
|
368
|
+
title: '服务期',
|
369
|
+
sort: true,
|
370
|
+
hide: gon.filter.service_end_time
|
371
|
+
},
|
372
|
+
{
|
373
|
+
field: 'o_business_deployment',
|
374
|
+
width: 150,
|
375
|
+
title: '部署类型',
|
376
|
+
sort: true,
|
377
|
+
hide: gon.filter.o_business_deployment
|
378
|
+
},
|
379
|
+
{
|
380
|
+
field: 'total_amount',
|
381
|
+
width: 100,
|
382
|
+
title: '总额',
|
383
|
+
totalRow: true,
|
384
|
+
sort: true,
|
385
|
+
hide: gon.filter.total_amount
|
386
|
+
},
|
387
|
+
{
|
388
|
+
field: 'actual_amount',
|
389
|
+
width: 100,
|
390
|
+
title: '合同额',
|
391
|
+
totalRow: true,
|
392
|
+
sort: true,
|
393
|
+
hide: gon.filter.actual_amount
|
394
|
+
},
|
395
|
+
{
|
396
|
+
field: 'return_money',
|
397
|
+
width: 100,
|
398
|
+
title: '回款',
|
399
|
+
sort: true,
|
400
|
+
totalRow: true,
|
401
|
+
hide: gon.filter.return_money
|
402
|
+
},
|
403
|
+
{
|
404
|
+
field: 'wait_return_money',
|
405
|
+
width: 100,
|
406
|
+
title: '待回款',
|
407
|
+
sort: true,
|
408
|
+
totalRow: true,
|
409
|
+
hide: gon.filter.wait_return_money
|
410
|
+
},
|
411
|
+
{
|
412
|
+
field: 'return_money_days',
|
413
|
+
width: 150,
|
414
|
+
title: '首次回款周期(天)',
|
415
|
+
hide: gon.filter.return_money_days
|
416
|
+
},
|
417
|
+
{
|
418
|
+
field: 'place',
|
419
|
+
width: 160,
|
420
|
+
title: '渠道',
|
421
|
+
hide: gon.filter.place
|
422
|
+
},
|
423
|
+
{
|
424
|
+
field: 'year',
|
425
|
+
width: 105,
|
426
|
+
title: '所属年度',
|
427
|
+
sort: true,
|
428
|
+
hide: gon.filter.year
|
429
|
+
},
|
430
|
+
{
|
431
|
+
field: 'followed',
|
432
|
+
templet:function(d){
|
433
|
+
if (d.followed==1){
|
435
434
|
|
436
|
-
|
437
|
-
|
435
|
+
return '<i class="layui-icon" style="color: goldenrod"></i> '
|
436
|
+
}
|
438
437
|
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
438
|
+
else return ''
|
439
|
+
},
|
440
|
+
width: 105,
|
441
|
+
title: '关注',
|
442
|
+
align: "center",
|
443
|
+
hide: gon.filter.followed
|
445
444
|
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
445
|
+
},
|
446
|
+
{
|
447
|
+
title: '操作',
|
448
|
+
minWidth: 220,
|
449
|
+
toolbar: '#currentTableBar',
|
450
|
+
align: "center",
|
451
|
+
fixed: 'right',
|
452
|
+
}
|
454
453
|
]
|
455
|
-
|
454
|
+
]
|
455
|
+
var business_table = table.render({
|
456
|
+
elem: '#businesses_table',
|
457
|
+
url: '/missions/businesses',
|
458
|
+
where: {q: data},
|
459
|
+
toolbar: '#bussinessBar',
|
460
|
+
defaultToolbar: ['filter'],
|
461
|
+
title: '商机数据表',
|
462
|
+
totalRow: true,//开启合并行
|
463
|
+
cols: cols_table,
|
456
464
|
|
457
465
|
limit: 20,
|
458
466
|
limits: [10,15,20,30,40,50,60,70,80,90],
|
@@ -816,7 +824,6 @@
|
|
816
824
|
data.field.business_type = business_type.toString();
|
817
825
|
data.field.business_step = business_step.toString();
|
818
826
|
search = data.field
|
819
|
-
console.log(search);
|
820
827
|
table.reload('businesses_table', {
|
821
828
|
url: '/missions/businesses',
|
822
829
|
page: {
|
@@ -825,7 +832,6 @@
|
|
825
832
|
where: {q: search, sort: sort}
|
826
833
|
}, 'data');
|
827
834
|
table.reload('teachers_table', {
|
828
|
-
url: '/missions/businesses',
|
829
835
|
page: {
|
830
836
|
curr: 1
|
831
837
|
},
|
@@ -854,22 +860,35 @@
|
|
854
860
|
|
855
861
|
return false;
|
856
862
|
});
|
857
|
-
|
858
863
|
table.on('toolbar(businesses_table)', function (obj) {
|
859
864
|
switch (obj.event) {
|
860
865
|
case 'LAYTABLE_COLS':
|
861
|
-
layui.form.on('checkbox(LAY_TABLE_TOOL_COLS)', function(
|
862
|
-
var value =
|
863
|
-
var name =
|
864
|
-
|
865
|
-
|
866
|
-
|
867
|
-
|
868
|
-
|
869
|
-
|
870
|
-
|
866
|
+
layui.form.on('checkbox(LAY_TABLE_TOOL_COLS)', function(objs) {
|
867
|
+
var value = objs.elem.checked
|
868
|
+
var name = objs.elem.attributes[1].value
|
869
|
+
$.ajax({
|
870
|
+
url: "filter",
|
871
|
+
type: "GET",
|
872
|
+
data: "type=businesses_list&name=" + name + "&check=" + value,
|
873
|
+
success: function (data){
|
874
|
+
let hide_type = "[data-field='"+name+"']"
|
875
|
+
if (data.hidden === 1){
|
876
|
+
$(hide_type).addClass('layui-hide');
|
877
|
+
}else if (data.hidden === 0){
|
878
|
+
$(hide_type).removeClass('layui-hide');
|
879
|
+
}
|
880
|
+
//(因为触发筛选器出现的checkbox是根据cols的值得到 这里必须修改 cols的值 然后才会出现下次点击筛选器时 checkbox正常显示)
|
881
|
+
for (i=1;i<cols_table[0].length;i++){
|
882
|
+
if (name === cols_table[0][i].field ){
|
883
|
+
cols_table[0][i].hide = !value
|
884
|
+
objs.config.cols = cols_table
|
885
|
+
}
|
886
|
+
}
|
887
|
+
},
|
888
|
+
error: function (data){
|
871
889
|
layer.msg("操作失败")
|
872
|
-
}
|
890
|
+
},
|
891
|
+
dataType: 'Json'
|
873
892
|
})
|
874
893
|
});
|
875
894
|
}
|
@@ -18,6 +18,14 @@ json.data do
|
|
18
18
|
json.bidded_date d.last_follow_up&.bidded_date.to_s
|
19
19
|
json.signed_date d.last_follow_up&.signed_date.to_s
|
20
20
|
json.service_end_time d.last_follow_up&.service_start_time.to_s + "-" + d.last_follow_up&.service_end_time.to_s
|
21
|
+
EducodeSales::FollowUp::BUSINESS_DEPLOYMENT.each do |m|
|
22
|
+
if d.last_follow_up&.o_business_deployment == m[1]
|
23
|
+
json.o_business_deployment m[0]
|
24
|
+
break
|
25
|
+
else
|
26
|
+
json.o_business_deployment ''
|
27
|
+
end
|
28
|
+
end
|
21
29
|
json.year d.last_follow_up&.year.to_s
|
22
30
|
json.total_amount d.last_follow_up&.total_amount
|
23
31
|
json.actual_amount d.last_follow_up&.actual_amount
|
@@ -74,6 +74,12 @@
|
|
74
74
|
<input type="text" class="layui-input required" id="service_time" name="service_time" placeholder=" - " autocomplete="off" value="<%= (@last_follow_up&.service_start_time.present? && @last_follow_up&.service_end_time.present?) ? (@last_follow_up.service_start_time.to_s + " - " + @last_follow_up.service_end_time.to_s) : '' %>">
|
75
75
|
</div>
|
76
76
|
</div>
|
77
|
+
<div class="layui-inline deployment_type layui-hide">
|
78
|
+
<label class="layui-form-label required">部署类型</label>
|
79
|
+
<div class="layui-input-inline">
|
80
|
+
<%= select_tag "o_business_deployment", options_for_select(@deployment_type, @last_follow_up&.o_business_deployment), class: 'required' %>
|
81
|
+
</div>
|
82
|
+
</div>
|
77
83
|
<br class="service_show layui-hide">
|
78
84
|
<div class="layui-inline">
|
79
85
|
<label class="layui-form-label">总额(万)</label>
|
@@ -168,10 +174,11 @@
|
|
168
174
|
xmSelect = layui.xmSelect,
|
169
175
|
$ = layui.$;
|
170
176
|
|
171
|
-
flag =
|
172
|
-
<%=@last_follow_up&.clazz&.name == @o_name %>
|
177
|
+
flag = <%=@last_follow_up&.clazz&.name == @o_name %>
|
173
178
|
if (flag) {
|
179
|
+
console.log(flag)
|
174
180
|
$(".service_show").removeClass('layui-hide')
|
181
|
+
$(".deployment_type").removeClass('layui-hide')
|
175
182
|
}
|
176
183
|
|
177
184
|
form.on('select(clazz_id)', function (data) {
|
@@ -179,8 +186,9 @@
|
|
179
186
|
const value = data.value;
|
180
187
|
if (value == <%= EducodeSales::Common.where(extras: EducodeSales::Common::OTYPE).first&.id %>) {
|
181
188
|
$(".service_show").removeClass('layui-hide')
|
189
|
+
$(".deployment_type").removeClass('layui-hide')
|
182
190
|
} else {
|
183
|
-
|
191
|
+
$(".deployment_type").addClass('layui-hide')
|
184
192
|
$(".service_show").addClass('layui-hide')
|
185
193
|
}
|
186
194
|
})
|
@@ -292,6 +300,8 @@
|
|
292
300
|
data.field.assign_follow_up = assign_follow;
|
293
301
|
data.field.business_id = "<%= @business.id %>";
|
294
302
|
data.field.place_id = place_list.getValue('valueStr');
|
303
|
+
console.log("start")
|
304
|
+
console.log(data.field)
|
295
305
|
request.authPost("missions/follow_ups", data.field, function (res) {
|
296
306
|
if (res.success == false) {
|
297
307
|
layer.alert(res.msg)
|
@@ -10,6 +10,13 @@ json.data do
|
|
10
10
|
json.bidded_date d.bidded_date&.to_s(:date)
|
11
11
|
json.signed_date d.signed_date&.to_s(:date)
|
12
12
|
json.service_end_time (d.service_start_time.present? && d.service_end_time.present?) ? (d.service_start_time&.to_s + "-" + d.service_end_time&.to_s) : ''
|
13
|
+
if d.o_business_deployment.present?
|
14
|
+
EducodeSales::FollowUp::BUSINESS_DEPLOYMENT.each do |m|
|
15
|
+
if d.o_business_deployment == m[1]
|
16
|
+
json.o_business_deployment m[0]
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
13
20
|
json.total_amount d.total_amount
|
14
21
|
json.actual_amount d.actual_amount
|
15
22
|
json.divide_amount d.divide_amount ? d.divide_amount : ""
|
@@ -53,12 +53,22 @@
|
|
53
53
|
</div>
|
54
54
|
</div>
|
55
55
|
<br>
|
56
|
-
|
57
|
-
<
|
58
|
-
|
59
|
-
|
56
|
+
<%if @follow_up.clazz_id == EducodeSales::Common.find_by(extras: EducodeSales::Common::OTYPE)&.id %>
|
57
|
+
<div class="layui-inline">
|
58
|
+
<label class="layui-form-label">服务期:</label>
|
59
|
+
<div class="layui-input-inline">
|
60
|
+
<%= @follow_up.service_start_time.to_s + "-" + @follow_up.service_end_time.to_s %>
|
61
|
+
</div>
|
60
62
|
</div>
|
61
|
-
|
63
|
+
<%end %>
|
64
|
+
<%if @follow_up.clazz_id == EducodeSales::Common.find_by(extras: EducodeSales::Common::OTYPE)&.id %>
|
65
|
+
<div class="layui-inline">
|
66
|
+
<label class="layui-form-label">部署类型:</label>
|
67
|
+
<div class="layui-input-inline">
|
68
|
+
<%=@show_follow_recored_deployment%>
|
69
|
+
</div>
|
70
|
+
</div>
|
71
|
+
<% end %>
|
62
72
|
<br>
|
63
73
|
<div class="layui-inline">
|
64
74
|
<label class="layui-form-label">总额:</label>
|
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.8.
|
4
|
+
version: 0.8.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- anke1460
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-05-
|
11
|
+
date: 2022-05-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -457,6 +457,7 @@ files:
|
|
457
457
|
- db/migrate/20220507020149_create_filter.rb
|
458
458
|
- db/migrate/20220507091959_change_educode_sales_filter_column_length.rb
|
459
459
|
- db/migrate/20220509073936_update_educode_sales_filters_filter_data.rb
|
460
|
+
- db/migrate/20220512031715_add_column_o_business_deployment_to_follow_ups.rb
|
460
461
|
- lib/educode_sales.rb
|
461
462
|
- lib/educode_sales/engine.rb
|
462
463
|
- lib/educode_sales/version.rb
|