Commit 6a506788 by yancanhua

fix:检测师功能开发

1 parent 076f27b1
...@@ -2,7 +2,7 @@ import { RouteRecordRaw } from "vue-router"; ...@@ -2,7 +2,7 @@ import { RouteRecordRaw } from "vue-router";
export const DetectionRouter: Array<RouteRecordRaw> = [ export const DetectionRouter: Array<RouteRecordRaw> = [
{ {
path: '/detection/detectionOrder', path: '/detection/order',
component: () => import('@/views/detection/order/DetectionOrderPage.vue'), component: () => import('@/views/detection/order/DetectionOrderPage.vue'),
meta: { meta: {
breadcrumbs: [{ name: '检测管理' }, { name: '检测订单管理' }] breadcrumbs: [{ name: '检测管理' }, { name: '检测订单管理' }]
...@@ -16,7 +16,7 @@ export const DetectionRouter: Array<RouteRecordRaw> = [ ...@@ -16,7 +16,7 @@ export const DetectionRouter: Array<RouteRecordRaw> = [
} }
}, },
{ {
path: '/detection/detectionReport', path: '/detection/report',
component: () => import('@/views/detection/report/DetectionReportPage.vue'), component: () => import('@/views/detection/report/DetectionReportPage.vue'),
meta: { meta: {
breadcrumbs: [{ name: '检测管理' }, { name: '检测报告管理' }] breadcrumbs: [{ name: '检测管理' }, { name: '检测报告管理' }]
...@@ -30,7 +30,7 @@ export const DetectionRouter: Array<RouteRecordRaw> = [ ...@@ -30,7 +30,7 @@ export const DetectionRouter: Array<RouteRecordRaw> = [
} }
}, },
{ {
path: '/detection/detectionInspector', path: '/detection/inspector',
component: () => import('@/views/detection/inspector/DetectionInspectorPage.vue'), component: () => import('@/views/detection/inspector/DetectionInspectorPage.vue'),
meta: { meta: {
breadcrumbs: [{ name: '检测管理' }, { name: '检测师管理' }] breadcrumbs: [{ name: '检测管理' }, { name: '检测师管理' }]
......
<template> <template>
<a-card class="tabs-card" :bordered="false"> <a-card class="tabs-card" :bordered="false">
<!--查询栏--> <!--查询栏-->
<m-pagination-query-render :fields="pagination.filterFields" :form="pagination.queryForm" @onSearch="pageReload" <m-pagination-query-render :fields="pagination.filterFields" :form="pagination.queryForm" @onSearch="pageReload"
@onReset="pageReset" :simpleFieldNum="4" /> @onReset="pageReset" :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 项 检测师列表
<a-button>批量绑定</a-button>
<a-button>批量解绑</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="downloadExcel" :disabled="exporting">导出</a-button> <a-button type="primary" @click="handleAdd()" >新增检测师</a-button>
<a-button @click="downloadExcel" :disabled="exporting">导出</a-button>
</div> </div>
</div> </div>
...@@ -28,6 +25,8 @@ ...@@ -28,6 +25,8 @@
</template> </template>
</a-table> </a-table>
<InspectorAddForm ref="inspectorAddFormRef" />
</a-card> </a-card>
</template> </template>
<script lang="ts"> <script lang="ts">
...@@ -41,10 +40,13 @@ import { Vehicle } from "lib/src/entity/vehicle/entity/Vehicle"; ...@@ -41,10 +40,13 @@ 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 InspectorAddForm from "@/views/detection/inspector/components/InspectorAddForm.vue";
@Component({ @Component({
components: { VehicleStateTag } components: { InspectorAddForm }
}) })
export default class AppraiseVehiclePricePage extends PaginationComponent<Vehicle> { export default class detectionInspectorPage extends PaginationComponent<Vehicle> {
vehicleStateIndex = "0"; vehicleStateIndex = "0";
exporting = false; exporting = false;
...@@ -98,6 +100,9 @@ export default class AppraiseVehiclePricePage extends PaginationComponent<Vehicl ...@@ -98,6 +100,9 @@ export default class AppraiseVehiclePricePage extends PaginationComponent<Vehicl
this.pagination.setDefaultSort('createTime', Order.desc); this.pagination.setDefaultSort('createTime', Order.desc);
} }
handleAdd(): void {
this.$refs.inspectorAddFormRef.init({});
}
downloadExcel(): void { downloadExcel(): void {
// this.exporting = true; // this.exporting = true;
......
<template> <template>
<div> <div>
<a-modal v-model:open="open" title="Basic Modal" @ok="handleOk"> <a-modal v-model:open="dialogVisible" :title="titleVisible" @ok="handleOk">
<a-spin :spinning="submitted"> <a-spin :spinning="submitted" style="margin-top: 16px;">
<a-form :model="postData" :label-col="labelCol" :wrapper-col="wrapperCol" ref="formRef"> <a-form layout="vertical" :model="postData" :label-col="labelCol" :wrapper-col="wrapperCol"
ref="formRef">
<a-form-item name="realName" label="姓名" <a-form-item name="realName" label="姓名"
:rules="[{ required: true, message: '请输入姓名' }, { pattern: /^(?:[\u4e00-\u9fa5]{1,10}|[a-zA-Z]{2,20})$/, message: '请输入1-10个中文字符或2-20个英文字符' }]"> :rules="[{ required: true, message: '请输入检测室真实姓名' }, { pattern: /^(?:[\u4e00-\u9fa5]{1,10}|[a-zA-Z]{2,20})$/, message: '请输入1-10个中文字符或2-20个英文字符' }]">
<a-input v-model:value="postData.realName" placeholder="请输入姓名" :maxlength="20" /> <a-input v-model:value="postData.realName" placeholder="请输入检测室真实姓名" :maxlength="20"
style="width: 376px;" />
</a-form-item> </a-form-item>
<a-form-item name="mobile" label="手机号码" <a-form-item name="mobile" label="手机号码"
:rules="[{ required: true, message: '请输入手机号码' }, { pattern: /^1(3|4|5|6|7|8|9)\d{9}$/, message: '请输入正确的11位手机号码' }]"> :rules="[{ required: true, message: '请输入11位手机号' }, { pattern: /^1(3|4|5|6|7|8|9)\d{9}$/, message: '请输入正确的11位手机号码' }]">
<a-input v-model:value="postData.mobile" placeholder="请输入手机号码" :maxlength="11" /> <a-input v-model:value="postData.mobile" placeholder="请输入11位手机号" :maxlength="11"
style="width: 376px;" />
</a-form-item> </a-form-item>
<a-form-item label="所在城市" name="registrationCity" <a-form-item label="所在城市" name="registrationCity"
:rules="[{ required: true, message: '请选择所在城市!' }]"> :rules="[{ required: true, message: '请选择所在城市!' }]">
<a-cascader style="width: 100%;" v-model:value="postData.registrationCity" :options="areaData" <a-cascader v-model:value="postData.registrationCity" :options="areaData" placeholder="请选择所在城市"
placeholder="请选择所在城市" /> style="width: 376px;" />
</a-form-item> </a-form-item>
<a-form-item name="enabled" label="账号状态" :rules="[{ required: true, message: '请选择账号状态' }]"> <a-form-item name="enabled" label="账号状态" :rules="[{ required: true, message: '请选择账号状态' }]">
<a-switch v-model:checked="postData.enabled" /> <a-switch v-model:checked="postData.enabled" />
<span style="padding-left: 8px;">{{ postData.enabled ? '启用' : '禁用' }}</span>
</a-form-item> </a-form-item>
</a-form> </a-form>
</a-spin> </a-spin>
...@@ -38,32 +42,33 @@ import { DefaultOptionType } from "ant-design-vue/es/vc-cascader/Cascader"; ...@@ -38,32 +42,33 @@ import { DefaultOptionType } from "ant-design-vue/es/vc-cascader/Cascader";
import { convertToTree } from "@/common/chinaarea"; import { convertToTree } from "@/common/chinaarea";
@Component({ @Component({
components: {} components: {}
}) })
export default class InspectorAddForm extends EnhanceFormComponent<User> { export default class InspectorAddForm extends EnhanceFormComponent<User> {
areaData: DefaultOptionType[] = [];
dialogVisible = false;
titleVisible = "新增检测师";
postData={ postData = {
realName: "", realName: "",
mobile: "", mobile: "",
registrationCity: "", registrationCity: "",
enabled: true, enabled: true,
} }
formState = {
realName: "",
mobile: "",
}
areaData: DefaultOptionType[] = [];
created(): void { created(): void {
this.areaData = convertToTree(false); this.areaData = convertToTree(false);
} }
init(data): void {
console.log('1111111111111111111111111111111111', data);
this.dialogVisible = true;
this.titleVisible = data.id ? "编辑检测师" : "新增检测师";
}
handleOk() { handleOk() {
this.$refs.formRef.validate().then((valid) => { this.$refs.formRef.validate().then((valid) => {
if (valid) { if (valid) {
...@@ -80,7 +85,6 @@ export default class InspectorAddForm extends EnhanceFormComponent<User> { ...@@ -80,7 +85,6 @@ export default class InspectorAddForm extends EnhanceFormComponent<User> {
} }
}); });
} }
} }
</script> </script>
\ 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!