更新部分提案提交
This commit is contained in:
parent
eecaefa377
commit
4573a89bdd
|
@ -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) {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
message: '上传报名表成功',
|
||||
type: 'success',
|
||||
});
|
||||
}
|
||||
} else {
|
||||
if(res.status == 0){
|
||||
this.$message({
|
||||
showClose: true,
|
||||
message: '上传报名表成功',
|
||||
type: 'success'
|
||||
});
|
||||
this.file=res.url
|
||||
//TODO:更新提案提交信息到数据库
|
||||
}else{
|
||||
this.$message({
|
||||
showClose: true,
|
||||
message: '上传报名表失败' + res.message,
|
||||
|
|
Loading…
Reference in New Issue