educode_sales 0.7.9 → 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/application_controller.rb +14 -0
- data/app/controllers/educode_sales/assessments_controller.rb +58 -55
- data/app/controllers/educode_sales/businesses_controller.rb +16 -1
- 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 +12 -0
- data/app/models/educode_sales/follow_up.rb +7 -0
- data/app/views/educode_sales/assessments/_setup.html.erb +183 -132
- data/app/views/educode_sales/assessments/new.html.erb +1 -1
- data/app/views/educode_sales/businesses/edit_follow_record.html.erb +9 -0
- data/app/views/educode_sales/businesses/index.html.erb +220 -161
- 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 +6 -3
- 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/app/views/educode_sales/money_plans/index.json.jbuilder +1 -1
- data/config/routes.rb +1 -0
- data/db/migrate/20220507020149_create_filter.rb +10 -0
- data/db/migrate/20220507091959_change_educode_sales_filter_column_length.rb +5 -0
- data/db/migrate/20220509073936_update_educode_sales_filters_filter_data.rb +9 -0
- data/db/migrate/20220512031715_add_column_o_business_deployment_to_follow_ups.rb +5 -0
- data/lib/educode_sales/version.rb +1 -1
- metadata +7 -2
@@ -79,121 +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
|
-
},
|
104
|
-
{
|
105
|
-
field: 'annual',
|
106
|
-
title: '全年',
|
107
|
-
width: 100,
|
108
|
-
},
|
109
|
-
{
|
110
|
-
field: 'first_quarter',
|
111
|
-
title: '第1季度',
|
112
|
-
width: 100,
|
113
|
-
},
|
114
|
-
{
|
115
|
-
field: 'january',
|
116
|
-
title: '1月',
|
117
|
-
},
|
118
|
-
{
|
119
|
-
field: 'february',
|
120
|
-
title: '2月',
|
121
|
-
width: 70,
|
122
|
-
},
|
123
|
-
{
|
124
|
-
field: 'march',
|
125
|
-
title: '3月',
|
126
|
-
width: 70,
|
127
|
-
},
|
128
|
-
{
|
129
|
-
field: 'second_quarter',
|
130
|
-
title: '第2季度',
|
131
|
-
width: 100,
|
132
|
-
},
|
133
|
-
{
|
134
|
-
field: 'april',
|
135
|
-
title: '4月',
|
136
|
-
},
|
137
|
-
{
|
138
|
-
field: 'may',
|
139
|
-
title: '5月',
|
140
|
-
width: 70,
|
141
|
-
},
|
142
|
-
{
|
143
|
-
field: 'june',
|
144
|
-
title: '6月',
|
145
|
-
width: 70,
|
146
|
-
},
|
147
|
-
{
|
148
|
-
field: 'third_quarter',
|
149
|
-
title: '第3季度',
|
150
|
-
width: 100,
|
151
|
-
},
|
152
|
-
{
|
153
|
-
field: 'july',
|
154
|
-
title: '7月',
|
155
|
-
width: 70,
|
156
|
-
},
|
157
|
-
{
|
158
|
-
field: 'august',
|
159
|
-
title: '8月',
|
160
|
-
width: 70,
|
161
|
-
},
|
162
|
-
{
|
163
|
-
field: 'september',
|
164
|
-
title: '9月',
|
165
|
-
width: 70,
|
166
|
-
},
|
167
|
-
{
|
168
|
-
field: 'fourth_quarter',
|
169
|
-
title: '第4季度',
|
170
|
-
width: 100,
|
171
|
-
},
|
172
|
-
{
|
173
|
-
field: 'october',
|
174
|
-
title: '10月',
|
175
|
-
width: 70,
|
176
|
-
},
|
177
|
-
{
|
178
|
-
field: 'november',
|
179
|
-
title: '11月',
|
180
|
-
width: 70,
|
181
|
-
},
|
182
|
-
{
|
183
|
-
field: 'december',
|
184
|
-
title: '12月',
|
185
|
-
width: 70,
|
186
|
-
},
|
187
|
-
{
|
188
|
-
field: 'option',
|
189
|
-
title: '操作',
|
190
|
-
align: 'center',
|
191
|
-
fixed: 'right',
|
192
|
-
width: 200,
|
193
|
-
toolbar: '#human_task_indicatorsTableBar'
|
194
|
-
},
|
195
|
-
]
|
196
|
-
],
|
216
|
+
cols:cols_table,
|
197
217
|
done : function () {
|
198
218
|
$('.layui-table-fixed-r').removeClass('layui-hide'); // 与底部的css文件解决fixed第一次加载无法实现问题
|
199
219
|
},
|
@@ -237,12 +257,10 @@
|
|
237
257
|
})
|
238
258
|
|
239
259
|
|
260
|
+
|
240
261
|
table.on('tool(assessments)', function (obj) {
|
241
262
|
var data = obj.data;
|
242
|
-
console.log(obj)
|
243
|
-
console.log(data)
|
244
263
|
var id = data.id
|
245
|
-
console.log(id)
|
246
264
|
// 有些地方还要多看--------!!!!!!!
|
247
265
|
if (obj.event === 'edit') {
|
248
266
|
var content = miniPage.getHrefContent('/missions/assessments/' + id + '/edit');
|
@@ -275,8 +293,39 @@
|
|
275
293
|
});
|
276
294
|
|
277
295
|
// * toolbar事件监听
|
278
|
-
|
279
|
-
|
296
|
+
table.on('toolbar(assessments)', function (obj) {
|
297
|
+
console.log(obj)
|
298
|
+
if (obj.event === 'LAYTABLE_COLS'){
|
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
|
302
|
+
$.ajax({
|
303
|
+
url: "filter",
|
304
|
+
type: "GET",
|
305
|
+
data: "type=assessments_setup&name=" + name + "&check=" + value,
|
306
|
+
success: function (data){
|
307
|
+
let hide_type = "[data-field='"+name+"']"
|
308
|
+
if (data.hidden === 1){
|
309
|
+
$(hide_type).addClass('layui-hide');
|
310
|
+
}else if (data.hidden === 0){
|
311
|
+
$(hide_type).removeClass('layui-hide');
|
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
|
+
}
|
320
|
+
},
|
321
|
+
error: function (data){
|
322
|
+
layer.msg("操作失败")
|
323
|
+
},
|
324
|
+
dataType: 'Json'
|
325
|
+
})
|
326
|
+
});
|
327
|
+
}else if( obj.event === 'add'){
|
328
|
+
// 监听添加操作
|
280
329
|
var content = miniPage.getHrefContent('/missions/assessments/new');
|
281
330
|
var openWH = miniPage.getOpenWidthHeight();
|
282
331
|
var index = layer.open({
|
@@ -289,28 +338,30 @@
|
|
289
338
|
offset: [openWH[2] + 'px', openWH[3] + 'px'],
|
290
339
|
content: content,
|
291
340
|
success: function (layero, index) {
|
292
|
-
|
341
|
+
// 重新加载select下拉框(绩效考核标准)
|
293
342
|
form.render('select')
|
294
|
-
|
295
|
-
staffs.setValue([
|
343
|
+
// clear上次弹层中的多选人员数据 // staffs不清楚为什么要写在单独的script下才有效
|
344
|
+
staffs.setValue([])
|
296
345
|
|
297
346
|
}
|
298
347
|
});
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
348
|
+
// 这样写无法实现 要写在success中记住(open弹出层) 294
|
349
|
+
// document.getElementById('clear_staffs').onclick = function() {
|
350
|
+
// console.log("delete")
|
351
|
+
// staffs.setValue([ {name:'', value:''} ])
|
352
|
+
// // console.log(staffs)
|
353
|
+
// // alert(staffs.setValue([ {name:'', value:''} ]))
|
354
|
+
// // staffs.setValue([ ])
|
355
|
+
// // alert(staffs.setValue([ ]))
|
356
|
+
// clear(staffs)
|
357
|
+
// console.log("ok")
|
358
|
+
// };
|
359
|
+
|
360
|
+
// 目前不清除有什么用
|
361
|
+
// $(window).on("resize", function () {
|
362
|
+
// layer.full(index);
|
363
|
+
// });
|
364
|
+
}
|
314
365
|
});
|
315
366
|
|
316
367
|
|
@@ -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
|
})
|