|
|
|
|
@ -46,14 +46,14 @@
|
|
|
|
|
<view class="card-main">
|
|
|
|
|
<view class="card-top">
|
|
|
|
|
<text class="repair-code">{{ textValue(item.repairCode) }}</text>
|
|
|
|
|
<view class="repair-status-wrap">
|
|
|
|
|
<text :class="['status-dot', getRepairStatusDotClass(item.repairStatus)]"></text>
|
|
|
|
|
<text :class="['repair-status-text', getRepairStatusTextClass(item.repairStatus)]">{{ getRepairStatusText(item.repairStatus) }}</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view :class="['repair-status-tag', getRepairStatusTagClass(item.repairStatus)]">{{ getRepairStatusText(item.repairStatus) }}</view>
|
|
|
|
|
</view>
|
|
|
|
|
<text class="repair-name">{{ textValue(item.machineryName) }}</text>
|
|
|
|
|
<view class="card-bottom">
|
|
|
|
|
<text class="repair-device-code">{{ textValue(item.machineryCode) }}</text>
|
|
|
|
|
<view class="equipment-row">
|
|
|
|
|
<text class="equipment-label">{{ t('equipmentMaintenance.deviceLabel') }}</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>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
@ -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,
|
|
|
|
|
|