diff --git a/src/locales/en-US.js b/src/locales/en-US.js index 46cfad2..5899d53 100644 --- a/src/locales/en-US.js +++ b/src/locales/en-US.js @@ -907,6 +907,8 @@ export default { repairedImages: 'Post-repair Images', remark: 'Remark', autoCode: 'Auto Generate', + deviceLabel: 'Equipment', + reportTimeLabel: 'Report Time', searchPlaceholder: 'Enter order no. or equipment code', empty: 'No repair records', statusPending: 'Pending Repair', diff --git a/src/locales/zh-CN.js b/src/locales/zh-CN.js index a9e7adb..9a8cafd 100644 --- a/src/locales/zh-CN.js +++ b/src/locales/zh-CN.js @@ -907,6 +907,8 @@ export default { repairedImages: '维修后图片', remark: '备注', autoCode: '自动生成', + deviceLabel: '设备', + reportTimeLabel: '报修时间', searchPlaceholder: '请输入单号或设备编码', empty: '暂无维修记录', statusPending: '待维修', diff --git a/src/pages_function/pages/equipmentMaintenance/index.vue b/src/pages_function/pages/equipmentMaintenance/index.vue index 585e53d..4943ba0 100644 --- a/src/pages_function/pages/equipmentMaintenance/index.vue +++ b/src/pages_function/pages/equipmentMaintenance/index.vue @@ -46,14 +46,14 @@ {{ textValue(item.repairCode) }} - - - {{ getRepairStatusText(item.repairStatus) }} - + {{ getRepairStatusText(item.repairStatus) }} - {{ textValue(item.machineryName) }} - - {{ textValue(item.machineryCode) }} + + {{ t('equipmentMaintenance.deviceLabel') }} + {{ formatEquipmentDisplay(item) }} + + + {{ t('equipmentMaintenance.reportTimeLabel') }} {{ formatDateValue(item.requireDate || item.createTime) }} @@ -345,6 +345,13 @@ function getRepairStatusTextClass(value) { return 'text-warning' } +function getRepairStatusTagClass(value) { + const normalized = value === '' || value === null || value === undefined ? '0' : String(value) + if (normalized === '1') return 'tag-success' + if (normalized === '2') return 'tag-danger' + return 'tag-warning' +} + function getRepairStatusDotClass(value) { const normalized = value === '' || value === null || value === undefined ? '0' : String(value) if (normalized === '1') return 'dot-success' @@ -378,6 +385,15 @@ function normalizeDate(value) { return null } +function formatEquipmentDisplay(item) { + const name = String(item?.machineryName ?? '').trim() + const code = String(item?.machineryCode ?? '').trim() + if (name && code) return `${name}-${code}` + if (name) return name + if (code) return code + return '-' +} + function textValue(value) { if (value === 0) return '0' if (value === null || value === undefined) return '-' @@ -497,6 +513,14 @@ function textValue(value) { gap: 12rpx; } +.repair-status-tag { + padding: 8rpx 18rpx; + border-radius: 999rpx; + font-size: 24rpx; + font-weight: 600; + line-height: 1.2; +} + .status-dot { width: 16rpx; height: 16rpx; @@ -508,6 +532,28 @@ function textValue(value) { font-weight: 600; } +.equipment-row { + display: flex; + align-items: center; + justify-content: space-between; + gap: 20rpx; + margin-top: 14rpx; +} + +.equipment-label { + font-size: 28rpx; + color: #9ca3af; + font-weight: 600; + flex-shrink: 0; +} + +.equipment-value { + flex: 1; + text-align: right; + font-size: 30rpx; + color: #9ca3af; +} + .text-warning { color: #f97316; } @@ -532,15 +578,24 @@ function textValue(value) { background: #dc2626; } -.repair-name { - display: block; - margin-top: 14rpx; - font-size: 30rpx; - color: #9ca3af; +.tag-warning { + color: #c2410c; + background: #ffedd5; +} + +.tag-success { + color: #15803d; + background: #dcfce7; +} + +.tag-danger { + color: #dc2626; + background: #fee2e2; } .card-bottom { margin-top: 18rpx; + justify-content: flex-end; } .repair-device-code,