bAutoReport.html
12.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
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
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
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
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('自动化报告列表')"/>
</head>
<body class="gray-bg">
<div class="container-div">
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="formId">
<div class="select-list">
<ul>
<li>
企业名称:<input type="text" name="orgName"/>
</li>
<!--<li>
下单人id:<input type="text" name="userId"/>
</li>
<li>
信用报告id:<input type="text" name="creditReportId"/>
</li>
<li>
原始报告信息下载地址:<input type="text" name="firstUrl"/>
</li>
<li>
最终报告信息下载地址:<input type="text" name="finalUrl"/>
</li>
<li>
pdf报告下载地址:<input type="text" name="pdfUrl"/>
</li>
<li>
报告生成错误信息:<input type="text" name="errorMsg"/>
</li>
<li>
创建时间:<input type="text" name="createTime"/>
</li>
<li>
创建人:<input type="text" name="createBy"/>
</li>
<li>
更新时间:<input type="text" name="updateTime"/>
</li>
<li>
更新时间:<input type="text" name="updateBy"/>
</li>-->
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</a>
</li>
</ul>
</div>
</form>
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<!-- <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="business:bAutoReport:add">-->
<!-- <i class="fa fa-plus"></i> 添加-->
<!-- </a>-->
<!-- <a class="btn btn-primary btn-edit disabled" onclick="$.operate.edit()" shiro:hasPermission="business:bAutoReport:edit">-->
<!-- <i class="fa fa-edit"></i> 修改-->
<!-- </a>-->
<!-- <a class="btn btn-danger btn-del btn-del disabled" onclick="$.operate.removeAll()" shiro:hasPermission="business:bAutoReport:remove">-->
<!-- <i class="fa fa-remove"></i> 删除-->
<!-- </a>-->
<!-- <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="business:bAutoReport:export">-->
<!-- <i class="fa fa-download"></i> 导出-->
<!-- </a>-->
<!-- <a style="display: inline-block"> <input id="scoreImgIpt" type="number" style="width:200px;" min=0 max=100 laceholder="打分卡分数" class="form-control"/></a>-->
<!-- <a style="display: inline-block">-->
<!-- </a>-->
<!-- <a class="btn btn-success" id="scoreImgShow" >-->
<!-- <i class="fa fa-plus"></i> 获取打分卡评分图-->
<!-- </a>-->
<a class="btn btn-warning" onclick="updateXcFinanceTag()" id="xcimport">
<i class="fa fa-plus"></i> 上传详财数据
</a>
<a class="btn btn-success" onclick="importDsExcelTag()" id="dsimport">
<i class="fa fa-plus"></i> 上传大数数据
</a>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table" data-mobile-responsive="true"></table>
</div>
</div>
</div>
<div th:include="include :: footer"></div>
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('business:bAutoReport:edit')}]];
var removeFlag = [[${@permission.hasPermi('business:bAutoReport:remove')}]];
var importFlag = [[${@permission.hasPermi('business:bAutoReport:import')}]];
var prefix = ctx + "business/bAutoReport";
var imgOp="data:image/png;base64,";
function updateXcFinanceTag(){
//普通版 特殊版
layer.open({
title: '上传详财财务数据',
area: ['500px', '500px']
,content: '<div><input type="file" class="form-control" id="xcFile" /><select class="form-control" id="xcType" style="margin:2% 0;"><option value="3">新版</option><option value="1">老版本</option><option value="2">特殊版</option></select><div class="btn btn-success" style="width: 100%" onclick="updateXcFinancefun()">上传</div></div>'
});
}
function importDsExcelTag(name){
layer.open({
area: ['400px', '230px'],
title: "导入大数财务数据",
content: '<input type="file" id="dsField"/></br>',
// 弹层外区域关闭
btn1: function(layero, index){
console.log("执行")
var files=$("#dsField")[0].files[0]
var formData = new FormData();
formData.append("file",files);
$.ajax({
url: prefix+"/importDsFinance",
type: 'POST',
data: formData,
processData: false,
contentType:false,
success : function(data) {
console.log(data)
$.modal.msg(data.msg)
$.modal.closeAll();
}
});
}
})
}
function updateXcFinancefun(){
alert("开始上传");
var files=$("#xcFile")[0].files[0]
var xcType=$("#xcType").val()
if(null==files||undefined==files){
$.modal.msg("请先选择文件")
return;
}
console.log(files.name.indexOf(".xls"))
if (files.name.indexOf(".xlsx")<=0&&files.name.indexOf(".xls")<=0){
$.modal.msg("请上传表格.xlsx/.xls")
return;
}
var formData = new FormData();
formData.append("file",files);
formData.append("xcType",xcType);
var url=xcType=="1"?"importFinanceData":xcType==2?"importData":"newXcGroup1";
$.ajax({
url: prefix+"/"+url,
type: 'POST',
data: formData,
processData: false,
contentType:false,
success : function(data) {
console.log(data)
$.modal.msg(data.msg)
}
});
}
$("#scoreImgShow").click(function(){
$.modal.msg("开始生成打分卡图片,请稍等!</br>生成后会自动弹出")
var scoreImg =$("#scoreImgIpt").val();
var lvImg =$("#lvImgIpt").val();
$.get(prefix+"/getScoreImg?scoreImg="+scoreImg+"&lvImg="+lvImg,(data)=>{
layer.open({
title: '在线调试',
area: ['1000px', '500px']
,content: '<img src="'+imgOp+data.data.scoreImg+'"></br><img src="'+imgOp+data.data.lvImg+'">'
});
})
})
$(function() {
if (""!=importFlag){
$("#xcimport").css({"display":"none"})
$("#dsimport").css({"display":"none"})
}
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
importUrl: prefix + "/importFinanceData",
modalName: "自动化报告",
showExport: true,
columns: [{
checkbox: true
},
{
field : 'id',
title : '',
visible: false
},
{
field : 'orgName',
title : '企业名称',
sortable: true
},
{
field : 'reportTypeStr',
title : '报告类型',
sortable: false,
visible: true
},
{
field : 'orderCompanyName',
title : '下单公司名称',
sortable: false,
visible: true
},
{
field : 'userId',
title : '下单人id',
sortable: false,
visible: false
},
{
field : 'userName',
title : '下单人',
sortable: true
},
{
field : 'applicationTime',
title : '下单时间',
sortable: true,
visible: true
},
{
field : 'zdStatus',
title : '中登状态',
sortable: true,
visible: true
},
/*{
field : 'creditReportId',
title : '信用报告id',
sortable: true
},
{
field : 'firstUrl',
title : '原始报告信息下载地址',
sortable: true
},
{
field : 'finalUrl',
title : '最终报告信息下载地址',
sortable: true
},
{
field : 'pdfUrl',
title : 'pdf报告下载地址',
sortable: true
},
{
field : 'errorMsg',
title : '报告生成错误信息',
sortable: true
},
{
field : 'createTime',
title : '创建时间',
sortable: true
},
{
field : 'createBy',
title : '创建人',
sortable: true
},
{
field : 'updateTime',
title : '更新时间',
sortable: true
},
{
field : 'updateBy',
title : '更新时间',
sortable: true
},*/
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
// 判断 reportType 是否为 -3,如果是,则添加导入详财的按钮
// if (row.reportType === "详财") {
if (row.reportType == "-3"||row.reportType == "-5") {
actions.push('<i class="btn btn-success btn-xs ' + importFlag + '" href="javascript:void(0)" onclick="$.table.importExcel()"><i class="fa fa-import"></i>导入详财</i> ');
}
// actions.push('<apiDoc class="btn btn-success btn-xs ' + importFlag + '" href="javascript:void(0)" th:hidden="row.reportType = -3" onclick="$.table.importExcel()"><i class="fa fa-edit"></i>导入详财</apiDoc> ');
if(null==row.firstUrl){
actions.push('<apiDoc class="btn btn-danger btn-xs ' + editFlag + '" href="javascript:void(0)" <i class="fa fa-edit"></i>暂未生成文件</apiDoc> ')
}else{
actions.push('<apiDoc class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>交付</apiDoc> ')
}
;
actions.push('<a class="btn btn-info btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="reCreateReport(\'' + row.id + '\')"><i class="fa fa-plus"></i>重新生成报告</a> ');
// actions.push('<apiDoc class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</apiDoc>');
return actions.join('');
}
}]
};
$.table.init(options);
});
/**
* 重新生成报告
* @param aotuReportId
*/
function reCreateReport(aotuReportId) {
layer.open({
title: '在线调试'
,content: '<input type="text" placeholder="修改的行业Code" id="newIndustry" style="width:100%;margin-bottom: 5px;"></br>'+
'<input type="number" placeholder="修改评分" id="md_score" style="width:100%;;margin-bottom: 5px;"></br>'+
'<input type="number" placeholder="修改违约率" id="md_default_rate" style="width:100%;;margin-bottom: 5px;"></br>'+
'<input type="number" placeholder="修改授信额度" id="creditLimit" style="width:100%;;margin-bottom: 5px;"></br>'+
'<select id="lvImgIpt" class="form-control"> <option value="">请选择信用等级</option> <option value="AA">AA</option> <option value="A">A</option> <option value="BB">BB</option> <option value="B">B</option> <option value="B-">B-</option> <option value="C">C</option> <option value="C-">C-</option> <option value="D">D</option> <option value="NR">NR</option> </select>'
,btn: ['生成', '取消']
,yes: function(index, layero){
var id = aotuReportId;
var url = prefix + "/reCreateReport";
var newId=$("#newIndustry").val()
var creditScore=$("#md_score").val()
var defaultRate=$("#md_default_rate").val()
var creditLv=$("#lvImgIpt").val()
var creditLimit=$("#creditLimit").val()
$.get(url+"?id="+id+"&userName="+newId+"&creditScore="+creditScore+"&creditLv="+creditLv+"&defaultRate="+defaultRate+"&creditLimit="+creditLimit,(data)=>{
})
$.table.refresh();
layer.close(index); //如果设定了yes回调,需进行手工关闭
}
,cancel: function(){
}
});
}
</script>
</body>
<!-- 导入区域 -->
<script id="importTpl" type="text/template">
<form enctype="multipart/form-data" class="mt20 mb10">
<div class="col-xs-offset-1">
<input type="file" id="file" name="file"/>
<div class="mt10 pt5">
<input type="checkbox" id="updateSupport" name="updateSupport" title="如果登录账户已经存在,更新这条数据。"> 是否更新已经存在的用户数据
<a onclick="$.table.importTemplate()" class="btn btn-default btn-xs"><i class="fa fa-file-excel-o"></i> 下载模板</a>
</div>
<font color="red" class="pull-left mt10">
提示:仅允许导入“xls”或“xlsx”格式文件!
</font>
</div>
</form>
</script>
</html>