educode_sales 0.9.64 → 0.9.65
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/ideas_controller.rb +6 -0
- data/app/models/educode_sales/idea.rb +5 -0
- data/app/views/educode_sales/idea_recycles/detail.html.erb +12 -0
- data/app/views/educode_sales/ideas/detail.html.erb +20 -8
- data/app/views/educode_sales/ideas/edit.html.erb +47 -13
- data/app/views/educode_sales/ideas/new.html.erb +36 -15
- data/db/migrate/20230327021033_add_attachment_ids_to_ideas.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: 840004c5725190fa6d1a8b359f886151f5efe6492a343f176fd53325c93563b0
|
4
|
+
data.tar.gz: 86e69f97e1facebfcfe0c0e3c5b059fcba252204d607ed5ff2cd6974057396ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 28284bf39836512e0bbb84a23da24cb5090450d311ee4d00c6dfdc29d72cdf64bc0e755f15248cc0d83bd152a77d1cfe2f369ac01ac63f059cfe6ae71970e6ff
|
7
|
+
data.tar.gz: 80ff218d9f6423ae14a1f08cbd5f0cfad784343f1ce18f5a8338e62a47b032dd5beffa2c08559b16f9b1c1d98f047450d017b7397ea1ef0b51cb5c7cb8666ef2
|
@@ -62,6 +62,7 @@ module EducodeSales
|
|
62
62
|
gon.staffs = staffs.map { |d| { name: d.user.real_name, value: d.id } }
|
63
63
|
gon.department = { value: '', name: '' }
|
64
64
|
gon.value = ''
|
65
|
+
gon.attachments = []
|
65
66
|
render layout: false
|
66
67
|
end
|
67
68
|
|
@@ -70,6 +71,8 @@ module EducodeSales
|
|
70
71
|
# idea.school_id = Department.find_by_id(idea.department_id)&.school_id
|
71
72
|
idea.creator = current_user
|
72
73
|
assist_staff_ids = Array(params[:assist_staff_ids].to_s.split(","))
|
74
|
+
attachment_ids = Array(params[:attachment_ids].to_s.split(","))
|
75
|
+
idea.attachment_ids = attachment_ids
|
73
76
|
idea.assist_staff_ids = assist_staff_ids
|
74
77
|
idea.save
|
75
78
|
render_success
|
@@ -88,6 +91,8 @@ module EducodeSales
|
|
88
91
|
# @idea.school_id = Department.find_by_id(@idea.department_id)&.school_id
|
89
92
|
assist_staff_ids = Array(params[:assist_staff_ids].to_s.split(","))
|
90
93
|
@idea.assist_staff_ids = assist_staff_ids
|
94
|
+
attachment_ids = Array(params[:attachment_ids].to_s.split(","))
|
95
|
+
@idea.attachment_ids = attachment_ids
|
91
96
|
check_changes
|
92
97
|
@idea.save
|
93
98
|
render_success
|
@@ -104,6 +109,7 @@ module EducodeSales
|
|
104
109
|
gon.staff_value = [{ name: @idea.staff&.user&.real_name, value: @idea.staff_id }]
|
105
110
|
gon.sale_staff_value = [{ name: @idea.sale_staff&.user&.real_name, value: @idea.sale_staff_id }]
|
106
111
|
gon.assist_staff_value = @idea.assist_staffs.map { |d| { name: d&.user&.real_name, value: d.id } }
|
112
|
+
gon.attachment_list = @idea.attachments.map { |d| { name: d.filename, value: d.id } }
|
107
113
|
gon.department = { value: @idea&.department_id, name: "#{@idea&.department&.school&.name}-#{@idea&.department&.name}" }
|
108
114
|
gon.value = @idea.department_id
|
109
115
|
gon.department_list = @idea.department.present? ? [{ name: @idea.department.name, value: @idea.department_id }] : []
|
@@ -20,6 +20,7 @@ module EducodeSales
|
|
20
20
|
enum model: %w[本地版 线上版 混合版]
|
21
21
|
|
22
22
|
serialize :assist_staff_ids,Array
|
23
|
+
serialize :attachment_ids, Array
|
23
24
|
|
24
25
|
# before_save :check_changes
|
25
26
|
|
@@ -31,6 +32,10 @@ module EducodeSales
|
|
31
32
|
Staff.where(id: self.assist_staff_ids)
|
32
33
|
end
|
33
34
|
|
35
|
+
def attachments
|
36
|
+
Attachment.where(id: self.attachment_ids)
|
37
|
+
end
|
38
|
+
|
34
39
|
def soft_destroy(staff_id)
|
35
40
|
self.update(deleted_at: Time.now, deleter_id: staff_id, is_deleted: true)
|
36
41
|
end
|
@@ -131,6 +131,18 @@
|
|
131
131
|
<%= idea.content.to_s %>
|
132
132
|
</div>
|
133
133
|
</div>
|
134
|
+
|
135
|
+
<div class="layui-inline">
|
136
|
+
<label class="layui-form-label" style="width: 100px">方案材料:</label>
|
137
|
+
<div class="layui-input-inline" style="width: 1000px">
|
138
|
+
<% idea.attachments.each do |a| %>
|
139
|
+
<%= link_to "/missions/upload_files/download?id=#{a.id}", target: '_blank' do %>
|
140
|
+
<%= a&.filename.to_s %>
|
141
|
+
<% end %>
|
142
|
+
<% end %>
|
143
|
+
</div>
|
144
|
+
</div>
|
145
|
+
|
134
146
|
</div>
|
135
147
|
</div>
|
136
148
|
<hr>
|
@@ -65,14 +65,14 @@
|
|
65
65
|
<%= idea.assist_staffs.map { |d| d&.user&.real_name }.reject(&:blank?).join("、") %>
|
66
66
|
</div>
|
67
67
|
</div>
|
68
|
-
<div class="layui-inline"
|
69
|
-
<label class="layui-form-label" style="width: 100px">方案材料:</label
|
70
|
-
<div class="layui-input-inline"
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
</div
|
75
|
-
</div
|
68
|
+
<!-- <div class="layui-inline">-->
|
69
|
+
<!-- <label class="layui-form-label" style="width: 100px">方案材料:</label>-->
|
70
|
+
<!-- <div class="layui-input-inline">-->
|
71
|
+
<%#= link_to "/missions/upload_files/download?id=#{idea.attachment_id}", target: '_blank' do %>
|
72
|
+
<%#= idea.attachment&.filename.to_s %>
|
73
|
+
<%# end %>
|
74
|
+
<!-- </div>-->
|
75
|
+
<!-- </div>-->
|
76
76
|
<br>
|
77
77
|
<div class="layui-inline">
|
78
78
|
<label class="layui-form-label" style="width: 100px">优先级:</label>
|
@@ -131,6 +131,18 @@
|
|
131
131
|
<%= idea.content.to_s %>
|
132
132
|
</div>
|
133
133
|
</div>
|
134
|
+
|
135
|
+
<div class="layui-inline">
|
136
|
+
<label class="layui-form-label" style="width: 100px">方案材料:</label>
|
137
|
+
<div class="layui-input-inline" style="width: 1000px">
|
138
|
+
<% idea.attachments.each do |a| %>
|
139
|
+
<%= link_to "/missions/upload_files/download?id=#{a.id}", target: '_blank' do %>
|
140
|
+
<%= a&.filename.to_s %>
|
141
|
+
<% end %>
|
142
|
+
<% end %>
|
143
|
+
</div>
|
144
|
+
</div>
|
145
|
+
|
134
146
|
</div>
|
135
147
|
</div>
|
136
148
|
<hr>
|
@@ -138,6 +138,12 @@
|
|
138
138
|
<button type="button" class="layui-btn layui-btn-normal" id="test8">选择文件</button>
|
139
139
|
</div>
|
140
140
|
</div>
|
141
|
+
<div class="layui-col-md6">
|
142
|
+
<labeL class="layui-form-label">文件:</labeL>
|
143
|
+
<div class="layui-input-block">
|
144
|
+
<div id="attachment_ids"></div>
|
145
|
+
</div>
|
146
|
+
</div>
|
141
147
|
</div>
|
142
148
|
<div class="layui-row" style="padding-top: 30px; float: left">
|
143
149
|
<div class="layui-input-block">
|
@@ -284,18 +290,18 @@
|
|
284
290
|
});
|
285
291
|
form.render();
|
286
292
|
|
287
|
-
upload.render({
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
});
|
293
|
+
// upload.render({
|
294
|
+
// elem: '#test8'
|
295
|
+
// , url: '/missions/upload_files' //此处配置你自己的上传接口即可
|
296
|
+
// , auto: true
|
297
|
+
// , accept: 'file' //普通文件
|
298
|
+
// , bindAction: '#test9'
|
299
|
+
// , done: function (res) {
|
300
|
+
// layer.msg('上传成功');
|
301
|
+
// $("#attachment_id").val(res.attachment_id)
|
302
|
+
// // $("#filename").val(res.filename)
|
303
|
+
// }
|
304
|
+
// });
|
299
305
|
|
300
306
|
|
301
307
|
var staff_list = xmSelect.render({
|
@@ -315,12 +321,39 @@
|
|
315
321
|
el: '#assist_staff_ids',
|
316
322
|
data: gon.staffs,
|
317
323
|
filterable: true,
|
318
|
-
multiple:true
|
324
|
+
multiple: true
|
325
|
+
})
|
326
|
+
|
327
|
+
|
328
|
+
var attachment_list = xmSelect.render({
|
329
|
+
el: '#attachment_ids',
|
330
|
+
data: [],
|
331
|
+
filterable: true,
|
332
|
+
multiple: true
|
319
333
|
})
|
320
334
|
|
335
|
+
|
336
|
+
upload.render({
|
337
|
+
elem: '#test8'
|
338
|
+
, url: '/missions/upload_files' //此处配置你自己的上传接口即可
|
339
|
+
, auto: true
|
340
|
+
, accept: 'file' //普通文件
|
341
|
+
, bindAction: '#test9'
|
342
|
+
, done: function (res) {
|
343
|
+
layer.msg('上传成功');
|
344
|
+
// $("#attachment_id").val(res.attachment_id)
|
345
|
+
// $("#filename").val(res.filename)
|
346
|
+
a = attachment_list.getValue()
|
347
|
+
b = [{name: res.filename, value: res.attachment_id}]
|
348
|
+
c = a.concat(b)
|
349
|
+
attachment_list.setValue(c)
|
350
|
+
}
|
351
|
+
});
|
352
|
+
|
321
353
|
staff_list.setValue(gon.staff_value)
|
322
354
|
sale_staff_list.setValue(gon.sale_staff_value)
|
323
355
|
assist_staff_list.setValue(gon.assist_staff_value)
|
356
|
+
attachment_list.setValue(gon.attachment_list)
|
324
357
|
|
325
358
|
var department_id = gon.value;
|
326
359
|
var department = selectInput.render({
|
@@ -354,6 +387,7 @@
|
|
354
387
|
data.field.staff_id = staff_list.getValue('valueStr');
|
355
388
|
data.field.sale_staff_id = sale_staff_list.getValue('valueStr');
|
356
389
|
data.field.assist_staff_ids = assist_staff_list.getValue('valueStr');
|
390
|
+
data.field.attachment_ids = attachment_list.getValue('valueStr');
|
357
391
|
var schools = [];
|
358
392
|
school_list.getValue().forEach(function (d) {
|
359
393
|
schools.push(d.value);
|
@@ -138,6 +138,12 @@
|
|
138
138
|
<button type="button" class="layui-btn layui-btn-normal" id="test8">选择文件</button>
|
139
139
|
</div>
|
140
140
|
</div>
|
141
|
+
<div class="layui-col-md6">
|
142
|
+
<labeL class="layui-form-label">文件:</labeL>
|
143
|
+
<div class="layui-input-block">
|
144
|
+
<div id="attachment_ids"></div>
|
145
|
+
</div>
|
146
|
+
</div>
|
141
147
|
</div>
|
142
148
|
<div class="layui-row" style="padding-top: 30px; float: left">
|
143
149
|
<div class="layui-input-block">
|
@@ -275,18 +281,7 @@
|
|
275
281
|
})
|
276
282
|
|
277
283
|
|
278
|
-
|
279
|
-
elem: '#test8'
|
280
|
-
, url: '/missions/upload_files' //此处配置你自己的上传接口即可
|
281
|
-
, auto: true
|
282
|
-
, accept: 'file' //普通文件
|
283
|
-
, bindAction: '#test9'
|
284
|
-
, done: function (res) {
|
285
|
-
layer.msg('上传成功');
|
286
|
-
$("#attachment_id").val(res.attachment_id)
|
287
|
-
// $("#filename").val(res.filename)
|
288
|
-
}
|
289
|
-
});
|
284
|
+
|
290
285
|
|
291
286
|
|
292
287
|
var department_id = gon.value;
|
@@ -336,6 +331,31 @@
|
|
336
331
|
multiple: true
|
337
332
|
})
|
338
333
|
|
334
|
+
var attachment_list = xmSelect.render({
|
335
|
+
el: '#attachment_ids',
|
336
|
+
data: gon.attachments,
|
337
|
+
filterable: true,
|
338
|
+
multiple: true
|
339
|
+
})
|
340
|
+
|
341
|
+
|
342
|
+
upload.render({
|
343
|
+
elem: '#test8'
|
344
|
+
, url: '/missions/upload_files' //此处配置你自己的上传接口即可
|
345
|
+
, auto: true
|
346
|
+
, accept: 'file' //普通文件
|
347
|
+
, bindAction: '#test9'
|
348
|
+
, done: function (res) {
|
349
|
+
layer.msg('上传成功');
|
350
|
+
// $("#attachment_id").val(res.attachment_id)
|
351
|
+
// $("#filename").val(res.filename)
|
352
|
+
a = attachment_list.getValue()
|
353
|
+
b = [{name: res.filename, value: res.attachment_id}]
|
354
|
+
c = a.concat(b)
|
355
|
+
attachment_list.setValue(c)
|
356
|
+
}
|
357
|
+
});
|
358
|
+
|
339
359
|
//监听提交
|
340
360
|
form.on('submit(saveBtn)', function (data) {
|
341
361
|
// if (department.getValue() == "" && department_id == "") {
|
@@ -361,6 +381,7 @@
|
|
361
381
|
data.field.staff_id = staff_list.getValue('valueStr');
|
362
382
|
data.field.sale_staff_id = sale_staff_list.getValue('valueStr');
|
363
383
|
data.field.assist_staff_ids = assist_staff_list.getValue('valueStr');
|
384
|
+
data.field.attachment_ids = attachment_list.getValue('valueStr');
|
364
385
|
request.authPost("missions/ideas/", data.field, function (res) {
|
365
386
|
if (res.success == false) {
|
366
387
|
layer.alert(res.msg)
|
@@ -368,9 +389,9 @@
|
|
368
389
|
layer.close(parent.add_idea_index);
|
369
390
|
parent.layer.close(parent.layer.getFrameIndex(window.name))
|
370
391
|
parent.table.reload('ideas_table', {
|
371
|
-
|
372
|
-
|
373
|
-
|
392
|
+
done: function () {
|
393
|
+
}
|
394
|
+
});
|
374
395
|
}
|
375
396
|
})
|
376
397
|
// }
|
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.
|
4
|
+
version: 0.9.65
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- anke1460
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-03-
|
11
|
+
date: 2023-03-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -568,6 +568,7 @@ files:
|
|
568
568
|
- db/migrate/20230319050647_add_clazz_to_educode_sales_activities.rb
|
569
569
|
- db/migrate/20230319105048_create_educode_sales_activity_staffs.rb
|
570
570
|
- db/migrate/20230322034022_add_to_school_name_to_ideas.rb
|
571
|
+
- db/migrate/20230327021033_add_attachment_ids_to_ideas.rb
|
571
572
|
- lib/educode_sales.rb
|
572
573
|
- lib/educode_sales/engine.rb
|
573
574
|
- lib/educode_sales/version.rb
|