问题优化
This commit is contained in:
parent
ad64f17c1a
commit
f5c4e82a1d
|
|
@ -172,17 +172,41 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="appearance">
|
<div class="appearance">
|
||||||
<!-- <div class="publicTitle">证书展示</div> -->
|
<div class="publicTitle">证书展示</div>
|
||||||
<!-- <div class="certificate"> -->
|
<div class="certificate">
|
||||||
<!-- <el-row>
|
<el-row>
|
||||||
<el-col :span="2">
|
<el-col :span="2">
|
||||||
<div>合格证:</div>
|
<div>合格证:</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="22">
|
<el-col :span="22">
|
||||||
<div class="prove-container">
|
<div class="prove-container">
|
||||||
<div v-for="item in pageData.insurancePdf" :key="item.id">
|
<div v-for="item in pageData.insurancePdf" :key="item.id">
|
||||||
|
<a
|
||||||
|
v-if="item.fileUrl.includes('.pdf')"
|
||||||
|
:href="item.fileUrl"
|
||||||
|
target="_blank"
|
||||||
|
>
|
||||||
|
<img
|
||||||
|
style="width: 100px; height: 100px"
|
||||||
|
src="@/assets/img/pdf.png"
|
||||||
|
/>
|
||||||
|
</a>
|
||||||
|
<a
|
||||||
|
v-else-if="
|
||||||
|
item.fileUrl.includes('.doc') ||
|
||||||
|
item.fileUrl.includes('.docx')
|
||||||
|
"
|
||||||
|
:href="item.fileUrl"
|
||||||
|
target="_blank"
|
||||||
|
>
|
||||||
|
<img
|
||||||
|
style="width: 100px; height: 100px"
|
||||||
|
src="@/assets/img/word.png"
|
||||||
|
/>
|
||||||
|
</a>
|
||||||
<el-image
|
<el-image
|
||||||
style="width: 100%; height: 100%"
|
v-else
|
||||||
|
style="width: 100px; height: 100px"
|
||||||
:src="item.fileUrl"
|
:src="item.fileUrl"
|
||||||
:zoom-rate="1.2"
|
:zoom-rate="1.2"
|
||||||
:max-scale="7"
|
:max-scale="7"
|
||||||
|
|
@ -196,8 +220,8 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row> -->
|
</el-row>
|
||||||
<!-- <el-row>
|
<!-- <el-row>
|
||||||
<el-col :span="2">
|
<el-col :span="2">
|
||||||
<div>检测证明:</div>
|
<div>检测证明:</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
@ -220,7 +244,7 @@
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row> -->
|
</el-row> -->
|
||||||
<!-- </div> -->
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="appearance">
|
<div class="appearance">
|
||||||
<div class="publicTitle">检测记录</div>
|
<div class="publicTitle">检测记录</div>
|
||||||
|
|
@ -1551,8 +1575,8 @@ onMounted(() => {
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
|
|
||||||
div {
|
div {
|
||||||
width: calc((100% - 30px) / 3);
|
/* width: calc((100% - 30px) / 3);
|
||||||
height: 200px;
|
height: 200px; */
|
||||||
margin: 0 15px 15px 0;
|
margin: 0 15px 15px 0;
|
||||||
|
|
||||||
&:nth-child(3n) {
|
&:nth-child(3n) {
|
||||||
|
|
|
||||||
|
|
@ -317,6 +317,12 @@ const getDetailData = async (row: any) => {
|
||||||
e.name = e.fileName
|
e.name = e.fileName
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
if (item.insurancePdf && item.insurancePdf.length > 0) {
|
||||||
|
item.insurancePdf.forEach((e: any) => {
|
||||||
|
e.url = e.fileUrl
|
||||||
|
e.name = e.fileName
|
||||||
|
})
|
||||||
|
}
|
||||||
equipTableList.value.push({
|
equipTableList.value.push({
|
||||||
id: item.id,
|
id: item.id,
|
||||||
identifyCode: item.identifyCode,
|
identifyCode: item.identifyCode,
|
||||||
|
|
@ -355,6 +361,12 @@ const getDetailData = async (row: any) => {
|
||||||
e.name = e.fileName
|
e.name = e.fileName
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
if (item.insurancePdf && item.insurancePdf.length > 0) {
|
||||||
|
item.insurancePdf.forEach((e: any) => {
|
||||||
|
e.url = e.fileUrl
|
||||||
|
e.name = e.fileName
|
||||||
|
})
|
||||||
|
}
|
||||||
equipTableList.value.push({
|
equipTableList.value.push({
|
||||||
id: item.id,
|
id: item.id,
|
||||||
identifyCode: item.identifyCode,
|
identifyCode: item.identifyCode,
|
||||||
|
|
@ -1189,24 +1201,42 @@ const handlePreview = (e: any) => {
|
||||||
window.open(e.fileUrl, '_blank')
|
window.open(e.fileUrl, '_blank')
|
||||||
}
|
}
|
||||||
// 删除附件
|
// 删除附件
|
||||||
const handleRemove = (file: any, row: any) => {
|
const handleRemove = (file: any, row: any, type: Number) => {
|
||||||
console.log('🚀 ~ handleRemove ~ handleRemove:', file)
|
console.log('🚀 ~ handleRemove ~ handleRemove:', file)
|
||||||
|
|
||||||
if (row.id) {
|
if (row.id) {
|
||||||
const index = row.examinationPdf.findIndex((e: any) => e.fileUrl == file.fileUrl)
|
if (type == 1) {
|
||||||
if (index > -1) {
|
const index = row.examinationPdf.findIndex((e: any) => e.fileUrl == file.fileUrl)
|
||||||
row.examinationPdf.splice(index, 1)
|
if (index > -1) {
|
||||||
|
row.examinationPdf.splice(index, 1)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
const index = row.insurancePdf.findIndex((e: any) => e.fileUrl == file.fileUrl)
|
||||||
|
if (index > -1) {
|
||||||
|
row.insurancePdf.splice(index, 1)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const index = row.examinationPdf.findIndex((e: any) => e.fileUrl == file.response.data.url)
|
if (type == 1) {
|
||||||
if (index > -1) {
|
const index = row.examinationPdf.findIndex(
|
||||||
row.examinationPdf.splice(index, 1)
|
(e: any) => e.fileUrl == file.response.data.url,
|
||||||
|
)
|
||||||
|
if (index > -1) {
|
||||||
|
row.examinationPdf.splice(index, 1)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
const index = row.insurancePdf.findIndex(
|
||||||
|
(e: any) => e.fileUrl == file.response.data.url,
|
||||||
|
)
|
||||||
|
if (index > -1) {
|
||||||
|
row.insurancePdf.splice(index, 1)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log('🚀 ~ handleRemove ~ row:', row.examinationPdf)
|
console.log('🚀 ~ handleRemove ~ row:', row.examinationPdf)
|
||||||
}
|
}
|
||||||
// 上传附件
|
// 上传附件
|
||||||
const handleSuccess = (uploadFile: any, row: any) => {
|
const handleSuccess = (uploadFile: any, row: any, type: Number) => {
|
||||||
console.log('🚀 ~ handleSuccess ~ uploadFile:', uploadFile)
|
console.log('🚀 ~ handleSuccess ~ uploadFile:', uploadFile)
|
||||||
if (uploadFile.code == 200) {
|
if (uploadFile.code == 200) {
|
||||||
let fileUrl = ''
|
let fileUrl = ''
|
||||||
|
|
@ -1219,10 +1249,17 @@ const handleSuccess = (uploadFile: any, row: any) => {
|
||||||
fileUrl = 'http://sgwpdm.ah.sgcc.com.cn/iws/ahbns/' + uploadFile.data.url // 宏源-测试环境
|
fileUrl = 'http://sgwpdm.ah.sgcc.com.cn/iws/ahbns/' + uploadFile.data.url // 宏源-测试环境
|
||||||
}
|
}
|
||||||
console.log('输出fileUrl----------', fileUrl)
|
console.log('输出fileUrl----------', fileUrl)
|
||||||
row.examinationPdf.push({
|
if (type == 1) {
|
||||||
fileName: uploadFile.data.name,
|
row.examinationPdf.push({
|
||||||
fileUrl: fileUrl,
|
fileName: uploadFile.data.name,
|
||||||
})
|
fileUrl: fileUrl,
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
row.insurancePdf.push({
|
||||||
|
fileName: uploadFile.data.name,
|
||||||
|
fileUrl: fileUrl,
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
console.log('🚀 ~ handleSuccess ~ row:', row)
|
console.log('🚀 ~ handleSuccess ~ row:', row)
|
||||||
}
|
}
|
||||||
|
|
@ -2258,11 +2295,27 @@ const changeNextDate = (row: any) => {
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column
|
<el-table-column label="合格证" prop="name2" align="center">
|
||||||
label="检测证明"
|
<template #default="{ row, $index }">
|
||||||
prop="name6"
|
<el-upload
|
||||||
align="center"
|
:file-list="row.insurancePdf"
|
||||||
>
|
class="upload-demo"
|
||||||
|
:action="uploadUrl"
|
||||||
|
:headers="headerInfo"
|
||||||
|
:before-upload="beforeUpload"
|
||||||
|
:on-preview="handlePreview"
|
||||||
|
:on-remove="(file: any) => handleRemove(file, row, 2)"
|
||||||
|
:on-exceed="handleExceed"
|
||||||
|
:limit="5"
|
||||||
|
:on-success="(file: any) => handleSuccess(file, row, 2)"
|
||||||
|
accept=".jpg,.png,.pdf, .doc, .docx"
|
||||||
|
>
|
||||||
|
<el-button v-if="isAdd" type="primary" size="mini">上传</el-button>
|
||||||
|
</el-upload>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column label="检测证明" prop="name6" align="center">
|
||||||
<template #default="{ row, $index }">
|
<template #default="{ row, $index }">
|
||||||
<el-upload
|
<el-upload
|
||||||
:file-list="row.examinationPdf"
|
:file-list="row.examinationPdf"
|
||||||
|
|
@ -2271,10 +2324,10 @@ const changeNextDate = (row: any) => {
|
||||||
:headers="headerInfo"
|
:headers="headerInfo"
|
||||||
:before-upload="beforeUpload"
|
:before-upload="beforeUpload"
|
||||||
:on-preview="handlePreview"
|
:on-preview="handlePreview"
|
||||||
:on-remove="(file: any) => handleRemove(file, row)"
|
:on-remove="(file: any) => handleRemove(file, row, 1)"
|
||||||
:on-exceed="handleExceed"
|
:on-exceed="handleExceed"
|
||||||
:limit="5"
|
:limit="5"
|
||||||
:on-success="(file: any) => handleSuccess(file, row)"
|
:on-success="(file: any) => handleSuccess(file, row, 1)"
|
||||||
accept=".jpg,.png,.pdf, .doc, .docx"
|
accept=".jpg,.png,.pdf, .doc, .docx"
|
||||||
>
|
>
|
||||||
<el-button v-if="isAdd" type="primary" size="mini">上传</el-button>
|
<el-button v-if="isAdd" type="primary" size="mini">上传</el-button>
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import { useRouter } from 'vue-router'
|
||||||
import { useStore } from '../../store/user'
|
import { useStore } from '../../store/user'
|
||||||
import { useRoute } from 'vue-router'
|
import { useRoute } from 'vue-router'
|
||||||
|
|
||||||
const store = useStore()
|
const store: any = useStore()
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
|
|
||||||
|
|
@ -12,10 +12,27 @@ import imgSrc from '@/assets/img/logo.png'
|
||||||
import { el } from 'element-plus/es/locale'
|
import { el } from 'element-plus/es/locale'
|
||||||
|
|
||||||
const handleSelect = (name: any, path: any) => {
|
const handleSelect = (name: any, path: any) => {
|
||||||
store.editcurrentMenuItem(name)
|
console.log('🚀 ~ handleSelect ~ name:', name)
|
||||||
router.push({
|
console.log('🚀 ~ handleSelect ~ store.token:', store.token)
|
||||||
name,
|
if (name == 'admin') {
|
||||||
})
|
// const host = window.location.origin
|
||||||
|
|
||||||
|
// if (host.indexOf('sgwpdm.ah.sgcc.com.cn') > -1) {
|
||||||
|
// window.open(`${host}/iws/glweb/login?token@${store.token}@`)
|
||||||
|
// } else {
|
||||||
|
// // window.open(`${host}/glweb/?token@${store.token}@`)
|
||||||
|
// if (import.meta.env.VITE_ENV === 'production') {
|
||||||
|
// window.open(`${host}/glweb/?token@${store.token}@`)
|
||||||
|
// } else {
|
||||||
|
// window.open(`${host}/iws/glweb/?token@${store.token}@`)
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
} else {
|
||||||
|
store.editcurrentMenuItem(name)
|
||||||
|
router.push({
|
||||||
|
name,
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const isType: any = computed(() => {
|
const isType: any = computed(() => {
|
||||||
|
|
@ -36,26 +53,33 @@ const lessorMenus: MenuItem[] = [
|
||||||
{ title: '接单管理', name: 'accept-orders', permission: ['1'] },
|
{ title: '接单管理', name: 'accept-orders', permission: ['1'] },
|
||||||
{ title: '质检管理', name: 'quality-manage', permission: ['1'] },
|
{ title: '质检管理', name: 'quality-manage', permission: ['1'] },
|
||||||
{ title: '合同管理', name: 'contract-manage', permission: ['1'] },
|
{ title: '合同管理', name: 'contract-manage', permission: ['1'] },
|
||||||
|
// { title: '后台管理', name: 'admin', permission: ['1'] },
|
||||||
]
|
]
|
||||||
// 按角色分组定义菜单---承租方
|
// 按角色分组定义菜单---承租方
|
||||||
const lesseeMenus: MenuItem[] = [
|
const lesseeMenus: MenuItem[] = [
|
||||||
{ title: '需求管理', name: 'sourcingNeed', permission: ['2'] },
|
{ title: '需求管理', name: 'sourcingNeed', permission: ['2'] },
|
||||||
{ title: '租赁订单', name: 'orderManagement', permission: ['2'] },
|
{ title: '租赁订单', name: 'orderManagement', permission: ['2'] },
|
||||||
{ title: '收货地址管理', name: 'address-manage', permission: ['2'] },
|
{ title: '收货地址管理', name: 'address-manage', permission: ['2'] },
|
||||||
|
// { title: '后台管理', name: 'admin', permission: ['2'] },
|
||||||
]
|
]
|
||||||
|
|
||||||
// 合并所有菜单项
|
// 合并所有菜单项
|
||||||
const allList: MenuItem[] = [...lessorMenus, ...lesseeMenus]
|
const allList: MenuItem[] = [...lessorMenus, ...lesseeMenus]
|
||||||
const rolesType = ref(localStorage.getItem('rolesTypeName') || '出租方')
|
const rolesType: any = ref('')
|
||||||
|
if (localStorage.getItem('rolesTypeName')) {
|
||||||
|
rolesType.value = localStorage.getItem('rolesTypeName')
|
||||||
|
} else {
|
||||||
|
rolesType.value = '承租方'
|
||||||
|
}
|
||||||
const menuList: any = computed(() => {
|
const menuList: any = computed(() => {
|
||||||
if (rolesType.value == '承租方') return allList.filter((e) => e.permission.includes('2'))
|
return rolesType.value == '承租方'
|
||||||
if (rolesType.value == '出租方') return allList.filter((e) => e.permission.includes('1'))
|
? allList.filter((e) => e.permission.includes('2'))
|
||||||
|
: allList.filter((e) => e.permission.includes('1'))
|
||||||
})
|
})
|
||||||
|
|
||||||
const activeItem = computed(() => {
|
const activeItem = computed(() => {
|
||||||
// return 'sourcingNeed'
|
if (rolesType.value == '出租方') {
|
||||||
if (store.currentMenuItem) {
|
return 'goodsManagement'
|
||||||
return store.currentMenuItem
|
|
||||||
} else {
|
} else {
|
||||||
return 'sourcingNeed'
|
return 'sourcingNeed'
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue