Commit 2df1d636 authored by liudong1993's avatar liudong1993

1

parent 4e15102e
......@@ -1604,11 +1604,47 @@
</el-dialog>
<el-dialog custom-class='w700' title="导入快递费" :visible.sync="outerVisible2" center>
<el-upload drag class="upload-demo" :action="importFileUrl3" :on-success="handleAvatarSuccess2"
:before-upload="beforeAvatarUpload">
:before-upload="beforeAvatarUpload2">
<i class="el-icon-upload"></i>
<div class="el-upload__text">{{$t("tips.tuodongwenjian")}}<em>{{$t('tips.dianjishanhcuan')}}</em></div>
<div slot="tip" class="el-upload__tip">{{$t("ground.znscexcel")}}</div>
</el-upload>
<div class="_addUpload_box clearfix">
<template v-for="(file,fIndex) in expressageMsg">
<div v-if="file.Type==3" style="width:30px; float:left;">
<div class="iconfont ">
<el-image
style="height:16px;"
:src="file.Url?file.Url:file.Content"
:preview-src-list="[file.Url?file.Url:file.Content]">
</el-image>
<!-- <img :src="file.Url?file.Url:file.Content" @click="showUpLoadFile(file,index)" style="height:16px;"> -->
</div>
<span class="iconfont icon-guanbi1" style="font-size:12px;" @click="deleteExpressFeeUploadFile(fIndex,index)"></span>
</div>
<div v-if="file.Type==1" style="width:30px; float:left;">
<div class="iconfont "
:class="file.Content.substring(file.Content.lastIndexOf('.')+1,file.Content.length).toUpperCase()=='PDF'? 'icon-pdf' : 'icon-excel'"
@click="showUpLoadFile(file)">
</div>
<span class="iconfont icon-guanbi1" style="font-size:12px;" @click="deleteExpressFeeUploadFile(fIndex,index)"></span>
</div>
<div v-if="file.Type==2" style="width:30px; float:left;">
<div class="iconfont icon-excel" @click="showUpLoadFile(file,index)">
</div>
<span class="iconfont icon-guanbi1" style="font-size:12px;" @click="deleteExpressFeeUploadFile(fIndex,index)"></span>
</div>
</template>
<div class="_pic_upload financiaUpload">
<el-upload drag :http-request="uploadFileExpressFeeBtn" :multiple="true" :show-file-list="false" action="">
<i class="el-icon-plus avatar-uploader-icon"></i>
<div class="el-upload__text" >{{$t('tips.dianjishanhcuan')}}</div>
</el-upload>
</div>
</div>
</el-dialog>
<editExchangeRate v-if="costmodeHL" :hlData="trabeListHL" @success="resetPageIndex(),
......@@ -1753,6 +1789,7 @@
tabLoading:false,
importFileUrl2: this.domainManager().UploadFileUrl +
"?cmd=dmc_post_LocalFileUpload&fileType=1&fileLimit=1&RB_Group_id=2&Type=18",
expressageMsg: [],
importFileUrl3: this.domainManager().UploadFileUrl +
"?cmd=dmc_post_LocalFileUpload&fileType=1&fileLimit=1&RB_Group_id=2&Type=21",
hbMsg: {
......@@ -2067,6 +2104,50 @@
this.$refs.multipleTable.clearSelection();
}
},
uploadFileExpressFeeBtn(file) { //上传
if (file.file.size > 1024 * 1024 * 10) {
this.$message.warning(this.$t('tips.wjdxbncgsz'))
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(this.$t('tips.qscWEfile'));
let newArr = [];
newArr.push(file.file)
let path = "/Upload/Temporary/"
this.$message.info(this.$t('tips.shangchuanzhong'))
this.UploadSelfFileT(path, newArr, x => {
let fileSize = file.file.size < 1024 ? file.file.size : (file.file.size / 1024).toFixed(0);
this.expressageMsg.push({
Content: x.data.FilePath,
ID: 0,
Type: fileTypeNumber,
Url: this.domainManager().ViittoFileUrl + x.data.FilePath,
})
this.$message.success(this.$t('tips.scchenggong'))
}, 1);
},
deleteExpressFeeUploadFile(i) { // 删除上传文件
// this.saveMsgInvoice.splice(i, 1);
this.expressageMsg.splice(i, 1);
},
handleSelectionChange(val){
this.multipleSelection = []
this.checkList = []
......@@ -2276,6 +2357,10 @@
}
return isJPG && isLt2M;
},
beforeAvatarUpload2(file) {
this.importFileUrl3 = this.importFileUrl3 + '&CreateByName=' + this.expressageMsg[0].Url
return;
},
//上传
handleAvatarSuccess(res, file) {
if (res.resultCode == 1) {
......@@ -2292,6 +2377,7 @@
if (res.resultCode == 1) {
this.Success(res.message);
resetPageIndex();
getPageList();
}
else{
this.$message.error(res.message);
......
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