<!--
 * @Author: micky
 * @Date: 2024-09-05 16:15:45
 * @LastEditors: micky
 * @LastEditTime: 2024-09-09 21:02:21
 * @FilePath: \chargingpile-uniapp\src\pages\client\workOrder\inspection-card.vue
-->
<template>
    <w-order-card>
        <template #title>
            <view class="flex justify-between items-center">
                <view>工单编号：{{ item.orderNo }}</view>
                <view
                    :style="{ color: inspectWorkOrderColor[item.orderStatus] }"
                    v-if="!activeStatus"
                >
                    {{ inspectWorkOrderStatusMap[item.orderStatus] }}
                </view>
            </view>
        </template>
        <template #content>
            <view class="order-content-wrapper" @click="toDetail(item)">
                <view>
                    <text>设备名称</text>
                    <text>{{ item.equipmentName }}</text>
                </view>
                <view>
                    <text>设备编号</text>
                    <text>{{ item.equipmentNo }}</text>
                </view>
                <view>
                    <text>设备地址</text>
                    <text>{{ item.detailedAddress }}</text>
                </view>
                <view>
                    <text>创建时间</text>
                    <text>{{ item.createTime }}</text>
                </view>
                <view>
                    <text>接单人</text>
                    <text>{{ item.receiverName }}</text>
                </view>
                <view v-if="item.orderAccomplishTime">
                    <text>完成时间</text>
                    <text>{{ item.orderAccomplishTime }}</text>
                </view>
            </view>
        </template>
    </w-order-card>
</template>

<script setup lang="ts">
import { inspectWorkOrderColor, inspectWorkOrderStatusMap } from '@/enums/businessEnums'

defineProps<{
    item: InspectionItem
    activeStatus: number | string
}>()

const toDetail = (row: any) => {
    uni.navigateTo({
        url: `/bundle/pages/inspection/order-detail?id=${row.id}&pageSource=0`
    })
}
</script>
<style scoped lang="scss"></style>
