绑定车辆

This commit is contained in:
PQZ 2024-08-03 16:16:28 +08:00
parent 2e559fc7d9
commit c82aecbdd8
6 changed files with 444 additions and 11 deletions

View File

@ -0,0 +1,235 @@
<template>
<div>
<!-- 对话框(添加 / 修改) -->
<el-drawer
title="选择车辆"
size="60%"
:visible.sync="drawVisible"
>
<!-- 搜索工作栏 -->
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="发动机号码" prop="engineNumber">
<el-input v-model="queryParams.engineNumber" placeholder="请输入发动机号码" clearable
@keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="车架号" prop="vin">
<el-input v-model="queryParams.vin" placeholder="请输入车架号" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="车牌号" prop="licenseNumber">
<el-input v-model="queryParams.licenseNumber" placeholder="请输入车牌号" clearable
@keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="车辆型号" prop="carModel">
<el-input v-model="queryParams.carModel" placeholder="请输入车辆型号" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="保养日期" prop="maintenanceDate">
<el-date-picker v-model="queryParams.maintenanceDate" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss"
type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"
:default-time="['00:00:00', '23:59:59']" />
</el-form-item>
<el-form-item label="保养里程" prop="maintenanceMileage">
<el-input v-model="queryParams.maintenanceMileage" placeholder="请输入保养里程" clearable
@keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="年检日期" prop="inspectionDate">
<el-date-picker v-model="queryParams.inspectionDate" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss"
type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"
:default-time="['00:00:00', '23:59:59']" />
</el-form-item>
<el-form-item label="保险日期" prop="insuranceDate">
<el-date-picker v-model="queryParams.insuranceDate" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss"
type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"
:default-time="['00:00:00', '23:59:59']" />
</el-form-item>
<el-form-item label="二级维护时间" prop="checkDate">
<el-date-picker v-model="queryParams.checkDate" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss"
type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"
:default-time="['00:00:00', '23:59:59']" />
</el-form-item>
<el-form-item label="车辆品牌" prop="carBrand">
<el-input v-model="queryParams.carBrand" placeholder="请输入车辆品牌" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="车辆性质" prop="carNature">
<el-input v-model="queryParams.carNature" placeholder="请输入车辆性质" clearable
@keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="车辆注册日期" prop="carRegisterDate">
<el-date-picker v-model="queryParams.carRegisterDate" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss"
type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"
:default-time="['00:00:00', '23:59:59']" />
</el-form-item>
<el-form-item label="最近办理业务" prop="recentlyHandledBusiness">
<el-input v-model="queryParams.recentlyHandledBusiness" placeholder="请输入最近办理业务" clearable
@keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="最近办理业务的时间" prop="recentlyHandleBusinessTime">
<el-date-picker v-model="queryParams.recentlyHandleBusinessTime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss"
type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"
:default-time="['00:00:00', '23:59:59']" />
</el-form-item>
<el-form-item label="行驶证图片" prop="carLicenseImg">
<el-input v-model="queryParams.carLicenseImg" placeholder="请输入行驶证图片" clearable
@keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="创建时间" prop="createTime">
<el-date-picker v-model="queryParams.createTime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss"
type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"
:default-time="['00:00:00', '23:59:59']" />
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<!-- 操作工具栏 -->
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="openForm(undefined)"
v-hasPermi="['base:car-main:create']">新增</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="formLoading" :data="list" :stripe="true" :show-overflow-tooltip="true">
<el-table-column label="主键标识" align="center" prop="id" />
<el-table-column label="发动机号码" align="center" prop="engineNumber" />
<el-table-column label="车架号" align="center" prop="vin" />
<el-table-column label="车牌号" align="center" prop="licenseNumber" />
<el-table-column label="车辆型号" align="center" prop="carModel" />
<el-table-column label="保养日期" align="center" prop="maintenanceDate" width="180">
<template v-slot="scope">
<span>{{ parseTime(scope.row.maintenanceDate) }}</span>
</template>
</el-table-column>
<el-table-column label="保养里程" align="center" prop="maintenanceMileage" />
<el-table-column label="年检日期" align="center" prop="inspectionDate" width="180">
<template v-slot="scope">
<span>{{ parseTime(scope.row.inspectionDate) }}</span>
</template>
</el-table-column>
<el-table-column label="保险日期" align="center" prop="insuranceDate" width="180">
<template v-slot="scope">
<span>{{ parseTime(scope.row.insuranceDate) }}</span>
</template>
</el-table-column>
<el-table-column label="二级维护时间" align="center" prop="checkDate" width="180">
<template v-slot="scope">
<span>{{ parseTime(scope.row.checkDate) }}</span>
</template>
</el-table-column>
<el-table-column label="车辆品牌" align="center" prop="carBrand" />
<el-table-column label="车辆性质" align="center" prop="carNature" />
<el-table-column label="车辆注册日期" align="center" prop="carRegisterDate" width="180">
<template v-slot="scope">
<span>{{ parseTime(scope.row.carRegisterDate) }}</span>
</template>
</el-table-column>
<el-table-column label="最近办理业务" align="center" prop="recentlyHandledBusiness" />
<el-table-column label="最近办理业务的时间" align="center" prop="recentlyHandleBusinessTime" width="180">
<template v-slot="scope">
<span>{{ parseTime(scope.row.recentlyHandleBusinessTime) }}</span>
</template>
</el-table-column>
<el-table-column label="行驶证图片" align="center" prop="carLicenseImg" />
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template v-slot="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
</el-table>
</el-drawer>
</div>
</template>
<script>
import * as CarMainApi from '@/api/base/carmain';
export default {
name: "ChooseCarDraw",
components: {
},
data() {
return {
//
//
drawVisible: false,
// 12
formLoading: false,
//
exportLoading: false,
//
showSearch: true,
//
formData:{},
//
list: [],
//
queryParams: {
pageNo: 1,
pageSize: 10,
engineNumber: null,
vin: null,
licenseNumber: null,
carModel: null,
maintenanceDate: [],
maintenanceMileage: null,
inspectionDate: [],
insuranceDate: [],
checkDate: [],
carBrand: null,
carNature: null,
carRegisterDate: [],
carLicenseImg: null,
createTime: [],
},
};
},
methods: {
/** 打开弹窗 */
async open() {
this.drawVisible = true;
this.formLoading = true;
try{
const res = await CarMainApi.getCarMainPage(this.queryParams);
this.list = res.data.records;
this.total = res.data.total;
}finally {
this.formLoading = false;
}
},
/** 查询列表 */
async getList() {
try {
const res = await CarMainApi.getCarMainPage(this.queryParams);
this.list = res.data.records;
this.total = res.data.total;
} finally {
}
},
/** 搜索按钮操作 */
handleQuery() {
debugger;
this.queryParams.pageNo = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 提交按钮 */
async submitForm() {
},
}
};
</script>

View File

@ -0,0 +1,141 @@
<template>
<div>
<!-- 对话框(添加 / 修改) -->
<el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="60%" v-dialogDrag append-to-body>
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>客户基本信息</span>
</div>
<el-descriptions class="margin-top" :column="3" border>
<el-descriptions-item>
<template slot="label">
客户名称
</template>
{{formData.cusName}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
性别
</template>
<dict-tag :type="DICT_TYPE.DICT_SYS_USER_SEX" :value="formData.sex" />
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
联系方式
</template>
{{formData.phoneNumber}}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
生日
</template>
{{ parseTime(formData.birthday,'{y}-{m}-{d}') }}
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
客户来源
</template>
<dict-tag :type="DICT_TYPE.DICT_CUS_DATA_FROM" :value="formData.dataFrom" />
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
最近办理业务
</template>
<dict-tag :type="DICT_TYPE.DICT_CUS_BUSI_TYPE" :value="formData.nearDoContent" />
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">
联系地址
</template>
{{formData.address}}
</el-descriptions-item>
</el-descriptions>
</el-card>
<el-card class="box-card">
<div slot="header" class="clearfix">
<span>车辆信息</span>
<el-button @click="openChooseCar" style="float: right; padding: 3px 0" type="text">选择车辆</el-button>
</div>
<el-row>
<el-col :span="8">
<el-card shadow="hover">
车辆1
</el-card>
</el-col>
<el-col :span="8">
<el-card shadow="hover">
车辆2
</el-card>
</el-col>
<el-col :span="8">
<el-card shadow="hover">
车辆3
</el-card>
</el-col>
<el-col :span="8">
<el-card shadow="hover">
车辆4
</el-card>
</el-col>
</el-row>
</el-card>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm" :disabled="formLoading"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
</div>
</el-dialog>
<ChooseCarDraw ref="chooseCarForm"/>
</div>
</template>
<script>
import * as CustomerMainApi from '@/api/base/customer';
import ChooseCarDraw from '@/views/base/customer/ChooseCarDraw.vue';
export default {
name: "CustomerMainForm",
components: {
ChooseCarDraw
},
data() {
return {
//
dialogTitle: "",
//
dialogVisible: false,
// 12
formLoading: false,
//
formData:{},
};
},
methods: {
/** 打开弹窗 */
async open(row) {
this.dialogVisible = true;
this.formLoading = true;
try{
const res = await CustomerMainApi.getCustomerMain(row.id);
this.formData = res.data
console.log(this.formData)
this.dialogTitle = "绑定车辆";
}finally {
this.formLoading = false;
}
},
openChooseCar(){
this.$refs["chooseCarForm"].open();
},
/** 提交按钮 */
async submitForm() {
},
}
};
</script>

View File

@ -0,0 +1,31 @@
<template>
<div>
</div>
</template>
<script>
import * as CustomerMainApi from '@/api/base/customer';
export default {
name: "BindCar",
data() {
return {
};
},
created() {
const row = this.$route.query.row
},
methods: {
/**通过id客户信息查询*/
getById(){
}
}
}
</script>
<style scoped>
</style>

View File

@ -43,7 +43,7 @@
border
size="mini"
style="width: 100%">
<el-table-column prop="cusName" label="经办人姓名" width="100"/>
<el-table-column align="center" prop="cusName" label="经办人姓名" width="100"/>
<el-table-column width="50" label="性别" align="center" prop="sex">
<template v-slot="scope">
<dict-tag :type="DICT_TYPE.DICT_SYS_USER_SEX" :value="scope.row.sex"/>
@ -55,7 +55,7 @@
<span>{{ parseTime(scope.row.birthday, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column width="280" label="住址" align="left" prop="address"/>
<el-table-column width="300" label="住址" align="left" prop="address"/>
<el-table-column
label="操作"
@ -122,7 +122,7 @@ import * as CustomerMainApi from '@/api/base/customer';
import CustomerMainForm from '@/views/base/customer/CustomerMainForm.vue';
export default {
name: "PersonCustomer",
name: "CorpCustomer",
components: {
CustomerMainForm,
},

View File

@ -34,7 +34,12 @@
</el-row>
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
<el-table-column width="100" label="客户名称" align="center" prop="cusName"/>
<el-table-column width="100" label="客户名称" align="center" prop="cusName">
<template v-slot="scope">
<el-button size="mini" type="text" @click="customerDetail(scope.row)"><span>{{ scope.row.cusName }}</span>
</el-button>
</template>
</el-table-column>
<el-table-column width="50" label="性别" align="center" prop="sex">
<template v-slot="scope">
<dict-tag :type="DICT_TYPE.DICT_SYS_USER_SEX" :value="scope.row.sex" />
@ -46,7 +51,7 @@
<span>{{ parseTime(scope.row.birthday,'{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column width="280" label="住址" align="left" prop="address"/>
<el-table-column width="300" label="住址" align="left" prop="address"/>
<el-table-column width="80" label="客户来源" align="center" prop="dataFrom">
<template v-slot="scope">
<dict-tag :type="DICT_TYPE.DICT_CUS_DATA_FROM" :value="scope.row.dataFrom" />
@ -75,7 +80,7 @@
align="center"
class-name="small-padding fixed-width">
<template v-slot="scope">
<el-button size="mini" type="text" icon="el-icon-truck" @click="handleDelete(scope.row)"
<el-button size="mini" type="text" icon="el-icon-truck" @click="bindCar(scope.row)"
v-hasPermi="['base:customer-main:car']">绑定车辆
</el-button>
<el-button size="mini" type="text" icon="el-icon-edit" @click="openForm(scope.row.id)"
@ -93,16 +98,18 @@
@pagination="getList"/>
<!-- 对话框(添加 / 修改) -->
<CustomerMainForm ref="formRef" @success="getList"/>
<CustomerCarForm ref="carFormRef" @success="getList"/>
</div>
</template>
<script>
import * as CustomerMainApi from '@/api/base/customer';
import CustomerMainForm from '@/views/base/customer/CustomerMainForm.vue';
import CustomerCarForm from '@/views/base/customer/CustomerCarForm.vue';
export default {
name: "PersonCustomer",
name: "PrivateCustomer",
components: {
CustomerMainForm,
CustomerMainForm,CustomerCarForm
},
props:{
typeCode: {
@ -169,6 +176,25 @@ export default {
}
},
/**
* 详情
*/
customerDetail(row){
this.$router.push({
name: "CustomerDetail",
query:{
row: row
}
});
},
/**
* 绑定车辆
*/
bindCar(row){
this.$refs["carFormRef"].open(row);
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNo = 1;

View File

@ -46,8 +46,8 @@
<span>{{ parseTime(scope.row.birthday,'{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column width="280" label="住址" align="left" prop="address"/>
<el-table-column width="80" label="客户来源" align="center" prop="dataFrom">
<el-table-column width="300" label="住址" align="left" prop="address"/>
<el-table-column width="100" label="客户来源" align="center" prop="dataFrom">
<template v-slot="scope">
<dict-tag :type="DICT_TYPE.DICT_CUS_DATA_FROM" :value="scope.row.dataFrom" />
</template>
@ -96,7 +96,7 @@
import * as CustomerMainApi from '@/api/base/customer';
import CustomerMainForm from '@/views/base/customer/CustomerMainForm.vue';
export default {
name: "PersonCustomer",
name: "TodoCustomer",
components: {
CustomerMainForm,
},