|
|
|
|
@ -125,7 +125,7 @@
|
|
|
|
|
<view v-else-if="currentTab === 2">
|
|
|
|
|
<view v-if="repairLoading" class="hint">{{ t('functionCommon.loading') }}</view>
|
|
|
|
|
<view v-else-if="!repairRecords.length" class="hint">{{ t('moldLedger.noRepair') }}</view>
|
|
|
|
|
<view v-for="row in repairRecords" :key="row.key" class="record-card">
|
|
|
|
|
<view v-for="row in repairRecords" :key="row.key" class="record-card" @click="openRepairDetail(row)">
|
|
|
|
|
<view class="record-head">
|
|
|
|
|
<text class="record-title">{{ detailValue(row.repairCode || row.subjectName || row.repairName) }}</text>
|
|
|
|
|
<text class="result-badge" :class="`result-${row.resultType}`">{{ row.resultLabel }}</text>
|
|
|
|
|
@ -138,7 +138,7 @@
|
|
|
|
|
detailValue(row.finishDateLabel) }}</text></view>
|
|
|
|
|
<view class="record-row"><text class="record-label">{{ t('moldLedger.remark') }}</text><text class="record-value">{{
|
|
|
|
|
detailValue(row.remark) }}</text></view>
|
|
|
|
|
<view v-if="row.images.length" class="history-images">
|
|
|
|
|
<view v-if="row.images.length" class="history-images" @click.stop>
|
|
|
|
|
<image v-for="img in row.images" :key="img" class="history-image" :src="img" mode="aspectFill"
|
|
|
|
|
@click="previewImages(row.images, img)" />
|
|
|
|
|
</view>
|
|
|
|
|
@ -206,10 +206,10 @@ import {
|
|
|
|
|
getMoldBrandDetail,
|
|
|
|
|
getMoldInspectionByMoldId,
|
|
|
|
|
getMoldMaintenanceByMoldId,
|
|
|
|
|
getMoldPage,
|
|
|
|
|
getMoldRepairListByMoldId
|
|
|
|
|
getMoldPage
|
|
|
|
|
} from '@/api/mes/mold'
|
|
|
|
|
import { getMoldOperatePage } from '@/api/mes/moldoperate'
|
|
|
|
|
import { getMoldRepairList } from '@/api/mes/moldrepair'
|
|
|
|
|
import { DICT_TYPE, getDictLabel, initAllDict } from '@/utils/dict'
|
|
|
|
|
|
|
|
|
|
const { t } = useI18n()
|
|
|
|
|
@ -245,7 +245,7 @@ const childMoldCount = computed(() => childMolds.value.length || detailData.valu
|
|
|
|
|
const statusLabel = computed(() => getDictLabel(DICT_TYPE.ERP_MOLD_STATUS, detailData.value?.status, detailValue(detailData.value?.status)))
|
|
|
|
|
const statusTagType = computed(() => {
|
|
|
|
|
const label = String(statusLabel.value || '')
|
|
|
|
|
if (label.includes('正常') || label.includes('使用')) return 'success'
|
|
|
|
|
if (label.includes('正常') || label.includes('使用') || label.includes('在机') || label.includes('在库')) return 'success'
|
|
|
|
|
if (label.includes('维修') || label.includes('警')) return 'warning'
|
|
|
|
|
if (label.includes('报废') || label.includes('停')) return 'error'
|
|
|
|
|
return 'primary'
|
|
|
|
|
@ -278,14 +278,14 @@ const maintainGroups = computed(() =>
|
|
|
|
|
const repairRecords = computed(() => {
|
|
|
|
|
const rows = Array.isArray(repairList.value) ? repairList.value : []
|
|
|
|
|
return rows.map((row, index) => {
|
|
|
|
|
const resultMeta = formatRepairResult(row?.repairResult !== undefined ? row.repairResult : row?.result)
|
|
|
|
|
const resultMeta = formatRepairResult(row?.repairResult ?? row?.repairStatus ?? row?.result)
|
|
|
|
|
return {
|
|
|
|
|
...row,
|
|
|
|
|
key: String(row?.id ?? row?.repairCode ?? index),
|
|
|
|
|
finishDateLabel: formatDateTime(row?.finishDate || row?.createTime),
|
|
|
|
|
resultLabel: resultMeta.label,
|
|
|
|
|
resultType: resultMeta.type,
|
|
|
|
|
images: parseImages(row?.malfunctionUrl || row?.malfunctionImages || row?.images)
|
|
|
|
|
images: parseImages(row?.malfunctionUrl || row?.malfunctionImages || row?.images || row?.faultImages)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
@ -384,7 +384,7 @@ async function fetchRepairRecords() {
|
|
|
|
|
if (!brandId.value) return
|
|
|
|
|
repairLoading.value = true
|
|
|
|
|
try {
|
|
|
|
|
const res = await getMoldRepairListByMoldId(brandId.value)
|
|
|
|
|
const res = await getMoldRepairList({ moldId: brandId.value })
|
|
|
|
|
repairList.value = normalizeListData(res)
|
|
|
|
|
} catch (e) {
|
|
|
|
|
repairList.value = []
|
|
|
|
|
@ -467,7 +467,7 @@ function moldTypeText(type) {
|
|
|
|
|
|
|
|
|
|
function statusTextClass(status) {
|
|
|
|
|
const label = moldStatusText(status)
|
|
|
|
|
if (label.includes('正常') || label.includes('使用')) return 'text-success'
|
|
|
|
|
if (label.includes('正常') || label.includes('使用') || label.includes('在机') || label.includes('在库')) return 'text-success'
|
|
|
|
|
if (label.includes('维修') || label.includes('警')) return 'text-warning'
|
|
|
|
|
if (label.includes('报废') || label.includes('停')) return 'text-danger'
|
|
|
|
|
return 'text-default'
|
|
|
|
|
@ -583,6 +583,17 @@ function previewImages(list, current) {
|
|
|
|
|
if (!list || !list.length) return
|
|
|
|
|
uni.previewImage({ urls: list, current })
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function openRepairDetail(row) {
|
|
|
|
|
const id = row?.id
|
|
|
|
|
if (id === undefined || id === null || id === '') {
|
|
|
|
|
uni.showToast({ title: t('moldRepair.noId'), icon: 'none' })
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
uni.navigateTo({
|
|
|
|
|
url: `/pages_function/pages/moldRepair/form?mode=detail&id=${encodeURIComponent(String(id))}`
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
|