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

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

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

            <div v-if="actionStatus == 'AUDIT' && (pageData?.inspectionWORespVO?.status == 3 && pageData?.inspectionWORespVO?.auditStatus == 1)"
                class="actionBox">
                <a-button type="primary" @click="handleAudit('PASS')">审核通过</a-button>
                <a-button @click="handleAudit('REJECT')" style="margin-left: 8px;">审核驳回</a-button>
            </div>

            <!-- 操作日志 -->
            <div style="width: 100%;float: left;margin-top: 16px;">
                <a-descriptions :column="1" size="small" layout="vertical">
                    <template #title>
                        <div>
                            <div>
                                <title-tip-icon></title-tip-icon>
                                操作日志
                            </div>
                            <div @click="handleFold(false)" v-if="isShowFold" class="foldBox">收起
                                <DoubleLeftOutlined color="#666666" font-size="13px;"
                                    style="transform: rotate(90deg);" />
                            </div>
                            <div @click="handleFold(true)" v-else class="foldBox">展开
                                <DoubleLeftOutlined color="#666666" font-size="13px;"
                                    style="transform: rotate(270deg);" />
                            </div>
                        </div>
                        <div class="title-line"></div>
                    </template>
                    <a-descriptions-item v-if="isShowFold" label="">
                        <OperationLog ref="operationLogRef" :operationLogData="pageData" />
                    </a-descriptions-item>
                </a-descriptions>
            </div>
        </a-card>

        <reviewDialog ref="reviewDialogRef" @handleOk="getDetailData" />

    </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";
import reviewDialog from "@/views/detection/order/components/reviewDialog.vue";
import { DoubleLeftOutlined } from '@ant-design/icons-vue';


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


export default class DetectionOrderView extends PaginationComponent<Vehicle> {

    tabKey = "DETAIL";

    actionStatus = '';

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

    pageData: any = {};

    isShowFold: boolean = true;

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

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

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

    getDetailData() {
        let postDat = { workOrderId: this.routeData.id }
        if (this.routeData.page == 'report') {
            postDat = { reportId: this.routeData.id }
        }
        DetectionController.inspectOrderDetail(this.axios, postDat).then(response => {
            this.pageData = response.data.data || {};
        });
    }

    handleAudit(status: string) {
        this.$refs.reviewDialogRef.showVisible({ ...this.pageData, status });
    }

    handleFold(isFold: boolean) {
        this.isShowFold = isFold;
    }

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

<style scoped lang="less">
.titleBox {
    position: absolute;
    top: 70px;
    right: 0;
    height: 32px;
}

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

.actionBox {
    width: 100%;
    height: 32px;
    float: left;
    margin-top: 16px;
    margin-bottom: 16px;
}

.foldBox {
    float: right;
    color: #666666;
    font-size: 13px;
    font-weight: 400;
    margin-top: -16px;
    cursor: pointer;
}
</style>