问题清单修复

This commit is contained in:
BianLzhaoMin 2024-12-17 15:55:18 +08:00
parent 84e1008311
commit 560e324e6c
3 changed files with 143 additions and 29 deletions

23
components.d.ts vendored
View File

@ -9,12 +9,35 @@ declare module 'vue' {
export interface GlobalComponents { export interface GlobalComponents {
Breadcrumb: typeof import('./src/components/Breadcrumb/index.vue')['default'] Breadcrumb: typeof import('./src/components/Breadcrumb/index.vue')['default']
ElBadge: typeof import('element-plus/es')['ElBadge'] ElBadge: typeof import('element-plus/es')['ElBadge']
ElBreadcrumb: typeof import('element-plus/es')['ElBreadcrumb']
ElBreadcrumbItem: typeof import('element-plus/es')['ElBreadcrumbItem']
ElButton: typeof import('element-plus/es')['ElButton'] ElButton: typeof import('element-plus/es')['ElButton']
ElCarousel: typeof import('element-plus/es')['ElCarousel'] ElCarousel: typeof import('element-plus/es')['ElCarousel']
ElCarouselItem: typeof import('element-plus/es')['ElCarouselItem'] ElCarouselItem: typeof import('element-plus/es')['ElCarouselItem']
ElCascader: typeof import('element-plus/es')['ElCascader']
ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
ElCol: typeof import('element-plus/es')['ElCol']
ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider'] ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
ElDatePicker: typeof import('element-plus/es')['ElDatePicker']
ElDialog: typeof import('element-plus/es')['ElDialog']
ElForm: typeof import('element-plus/es')['ElForm']
ElFormItem: typeof import('element-plus/es')['ElFormItem']
ElIcon: typeof import('element-plus/es')['ElIcon'] ElIcon: typeof import('element-plus/es')['ElIcon']
ElImage: typeof import('element-plus/es')['ElImage'] ElImage: typeof import('element-plus/es')['ElImage']
ElInput: typeof import('element-plus/es')['ElInput']
ElMenu: typeof import('element-plus/es')['ElMenu']
ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
ElOption: typeof import('element-plus/es')['ElOption']
ElPagination: typeof import('element-plus/es')['ElPagination']
ElProgress: typeof import('element-plus/es')['ElProgress']
ElRow: typeof import('element-plus/es')['ElRow']
ElSelect: typeof import('element-plus/es')['ElSelect']
ElStep: typeof import('element-plus/es')['ElStep']
ElSteps: typeof import('element-plus/es')['ElSteps']
ElTable: typeof import('element-plus/es')['ElTable']
ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
ElTag: typeof import('element-plus/es')['ElTag']
ElUpload: typeof import('element-plus/es')['ElUpload']
Empty: typeof import('./src/components/Empty/index.vue')['default'] Empty: typeof import('./src/components/Empty/index.vue')['default']
EquipCard: typeof import('./src/components/equipCard.vue')['default'] EquipCard: typeof import('./src/components/equipCard.vue')['default']
EquipCardHall: typeof import('./src/components/equipCardHall/index.vue')['default'] EquipCardHall: typeof import('./src/components/equipCardHall/index.vue')['default']

View File

@ -128,7 +128,7 @@
<el-table-column align="center" label="附件" width="160"> <el-table-column align="center" label="附件" width="160">
<template #default="{ row }"> <template #default="{ row }">
<el-button type="primary" size="small" @click="onViewFileImg(row, 0)" <el-button type="primary" size="small" @click="onViewFileImg(row, 0)"
>查看99</el-button >查看</el-button
> >
</template> </template>
</el-table-column> </el-table-column>

View File

@ -103,12 +103,11 @@
<el-table-column align="center" label="维修附件"> <el-table-column align="center" label="维修附件">
<template #default="scope"> <template #default="scope">
<UploadComponentNew <UploadComponentNew
v-if="scope.row.isEdit" v-if="scope.row.isEdit && scope.row.repairInfoList.length == 0"
:currentIndex="scope.$index" :currentIndex="scope.$index"
listType="text"
:maxSize="2" :maxSize="2"
:minLimit="0" :minLimit="0"
width="100px"
height="100px"
:max-limit="4" :max-limit="4"
:multiple="true" :multiple="true"
:autoUpload="true" :autoUpload="true"
@ -122,6 +121,17 @@
</el-button> </el-button>
</template> </template>
</UploadComponentNew> </UploadComponentNew>
<template v-else>
<a
target="_blank"
:href="item.fileUrl"
:key="item.fileUrl"
v-for="item in scope.row.repairInfoList"
>
{{ item.fileName }}
</a>
</template>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="报废费用"> <el-table-column align="center" label="报废费用">
@ -136,12 +146,11 @@
<el-table-column align="center" label="报废附件"> <el-table-column align="center" label="报废附件">
<template #default="scope"> <template #default="scope">
<UploadComponentNew <UploadComponentNew
v-if="scope.row.isEdit" v-if="scope.row.isEdit && scope.row.scrapInfoList.length == 0"
:currentIndex="scope.$index" :currentIndex="scope.$index"
listType="text"
:maxSize="2" :maxSize="2"
:minLimit="0" :minLimit="0"
width="100px"
height="100px"
:max-limit="4" :max-limit="4"
:multiple="true" :multiple="true"
:autoUpload="true" :autoUpload="true"
@ -155,6 +164,17 @@
</el-button> </el-button>
</template> </template>
</UploadComponentNew> </UploadComponentNew>
<template v-else>
<a
target="_blank"
:href="item.fileUrl"
:key="item.fileUrl"
v-for="item in scope.row.scrapInfoList"
>
{{ item.fileName }}
</a>
</template>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="丢失费用"> <el-table-column align="center" label="丢失费用">
@ -170,12 +190,11 @@
<el-table-column align="center" label="丢失附件"> <el-table-column align="center" label="丢失附件">
<template #default="scope"> <template #default="scope">
<UploadComponentNew <UploadComponentNew
v-if="scope.row.isEdit" v-if="scope.row.isEdit && scope.row.lossInfoList.length == 0"
:currentIndex="scope.$index" :currentIndex="scope.$index"
listType="text"
:maxSize="2" :maxSize="2"
:minLimit="0" :minLimit="0"
width="100px"
height="100px"
:max-limit="4" :max-limit="4"
:multiple="true" :multiple="true"
:autoUpload="true" :autoUpload="true"
@ -189,6 +208,17 @@
</el-button> </el-button>
</template> </template>
</UploadComponentNew> </UploadComponentNew>
<template v-else>
<a
target="_blank"
:href="item.fileUrl"
:key="item.fileUrl"
v-for="item in scope.row.lossInfoList"
>
{{ item.fileName }}
</a>
</template>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="操作"> <el-table-column align="center" label="操作">
@ -632,9 +662,7 @@
<el-table-column prop="repairPrice" align="center" label="维修费用(元)" /> <el-table-column prop="repairPrice" align="center" label="维修费用(元)" />
<el-table-column align="center" label="附件" width="160"> <el-table-column align="center" label="附件" width="160">
<template #default="{ row }"> <template #default="{ row }">
<el-button type="primary" @click="onViewFileImg(row, 0)"> <el-button type="primary" @click="onViewFileImg(row, 0)"> 查看 </el-button>
查看---
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -1019,24 +1047,81 @@ const getOrderDetailsData = async () => {
props.type == 1 ? (dialogTitle.value = '退租检修') : (dialogTitle.value = '检修明细') props.type == 1 ? (dialogTitle.value = '退租检修') : (dialogTitle.value = '检修明细')
if (props.type === 1) { if (props.type === 1) {
const { data: res }: any = await getOrderDetailsByIdApi({ getOrderDetailsByIdApi({
orderId: props.orderId, orderId: props.orderId,
// maId: props.maId, // maId: props.maId,
}) }).then(async (res: any) => {
orderDetails.value = res.data
orderDetails.value.detailsList = orderDetails.value.detailsList.map((e: any) => {
return {
...e,
isEdit: false,
repairPrice: 0,
scrapPrice: 0,
lossPrice: 0,
repairInfoList: [],
scrapInfoList: [],
lossInfoList: [],
}
})
orderDetails.value = res const { data: result }: any = await getOverhaulApi(props.orderId)
orderDetails.value.detailsList = orderDetails.value.detailsList.map((e: any) => {
return { const { repairRecordList, scrapRecordList, lossRecordList, fileInfoList } = result
...e,
isEdit: false, if (repairRecordList.length > 0) {
repairPrice: '', repairRecordList.forEach((e: any) => {
scrapPrice: '', orderDetails.value.detailsList.forEach((j: any) => {
lossPrice: '', if (e.maId == j.maId) {
repairInfoList: [], j.repairPrice = e.repairPrice
scrapInfoList: [], j.isEdit = true
lossInfoList: [], }
})
})
}
if (scrapRecordList.length > 0) {
scrapRecordList.forEach((e: any) => {
orderDetails.value.detailsList.forEach((j: any) => {
if (e.maId == j.maId) {
j.scrapPrice = e.scrapPrice
j.isEdit = true
}
})
})
}
if (lossRecordList.length > 0) {
lossRecordList.forEach((e: any) => {
orderDetails.value.detailsList.forEach((j: any) => {
if (e.maId == j.maId) {
j.lossPrice = e.lossPrice
j.isEdit = true
}
})
})
}
if (fileInfoList.length > 0) {
fileInfoList.forEach((e: any) => {
orderDetails.value.detailsList.forEach((j: any) => {
if (e.modelId == j.maId && e.fileType == 0) {
j.repairInfoList.push(e)
}
if (e.modelId == j.maId && e.fileType == 1) {
j.scrapInfoList.push(e)
}
if (e.modelId == j.maId && e.fileType == 2) {
j.lossInfoList.push(e)
}
})
})
} }
}) })
// overhaulDetails.value = res
// fileListAll.value = res.fileInfoList
// lossRecordList.value = res.lossRecordList
// scrapRecordList.value = res.scrapRecordList
// repairRecordList.value = res.repairRecordList
// orderDetails.value = res // orderDetails.value = res
// repairSelect.value = JSON.parse(JSON.stringify(res.detailsList)).filter( // repairSelect.value = JSON.parse(JSON.stringify(res.detailsList)).filter(
// (e: any) => e.orderStatus == 5, // (e: any) => e.orderStatus == 5,
@ -1236,7 +1321,7 @@ const onRepairFileChange = (fileList: any, index: number) => {
taskType: 19, taskType: 19,
fileUrl: e.url, fileUrl: e.url,
fileName: e.name, fileName: e.name,
modelId: orderDetails.value.detailsList[index].modelId, modelId: orderDetails.value.detailsList[index].maId,
// modelId: repairFormList.value[index].maId, // modelId: repairFormList.value[index].maId,
} }
}) })
@ -1254,7 +1339,7 @@ const onScrapFileChange = (fileList: any, index: number) => {
taskType: 19, taskType: 19,
fileUrl: e.url, fileUrl: e.url,
fileName: e.name, fileName: e.name,
modelId: orderDetails.value.detailsList[index].modelId, modelId: orderDetails.value.detailsList[index].maId,
// modelId: scrapFormList.value[index].maId, // modelId: scrapFormList.value[index].maId,
} }
}) })
@ -1272,7 +1357,7 @@ const onLossFileChange = (fileList: any, index: number) => {
fileUrl: e.url, fileUrl: e.url,
fileName: e.name, fileName: e.name,
// modelId: lossFormList.value[index].maId, // modelId: lossFormList.value[index].maId,
modelId: orderDetails.value.detailsList[index].modelId, modelId: orderDetails.value.detailsList[index].maId,
} }
}) })
// lossFormRefList.value[index].clearValidate('fileInfoList') // lossFormRefList.value[index].clearValidate('fileInfoList')
@ -1320,6 +1405,12 @@ const handleSelectionChange = (list: any) => {
const onEditDeviceInfo = (row: any) => { const onEditDeviceInfo = (row: any) => {
row.isEdit = !row.isEdit row.isEdit = !row.isEdit
if (!row.isEdit) {
row.repairPrice = 0
row.scrapPrice = 0
row.lossPrice = 0
}
} }
watch( watch(