16 changed files with 193 additions and 27 deletions
@ -0,0 +1,98 @@ |
|||
<template> |
|||
<div class="body1"> |
|||
<p class="title">资产评估/资产评价报告</p> |
|||
<img :src="host+'/'+contentDatas.asset_data.asset_report_img" class="file_img" v-if="contentDatas.asset_data.asset_report_img"> |
|||
<div class="img_span"> |
|||
<span @click="onPreview([host+'/'+contentDatas.asset_data.asset_report_img])" v-if="contentDatas.asset_data.asset_report_img">在线预览</span> |
|||
<el-upload |
|||
class="upload-demo" |
|||
:action="action" |
|||
:show-file-list="false" |
|||
:on-error="handleAvatarError" |
|||
list-type="picture" |
|||
:on-success="(res)=>{handleAvatarSuccess(res)}" |
|||
> |
|||
<span class="upload_span">{{contentDatas.asset_data.asset_report==null?'上传文件':'重新上传'}}</span> |
|||
</el-upload> |
|||
<a :href="contentDatas.asset_data.asset_report" v-if="contentDatas.asset_data.asset_report">下载文件</a> |
|||
</div> |
|||
<el-image-viewer |
|||
v-if="showViewer" |
|||
:on-close="closeViewer" |
|||
:url-list="img_url" |
|||
:z-index="9999" |
|||
/> |
|||
</div> |
|||
</template> |
|||
<script> |
|||
import bus from '../../bus' |
|||
import {assetAssessReport} from '../../../../api/index' |
|||
export default { |
|||
props:{ |
|||
contentDatas:{ |
|||
require: true |
|||
} |
|||
}, |
|||
components: { |
|||
ElImageViewer: () => import('element-ui/packages/image/src/image-viewer') |
|||
}, |
|||
data() { |
|||
return{ |
|||
host:'http://wenhua.xingtongworld.com', |
|||
action:'http://wenhua.xingtongworld.com/api/Index/uploadFile', |
|||
showViewer:false, |
|||
img_url:[], |
|||
} |
|||
}, |
|||
methods:{ |
|||
// 上传资产评估报告 |
|||
assetAssessReport(url){ |
|||
let data={ |
|||
id:this.contentDatas.asset_data.id, |
|||
report:url |
|||
} |
|||
assetAssessReport(data).then(res => { |
|||
console.log(res); |
|||
if (res.code==100) { |
|||
this.$message.success('提交成功~'); |
|||
bus.$emit('getDate'); |
|||
}else{ |
|||
this.$message.error(res.msg); |
|||
} |
|||
}); |
|||
}, |
|||
onPreview(img) { |
|||
this.img_url = img |
|||
this.showViewer = true |
|||
}, |
|||
// 关闭查看器 |
|||
closeViewer() { |
|||
this.showViewer = false |
|||
}, |
|||
handleAvatarError(){ |
|||
this.$message.error('文件上传失败!'); |
|||
}, |
|||
handleAvatarSuccess(res,type){ |
|||
console.info(res) |
|||
if(res.code==1){ |
|||
let contract=this.host+res.data.img_url; |
|||
// bus.$emit('file', contract); |
|||
this.assetAssessReport(contract) |
|||
|
|||
}else{ |
|||
this.$message.error(res.msg); |
|||
} |
|||
}, |
|||
} |
|||
} |
|||
</script> |
|||
<style scoped> |
|||
@import url('../../../../assets/css/sidebar.css'); |
|||
.img_span{ |
|||
width: 200px; |
|||
} |
|||
.img_span a{ |
|||
font-size: 14px; |
|||
color: #4E73E4; |
|||
} |
|||
</style> |
|||
Loading…
Reference in new issue