diff --git a/src/api/mes/moldrepair.js b/src/api/mes/moldrepair.js index 17192cc..cdd9e93 100644 --- a/src/api/mes/moldrepair.js +++ b/src/api/mes/moldrepair.js @@ -9,6 +9,14 @@ export function getMoldRepairPage(params = {}) { }) } +export function getMoldRepairList(params = {}) { + return request({ + url: '/admin-api/mes/mold-repair/list', + method: 'get', + params + }) +} + export function getMoldRepair(id) { return request({ url: '/admin-api/mes/mold-repair/get', @@ -64,4 +72,4 @@ export function uploadRepairImage(filePath, name = 'file') { filePath, showLoading: false }) -} \ No newline at end of file +} diff --git a/src/locales/en-US.js b/src/locales/en-US.js index 6e9cec3..5d64671 100644 --- a/src/locales/en-US.js +++ b/src/locales/en-US.js @@ -1302,6 +1302,8 @@ export default { mold: 'Mold', moldCode: 'Mold Code', moldName: 'Mold Name', + specModel: 'Spec Model', + brand: 'Brand', faultLevel: 'Fault Level', isShutdown: 'Is Shutdown', status: 'Status', @@ -1328,6 +1330,8 @@ export default { statusPending: 'Pending', statusPassed: 'Passed', statusRejected: 'Rejected', + orderStatusPending: 'Pending', + orderStatusDone: 'Completed', placeholderRepairCode: 'Enter repair code', placeholderRepairName: 'Enter repair name', placeholderRequireDate: 'Select require date', diff --git a/src/locales/zh-CN.js b/src/locales/zh-CN.js index 763491f..a071b2f 100644 --- a/src/locales/zh-CN.js +++ b/src/locales/zh-CN.js @@ -1305,6 +1305,8 @@ export default { mold: '模具', moldCode: '模具编码', moldName: '模具名称', + specModel: '规格型号', + brand: '品牌', faultLevel: '故障等级', isShutdown: '是否停机', status: '单据状态', @@ -1331,6 +1333,8 @@ export default { statusPending: '待维修', statusPassed: '通过', statusRejected: '不通过', + orderStatusPending: '待处理', + orderStatusDone: '已完成', placeholderRepairCode: '请输入维修单编号', placeholderRepairName: '请输入维修单名称', placeholderRequireDate: '请选择报修日期', diff --git a/src/pages_function/pages/moldLedger/detail.vue b/src/pages_function/pages/moldLedger/detail.vue index 595bab7..6c8f18b 100644 --- a/src/pages_function/pages/moldLedger/detail.vue +++ b/src/pages_function/pages/moldLedger/detail.vue @@ -125,7 +125,7 @@ {{ t('functionCommon.loading') }} {{ t('moldLedger.noRepair') }} - + {{ detailValue(row.repairCode || row.subjectName || row.repairName) }} {{ row.resultLabel }} @@ -138,7 +138,7 @@ detailValue(row.finishDateLabel) }} {{ t('moldLedger.remark') }}{{ detailValue(row.remark) }} - + @@ -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))}` + }) +}