问题修复

This commit is contained in:
bb_pan 2025-02-25 16:55:43 +08:00
parent b8b405afe6
commit cb956732b8
5 changed files with 143 additions and 80 deletions

View File

@ -271,7 +271,7 @@ onMounted(() => {
<ArrowDown /> <ArrowDown />
</el-icon> </el-icon>
<div class="user-center"> <!-- <div class="user-center">
<div style="text-align: right"> <div style="text-align: right">
<el-button size="small" @click="onAccountManage" <el-button size="small" @click="onAccountManage"
>账号管理</el-button >账号管理</el-button
@ -284,7 +284,7 @@ onMounted(() => {
<div>登录账号{{ form.userName }}</div> <div>登录账号{{ form.userName }}</div>
</div> </div>
</div> </div>
</div> </div> -->
</a> </a>
<div class="line"></div> <div class="line"></div>

View File

@ -289,6 +289,7 @@ const nickNameNew = computed(() => {
}) })
const onJumpUser = () => { const onJumpUser = () => {
// router.push({ name: 'my-user' })
const isType: any = localStorage.getItem('rolesType') const isType: any = localStorage.getItem('rolesType')
if (isType == 3) { if (isType == 3) {
const host = window.location.origin const host = window.location.origin
@ -306,16 +307,6 @@ const onJumpUser = () => {
} else { } else {
router.push({ name: 'my-user' }) router.push({ name: 'my-user' })
} }
// const roles = store.userInfo.roles
// if (roles?.length > 0) {
// const isAdmin = roles.some((e: any) => e.roleKey == 'admin')
// if (isAdmin) {
// // window.location.href = `http://192.168.137.101:80/?token=${store.token}`
// window.open(`http://36.33.26.201:17788/glweb/login?token=${store.token}`)
// } else {
// router.push({ name: 'my-user' })
// }
// }
} }
const onClickLogin = () => { const onClickLogin = () => {
@ -416,7 +407,7 @@ onMounted(() => {
<ArrowDown /> <ArrowDown />
</el-icon> </el-icon>
<div class="user-center"> <!-- <div class="user-center">
<div style="text-align: right"> <div style="text-align: right">
<el-button size="small" @click="onAccountManage"> <el-button size="small" @click="onAccountManage">
账号管理 账号管理
@ -429,7 +420,7 @@ onMounted(() => {
<div>登录账号{{ form.userName }}</div> <div>登录账号{{ form.userName }}</div>
</div> </div>
</div> </div>
</div> </div> -->
</a> </a>
<div class="line"></div> <div class="line"></div>
</div> </div>

View File

@ -172,16 +172,15 @@
</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">
<!-- <img :src="item.fileUrl" alt="" /> -->
<el-image <el-image
style="width: 100%; height: 100%" style="width: 100%; height: 100%"
:src="item.fileUrl" :src="item.fileUrl"
@ -197,7 +196,7 @@
</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>
@ -221,7 +220,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>

View File

@ -182,9 +182,9 @@ const equipmentDeployment = () => {
examinationPdf.value = [] examinationPdf.value = []
//table //table
;(equipTableList.value = []), equipTableList.value = []
// //
(dialogFormVisibleSettlein.value = true) dialogFormVisibleSettlein.value = true
} }
const isEditForm = ref(false) const isEditForm = ref(false)
const maId: any = ref('') const maId: any = ref('')
@ -310,6 +310,13 @@ const getDetailData = async (row: any) => {
if (isEditForm.value == true) { if (isEditForm.value == true) {
if (addAndEditForm.tableList != null) { if (addAndEditForm.tableList != null) {
addAndEditForm.tableList.forEach((item: any) => { addAndEditForm.tableList.forEach((item: any) => {
console.log('🚀 ~ addAndEditForm.tableList.forEach ~ item:', item)
if (item.examinationPdf && item.examinationPdf.length > 0) {
item.examinationPdf.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,
@ -322,6 +329,7 @@ const getDetailData = async (row: any) => {
examinationPdf: item.examinationPdf, examinationPdf: item.examinationPdf,
}) })
}) })
console.log(equipTableList.value, '--->>>addAndEditForm.tableList')
} else { } else {
equipTableList.value = [ equipTableList.value = [
{ {
@ -338,8 +346,15 @@ const getDetailData = async (row: any) => {
] ]
} }
} else { } else {
console.log('详情--->?>')
if (addAndEditForm.tableList != null) { if (addAndEditForm.tableList != null) {
addAndEditForm.tableList.forEach((item: any) => { addAndEditForm.tableList.forEach((item: any) => {
if (item.examinationPdf && item.examinationPdf.length > 0) {
item.examinationPdf.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,
@ -487,7 +502,7 @@ const dialogTypeChange = async () => {
// equipmentDeploymentParams.value.deviceCount = 1 // equipmentDeploymentParams.value.deviceCount = 1
// countDisabled.value = true // countDisabled.value = true
// } // }
console.log('deviceTypeList', deviceTypeList[0].data.name) console.log('deviceTypeList', deviceTypeList[0].data)
warningDays.value = deviceTypeList[0].data.maintenanceAlarmDay warningDays.value = deviceTypeList[0].data.maintenanceAlarmDay
if (deviceTypeList[0].data.maTypeProperties == null) { if (deviceTypeList[0].data.maTypeProperties == null) {
propertyNames.value = [] propertyNames.value = []
@ -722,14 +737,14 @@ const submitFun = (type: any) => {
if (type == 3 || type == 4) { if (type == 3 || type == 4) {
// addAndEditForm.identifyCode = e.identifyCode // addAndEditForm.identifyCode = e.identifyCode
addAndEditForm.insurancePdf = e.insurancePdfs.map((e: any) => { // addAndEditForm.insurancePdf = e.insurancePdfs.map((e: any) => {
return { fileNam: e.fileName, fileUrl: e.fileUrl } // return { fileNam: e.fileName, fileUrl: e.fileUrl }
}) // })
addAndEditForm.examinationPdf = e.examinationPdfs.map((e: any) => { addAndEditForm.examinationPdf = e.examinationPdfs.map((e: any) => {
return { fileNam: e.fileName, fileUrl: e.fileUrl } return { fileNam: e.fileName, fileUrl: e.fileUrl }
}) })
} else { } else {
addAndEditForm.insurancePdfs[index] = e.insurancePdfs // addAndEditForm.insurancePdfs[index] = e.insurancePdfs
addAndEditForm.examinationPdfs[index] = e.examinationPdfs addAndEditForm.examinationPdfs[index] = e.examinationPdfs
// addAndEditForm.identifyCode.push(e.identifyCode) // addAndEditForm.identifyCode.push(e.identifyCode)
} }
@ -758,7 +773,8 @@ const submitFun = (type: any) => {
(row[key] === null || row[key] === '' || row[key]?.length === 0) && (row[key] === null || row[key] === '' || row[key]?.length === 0) &&
key !== 'name2' && key !== 'name2' &&
key !== 'name6' && key !== 'name6' &&
key !== 'id' key !== 'id' &&
key !== 'insurancePdf'
) { ) {
if (key == 'identifyCode') { if (key == 'identifyCode') {
ElMessage({ ElMessage({
@ -780,19 +796,30 @@ const submitFun = (type: any) => {
type: 'error', type: 'error',
message: `${i + 1} 行的 ${'下次检修日期'} 字段不能为空`, message: `${i + 1} 行的 ${'下次检修日期'} 字段不能为空`,
}) })
} else if (key == 'insurancePdf') {
ElMessage({
type: 'error',
message: `请上传第 ${i + 1} 行的合格证`,
})
} else {
ElMessage({
type: 'error',
message: `请上传第 ${i + 1} 行的检测证明`,
})
} }
// } else if (key == 'insurancePdf') {
// ElMessage({
// type: 'error',
// message: ` ${i + 1} `,
// })
// } else {
// ElMessage({
// type: 'error',
// message: ` ${i + 1} `,
// })
// }
return // return //
} }
console.log(row, '-->提交')
if (row.examinationPdf.length === 0) {
ElMessage({
type: 'error',
message: `请上传第 ${i + 1} 行的检测证明`,
})
return
}
} }
} }
if (isDescription) return if (isDescription) return
@ -1019,10 +1046,6 @@ const picturePreview = (file: any) => {
dialogImageUrl.value = file.fileUrl dialogImageUrl.value = file.fileUrl
dialogVisible.value = true dialogVisible.value = true
} }
//
const handleRemove = (list: any, index: Number) => {
list.splice(index, 1)
}
const onTempDownLoad = () => { const onTempDownLoad = () => {
ElMessageBox.confirm('是否确定下载', { ElMessageBox.confirm('是否确定下载', {
@ -1160,6 +1183,50 @@ const onExaminationPdfChange = (fileList: any, index: number) => {
descriptionFormList.value[index].examinationTempPdf.push(...fileListTemp) descriptionFormList.value[index].examinationTempPdf.push(...fileListTemp)
} }
//
const handlePreview = (e: any) => {
console.log('🚀 ~ handlePreview ~ handlePreview:', e.fileUrl)
//
window.open(e.fileUrl, '_blank')
}
//
const handleRemove = (file: any, row: any) => {
console.log('🚀 ~ handleRemove ~ handleRemove:', file)
if (row.id) {
const index = row.examinationPdf.findIndex((e: any) => e.fileUrl == file.fileUrl)
if (index > -1) {
row.examinationPdf.splice(index, 1)
}
} else {
const index = row.examinationPdf.findIndex((e: any) => e.fileUrl == file.response.data.url)
if (index > -1) {
row.examinationPdf.splice(index, 1)
}
}
console.log('🚀 ~ handleRemove ~ row:', row.examinationPdf)
}
//
const handleSuccess = (uploadFile: any, row: any) => {
console.log('🚀 ~ handleSuccess ~ uploadFile:', uploadFile)
if (uploadFile.code == 200) {
row.examinationPdf.push({
fileName: uploadFile.data.name,
fileUrl: uploadFile.data.url,
})
}
console.log('🚀 ~ handleSuccess ~ row:', row)
}
//
const handleExceed = () => {
ElMessage({
type: 'error',
message: '最多只能上传5个文件',
})
}
//
const onFileChangeEquip = (fileList: any, row: any, index: number, type: number) => { const onFileChangeEquip = (fileList: any, row: any, index: number, type: number) => {
const origin = window.location.origin const origin = window.location.origin
const isProd = origin.indexOf('sgwpdm.ah.sgcc.com.cn') > -1 const isProd = origin.indexOf('sgwpdm.ah.sgcc.com.cn') > -1
@ -1278,29 +1345,26 @@ const changeDate = (row: any, index: number) => {
console.log('3333', row) console.log('3333', row)
const currentDate = new Date(row.checkDate) const currentDate = new Date(row.checkDate)
console.log('1111', currentDate) console.log('1111', currentDate)
console.log('🚀 ~ 告警时间 ~ warningDays.value:', warningDays.value) // console.log('🚀 ~ ~ warningDays.value:', warningDays.value)
currentDate.setDate(currentDate.getDate() + Number(warningDays.value)) //
equipTableList.value[index].nextCheckDate = dayjs(currentDate).format('YYYY-MM-DD') const nextYearDate = dayjs(currentDate).add(1, 'year').subtract(1, 'day').toDate()
// equipTableList.value = [...equipTableList.value]; console.log('🚀 ~ changeDate ~ nextDate:', nextYearDate)
// currentDate.setDate(currentDate.getDate() + Number(warningDays.value))
equipTableList.value[index].nextCheckDate = dayjs(nextYearDate).format('YYYY-MM-DD')
} }
const getUpdateTimeBgColor = (row: any) => { //
// Date const changeNextDate = (row: any) => {
const checkDate = new Date(); if (row.checkDate && row.nextCheckDate) {
const nextCheckDate = new Date(row.nextCheckDate); if (dayjs(row.checkDate).isAfter(row.nextCheckDate)) {
ElMessage({
// type: 'error',
const diffTime = Math.abs(nextCheckDate - checkDate); message: '下次检修时间不能早于检修时间',
// })
const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24)); row.nextCheckDate = ''
}
if (checkDate < nextCheckDate && diffDays <= 30) { }
return '#FFFFCC'; // }
} else if (checkDate > nextCheckDate) {
return '#FFCCCC'; //
}
return ''; //
};
</script> </script>
<template> <template>
@ -1456,11 +1520,7 @@ const getUpdateTimeBgColor = (row: any) => {
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" prop="typeName" label="装备型号" /> <el-table-column align="center" prop="typeName" label="装备型号" />
<el-table-column align="center" prop="nextCheckDate" label="下次检验日期" > <el-table-column align="center" prop="updateTime" label="更新时间" />
<template #default="{ row }">
<span :style="{ backgroundColor: getUpdateTimeBgColor(row) }">{{ row.nextCheckDate }}</span>
</template>
</el-table-column>
<el-table-column align="center" label="装备状态"> <el-table-column align="center" label="装备状态">
<template #default="{ row }"> <template #default="{ row }">
<el-tag v-if="row.maStatus == 0" size="small" type="info">草稿状态</el-tag> <el-tag v-if="row.maStatus == 0" size="small" type="info">草稿状态</el-tag>
@ -1669,7 +1729,7 @@ const getUpdateTimeBgColor = (row: any) => {
v-model="addAndEditForm.personPhone" v-model="addAndEditForm.personPhone"
placeholder="请输入联系电话" placeholder="请输入联系电话"
clearable clearable
maxlength="20" maxlength="11"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -2089,7 +2149,7 @@ const getUpdateTimeBgColor = (row: any) => {
></el-input> ></el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <!-- <el-table-column
label="合格证" label="合格证"
prop="name2" prop="name2"
align="center" align="center"
@ -2127,7 +2187,6 @@ const getUpdateTimeBgColor = (row: any) => {
> >
</div> </div>
</UploadComponentNew> </UploadComponentNew>
<!-- <el-button size="mini" type="primary" @click="uploadTestReport(row)">上传</el-button> -->
</div> </div>
<div v-else> <div v-else>
<el-button <el-button
@ -2138,7 +2197,7 @@ const getUpdateTimeBgColor = (row: any) => {
> >
</div> </div>
</template> </template>
</el-table-column> </el-table-column> -->
<el-table-column <el-table-column
label="检修人" label="检修人"
prop="checkMan" prop="checkMan"
@ -2185,6 +2244,7 @@ const getUpdateTimeBgColor = (row: any) => {
type="date" type="date"
placeholder="请选择" placeholder="请选择"
style="width: 100%" style="width: 100%"
@change="changeNextDate(row)"
></el-date-picker> ></el-date-picker>
</template> </template>
</el-table-column> </el-table-column>
@ -2193,10 +2253,24 @@ const getUpdateTimeBgColor = (row: any) => {
label="检测证明" label="检测证明"
prop="name6" prop="name6"
align="center" align="center"
:show-overflow-tooltip="true"
> >
<template #default="{ row, $index }"> <template #default="{ row, $index }">
<div v-if="row.name6 == ''"> <el-upload
:file-list="row.examinationPdf"
class="upload-demo"
:action="uploadUrl"
:headers="headerInfo"
:before-upload="beforeUpload"
:on-preview="handlePreview"
:on-remove="(file: any) => handleRemove(file, row)"
:on-exceed="handleExceed"
:limit="5"
:on-success="(file: any) => handleSuccess(file, row)"
accept=".jpg,.png,.pdf, .doc, .docx"
>
<el-button v-if="isAdd" type="primary" size="mini">上传</el-button>
</el-upload>
<!-- <div v-if="row.name6 == ''">
<UploadComponentNew <UploadComponentNew
:maxSize="10" :maxSize="10"
:max-limit="1" :max-limit="1"
@ -2227,7 +2301,6 @@ const getUpdateTimeBgColor = (row: any) => {
> >
</div> </div>
</UploadComponentNew> </UploadComponentNew>
<!-- <el-button size="mini" type="primary" @click="uploadTestReport(row)">上传</el-button> -->
</div> </div>
<div v-else> <div v-else>
<el-button <el-button
@ -2236,7 +2309,7 @@ const getUpdateTimeBgColor = (row: any) => {
@click="viewCertificate(row.examinationPdf[0].fileUrl)" @click="viewCertificate(row.examinationPdf[0].fileUrl)"
>查看</el-button >查看</el-button
> >
</div> </div> -->
</template> </template>
</el-table-column> </el-table-column>

View File

@ -255,7 +255,7 @@
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="24"> <el-col :span="24">
<el-form-item label="1" style="margin-bottom: 0" class="upload-tip"> <el-form-item label="1" style="margin-bottom: 0" class="upload-tip">
支持格式.jpg.png 单个文件大小不能超过2M最多可上传1张 支持格式.jpg.png.pdf.doc.docx 单个文件大小不能超过5M最多可上传1个文件
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -263,7 +263,7 @@
<el-col :span="24"> <el-col :span="24">
<el-form-item label="质检附件" prop="fileInfoList"> <el-form-item label="质检附件" prop="fileInfoList">
<UploadComponentNew <UploadComponentNew
:maxSize="2" :maxSize="5"
:max-limit="1" :max-limit="1"
width="100px" width="100px"
height="100px" height="100px"
@ -273,7 +273,7 @@
:actionUrl="uploadUrl" :actionUrl="uploadUrl"
listType="picture-card" listType="picture-card"
@onFileChange="onFileChange" @onFileChange="onFileChange"
:acceptTypeList="['.jpg', '.png']" :acceptTypeList="['.jpg', '.png', '.pdf', '.doc', '.docx']"
> >
<template v-slot:default> <template v-slot:default>
<el-icon size="48" color="#aaa"><Plus /></el-icon> <el-icon size="48" color="#aaa"><Plus /></el-icon>