更新部分提案提交

This commit is contained in:
Sky_ID 2022-06-29 22:03:47 +08:00
parent eecaefa377
commit 4573a89bdd
1 changed files with 21 additions and 15 deletions

View File

@ -6,15 +6,14 @@
<div class="card">
<el-upload
drag
name="importSubmitFile"
:limit="1"
:on-exceed="handleExceed"
:action="uploadActionUrl"
:data="uploadData"
accept=".zip,.rar,.csv"
:before-upload="onBeforeUpload"
:on-progress="onUpload"
:on-success="(res)=>{importSuccess(res)}"
:before-remove="beforeRemove"
:file-list="fileList"
:disabled="uploadStatus"
class="import-submit-file"
@ -69,7 +68,13 @@ export default {
data() {
return {
fileList: [],
uploadActionUrl:"/api/comp/uploadImg",
uploadData: {
fileName : this.$route.params.compId + '-submit-',
type: 'submit'
},
downloadActionUrl: "",
applyTime: [],
@ -77,7 +82,8 @@ export default {
onlineScript: false,
onlineInter: '',
uploadStatus: false,
loading: true
loading: true,
file: ''
};
},
@ -92,12 +98,12 @@ export default {
onBeforeUpload(file) {
const isIMAGE = file.type === "rar" || "zip"||"csv";
const isLt1M = file.size / 1024 / 1024 < 1;
const isLt1M = file.size / 1024 / 1024 < 50;
if (!isIMAGE) {
this.$message.error("上传文件只能是rar/zip压缩包格式!");
this.$message.error("上传文件只能是rar/zip/csv压缩包格式!");
}
if (!isLt1M) {
this.$message.error("上传文件大小不能超过 1MB!");
this.$message.error("上传文件大小不能超过 50MB!");
}
// false
return isIMAGE && isLt1M;
@ -113,15 +119,15 @@ export default {
//
importSuccess(res) {
if (res.code == "0") {
if (res.data == 0) {
if(res.status == 0){
this.$message({
showClose: true,
message: '上传报名表成功',
type: 'success',
type: 'success'
});
}
} else {
this.file=res.url
//TODO:
}else{
this.$message({
showClose: true,
message: '上传报名表失败' + res.message,