文件上传限制
This commit is contained in:
parent
1ea2675e57
commit
5304b967a8
|
|
@ -34,7 +34,10 @@ function setParams(params) {
|
||||||
return layer.msg('最多上传5个附件证明', { icon: 7 });
|
return layer.msg('最多上传5个附件证明', { icon: 7 });
|
||||||
}
|
}
|
||||||
uploadObj.config.elem.next()[0].value = '';
|
uploadObj.config.elem.next()[0].value = '';
|
||||||
|
let num = 0;
|
||||||
obj.preview(function (index, file, result) {
|
obj.preview(function (index, file, result) {
|
||||||
|
num ++;
|
||||||
|
if(num <= (5-length)){
|
||||||
$('#uploader-list').append(
|
$('#uploader-list').append(
|
||||||
'<div id="" class="file-iteme">' +
|
'<div id="" class="file-iteme">' +
|
||||||
'<div class="handle"><p>x</p></div>' +
|
'<div class="handle"><p>x</p></div>' +
|
||||||
|
|
@ -45,6 +48,7 @@ function setParams(params) {
|
||||||
map.index = index;
|
map.index = index;
|
||||||
map.file = file;
|
map.file = file;
|
||||||
fileList.push(map);
|
fileList.push(map);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,10 @@ function setParams(obj) {
|
||||||
return layer.msg('最多上传5个附件证明', { icon: 7 });
|
return layer.msg('最多上传5个附件证明', { icon: 7 });
|
||||||
}
|
}
|
||||||
uploadObj.config.elem.next()[0].value = '';
|
uploadObj.config.elem.next()[0].value = '';
|
||||||
|
let num = 0;
|
||||||
obj.preview(function (index, file, result) {
|
obj.preview(function (index, file, result) {
|
||||||
|
num ++;
|
||||||
|
if(num <= (5-length)){
|
||||||
$('#uploader-list').append(
|
$('#uploader-list').append(
|
||||||
'<div id="" class="file-iteme">' +
|
'<div id="" class="file-iteme">' +
|
||||||
'<div class="handle"><p>x</p></div>' +
|
'<div class="handle"><p>x</p></div>' +
|
||||||
|
|
@ -58,6 +61,7 @@ function setParams(obj) {
|
||||||
map.index = index;
|
map.index = index;
|
||||||
map.file = file;
|
map.file = file;
|
||||||
fileList.push(map);
|
fileList.push(map);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,10 @@ function setParams(obj) {
|
||||||
return layer.msg('最多上传5个附件证明', { icon: 7 });
|
return layer.msg('最多上传5个附件证明', { icon: 7 });
|
||||||
}
|
}
|
||||||
uploadObj.config.elem.next()[0].value = '';
|
uploadObj.config.elem.next()[0].value = '';
|
||||||
|
let num = 0;
|
||||||
obj.preview(function (index, file, result) {
|
obj.preview(function (index, file, result) {
|
||||||
|
num ++;
|
||||||
|
if(num <= (5-length)){
|
||||||
$('#uploader-list').append(
|
$('#uploader-list').append(
|
||||||
'<div id="" class="file-iteme">' +
|
'<div id="" class="file-iteme">' +
|
||||||
'<div class="handle"><p>x</p></div>' +
|
'<div class="handle"><p>x</p></div>' +
|
||||||
|
|
@ -47,6 +50,7 @@ function setParams(obj) {
|
||||||
map.index = index;
|
map.index = index;
|
||||||
map.file = file;
|
map.file = file;
|
||||||
fileList.push(map);
|
fileList.push(map);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,10 @@ function setParams(obj) {
|
||||||
return layer.msg('最多上传5个附件证明', { icon: 7 });
|
return layer.msg('最多上传5个附件证明', { icon: 7 });
|
||||||
}
|
}
|
||||||
uploadObj.config.elem.next()[0].value = '';
|
uploadObj.config.elem.next()[0].value = '';
|
||||||
|
let num = 0;
|
||||||
obj.preview(function (index, file, result) {
|
obj.preview(function (index, file, result) {
|
||||||
|
num ++;
|
||||||
|
if(num <= (5-length)){
|
||||||
$('#uploader-list').append(
|
$('#uploader-list').append(
|
||||||
'<div id="" class="file-iteme">' +
|
'<div id="" class="file-iteme">' +
|
||||||
'<div class="handle"><p>x</p></div>' +
|
'<div class="handle"><p>x</p></div>' +
|
||||||
|
|
@ -48,6 +51,7 @@ function setParams(obj) {
|
||||||
map.index = index;
|
map.index = index;
|
||||||
map.file = file;
|
map.file = file;
|
||||||
fileList.push(map);
|
fileList.push(map);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,10 @@ function setParams(obj) {
|
||||||
return layer.msg('最多上传5个附件证明', { icon: 7 });
|
return layer.msg('最多上传5个附件证明', { icon: 7 });
|
||||||
}
|
}
|
||||||
uploadObj.config.elem.next()[0].value = '';
|
uploadObj.config.elem.next()[0].value = '';
|
||||||
|
let num = 0;
|
||||||
obj.preview(function (index, file, result) {
|
obj.preview(function (index, file, result) {
|
||||||
|
num ++;
|
||||||
|
if(num <= (5-length)){
|
||||||
$('#uploader-list').append(
|
$('#uploader-list').append(
|
||||||
'<div id="" class="file-iteme">' +
|
'<div id="" class="file-iteme">' +
|
||||||
'<div class="handle"><p>x</p></div>' +
|
'<div class="handle"><p>x</p></div>' +
|
||||||
|
|
@ -48,6 +51,7 @@ function setParams(obj) {
|
||||||
map.index = index;
|
map.index = index;
|
||||||
map.file = file;
|
map.file = file;
|
||||||
fileList.push(map);
|
fileList.push(map);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,10 @@ function setParams(obj) {
|
||||||
return layer.msg('最多上传5个附件证明', { icon: 7 });
|
return layer.msg('最多上传5个附件证明', { icon: 7 });
|
||||||
}
|
}
|
||||||
uploadObj.config.elem.next()[0].value = '';
|
uploadObj.config.elem.next()[0].value = '';
|
||||||
|
let num = 0;
|
||||||
obj.preview(function (index, file, result) {
|
obj.preview(function (index, file, result) {
|
||||||
|
num ++;
|
||||||
|
if(num <= (5-length)){
|
||||||
$('#uploader-list').append(
|
$('#uploader-list').append(
|
||||||
'<div id="" class="file-iteme">' +
|
'<div id="" class="file-iteme">' +
|
||||||
'<div class="handle"><p>x</p></div>' +
|
'<div class="handle"><p>x</p></div>' +
|
||||||
|
|
@ -49,6 +52,7 @@ function setParams(obj) {
|
||||||
map.index = index;
|
map.index = index;
|
||||||
map.file = file;
|
map.file = file;
|
||||||
fileList.push(map);
|
fileList.push(map);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,10 @@ function setParams(obj) {
|
||||||
return layer.msg('最多上传5个发货附件', { icon: 7 });
|
return layer.msg('最多上传5个发货附件', { icon: 7 });
|
||||||
}
|
}
|
||||||
uploadObj.config.elem.next()[0].value = '';
|
uploadObj.config.elem.next()[0].value = '';
|
||||||
|
let num = 0;
|
||||||
obj.preview(function (index, file, result) {
|
obj.preview(function (index, file, result) {
|
||||||
|
num++;
|
||||||
|
if (num <= (5 - length)) {
|
||||||
$('#uploader-list').append(
|
$('#uploader-list').append(
|
||||||
'<div id="" class="file-iteme">' +
|
'<div id="" class="file-iteme">' +
|
||||||
'<div class="handle"><p>x</p></div>' +
|
'<div class="handle"><p>x</p></div>' +
|
||||||
|
|
@ -50,6 +53,7 @@ function setParams(obj) {
|
||||||
map.index = index;
|
map.index = index;
|
||||||
map.file = file;
|
map.file = file;
|
||||||
fileList.push(map);
|
fileList.push(map);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue