DetectionOrderView.vue 3.34 KB
<template>
    <div>
        <div class="titleBox">
            <a-button style="float: right;" @click="handleBack()">返回列表</a-button>
        </div>
        <div style="width: 100%;float: left;">
            <a-card class="tabs-card" :bordered="false" :tab-list="tabs" :active-tab-key="tabKey"
                @tabChange="key => changeTab(key)">

                <!-- 检测报告 -->
                <div v-if="tabKey === 'REPORT'" style="width: 100%;float: left;">
                    <orderReport :pageData="pageData.inspectionWORespVO || {}" />
                </div>

                <!-- 工单详情 -->
                <div v-if="tabKey === 'DETAIL'" style="width: 100%;float: left;">
                    <orderDetails ref="orderDetailsRef" :pageData="pageData.inspectionWORespVO || {}"
                        :inspectionReportResp="pageData.inspectionReportRespVO || {}" />
                </div>

                <!-- 操作日志 -->
                <div style="width: 100%;float: left;margin-top: 16px;">
                    <a-descriptions :column="1" size="small" layout="vertical">
                        <template #title>
                            <title-tip-icon></title-tip-icon>
                            操作日志
                            <div class="title-line"></div>
                        </template>
                        <a-descriptions-item label="">
                            <OperationLog ref="operationLogRef" :operationLogData="pageData" />
                        </a-descriptions-item>
                    </a-descriptions>
                </div>
            </a-card>
        </div>
    </div>
</template>
<script lang="ts">
import { Component } from 'vue-facing-decorator';
import { PaginationComponent } from "@/components/PaginationComponent";
import { Vehicle } from "lib/src/entity/vehicle/entity/Vehicle";

import { DetectionController } from "@/api/DetectionController";
import TitleDivider from "@/components/TitleDivider.vue";
import TitleTipIcon from "@/components/icons/TitleTipIcon.vue";

import OperationLog from "@/views/detection/order/components/OperationLog.vue";
import orderReport from "@/views/detection/order/components/orderReport.vue";
import orderDetails from "@/views/detection/order/components/orderDetails.vue";

@Component({
    components: { TitleDivider, TitleTipIcon, OperationLog, orderReport, orderDetails }
})


export default class DetectionOrderView extends PaginationComponent<Vehicle> {

    tabKey = "DETAIL";

    routeData: any = {
        id: '',
        action: ''
    };

    pageData: any = {};

    get tabs() {
        let tabs = [
            { key: "REPORT", tab: "检测报告" },
            { key: "DETAIL", tab: "工单详情" },
        ];
        return tabs;
    }

    changeTab(key: string) {
        this.tabKey = key;
    }

    created(): void {
        this.routeData = this.$route.query;
        this.getDetailData();
    }

    getDetailData() {
        DetectionController.inspectOrderDetail(this.axios, { id: this.routeData.id }).then(response => {
            this.pageData = response.data.data || {};
        });
    }

    handleBack() {
        this.$router.back();
    }
}
</script>

<style scoped lang="less">
.titleBox {
    width: 100%;
    height: 32px;
    float: left;
}

.title-line {
    width: 100%;
    height: 1px;
    background-color: #F2F4F7;
    margin-top: 10px;
}
</style>