|
|
|
@ -9,7 +9,7 @@
|
|
|
|
<div class="dv-repair-dialog" v-loading="formLoading">
|
|
|
|
<div class="dv-repair-dialog" v-loading="formLoading">
|
|
|
|
<el-form ref="formRef" :model="formData" :rules="formRules" label-width="100px">
|
|
|
|
<el-form ref="formRef" :model="formData" :rules="formRules" label-width="100px">
|
|
|
|
<section class="dv-repair-section">
|
|
|
|
<section class="dv-repair-section">
|
|
|
|
<div class="dv-repair-section__title">基本信息</div>
|
|
|
|
<div class="dv-repair-section__title">{{ t('EquipmentManagement.DvRepair.reportInfo') }}</div>
|
|
|
|
<el-row :gutter="20">
|
|
|
|
<el-row :gutter="20">
|
|
|
|
<el-col :span="8">
|
|
|
|
<el-col :span="8">
|
|
|
|
<el-form-item :label="t('EquipmentManagement.DvRepair.repairCode')" prop="repairCode">
|
|
|
|
<el-form-item :label="t('EquipmentManagement.DvRepair.repairCode')" prop="repairCode">
|
|
|
|
@ -72,34 +72,6 @@
|
|
|
|
</el-select>
|
|
|
|
</el-select>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
|
<el-col v-if="formType !== 'create'" :span="8">
|
|
|
|
|
|
|
|
<el-form-item :label="t('EquipmentManagement.DvRepair.acceptedBy')" prop="acceptedBy">
|
|
|
|
|
|
|
|
<el-select
|
|
|
|
|
|
|
|
v-model="formData.acceptedBy"
|
|
|
|
|
|
|
|
multiple
|
|
|
|
|
|
|
|
filterable
|
|
|
|
|
|
|
|
clearable
|
|
|
|
|
|
|
|
:placeholder="t('EquipmentManagement.DvRepair.placeholderAcceptedBy')"
|
|
|
|
|
|
|
|
class="!w-full"
|
|
|
|
|
|
|
|
:disabled="isRepairMetaReadonly"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<el-option v-for="item in users" :key="String(item.id)" :label="item.nickname" :value="String(item.id)" />
|
|
|
|
|
|
|
|
</el-select>
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
<el-col v-if="formType !== 'create'" :span="8">
|
|
|
|
|
|
|
|
<el-form-item :label="t('EquipmentManagement.DvRepair.confirmBy')" prop="confirmBy">
|
|
|
|
|
|
|
|
<el-select
|
|
|
|
|
|
|
|
v-model="formData.confirmBy"
|
|
|
|
|
|
|
|
filterable
|
|
|
|
|
|
|
|
clearable
|
|
|
|
|
|
|
|
:placeholder="t('EquipmentManagement.DvRepair.placeholderConfirmBy')"
|
|
|
|
|
|
|
|
:disabled="isRepairMetaReadonly"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<el-option v-for="item in users" :key="String(item.id)" :label="item.nickname" :value="String(item.id)" />
|
|
|
|
|
|
|
|
</el-select>
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
<el-col :span="8">
|
|
|
|
<el-col :span="8">
|
|
|
|
<el-form-item :label="t('EquipmentManagement.DvRepair.status')">
|
|
|
|
<el-form-item :label="t('EquipmentManagement.DvRepair.status')">
|
|
|
|
<el-input :model-value="statusLabel" disabled />
|
|
|
|
<el-input :model-value="statusLabel" disabled />
|
|
|
|
@ -232,8 +204,38 @@
|
|
|
|
</section>
|
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
|
|
<section v-if="showRepairSection" class="dv-repair-section">
|
|
|
|
<section v-if="showRepairSection" class="dv-repair-section">
|
|
|
|
<div class="dv-repair-section__title">处理结果</div>
|
|
|
|
<div class="dv-repair-section__title-row">
|
|
|
|
|
|
|
|
<div class="dv-repair-section__title">{{ t('EquipmentManagement.DvRepair.processingResult') }}</div>
|
|
|
|
|
|
|
|
<el-select
|
|
|
|
|
|
|
|
v-if="hasRepairHistory"
|
|
|
|
|
|
|
|
v-model="selectedRepairHistoryIndex"
|
|
|
|
|
|
|
|
class="dv-repair-history-select"
|
|
|
|
|
|
|
|
@change="changeRepairHistory"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<el-option
|
|
|
|
|
|
|
|
v-for="option in repairHistoryOptions"
|
|
|
|
|
|
|
|
:key="option.value"
|
|
|
|
|
|
|
|
:value="option.value"
|
|
|
|
|
|
|
|
:label="option.label"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</el-select>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<el-row :gutter="20">
|
|
|
|
<el-row :gutter="20">
|
|
|
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
|
|
|
<el-form-item :label="t('EquipmentManagement.DvRepair.acceptedBy')" prop="acceptedBy">
|
|
|
|
|
|
|
|
<el-select
|
|
|
|
|
|
|
|
v-model="formData.acceptedBy"
|
|
|
|
|
|
|
|
multiple
|
|
|
|
|
|
|
|
filterable
|
|
|
|
|
|
|
|
clearable
|
|
|
|
|
|
|
|
:placeholder="t('EquipmentManagement.DvRepair.placeholderAcceptedBy')"
|
|
|
|
|
|
|
|
class="!w-full"
|
|
|
|
|
|
|
|
:disabled="repairFieldsDisabled"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<el-option v-for="item in users" :key="String(item.id)" :label="item.nickname" :value="String(item.id)" />
|
|
|
|
|
|
|
|
</el-select>
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="8">
|
|
|
|
<el-col :span="8">
|
|
|
|
<el-form-item :label="t('EquipmentManagement.DvRepair.repairResult')" prop="repairStatus">
|
|
|
|
<el-form-item :label="t('EquipmentManagement.DvRepair.repairResult')" prop="repairStatus">
|
|
|
|
<template #label>
|
|
|
|
<template #label>
|
|
|
|
@ -270,24 +272,6 @@
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
|
<el-col :span="8">
|
|
|
|
|
|
|
|
<el-form-item :label="t('EquipmentManagement.DvRepair.confirmDate')" prop="confirmDate">
|
|
|
|
|
|
|
|
<template #label>
|
|
|
|
|
|
|
|
<span class="dv-repair-label" :class="{ 'is-required': formType === 'repair' }">
|
|
|
|
|
|
|
|
{{ t('EquipmentManagement.DvRepair.confirmDate') }}
|
|
|
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<el-date-picker
|
|
|
|
|
|
|
|
v-model="formData.confirmDate"
|
|
|
|
|
|
|
|
type="datetime"
|
|
|
|
|
|
|
|
format="YYYY-MM-DD HH:mm:ss"
|
|
|
|
|
|
|
|
value-format="x"
|
|
|
|
|
|
|
|
:placeholder="t('EquipmentManagement.DvRepair.placeholderConfirmDate')"
|
|
|
|
|
|
|
|
class="!w-full"
|
|
|
|
|
|
|
|
:disabled="repairFieldsDisabled"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
</el-row>
|
|
|
|
</el-row>
|
|
|
|
<el-row :gutter="20">
|
|
|
|
<el-row :gutter="20">
|
|
|
|
<el-col :span="8">
|
|
|
|
<el-col :span="8">
|
|
|
|
@ -364,13 +348,37 @@
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
</el-row>
|
|
|
|
</section>
|
|
|
|
<el-row v-if="hasRepairHistory" :gutter="20">
|
|
|
|
|
|
|
|
<el-col :span="8">
|
|
|
|
<section v-if="isDetailMode && String(formData.status) === '2'" class="dv-repair-section">
|
|
|
|
<el-form-item :label="t('EquipmentManagement.DvRepair.confirmBy')">
|
|
|
|
<div class="dv-repair-section__title">{{ t('EquipmentManagement.DvRepair.rejectionInfo') }}</div>
|
|
|
|
<el-input :model-value="getUserLabel(displayedRepairHistory.confirmBy)" disabled />
|
|
|
|
<el-form-item :label="t('EquipmentManagement.DvRepair.rejectReason')">
|
|
|
|
</el-form-item>
|
|
|
|
<el-input :model-value="formData.rejectReason || '-'" type="textarea" :rows="3" disabled />
|
|
|
|
</el-col>
|
|
|
|
</el-form-item>
|
|
|
|
<el-col :span="8">
|
|
|
|
|
|
|
|
<el-form-item :label="t('EquipmentManagement.DvRepair.confirmDate')">
|
|
|
|
|
|
|
|
<el-date-picker
|
|
|
|
|
|
|
|
:model-value="toTimestamp(displayedRepairHistory.confirmDate)"
|
|
|
|
|
|
|
|
type="datetime"
|
|
|
|
|
|
|
|
format="YYYY-MM-DD HH:mm:ss"
|
|
|
|
|
|
|
|
value-format="x"
|
|
|
|
|
|
|
|
class="!w-full"
|
|
|
|
|
|
|
|
disabled
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
|
|
|
<el-form-item :label="t('EquipmentManagement.DvRepair.acceptanceResult')">
|
|
|
|
|
|
|
|
<el-input :model-value="getDocumentStatusLabel(displayedRepairHistory.status)" disabled />
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
<el-row v-if="hasRepairHistory && String(displayedRepairHistory.status) === '2'" :gutter="20">
|
|
|
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
|
|
|
<el-form-item :label="t('EquipmentManagement.DvRepair.rejectReason')">
|
|
|
|
|
|
|
|
<el-input :model-value="displayedRepairHistory.rejectReason || '-'" type="textarea" :rows="3" disabled />
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
</el-row>
|
|
|
|
</section>
|
|
|
|
</section>
|
|
|
|
|
|
|
|
|
|
|
|
<section class="dv-repair-section">
|
|
|
|
<section class="dv-repair-section">
|
|
|
|
@ -503,7 +511,7 @@
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
<script setup lang="ts">
|
|
|
|
import { DvRepairApi, DvRepairVO } from '@/api/mes/dvrepair'
|
|
|
|
import { DvRepairAcceptanceHistoryVO, DvRepairApi, DvRepairVO } from '@/api/mes/dvrepair'
|
|
|
|
import { DeviceLedgerApi, DeviceLedgerVO } from '@/api/mes/deviceledger'
|
|
|
|
import { DeviceLedgerApi, DeviceLedgerVO } from '@/api/mes/deviceledger'
|
|
|
|
import { DeviceTypeApi, DeviceTypeTreeVO } from '@/api/mes/devicetype'
|
|
|
|
import { DeviceTypeApi, DeviceTypeTreeVO } from '@/api/mes/devicetype'
|
|
|
|
import { RepairItemsApi } from '@/api/mes/repairItems'
|
|
|
|
import { RepairItemsApi } from '@/api/mes/repairItems'
|
|
|
|
@ -598,10 +606,11 @@ const currentRepairStatusValue = computed(() => {
|
|
|
|
const showRepairSection = computed(() => {
|
|
|
|
const showRepairSection = computed(() => {
|
|
|
|
if (formType.value === 'repair') return true
|
|
|
|
if (formType.value === 'repair') return true
|
|
|
|
if (formType.value === 'update') return currentStatusValue.value === '1'
|
|
|
|
if (formType.value === 'update') return currentStatusValue.value === '1'
|
|
|
|
if (formType.value === 'detail') return currentRepairStatusValue.value !== '0'
|
|
|
|
if (formType.value === 'detail') return hasRepairHistory.value || currentRepairStatusValue.value !== '0'
|
|
|
|
return false
|
|
|
|
return false
|
|
|
|
})
|
|
|
|
})
|
|
|
|
const repairFieldsDisabled = computed(() => formType.value !== 'repair')
|
|
|
|
const repairFieldsDisabled = computed(() => formType.value !== 'repair')
|
|
|
|
|
|
|
|
const documentStatusOptions = computed(() => getStrDictOptions(DICT_TYPE.EQUIPMENT_DOCUMENT_STATUS))
|
|
|
|
const submitButtonText = computed(() => {
|
|
|
|
const submitButtonText = computed(() => {
|
|
|
|
if (formType.value === 'create') return '保存'
|
|
|
|
if (formType.value === 'create') return '保存'
|
|
|
|
if (formType.value === 'repair') return '保存并提交'
|
|
|
|
if (formType.value === 'repair') return '保存并提交'
|
|
|
|
@ -609,15 +618,66 @@ const submitButtonText = computed(() => {
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
const statusLabel = computed(() => {
|
|
|
|
const statusLabel = computed(() => {
|
|
|
|
const status = formData.value.status
|
|
|
|
return getDocumentStatusLabel(formData.value.status)
|
|
|
|
if (status === '' || status === null || status === undefined) return t('EquipmentManagement.DvRepair.statusPending')
|
|
|
|
|
|
|
|
return String(status) === '1'
|
|
|
|
|
|
|
|
? t('EquipmentManagement.DvRepair.statusFinished')
|
|
|
|
|
|
|
|
: String(status) === '2'
|
|
|
|
|
|
|
|
? t('EquipmentManagement.DvRepair.statusRejected')
|
|
|
|
|
|
|
|
: t('EquipmentManagement.DvRepair.statusPending')
|
|
|
|
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const repairHistoryList = ref<DvRepairAcceptanceHistoryVO[]>([])
|
|
|
|
|
|
|
|
const selectedRepairHistoryIndex = ref<number>()
|
|
|
|
|
|
|
|
const hasRepairHistory = computed(() => repairHistoryList.value.length > 0)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const getHistoryTimestamp = (history: DvRepairAcceptanceHistoryVO) => {
|
|
|
|
|
|
|
|
const timestamp = toTimestamp(history.createTime ?? history.confirmDate ?? history.finishDate)
|
|
|
|
|
|
|
|
return timestamp === undefined ? Number.NEGATIVE_INFINITY : Number(timestamp)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const latestRepairHistoryIndex = computed(() => repairHistoryList.value.reduce((latestIndex, history, index) => {
|
|
|
|
|
|
|
|
return getHistoryTimestamp(history) >= getHistoryTimestamp(repairHistoryList.value[latestIndex]) ? index : latestIndex
|
|
|
|
|
|
|
|
}, 0))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const formatHistoryTime = (history: DvRepairAcceptanceHistoryVO) => {
|
|
|
|
|
|
|
|
const timestamp = toTimestamp(history.createTime ?? history.confirmDate ?? history.finishDate)
|
|
|
|
|
|
|
|
if (timestamp === undefined) return ''
|
|
|
|
|
|
|
|
const date = new Date(timestamp)
|
|
|
|
|
|
|
|
const pad = (value: number) => String(value).padStart(2, '0')
|
|
|
|
|
|
|
|
return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())} ${pad(date.getHours())}:${pad(date.getMinutes())}:${pad(date.getSeconds())}`
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const repairHistoryOptions = computed(() => repairHistoryList.value.map((item, index) => ({
|
|
|
|
|
|
|
|
value: index,
|
|
|
|
|
|
|
|
label: `${t('EquipmentManagement.DvRepair.historyRepairResult')} ${index + 1}${formatHistoryTime(item) ? ` · ${formatHistoryTime(item)}` : ''}`
|
|
|
|
|
|
|
|
})))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const displayedRepairHistory = computed(() => selectedRepairHistoryIndex.value === undefined
|
|
|
|
|
|
|
|
? formData.value
|
|
|
|
|
|
|
|
: repairHistoryList.value[selectedRepairHistoryIndex.value] ?? formData.value)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const getDocumentStatusLabel = (value: unknown) => {
|
|
|
|
|
|
|
|
const status = value === '' || value === null || value === undefined ? '0' : String(value)
|
|
|
|
|
|
|
|
return documentStatusOptions.value.find((item) => String(item.value) === status)?.label ?? status
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const applyRepairHistory = (source: Record<string, any>) => {
|
|
|
|
|
|
|
|
formData.value.repairResult = source.repairResult ?? ''
|
|
|
|
|
|
|
|
formData.value.repairStatus = normalizeRepairStatusValue(source.repairStatus ?? source.repairResult)
|
|
|
|
|
|
|
|
formData.value.finishDate = toTimestamp(source.finishDate)
|
|
|
|
|
|
|
|
formData.value.confirmDate = toTimestamp(source.confirmDate)
|
|
|
|
|
|
|
|
formData.value.confirmBy = normalizeUserId(source.confirmBy)
|
|
|
|
|
|
|
|
formData.value.rejectReason = source.rejectReason
|
|
|
|
|
|
|
|
formData.value.downtimeDuration = source.downtimeDuration
|
|
|
|
|
|
|
|
formData.value.faultReason = source.faultReason
|
|
|
|
|
|
|
|
formData.value.handlingMeasures = source.handlingMeasures
|
|
|
|
|
|
|
|
formData.value.replacementParts = source.replacementParts
|
|
|
|
|
|
|
|
formData.value.repairContent = source.repairContent
|
|
|
|
|
|
|
|
formData.value.repairedImages = normalizeImageString(source.repairedImages)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const changeRepairHistory = () => {
|
|
|
|
|
|
|
|
const source = selectedRepairHistoryIndex.value === undefined
|
|
|
|
|
|
|
|
? undefined
|
|
|
|
|
|
|
|
: repairHistoryList.value[selectedRepairHistoryIndex.value]
|
|
|
|
|
|
|
|
if (source) applyRepairHistory(source as Record<string, any>)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const showComponentSelect = computed(() => formData.value.machineryTypeId === 2)
|
|
|
|
const showComponentSelect = computed(() => formData.value.machineryTypeId === 2)
|
|
|
|
|
|
|
|
|
|
|
|
const selectedDeviceText = computed(() => {
|
|
|
|
const selectedDeviceText = computed(() => {
|
|
|
|
@ -695,6 +755,12 @@ const normalizeUserId = (value: any) => {
|
|
|
|
return matched ? String(matched.id) : str
|
|
|
|
return matched ? String(matched.id) : str
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const getUserLabel = (value: any) => {
|
|
|
|
|
|
|
|
const normalizedValue = normalizeUserId(value)
|
|
|
|
|
|
|
|
if (!normalizedValue) return '-'
|
|
|
|
|
|
|
|
return users.value.find((user) => String(user.id) === normalizedValue)?.nickname ?? String(value)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const splitUserIds = (value: unknown) => {
|
|
|
|
const splitUserIds = (value: unknown) => {
|
|
|
|
const values = Array.isArray(value) ? value : String(value ?? '').split(',')
|
|
|
|
const values = Array.isArray(value) ? value : String(value ?? '').split(',')
|
|
|
|
return [...new Set(values.map((item) => normalizeUserId(item)).filter(Boolean) as string[])]
|
|
|
|
return [...new Set(values.map((item) => normalizeUserId(item)).filter(Boolean) as string[])]
|
|
|
|
@ -1022,18 +1088,6 @@ const formRules = reactive({
|
|
|
|
trigger: 'change'
|
|
|
|
trigger: 'change'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
],
|
|
|
|
confirmDate: [
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
validator: (_: any, value: any, callback: any) => {
|
|
|
|
|
|
|
|
if (formType.value === 'repair' && !value) {
|
|
|
|
|
|
|
|
callback(new Error(t('EquipmentManagement.DvRepair.validatorConfirmDateRequired')))
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
callback()
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
trigger: 'change'
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
repairStatus: [
|
|
|
|
repairStatus: [
|
|
|
|
{
|
|
|
|
{
|
|
|
|
validator: (_: any, value: any, callback: any) => {
|
|
|
|
validator: (_: any, value: any, callback: any) => {
|
|
|
|
@ -1116,8 +1170,8 @@ const open = async (type: string, id?: number) => {
|
|
|
|
...createDefaultFormData(),
|
|
|
|
...createDefaultFormData(),
|
|
|
|
...detail,
|
|
|
|
...detail,
|
|
|
|
requireDate: toTimestamp(detail?.requireDate) ?? undefined,
|
|
|
|
requireDate: toTimestamp(detail?.requireDate) ?? undefined,
|
|
|
|
finishDate: detail?.finishDate ?? undefined,
|
|
|
|
finishDate: toTimestamp(detail?.finishDate) ?? undefined,
|
|
|
|
confirmDate: detail?.confirmDate ?? undefined,
|
|
|
|
confirmDate: toTimestamp(detail?.confirmDate) ?? undefined,
|
|
|
|
repairResult: detail?.repairResult ?? '',
|
|
|
|
repairResult: detail?.repairResult ?? '',
|
|
|
|
repairStatus: detail?.repairStatus === undefined || detail?.repairStatus === null || detail?.repairStatus === ''
|
|
|
|
repairStatus: detail?.repairStatus === undefined || detail?.repairStatus === null || detail?.repairStatus === ''
|
|
|
|
? normalizeRepairStatusValue(detail?.repairResult)
|
|
|
|
? normalizeRepairStatusValue(detail?.repairResult)
|
|
|
|
@ -1151,6 +1205,9 @@ const open = async (type: string, id?: number) => {
|
|
|
|
formData.value.componentId = String(formData.value.componentId)
|
|
|
|
formData.value.componentId = String(formData.value.componentId)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
repairHistoryList.value = Array.isArray(detail?.acceptanceHistoryList) ? detail.acceptanceHistoryList : []
|
|
|
|
|
|
|
|
selectedRepairHistoryIndex.value = hasRepairHistory.value ? latestRepairHistoryIndex.value : undefined
|
|
|
|
|
|
|
|
changeRepairHistory()
|
|
|
|
await nextTick()
|
|
|
|
await nextTick()
|
|
|
|
formRef.value?.clearValidate?.()
|
|
|
|
formRef.value?.clearValidate?.()
|
|
|
|
} finally {
|
|
|
|
} finally {
|
|
|
|
@ -1206,6 +1263,7 @@ const submitForm = async () => {
|
|
|
|
data.faultImages = normalizeImageString(data.faultImages)
|
|
|
|
data.faultImages = normalizeImageString(data.faultImages)
|
|
|
|
data.repairedImages = normalizeImageString(data.repairedImages)
|
|
|
|
data.repairedImages = normalizeImageString(data.repairedImages)
|
|
|
|
data.repairResult = data.repairStatus
|
|
|
|
data.repairResult = data.repairStatus
|
|
|
|
|
|
|
|
delete data.acceptanceHistoryList
|
|
|
|
const requireDate = toTimestamp(data.requireDate)
|
|
|
|
const requireDate = toTimestamp(data.requireDate)
|
|
|
|
|
|
|
|
|
|
|
|
if (formType.value === 'repair' && requireDate === undefined) {
|
|
|
|
if (formType.value === 'repair' && requireDate === undefined) {
|
|
|
|
@ -1214,7 +1272,7 @@ const submitForm = async () => {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (formType.value === 'repair') {
|
|
|
|
if (formType.value === 'repair') {
|
|
|
|
data.status = '1'
|
|
|
|
data.status = '3'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (formData.value.deviceId != null && formData.value.deviceId !== '') {
|
|
|
|
if (formData.value.deviceId != null && formData.value.deviceId !== '') {
|
|
|
|
data.machineryId = formData.value.deviceId
|
|
|
|
data.machineryId = formData.value.deviceId
|
|
|
|
@ -1226,11 +1284,10 @@ const submitForm = async () => {
|
|
|
|
if (formType.value === 'repair') {
|
|
|
|
if (formType.value === 'repair') {
|
|
|
|
await DvRepairApi.updateDvRepairStatus({
|
|
|
|
await DvRepairApi.updateDvRepairStatus({
|
|
|
|
id: data.id,
|
|
|
|
id: data.id,
|
|
|
|
|
|
|
|
status: '3',
|
|
|
|
requireDate,
|
|
|
|
requireDate,
|
|
|
|
acceptedBy: data.acceptedBy,
|
|
|
|
acceptedBy: data.acceptedBy,
|
|
|
|
confirmBy: data.confirmBy,
|
|
|
|
|
|
|
|
finishDate: data.finishDate,
|
|
|
|
finishDate: data.finishDate,
|
|
|
|
confirmDate: data.confirmDate,
|
|
|
|
|
|
|
|
repairStatus: data.repairStatus,
|
|
|
|
repairStatus: data.repairStatus,
|
|
|
|
repairResult: data.repairResult,
|
|
|
|
repairResult: data.repairResult,
|
|
|
|
faultLevel: data.faultLevel,
|
|
|
|
faultLevel: data.faultLevel,
|
|
|
|
@ -1267,6 +1324,8 @@ const submitForm = async () => {
|
|
|
|
|
|
|
|
|
|
|
|
const resetForm = () => {
|
|
|
|
const resetForm = () => {
|
|
|
|
formData.value = createDefaultFormData()
|
|
|
|
formData.value = createDefaultFormData()
|
|
|
|
|
|
|
|
repairHistoryList.value = []
|
|
|
|
|
|
|
|
selectedRepairHistoryIndex.value = undefined
|
|
|
|
deviceOptionsLoaded.value = false
|
|
|
|
deviceOptionsLoaded.value = false
|
|
|
|
componentOptions.value = []
|
|
|
|
componentOptions.value = []
|
|
|
|
formRef.value?.resetFields()
|
|
|
|
formRef.value?.resetFields()
|
|
|
|
@ -1331,6 +1390,22 @@ const resetForm = () => {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.dv-repair-section__title-row {
|
|
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
|
|
gap: 12px;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.dv-repair-section__title {
|
|
|
|
|
|
|
|
margin-bottom: 16px;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.dv-repair-history-select {
|
|
|
|
|
|
|
|
width: 260px;
|
|
|
|
|
|
|
|
margin-bottom: 16px;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.dv-repair-label {
|
|
|
|
.dv-repair-label {
|
|
|
|
display: inline-flex;
|
|
|
|
display: inline-flex;
|
|
|
|
gap: 4px;
|
|
|
|
gap: 4px;
|
|
|
|
|