|
|
@@ -74,11 +74,26 @@
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="FileUrlList" label="资质文件" show-overflow-tooltip>
|
|
|
- <template slot-scope="scope">
|
|
|
- <div v-for="(tmpUrl, index) in scope.row.FileUrlList">
|
|
|
- <el-link :href="'http://'+fileurlcut(scope.row.FileUrl, index)" target="_blank" type="primary">
|
|
|
+ <template slot-scope="scope" >
|
|
|
+ <!-- <div v-for="(tmpUrl, index) in scope.row.FileUrlList" :key="index" class="pgotoStyle"> -->
|
|
|
+ <!-- <el-link :href="'http://'+fileurlcut(scope.row.FileUrl, index)" target="_blank" type="primary">
|
|
|
+ {{scope.row.FileName.split('$')[index]}}</el-link> -->
|
|
|
+ <viewer :images="scope.row.FileUrlList">
|
|
|
+ <div v-for="(tmpUrl,index) in scope.row.FileUrlList" :key="index" style="vertical-align: middle; text-align: center;">
|
|
|
+
|
|
|
+ <el-link :href="'http://'+fileurlcut(scope.row.FileUrl, index)" target="_blank" type="primary"
|
|
|
+ v-if="imgFormat(scope.row.FileUrl, index)"
|
|
|
+ >
|
|
|
{{scope.row.FileName.split('$')[index]}}</el-link>
|
|
|
- </div>
|
|
|
+
|
|
|
+ <img
|
|
|
+ v-else
|
|
|
+ class="photoStyle" alt=""
|
|
|
+ :src="'http://'+fileurlcut(scope.row.FileUrl, index)"
|
|
|
+ :key="index"
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ </viewer>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="EffectDate" label="有效日期" show-overflow-tooltip>
|
|
|
@@ -115,16 +130,37 @@
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="资质文件">
|
|
|
- <el-upload multiple style="margin-top: 10px;" action="" ref="refuploadattach"
|
|
|
+ <!-- <el-upload multiple style="margin-top: 10px;" action="" ref="refuploadattach"
|
|
|
:on-remove="filremove" :http-request="uploadrequest" class="attach-uploader" :before-upload="beforeAvatarUpload" :file-list="fileList">
|
|
|
<i class="el-icon-plus attach-uploader-icon"></i>
|
|
|
<div slot="tip" class="el-upload__tip" v-if="SubfileForm.NeedFileType !=yasuoname">请上传图片(大小为512KB-5MB),可上传多张图片
|
|
|
</div>
|
|
|
<div slot="tip" class="el-upload__tip" v-if="SubfileForm.NeedFileType ==yasuoname">请上传压缩文件
|
|
|
</div>
|
|
|
+ </el-upload> -->
|
|
|
+ <el-upload
|
|
|
+ :multiple="false" style="margin-top: 10px;" class="attach-uploader"
|
|
|
+ action=""
|
|
|
+ :before-upload="beforeAvatarUpload"
|
|
|
+ :on-preview="handlePictureCardPreview"
|
|
|
+ list-type="picture-card"
|
|
|
+ ref="refuploadattach"
|
|
|
+ :file-list="fileList"
|
|
|
+ :on-remove="filremove"
|
|
|
+ :http-request="uploadrequest"
|
|
|
+ limit = "5"
|
|
|
+ :on-exceed="uploadExceed">
|
|
|
+ <i class="el-icon-plus"></i>
|
|
|
+ <div slot="tip" class="el-upload__tip" v-if="SubfileForm.NeedFileType !=yasuoname">请上传图片(大小为512KB-5MB),最多可上传五张图片
|
|
|
+ </div>
|
|
|
+ <div slot="tip" class="el-upload__tip" v-if="SubfileForm.NeedFileType ==yasuoname">请上传压缩文件
|
|
|
+ </div>
|
|
|
</el-upload>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
+ <el-dialog :visible.sync="dialogVisible" :modal="false">
|
|
|
+ <img width="100%" style="z-index:9999" :src="dialogImageUrl" alt="">
|
|
|
+ </el-dialog>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
<!--<el-col :span="24">
|
|
|
<el-form-item class="maintainlog" label="" label-width="120px">
|
|
|
<div style="overflow: auto;">
|
|
|
@@ -162,6 +198,14 @@
|
|
|
import BusinessList from '../../components/oilsupplier/businesslist'
|
|
|
import setapi from '@/api/oilsupplier/oilclassorgset'
|
|
|
import api from '@/api/oilsupplier/supplierfile'
|
|
|
+ // v-viewer
|
|
|
+ import Vue from 'vue';
|
|
|
+ import Viewer from 'v-viewer'
|
|
|
+ import 'viewerjs/dist/viewer.css'
|
|
|
+ Vue.use(Viewer)
|
|
|
+ Viewer.setDefaults({
|
|
|
+ Options: { 'inline': true, 'button': true, 'navbar': true, 'title': true, 'toolbar': true, 'tooltip': true, 'movable': true, 'zoomable': true, 'rotatable': true, 'scalable': true, 'transition': true, 'fullscreen': true, 'keyboard': true, 'url': 'data-source' }
|
|
|
+ })
|
|
|
|
|
|
export default {
|
|
|
name: 'SubfileList',
|
|
|
@@ -197,7 +241,9 @@
|
|
|
...mapGetters({
|
|
|
session: 'session',
|
|
|
authUser: 'authUser'
|
|
|
- })
|
|
|
+ }),
|
|
|
+
|
|
|
+
|
|
|
},
|
|
|
data () {
|
|
|
var effectDate = (rule, value, callback) => {
|
|
|
@@ -215,6 +261,9 @@
|
|
|
}
|
|
|
|
|
|
return {
|
|
|
+ dialogImageUrl: '',
|
|
|
+ dialogVisible: false,
|
|
|
+
|
|
|
size: 10,
|
|
|
currentPage: 1,
|
|
|
currentItem_Count: 0,
|
|
|
@@ -287,6 +336,25 @@
|
|
|
this.IsCompanyUser = this.authUser.Profile.IsCompanyUser
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 上传超过限制数
|
|
|
+ uploadExceed (files, fileList) {
|
|
|
+ if (fileList.length >= 5) {
|
|
|
+ this.$alert('超出上传照片数,禁止上传', '提示', {
|
|
|
+ confirmButtonText: '确定'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ handleRemove(file) {
|
|
|
+ console.log(file);
|
|
|
+ },
|
|
|
+ handlePictureCardPreview(file) {
|
|
|
+ this.dialogImageUrl = file.url;
|
|
|
+ this.dialogVisible = true;
|
|
|
+ },
|
|
|
+ handleDownload(file) {
|
|
|
+ console.log(file);
|
|
|
+ },
|
|
|
+
|
|
|
pickerchange () {
|
|
|
console.log(this.SubfileForm.EffectDate)
|
|
|
},
|
|
|
@@ -345,8 +413,27 @@
|
|
|
_this.subfileList = res.data.items
|
|
|
_this.currentItemCount = res.data.currentItemCount
|
|
|
for (let idx in _this.subfileList) {
|
|
|
- _this.subfileList[idx].FileUrlList = _this.subfileList[idx].FileUrl.split('$')
|
|
|
+ // _this.subfileList[idx].FileUrlList = _this.subfileList[idx].FileUrl.split('$')
|
|
|
+
|
|
|
+ var urlList = _this.subfileList[idx].FileUrl.split('$')
|
|
|
+ // var img = urlList.find(fileurlall=>{
|
|
|
+ // let fileurl = fileurlall.split('|')
|
|
|
+ // let retUrl = fileurl[0]
|
|
|
+ // let Format = fileurl[1].split(".")
|
|
|
+ // let pictureFormat = Format[1];
|
|
|
+ // if("jpg"== pictureFormat ){
|
|
|
+ // return true;
|
|
|
+ // }
|
|
|
+ // return false;
|
|
|
+ // })
|
|
|
+ // if(img != null && img != undefined){
|
|
|
+ // urlList = urlList.filter(n=>n!=img)
|
|
|
+ // urlList.unshift(img)
|
|
|
+ // }
|
|
|
+
|
|
|
+ _this.subfileList[idx].FileUrlList = urlList
|
|
|
}
|
|
|
+
|
|
|
this.getSupplierSceneFile()
|
|
|
})
|
|
|
.catch(err => {
|
|
|
@@ -541,6 +628,7 @@
|
|
|
},
|
|
|
showDialog () {
|
|
|
// this.doclist = []
|
|
|
+ this.fileList = []
|
|
|
this.IsMust = false
|
|
|
this.Title = '新增文件'
|
|
|
this.SubfileForm.Id = ''
|
|
|
@@ -719,6 +807,21 @@
|
|
|
seachdata () {
|
|
|
this.initData()
|
|
|
},
|
|
|
+
|
|
|
+ imgFormat(val,index){
|
|
|
+ if(val !=null && val != undefined){
|
|
|
+ let fileurlall = val.split('$')[index]
|
|
|
+ let fileurl = fileurlall.split('|')
|
|
|
+ let retUrl = fileurl[0]
|
|
|
+ let Format = fileurl[1].split(".")
|
|
|
+ let pictureFormat = Format[1];
|
|
|
+ if("jpg"== pictureFormat || "bmp" ==pictureFormat || "png" ==pictureFormat || "gif" ==pictureFormat|| "jpeg" ==pictureFormat){
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
fileurlcut (val, index) {
|
|
|
let fileurlall = val.split('$')[index]
|
|
|
let fileurl = fileurlall.split('|')
|
|
|
@@ -728,7 +831,7 @@
|
|
|
const myDomain = window.location.host
|
|
|
retUrl = myDomain + '/' + retUrl
|
|
|
}
|
|
|
- return retUrl
|
|
|
+ return retUrl;
|
|
|
},
|
|
|
jstimehandle (val) {
|
|
|
if (val === '') {
|
|
|
@@ -777,8 +880,10 @@
|
|
|
position: relative;
|
|
|
overflow: hidden;
|
|
|
// margin-bottom: -17px;
|
|
|
- margin-top: -15px;
|
|
|
- margin-left: 20px
|
|
|
+ //margin-top: -15px;
|
|
|
+ //margin-left: 20px
|
|
|
+ margin-top: 0px;
|
|
|
+ margin-left: 0px
|
|
|
}
|
|
|
|
|
|
.attach-uploader .el-upload:hover {
|
|
|
@@ -798,4 +903,9 @@
|
|
|
color: #228B22;
|
|
|
}
|
|
|
|
|
|
+ .photoStyle{
|
|
|
+ margin-top:6px;
|
|
|
+ width:140px;
|
|
|
+ height: 60px;
|
|
|
+ }
|
|
|
</style>
|