add.html
19.7 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
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
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('新增错误数据撤销申请')" />
<th:block th:include="include :: datetimepicker-css" />
<th:block th:include="include :: bootstrap-fileinput-css"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-modify-add">
<h4 class="form-header h4">错误数据撤销申请</h4>
<!--<div class="form-group">
<label class="col-sm-3 control-label is-required">信息类型:</label>
<div class="col-sm-8">
<select name="applyType" class="form-control m-b" th:with="type=${@dict.getEnum('exception_apply_type')}" required>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>-->
<!-- 信息类型-->
<input name="applyType" value="sgs" type="hidden" />
<div class="form-group">
<label class="col-sm-3 control-label is-required">问题类别:</label>
<div class="col-sm-8">
<select name="exceptionType" class="form-control m-b" th:with="type=${@dict.getEnum('exception_data_type')}" required>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">申请内容:</label>
<div class="col-sm-8">
<textarea name="applyContent" class="form-control" required></textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">附件:</label>
<div class="col-sm-8">
<input type="hidden" name="applyFile">
<div class="file-loading">
<input class="form-control file-upload" id="applyFile" name="file" type="file">
</div>
<span style="color: red"> 提示: 多个文件请上传压缩包 </span>
</div>
</div>
<!--<div class="form-group">
<label class="col-sm-3 control-label">业务附件:</label>
<div class="col-sm-8">
<input type="hidden" name="businessFile">
<div class="file-loading">
<input class="form-control file-upload" id="businessFile" name="file" type="file">
</div>
</div>
</div>-->
<div class="form-group">
<label class="col-sm-3 control-label">备注:</label>
<div class="col-sm-8">
<textarea name="applyMemo" class="form-control"></textarea>
</div>
</div>
<h4 class="form-header h4">错误数据信息</h4>
<div class="row">
<div class="col-sm-12">
<button type="button" class="btn btn-white btn-sm" onclick="downTemplate()"><i class="fa fa-plus"> 模板下载</i></button>
<button type="button" class="btn btn-white btn-sm" onclick="importData()"><i class="fa fa-plus"> 导入excel</i></button>
<button type="button" class="btn btn-white btn-sm" onclick="addRow()"><i class="fa fa-plus"> 增加</i></button>
<button type="button" class="btn btn-white btn-sm" onclick="sub.delRow()"><i class="fa fa-minus"> 删除</i></button>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-offset-5 col-sm-10">
<button type="button" class="btn btn-sm btn-primary" onclick="submitHandler()"><i class="fa fa-check"></i>保 存</button>
<button type="button" class="btn btn-sm btn-danger" onclick="closeItem()"><i class="fa fa-reply-all"></i>关 闭 </button>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<th:block th:include="include :: bootstrap-fileinput-js"/>
<script th:inline="javascript">
var prefix = ctx + "business/modify"
var dataTypeDatas = [[${@dict.getEnum('publicity_type')}]];
var counterpartTypeDatas = [[${@dict.getEnum('counterpart_view_type')}]];
$("#form-modify-add").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.saveTab(prefix + "/add", $('#form-modify-add').serialize());
}
}
function downTemplate() {
var exceptionTypeValue = $('select[name="exceptionType"]').val();
var fileType = '';
/*if(exceptionTypeValue == 'repeat') {
fileType = 'publicity_error_cancel_repeat';
}else if(exceptionTypeValue == 'error'){
fileType = 'publicity_error_cancel_error';
}else if(exceptionTypeValue == 'modify'){
fileType = 'publicity_error_cancel_modify';
}else if(exceptionTypeValue == 'entity'){
fileType = 'publicity_error_cancel_entity';
}else if(exceptionTypeValue == 'cancel'){
fileType = 'publicity_error_cancel_cancel';
}else if(exceptionTypeValue == 'private'){
fileType = 'publicity_error_cancel_private';
}else {
fileType = 'publicity_error_cancel_repeat_other';
}*/
//文书号错误
if(exceptionTypeValue == 'error') {
fileType = 'publicity_error_cancel_error';
//主体信息错误
}else if(exceptionTypeValue == 'entity'){
fileType = 'publicity_error_cancel_entity';
//处罚或许可已撤销
}else if(exceptionTypeValue == 'cancel'){
fileType = 'publicity_error_cancel_cancel';
//不予公示
}else if(exceptionTypeValue == 'private'){
fileType = 'publicity_error_cancel_private';
//其他问题
}else {
fileType = 'publicity_error_cancel_repeat_other';
}
if (!fileType || fileType == '') {
$.modal.msgWarning("请选择修复数据类型。");
return;
}
businessTemplateDownload(fileType);
}
$("input[name='reportDate']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
$(".file-upload").fileinput({
uploadUrl: ctx + 'business/common/cloud/upload',
maxFileCount: 1,
autoReplace: true,
// allowedFileExtensions: ["doc", "pdf", "docx"],
// allowedFileExtensions: ["rar", "zip"],
showPreview: false,
uploadAsync: true,
maxFileSize: 25600,
dropZoneEnabled: false,
autoReplace: true, //上传新文件,自动替换上一个
uploadExtraData:{bType: "credit_exception"}
}).on('fileuploaded', function (event, data, previewId, index) {
var rdata = data.response.data;
if (rdata) {
$("input[name='" + event.currentTarget.id + "']").val(rdata.ids);
}
}).on('fileremoved', function (event, id, index) {
$("input[name='" + event.currentTarget.id + "']").val('')
})
$(function() {
// 定义一个默认的 行政相对人类别,用户不没有选择时,显示默认
var defaultSelect = {
"default" : true,
"dictLabel": "请选择",
"dictValue" : "",
}
counterpartTypeDatas.unshift(defaultSelect);
var options = {
pagination: false,
showSearch: false,
showRefresh: false,
showToggle: false,
showColumns: false,
sidePagination: "client",
columns: [{
checkbox: true
},
{
field: 'index',
align: 'center',
title: "序号",
formatter: function (value, row, index) {
var columnIndex = $.common.sprintf("<input type='hidden' name='index' value='%s'>", $.table.serialNumber(index));
return columnIndex + $.table.serialNumber(index);
}
},
{
field: 'dataType',
align: 'center',
title: '数据类型',
formatter: function(value, row, index) {
var name = $.common.sprintf("creditExceptionDataList[%s].dataType", index);
return $.common.dictToSelect(dataTypeDatas, value, name);
}
},
{
field: 'counterpartName',
align: 'center',
title: '错误数据主体',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='creditExceptionDataList[%s].counterpartName' value='%s'>", index, value);
return html;
}
},
{
field: 'counterpartCode',
align: 'center',
title: '错误数据统一社会信用代码',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='creditExceptionDataList[%s].counterpartCode' value='%s'>", index, value);
return html;
}
},
{
field: 'counterpartType',
align: 'center',
title: '错误行政相对人类别',
formatter: function(value, row, index) {
var name = $.common.sprintf("creditExceptionDataList[%s].counterpartType", index);
return $.common.dictToSelect(counterpartTypeDatas, value, name);
}
},
{
field: 'decisionSequence',
align: 'center',
title: '错误文书号',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='creditExceptionDataList[%s].decisionSequence' value='%s'>", index, value);
return html;
}
},
/*{
field: 'decisionCreditCode',
align: 'center',
title: '错误决定机关统一社会信用代码',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='creditExceptionDataList[%s].decisionCreditCode' value='%s'>", index, value);
return html;
}
},*/
{
field: 'rightCounterpartName',
align: 'center',
title: '正确的主体',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='creditExceptionDataList[%s].rightCounterpartName' value='%s'>", index, value);
return html;
}
},
{
field: 'rightCounterpartCode',
align: 'center',
title: '正确的主体统一社会信用代码',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='creditExceptionDataList[%s].rightCounterpartCode' value='%s'>", index, value);
return html;
}
},
{
field: 'rightCounterpartType',
align: 'center',
title: '正确的行政相对人类别',
formatter: function(value, row, index) {
var name = $.common.sprintf("creditExceptionDataList[%s].rightCounterpartType", index);
return $.common.dictToSelect(counterpartTypeDatas, value, name);
}
},
{
field: 'rightDecisionSequence',
align: 'center',
title: '正确的文书号',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='creditExceptionDataList[%s].rightDecisionSequence' value='%s'>", index, value);
return html;
}
},
/*{
field: 'rightDecisionCreditCode',
align: 'center',
title: '正确的决定机关统一社会信用代码',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='creditExceptionDataList[%s].rightDecisionCreditCode' value='%s'>", index, value);
return html;
}
},*/
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var value = $.common.isNotEmpty(row.index) ? row.index : $.table.serialNumber(index);
return '<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="sub.delRowByIndex(\'' + value + '\')"><i class="fa fa-remove"></i>删除</a>';
}
}]
};
$.table.init(options);
});
function addRow() {
var count = $("#" + table.options.id).bootstrapTable('getData').length;
var row = {
index: $.table.serialNumber(count),
dataType: "",
counterpartName: "",
counterpartCode: "",
counterpartType: "",
decisionSequence: "",
decisionCreditCode: "",
rightCounterpartName: "",
rightCounterpartCode: "",
rightCounterpartType: "",
rightDecisionSequence: "",
rightDecisionCreditCode: "",
}
sub.addRow(row);
}
function parseData(dataList) {
dataList.forEach(item => {
var count = $("#" + table.options.id).bootstrapTable('getData').length;
var row = {
index: $.table.serialNumber(count),
dataType: item.dataType,
counterpartName: item.counterpartName,
counterpartCode: item.counterpartCode,
counterpartType: item.counterpartType,
decisionSequence: item.decisionSequence,
decisionCreditCode: item.decisionCreditCode,
rightCounterpartName: item.rightCounterpartName,
rightCounterpartCode: item.rightCounterpartCode,
rightCounterpartType: item.rightCounterpartType,
rightDecisionSequence: item.rightDecisionSequence,
rightDecisionCreditCode: item.rightDecisionCreditCode
}
sub.addRow(row);
});
}
function importData() {
// var applyTypeValue = $("select[name='applyType']").val();
let applyTypeValue = $('input[name="applyType"]').val();
var exceptionTypeValue = $("select[name='exceptionType']").val();
if (!applyTypeValue || !exceptionTypeValue) {
$.modal.msgWarning("请选择修复数据类型。");
return;
}
var formUrl = prefix + "/importData/" + applyTypeValue + "/" + exceptionTypeValue;
top.layer.open({
type: 1,
area: ['400px', '230px'],
fix: false,
//不固定
maxmin: true,
shade: 0.3,
title: '导入修复数据数据',
content: $('#importTpl').html(),
btn: ['<i class="fa fa-check"></i> 导入', '<i class="fa fa-remove"></i> 取消'],
// 弹层外区域关闭
shadeClose: true,
btn1: function(index, layero){
var file = layero.find('#file').val();
if (file == '' || (!$.common.endWith(file, '.xls') && !$.common.endWith(file, '.xlsx'))){
$.modal.msgWarning("请选择后缀为 “xls”或“xlsx”的文件。");
return false;
}
var index = top.layer.load(2, {shade: false});
$.modal.disable();
var formData = new FormData(layero.find('form')[0]);
$.ajax({
url: formUrl,
data: formData,
cache: false,
contentType: false,
processData: false,
type: 'POST',
success: function (result) {
if (result.code == web_status.SUCCESS) {
$.modal.close(index);
$.modal.closeAll();
$.modal.alertSuccess(result.msg);
var dataList = result.data;
if (dataList) {
parseData(dataList);
}
} else if (result.code == web_status.WARNING) {
$.modal.close(index);
$.modal.enable();
$.modal.alertWarning(result.msg)
} else {
$.modal.close(index);
$.modal.enable();
$.modal.alertError(result.msg);
}
},
complete: function () {
layero.find('#file').val('');
}
});
}
});
}
</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"/>
<font color="red" class="pull-left mt10">
提示:仅允许导入“xls”或“xlsx”格式文件!
</font>
</div>
</form>
</script>
</html>