bug修复

This commit is contained in:
hongchao 2024-12-20 19:20:29 +08:00
parent 1decab330c
commit 9b4d32420f
1 changed files with 13 additions and 5 deletions

View File

@ -13,6 +13,7 @@ import { useStore } from 'store/user'
const store = useStore() const store = useStore()
import { mainStore } from 'store/main' import { mainStore } from 'store/main'
import { InfoFilled, UploadFilled } from '@element-plus/icons-vue' import { InfoFilled, UploadFilled } from '@element-plus/icons-vue'
import dayjs from 'dayjs';
const store2 = mainStore() const store2 = mainStore()
const isViewForm = ref(false) const isViewForm = ref(false)
@ -245,6 +246,7 @@ const getDetailData = async (row: any) => {
examinationPdf, examinationPdf,
devInfoProperties, devInfoProperties,
tableList, tableList,
maintenanceAlarmDay,
} = res } = res
Object.assign(addAndEditForm, { Object.assign(addAndEditForm, {
@ -268,6 +270,7 @@ const getDetailData = async (row: any) => {
examinationPdf, examinationPdf,
devInfoProperties, devInfoProperties,
tableList, tableList,
maintenanceAlarmDay,
}) })
if (settleinTitle.value == '装备编辑') { if (settleinTitle.value == '装备编辑') {
@ -288,7 +291,9 @@ const getDetailData = async (row: any) => {
descriptionFormList.value[0].examinationPdfs = examinationPdf descriptionFormList.value[0].examinationPdfs = examinationPdf
options.value = [] options.value = []
addAndEditForm.deviceTypeList = getSelectId(deviceTypeTree.value, addAndEditForm.typeId) addAndEditForm.deviceTypeList = getSelectId(deviceTypeTree.value, addAndEditForm.typeId)
warningDays.value = addAndEditForm.deviceTypeList.maintenanceAlarmDay warningDays.value = addAndEditForm.maintenanceAlarmDay
// warningDays.value = addAndEditForm.deviceTypeList[addAndEditForm.deviceTypeList.length-1].data.maintenanceAlarmDay
// warningDays.value = addAndEditForm.deviceTypeList.maintenanceAlarmDay
propertyNames.value = addAndEditForm.devInfoProperties propertyNames.value = addAndEditForm.devInfoProperties
equipTableList.value = []; equipTableList.value = [];
if(isEditForm.value == true){ if(isEditForm.value == true){
@ -317,6 +322,7 @@ const getDetailData = async (row: any) => {
examinationPdf: [], examinationPdf: [],
}] }]
} }
addAndEditForm.id = addAndEditForm.tableList[0].id
}else{ }else{
if(addAndEditForm.tableList!=null){ if(addAndEditForm.tableList!=null){
addAndEditForm.tableList.forEach((item:any) =>{ addAndEditForm.tableList.forEach((item:any) =>{
@ -1021,6 +1027,7 @@ const addAndEditForm = reactive<any>({
examinationPdfs: [], examinationPdfs: [],
devInfoProperties: [], devInfoProperties: [],
tableList: [], tableList: [],
id:'',
}) })
// const addAndEditFormTemp = reactive<any>() // const addAndEditFormTemp = reactive<any>()
const uploadUrl = import.meta.env.VITE_API_URL + '/file/upload' const uploadUrl = import.meta.env.VITE_API_URL + '/file/upload'
@ -1198,10 +1205,11 @@ const viewCertificate = (url:string) => {
}; };
const changeDate = (row:any,index:number) => { const changeDate = (row:any,index:number) => {
const currentDate = new Date(row.checkDate); const currentDate = new Date(row.checkDate);
currentDate.setDate(currentDate.getDate() + warningDays.value);
console.log('1111',currentDate) console.log('1111',currentDate)
equipTableList.value[index].nextCheckDate = currentDate.toISOString().split('T')[0]; console.log('2222',warningDays.value)
equipTableList.value = [...equipTableList.value]; currentDate.setDate(currentDate.getDate() + warningDays.value);
equipTableList.value[index].nextCheckDate = dayjs(currentDate).format('YYYY-MM-DD');
// equipTableList.value = [...equipTableList.value];
} }
</script> </script>
@ -2104,7 +2112,7 @@ const changeDate = (row:any,index:number) => {
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" width="150px" > <el-table-column label="操作" align="center" width="150px" v-if="settleinTitle=='新增装备'">
<template #default="{row,$index}"> <template #default="{row,$index}">
<div <div
style=" style="