This commit is contained in:
parent
987388f71b
commit
03b92f97e7
|
|
@ -234,6 +234,13 @@
|
||||||
<!-- 文件格式下载,图片格式预览 -->
|
<!-- 文件格式下载,图片格式预览 -->
|
||||||
<div slot="file" slot-scope="{ file }">
|
<div slot="file" slot-scope="{ file }">
|
||||||
<img
|
<img
|
||||||
|
v-if="isPdf(file)"
|
||||||
|
class="el-upload-list__item-thumbnail"
|
||||||
|
src="@/assets/images/pdf.png"
|
||||||
|
alt=""
|
||||||
|
/>
|
||||||
|
<img
|
||||||
|
v-else
|
||||||
class="el-upload-list__item-thumbnail"
|
class="el-upload-list__item-thumbnail"
|
||||||
:src="file.url"
|
:src="file.url"
|
||||||
alt=""
|
alt=""
|
||||||
|
|
@ -689,6 +696,11 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
isPdf(file) {
|
||||||
|
const url = file.response ? file.response.data.url : file.url.replaceAll('#', '%23')
|
||||||
|
if (!url) return false
|
||||||
|
return url.toLowerCase().includes('.pdf')
|
||||||
|
},
|
||||||
/** 获取分公司下拉 */
|
/** 获取分公司下拉 */
|
||||||
async getImpUnitOptions() {
|
async getImpUnitOptions() {
|
||||||
try {
|
try {
|
||||||
|
|
@ -1570,6 +1582,10 @@ export default {
|
||||||
console.log("xxxxxxxxxxxx",file)
|
console.log("xxxxxxxxxxxx",file)
|
||||||
this.dialogImageUrl =file.response ? file.response.data.url : file.url.replaceAll('#', '%23')
|
this.dialogImageUrl =file.response ? file.response.data.url : file.url.replaceAll('#', '%23')
|
||||||
console.log("zzzzzzzzzz",this.dialogImageUrl)
|
console.log("zzzzzzzzzz",this.dialogImageUrl)
|
||||||
|
if (this.isPdf(file)) {
|
||||||
|
window.open(this.dialogImageUrl, '_blank')
|
||||||
|
return
|
||||||
|
}
|
||||||
// const parts = file.name ? file.name:file.url.split('.')
|
// const parts = file.name ? file.name:file.url.split('.')
|
||||||
// console.log("yyyyyyyyy",parts)
|
// console.log("yyyyyyyyy",parts)
|
||||||
// const extension = parts?.pop()
|
// const extension = parts?.pop()
|
||||||
|
|
|
||||||
|
|
@ -175,7 +175,8 @@
|
||||||
>
|
>
|
||||||
<!-- 文件格式下载,图片格式预览 -->
|
<!-- 文件格式下载,图片格式预览 -->
|
||||||
<div slot="file" slot-scope="{ file }">
|
<div slot="file" slot-scope="{ file }">
|
||||||
<img class="el-upload-list__item-thumbnail" :src="file.url" alt="" />
|
<img v-if="isPdf(file)" class="el-upload-list__item-thumbnail" src="@/assets/images/pdf.png" alt="" />
|
||||||
|
<img v-else class="el-upload-list__item-thumbnail" :src="file.url" alt="" />
|
||||||
|
|
||||||
<span class="el-upload-list__item-actions">
|
<span class="el-upload-list__item-actions">
|
||||||
<span class="el-upload-list__item-preview" @click="picturePreviewFbs(file)">
|
<span class="el-upload-list__item-preview" @click="picturePreviewFbs(file)">
|
||||||
|
|
@ -599,6 +600,11 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
isPdf(file) {
|
||||||
|
const url = file.response ? file.response.data.url : file.url.replaceAll('#', '%23')
|
||||||
|
if (!url) return false
|
||||||
|
return url.toLowerCase().includes('.pdf')
|
||||||
|
},
|
||||||
// 查询
|
// 查询
|
||||||
handleQuery() {
|
handleQuery() {
|
||||||
// 重置分页到第一页
|
// 重置分页到第一页
|
||||||
|
|
@ -730,12 +736,12 @@ export default {
|
||||||
isTeamSelected(teamName) {
|
isTeamSelected(teamName) {
|
||||||
// 如果转出班组已选择,且当前遍历的转入班组的 teamName 与选中的转出班组的 teamName 相同,则禁用
|
// 如果转出班组已选择,且当前遍历的转入班组的 teamName 与选中的转出班组的 teamName 相同,则禁用
|
||||||
if (this.maForm.backTeamId) {
|
if (this.maForm.backTeamId) {
|
||||||
const selectedBackTeam = this.uniteList.find(item => item.id === this.maForm.backTeamId);
|
const selectedBackTeam = this.uniteList.find(item => item.id === this.maForm.backTeamId)
|
||||||
if (selectedBackTeam && selectedBackTeam.teamName === teamName) {
|
if (selectedBackTeam && selectedBackTeam.teamName === teamName) {
|
||||||
return true; // 禁用相同的班组
|
return true // 禁用相同的班组
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false; // 不禁用
|
return false // 不禁用
|
||||||
},
|
},
|
||||||
// 获取物资类型
|
// 获取物资类型
|
||||||
async getMaTypeOpt() {
|
async getMaTypeOpt() {
|
||||||
|
|
@ -837,11 +843,11 @@ export default {
|
||||||
if (!val) return
|
if (!val) return
|
||||||
this.maForm.backTeamName = this.uniteList.find(item => item.id === val).teamName
|
this.maForm.backTeamName = this.uniteList.find(item => item.id === val).teamName
|
||||||
// 清空转入班组内容
|
// 清空转入班组内容
|
||||||
this.maForm.leaseTeamName = '';
|
this.maForm.leaseTeamName = ''
|
||||||
this.getAgreementId()
|
this.getAgreementId()
|
||||||
},
|
},
|
||||||
projectChange(val) {
|
projectChange(val) {
|
||||||
this.maForm.backTeamId=undefined;
|
this.maForm.backTeamId = undefined
|
||||||
const obj = this.projectList.find(item => item.proId === val)
|
const obj = this.projectList.find(item => item.proId === val)
|
||||||
console.log('🚀 ~ projectChange ~ obj:', obj)
|
console.log('🚀 ~ projectChange ~ obj:', obj)
|
||||||
if (!val) {
|
if (!val) {
|
||||||
|
|
@ -1303,6 +1309,10 @@ export default {
|
||||||
console.log('xxxxxxxxxxxx', file)
|
console.log('xxxxxxxxxxxx', file)
|
||||||
this.dialogImageUrl = file.response ? file.response.data.url : file.url.replaceAll('#', '%23')
|
this.dialogImageUrl = file.response ? file.response.data.url : file.url.replaceAll('#', '%23')
|
||||||
console.log('zzzzzzzzzz', this.dialogImageUrl)
|
console.log('zzzzzzzzzz', this.dialogImageUrl)
|
||||||
|
if (this.isPdf(file)) {
|
||||||
|
window.open(this.dialogImageUrl, '_blank')
|
||||||
|
return
|
||||||
|
}
|
||||||
// const parts = file.name ? file.name:file.url.split('.')
|
// const parts = file.name ? file.name:file.url.split('.')
|
||||||
// console.log("yyyyyyyyy",parts)
|
// console.log("yyyyyyyyy",parts)
|
||||||
// const extension = parts?.pop()
|
// const extension = parts?.pop()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue