style:设备维修列表-样式优化

besure_bit
黄伟杰 2 months ago
parent 7602ee9df0
commit aa71195250

@ -907,6 +907,8 @@ export default {
repairedImages: 'Post-repair Images', repairedImages: 'Post-repair Images',
remark: 'Remark', remark: 'Remark',
autoCode: 'Auto Generate', autoCode: 'Auto Generate',
deviceLabel: 'Equipment',
reportTimeLabel: 'Report Time',
searchPlaceholder: 'Enter order no. or equipment code', searchPlaceholder: 'Enter order no. or equipment code',
empty: 'No repair records', empty: 'No repair records',
statusPending: 'Pending Repair', statusPending: 'Pending Repair',

@ -907,6 +907,8 @@ export default {
repairedImages: '维修后图片', repairedImages: '维修后图片',
remark: '备注', remark: '备注',
autoCode: '自动生成', autoCode: '自动生成',
deviceLabel: '设备',
reportTimeLabel: '报修时间',
searchPlaceholder: '请输入单号或设备编码', searchPlaceholder: '请输入单号或设备编码',
empty: '暂无维修记录', empty: '暂无维修记录',
statusPending: '待维修', statusPending: '待维修',

@ -46,14 +46,14 @@
<view class="card-main"> <view class="card-main">
<view class="card-top"> <view class="card-top">
<text class="repair-code">{{ textValue(item.repairCode) }}</text> <text class="repair-code">{{ textValue(item.repairCode) }}</text>
<view class="repair-status-wrap"> <view :class="['repair-status-tag', getRepairStatusTagClass(item.repairStatus)]">{{ getRepairStatusText(item.repairStatus) }}</view>
<text :class="['status-dot', getRepairStatusDotClass(item.repairStatus)]"></text>
<text :class="['repair-status-text', getRepairStatusTextClass(item.repairStatus)]">{{ getRepairStatusText(item.repairStatus) }}</text>
</view>
</view> </view>
<text class="repair-name">{{ textValue(item.machineryName) }}</text> <view class="equipment-row">
<view class="card-bottom"> <text class="equipment-label">{{ t('equipmentMaintenance.deviceLabel') }}</text>
<text class="repair-device-code">{{ textValue(item.machineryCode) }}</text> <text class="equipment-value">{{ formatEquipmentDisplay(item) }}</text>
</view>
<view class="equipment-row">
<text class="equipment-label">{{ t('equipmentMaintenance.reportTimeLabel') }}</text>
<text class="repair-date">{{ formatDateValue(item.requireDate || item.createTime) }}</text> <text class="repair-date">{{ formatDateValue(item.requireDate || item.createTime) }}</text>
</view> </view>
</view> </view>
@ -345,6 +345,13 @@ function getRepairStatusTextClass(value) {
return 'text-warning' 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) { function getRepairStatusDotClass(value) {
const normalized = value === '' || value === null || value === undefined ? '0' : String(value) const normalized = value === '' || value === null || value === undefined ? '0' : String(value)
if (normalized === '1') return 'dot-success' if (normalized === '1') return 'dot-success'
@ -378,6 +385,15 @@ function normalizeDate(value) {
return null 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) { function textValue(value) {
if (value === 0) return '0' if (value === 0) return '0'
if (value === null || value === undefined) return '-' if (value === null || value === undefined) return '-'
@ -497,6 +513,14 @@ function textValue(value) {
gap: 12rpx; gap: 12rpx;
} }
.repair-status-tag {
padding: 8rpx 18rpx;
border-radius: 999rpx;
font-size: 24rpx;
font-weight: 600;
line-height: 1.2;
}
.status-dot { .status-dot {
width: 16rpx; width: 16rpx;
height: 16rpx; height: 16rpx;
@ -508,6 +532,28 @@ function textValue(value) {
font-weight: 600; 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 { .text-warning {
color: #f97316; color: #f97316;
} }
@ -532,15 +578,24 @@ function textValue(value) {
background: #dc2626; background: #dc2626;
} }
.repair-name { .tag-warning {
display: block; color: #c2410c;
margin-top: 14rpx; background: #ffedd5;
font-size: 30rpx; }
color: #9ca3af;
.tag-success {
color: #15803d;
background: #dcfce7;
}
.tag-danger {
color: #dc2626;
background: #fee2e2;
} }
.card-bottom { .card-bottom {
margin-top: 18rpx; margin-top: 18rpx;
justify-content: flex-end;
} }
.repair-device-code, .repair-device-code,

Loading…
Cancel
Save