Commit 0bbb39c8 authored by youjie's avatar youjie

资金调拨单据详情 上传附件

parent 96d00af3
<style>
.page_fdd.CapitalDetail92 .el-upload-dragger{
height: 92px;
}
._addUpload_box_btm {
margin-top: 20px;
}
._addUpload_box_btm img {
width: 100%;
}
._addUpload_box_btm>div {
float: left;
width: 138px;
height: 92px;
border: 1px dashed rgba(210, 210, 210, 1);
border-radius: 2px;
cursor: pointer;
margin-bottom: 10px;
padding: 5px;
margin-right: 10px;
position: relative;
}
._addUpload_box_btm>div:hover {
background-color: #f5f5f5;
}
._addFile_name {
padding-left: 15px;
max-width: 450px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
._addUpload_box_btm .icon-guanbi1 {
font-size: 12px;
color: white;
display: inline-block;
margin-left: 15px;
position: absolute;
right: -6px;
top: -9px;
background-color: #f56c6c;
border-radius: 50%;
height: 20px;
width: 20px;
text-align: center;
line-height: 20px;
}
._addUpload_box_btm .icon-guanbi1:hover {
font-size: 12px;
color: #c94052;
}
._addUpload_box_btm .icon-excel {
text-align: center;
font-size: 38px;
color: green;
line-height: 75px;
}
._show_img_box {
position: fixed;
background: rgba(0, 0, 0, .6);
left: 0;
top: 0;
width: 100%;
height: 100%;
z-index: 999;
text-align: center;
}
._addUpload_tips {
font-size: 12px;
color: #999999;
}
.CapitalDetail .Ca_Span{
display:block;
padding-left: 10px;
......@@ -127,7 +206,7 @@
margin-right:0;
}
.CapitalDetail .Cafujian{
width:100%;
/* width:100%; */
min-height: 50px;
margin-top:20px;
}
......@@ -331,7 +410,8 @@
<span class="Ca_remarkSpan">{{$t('hotel.hotel_remark')}}</span>
<div class="Ca_description">{{item.Description}}</div>
<input type="button" class="hollowFixedBtn Co_oderRight" style="margin-top:25px;" @click="showFileList(item)" :value="item.comText"/>
<div class="Cafujian clearfix" v-if="item.isShow">
<div v-if="item.isShow" style="display: flex;">
<div class="Cafujian clearfix" v-if="item.vorcherInos.length>0">
<template v-for="(file,fIndex) in item.vorcherInos">
<div v-if="file.Type==3">
<div style="width:100%;height:100%;overflow: hidden;">
......@@ -350,8 +430,49 @@
</div>
</template>
</div>
<div class="_fujian_box" style="display: flex;margin-bottom: 10px;">
<div class="_addUpload_box _addUpload_box_btm clearfix" v-if="attachmentsList.length>0">
<template v-for="(file,fIndex) in attachmentsList">
<div v-if="file.Type==3">
<div style="width:100%;height:100%;overflow: hidden;">
<el-image
style="width: auto; height: 100%"
:src="file.Url?file.Url:file.Content"
:preview-src-list="[file.Url?file.Url:file.Content]">
</el-image>
</div>
<span class="iconfont icon-guanbi1" @click="deleteUploadFile(fIndex)"></span>
</div>
<div v-if="file.Type==1">
<div class="iconfont _wenjian_P"
style="text-align: center;line-height: 92px;"
:class="file.Content.substring(file.Content.lastIndexOf('.')+1,file.Content.length).toUpperCase()=='PDF'? 'icon-pdf' : 'icon-excel'"
@click="showUpLoadFileT(file)">
</div>
<span class="iconfont icon-guanbi1" @click="deleteUploadFile(fIndex)"></span>
</div>
</template>
</div>
<div style="margin-top: 20px;display: flex;" class="page_fdd CapitalDetail92"
v-if="isUploadFile">
<div class="_pic_upload ">
<el-upload drag :http-request="uploadFileBtn" :multiple="true" :show-file-list="false" action=""
style="height: 92px;">
<i class="el-icon-plus avatar-uploader-icon"></i>
<div class="el-upload__text">点击/拖拽上传</div>
</el-upload>
</div>
<div class="shangchuanfujian" style="display: flex; align-items: flex-end;">
<el-button
v-loading="loading" class="hollowFixedBtn" @click="upLoadFuJian(1)" style="margin-bottom: 10px;">上传附件</el-button>
</div>
</div>
</div>
</div>
</div>
</div>
<div v-for="item in dataList.FBankList">
<div class="clearfix Ca_diaobo">
......@@ -388,7 +509,8 @@
<span class="Ca_remarkSpan">{{$t('hotel.hotel_remark')}}:</span>
<div class="Ca_description">{{item.Description}}</div>
<input type="button" class="hollowFixedBtn Co_oderRight Ca_payBtn" style="margin-top:25px;" @click="showFuFileList(item)" :value="item.comText"/>
<div class="Cafujian clearfix" v-if="item.isShow">
<div v-if="item.isShow" style="display: flex;">
<div class="Cafujian clearfix" v-if="item.vorcherInos.length>0">
<template v-for="(file,fIndex) in item.vorcherInos">
<div v-if="file.Type==3">
<div style="width:100%;height:100%;overflow: hidden;">
......@@ -396,8 +518,8 @@
</div>
</div>
<div v-if="file.Type==1">
<div class="iconfont _wenjian_P" :class="file.Content.substring(file.Content.lastIndexOf('.')+1,file.Content.length).toUpperCase()=='PDF'? 'icon-pdf' : 'icon-excel'" @click="showUpLoadFileT(file)">
<div class="iconfont _wenjian_P"
:class="file.Content.substring(file.Content.lastIndexOf('.')+1,file.Content.length).toUpperCase()=='PDF'? 'icon-pdf' : 'icon-excel'" @click="showUpLoadFileT(file)">
</div>
</div>
<div v-if="file.Type==2">
......@@ -407,6 +529,46 @@
</div>
</template>
</div>
<div class="_fujian_box" style="display: flex;margin-bottom: 10px;">
<div class="_addUpload_box _addUpload_box_btm clearfix" v-if="attachmentsList2.length>0">
<template v-for="(file,fIndex) in attachmentsList2">
<div v-if="file.Type==3">
<div style="width:100%;height:100%;overflow: hidden;">
<el-image
style="width: auto; height: 100%"
:src="file.Url?file.Url:file.Content"
:preview-src-list="[file.Url?file.Url:file.Content]">
</el-image>
</div>
<span class="iconfont icon-guanbi1" @click="deleteUploadFile(fIndex,1)"></span>
</div>
<div v-if="file.Type==1">
<div class="iconfont _wenjian_P" style="text-align: center;line-height: 92px;"
:class="file.Content.substring(file.Content.lastIndexOf('.')+1,file.Content.length).toUpperCase()=='PDF'? 'icon-pdf' : 'icon-excel'"
@click="showUpLoadFileT(file)">
</div>
<span class="iconfont icon-guanbi1" @click="deleteUploadFile(fIndex,1)"></span>
</div>
</template>
</div>
<div style="margin-top: 20px;display: flex;" class="page_fdd CapitalDetail92"
v-if="isUploadFile">
<div class="_pic_upload ">
<el-upload drag :http-request="uploadFileBtn2" :multiple="true" :show-file-list="false" action=""
style="height: 92px;">
<i class="el-icon-plus avatar-uploader-icon"></i>
<div class="el-upload__text">点击/拖拽上传</div>
</el-upload>
</div>
<div class="shangchuanfujian" style="display: flex; align-items: flex-end;">
<el-button
v-loading="loading" class="hollowFixedBtn" @click="upLoadFuJian(2)" style="margin-bottom: 10px;">上传附件</el-button>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="Ca_popDiv" v-if="dataList.AuditSteps!=''">
......@@ -618,8 +780,12 @@ export default {
'my-FlowChartModule': myFlowChartModule,
},
data(){
return {
loading2: false,
attachmentsList2:[],
loading: false,
isUploadFile: false,
attachmentsList:[],
msg:{
ID:0
},
......@@ -648,6 +814,9 @@ export default {
if(ActionMenuCode.indexOf('F_Update_KJCostType')!=-1){
this.huijiShow=true;
}
if(ActionMenuCode.indexOf('F_Trademodify')!=-1){
this.isUploadFile = true
}
},
methods:{
goPrintPageNew(type,id,Merge,OrderSource){
......@@ -738,9 +907,116 @@ export default {
}
this.$forceUpdate();
},
//删除附件
deleteUploadFile(){
upLoadFuJian(type){
if (this.attachmentsList.length === 0) return this.$message.error('请上传文件!');
let TradeWayId
if(type==1){
TradeWayId = this.dataList.SBankList[0].AccountId
}else{
TradeWayId = this.dataList.FBankList[0].AccountId
}
let msg = {
FrID: this.msg.ID,
vorcherInos: type==1?this.attachmentsList:this.attachmentsList2,
TradeWayId: TradeWayId
};
this.loading = true
this.apipost('Financial_post_SetVoucher', msg, res => {
this.loading = false
if (res.data.resultCode === 1) {
this.getList()
} else {
this.$message.error(res.data.message);
}
}, null)
},
uploadFileBtn2(file) { //上传
if (file.file.size > 1024 * 1024 * 10) {
this.$message.warning('文件大小不能超过10M!')
return
}
// 1 文档 2 数据 3 图片
let typeArr = [{
stringArr: 'GIF|JPG|JPEG|PNG|BMP',
type: 3
},
{
stringArr: 'DOCX|DOC|XLSX|XLS|PPT|PPTX|PDF',
type: 1
},
]
let ft = file.file.name.substring(file.file.name.lastIndexOf('.') + 1, file.file.name.length).toUpperCase();
let fileTypeNumber = 2;
let typeOk = false;
typeArr.forEach(x => {
if (x.stringArr.indexOf(ft) != '-1') {
fileTypeNumber = x.type;
typeOk = true;
}
});
if (!typeOk) return this.$message.error('请上传图片、word、excel类型的文件!');
let newArr = [];
newArr.push(file.file)
let path = "/Upload/Temporary/"
this.$message.info('上传中...')
this.UploadSelfFileT(path, newArr, x => {
let fileSize = file.file.size < 1024 ? file.file.size : (file.file.size / 1024).toFixed(0);
this.attachmentsList2.push({
Type: fileTypeNumber,
Content: x.data.FilePath,
Url: this.domainManager().ViittoFileUrl + x.data.FilePath,
});
this.$message.success('上传成功');
});
},
uploadFileBtn(file) { //上传
if (file.file.size > 1024 * 1024 * 10) {
this.$message.warning('文件大小不能超过10M!')
return
}
// 1 文档 2 数据 3 图片
let typeArr = [{
stringArr: 'GIF|JPG|JPEG|PNG|BMP',
type: 3
},
{
stringArr: 'DOCX|DOC|XLSX|XLS|PPT|PPTX|PDF',
type: 1
},
]
let ft = file.file.name.substring(file.file.name.lastIndexOf('.') + 1, file.file.name.length).toUpperCase();
let fileTypeNumber = 2;
let typeOk = false;
typeArr.forEach(x => {
if (x.stringArr.indexOf(ft) != '-1') {
fileTypeNumber = x.type;
typeOk = true;
}
});
if (!typeOk) return this.$message.error('请上传图片、word、excel类型的文件!');
let newArr = [];
newArr.push(file.file)
let path = "/Upload/Temporary/"
this.$message.info('上传中...')
this.UploadSelfFileT(path, newArr, x => {
let fileSize = file.file.size < 1024 ? file.file.size : (file.file.size / 1024).toFixed(0);
this.attachmentsList.push({
Type: fileTypeNumber,
Content: x.data.FilePath,
Url: this.domainManager().ViittoFileUrl + x.data.FilePath,
});
this.$message.success('上传成功');
});
},
//删除附件
deleteUploadFile(i,type){
if(type==1){
this.attachmentsList.splice(i, 1);
}else{
this.attachmentsList2.splice(i, 1);
}
},
//显示大图
showImg(obj){
......
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