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
<!DOCTYPE html>
<html class="x-admin-sm">
<head>
<meta charset="UTF-8">
<title>需求取消</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi"/>
<link href="css/font.css" rel="stylesheet">
<link href="css/xadmin.css" rel="stylesheet">
<link href="css/login.css" rel="stylesheet">
<link href="../lib/layui/css/layui.css">
<!-- 隐藏操作中的多一次显示-->
<style>
.layui-table-tips-main {
display: none;
}
.layui-table-tips-c {
display: none;
}
.layui-table-grid-down{
display: none;
}
.layui-form-select dl dd.layui-select-tips {
padding-left: 10px!important;
color: #999;
}
.layui-layer-lan div.layui-layer-title {
background: #eee;
color: #333;
border: none;
}
#agreementUp{
display: none;
}
</style>
<script src="js/jquery.min.js"></script>
<script src="lib/layui/layui.js"></script>
<script src="js/xadmin.js"></script>
<script src="js/util.js"></script>
<script src="js/getUserToken.js"></script>
<script src="js/api.js"></script>
<script src="js/layer.js"></script>
<!--<script src="js/append.js"></script>-->
<script src="js/search.js"></script>
<script src="js/jqueryForm.js"></script>
<!--动态表单拼接-->
<script src="js/parameter.js"></script>
<!--详情页动态表单-->
<script src="js/base.js"></script>
<!--待办动态表单-->
<script src="js/Taskdealwith.js"></script>
<!--<script src="js/ajax.js"></script>-->
<!--详情页静态元素-->
<script src="js/Taskdealwith-static.js"></script>
<!--已办详情动态拼接-->
<script src="js/complete.js"></script>
<!--已办详情静态拼接-->
<script src="js/complete-static.js"></script>
<!--二维码-->
<script src="js/jquery.qrcode.min.js"></script>
<!--当前详情静态拼接-->
<script src="js/baseStatic.js"></script>
<!--当前详情动态拼接-->
<script src="js/base.js"></script>
<script src="js/agreement.js"></script>
<!--禁用回车键(texaarea文本输入框除外)-->
<script>
window.onload = function (){
document.body.onkeydown=function(event){
if(event.keyCode==13 && event.target.nodeName !== 'TEXTAREA'){
event.keyCod=0; return false;
}
}
};
</script>
<!--//备注与输入框超过300|100字时截断且提示-->
<script src="js/msgRemark.js"></script>
<!--//更换阶段负责人-->
<script src="js/ifChangeOn.js"></script>
<!-- 让IE8/9支持媒体查询,从而兼容栅格 -->
<!--[if lt IE 9]>
<script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
<script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<style>
.x-admin-sm body {
font-size: 14px;
}
a {
color: #01AAED;
text-decoration: none;
}
.parentahref a:hover {
color: #6c5ce7;
text-decoration: underline;
}
.layui-form-radio{
margin: 6px 10px 0 17px;
}
.downloadcontainer{
display: inline-block;
width: 33%;
text-align: start;
}
</style>
<style>
/*文字显示为灰色*/
input, optgroup, option, select, textarea {
color: black;
}
/*确定按钮距顶端40*/
#move{
margin-top: 10px;
}
/*表格宽120文本左对齐*/
.layui-form-label {
width: 120px;
}
</style>
<div class="layui-fluid">
<div class="layui-row">
<form class="layui-form">
<div class="layui-form-item">
<label class="layui-form-label" style="width: 70px;"><span class="x-red"></span>下载模板</label>
<label class="layui-form-label parentahref" style="width: 400px;display: flex;flex-direction: row">
<div class="downloadcontainer">
<a onclick="window.open(util.interfaceUrl+interfacenName.downloadmodelDJZ);" style="cursor: pointer">代缴站</a>
</div>
<div class="downloadcontainer">
<a onclick="window.open(util.interfaceUrl+interfacenName.downloadmodelYD);" style="margin-left:8px;cursor: pointer">自建站(移动)</a>
</div>
<div class="downloadcontainer" style="padding-top: 0.5px">
<a onclick="window.open(util.interfaceUrl+interfacenName.downloadmodelTT);" style="margin-left:15px;cursor: pointer";>自建站(铁塔)</a>
</div>
</label>
</div>
<div class="layui-form-item">
<label class="layui-form-label" style="width: 70px;"><span class="x-red">*</span>导入</label>
<input type="radio" class="type" name="type" value="0" title="代缴站" checked>
<input type="radio" class="type" name="type" value="1" title="自建站(移动)">
<input type="radio" class="type" name="type" value="2" title="自建站(铁塔)">
</div>
<div class="layui-form-item">
<label class="layui-form-label" style="width: 70px;">
<span class="x-red">*</span>上传</label>
<label class="layui-form-label" id="upload_label" style="padding: 5px 15px;text-align: left;width: auto">
<button type="button" class="layui-btn layui-btn-normal" id="excelupload" style="font-size: 14px;">
<i class="layui-icon"></i>上传
</button>
</label>
</div>
<div class="layui-form-item">
<label class="layui-form-label"></label>
<button id="uploadbtn" class="layui-btn" type="button" style="position:fixed;left: 50%;top:280px;transform: translateX(-50%);font-size: 14px" onclick="submitBefore()">确定
</button>
</div>
</form>
</div>
</div>
</div>
</body>
</html>
<script>
var submitBefore = function (){
if ($('#upload_label').find('span.layui-inline.layui-upload-choose').length==0) {
layer.msg("请选择上传文件",{icon: 2,time: 1000,anim:6});
}
}
layui.use(['form', 'layer', 'jquery','upload'],
function () {
let $ = layui.jquery;
let layer = layui.layer;
let upload = layui.upload;
var indexloading ;
//日期
upload.render({
elem: '#excelupload'
, url: util.interfaceUrl+ interfacenName.importexecl
, bindAction: '#uploadbtn'
, accept: "file"
, size: 0
, auto: false
, multiple: true
,headers:{
'Authorization': util.authorization? util.authorization: '',
},
before: function (input){
indexloading = layer.load(0, {
shade: [0.7,'#fff'] //0.1透明度的白色背景
});
var radiobox = $(".type");
var type;
for (var i = 0; i < radiobox.length; i++) {
if (radiobox[i].checked) {
type = radiobox[i].value
console.log(type)
break;
}
}
this.data = {
type: type,
excelId: '',
excelList:''
}
},
done:function(res){
setTimeout(function () {
layer.close(indexloading)
},1000)
if (res.code==200){
var exist=res.data;
if(!exist){
layer.msg("所选模板错误!请重新上传",{icon: 2,time: 1000,anim:6});
}
if(exist&&(exist.key).length==0){
layer.msg("导入成功!",{icon:1,time:1000});
setTimeout(function () {
var index = parent.layer.getFrameIndex(window.name)
parent.layer.close(index);
parent.refresh()
},1500)
}
if (exist&&(exist.key).length>0){
layer.msg("部分信息错误",{icon: 2,time: 1000});
for(let i=0;i<(res.data.key).length;i++){
res.data.key[i]["num"]=i;
var createTime =util.dealWithFormatTextByLen(res.data.key[i]['jzCreateDate'],10,false)
res.data.key[i]['jzCreateDate'] = createTime
}
window.parent.testID=res.data
setTimeout(function () {
var index = parent.layer.getFrameIndex(window.name)
parent.layer.close(index);
parent.openerrortab(res.data.value);
},1000)
}
}
else if (res.code == 400) {
layer.msg("导入excel数据为空!", {icon: 2, time: 2000, anim: 6})
}
},
error: function () {
setTimeout(function () {
layer.close(indexloading);
layer.msg("操作失败,请重新尝试",{icon: 2,time: 2000,anim:6})
},1000)
}
});
});
</script>