Commit d62e35a8 by yancanhua

fix: 检测订单功能开发

1 parent 16f53a55
...@@ -5,7 +5,7 @@ import { AxiosResponse, AxiosStatic } from 'axios'; ...@@ -5,7 +5,7 @@ import { AxiosResponse, AxiosStatic } from 'axios';
*/ */
export class DetectionController { export class DetectionController {
static pagePreference(axios: AxiosStatic, params: any): Promise<AxiosResponse> { static inspectPage(axios: AxiosStatic, params: any): Promise<AxiosResponse> {
return axios.post('inspect/page', params); return axios.post('inspect/page', params);
} }
...@@ -28,7 +28,7 @@ export class DetectionController { ...@@ -28,7 +28,7 @@ export class DetectionController {
} }
static inspectUpdate(axios: AxiosStatic, params: any): Promise<AxiosResponse> { static inspectUpdate(axios: AxiosStatic, params: any): Promise<AxiosResponse> {
return axios.post('inspect/update', params); return axios.post('inspect/update/' + params.id, params);
} }
static inspectStatus(axios: AxiosStatic, params: any): Promise<AxiosResponse> { static inspectStatus(axios: AxiosStatic, params: any): Promise<AxiosResponse> {
...@@ -39,4 +39,35 @@ export class DetectionController { ...@@ -39,4 +39,35 @@ export class DetectionController {
return axios.post('inspect/export', params, config); return axios.post('inspect/export', params, config);
} }
static inspectOrderPage(axios: AxiosStatic, params: any): Promise<AxiosResponse> {
return axios.post('inspect/wo/page', params);
}
static PAGE_INSPECTOR_ORDER = 'inspect/wo/page';
static inspectOrderAdd(axios: AxiosStatic, params: any): Promise<AxiosResponse> {
return axios.post('inspect/wo/add', params);
}
static inspectOrderCountByStatus(axios: AxiosStatic, params: any): Promise<AxiosResponse> {
return axios.get('inspect/wo/countByStatus', params);
}
static inspectOrderUpdate(axios: AxiosStatic, params: any): Promise<AxiosResponse> {
return axios.post('inspect/wo/update', params);
}
static inspectOrderExport(axios: AxiosStatic, params: any, config?: any): Promise<AxiosResponse<void>> {
return axios.post('/inspect/wo/export', params, config);
}
static inspectOrderCancel(axios: AxiosStatic, params: any): Promise<AxiosResponse> {
return axios.post('/inspect/wo/cancel', params);
}
static inspectOrderDetail(axios: AxiosStatic, params: any): Promise<AxiosResponse> {
return axios.get('/inspect/wo/detail/' + params.id, params);
}
} }
...@@ -9,10 +9,10 @@ export const DetectionRouter: Array<RouteRecordRaw> = [ ...@@ -9,10 +9,10 @@ export const DetectionRouter: Array<RouteRecordRaw> = [
} }
}, },
{ {
path: '/detection/detectionOrderView', path: '/detection/order/view',
component: () => import('@/views/detection/order/DetectionOrderView.vue'), component: () => import('@/views/detection/order/DetectionOrderView.vue'),
meta: { meta: {
breadcrumbs: [{ name: '检测管理' }, { name: '检测订单管理', path: '/detection/detectionOrder' }, { name: '检测订单详情' }] breadcrumbs: [{ name: '检测管理' }, { name: '检测订单管理', path: '/detection/order' }, { name: '检测订单详情' }]
} }
}, },
{ {
...@@ -23,10 +23,10 @@ export const DetectionRouter: Array<RouteRecordRaw> = [ ...@@ -23,10 +23,10 @@ export const DetectionRouter: Array<RouteRecordRaw> = [
} }
}, },
{ {
path: '/detection/detectionReportView', path: '/detection/report/view',
component: () => import('@/views/detection/report/DetectionReportView.vue'), component: () => import('@/views/detection/report/DetectionReportView.vue'),
meta: { meta: {
breadcrumbs: [{ name: '检测管理' }, { name: '检测报告管理', path: '/detection/detectionReport' }, { name: '检测报告详情' }] breadcrumbs: [{ name: '检测管理' }, { name: '检测报告管理', path: '/detection/report' }, { name: '检测报告详情' }]
} }
}, },
{ {
...@@ -37,7 +37,7 @@ export const DetectionRouter: Array<RouteRecordRaw> = [ ...@@ -37,7 +37,7 @@ export const DetectionRouter: Array<RouteRecordRaw> = [
} }
}, },
{ {
path: '/detection/detectionInspectorView', path: '/detection/inspector/view',
component: () => import('@/views/detection/inspector/DetectionInspectorView.vue'), component: () => import('@/views/detection/inspector/DetectionInspectorView.vue'),
meta: { meta: {
breadcrumbs: [{ name: '检测管理' }, { name: '检测师管理', path: '/detection/detectionInspector' }, { name: '检测师详情' }] breadcrumbs: [{ name: '检测管理' }, { name: '检测师管理', path: '/detection/detectionInspector' }, { name: '检测师详情' }]
......
...@@ -57,13 +57,22 @@ ...@@ -57,13 +57,22 @@
</div> </div>
</div> </div>
<a-table :columns="columns" :data-source="pagination.content" :loading="loading" :bordered="false" <a-table :columns="columns" :data-source="contentList" :loading="loading" :bordered="false"
@change="pageRefresh" @resizeColumn="this.$filters.tableResizeColumn" size="small" @change="pageRefresh" @resizeColumn="this.$filters.tableResizeColumn" size="small"
:pagination="pageState" :row-key="record => record.id" :scroll="{ y: 'calc(100vh - 288px)' }"> :pagination="pageState" :row-key="record => record.id" :scroll="{ y: 'calc(100vh - 288px)' }">
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
<template v-if="column.key === 'vehicleState'"> <template v-if="column.key === 'status'">
111 <a-switch @change="handleEnableDisable(record)" v-model:checked="record.status" />
{{ record.status ? '启用' : '禁用' }}
</template>
<template v-if="column.key === 'action'">
<router-link
:to="{ path: '/detection/inspector/view', query: { id: record.id, action: 'VIEW' } }">
<a-button type="link" size="small">详情</a-button>
</router-link>
<a-button type="link" @click="handleAdd(record)" size="small">编辑</a-button>
</template> </template>
</template> </template>
</a-table> </a-table>
...@@ -148,9 +157,9 @@ export default class DetectionInspectorPage extends PaginationComponent<Vehicle> ...@@ -148,9 +157,9 @@ export default class DetectionInspectorPage extends PaginationComponent<Vehicle>
created(): void { created(): void {
this.init(this.axios, DetectionController.PAGE_INSPECTOR); this.init(this.axios, DetectionController.PAGE_INSPECTOR);
this.buildQueryForm({ this.buildQueryForm({
sourceNo: [null, { label: '关键字', field: 'key', placeholder: '搜索姓名、手机号', operator: Operator.like }], sourceNo: [null, { label: '关键字', field: 'keyword', placeholder: '搜索姓名、手机号', operator: Operator.like }],
cityCode: [null, { region: [null, {
name: 'cityCodeName', label: '所在城市', field: 'cityCode', type: 'slot', placeholder: '请选择省/市', operator: Operator.eq name: 'cityCodeName', label: '所在城市', field: 'region', type: 'slot', placeholder: '请选择省/市', operator: Operator.eq
}], }],
status: [null, { status: [null, {
label: '账号状态', field: 'status', type: 'select', allowClear: true, optionItems: this.reviewStatusList, operator: Operator.eq label: '账号状态', field: 'status', type: 'select', allowClear: true, optionItems: this.reviewStatusList, operator: Operator.eq
...@@ -161,6 +170,10 @@ export default class DetectionInspectorPage extends PaginationComponent<Vehicle> ...@@ -161,6 +170,10 @@ export default class DetectionInspectorPage extends PaginationComponent<Vehicle>
this.getInspectSummary(); this.getInspectSummary();
} }
get contentList() {
return this.pagination.content.map((item) => ({ ...item, status: item.status == 1 ? true : false }));
}
//获取统计数据 //获取统计数据
getInspectSummary() { getInspectSummary() {
DetectionController.inspectSummary(this.axios, {}).then(response => { DetectionController.inspectSummary(this.axios, {}).then(response => {
...@@ -181,7 +194,7 @@ export default class DetectionInspectorPage extends PaginationComponent<Vehicle> ...@@ -181,7 +194,7 @@ export default class DetectionInspectorPage extends PaginationComponent<Vehicle>
const cityObj = e[e.length - 1]; const cityObj = e[e.length - 1];
code = cityObj.value || ''; code = cityObj.value || '';
} }
this.pagination.queryForm.cityCode = code; this.pagination.queryForm.region = code;
} }
//重置查询条件 //重置查询条件
...@@ -196,10 +209,10 @@ export default class DetectionInspectorPage extends PaginationComponent<Vehicle> ...@@ -196,10 +209,10 @@ export default class DetectionInspectorPage extends PaginationComponent<Vehicle>
//启用/禁用检测师 //启用/禁用检测师
handleEnableDisable(record) { handleEnableDisable(record) {
this.$refs.enableDialogRef.init({ id: '3', status: 0, }); this.$refs.enableDialogRef.init({ id: record.id, status: record.status ? 0 : 1 });
} }
// //导出检测师列表
downloadExcel(): void { downloadExcel(): void {
this.exporting = true; this.exporting = true;
let paramsData = { let paramsData = {
......
<template> <template>
<div> <div>
<a-modal v-model:open="dialogVisible" :title="titleVisible" @ok="handleOk"> <a-modal v-model:open="dialogVisible" :title="titleVisible" @ok="handleOk" @cancel="handleCancel">
<a-spin :spinning="submitted" style="margin-top: 16px;"> <a-spin :spinning="submitted" style="margin-top: 16px;">
<a-form layout="vertical" :model="postData" :label-col="labelCol" :wrapper-col="wrapperCol" <a-form layout="vertical" :model="postData" :label-col="labelCol" :wrapper-col="wrapperCol"
ref="formRef"> ref="formRef">
...@@ -52,6 +52,11 @@ export default class EnableDialog extends EnhanceFormComponent<User> { ...@@ -52,6 +52,11 @@ export default class EnableDialog extends EnhanceFormComponent<User> {
this.dialogVisible = true; this.dialogVisible = true;
} }
handleCancel() {
this.dialogVisible = false;
this.$emit("emitOk");
}
handleOk() { handleOk() {
this.$refs.formRef.validate().then((valid) => { this.$refs.formRef.validate().then((valid) => {
if (valid) { if (valid) {
......
...@@ -69,17 +69,16 @@ export default class InspectorAddForm extends EnhanceFormComponent<User> { ...@@ -69,17 +69,16 @@ export default class InspectorAddForm extends EnhanceFormComponent<User> {
this.dialogVisible = true; this.dialogVisible = true;
this.titleVisible = data.id ? "编辑检测师" : "新增检测师"; this.titleVisible = data.id ? "编辑检测师" : "新增检测师";
this.formDisabled = data.id ? true : false; this.formDisabled = data.id ? true : false;
if (data.id) {
this.postData.id = data.id || ''; this.postData.id = data.id || '';
this.postData.name = data.name || ''; this.postData.name = data.name || '';
this.postData.phone = data.phone || ''; this.postData.phone = data.phone || '';
this.postData.region = data.region || ''; this.postData.region = data.region || '';
this.postData.regionName = data.regionName || ''; this.postData.regionName = data.regionName || '';
this.postData.status = data.status === 1; this.postData.status = data.id ? data.status : true;
}
if (data.region) { if (data.region) {
const cityCode = data.region.substring(0, 2); const cityCode = data.region.substring(0, 2);
this.postData.registrationCity = [cityCode + '0000', data.cityCode]; this.postData.registrationCity = [cityCode + '0000', data.region];
} else { } else {
this.postData.registrationCity = [] this.postData.registrationCity = []
} }
......
...@@ -3,28 +3,76 @@ ...@@ -3,28 +3,76 @@
@tabChange="key => changeTab(key)"> @tabChange="key => changeTab(key)">
<!--查询栏--> <!--查询栏-->
<m-pagination-query-render :fields="pagination.filterFields" :form="pagination.queryForm" @onSearch="pageReload" <m-pagination-query-render :fields="pagination.filterFields" :form="pagination.queryForm"
@onReset="pageReset" :simpleFieldNum="4" /> @onSearch="handlePageReload" @onReset="handleReset" :simpleFieldNum="4" />
<!--查询栏end--> <!--查询栏end-->
<!--库存车辆列表start--> <!--库存车辆列表start-->
<div class="table-operations" style="margin-bottom: 16px;width: 100%;float: left;"> <div class="table-operations" style="margin-bottom: 16px;width: 100%;float: left;">
<div class="flex justify-end" style="float: left;"> <div class="flex justify-end" style="float: left;">
已选 3 项 已选 {{ selectedItems.length }} 项
<a-button @click="downloadExcel" :disabled="exporting">批量导出</a-button> <a-button @click="downloadExcel('BATCH')" :disabled="exporting">批量导出</a-button>
</div> </div>
<div class="flex justify-end" style="float: right;"> <div class="flex justify-end" style="float: right;">
<a-button type="primary" @click="handleAddOrder({})">创建工单</a-button> <a-button type="primary" @click="handleAddOrder({})">创建工单</a-button>
<a-button @click="downloadExcel" :disabled="exporting">导出</a-button> <a-button @click="downloadExcel('ALL')" :disabled="exporting">导出</a-button>
</div> </div>
</div> </div>
<a-table :columns="columns" :data-source="pagination.content" :loading="loading" :bordered="false" <a-table :columns="columns" :data-source="pagination.content" :loading="loading" :bordered="false"
@change="pageRefresh" @resizeColumn="this.$filters.tableResizeColumn" size="small" :pagination="pageState" @change="pageRefresh" @resizeColumn="this.$filters.tableResizeColumn" size="small" :pagination="pageState"
:row-key="record => record.vehicleId" :scroll="{ y: 'calc(100vh - 350px)' }"> :row-key="record => record.id" :scroll="{ y: 'calc(100vh - 288px)' }"
:row-selection="{ selectedRowKeys: selectIds, onChange: onSelectChange, type: 'checkbox', preserveSelectedRowKeys: true, }">
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
<template v-if="column.key === 'vehicleState'"> <template v-if="column.key === 'vehicleState'">
111 <vehicle-state-tag :vehicle-state="record.vehicle.vehicleState"></vehicle-state-tag>
</template>
<template v-if="column.key === 'status'">
<a-tag v-if="record.status == 1" color="#FFF3E5" :style="{ color: '#F0A700' }"
:bordered="false">待检测</a-tag>
<a-tag v-else-if="record.status == 2" color="#E7F2FE" :style="{ color: '#288BFA' }"
:bordered="false">检测中</a-tag>
<a-tag v-else-if="record.status == 3" color="#E8F8F2" :style="{ color: '#00AD74' }"
:bordered="false">已完成</a-tag>
<a-tag v-else-if="record.status == 4" color="#F0F2F5" :style="{ color: '#777C85' }"
:bordered="false">已取消</a-tag>
</template>
<template v-if="column.key === 'auditStatus'">
<a-tag v-if="record.auditStatus == 1" color="#FFF3E5" :style="{ color: '#F0A700' }"
:bordered="false">待审核</a-tag>
<a-tag v-else-if="record.auditStatus == 2" color="#E7F2FE" :style="{ color: '#288BFA' }"
:bordered="false">审核中</a-tag>
<a-tag v-else-if="record.auditStatus == 3" color="#E8F8F2" :style="{ color: '#00AD74' }"
:bordered="false">审批通过</a-tag>
<a-tag v-else-if="record.auditStatus == 4" color="#FFEDED" :style="{ color: '#EB2F2F' }"
:bordered="false">审批驳回</a-tag>
</template>
<template v-if="column.key === 'action'">
<router-link :to="{ path: '/detection/order/view', query: { id: record.id, action: 'VIEW' } }">
<a-button type="link" size="small">详情</a-button>
</router-link>
<a-button v-if="record.status == 1" type="link" @click="handleAddOrder(record)"
size="small">编辑</a-button>
<a-button v-if="record.status == 1 || record.status == 2" type="link"
@click="handleCancelOrder(record)" size="small">取消工单</a-button>
<router-link v-if="record.status == 3 && record.auditStatus == 1"
:to="{ path: '/detection/order/view', query: { id: record.id, action: 'AUDIT' } }">
<a-button type="link" size="small">审核</a-button>
</router-link>
<router-link v-if="record.auditStatus == 3"
:to="{ path: '/detection/order/view', query: { id: record.id, action: 'VIEW' } }">
<a-button type="link" size="small">检测报告</a-button>
</router-link>
</template> </template>
</template> </template>
</a-table> </a-table>
...@@ -32,12 +80,14 @@ ...@@ -32,12 +80,14 @@
<!--新增/编辑工单弹窗--> <!--新增/编辑工单弹窗-->
<OrderAddForm ref="orderAddFormRef" @emitOk="pageLoad" /> <OrderAddForm ref="orderAddFormRef" @emitOk="pageLoad" />
<!--取消工单弹窗-->
<cancelDialog ref="cancelDialogRef" @emitOk="pageLoad" />
</a-card> </a-card>
</template> </template>
<script lang="ts"> <script lang="ts">
import { Component } from 'vue-facing-decorator'; import { Component } from 'vue-facing-decorator';
import { message, TableColumnsType } from "ant-design-vue"; import { message, TableColumnsType } from "ant-design-vue";
import { VehicleController } from "@/api/VehicleController";
import { Operator, Order } from "lib/src/core/page/Pagination"; import { Operator, Order } from "lib/src/core/page/Pagination";
import VehicleStateTag from "@/views/vehicle/inventory/VehicleStateTag.vue"; import VehicleStateTag from "@/views/vehicle/inventory/VehicleStateTag.vue";
import { PaginationComponent } from "@/components/PaginationComponent"; import { PaginationComponent } from "@/components/PaginationComponent";
...@@ -45,123 +95,178 @@ import { Vehicle } from "lib/src/entity/vehicle/entity/Vehicle"; ...@@ -45,123 +95,178 @@ import { Vehicle } from "lib/src/entity/vehicle/entity/Vehicle";
import { Security } from "@/store"; import { Security } from "@/store";
import { ExportUtil } from "@/common/ExportUtil"; import { ExportUtil } from "@/common/ExportUtil";
import { DetectionController } from "@/api/DetectionController";
import OrderAddForm from "@/views/detection/order/components/OrderAddForm.vue"; import OrderAddForm from "@/views/detection/order/components/OrderAddForm.vue";
import cancelDialog from "@/views/detection/order/components/cancelDialog.vue";
@Component({ @Component({
components: { OrderAddForm } components: { VehicleStateTag, OrderAddForm, cancelDialog }
}) })
export default class AppraiseVehiclePricePage extends PaginationComponent<Vehicle> {
vehicleStateIndex = "0";
exporting = false;
vehicleCount: any = {};
@Security.Getter hasPrivilege;
export default class DetectionOrderPage extends PaginationComponent<Vehicle> {
detectingStatusList = [ selectIds: number[] = [];
{ label: '待检测', value: 'TO_BE_DETECTED' }, selectedItems = [];
{ label: '检测中', value: 'DETECTING' },
{ label: '已检测', value: 'DETECTED' },
];
reviewStatusList = [ exporting = false;
{ label: '待审核', value: 'TO_BE_AUDITED' }, ccountByStatusData = {
{ label: '审核中', value: 'AUDITING' }, dispatchedCount: 0,
{ label: '已审核', value: 'AUDITED' }, inProgressCount: 0,
completedCount: 0,
canceledCount: 0,
};
auditStatusList = [
{ label: '待审核', value: 1 },
// { label: '审核中', value: 2 },
{ label: '审批通过', value: 3 },
{ label: '审批驳回', value: 4 },
]; ];
tabKey = "TO_BE_PRICED"; tabKey = "";
/** /**
* 表格列配置 * 表格列配置
*/ */
columns: TableColumnsType = [ columns: TableColumnsType = [
{ title: '工单单号', dataIndex: ['baseInfo', "sourceNo"], key: 'sourceNo', align: 'center', width: 150, resizable: true, ellipsis: true }, {
{ title: '车源号', dataIndex: ['baseInfo', "vin"], key: 'vin', align: 'center', width: 170, resizable: true, ellipsis: true }, title: '序号', key: 'index', width: 70, align: 'center', sorter: false,
{ title: '车型名称', dataIndex: ['baseInfo', "carTypeName"], key: 'carTypeName', align: 'center', width: 240, resizable: true, ellipsis: true }, customRender: ({ index }) => {
{ title: '车牌号', dataIndex: ['baseInfo', "licensePlate"], key: 'licensePlate', align: 'center', width: 110, resizable: true, ellipsis: true }, return (this.getPagination().pageIndex - 1) * this.getPagination().pageSize + index + 1;
{ title: '所属门店', dataIndex: ['venue', 'venueName'], key: 'venueName', align: 'center', width: 130, resizable: true, ellipsis: true }, },
{ title: '车辆所在地址', dataIndex: ['custodianInfo', "handoverAddress"], key: 'address', width: 180, resizable: true, ellipsis: true }, },
{ title: '车辆保管人', dataIndex: ['custodianInfo', "custodianName"], key: 'custodianName', align: 'center', width: 160, resizable: true, ellipsis: true }, { title: '工单单号', dataIndex: 'woId', key: 'woId', align: 'center', width: 170, resizable: true, ellipsis: true },
{ title: '车辆状态', dataIndex: 'createTime', key: 'createTime', align: 'center', width: 170, resizable: true, ellipsis: true }, { title: '车源号', dataIndex: ['vehicle', 'baseInfo', "sourceNo"], key: 'sourceNo', align: 'center', width: 170, resizable: true, ellipsis: true },
{ title: '检测师', dataIndex: 'warehousingTime', key: 'warehousingTime', align: 'center', width: 170, resizable: true, ellipsis: true }, { title: '车型名称', dataIndex: ['vehicle', 'baseInfo', "carTypeName"], key: 'carTypeName', align: 'center', width: 240, resizable: true, ellipsis: true },
{ title: '检测地址', dataIndex: 'transferredTime', key: 'transferredTime', align: 'center', width: 170, resizable: true, ellipsis: true }, { title: '车牌号', dataIndex: ['vehicle', 'baseInfo', "licensePlate"], key: 'licensePlate', align: 'center', width: 170, resizable: true, ellipsis: true },
{ title: '检测单状态', dataIndex: 'updateTime', key: 'updateTime', align: 'center', width: 170, resizable: true, ellipsis: true }, { title: '所属门店', dataIndex: ['vehicle', 'venue', 'venueName'], key: 'venueName', align: 'center', width: 170, resizable: true, ellipsis: true },
{ title: '审核状态', dataIndex: 'vehicleState', key: 'vehicleState', width: 100, align: 'center', resizable: true, ellipsis: true }, { title: '车辆所在地址', dataIndex: ['vehicle', 'custodianInfo', "handoverAddress"], key: 'handoverAddress', width: 240, resizable: true, ellipsis: true },
{ title: '创建时间', dataIndex: 'updateTime', key: 'updateTime', align: 'center', width: 170, resizable: true, ellipsis: true, sorter: true }, { title: '车辆保管人', dataIndex: ['vehicle', 'custodianInfo', "custodianName"], key: 'custodianName', align: 'center', width: 170, resizable: true, ellipsis: true },
{ title: '完成检测时间', dataIndex: 'updateTime', key: 'updateTime', align: 'center', width: 170, resizable: true, ellipsis: true, sorter: true }, { title: '车辆状态', dataIndex: ['vehicle', "vehicleState"], key: 'vehicleState', align: 'center', width: 170, resizable: true, ellipsis: true },
{ title: '操作', key: 'action', width: 170, align: 'center', fixed: 'right' }, { title: '检测师', dataIndex: ['inspector', "name"], key: 'name', align: 'center', width: 170, resizable: true, ellipsis: true },
{ title: '检测地址', dataIndex: 'inspectionAddress', key: 'inspectionAddress', align: 'center', width: 240, resizable: true, ellipsis: true },
{ title: '检测单状态', dataIndex: 'status', key: 'status', align: 'center', width: 170, resizable: true, ellipsis: true },
{ title: '审核状态', dataIndex: 'auditStatus', key: 'auditStatus', width: 170, align: 'center', resizable: true, ellipsis: true },
{ title: '创建时间', dataIndex: 'createTime', key: 'createTime', align: 'center', width: 170, resizable: true, ellipsis: true, sorter: true },
{ title: '完成检测时间', dataIndex: 'inspectionCompletedTime', key: 'inspectionCompletedTime', align: 'center', width: 170, resizable: true, ellipsis: true, sorter: true },
{ title: '操作', key: 'action', width: 190, align: 'center', fixed: 'right' },
]; ];
getPagination() {
return this.pagination;
}
/** /**
* 初始化配置 * 初始化配置
*/ */
created(): void { created(): void {
this.init(this.axios, VehicleController.PAGE_PRICE_VEHICLE); this.getinspectOrderCountByStatus();
this.init(this.axios, DetectionController.PAGE_INSPECTOR_ORDER);
this.buildQueryForm({ this.buildQueryForm({
sourceNo: [null, { label: '关键字', field: 'key', placeholder: '搜索工单单号、车源号、VIN码、车牌', operator: Operator.like }], sourceNo: [null, { label: '关键字', field: 'keyword', placeholder: '搜索工单单号、车源号、VIN码、车牌', operator: Operator.like }],
status: [null, {
label: '检测单状态', field: 'status', type: 'select', allowClear: true, optionItems: this.detectingStatusList, operator: Operator.eq
}],
vehicleState: [null, { vehicleState: [null, {
label: '审核状态', field: 'vehicleState', type: 'select', allowClear: true, optionItems: this.reviewStatusList, operator: Operator.eq label: '审核状态', field: 'auditStatus', type: 'select', allowClear: true, optionItems: this.auditStatusList, operator: Operator.eq
}], }],
updateTime: [null, { label: '派单时间', field: 'updateTime', operator: Operator.dateBetween, type: 'date-range' }], woTime: [null, { label: '派单时间', field: 'woTime', operator: Operator.dateBetween, type: 'date-range' }],
}); });
this.pagination.addFilter('vehicleState', ['TO_BE_PRICED', 'PRICED'], Operator.in);
this.pagination.setDefaultSort('createTime', Order.desc); this.pagination.setDefaultSort('createTime', Order.desc);
this.changeTab(this.tabKey); this.changeTab(this.tabKey);
} }
getinspectOrderCountByStatus() {
DetectionController.inspectOrderCountByStatus(this.axios, {}).then(res => {
this.ccountByStatusData = res.data.data || {};
});
}
get tabs() { get tabs() {
const tabs = [{ key: "", tab: '全部' }, { key: "1", tab: '待检测 (3)' }, { key: "2", tab: '检测中 (2)' }, { key: "3", tab: '已完成 (21)' }, { key: "4", tab: '已取消 (4)' }]; const totalCount = (this.ccountByStatusData.dispatchedCount || 0) + (this.ccountByStatusData.inProgressCount || 0) + (this.ccountByStatusData.completedCount || 0) + (this.ccountByStatusData.canceledCount || 0);
let tabs = [
{ key: "", tab: `全部 (${totalCount || 0})` },
{ key: "DISPATCHED", tab: `待检测 (${this.ccountByStatusData.dispatchedCount || 0})` },
{ key: "IN_PROGRESS", tab: `检测中 (${this.ccountByStatusData.inProgressCount || 0})` },
{ key: "COMPLETED", tab: `已完成 (${this.ccountByStatusData.completedCount || 0})` },
{ key: "CANCELED", tab: `已取消 (${this.ccountByStatusData.canceledCount || 0})` }
];
return tabs; return tabs;
} }
//查询
handlePageReload() {
this.selectIds = [];
this.selectedItems = [];
this.pageReload();
}
//重置查询条件
handleReset() {
this.selectIds = [];
this.selectedItems = [];
this.pageReset();
}
// 新增工单 编辑 // 新增工单 编辑
handleAddOrder(data) { handleAddOrder(data) {
this.$refs.orderAddFormRef.init(data); this.$refs.orderAddFormRef.init(data);
} }
// 取消工单
handleCancelOrder(data) {
this.$refs.cancelDialogRef.init(data);
}
changeTab(orderState: string): void { changeTab(status: string): void {
this.tabKey = orderState; this.tabKey = status;
switch (this.tabKey) { switch (this.tabKey) {
case "": case "":
this.pagination.addDefaultFilter('vehicleState', ['TO_BE_PRICED', 'PRICED'], Operator.in); this.pagination.removeDefaultFilter('status');
break; break;
case "TO_BE_PRICED": case "DISPATCHED":
this.pagination.addDefaultFilter('vehicleState', ['TO_BE_PRICED'], Operator.in); this.pagination.addDefaultFilter('status', 1, Operator.eq);
this.pagination.putData('auditState', "empty");
break; break;
case "UNAUDITED": case "IN_PROGRESS":
this.pagination.addDefaultFilter('vehicleState', ['TO_BE_PRICED'], Operator.in); this.pagination.addDefaultFilter('status', 2, Operator.eq);
this.pagination.putData("auditState", "UNAUDITED");
break; break;
case "REJECTED": case "COMPLETED":
this.pagination.addDefaultFilter('vehicleState', ['TO_BE_PRICED'], Operator.in); this.pagination.addDefaultFilter('status', 3, Operator.eq);
this.pagination.putData("auditState", "REJECTED");
break; break;
case "AUDITED": case "CANCELED":
this.pagination.addDefaultFilter('vehicleState', ['PRICED'], Operator.in); this.pagination.addDefaultFilter('status', 4, Operator.eq);
this.pagination.removeData('auditState');
break; break;
} }
this.loading = true; this.loading = true;
this.pagination.reload().then(res => { }).finally(() => this.loading = false); this.pagination.reload().then(res => { }).finally(() => this.loading = false);
} }
downloadExcel(): void { onSelectChange(selectedRowKeys: number[], selectedRows: []): void {
// this.exporting = true; this.selectIds = selectedRowKeys;
// VehicleController.exportPriceVehicles(this.axios, this.pagination.requestParams, { responseType: 'blob' }).then(response => { this.selectedItems = selectedRows;
// message.success('导出任务已创建,请稍后在浏览器下载列表中查看'); }
// ExportUtil.downloadExcelFile(response.data, '评估定价车辆列表');
// }).catch(error => { downloadExcel(type: string): void {
// console.error('Error downloading Word file:', error); this.exporting = true;
// }).finally(() => { let paramsData = {
// this.exporting = false; ...this.pagination.requestParams,
// }); }
if (type == 'BATCH') {
if (!this.selectIds.length) {
message.error('请选择需要导出的数据');
this.exporting = false;
return false
} else {
if (!paramsData.filters) {
paramsData.filters = []
}
paramsData.filters.push({ field: "id", logic: "and", operator: Operator.in, value: this.selectIds, })
}
}
DetectionController.inspectOrderExport(this.axios, paramsData, { responseType: 'blob' }).then(response => {
message.success('导出任务已创建,请在下载中心查看');
ExportUtil.downloadExcelFile(response.data, '检测订单管理列表');
}).catch(error => {
console.error('Error downloading Word file:', error);
}).finally(() => {
this.exporting = false;
});
} }
} }
</script> </script>
......
<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>
\ No newline at end of file \ No newline at end of file
<template>
<div class="logBox">
<div v-for="(item, index) in logList" :key="index" class="log-list">
<div class="progressBox">
<div class="progressBox-point" :class="{ 'bg-1956fe': index > 0 }"></div>
<div v-if="alllist.length !== index + 1" class="progressBox-line"></div>
</div>
<div class="log-title">
<div v-if="item.description" class="logBox-content">{{ item.description }}</div>
<div class="logBox-time">
<div class="logBox-point" v-if="item.updateNameCnFirst">{{ item.updateNameCnFirst }}</div>
<span class="p-l-4">{{ item.operatorName }}</span>
<span class="p-l-8">{{ item.operationTime }}</span>
</div>
</div>
</div>
<div v-if="!isAllData" @click="handleMore()" class="moreBox">
查看更多
<DoubleLeftOutlined color="#666666" font-size="16px;" style="transform: rotate(270deg);" />
</div>
</div>
</template>
<script lang="ts">
import { Component, Prop, Vue, Watch } from "vue-facing-decorator";
import { DoubleLeftOutlined } from '@ant-design/icons-vue';
@Component({ components: { DoubleLeftOutlined } })
export default class OperationLog extends Vue {
@Prop({ type: Object, required: true })
operationLogData: any;
logList = [];
isAllData = false;
alllist = [];
@Watch('operationLogData', { deep: true, immediate: true })
watchOperationLogData(newValue: any, oldValue: any): void {
const list = (newValue.logList || []).map((item: any) => { return { ...item } });
if (list.length > 5) {
this.isAllData = false;
this.alllist = list;
this.logList = list.slice(0, 5);
} else {
this.isAllData = true;
this.logList = list;
}
}
handleMore() {
this.isAllData = true;
this.logList = this.alllist
}
}
</script>
<style lang="less" scoped>
.logBox {
width: 100%;
height: auto;
float: left;
margin-top: 16px;
}
.log-list {
width: -webkit-calc(100% - 32px);
width: -moz-calc(100% - 32px);
width: calc(100% - 32px);
float: left;
margin-bottom: 16px;
margin-left: 32px;
}
.progressBox {
width: 24px;
float: left;
}
.progressBox-point {
width: 8px;
height: 8px;
border: 2px solid #1956fe;
border-radius: 8px;
}
.bg-1956fe {
background: #1956fe;
}
.progressBox-line {
width: 2px;
height: 40px;
background: #1956fe;
margin-top: 3px;
margin-left: 2.5px;
}
.log-title {
width: -webkit-calc(100% - 24px);
width: -moz-calc(100% - 24px);
width: calc(100% - 24px);
float: left;
}
.logBox-content {
width: 100%;
height: 20px;
line-height: 20px;
float: left;
color: #2F3133;
font-size: 14px;
font-weight: 400;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.logBox-content span {
color: #2f3133;
}
.logBox-time {
width: 100%;
height: 20px;
line-height: 20px;
float: left;
color: #777c85;
font-size: 12px;
font-weight: 400;
margin-top: 6px;
}
.logBox-point {
width: 14px;
height: 14px;
line-height: 14px;
background: #e6efff;
text-align: center;
float: left;
margin: 3px 0;
color: #1956fe;
font-size: 8px;
font-weight: 700;
border-radius: 8px;
}
.moreBox {
width: -webkit-calc(100% - 32px);
width: -moz-calc(100% - 32px);
width: calc(100% - 32px);
height: 20px;
float: left;
color: #666666;
font-size: 14px;
font-weight: 400;
line-height: 20px;
margin-top: 8px;
margin-bottom: 22px;
margin-left: 32px;
cursor: pointer;
}
.p-l-4 {
padding-left: 4px;
}
.p-l-8 {
padding-left: 8px;
}
</style>
<template> <template>
<div> <div>
<a-drawer width="680" :title="titleVisible" placement="right" :open="dialogVisible" @close="onClose"> <a-drawer width="680" :title="titleVisible" placement="right" :open="dialogVisible" @close="onClose">
<template #extra>
<a-space>
<a-button @click="onClose">取消</a-button>
<a-button type="primary" @click="handleOk()">保存</a-button>
</a-space>
</template>
<a-spin :spinning="submitted" style="margin-top: 16px;"> <a-spin :spinning="submitted" style="margin-top: 16px;">
<a-form layout="vertical" :model="postData" :label-col="labelCol" :wrapper-col="wrapperCol" <a-form layout="vertical" :model="postData" :label-col="labelCol" :wrapper-col="wrapperCol"
ref="formRef"> ref="formRef">
<a-form-item name="vehicleId" label="车辆" :rules="[{ required: true, message: '请选择车辆' },]"> <a-form-item name="vehicleId" style="width: 100%;" label="车辆信息"
<a-button @click="addVehicle()">选择车辆</a-button> :rules="[{ required: true, message: '请选择车辆' },]">
<a-button v-if="!postData.vehicleId" @click="addVehicle()">选择车辆</a-button>
<div v-if="postData.vehicleId" class="vehicleData">
<div v-if="!postData.id" class="vehicleDelete">
<a-button type="link" title="点击删除车辆" @click="deleteVehicle()">删除</a-button>
</div>
<a-descriptions :column="2" size="small" layout="vertical">
<a-descriptions-item label="车型名称">{{ vehicleData.carName }}</a-descriptions-item>
<a-descriptions-item label="车源号">{{ vehicleData.sourceNo }}</a-descriptions-item>
<a-descriptions-item label="VIN码">{{ vehicleData.vin }}</a-descriptions-item>
<a-descriptions-item label="车牌号">{{ vehicleData.licensePlate }}</a-descriptions-item>
</a-descriptions>
</div>
</a-form-item> </a-form-item>
<a-form-item name="inspectorId" label="检测人员" :rules="[{ required: true, message: '请输入检测人员' }]">
<a-input v-model:value="postData.inspectorId" placeholder="输入姓名或电话搜索" :maxlength="20" <a-form-item v-if="postData.id" name="vehicleId" style="width: 100%;" label="保管人信息">
style="width: 376px;" /> <div class="vehicleData">
<a-descriptions :column="2" size="small" layout="vertical">
<a-descriptions-item label="保管人姓名">{{ inspectorData.custodianName
}}</a-descriptions-item>
<a-descriptions-item label="保管人电话">{{ inspectorData.custodianPhone
}}</a-descriptions-item>
<a-descriptions-item label="车辆所在地">{{ inspectorData.handoverAddress
}}</a-descriptions-item>
</a-descriptions>
</div>
</a-form-item>
<a-form-item name="inspectorId" label="检测人员" :rules="[{ required: true, message: '请选择检测人员' }]">
<a-select ref="select" v-model:value="postData.inspectorId" placeholder="请选择检测人员"
style="width: 376px;">
<a-select-option v-for="item in inspectPageList" :key="item.id" :value="item.id">
{{ item.name }}
</a-select-option>
</a-select>
</a-form-item> </a-form-item>
<a-form-item name="inspectionAddress" label="检测地址" <a-form-item name="inspectionAddress" label="检测地址"
:rules="[{ required: true, message: '请输入检测地址' }]"> :rules="[{ required: true, message: '请输入检测地址' }]">
<a-input v-model:value="postData.inspectionAddress" placeholder="请输入检检测地址" <a-input v-model:value="postData.inspectionAddress" maxlength="100" placeholder="请输入检测地址"
style="width: 376px;" /> style="width: 376px;" />
</a-form-item> </a-form-item>
<a-form-item name="remark" label="备注说明"> <a-form-item name="remark" label="备注说明">
<a-textarea v-model:value="postData.remark" show-count :maxlength="500" :rows="6" <a-textarea v-model:value="postData.remark" show-count :maxlength="500" placeholder="请输入备注说明"
style="width: 580px;" /> :rows="6" style="width: 580px;" />
</a-form-item> </a-form-item>
</a-form> </a-form>
</a-spin> </a-spin>
</a-drawer> </a-drawer>
<promptDialog ref="promptDialogRef" />
</div> </div>
</template> </template>
...@@ -33,48 +71,68 @@ import { EnhanceFormComponent } from "@/core/form/EnhanceFormComponent"; ...@@ -33,48 +71,68 @@ import { EnhanceFormComponent } from "@/core/form/EnhanceFormComponent";
import { DetectionController } from "@/api/DetectionController"; import { DetectionController } from "@/api/DetectionController";
import { message } from "ant-design-vue"; import { message } from "ant-design-vue";
import { User } from "lib/src/entity/security/entity/User"; import { User } from "lib/src/entity/security/entity/User";
import { DefaultOptionType } from "ant-design-vue/es/vc-cascader/Cascader";
import { convertToTree } from "@/common/chinaarea";
import { handleError } from 'vue';
import VehiclePicker from "@/views/vehicle/auction/VehiclePicker.vue"; import VehiclePicker from "@/views/vehicle/auction/VehiclePicker.vue";
import { ModalService } from "@/components/ModalService"; import { ModalService } from "@/components/ModalService";
import promptDialog from "@/views/detection/order/components/promptDialog.vue";
@Component({ @Component({
components: { VehiclePicker, ModalService } components: { VehiclePicker, ModalService, promptDialog }
}) })
export default class OrderAddForm extends EnhanceFormComponent<User> { export default class OrderAddForm extends EnhanceFormComponent<User> {
dialogVisible = false; dialogVisible = false;
titleVisible = "创建检测工单"; titleVisible = "创建检测工单";
//提交数据
postData = { postData = {
id: "", id: "",
vehicleId: "", vehicleId: "",
inspectorId: "", inspectorId: null,
inspectionAddress: "", inspectionAddress: "",
remark: "", remark: "",
} }
//车辆数据
vehicleData = {
vehicleData = {} carName: '',
sourceNo: '',
vin: '',
licensePlate: '',
}
//人员数据
inspectorData = {
custodianName: '',
custodianPhone: '',
handoverAddress: '',
}
inspectPageList = []
init(data): void { init(data): void {
this.dialogVisible = true; this.getInspectPageList();
this.titleVisible = data.id ? "编辑检测师" : "创建检测工单"; this.titleVisible = data.id ? "编辑检测师" : "创建检测工单";
} this.postData.id = data.id || "";
this.postData.vehicleId = data.vehicle?.vehicleId || "";
this.postData.inspectorId = data.inspector?.id || null;
this.postData.inspectionAddress = data.inspectionAddress || "";
this.postData.remark = data.remark || "";
//车辆数据
this.vehicleData.carName = data?.vehicle?.baseInfo?.carTypeName || "";
this.vehicleData.sourceNo = data?.vehicle?.baseInfo?.sourceNo || "";
this.vehicleData.vin = data?.vehicle?.baseInfo?.vin || "";
this.vehicleData.licensePlate = data?.vehicle?.baseInfo?.licensePlate || "";
//人员数据
this.inspectorData.custodianName = data?.vehicle?.custodianInfo?.custodianName || "";
this.inspectorData.custodianPhone = data?.vehicle?.custodianInfo?.custodianPhone || "";
this.inspectorData.handoverAddress = data?.vehicle?.custodianInfo?.handoverAddress || "";
onClose() { this.dialogVisible = true;
this.dialogVisible = false;
} }
//添加车辆
addVehicle(): void { addVehicle(): void {
const modal = ModalService.confirm({ const modal = ModalService.confirm({
title: '选择车辆', component: VehiclePicker, closable: true, appContext: this.$.appContext, width: 960, title: '选择车辆', component: VehiclePicker, closable: true, appContext: this.$.appContext, width: 960,
props: { props: {
selectType: 'checkbox', selectType: 'radio',
vehicleState: 'PRICED', vehicleState: 'PRICED',
}, },
onOk: (component): void => { onOk: (component): void => {
...@@ -90,36 +148,72 @@ export default class OrderAddForm extends EnhanceFormComponent<User> { ...@@ -90,36 +148,72 @@ export default class OrderAddForm extends EnhanceFormComponent<User> {
message.error("只能选择一辆待检测车辆"); message.error("只能选择一辆待检测车辆");
return; return;
} }
this.vehicleData = vehicles[0]; const vehicleData = vehicles[0];
this.postData.vehicleId = vehicleData.vehicleId;
this.vehicleData.carName = vehicleData?.baseInfo.carSeriesName + vehicleData?.baseInfo.carTypeName;
this.vehicleData.sourceNo = vehicleData?.baseInfo.sourceNo;
this.vehicleData.vin = vehicleData?.baseInfo.vin;
this.vehicleData.licensePlate = vehicleData?.baseInfo.licensePlate;
modal.destroy(); modal.destroy();
} }
}, },
}); });
} }
//删除车辆
deleteVehicle() {
this.postData.vehicleId = "";
this.vehicleData.carName = "";
this.vehicleData.sourceNo = "";
this.vehicleData.vin = "";
this.vehicleData.licensePlate = "";
}
//检测人员获取
getInspectPageList() {
DetectionController.inspectPage(this.axios, {}).then(response => {
this.inspectPageList = response?.data?.content || [];
})
}
onClose() {
this.dialogVisible = false;
}
handleOk() { handleOk() {
this.$refs.formRef.validate().then((valid) => { this.$refs.formRef.validate().then((valid) => {
if (valid) { if (valid) {
this.submitted = true; this.submitted = true;
const formData = { const formData = {
id: this.postData.id || "",
vehicleId: this.postData.vehicleId, vehicleId: this.postData.vehicleId,
inspectorId: this.postData.inspectorId, inspectorId: this.postData.inspectorId,
inspectionAddress: this.postData.inspectionAddress, inspectionAddress: this.postData.inspectionAddress,
remark: this.postData.remark, remark: this.postData.remark,
} }
if (this.postData.id) { if (this.postData.id) {
DetectionController.inspectUpdate(this.axios, formData).then(response => { DetectionController.inspectOrderUpdate(this.axios, formData).then(response => {
this.submitted = false; if (response?.data?.code === '1001006') {
this.$refs.promptDialogRef.showVisible();
} else if (response?.data?.code === '000000') {
message.success("更新成功"); message.success("更新成功");
this.$emit("emitOk"); this.$emit("emitOk");
this.dialogVisible = false; this.dialogVisible = false;
} else {
message.error(response?.data?.message || "操作失败");
}
}).finally(() => this.submitted = false); }).finally(() => this.submitted = false);
} else { } else {
DetectionController.inspectAdd(this.axios, formData).then(response => { DetectionController.inspectOrderAdd(this.axios, formData).then(response => {
this.submitted = false; if (response?.data?.code === '1001006') {
this.$refs.promptDialogRef.showVisible();
} else if (response?.data?.code === '000000') {
message.success("创建成功"); message.success("创建成功");
this.$emit("emitOk"); this.$emit("emitOk");
this.dialogVisible = false; this.dialogVisible = false;
} else {
message.error(response?.data?.message || "操作失败");
}
}).finally(() => this.submitted = false); }).finally(() => this.submitted = false);
} }
} }
...@@ -128,3 +222,20 @@ export default class OrderAddForm extends EnhanceFormComponent<User> { ...@@ -128,3 +222,20 @@ export default class OrderAddForm extends EnhanceFormComponent<User> {
} }
</script> </script>
<style scoped lang="less">
.vehicleData {
width: 628px;
padding: 16px;
border-radius: 8px;
background: #f7f8f9;
position: relative;
}
.vehicleDelete {
position: absolute;
top: 16px;
right: 16px;
z-index: 99;
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div>
<a-modal v-model:open="dialogVisible" title="取消工单" @ok="handleOk">
<a-spin :spinning="submitted" style="margin-top: 16px;">
<a-form layout="vertical" :model="postData" :label-col="labelCol" :wrapper-col="wrapperCol"
ref="formRef">
<div class="disabledTip">
<div class="outlinedBox">
<InfoCircleOutlined style="font-size: 15px; color: #FC8B0A;" />
</div>
<div class="disabledTxt">是否确认取消工单「{{ pageData.woId || '-' }}」?
<br>取消后将通知检测师「{{ pageData?.inspector?.name || '-' }}」,该操作不可撤销。
</div>
</div>
<a-form-item name="cancelType" label="取消原因" :rules="[{ required: true, message: '请选择取消原因' }]">
<a-select ref="select" v-model:value="postData.cancelType" placeholder="请选择取消原因"
style="width: 456px;">
<a-select-option value="车主取消">车主取消</a-select-option>
<a-select-option value="车辆已售">车辆已售</a-select-option>
<a-select-option value="重复派单">重复派单</a-select-option>
<a-select-option value="信息错误">信息错误</a-select-option>
</a-select>
</a-form-item>
<a-form-item name="cancelReason" label="备注说明">
<a-textarea v-model:value="postData.cancelReason" show-count :maxlength="500"
style="width: 456px;" />
</a-form-item>
</a-form>
</a-spin>
</a-modal>
</div>
</template>
<script lang="ts">
import { Component } from 'vue-facing-decorator';
import { EnhanceFormComponent } from "@/core/form/EnhanceFormComponent";
import { DetectionController } from "@/api/DetectionController";
import { message } from "ant-design-vue";
import { User } from "lib/src/entity/security/entity/User";
import { InfoCircleOutlined } from "@ant-design/icons-vue";
@Component({
components: { InfoCircleOutlined }
})
export default class cancelDialog extends EnhanceFormComponent<User> {
pageData = {};
dialogVisible = false;
postData = { id: '', cancelType: null, cancelReason: '' }
init(data): void {
this.pageData = data;
this.postData.id = data.id;
this.postData.cancelType = null;
this.postData.cancelReason = '';
this.dialogVisible = true;
}
handleOk() {
this.$refs.formRef.validate().then((valid) => {
if (valid) {
this.submitted = true;
const formData = {
id: this.postData.id,
cancelType: this.postData.cancelType,
cancelReason: this.postData.cancelReason,
}
DetectionController.inspectOrderCancel(this.axios, formData).then(response => {
message.success("操作成功");
this.$emit("emitOk");
this.dialogVisible = false;
}).finally(() => this.submitted = false);
}
});
}
}
</script>
<style scoped lang="less">
.tipBox {
width: 100%;
height: 22px;
line-height: 22px;
color: #2f3133;
font-size: 14px;
font-weight: 400;
font-family: "HarmonyOSSansSC";
}
.disabledTip {
width: 100%;
height: 68px;
border-radius: 4px;
background: #fc8b0a1a;
display: flex;
margin-bottom: 20px;
margin-top: 24px;
}
.outlinedBox {
float: left;
margin-left: 16px;
margin-top: 16px;
}
.disabledTxt {
padding-top: 14px;
padding-bottom: 14px;
padding-right: 16px;
padding-left: 8px;
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div>
<div class="pageBox_title">
工单详情 <span>工单单号:{{ pageData.woId || '-' }}</span>
</div>
<div class="pageBox">
<div style="width: 100%;float: left;">
<a-card class="tabs-card" :bordered="false">
<a-descriptions :column="2" size="small" layout="vertical">
<template #title>
<title-tip-icon></title-tip-icon>
工单信息
<div class="title-line"></div>
</template>
<a-descriptions-item label="工单单号">{{ pageData.woId || '-' }}</a-descriptions-item>
<a-descriptions-item label="检测单状态">
<a-tag v-if="pageData.status == 1" color="#FFF3E5" :style="{ color: '#F0A700' }"
:bordered="false">待检测</a-tag>
<a-tag v-if="pageData.status == 2" color="#E7F2FE" :style="{ color: '#288BFA' }"
:bordered="false">检测中</a-tag>
<a-tag v-if="pageData.status == 3" color="#E8F8F2" :style="{ color: '#00AD74' }"
:bordered="false">已完成</a-tag>
<a-tag v-if="pageData.status == 4" color="#F0F2F5" :style="{ color: '#777C85' }"
:bordered="false">已取消</a-tag>
</a-descriptions-item>
<a-descriptions-item label="审核状态">
<a-tag v-if="pageData.auditStatus == 1" color="#FFF3E5" :style="{ color: '#F0A700' }"
:bordered="false">待审核</a-tag>
<a-tag v-else-if="pageData.auditStatus == 2" color="#E7F2FE" :style="{ color: '#288BFA' }"
:bordered="false">审核中</a-tag>
<a-tag v-else-if="pageData.auditStatus == 3" color="#E8F8F2" :style="{ color: '#00AD74' }"
:bordered="false">审批通过</a-tag>
<a-tag v-else-if="pageData.auditStatus == 4" color="#FFEDED" :style="{ color: '#EB2F2F' }"
:bordered="false">审批驳回</a-tag>
</a-descriptions-item>
<a-descriptions-item label="创建时间">{{ pageData.createTime || '-' }}</a-descriptions-item>
<a-descriptions-item label="完成检测时间">{{ pageData.inspectionCompletedTime || '-'
}}</a-descriptions-item>
</a-descriptions>
<a-descriptions :column="2" size="small" layout="vertical">
<template #title>
<title-tip-icon></title-tip-icon>
车辆详细信息
<div class="title-line"></div>
</template>
<a-descriptions-item label="车型名称">
{{ pageData?.vehicle?.baseInfo?.carTypeName || '-' }}
</a-descriptions-item>
<a-descriptions-item label="车源号">
{{ pageData?.vehicle?.baseInfo?.sourceNo || '-' }}
</a-descriptions-item>
<a-descriptions-item label="VIN码">
{{ pageData?.vehicle?.baseInfo?.vin || '-' }}
</a-descriptions-item>
<a-descriptions-item label="车牌号">
{{ pageData?.vehicle?.baseInfo?.licensePlate || '-' }}
</a-descriptions-item>
<a-descriptions-item label="所属门店">
{{ pageData?.vehicle?.venue?.venueName || '-' }}
</a-descriptions-item>
<a-descriptions-item label="车辆状态">
<vehicle-state-tag :vehicle-state="pageData?.vehicle?.vehicleState"></vehicle-state-tag>
</a-descriptions-item>
<a-descriptions-item label="车辆所在地">
{{ pageData?.vehicle?.custodianInfo?.handoverAddress || '-' }}
</a-descriptions-item>
</a-descriptions>
<a-descriptions :column="2" size="small" layout="vertical">
<template #title>
<title-tip-icon></title-tip-icon>
车辆保管人信息
<div class="title-line"></div>
</template>
<a-descriptions-item label="保管人姓名">
{{ pageData?.vehicle?.custodianInfo?.custodianName || '-' }}
</a-descriptions-item>
<a-descriptions-item label="保管人电话">
{{ pageData?.vehicle?.custodianInfo?.custodianPhone || '-' }}
</a-descriptions-item>
</a-descriptions>
<a-descriptions :column="2" size="small" layout="vertical">
<template #title>
<title-tip-icon></title-tip-icon>
检测师信息
<div class="title-line"></div>
</template>
<a-descriptions-item label="检测师姓名">
{{ pageData?.inspector?.name || '-' }}
</a-descriptions-item>
<a-descriptions-item label="检测师电话">
{{ pageData?.inspector?.phone || '-' }}
</a-descriptions-item>
<a-descriptions-item label="检测地址">
{{ pageData?.inspector?.regionName || '-' }}
</a-descriptions-item>
</a-descriptions>
<a-descriptions :column="2" size="small" layout="vertical">
<template #title>
<title-tip-icon></title-tip-icon>
报告信息
<div class="title-line"></div>
</template>
<a-descriptions-item label="报告编号">
{{ inspectionReportResp?.reportNo || '-' }}
</a-descriptions-item>
<a-descriptions-item label="生成时间">
{{ inspectionReportResp?.createTime || '-' }}
</a-descriptions-item>
<a-descriptions-item label="更新时间">
{{ inspectionReportResp?.updateTime || '-' }}
</a-descriptions-item>
<a-descriptions-item label="关联工单">
{{ inspectionReportResp?.woId || '-' }}
</a-descriptions-item>
<a-descriptions-item label="绑定状态">
<a-tag v-if="inspectionReportResp.bindStatus == 1" color="#E8F8F2"
:style="{ color: '#00AD74' }" :bordered="false">已绑定</a-tag>
<a-tag v-if="inspectionReportResp.bindStatus == 2" color="#F0F2F5"
:style="{ color: '#777C85' }" :bordered="false">未绑定</a-tag>
</a-descriptions-item>
</a-descriptions>
<a-descriptions :column="1" size="small" layout="vertical">
<template #title>
<title-tip-icon></title-tip-icon>
检测报告H5链接
<div class="title-line"></div>
</template>
<a-descriptions-item label="">
<div class="linkBox">{{ inspectionReportResp?.h5Url || '-' }}</div>
</a-descriptions-item>
</a-descriptions>
</a-card>
</div>
</div>
</div>
</template>
<script lang="ts">
import { Component, Prop, Vue, Watch } from "vue-facing-decorator";
import { PaginationComponent } from "@/components/PaginationComponent";
import { Vehicle } from "lib/src/entity/vehicle/entity/Vehicle";
import TitleDivider from "@/components/TitleDivider.vue";
import TitleTipIcon from "@/components/icons/TitleTipIcon.vue";
import VehicleStateTag from "@/views/vehicle/inventory/VehicleStateTag.vue";
@Component({
components: { TitleDivider, TitleTipIcon, VehicleStateTag }
})
export default class DetectionOrderView extends PaginationComponent<Vehicle> {
@Prop({ type: Object, required: true })
pageData: any;
@Prop({ type: Object, required: true })
inspectionReportResp: any;
}
</script>
<style scoped lang="less">
.pageBox {
width: 100%;
float: left;
border-radius: 8px;
border: 1px solid #e1e3e6;
padding: 0 16px;
}
.pageBox_title {
width: 100%;
height: 24px;
float: left;
color: #202020;
font-size: 16px;
font-weight: 700;
line-height: 24px;
margin-top: 16px;
margin-bottom: 16px;
}
.pageBox_title span {
padding-left: 10px;
color: #9ca0a8;
font-size: 12px;
font-weight: 400;
}
.titleBox {
width: 100%;
height: 32px;
float: left;
}
.title-line {
width: 100%;
height: 1px;
background-color: #F2F4F7;
margin-top: 10px;
}
.linkBox {
width: 100%;
height: 40px;
line-height: 40px;
padding-left: 12px;
border-radius: 6px;
background: #f5f7fa;
color: #2f3133;
font-size: 14px;
font-weight: 400;
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div>
<div class="pageBox_title">
二手车检测报告 <span> 报告编号:GL202603120015</span>
</div>
</div>
</template>
<script lang="ts">
import { Component, Prop } from "vue-facing-decorator";
import { PaginationComponent } from "@/components/PaginationComponent";
import { Vehicle } from "lib/src/entity/vehicle/entity/Vehicle";
@Component({
components: {}
})
export default class DetectionOrderView extends PaginationComponent<Vehicle> {
@Prop({ type: Object, required: true })
pageData: any;
}
</script>
<style scoped lang="less">
.pageBox_title {
width: 100%;
height: 24px;
float: left;
color: #202020;
font-size: 16px;
font-weight: 700;
line-height: 24px;
margin-top: 16px;
margin-bottom: 16px;
}
.pageBox_title span {
padding-left: 10px;
color: #9ca0a8;
font-size: 12px;
font-weight: 400;
}
</style>
\ No newline at end of file \ No newline at end of file
<template> <template>
<div> <div>
<a-modal v-model:open="dialogVisible" width="760px" title="选择车辆" @ok="handleOk"> <a-modal v-model:open="dialogVisible" title="提示" @ok="handleOk">
<div class="tipBox">
<InfoCircleOutlined style="font-size: 15px; color: #FC8B0A;" />
<span style="padding-left: 8px;" >该车辆已有正在进行的检测工单,请勿重复创建</span>
</div>
</a-modal> </a-modal>
</div> </div>
</template> </template>
<script lang="ts"> <script lang="ts">
import { Component } from 'vue-facing-decorator'; import { Component } from 'vue-facing-decorator';
import { message } from "ant-design-vue";
import { EnhanceFormComponent } from "@/core/form/EnhanceFormComponent"; import { EnhanceFormComponent } from "@/core/form/EnhanceFormComponent";
import { User } from "lib/src/entity/security/entity/User"; import { User } from "lib/src/entity/security/entity/User";
import { InfoCircleOutlined } from "@ant-design/icons-vue";
@Component({ @Component({
components: {} components: { InfoCircleOutlined }
}) })
export default class selectVehicleForm extends EnhanceFormComponent<User> { export default class promptDialog extends EnhanceFormComponent<User> {
dialogVisible = false; dialogVisible = false;
vehicleId = '';
showVisible(): void {
init(): void {
this.vehicleId = '';
this.dialogVisible = true; this.dialogVisible = true;
} }
handleOk() { handleOk() {
this.dialogVisible = false;
} }
} }
</script> </script>
<style scoped lang="less"></style>
\ No newline at end of file \ No newline at end of file
<style scoped lang="less">
.tipBox {
width: 100%;
height: 22px;
line-height: 22px;
color: #2f3133;
font-size: 14px;
font-weight: 400;
font-family: "HarmonyOSSansSC";
}
</style>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!