上传文件大小限制

ywj_dev
anthonywj 2 years ago
parent 29a20bb4d7
commit 3c97cd019b

@ -288,9 +288,9 @@ export default {
return;
}
//
const isLt = file.size / 1024 / 1024 / 2 <= 1;
const isLt = file.size / 1024 / 1024 / 10 <= 1;
if (!isLt) {
this.$message.error("上传文件大小不能超过 2MB");
this.$message.error("上传文件大小不能超过 10MB");
for (let i = 0; i < fileList.length; i++) {
if (fileList[i].uid === uid) {
fileList.splice(i, 1)

@ -222,6 +222,7 @@ export default {
this.udiCode = "01" + response.data.nameCode;
this.originCode = this.udiCode;
} else {
this.originCode = "";
this.$alert(response.message, '提示', {
confirmButtonText: '确定',
type: 'warning',

@ -313,9 +313,9 @@ export default {
return;
}
//
const isLt = file.size / 1024 / 1024 / 2 <= 1;
const isLt = file.size / 1024 / 1024 / 10 <= 1;
if (!isLt) {
this.$message.error("上传文件大小不能超过 2MB");
this.$message.error("上传文件大小不能超过 10MB");
for (let i = 0; i < fileList.length; i++) {
if (fileList[i].uid === uid) {
fileList.splice(i, 1)

@ -182,7 +182,7 @@
<el-table-column type="index" label="序号" width="50"></el-table-column>
<el-table-column label="证书名称" prop="name"></el-table-column>
<el-table-column label="证书编号" prop="code"></el-table-column>
<el-table-column label="效期" prop="vailDate"></el-table-column>
<el-table-column label="效期" prop="vailDate"></el-table-column>
<el-table-column label="失效期" prop="expireDate"></el-table-column>
<el-table-column label="备注" prop="remark"></el-table-column>
<el-table-column label="证书状态" prop="status">
@ -239,7 +239,7 @@
<el-row>
<el-col :span="11">
<el-form-item label="效期:" prop="vailDate">
<el-form-item label="效期:" prop="vailDate">
<el-date-picker
v-model="currentAudit.vailDate"
@ -247,7 +247,7 @@
disabled
value-format="yyyy-MM-dd"
style="width: 100%"
placeholder="请选择效期">
placeholder="请选择效期">
</el-date-picker>
</el-form-item>
</el-col>
@ -783,9 +783,9 @@ export default {
return;
}
//
const isLt = file.size / 1024 / 1024 / 2 <= 1;
const isLt = file.size / 1024 / 1024 / 10 <= 1;
if (!isLt) {
this.$message.error("上传文件大小不能超过 2MB");
this.$message.error("上传文件大小不能超过 10MB");
for (let i = 0; i < fileList.length; i++) {
if (fileList[i].uid === uid) {
fileList.splice(i, 1)

@ -208,7 +208,7 @@
<el-table-column type="index" label="序号" width="50"></el-table-column>
<el-table-column label="证书名称" prop="name"></el-table-column>
<el-table-column label="证书编号" prop="name"></el-table-column>
<el-table-column label="效期" prop="vailDate"></el-table-column>
<el-table-column label="效期" prop="vailDate"></el-table-column>
<el-table-column label="失效期" prop="expireDate"></el-table-column>
<el-table-column label="审核状态" prop="auditStatus" width="120">
<template slot-scope="scope">
@ -675,9 +675,9 @@ export default {
return;
}
//
const isLt = file.size / 1024 / 1024 / 2 <= 1;
const isLt = file.size / 1024 / 1024 / 10 <= 1;
if (!isLt) {
this.$message.error("上传文件大小不能超过 2MB");
this.$message.error("上传文件大小不能超过 10MB");
for (let i = 0; i < fileList.length; i++) {
if (fileList[i].uid === uid) {
fileList.splice(i, 1)

@ -216,7 +216,7 @@
<el-table-column type="index" label="序号" width="50"></el-table-column>
<el-table-column label="证书名称" prop="name"></el-table-column>
<el-table-column label="证书编号" prop="code"></el-table-column>
<el-table-column label="效期" prop="vailDate"></el-table-column>
<el-table-column label="效期" prop="vailDate"></el-table-column>
<el-table-column label="失效期" prop="expireDate"></el-table-column>
<el-table-column label="备注" prop="remark"></el-table-column>
<el-table-column label="证书状态" prop="status">
@ -272,7 +272,7 @@
<el-row>
<el-col :span="11">
<el-form-item label="效期:" prop="vailDate">
<el-form-item label="效期:" prop="vailDate">
<el-date-picker
v-model="currentAudit.vailDate"
@ -280,7 +280,7 @@
disabled
value-format="yyyy-MM-dd"
style="width: 100%"
placeholder="请选择效期">
placeholder="请选择效期">
</el-date-picker>
</el-form-item>
</el-col>

@ -851,9 +851,9 @@ export default {
return;
}
//
const isLt = file.size / 1024 / 1024 / 2 <= 1;
const isLt = file.size / 1024 / 1024 / 10 <= 1;
if (!isLt) {
this.$message.error("上传文件大小不能超过 2MB");
this.$message.error("上传文件大小不能超过 10MB");
for (let i = 0; i < fileList.length; i++) {
if (fileList[i].uid === uid) {
fileList.splice(i, 1)

@ -169,7 +169,7 @@
<el-table-column type="index" label="序号" width="50"></el-table-column>
<el-table-column label="证书名称" prop="name"></el-table-column>
<el-table-column label="证书编号" prop="code"></el-table-column>
<el-table-column label="效期" prop="vailDate"></el-table-column>
<el-table-column label="效期" prop="vailDate"></el-table-column>
<el-table-column label="失效期" prop="expireDate"></el-table-column>
<el-table-column label="确认状态" prop="auditStatus" width="120">
<template slot-scope="scope">

@ -426,9 +426,9 @@
return;
}
//
const isLt = file.size / 1024 / 1024 / 2 <= 1;
const isLt = file.size / 1024 / 1024 / 10 <= 1;
if (!isLt) {
this.$message.error("上传文件大小不能超过 2MB");
this.$message.error("上传文件大小不能超过 10MB");
for (let i = 0; i < fileList.length; i++) {
if (fileList[i].uid === uid) {
fileList.splice(i, 1)

@ -245,9 +245,9 @@ export default {
return;
}
//
const isLt = file.size / 1024 / 1024 / 2 <= 1;
const isLt = file.size / 1024 / 1024 / 10 <= 1;
if (!isLt) {
this.$message.error("上传文件大小不能超过 2MB");
this.$message.error("上传文件大小不能超过 10MB");
for (let i = 0; i < fileList.length; i++) {
if (fileList[i].uid === uid) {
fileList.splice(i, 1)

@ -651,9 +651,9 @@ export default {
return;
}
//
const isLt = file.size / 1024 / 1024 / 2 <= 1;
const isLt = file.size / 1024 / 1024 / 10 <= 1;
if (!isLt) {
this.$message.error("上传文件大小不能超过 2MB");
this.$message.error("上传文件大小不能超过 10MB");
for (let i = 0; i < fileList.length; i++) {
if (fileList[i].uid === uid) {
fileList.splice(i, 1)

@ -590,9 +590,9 @@ export default {
return;
}
//
const isLt = file.size / 1024 / 1024 / 2 <= 1;
const isLt = file.size / 1024 / 1024 / 10 <= 1;
if (!isLt) {
this.$message.error("上传文件大小不能超过 2MB");
this.$message.error("上传文件大小不能超过 10MB");
for (let i = 0; i < fileList.length; i++) {
if (fileList[i].uid === uid) {
fileList.splice(i, 1)
@ -629,9 +629,9 @@ export default {
return;
}
//
const isLt = file.size / 1024 / 1024 / 2 <= 1;
const isLt = file.size / 1024 / 1024 / 10 <= 1;
if (!isLt) {
this.$message.error("上传文件大小不能超过 2MB");
this.$message.error("上传文件大小不能超过 10MB");
for (let i = 0; i < fileList.length; i++) {
if (fileList[i].uid === uid) {
fileList.splice(i, 1)

Loading…
Cancel
Save