Commit 83dc61b7 authored by youjie's avatar youjie

附件

parent fe041aa9
<style scoped> <style scoped>
._fujian_box{
display: inline-block
}
/deep/._fujian_box .el-upload-dragger{
width: 50px;
height: 50px;
line-height: 50px;
}
/deep/.el-table th.el-table__cell { /deep/.el-table th.el-table__cell {
background-color: #E6E6E6; background-color: #E6E6E6;
} }
...@@ -145,6 +153,16 @@ ...@@ -145,6 +153,16 @@
<template v-else> <template v-else>
- -
</template> </template>
<div class="_fujian_box" style="margin-left: 15px;margin-right: 5px;">
<div class="_pic_upload">
<el-upload drag :http-request="(file)=>uploadFile(file,scope.$index)"
:multiple="true"
:show-file-list="false" action=""
accept="image/jpeg,image/jpg, image/png, image/bmp">
<i class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
</div>
</div>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -232,6 +250,47 @@ ...@@ -232,6 +250,47 @@
this.getEmployeeList(); this.getEmployeeList();
}, },
methods: { methods: {
uploadFile(file,index) { //上传
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);
let obj = {
Type: fileTypeNumber,
Content: x.data.FilePath,
Url: this.domainManager().ViittoFileUrl + x.data.FilePath
}
this.DataList[index].ReFinanceIds = obj.Url
this.$message.success(this.$t('tips.scchenggong'));
this.$forceUpdate()
})
},
getdatalist() { getdatalist() {
this.loading = true; this.loading = true;
this.apipost( this.apipost(
......
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