DetectionOrderView.vue
4.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
<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>
<title-tip-icon></title-tip-icon>
操作日志
</div>
<div class="title-line"></div>
</template>
<a-descriptions-item label="">
<OperationLog ref="operationLogRef" />
</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";
@Component({
components: { TitleDivider, TitleTipIcon, OperationLog, orderReport, orderDetails, reviewDialog }
})
export default class DetectionOrderView extends PaginationComponent<Vehicle> {
tabKey = "DETAIL";
actionStatus = '';
routeData: any = {
id: '',
action: ''
};
pageData: any = {};
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();
}
mounted(): void {
this.$refs.operationLogRef?.init(this.routeData.id);
}
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 });
}
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;
}
</style>