bug修复

This commit is contained in:
hongchao 2024-12-20 20:19:21 +08:00
parent 9b4d32420f
commit 031102bec8
4 changed files with 57 additions and 15 deletions

View File

@ -0,0 +1,7 @@
import { get, post } from '../../index'
// 合同列表
export const getListApi = (data: any = {}) => {
return get('/material-mall/notice/list', data)
}

View File

@ -1,11 +1,25 @@
<script setup lang="ts">
import NavMenu from 'components/Navmenu/index.vue'
import {
getListApi, //
} from 'http/api/info'
const leaseList = ref([
{
orderCode: '202303221234567890',
leaseName: '张三',
noticeContent: '',
createTime: '',
}])
const getList = async () => {
leaseList.value = []
const { data: res }: any = await getListApi()
leaseList.value = res.rows
}
onMounted(() => {
getList()
})
</script>
<template>
@ -19,8 +33,8 @@ const leaseList = ref([
:header-cell-style="{ background: '#00a288', color: '#fff' }"
>
<el-table-column align="center" type="index" label="序号" width="80" />
<el-table-column align="center" prop="orderCode" label="消息发布时间" />
<el-table-column align="center" prop="leaseName" label="消息内容" />
<el-table-column align="center" prop="createTime" label="消息发布时间" />
<el-table-column align="center" prop="noticeContent" label="消息内容" />
</el-table>

View File

@ -300,6 +300,7 @@ const getDetailData = async (row: any) => {
if(addAndEditForm.tableList!=null){
addAndEditForm.tableList.forEach((item:any) =>{
equipTableList.value.push({
id:item.id,
identifyCode: item.identifyCode,
name2: item.insurancePdf[0].fileUrl,
checkMan: item.checkMan,
@ -312,6 +313,7 @@ const getDetailData = async (row: any) => {
})
}else{
equipTableList.value = [{
id:'',
identifyCode: '',
name2: '',
checkMan: '',
@ -322,11 +324,11 @@ const getDetailData = async (row: any) => {
examinationPdf: [],
}]
}
addAndEditForm.id = addAndEditForm.tableList[0].id
}else{
if(addAndEditForm.tableList!=null){
addAndEditForm.tableList.forEach((item:any) =>{
equipTableList.value.push({
id:item.id,
identifyCode: item.identifyCode,
name2: item.insurancePdf[0].fileUrl,
checkMan: item.checkMan,
@ -493,6 +495,7 @@ const dialogTypeChange = async () => {
addAndEditFormRef.value.clearValidate(['unitName', 'dayLeasePrice'])
equipTableList.value = []
equipTableList.value.push({
id: '',
identifyCode: '',
name2: '',
checkMan: '',
@ -729,7 +732,7 @@ const submitFun = (type: any) => {
for (let i = 0; i < addAndEditForm.tableList.length; i++) {
const row = addAndEditForm.tableList[i];
for (const key in row) {
if (row.hasOwnProperty(key) && (row[key] === null || row[key] === '' || row[key].length ===0) && key !== 'name2' && key !== 'name6') {
if (row.hasOwnProperty(key) && (row[key] === null || row[key] === '' || row[key].length ===0) && key !== 'name2' && key !== 'name6'&& key !== 'id') {
if(key=='identifyCode'){
ElMessage({
type: 'error',
@ -1027,7 +1030,6 @@ const addAndEditForm = reactive<any>({
examinationPdfs: [],
devInfoProperties: [],
tableList: [],
id:'',
})
// const addAndEditFormTemp = reactive<any>()
const uploadUrl = import.meta.env.VITE_API_URL + '/file/upload'

View File

@ -217,10 +217,11 @@
<el-form-item label="质检日期" prop="qcTime">
<el-date-picker
clearable
type="date"
type="datetime"
style="width: 100%"
value-format="YYYY-MM-DD"
value-format="YYYY-MM-DD hh:mm:ss"
v-model="addOrEditForm.qcTime"
@change="onQcChange"
placeholder="请选择质检日期"
/>
</el-form-item>
@ -229,13 +230,13 @@
<el-row :gutter="20">
<el-col :span="24">
<el-form-item label="下次质检日期" prop="nextQcTime">
<el-form-item label="下次质检日期" prop="nextCheckTime">
<el-date-picker
clearable
type="date"
type="datetime"
style="width: 100%"
value-format="YYYY-MM-DD"
v-model="addOrEditForm.nextQcTime"
value-format="YYYY-MM-DD hh:mm:ss"
v-model="addOrEditForm.nextCheckTime"
placeholder="请选择下次质检日期"
/>
</el-form-item>
@ -417,6 +418,7 @@ import {
} from 'http/api/quality-manage'
import { InfoFilled } from '@element-plus/icons-vue'
import { ElMessage } from 'element-plus'
import dayjs from 'dayjs';
const total = ref(0)
const totalInDialog = ref(0)
@ -463,6 +465,7 @@ const addOrEditForm = ref<any>({
qcName: '',
qcUser: '',
qcTime: '',
nextCheckTime: '',
fileInfoList: [],
fileInfoTempList: [],
})
@ -486,7 +489,7 @@ const checkMaxNum = (rule: any, value: any, callback: any) => {
const addOrEditFormRules = reactive({
maId: [{ required: true, message: '请选择关联装备', trigger: 'change' }],
nextQcTime: [{ required: true, message: '请输入下次质检日期', trigger: 'blur' }],
nextCheckTime: [{ required: true, message: '请输入下次质检日期', trigger: 'blur' }],
qcUser: [{ required: true, message: '请输入质检员', trigger: 'change' }],
qcTime: [{ required: true, message: '请选择质检日期', trigger: 'change' }],
fileInfoList: [{ required: true, message: '请上传质检附件', trigger: 'blur' }],
@ -634,9 +637,25 @@ const onFileChange = (fileList: any) => {
addOrEditForm.value.fileInfoTempList.push(...fileListTemp)
}
const warningDays: any = ref(0)
const onChange = (value: any) => {
console.log('11111',value)
addOrEditForm.value.qcTime = ''
addOrEditForm.value.nextQcTime = ''
addOrEditForm.value.nextCheckTime = ''
console.log('11111111',associationList)
associationList.value.forEach((e: any) => {
if (e.maId === value) {
console.log('11111111',e.maintenanceAlarmDay)
warningDays.value = Number(e.maintenanceAlarmDay)
}
})
}
const onQcChange = (value: any) => {
const currentDate = new Date(value);
currentDate.setDate(currentDate.getDate() + warningDays.value);
addOrEditForm.value.nextCheckTime = dayjs(currentDate).format('YYYY-MM-DD hh:mm:ss');
}
//