|
@@ -85,17 +85,24 @@
|
|
|
<div><p>活动完结报告</p></div>
|
|
|
</div>
|
|
|
<div style="width: 85%" v-loading="loading" element-loading-text="文件正在上传中">
|
|
|
- <div style="display: flex;width: 100%;align-items: center;">
|
|
|
- <div class="download" v-if="tableData.reportFile!=''&&tableData.reportFile!=null">{{ tableData.reportFile!=''&&tableData.reportFile!=null?JSON.parse(tableData.reportFile).fileName:'' }}</div>
|
|
|
- <div class="addMoneyBtn" v-if="tableData.reportFile==''||tableData.reportFile==null">
|
|
|
+ <div style="display: flex;width: 100%;flex-direction: column;">
|
|
|
+ <div class="download" v-for="item in tableData.reportFile">
|
|
|
+ <span>{{ item.fileName }}</span>
|
|
|
+ <div class="downloadBtn">
|
|
|
+ <el-button type="primary" size="mini">下载文件</el-button>
|
|
|
+ <el-button type="primary" @click="checkDelFile(item.fid)" size="mini">删除文件</el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!-- <div class="download" v-if="tableData.reportFile!=''&&tableData.reportFile!=null">{{ tableData.reportFile!=''&&tableData.reportFile!=null?JSON.parse(tableData.reportFile).fileName:'' }}</div> -->
|
|
|
+ <div class="addMoneyBtn">
|
|
|
<div class="jia">+</div>添加
|
|
|
<div id="upFile">
|
|
|
<beUpload @getFile="getFile" :navName="'上传文件'" :accept="accept"> </beUpload>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="DelFile" v-if="tableData.reportFile!=''&&tableData.reportFile!=null">
|
|
|
+ <!-- <div class="DelFile" v-if="tableData.reportFile!=''&&tableData.reportFile!=null">
|
|
|
<el-button type="danger" @click="DelFileDialog = true">删除文件</el-button>
|
|
|
- </div>
|
|
|
+ </div> -->
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- 活动完结报告结束 -->
|
|
@@ -272,7 +279,7 @@
|
|
|
width="600px"
|
|
|
class="MAputIn AddMember">
|
|
|
<div class="addDialogLogo">LOGO</div>
|
|
|
- <div class="deleteContent" v-if="tableData.reportFile!=''&&tableData.reportFile!=null">是否删除“{{JSON.parse(tableData.reportFile).fileName}}”文件?</div>
|
|
|
+ <div class="deleteContent" >是否删除“{{DelFileData.fileName}}”文件?</div>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
<el-button type="danger" @click="DelFileYes" class="btn5" size="small">确认删除</el-button>
|
|
|
<el-button @click="DelFileDialog=false;" class="btn5" style="background:#cccccc" size="small">取消</el-button>
|
|
@@ -338,6 +345,11 @@ export default {
|
|
|
project:[],
|
|
|
class:[]
|
|
|
},
|
|
|
+ DelFileData:{
|
|
|
+ fid:"",
|
|
|
+ fileName:"",
|
|
|
+
|
|
|
+ },
|
|
|
Member:{
|
|
|
Id:'',
|
|
|
Name:'',
|
|
@@ -348,10 +360,11 @@ export default {
|
|
|
},
|
|
|
methods:{
|
|
|
DelFileYes(){
|
|
|
+ let newFile = this.tableData.reportFile.filter(item=>item.fid!=this.DelFileData.fid);
|
|
|
this.ajax.post(this.$store.state.api+"/UploadActivityFile",{
|
|
|
uid:this.$store.state.userInfo.userid,
|
|
|
aid:this.$route.query['Id'],
|
|
|
- file:""
|
|
|
+ file:JSON.stringify(newFile)
|
|
|
}).then(res=>{
|
|
|
if(res.data==1){
|
|
|
this.$message.success("删除成功");
|
|
@@ -364,11 +377,28 @@ export default {
|
|
|
this.$message.error(err.message)
|
|
|
})
|
|
|
},
|
|
|
+ checkDelFile(Id){
|
|
|
+ this.DelFileData = this.tableData.reportFile.filter(item=>item.fid==Id)[0];
|
|
|
+ this.DelFileDialog = true;
|
|
|
+ },
|
|
|
+ // delFile(Id){
|
|
|
+ // let file = this.tableData.reportFile.filter(item=>item.fid==Id)[0];
|
|
|
+ // this.$confirm(`确定删除${file.fileName}这个文件吗?`, '提示', {
|
|
|
+ // confirmButtonText: '确定',
|
|
|
+ // cancelButtonText: '取消',
|
|
|
+ // type: 'warning'
|
|
|
+ // }).then(() => {
|
|
|
+ // let newFile = this.tableData.reportFile.filter(item=>item.fid!=Id);
|
|
|
+ // console.log(newFile);
|
|
|
+ // })
|
|
|
+ // },
|
|
|
getFile(val) {//上传文件
|
|
|
+ val.fid = uuid.v1()
|
|
|
+ let newData = [...this.tableData.reportFile,val];
|
|
|
this.ajax.post(this.$store.state.api+"/UploadActivityFile",{
|
|
|
uid:this.$store.state.userInfo.userid,
|
|
|
aid:this.$route.query['Id'],
|
|
|
- file:JSON.stringify(val)
|
|
|
+ file:JSON.stringify(newData)
|
|
|
}).then(res=>{
|
|
|
if(res.data==1){
|
|
|
this.$message.success("添加成功");
|
|
@@ -548,6 +578,10 @@ export default {
|
|
|
data.begin_at = JSON.parse(data.begin_at);
|
|
|
data.course_teacher = JSON.parse(data.course_teacher);
|
|
|
data.chapters = JSON.parse(data.chapters)
|
|
|
+ // console.log(data.reportFile)
|
|
|
+ // console.log(data.reportFile==''||data.reportFile==null?[]:JSON.parse(data.reportFile))
|
|
|
+ data.reportFile = data.reportFile==''||data.reportFile==null?[]:JSON.parse(data.reportFile)
|
|
|
+ // data.reportFile = data.reportFile==''||data.reportFile==null?[]:JSON.parse(data.reportFile);
|
|
|
this.tableData = data;
|
|
|
console.log(this.tableData)
|
|
|
// this.$message.success("获取数据成功")
|
|
@@ -587,14 +621,23 @@ export default {
|
|
|
|
|
|
|
|
|
.download{ //pdf下载
|
|
|
- margin: 20px 15px;
|
|
|
- width: 250px;
|
|
|
+ margin: 10px 10px;
|
|
|
+ width: 500px;
|
|
|
line-height: 35px;
|
|
|
text-align: left;
|
|
|
font-size: 16px;
|
|
|
font-weight: bold;
|
|
|
color: #5391fd;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
cursor: pointer;
|
|
|
+ span{
|
|
|
+ display: block;
|
|
|
+ max-width: 250px;
|
|
|
+ white-space: nowrap;
|
|
|
+ overflow: hidden;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|