This commit is contained in:
unknown 2022-06-29 18:22:07 +08:00
parent 0fd9cb7d51
commit a558afe656
2 changed files with 85 additions and 26 deletions

View File

@ -144,14 +144,14 @@
<div class="apply-button">
<!-- 导入按钮 -->
<el-upload
name="importApplyFile"
:limit="1"
:on-exceed="handleExceed"
:action="uploadActionUrl"
:data="uploadData"
accept=".zip,.rar"
:before-upload="onBeforeUpload"
:on-progress="onUpload"
:on-success="(res)=>{importSuccess(res)}"
:file-list="fileList"
class="import-apply-file"
>
<!-- 触发文件选择框的内容 -->
@ -184,9 +184,15 @@ export default {
data() {
return {
uploadData: {
fileName : this.$route.params.compId + '-报名-',
type: 'apply'
},
fileList: [
],
divisionList : [],
kindList : [],
applyTime:[],
submitTime:[],
isReady : false,
@ -223,7 +229,7 @@ export default {
addForm: [], //
uploadActionUrl: "", // url
uploadActionUrl: "/api/comp/uploadImg", // url
applyFilterUrl: "", // url
disabledIf: false, //
@ -395,35 +401,31 @@ export default {
onBeforeUpload(file){
const isIMAGE = file.type === "rar"||"zip";
const isLt1M = file.size / 1024 / 1024 < 1;
const isLt20M = file.size / 1024 / 1024 < 20;
if (!isIMAGE) {
this.$message.error("上传文件只能是rar/zip压缩包格式!");
}
if (!isLt1M) {
this.$message.error("上传文件大小不能超过 1MB!");
if (!isLt20M) {
this.$message.error("上传文件大小不能超过 20MB!");
}
// false
return isIMAGE && isLt1M;
return isIMAGE && isLt20M;
},
//
onUpload(){
this.loading_text = "拼命导入中...请稍等";
this.loading = true;
},
//
importSuccess(res){
if(res.code == "0"){
if(res.data == 0){
this.$message({
showClose: true,
message: '上传报名表成功',
type: 'success'
if(res.status == 0){
this.$message({
showClose: true,
message: '上传报名表成功',
type: 'success'
});
}
this.applyForm.applyFile=res.url
}else{
this.$message({
showClose: true,
@ -550,6 +552,15 @@ export default {
memberList : res.data.memberInfoList
}
this.applyForm = getApplyInfo
if (res.data.applyInfo.file != ''){
this.fileList.push({
name: res.data.applyInfo.file.split("/")[3].split("-")[2],
url: res.data.applyInfo.file
}
)
}
if (this.applyForm.applySource == "自主提交") {
this.radioValue = 2
this.inputIf = true;
@ -579,6 +590,13 @@ export default {
status : 1,
memberList : res.data.memberInfoList
}
if (res.data.applyInfo.file != ''){
this.fileList.push({
name: res.data.applyInfo.file.split("/")[3].split("-")[2],
url: res.data.applyInfo.file
}
)
}
if (this.applyForm.applySource == "自主提交") {
this.radioValue = 2
this.inputIf = true;
@ -608,6 +626,13 @@ export default {
status : 2,
memberList : res.data.memberInfoList
}
if (res.data.applyInfo.file != ''){
this.fileList.push({
name: res.data.applyInfo.file.split("/")[3].split("-")[2],
url: res.data.applyInfo.file
}
)
}
if (this.applyForm.applySource == "自主提交") {
this.radioValue = 2
this.inputIf = true;

View File

@ -16,10 +16,35 @@
:on-success="(res)=>{importSuccess(res)}"
:before-remove="beforeRemove"
:file-list="fileList"
:disabled="uploadStatus"
class="import-submit-file"
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
<div v-loading="loading" element-loading-background="rgb(255, 255, 255)">
<div v-if="uploadStatus">
<svg t="1656492230012" class="icon" viewBox="0 0 2874 1024" version="1.1"
xmlns="http://www.w3.org/2000/svg"
p-id="2968" width="150" height="150">
<path
d="M1406.40295624 975.64887882c-47.05350201-2.88392419-93.95521877-12.74998101-139.49086604-29.59817046-119.60696605-44.4731483-214.92825429-132.5087323-268.35674568-247.86570467-53.42849251-115.50875762-58.58919879-244.37463837-14.41962209-363.07089179 44.16957781-118.69625344 132.35694706-212.9550427 248.32106153-265.32103737 109.89269447-49.63385571 232.08001422-56.00884622 346.526274-18.66961466 6.22320526 1.97321159 26.56246102 10.01784206 32.78566628 12.29462415l-37.79458733 57.98205781c-3.49106631-1.36606947-6.98213262-2.58035371-10.62498417-3.79463796-99.72306717-34.15173575-206.88362269-29.29459997-302.81205303 14.11605051-99.26771029 44.92850517-174.70509853 125.52659968-212.49968585 227.07109319-78.01774193 209.76754688 30.81245469 444.7314853 242.7049984 523.50815573 39.16065678 14.57140736 79.23202617 22.91960946 118.99982393 25.1963904 174.85688491 10.62498418 343.33877817-91.67843555 406.93689913-262.74068252 17.91068729-48.26778624 26.41067577-98.50878293 25.34817677-149.50870815 0-2.12499682-0.15178525-4.24999367-0.15178523-6.37499048l63.59811981-37.18744519c0.15178525 2.42856733 4.70535054 39.61601251 4.70535055 42.04458096 1.36606947 59.65169778-8.49998734 118.39268181-29.59817046 174.85688491-44.16957781 118.69625344-132.35694706 212.9550427-248.32106153 265.32103623-71.94632192 32.48209465-149.05335125 46.44635989-225.85680899 41.74100936z"
p-id="2969" fill="#36ab60"></path>
<path
d="M1934.464675 202.7571637l-112.01769128-138.42836592S1670.50970824 258.61422467 1631.04548101 315.83735398c-45.08029042 65.26776093-155.27655651 224.79431111-213.10682798 308.57990145-22.46425259-22.91960947-47.3570725-47.50885888-63.5981198-61.77669462-38.70529991-33.99994937-183.66044274-144.34800071-183.66044389-144.34800071l-61.16955136 96.9909282s149.05335125 91.83022194 197.32113635 124.61588709c77.86595669 52.82135041 116.11589972 111.25876395 116.11589974 111.25876394l39.00887155-58.8927704c53.27670727-66.02668829 163.9283291-201.72291641 208.24969215-245.74070784 54.64277675-54.33920512 264.25853838-243.76749739 264.25853723-243.76749738z"
p-id="2970" fill="#36ab60"></path>
<path
d="M1423.09935933 752.52420883l-0.60714098-0.91071264c-0.45535687-0.60714211-39.16065678-59.04455566-115.96411448-111.1069787-47.66064413-32.33030941-195.80328163-123.55338923-197.3211375-124.46410182l-0.60714213-0.45535686 62.0802651-98.35699769 0.60714212 0.45535685c1.51785472 1.06249899 145.41049969 110.95519346 183.66044275 144.49978598 13.66069362 11.99105365 34.75887673 32.48209465 62.99097882 61.16955248l212.49968584-307.82097291c39.16065678-56.6159872 189.883648-249.68713102 191.40150272-251.66034265l0.60714213-0.75892734 0.60714212 0.75892734 112.47304816 139.03550921-0.60714212 0.45535572c-2.12499682 1.82142635-210.22290375 190.03543325-264.10675199 243.61571216-43.41065045 43.25886521-149.05335125 172.42831645-208.24969328 245.74070784l-39.46422728 59.80348303z m-312.37453825-237.54429212c10.77676942 6.67856099 150.57120597 92.89271979 196.71399537 124.1605313 71.64275143 48.57135673 110.34805134 102.7587766 115.66054287 110.49983661l38.40172944-57.98205667c59.19634091-73.31239139 164.83904171-202.63362901 208.40147737-245.89249423 52.66956515-52.21420829 251.81212786-232.53537109 263.65139629-243.16035527l-111.1069787-137.21408285c-10.3214137 13.35712313-152.99977443 195.95506802-190.79436061 250.74963002l-213.56218482 309.33882765-0.60714211-0.60714098c-28.38388621-28.99102834-49.78564096-49.63385571-63.4463346-61.7766946-36.88387357-32.33030941-172.2765312-135.69622813-182.90151539-143.892645l-60.41062511 95.77664402z"
p-id="2971" fill="#36ab60"></path>
</svg>
<div class="el-upload__text" style="margin-top: -20px">您已上传</div>
</div>
<div v-else>
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处<em>点击上传</em></div>
</div>
</div>
<div class="el-upload__tip" slot="tip">
只能上传zip/rar文件且不超过1M
</div>
@ -43,9 +68,7 @@ export default {
data() {
return {
fileList: [
],
fileList: [],
downloadActionUrl: "",
@ -53,6 +76,8 @@ export default {
submitTime: [],
onlineScript: false,
onlineInter: '',
uploadStatus: false,
loading: true
};
},
@ -82,7 +107,7 @@ export default {
//
onUpload() {
this.loading_text = "拼命导入中...请稍等";
this.loading = true;
this.loading = null;
},
//
@ -213,7 +238,7 @@ export default {
userId: localStorage.getItem("userId")
}
this.$api.getApplyForPerson(applyInfo).then((res) => {
if (res.status == 0) {
if (res.status == 0 && res.data.applyInfo.status == 2) {
//
var teamId = res.data.applyInfo.teamId
var submitInfo = {
@ -229,8 +254,13 @@ export default {
}
)
//
this.uploadStatus = true
this.loading = false
} else if (res.status == 10) {
//
this.loading = false
} else {
Message.error("权限不足或其他错误")
}
@ -240,8 +270,12 @@ export default {
Message.error("当前用户未报名")
this.$router.go(-1)
} else if (res.status == 0 && res.data.applyInfo.status != 2) {
Message.error("当前用户未通过报名审核")
this.$router.go(-1)
} else {
Message.error("权限不足或其他错误")
this.$router.go(-1)
}
})