educode_sales 0.8.4 → 0.8.5
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/assets/javascripts/educode_sales/table2excel.js +2759 -0
- data/app/controllers/educode_sales/assessments_controller.rb +23 -11
- data/app/helpers/educode_sales/application_helper.rb +1 -1
- data/app/models/educode_sales/staff.rb +1 -1
- data/app/views/educode_sales/assessments/_progress.html.erb +214 -146
- data/app/views/educode_sales/assessments/_setup.html.erb +108 -34
- data/app/views/educode_sales/assessments/edit.html.erb +53 -45
- data/app/views/educode_sales/assessments/index.html.erb +16 -4
- data/app/views/educode_sales/assessments/index.json.jbuilder +17 -17
- data/app/views/educode_sales/assessments/new.html.erb +113 -114
- data/app/views/educode_sales/assessments/progress.json.jbuilder +52 -52
- data/app/views/educode_sales/businesses/new_follow_record.html.erb +1 -1
- data/db/migrate/20220523023609_update_assessment_month_column_to_assessment_settings.rb +9 -0
- data/db/migrate/20220523101628_update_column_to_follow_ups.rb +8 -0
- data/lib/educode_sales/version.rb +1 -1
- metadata +5 -2
@@ -26,11 +26,23 @@ module EducodeSales
|
|
26
26
|
end
|
27
27
|
end
|
28
28
|
format.json do
|
29
|
-
@
|
30
|
-
|
31
|
-
|
29
|
+
if @current_admin.is_admin?
|
30
|
+
@assessments = AssessmentsSetting.all
|
31
|
+
else
|
32
|
+
level = @current_admin.role.role_areas.find_by(clazz: '绩效考核').level
|
33
|
+
case level
|
34
|
+
when '自己'
|
35
|
+
@assessments = AssessmentsSetting.where(staff_id: @current_admin.id)
|
36
|
+
when '区域'
|
37
|
+
@staffs = EducodeSales::Staff.joins(:areas).where("educode_sales_commons.id in (?)", @current_admin.areas.pluck(:id)).distinct
|
38
|
+
@assessments = EducodeSales::AssessmentsSetting.where(staff_id: @staffs.select(:id))
|
39
|
+
else
|
40
|
+
@assessments = AssessmentsSetting.all
|
41
|
+
end
|
42
|
+
end
|
43
|
+
@year = params[:q].present? && params[:q][:assessment_year].present? ? params[:q][:assessment_year]:Time.now.year
|
32
44
|
@assessments_id = params[:q].present? && params[:q][:assessment_id].present? ? params[:q][:assessment_id]: '1'
|
33
|
-
@assessments =
|
45
|
+
@assessments = @assessments.where("assessment_year >= ? and assessment_year <= ?", "#{@year}-01-01 00:00:00".to_date, "#{@year}-12-31 23:59:00".to_date)
|
34
46
|
@assessments = @assessments.where(assessment: @assessments_id).order("updated_at desc")
|
35
47
|
if params[:q].present? && params[:q][:staff_id].present?
|
36
48
|
@assessments = @assessments.where(staff_id: params[:q][:staff_id]).order("updated_at desc")
|
@@ -170,7 +182,7 @@ module EducodeSales
|
|
170
182
|
data_count=[]
|
171
183
|
data_list = FollowUp.joins("JOIN educode_sales_businesses ON educode_sales_businesses.last_follow_up_id = educode_sales_follow_ups.id")
|
172
184
|
.where("educode_sales_businesses.id in (?)",businesses.pluck(:id)).map do |m|
|
173
|
-
{value: m.actual_amount.
|
185
|
+
{value: m.actual_amount.to_f, date:m.signed_date.to_s[5..6].to_i}
|
174
186
|
end
|
175
187
|
count_data(data_list,data_count) # 统计数据
|
176
188
|
update_assessments_progress(data_count,d) # 批量更新assessment数据 事物 一个commit
|
@@ -203,7 +215,7 @@ module EducodeSales
|
|
203
215
|
@staff_ids.each do |d|
|
204
216
|
data_count = []
|
205
217
|
data_list = @money_plans.where(staff_id: d).map do |m|
|
206
|
-
{date:m.date_at.to_s[5..6].to_i, value:m.amount.
|
218
|
+
{date:m.date_at.to_s[5..6].to_i, value:m.amount.to_f}
|
207
219
|
end
|
208
220
|
count_data(data_list,data_count)
|
209
221
|
update_assessments_progress(data_count, d)
|
@@ -304,11 +316,11 @@ module EducodeSales
|
|
304
316
|
|
305
317
|
# 更新assessments_settings表中数据
|
306
318
|
def update_assessments_progress(data_count,staff_id)
|
307
|
-
data_count[12] = data_count[0].
|
308
|
-
data_count[13] = data_count[3].
|
309
|
-
data_count[14] = data_count[6].
|
310
|
-
data_count[15] = data_count[9].
|
311
|
-
data_count[16] = data_count[12].
|
319
|
+
data_count[12] = data_count[0].to_f + data_count[1].to_f + data_count[2].to_f
|
320
|
+
data_count[13] = data_count[3].to_f + data_count[4].to_f + data_count[5].to_f
|
321
|
+
data_count[14] = data_count[6].to_f + data_count[7].to_f + data_count[8].to_f
|
322
|
+
data_count[15] = data_count[9].to_f + data_count[10].to_f + data_count[11].to_f
|
323
|
+
data_count[16] = data_count[12].to_f + data_count[13].to_f + data_count[14].to_f + data_count[15].to_f
|
312
324
|
# 开启事物 处理 批量修改数据
|
313
325
|
assessments = @assessments.where(staff_id: staff_id)
|
314
326
|
assessments.update(annual_progress: data_count[16], first_quarter_progress: data_count[12], second_quarter_progress: data_count[13], third_quarter_progress: data_count[14], fourth_quarter_progress: data_count[15],
|
@@ -3,7 +3,6 @@ module EducodeSales
|
|
3
3
|
belongs_to :user
|
4
4
|
belongs_to :role, optional: true
|
5
5
|
|
6
|
-
has_many :market_areas, dependent: :destroy
|
7
6
|
has_many :follow_ups, dependent: :destroy
|
8
7
|
has_many :operation_plans, dependent: :destroy
|
9
8
|
has_many :operation_reports, dependent: :destroy
|
@@ -16,6 +15,7 @@ module EducodeSales
|
|
16
15
|
has_many :sale_plans, dependent: :destroy
|
17
16
|
has_many :staff_schools, dependent: :destroy
|
18
17
|
|
18
|
+
has_many :market_areas, dependent: :destroy
|
19
19
|
has_many :areas, through: :market_areas
|
20
20
|
validates :user_id, uniqueness: { message: '已存在' }
|
21
21
|
|
@@ -1,12 +1,3 @@
|
|
1
|
-
<script type="text/html" id="progress_Toolbar">
|
2
|
-
<div class="layui-btn-container">
|
3
|
-
<span class="table-label">指标完成情况</span>
|
4
|
-
<% if can?(:export_result, EducodeSales::AssessmentsSetting) %>
|
5
|
-
<button class="layui-btn layui-btn-primary layui-border-green layui-btn-sm data-count-edit export_more-btn pull-right" style="color: #0000FF;" data-name="export" data-id="export">
|
6
|
-
导出<i class="layui-icon layui-icon-down layui-nav-more" style="font-size: 12px"></i></button>
|
7
|
-
<%end %>
|
8
|
-
</div>
|
9
|
-
</script>
|
10
1
|
<!--搜索-->
|
11
2
|
<div class="layuimini-main min-height-table" id="monthly_table_wraper">
|
12
3
|
<form class="layui-form layui-form-pane" lay-filter="assessment_progress_form">
|
@@ -29,7 +20,7 @@
|
|
29
20
|
</div>
|
30
21
|
</div>
|
31
22
|
<div class="layui-inline">
|
32
|
-
<label class="layui-form-label"
|
23
|
+
<label class="layui-form-label">考核人员</label>
|
33
24
|
<div class="layui-input-inline large-select">
|
34
25
|
<%= select_tag "staff_id", options_for_select(@staffs), { id: 'weekly_staff_id', include_blank: true} %>
|
35
26
|
</div>
|
@@ -44,21 +35,202 @@
|
|
44
35
|
</form>
|
45
36
|
|
46
37
|
<!--表格-->
|
47
|
-
<table class="layui-
|
48
|
-
|
49
|
-
|
50
|
-
|
38
|
+
<table class="layui-tab " id="progressTable" lay-filter="progressTable"></table>
|
39
|
+
</div>
|
51
40
|
|
41
|
+
<!--隐藏导出用的table-->
|
42
|
+
<div class="layui-hide">
|
43
|
+
<table class="layui-table" lay-data="{height:315, url: '/missions/assessments/progress' }" id="export-table" lay-filter="export-table">
|
44
|
+
<thead>
|
45
|
+
<tr>
|
46
|
+
<th lay-data="{width:80, type:'numbers' ,sort: true}" rowspan="2">序号</th>
|
47
|
+
<th lay-data="{field:'name', width:120}" rowspan="2">考核人员</th>
|
48
|
+
<th lay-data="{align:'center'}" colspan="5">全年</th>
|
49
|
+
<th lay-data="{align:'center'}" colspan="5">第1季度</th>
|
50
|
+
<th lay-data="{align:'center'}" colspan="5">1月</th>
|
51
|
+
<th lay-data="{align:'center'}" colspan="5">2月</th>
|
52
|
+
<th lay-data="{align:'center'}" colspan="5">3月</th>
|
53
|
+
<th lay-data="{align:'center'}" colspan="5">第2季度</th>
|
54
|
+
<th lay-data="{align:'center'}" colspan="5">4月</th>
|
55
|
+
<th lay-data="{align:'center'}" colspan="5">5月</th>
|
56
|
+
<th lay-data="{align:'center'}" colspan="5">6月</th>
|
57
|
+
<th lay-data="{align:'center'}" colspan="5">第3季度</th>
|
58
|
+
<th lay-data="{align:'center'}" colspan="5">7月</th>
|
59
|
+
<th lay-data="{align:'center'}" colspan="5">8月</th>
|
60
|
+
<th lay-data="{align:'center'}" colspan="5">9月</th>
|
61
|
+
<th lay-data="{align:'center'}" colspan="5">第4季度</th>
|
62
|
+
<th lay-data="{align:'center'}" colspan="5">10月</th>
|
63
|
+
<th lay-data="{align:'center'}" colspan="5">11月</th>
|
64
|
+
<th lay-data="{align:'center'}" colspan="5">12月</th>
|
65
|
+
</tr>
|
66
|
+
<tr>
|
67
|
+
<th lay-data="{field:'annual', width:80}">目标</th>
|
68
|
+
<th lay-data="{field:'annual_progress', width:80}">完成</th>
|
69
|
+
<th lay-data="{field:'annual_dif', width:80}">差额</th>
|
70
|
+
<th lay-data="{field:'annual_rate', width:80}">完成率</th>
|
71
|
+
<th lay-data="{field:'annual_score', width:80}">得分</th>
|
72
|
+
|
73
|
+
<th lay-data="{field:'first_quarter', width:80}">目标</th>
|
74
|
+
<th lay-data="{field:'first_quarter_progress', width:80}">完成</th>
|
75
|
+
<th lay-data="{field:'first_quarter_dif', width:80}">差额</th>
|
76
|
+
<th lay-data="{field:'first_quarter_rate', width:80}">完成率</th>
|
77
|
+
<th lay-data="{field:'first_quarter_score', width:80}">得分</th>
|
78
|
+
|
79
|
+
<th lay-data="{field:'january', width:80}">目标</th>
|
80
|
+
<th lay-data="{field:'january_progress', width:80}">完成</th>
|
81
|
+
<th lay-data="{field:'january_dif', width:80}">差额</th>
|
82
|
+
<th lay-data="{field:'january_rate', width:80}">完成率</th>
|
83
|
+
<th lay-data="{field:'january_score', width:80}">得分</th>
|
84
|
+
|
85
|
+
<th lay-data="{field:'february', width:80}">目标</th>
|
86
|
+
<th lay-data="{field:'february_progress', width:80}">完成</th>
|
87
|
+
<th lay-data="{field:'february_dif', width:80}">差额</th>
|
88
|
+
<th lay-data="{field:'february_rate', width:80}">完成率</th>
|
89
|
+
<th lay-data="{field:'february_score', width:80}">得分</th>
|
90
|
+
|
91
|
+
<th lay-data="{field:'march', width:80}">目标</th>
|
92
|
+
<th lay-data="{field:'march_progress', width:80}">完成</th>
|
93
|
+
<th lay-data="{field:'march_dif', width:80}">差额</th>
|
94
|
+
<th lay-data="{field:'march_rate', width:80}">完成率</th>
|
95
|
+
<th lay-data="{field:'march_score', width:80}">得分</th>
|
96
|
+
|
97
|
+
<th lay-data="{field:'second_quarter', width:80}">目标</th>
|
98
|
+
<th lay-data="{field:'second_quarter_progress', width:80}">完成</th>
|
99
|
+
<th lay-data="{field:'second_quarter_dif', width:80}">差额</th>
|
100
|
+
<th lay-data="{field:'second_quarter_rate', width:80}">完成率</th>
|
101
|
+
<th lay-data="{field:'second_quarter_score', width:80}">得分</th>
|
102
|
+
|
103
|
+
<th lay-data="{field:'april', width:80}">目标</th>
|
104
|
+
<th lay-data="{field:'april_progress', width:80}">完成</th>
|
105
|
+
<th lay-data="{field:'april_dif', width:80}">差额</th>
|
106
|
+
<th lay-data="{field:'april_rate', width:80}">完成率</th>
|
107
|
+
<th lay-data="{field:'april_score', width:80}">得分</th>
|
108
|
+
|
109
|
+
<th lay-data="{field:'may', width:80}">目标</th>
|
110
|
+
<th lay-data="{field:'may_progress', width:80}">完成</th>
|
111
|
+
<th lay-data="{field:'may_dif', width:80}">差额</th>
|
112
|
+
<th lay-data="{field:'may_rate', width:80}">完成率</th>
|
113
|
+
<th lay-data="{field:'may_score', width:80}">得分</th>
|
114
|
+
|
115
|
+
<th lay-data="{field:'june', width:80}">目标</th>
|
116
|
+
<th lay-data="{field:'june_progress', width:80}">完成</th>
|
117
|
+
<th lay-data="{field:'june_dif', width:80}">差额</th>
|
118
|
+
<th lay-data="{field:'june_rate', width:80}">完成率</th>
|
119
|
+
<th lay-data="{field:'june_score', width:80}">得分</th>
|
120
|
+
|
121
|
+
<th lay-data="{field:'third_quarter', width:80}">目标</th>
|
122
|
+
<th lay-data="{field:'third_quarter_progress', width:80}">完成</th>
|
123
|
+
<th lay-data="{field:'third_quarter_dif', width:80}">差额</th>
|
124
|
+
<th lay-data="{field:'third_quarter_rate', width:80}">完成率</th>
|
125
|
+
<th lay-data="{field:'third_quarter_score', width:80}">得分</th>
|
126
|
+
|
127
|
+
<th lay-data="{field:'july', width:80}">目标</th>
|
128
|
+
<th lay-data="{field:'july_progress', width:80}">完成</th>
|
129
|
+
<th lay-data="{field:'july_dif', width:80}">差额</th>
|
130
|
+
<th lay-data="{field:'july_rate', width:80}">完成率</th>
|
131
|
+
<th lay-data="{field:'july_score', width:80}">得分</th>
|
132
|
+
|
133
|
+
<th lay-data="{field:'august', width:80}">目标</th>
|
134
|
+
<th lay-data="{field:'august_progress', width:80}">完成</th>
|
135
|
+
<th lay-data="{field:'august_dif', width:80}">差额</th>
|
136
|
+
<th lay-data="{field:'august_rate', width:80}">完成率</th>
|
137
|
+
<th lay-data="{field:'august_score', width:80}">得分</th>
|
138
|
+
|
139
|
+
<th lay-data="{field:'september', width:80}">目标</th>
|
140
|
+
<th lay-data="{field:'september_progress', width:80}">完成</th>
|
141
|
+
<th lay-data="{field:'september_dif', width:80}">差额</th>
|
142
|
+
<th lay-data="{field:'september_rate', width:80}">完成率</th>
|
143
|
+
<th lay-data="{field:'september_score', width:80}">得分</th>
|
144
|
+
|
145
|
+
<th lay-data="{field:'fourth_quarter', width:80}">目标</th>
|
146
|
+
<th lay-data="{field:'fourth_quarter_progress', width:80}">完成</th>
|
147
|
+
<th lay-data="{field:'fourth_quarter_dif', width:80}">差额</th>
|
148
|
+
<th lay-data="{field:'fourth_quarter_rate', width:80}">完成率</th>
|
149
|
+
<th lay-data="{field:'fourth_quarter_score', width:80}">得分</th>
|
150
|
+
|
151
|
+
<th lay-data="{field:'october', width:80}">目标</th>
|
152
|
+
<th lay-data="{field:'october_progress', width:80}">完成</th>
|
153
|
+
<th lay-data="{field:'october_dif', width:80}">差额</th>
|
154
|
+
<th lay-data="{field:'october_rate', width:80}">完成率</th>
|
155
|
+
<th lay-data="{field:'october_score', width:80}">得分</th>
|
156
|
+
|
157
|
+
<th lay-data="{field:'november', width:80}">目标</th>
|
158
|
+
<th lay-data="{field:'november_progress', width:80}">完成</th>
|
159
|
+
<th lay-data="{field:'november_dif', width:80}">差额</th>
|
160
|
+
<th lay-data="{field:'november_rate', width:80}">完成率</th>
|
161
|
+
<th lay-data="{field:'november_score', width:80}">得分</th>
|
162
|
+
|
163
|
+
<th lay-data="{field:'december', width:80}">目标</th>
|
164
|
+
<th lay-data="{field:'december_progress', width:80}">完成</th>
|
165
|
+
<th lay-data="{field:'december_dif', width:80}">差额</th>
|
166
|
+
<th lay-data="{field:'december_rate', width:80}">完成率</th>
|
167
|
+
<th lay-data="{field:'december_score', width:80}">得分</th>
|
168
|
+
|
169
|
+
</tr>
|
170
|
+
</thead>
|
171
|
+
</table>
|
52
172
|
</div>
|
53
173
|
|
54
174
|
|
175
|
+
<script src="educode_sales/table2excel.js"></script>
|
176
|
+
<script type="text/html" id="progress_Toolbar">
|
177
|
+
<div class="layui-btn-container">
|
178
|
+
<span class="table-label">指标完成情况</span>
|
179
|
+
<% if can?(:export_result, EducodeSales::AssessmentsSetting) %>
|
180
|
+
<button class="layui-btn layui-btn-primary layui-border-green layui-btn-sm data-count-edit export_more-btn pull-right" style="color: #0000FF;" data-name="export" data-id="export">
|
181
|
+
导出<i class="layui-icon layui-icon-down layui-nav-more" style="font-size: 12px"></i></button>
|
182
|
+
<%end %>
|
183
|
+
</div>
|
184
|
+
</script>
|
55
185
|
|
56
186
|
|
57
187
|
<script>
|
58
|
-
|
188
|
+
var $=layui.jquery
|
189
|
+
var demo = function() {
|
190
|
+
let header_tr = $("#export-table").next().find(".layui-table-header").find("tr");
|
191
|
+
let body_tr = $("#export-table").next().find(".layui-table-body").find("tr");
|
192
|
+
let header_html = "";
|
193
|
+
let body_html = "";
|
194
|
+
// 获取表头html,包括单元格的合并
|
195
|
+
$.each(header_tr,function (i,tr) {
|
196
|
+
let header_th = $(tr).find("th");
|
197
|
+
header_html += "<tr>";
|
198
|
+
$.each(header_th,function (j,th) {
|
199
|
+
let rowspan_num = $(th).attr("rowspan");// 行合并数
|
200
|
+
let colspan_num = $(th).attr("colspan");// 列合并数
|
201
|
+
if (rowspan_num && !colspan_num){// 只有行合并时
|
202
|
+
header_html += '<th rowspan= "'+ rowspan_num +'">';
|
203
|
+
} else if (colspan_num && !rowspan_num){// 只有列合并时
|
204
|
+
header_html += '<th colspan= "'+ colspan_num +'">';
|
205
|
+
} else if (rowspan_num && colspan_num){// 行列合并均有时
|
206
|
+
header_html += '<th rowspan= "'+ rowspan_num +'" colspan="'+ colspan_num +'">';
|
207
|
+
} else {// 没有发生单元格合并
|
208
|
+
header_html += '<th>';
|
209
|
+
}
|
210
|
+
header_html += $(th).children().children().text() + '</th>';// 获取表头名称并拼接th标签
|
211
|
+
console.log(header_html)
|
212
|
+
})
|
213
|
+
header_html += '</tr>';
|
214
|
+
})
|
215
|
+
// 获取表格body数据
|
216
|
+
$.each(body_tr,function (i,tr) {
|
217
|
+
let body_td = $(tr).find("td");
|
218
|
+
body_html += '<tr>';
|
219
|
+
$.each(body_td,function (j,td) {
|
220
|
+
body_html += '<td>' + $(td).children().text() + '</td>';
|
221
|
+
})
|
222
|
+
body_html += '</tr>';
|
223
|
+
})
|
224
|
+
$("#export-table tr").remove();// 清除之前的doom结构
|
225
|
+
$("#export-table").append(header_html).append(body_html);
|
226
|
+
$("#export-table").hide();
|
227
|
+
}
|
59
228
|
|
229
|
+
</script>
|
60
230
|
|
61
231
|
|
232
|
+
<script>
|
233
|
+
layui.use(['form', 'table', 'miniPage', 'element', 'rate', 'laydate', 'request'], function () {
|
62
234
|
|
63
235
|
var $ = layui.jquery,
|
64
236
|
form = layui.form,
|
@@ -69,6 +241,7 @@
|
|
69
241
|
miniPage = layui.miniPage;
|
70
242
|
dropdown = layui.dropdown;
|
71
243
|
|
244
|
+
|
72
245
|
laydate.render({
|
73
246
|
elem: '#assessment_year',
|
74
247
|
type: 'year'
|
@@ -83,13 +256,12 @@
|
|
83
256
|
,totalRow:true
|
84
257
|
,title: "绩效考核指标完成情况" // 目前发现的作用(导出文件的文件名)
|
85
258
|
,defaultToolbar: ['filter']
|
86
|
-
// ,limit: 10
|
87
259
|
,limits: [10,15,20,30,40,50,60,70,80,90]
|
88
260
|
,limit: 10
|
89
261
|
,page: true
|
90
262
|
,cols:[
|
91
263
|
[ //标题栏
|
92
|
-
{ title: '序号', width: 80, rowspan: 2,type:'numbers',fixed:'left',
|
264
|
+
{ title: '序号', width: 80, rowspan: 2,type:'numbers',fixed:'left',} //rowspan即纵向跨越的单元格数
|
93
265
|
,{field: 'name', title: '考核人员', width: 120, rowspan: 2,fixed:'left'}
|
94
266
|
,{align: 'center', title: '全年', colspan: 5} //colspan即横跨的单元格数,这种情况下不用设置field和width
|
95
267
|
,{align: 'center', title: '第1季度', colspan: 5} //colspan即横跨的单元格数,这种情况下不用设置field和width
|
@@ -104,10 +276,10 @@
|
|
104
276
|
,{align: 'center', title: '7月', colspan: 5} //colspan即横跨的单元格数,这种情况下不用设置field和width
|
105
277
|
,{align: 'center', title: '8月', colspan: 5} //colspan即横跨的单元格数,这种情况下不用设置field和width
|
106
278
|
,{align: 'center', title: '9月', colspan: 5} //colspan即横跨的单元格数,这种情况下不用设置field和width
|
107
|
-
,{align: 'center', title: '第4季度', colspan: 5}
|
108
|
-
,{align: 'center', title: '10月', colspan: 5}
|
109
|
-
,{align: 'center', title: '11月', colspan: 5}
|
110
|
-
,{align: 'center', title: '12月', colspan: 5}
|
279
|
+
,{align: 'center', title: '第4季度', colspan: 5}
|
280
|
+
,{align: 'center', title: '10月', colspan: 5}
|
281
|
+
,{align: 'center', title: '11月', colspan: 5}
|
282
|
+
,{align: 'center', title: '12月', colspan: 5}
|
111
283
|
],
|
112
284
|
[
|
113
285
|
{field: 'annual', title: '目标', width: 80}
|
@@ -260,17 +432,17 @@
|
|
260
432
|
})
|
261
433
|
|
262
434
|
}
|
435
|
+
|
263
436
|
function export_excel() {
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
})
|
437
|
+
demo()
|
438
|
+
let table2excel = new Table2Excel();
|
439
|
+
/**
|
440
|
+
* 此处的show()是为了避免table2excel将hide属性带入excel中
|
441
|
+
* 导致下载后的excel中所有数据被隐藏
|
442
|
+
*/
|
443
|
+
$('#export-table').show();
|
444
|
+
table2excel.export($('#export-table'), "指标完成情况");
|
445
|
+
$('#export-table').hide();
|
274
446
|
|
275
447
|
}
|
276
448
|
|
@@ -302,13 +474,20 @@
|
|
302
474
|
sort: sort
|
303
475
|
}
|
304
476
|
}, 'data');
|
305
|
-
|
477
|
+
// 导出table中的数据也要reload
|
478
|
+
table.reload('export-table', {
|
479
|
+
page: {
|
480
|
+
curr: 1
|
481
|
+
},
|
482
|
+
where: {
|
483
|
+
q: search,
|
484
|
+
sort: sort
|
485
|
+
}
|
486
|
+
})
|
306
487
|
return false;
|
307
488
|
});
|
308
489
|
|
309
490
|
form.on('submit(progress_resert_btn)', function (data) {
|
310
|
-
var field = data.field;
|
311
|
-
console.log("--------------------")
|
312
491
|
console.log(gon.export_menus)
|
313
492
|
form.val('assessment_progress_form', {
|
314
493
|
staff_id: '',
|
@@ -319,118 +498,7 @@
|
|
319
498
|
});
|
320
499
|
|
321
500
|
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
/**
|
342
|
-
* toolbar事件监听
|
343
|
-
*/
|
344
|
-
// table.on('toolbar(progressTable)', function (obj) {
|
345
|
-
// if (obj.event === 'add') { // 监听添加操作
|
346
|
-
// var content = miniPage.getHrefContent('/missions/plans/new_monthly');
|
347
|
-
// var openWH = miniPage.getOpenWidthHeight();
|
348
|
-
// sindex = layer.open({
|
349
|
-
// title: '添加月报',
|
350
|
-
// type: 1,
|
351
|
-
// shade: 0.2,
|
352
|
-
// maxmin: true,
|
353
|
-
// shadeClose: true,
|
354
|
-
// area: [openWH[0] + 'px', openWH[1] + 'px'],
|
355
|
-
// offset: [openWH[2] + 'px', openWH[3] + 'px'],
|
356
|
-
// content: content,
|
357
|
-
// success: function (layero, index) {
|
358
|
-
// // 重新渲染弹层中的下拉选择框select
|
359
|
-
// form.render('select');
|
360
|
-
// }
|
361
|
-
// });
|
362
|
-
// $(window).on("resize", function () {
|
363
|
-
// layer.full(sindex);
|
364
|
-
// });
|
365
|
-
// }
|
366
|
-
// });
|
367
|
-
|
368
|
-
// table.on('tool(progressTable)', function (obj) {
|
369
|
-
// var data = obj.data;
|
370
|
-
// if (obj.event === 'edit') {
|
371
|
-
// var content = miniPage.getHrefContent('/missions/sale_reports/' + data.id + "/edit");
|
372
|
-
// var openWH = miniPage.getOpenWidthHeight();
|
373
|
-
// from_edit_monthly = true
|
374
|
-
// sindex = layer.open({
|
375
|
-
// title: '编辑月报',
|
376
|
-
// type: 1,
|
377
|
-
// shade: 0.2,
|
378
|
-
// maxmin: true,
|
379
|
-
// shadeClose: true,
|
380
|
-
// area: [openWH[0] + 'px', openWH[1] + 'px'],
|
381
|
-
// offset: [openWH[2] + 'px', openWH[3] + 'px'],
|
382
|
-
// content: content,
|
383
|
-
// });
|
384
|
-
// $(window).on("resize", function () {
|
385
|
-
// layer.full(sindex);
|
386
|
-
// });
|
387
|
-
// return false;
|
388
|
-
// } else if (obj.event === 'delete') {
|
389
|
-
// layer.confirm('确定删除ID为' + data.id + " 的月报", function (index) {
|
390
|
-
// request.delete('missions/sale_reports/' + data.id, {}, function (res) {
|
391
|
-
// layer.close(index);
|
392
|
-
// table.reload("progressTable")
|
393
|
-
// })
|
394
|
-
// });
|
395
|
-
// } else if (obj.event === 'show') {
|
396
|
-
// content = miniPage.getHrefContent('/missions/sale_reports/' + data.id);
|
397
|
-
// openWH = miniPage.getOpenWidthHeight();
|
398
|
-
// index = layer.open({
|
399
|
-
// title: '查看月报',
|
400
|
-
// type: 1,
|
401
|
-
// shade: 0.2,
|
402
|
-
// maxmin: true,
|
403
|
-
// shadeClose: true,
|
404
|
-
// area: [openWH[0] + 'px', openWH[1] + 'px'],
|
405
|
-
// offset: [openWH[2] + 'px', openWH[3] + 'px'],
|
406
|
-
// content: content,
|
407
|
-
// });
|
408
|
-
// $(window).on("resize", function () {
|
409
|
-
// layer.full(index);
|
410
|
-
// });
|
411
|
-
// return false;
|
412
|
-
// } else if (obj.event === 'audit') {
|
413
|
-
// content = miniPage.getHrefContent('/missions/sale_reports/' + data.id + "/audit");
|
414
|
-
// openWH = miniPage.getOpenWidthHeight();
|
415
|
-
// from_source = 'monthly';
|
416
|
-
// report_id = data.id;
|
417
|
-
// sindex = layer.open({
|
418
|
-
// title: '审查'+ data.staff +'的月报',
|
419
|
-
// type: 1,
|
420
|
-
// shade: 0.2,
|
421
|
-
// maxmin: true,
|
422
|
-
// shadeClose: true,
|
423
|
-
// area: [openWH[0] + 'px', openWH[1] + 'px'],
|
424
|
-
// offset: [openWH[2] + 'px', openWH[3] + 'px'],
|
425
|
-
// content: content,
|
426
|
-
// });
|
427
|
-
// $(window).on("resize", function () {
|
428
|
-
// layer.full(sindex);
|
429
|
-
// });
|
430
|
-
// return false;
|
431
|
-
// }
|
432
|
-
// });
|
433
|
-
|
434
501
|
});
|
435
502
|
</script>
|
436
503
|
|
504
|
+
|