feat:换电记录增加使用时间字段
This commit is contained in:
@@ -14,6 +14,8 @@ export interface EquipmentRecord {
|
|||||||
createTime?: string;
|
createTime?: string;
|
||||||
tenantId?: number;
|
tenantId?: number;
|
||||||
merchantCode?: string;
|
merchantCode?: string;
|
||||||
|
//使用时间按天算
|
||||||
|
duration?:number;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -272,6 +272,11 @@
|
|||||||
<template v-if="column.key === 'expirationDay'">
|
<template v-if="column.key === 'expirationDay'">
|
||||||
<span class="ele-text-danger">{{ expirationDay(record) }}</span>
|
<span class="ele-text-danger">{{ expirationDay(record) }}</span>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<template v-if="column.key === 'duration'">
|
||||||
|
<span class="ele-text-danger">{{ countDuration (record)}}</span>
|
||||||
|
</template>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
</ele-pro-table>
|
</ele-pro-table>
|
||||||
</a-spin>
|
</a-spin>
|
||||||
@@ -612,7 +617,8 @@ const columns3 = ref<ColumnItem[]>([
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '使用电池',
|
title: '使用电池',
|
||||||
dataIndex: 'use'
|
dataIndex: 'duration',
|
||||||
|
key:'duration'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '操作人',
|
title: '操作人',
|
||||||
@@ -765,6 +771,21 @@ const expirationDay = (order) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const countDuration = (equipmentRecord) =>{//计算使用时间
|
||||||
|
if (equipmentRecord.eventType ==="电池解绑"){
|
||||||
|
if (equipmentRecord.duration !== null){
|
||||||
|
return equipmentRecord.duration+'天'
|
||||||
|
}
|
||||||
|
return '0天'
|
||||||
|
} else {
|
||||||
|
if (equipmentRecord.duration !== null){
|
||||||
|
return equipmentRecord.duration+'天';
|
||||||
|
}else {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const getFiles = () => {
|
const getFiles = () => {
|
||||||
if (order.orderSourceData != '') {
|
if (order.orderSourceData != '') {
|
||||||
const array = JSON.parse(<string>order.orderSourceData);
|
const array = JSON.parse(<string>order.orderSourceData);
|
||||||
|
|||||||
Reference in New Issue
Block a user