|
|
@@ -693,7 +693,7 @@
|
|
|
style="margin-top: 10px;">
|
|
|
<div slot="header"
|
|
|
class="clearfix">
|
|
|
- <span style="padding:3px 20px">所代理制造商名称(先保存基本信息后再添加)</span>
|
|
|
+ <span style="padding:3px 20px">所代理制造商名称 </span>
|
|
|
<el-button style="float: right; padding: 3px 10px"
|
|
|
type="text"
|
|
|
@click="manufacturerdialog"
|
|
|
@@ -718,26 +718,40 @@
|
|
|
<el-table :data="scenefileurllist" border size="mini" empty-text="暂无数据" style="margin-top: 30px;">
|
|
|
<el-table-column prop="FileUrlList" label="报告" show-overflow-tooltip>
|
|
|
<template slot-scope="scope">
|
|
|
- <viewer :images="scenefileurllist">
|
|
|
- <el-col :span="6" v-for="(tmpUrl,index) in scenefileurllist" v-if="index<1" :key="index" style="vertical-align: middle; text-align: center;">
|
|
|
- <el-link :href="'http://'+fileurlcut(scenefile.FileUrl, scope.$index)" target="_blank" type="primary"
|
|
|
- v-if="imgFormat(scenefile.FileUrl, index)" >
|
|
|
- {{scenefile.FileName.split('$')[scope.$index]}}</el-link>
|
|
|
+<!-- <viewer :images="scenefileurllist">-->
|
|
|
+<!-- <el-col :span="6" v-for="(tmpUrl,index) in scenefileurllist" v-if="index<1" :key="index" style="vertical-align: middle; text-align: center;">-->
|
|
|
+<!-- <el-link :href="'http://'+fileurlcut(scenefile.FileUrl, scope.$index)" target="_blank" type="primary"-->
|
|
|
+<!-- v-if="imgFormat(scenefile.FileUrl, index)" >-->
|
|
|
+<!-- {{scenefile.FileName.split('$')[scope.$index]}}</el-link>-->
|
|
|
+<!-- <img-->
|
|
|
+<!-- v-else-->
|
|
|
+<!-- class="photoStyle" alt=""-->
|
|
|
+<!-- :src="'http://'+fileurlcut(scenefile.FileUrl, scope.$index)"-->
|
|
|
+<!-- :key="index">-->
|
|
|
+<!-- </el-col>-->
|
|
|
+<!-- </viewer>-->
|
|
|
+ <viewer>
|
|
|
+ <div style="vertical-align: middle; text-align: center;">
|
|
|
+ <el-link :href="'http://'+fileurlcut(scope.row.FileUrl)" target="_blank" type="primary"
|
|
|
+ v-if="imgFormat(scope.row.FileUrl)" >
|
|
|
+ {{scope.row.FileUrl}}</el-link>
|
|
|
<img
|
|
|
v-else
|
|
|
class="photoStyle" alt=""
|
|
|
- :src="'http://'+fileurlcut(scenefile.FileUrl, scope.$index)"
|
|
|
- :key="index">
|
|
|
- </el-col>
|
|
|
+ :src="'http://'+fileurlcut(scope.row.FileUrl)">
|
|
|
+ </div>
|
|
|
</viewer>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="FileUrlList" label="描述" show-overflow-tooltip>{{scenefile.Remark}}
|
|
|
+ <el-table-column prop="FileUrlList" label="描述" show-overflow-tooltip>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{scope.row.Remark}}
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="操作" width="150" align="center" fixed>
|
|
|
<template slot-scope="scope">
|
|
|
<el-button type="primary" plain size="mini" title="删除" style="margin-left:3px" :disabled="checkStatus.includes(formData.Status)"
|
|
|
- v-if="scenefile.FileName != ''" @click="deletedata(scenefile.FileName.split('$')[scope.$index], scenefile.FileUrl.split('$')[scope.$index])">删除</el-button>
|
|
|
+ v-if="scope.row.FileName != ''" @click="deletedata(scope.row.Id)">删除</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
@@ -750,7 +764,7 @@
|
|
|
<el-row>
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="现场考察报告">
|
|
|
- <el-upload multiple style="margin-top: 10px;" action="" ref="refuploadattach"
|
|
|
+ <el-upload :limit="1" style="margin-top: 10px;" action="" ref="refuploadattach"
|
|
|
:http-request="uploadrequest" class="attach-uploader" :before-upload="beforeAvatarUpload">
|
|
|
<i class="el-icon-plus attach-uploader-icon"></i>
|
|
|
</el-upload>
|
|
|
@@ -774,6 +788,7 @@
|
|
|
|
|
|
<script>
|
|
|
import axios from 'axios'
|
|
|
+import api from '@/api/oilsupplier/supplier'
|
|
|
import uploadajax from '../../assets/js/uploadajax.js'
|
|
|
import ManufacturerList from '@/components/oilsupplier/manufacturerlist'
|
|
|
|
|
|
@@ -998,6 +1013,7 @@ export default {
|
|
|
FileName: '',
|
|
|
Remark: ''
|
|
|
},
|
|
|
+ isscenefile: false,
|
|
|
countryprops: {
|
|
|
value: 'adcode',
|
|
|
label: 'name',
|
|
|
@@ -1190,14 +1206,35 @@ export default {
|
|
|
getCurrentManufactureCount2 () {
|
|
|
return this.$refs['manufacturerList'].getCurrentManufactureCount3()
|
|
|
},
|
|
|
- deletedata (FileName, FileUrl) {
|
|
|
+ deletedata (id) {
|
|
|
let _this = this
|
|
|
_this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
|
|
confirmButtonText: '确定',
|
|
|
cancelButtonText: '取消',
|
|
|
type: 'warning'
|
|
|
}).then(() => {
|
|
|
- this.editSubfile(FileName, FileUrl)
|
|
|
+ // this.editSubfile(FileName, FileUrl)
|
|
|
+ api.deleteFileEntity(id, _this.$axios)
|
|
|
+ .then(res => {
|
|
|
+ if (res.data.code === 0) {
|
|
|
+ _this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: res.data.message
|
|
|
+ })
|
|
|
+ this.visible = false
|
|
|
+ this.$emit('initFDatas')
|
|
|
+ this.getSupplierSceneFile()
|
|
|
+ this.$refs.refuploadattach.uploadFiles = []
|
|
|
+ } else {
|
|
|
+ _this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: res.data.message
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
}).catch(() => {
|
|
|
this.$message({
|
|
|
type: 'info',
|
|
|
@@ -1238,24 +1275,37 @@ export default {
|
|
|
manufacturerdialog () {
|
|
|
this.$refs['manufacturerList'].showDialog()
|
|
|
},
|
|
|
- imgFormat (val, index) {
|
|
|
- if (val != null && val != undefined && val != '') {
|
|
|
- let fileurlall = val.split('$')[index]
|
|
|
- let fileurl = fileurlall.split('|')
|
|
|
- if (fileurl[1] != null && fileurl[1] != '' && fileurl[1] != undefined) {
|
|
|
- let Format = fileurl[1].split('.')
|
|
|
- if (Format[1] != null && Format[1] !='' && Format[1] != undefined) {
|
|
|
- let pictureFormat = Format[1]
|
|
|
- if (pictureFormat == 'jpg' || pictureFormat == 'bmp' || pictureFormat == 'png' || pictureFormat == 'gif' || pictureFormat == 'jpeg') {
|
|
|
- return false
|
|
|
- }
|
|
|
+ // imgFormat (val, index) {
|
|
|
+ // if (val != null && val != undefined && val != '') {
|
|
|
+ // let fileurlall = val.split('$')[index]
|
|
|
+ // let fileurl = fileurlall.split('|')
|
|
|
+ // if (fileurl[1] != null && fileurl[1] != '' && fileurl[1] != undefined) {
|
|
|
+ // let Format = fileurl[1].split('.')
|
|
|
+ // if (Format[1] != null && Format[1] !='' && Format[1] != undefined) {
|
|
|
+ // let pictureFormat = Format[1]
|
|
|
+ // if (pictureFormat == 'jpg' || pictureFormat == 'bmp' || pictureFormat == 'png' || pictureFormat == 'gif' || pictureFormat == 'jpeg') {
|
|
|
+ // return false
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // return true
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ imgFormat (fileurl) {
|
|
|
+ if (fileurl != null && fileurl != undefined && fileurl != '') {
|
|
|
+ let Format = fileurl.split('.')
|
|
|
+ if (Format[1] != null && Format[1] != '' && Format[1] != undefined) {
|
|
|
+ let pictureFormat = Format[1]
|
|
|
+ if (pictureFormat == 'jpg' || pictureFormat == 'bmp' || pictureFormat == 'png' || pictureFormat == 'gif' || pictureFormat == 'jpeg') {
|
|
|
+ return true
|
|
|
}
|
|
|
}
|
|
|
- return true
|
|
|
}
|
|
|
+ return false
|
|
|
},
|
|
|
fileurlcut (val, index) {
|
|
|
- let fileurlall = val.split('$')[index]
|
|
|
+ // let fileurlall = val.split('$')[index]
|
|
|
+ let fileurlall = val
|
|
|
let fileurl = fileurlall.split('|')
|
|
|
let retUrl = fileurl[0]
|
|
|
// 内网服务器专用
|
|
|
@@ -1373,6 +1423,31 @@ export default {
|
|
|
console.error(err)
|
|
|
})
|
|
|
},
|
|
|
+ editSubfileCopy () {
|
|
|
+ let _this = this
|
|
|
+ _this.SubfileForm.SupplierId = parseInt(_this.formData.Id)
|
|
|
+ console.log(_this.SubfileForm, '2222')
|
|
|
+ _this.$axios.put('/supplier/editsubfilecopy/' + this.SubfileForm.SupplierId, _this.SubfileForm)
|
|
|
+ .then(res => {
|
|
|
+ if (res.data.code === 0) {
|
|
|
+ _this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: res.data.message
|
|
|
+ })
|
|
|
+ this.visible = false
|
|
|
+ this.$emit('initFDatas')
|
|
|
+ this.$refs.refuploadattach.uploadFiles = []
|
|
|
+ } else {
|
|
|
+ _this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: res.data.message
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
getSupplierSceneFile () {
|
|
|
if (this.formData.Id !== '') {
|
|
|
let params = {
|
|
|
@@ -1381,13 +1456,20 @@ export default {
|
|
|
this.isInvestigate = true
|
|
|
this.$axios.get('/supplier/getscenefilelist', {params}).then(res => {
|
|
|
// TODO 文件已经仅只上传一张, 还需展示描述
|
|
|
- this.scenefile = res.data.item
|
|
|
- console.log('345', this.scenefile)
|
|
|
- if (this.scenefile && this.scenefile.FileUrl && this.scenefile != null) {
|
|
|
- this.scenefileurllist = this.scenefile.FileUrl.split('$')
|
|
|
- // this.scenefileurllist.push(this.scenefile.Remark)
|
|
|
- console.log('222', this.scenefileurllist)
|
|
|
+ this.scenefileurllist = res.data.item
|
|
|
+ // this.scenefileurl = res.data.item
|
|
|
+ if (this.scenefileurllist && this.scenefileurllist.length > 0) {
|
|
|
+ this.isscenefile = true
|
|
|
+ } else {
|
|
|
+ this.isscenefile = false
|
|
|
}
|
|
|
+ console.log('345', this.scenefileurllist)
|
|
|
+ console.log('345', this.isscenefile)
|
|
|
+ // if (this.scenefile && this.scenefile.FileUrl && this.scenefile != null) {
|
|
|
+ // this.scenefileurllist = this.scenefile.FileUrl.split('$')
|
|
|
+ // this.scenefileurllist.push(this.scenefile.Remark)
|
|
|
+ // console.log('222', this.scenefileurllist)
|
|
|
+ // }
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
@@ -1399,7 +1481,8 @@ export default {
|
|
|
return
|
|
|
}
|
|
|
this.getattachissuccess()
|
|
|
- this.editSubfile('', '')
|
|
|
+ // this.editSubfile('', '')
|
|
|
+ this.editSubfileCopy()
|
|
|
return false
|
|
|
} else {
|
|
|
this.$message({
|