Commit 43904a41 authored by ‘yangmengxue’'s avatar ‘yangmengxue’

111

parent 2d5d6537
......@@ -40,7 +40,7 @@
::v-deep .el-form-item {
margin-bottom: 20px;
height: 70px;
// height: 70px;
.el-form-item__label {
height: 32px;
......@@ -241,9 +241,10 @@
// 下载附件
.annex {
>div{
>div {
margin-bottom: 10px;
}
.annex_remarks {
color: red;
font-size: 18px;
......@@ -254,3 +255,86 @@
cursor: pointer;
}
}
.annex_url {
.el-form-item__label {
width: 100%;
}
.upload_box {
// margin-top: 10px;
.img_list {
position: relative;
float: left;
width: 160px;
height: 120px;
text-align: center;
background: transparent;
border-radius: 4px;
border: 2px dashed #E1E3E6;
margin: 0 8px 8px 0;
padding: 5px;
display: flex;
flex-flow: column;
justify-content: center;
align-items: center;
>div {
width: 100%;
.el-image {
width: 30px;
height: 30px;
min-height: 30px;
display: block;
margin: 0 auto;
border: 0;
img {
width: auto;
height: auto;
max-width: 100% !important;
max-height: 100% !important;
}
}
.item_name {
font-size: 12px;
color: #999999;
line-height: 16px;
word-wrap: break-word;
margin: 5px 0 10px;
}
.item_remove {
width: 40px;
font-size: 12px;
color: #999999;
font-weight: bold;
line-height: 16px;
margin: 0 auto;
&:hover {
cursor: pointer;
color: red;
}
}
}
}
::v-deep .el-upload {
width: 170px !important;
height: 134px !important;
background: transparent;
border-radius: 4px;
border: 2px dashed #E1E3E6;
display: flex;
justify-content: center;
align-items: center;
}
}
}
\ No newline at end of file
......@@ -25,10 +25,7 @@
</div>
<!-- 报名流程提示 -->
<div
class="vertical-steps"
v-if="isShowStepsTips && (status == 0 || status == 2)"
>
<div class="vertical-steps" v-if="isShowStepsTips">
<div class="vertical-steps-title">报名流程</div>
<div class="vertical_close" @click="toShowSteps">
<i class="el-icon-close"></i>
......@@ -44,7 +41,11 @@
</div>
</div>
</div>
<div class="referInfoTips" @click="toShowSteps">
<div
class="referInfoTips"
v-show="status == 0 || status == 1 || status == 2||status == 3 "
@click="toShowSteps"
>
<i class="el-icon-question"></i>
</div>
</div>
......
......@@ -1325,6 +1325,47 @@
</div>
</div>
</div>
<!-- 上传附件 -->
<div v-show="$store.state.user_annex_key == 1">
<el-form-item class="annex_url" label="相关附件">
<!-- <div class="item_info1">(支持文件类型有word、pdf、excel。)</div> -->
<div class="upload_box">
<div
:key="index"
class="img_list"
v-for="(item, index) in annexFileList"
>
<div>
<el-image :src="fileImg"></el-image>
<div class="item_name">{{ item.name }}</div>
<div @click="handleRemoveAnnex(item)" class="item_remove">
删除
</div>
</div>
</div>
<el-upload
v-if="annexFileList.length < 10"
:action="annexPdfAction"
:before-upload="beforeUploadAnnex"
:disabled="isAnnexLoading"
:file-list="annexFileList"
:headers="headers"
:on-progress="handleProgressAnnex"
:on-success="handleSuccessAnnex"
:show-file-list="false"
list-type="picture-card"
name="multipartFile"
ref="annex_url"
>
<i class="el-icon-plus" v-if="!isAnnexLoading"></i>
<i class="el-icon-loading" v-if="isAnnexLoading"></i>
</el-upload>
</div>
</el-form-item>
</div>
<div class="btn">
<el-button @click="confirm">提交资料</el-button>
</div>
......@@ -1335,8 +1376,6 @@
</el-dialog>
<!-- 多形式报名邀请码报错弹框 -->
<cueDialog :dialogVisible="cueDialogVisible" :msg="msg"></cueDialog>
</div>
</template>
......@@ -1349,12 +1388,15 @@ import {
getSchool,
setAccount,
downloadAnnex,
setAnnexUrl,
} from "r/index/signUp";
import COS from "cos-js-sdk-v5";
import { achievementCallBack, cosSignature } from "r/index/cosUpload";
import validator from "common/validator";
import area from "config/area";
import cueDialog from "c/index/cueDialog";
import { SERVER_URL } from "@/config/server";
import fileImg from "a/img/signUp/file_img.png";
export default {
name: "referInfo",
......@@ -1436,6 +1478,7 @@ export default {
school_contacts: null,
school_phone: null,
code: null,
annex_url: null,
},
// doubt_code: window.localStorage.getItem(
// "doubt_code" + this.$store.state.indexIdentity
......@@ -1820,15 +1863,25 @@ export default {
fileList2: [],
fileList3: [],
fileList4: [],
hideUpload1: false,
hideUpload2: false,
hideUpload3: false,
hideUpload4: false,
resultPicture: "",
disabled: false, //限制输入框
isOffline: false, //活动形式是否包含线下字段
// 下载附件
annexList: [],
annexFileList: [], //上传附件
isAnnexLoading: false,
headers: {
token: "Bearer " + localStorage.getItem("index-token-all"),
},
annexPdfAction: SERVER_URL + "/web/signUp/uploadAnnex", // 上传附件接口
fileImg: fileImg,
};
},
created() {
......@@ -1980,7 +2033,72 @@ export default {
},
mounted() {},
methods: {
//上传附件
// 上传文件之前的钩子
beforeUploadAnnex(file) {
let isName = false;
for (let i = 0; i < this.annexFileList.length; i++) {
if (this.annexFileList[i].name == file.name) {
isName = true;
break;
}
}
if (isName) {
this.$message.info("不能上传同名文件");
return false;
}
const isLt10M = file.size / 1024 / 1024 <= 100;
if (!isLt10M) {
this.$message.error("上传的附件大小不能超过 100M!");
return false;
}
return isLt10M;
},
// 文件上传成功时的钩子
handleSuccessAnnex(res, file, fileList) {
console.log(res);
if (res.code != 200) {
this.isAnnexLoading = false;
return this.$message.error(res.msg);
}
let length = this.annexFileList.length;
this.annexFileList[length] = {
status: "success",
name: res.data.orgin.split("annexuser/")[1],
url: res.data.urls,
orginUrl: res.data.orgin,
};
console.log(this.annexFileList);
// return
this.referForm.annex_url = this.annexFileList
.map((item) => {
console.log();
return item.orginUrl;
})
.join(",");
console.log(this.annexFileList, "this.annexFileList");
// console.log(this.annexFileList, "this.annexFileList");
localStorage.setItem("annex_urls", this.referForm.annex_url);
this.isAnnexLoading = false;
this.$message.success("上传成功");
},
handleProgressAnnex(event, file, fileList) {
this.isAnnexLoading = true;
},
// 删除文件
handleRemoveAnnex(data) {
this.annexFileList = this.annexFileList.filter((item) => {
return item != data;
});
this.referForm.annex_url = this.annexFileList
.map((item) => {
return item.url;
})
.join(",");
localStorage.setItem("annex_urls", this.referForm.annex_url);
},
//下载附件
downloadAnnexFile(url) {
downloadAnnex({ enclosure_url: url }).then((res) => {
......@@ -2307,19 +2425,19 @@ export default {
},
// 图片上传成功前钩子
beforeAvatarUpload(file) {
// console.log(file, "beforeImage");
const isJPG = file.type === "image/jpg";
const isPng = file.type === "image/png";
const isJPEG = file.type === "image/jpeg";
const isLt10M = file.size / 1024 / 1024 < 10;
// console.log(isLt10M)
if (!isJPG && !isPng && !isJPEG) {
this.$message.info("上传图片只能是 JPG,JPEG或png 格式!");
}
if (!isLt10M) {
this.$message.info("上传图片大小不能超过 10MB!");
}
return (isJPG || isPng || isJPEG) && isLt10M;
// // console.log(file, "beforeImage");
// const isJPG = file.type === "image/jpg";
// const isPng = file.type === "image/png";
// const isJPEG = file.type === "image/jpeg";
// const isLt10M = file.size / 1024 / 1024 < 10;
// // console.log(isLt10M)
// if (!isJPG && !isPng && !isJPEG) {
// this.$message.info("上传图片只能是 JPG,JPEG或png 格式!");
// }
// if (!isLt10M) {
// this.$message.info("上传图片大小不能超过 10MB!");
// }
// return (isJPG || isPng || isJPEG) && isLt10M;
},
handlePictureCardPreview(file) {
this.resultPicture = file.url;
......@@ -2372,7 +2490,9 @@ export default {
},
// cos上传
async getCosConfigs(image, file, type) {
console.log(image);
console.log(file);
// return;
this.loading = true;
await cosSignature({ image: image, index: "1" })
.then((res) => {
......@@ -2744,6 +2864,7 @@ export default {
// return _this.$message.error('请上传成绩证明资料!')
// }
// }
if (_this.configJson.transcripts == 1) {
if (_this.fileList1.length == 0) {
return _this.$message.error("请上传学生成绩单!");
......@@ -2759,6 +2880,25 @@ export default {
return _this.$message.error("请上传安全告知书!");
}
}
// console.log(this.referForm.annex_url)
// console.log(this.annexFileList.length)
if (
_this.$store.state.user_annex_key == 1 &&
_this.annexFileList.length == 0
) {
return this.$message.error("请上传附件");
}
let obj1 = {
annexUrl: this.referForm.annex_url,
phone: obj.phone,
};
// return
//上传附件
setAnnexUrl(obj1).then((res1) => {
console.log(res1);
if (res1.data.code != 200) {
return _this.$message.error(res1.data.msg);
}
// console.log(obj);
setAccount(obj).then((res) => {
console.log(res);
......@@ -2779,6 +2919,7 @@ export default {
// _this.referForm = res.data.data;
});
});
});
},
},
};
......
......@@ -9,6 +9,6 @@ export const DEVELOPMENT_SERVER_URL = "https://gwapi.campcenter.cn/modules-camps
export const SERVER_WS_URL = "wss://gwapi.campcenter.cn"; // websocket
// 测试
// export const SERVER_URL = "http://192.168.1.145:8088/modules-campsite"; // 正式环境
// export const DEVELOPMENT_SERVER_URL = "http://192.168.1.145:8088/modules-campsite"; //开发环境
// export const SERVER_WS_URL = "wss://192.168.1.145:8088"; // websocket
// export const SERVER_URL = "http://192.168.8.204:8088/modules-campsite"; // 正式环境
// export const DEVELOPMENT_SERVER_URL = "http://192.168.8.204:8088/modules-campsite"; //开发环境
// export const SERVER_WS_URL = "wss://192.168.8.204:8088"; // websocket
/* eslint-disable */
import {request} from '../network';
import { request } from '../network';
import store from '@/store';
// 报名初始化
......@@ -73,7 +73,7 @@ export function delPic(data) {
return request({
method: 'post',
url: '/web/auth/delPic',
params:data
params: data
})
}
......@@ -142,10 +142,21 @@ export function setLog(data) {
//下载附件
export function downloadAnnex(data) {
  data['identity'] = store.state.indexIdentity;
  return request({
    method: 'post',
    url: '/web/download/getDownloadAnnex',
    params: data
  })
data['identity'] = store.state.indexIdentity;
return request({
method: 'post',
url: '/web/download/getDownloadAnnex',
params: data
})
}
//用户上传附件的接口地址
export function setAnnexUrl(data) {
data['identity'] = store.state.indexIdentity;
return request({
method: 'post',
url: '/web/signUp/setAnnexUrl',
data
})
}
......@@ -224,6 +224,11 @@ function checkCam(code, cb) {
store.state.tp_qr_note = res.data.tp_qr_note;
store.state.tp_qr_code = res.data.tp_qr_code;
}
//是否上传附件
if (res.data.user_annex_key == 1) {
store.state.user_annex_key = res.data.user_annex_key;
}
cb && cb(true);
}).catch(() => {
......
......@@ -37,6 +37,7 @@ let state = {
tp_qr_pay:null,//微信二维码截图支付
tp_qr_note:null,
tp_qr_code:null,
user_annex_key:null,//上传附件
};
export default new Vuex.Store({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment