新增车辆品牌维护;车辆基础信息管理优化
This commit is contained in:
parent
ac2ae6afa4
commit
e00cfc01dd
53
src/api/base/carbrand/index.js
Normal file
53
src/api/base/carbrand/index.js
Normal file
@ -0,0 +1,53 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 创建车辆品牌维护
|
||||
export function createCarBrand(data) {
|
||||
return request({
|
||||
url: '/base/carBrand/create',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 更新车辆品牌维护
|
||||
export function updateCarBrand(data) {
|
||||
return request({
|
||||
url: '/base/carBrand/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除车辆品牌维护
|
||||
export function deleteCarBrand(id) {
|
||||
return request({
|
||||
url: '/base/carBrand/delete?id=' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得车辆品牌维护
|
||||
export function getCarBrand(id) {
|
||||
return request({
|
||||
url: '/base/carBrand/get?id=' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得车辆品牌维护分页
|
||||
export function getCarBrandPage(params) {
|
||||
return request({
|
||||
url: '/base/carBrand/page',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
// 导出车辆品牌维护 Excel
|
||||
export function exportCarBrandExcel(params) {
|
||||
return request({
|
||||
url: '/base/carBrand/export-excel',
|
||||
method: 'get',
|
||||
params,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
53
src/api/base/carmodel/index.js
Normal file
53
src/api/base/carmodel/index.js
Normal file
@ -0,0 +1,53 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 创建车辆品牌型号
|
||||
export function createCarModel(data) {
|
||||
return request({
|
||||
url: '/base/carModel/create',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 更新车辆品牌型号
|
||||
export function updateCarModel(data) {
|
||||
return request({
|
||||
url: '/base/carModel/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除车辆品牌型号
|
||||
export function deleteCarModel(id) {
|
||||
return request({
|
||||
url: '/base/carModel/delete?id=' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得车辆品牌型号
|
||||
export function getCarModel(id) {
|
||||
return request({
|
||||
url: '/base/carModel/get?id=' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得车辆品牌型号分页
|
||||
export function getCarModelPage(params) {
|
||||
return request({
|
||||
url: '/base/carModel/page',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
// 导出车辆品牌型号 Excel
|
||||
export function exportCarModelExcel(params) {
|
||||
return request({
|
||||
url: '/base/carModel/export-excel',
|
||||
method: 'get',
|
||||
params,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
@ -102,6 +102,8 @@ export const DICT_TYPE = {
|
||||
DICT_CAR_NATURE : 'car_nature',
|
||||
//车辆类别
|
||||
DICT_CAR_CATEGORY : 'car_category',
|
||||
//品牌类型
|
||||
DICT_BRAND_TYPE : 'brand_type',
|
||||
//标签样式
|
||||
DICT_BASE_LABEL_TYPE : 'base_label_type',
|
||||
}
|
||||
|
134
src/views/base/carbrand/CarBrandForm.vue
Normal file
134
src/views/base/carbrand/CarBrandForm.vue
Normal file
@ -0,0 +1,134 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 对话框(添加 / 修改) -->
|
||||
<el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="45%" v-dialogDrag append-to-body>
|
||||
<el-form ref="formRef" :model="formData" :rules="formRules" v-loading="formLoading" label-width="100px">
|
||||
<el-form-item label="品牌名称" prop="brandName">
|
||||
<el-input v-model="formData.brandName" placeholder="请输入品牌名称" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="状态" prop="status">
|
||||
<el-radio-group v-model="formData.status">
|
||||
<el-radio label="1">请选择字典生成</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="formData.remark" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
<el-form-item label="车标图片">
|
||||
<ImageUpload v-model="formData.logoImg" :limit="1"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="品牌英文名称" prop="englishName">
|
||||
<el-input v-model="formData.englishName" placeholder="请输入品牌英文名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="品牌缩写" prop="abbName">
|
||||
<el-input v-model="formData.abbName" placeholder="请输入品牌缩写" />
|
||||
</el-form-item>
|
||||
<el-form-item label="品牌类型 " prop="brandType">
|
||||
<el-select v-model="formData.brandType" placeholder="请选择品牌类型 ">
|
||||
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.DICT_BRAND_TYPE)" :key="dict.value" :label="dict.label"
|
||||
:value="dict.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<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>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import * as CarBrandApi from '@/api/base/carbrand';
|
||||
import ImageUpload from '@/components/ImageUpload';
|
||||
export default {
|
||||
name: "CarBrandForm",
|
||||
components: {
|
||||
ImageUpload,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 弹出层标题
|
||||
dialogTitle: "",
|
||||
// 是否显示弹出层
|
||||
dialogVisible: false,
|
||||
// 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
formLoading: false,
|
||||
// 表单参数
|
||||
formData: {
|
||||
id: undefined,
|
||||
brandName: undefined,
|
||||
status: undefined,
|
||||
remark: undefined,
|
||||
logoImg: undefined,
|
||||
englishName: undefined,
|
||||
abbName: undefined,
|
||||
brandType: undefined,
|
||||
},
|
||||
// 表单校验
|
||||
formRules: {
|
||||
brandName: [{ required: true, message: '品牌名称不能为空', trigger: 'blur' }],
|
||||
// status: [{ required: true, message: '状态不能为空', trigger: 'blur' }],
|
||||
brandType: [{ required: true, message: '品牌类型 不能为空', trigger: 'change' }],
|
||||
},
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
/** 打开弹窗 */
|
||||
async open(id) {
|
||||
this.dialogVisible = true;
|
||||
this.reset();
|
||||
// 修改时,设置数据
|
||||
if (id) {
|
||||
this.formLoading = true;
|
||||
try {
|
||||
const res = await CarBrandApi.getCarBrand(id);
|
||||
this.formData = res.data;
|
||||
this.title = "修改车辆品牌维护";
|
||||
} finally {
|
||||
this.formLoading = false;
|
||||
}
|
||||
}
|
||||
this.title = "新增车辆品牌维护";
|
||||
},
|
||||
/** 提交按钮 */
|
||||
async submitForm() {
|
||||
// 校验主表
|
||||
await this.$refs["formRef"].validate();
|
||||
this.formLoading = true;
|
||||
try {
|
||||
const data = this.formData;
|
||||
// 修改的提交
|
||||
if (data.id) {
|
||||
await CarBrandApi.updateCarBrand(data);
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.dialogVisible = false;
|
||||
this.$emit('success');
|
||||
return;
|
||||
}
|
||||
// 添加的提交
|
||||
await CarBrandApi.createCarBrand(data);
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.dialogVisible = false;
|
||||
this.$emit('success');
|
||||
} finally {
|
||||
this.formLoading = false;
|
||||
}
|
||||
},
|
||||
/** 表单重置 */
|
||||
reset() {
|
||||
this.formData = {
|
||||
id: undefined,
|
||||
brandName: undefined,
|
||||
status: undefined,
|
||||
remark: undefined,
|
||||
logoImg: undefined,
|
||||
englishName: undefined,
|
||||
abbName: undefined,
|
||||
brandType: undefined,
|
||||
};
|
||||
this.resetForm("formRef");
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
127
src/views/base/carbrand/CarModelForm.vue
Normal file
127
src/views/base/carbrand/CarModelForm.vue
Normal file
@ -0,0 +1,127 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 对话框(添加 / 修改) -->
|
||||
<el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="45%" v-dialogDrag append-to-body>
|
||||
<el-form ref="formRef" :model="formData" :rules="formRules" v-loading="formLoading" label-width="100px">
|
||||
<el-form-item label="型号名称" prop="modelName">
|
||||
<el-input v-model="formData.modelName" placeholder="请输入型号名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="排序" prop="sort">
|
||||
<el-input-number v-model="formData.sort" controls-position="right" :min="0" />
|
||||
</el-form-item>
|
||||
<el-form-item label="型号缩写" prop="abbName">
|
||||
<el-input v-model="formData.abbName" placeholder="请输入型号缩写" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="formData.remark" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
<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>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import * as CarModelApi from '@/api/base/carmodel';
|
||||
export default {
|
||||
name: "CarModelForm",
|
||||
components: {
|
||||
},
|
||||
props: {
|
||||
brandId: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
},
|
||||
data() {
|
||||
|
||||
return {
|
||||
|
||||
// 弹出层标题
|
||||
dialogTitle: "",
|
||||
// 是否显示弹出层
|
||||
dialogVisible: false,
|
||||
// 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
formLoading: false,
|
||||
// 表单参数
|
||||
formData: {
|
||||
id: undefined,
|
||||
sort: 0,
|
||||
modelName: undefined,
|
||||
remark: undefined,
|
||||
abbName: undefined,
|
||||
},
|
||||
// 表单校验
|
||||
formRules: {
|
||||
sort: [{ required: true, message: '排序不能为空', trigger: 'blur' }],
|
||||
modelName: [{ required: true, message: '型号名称不能为空', trigger: 'blur' }],
|
||||
},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
|
||||
},
|
||||
mounted() {
|
||||
console.log(this.brandId, "brandIdpops");
|
||||
},
|
||||
methods: {
|
||||
/** 打开弹窗 */
|
||||
async open(id) {
|
||||
this.dialogVisible = true;
|
||||
this.reset();
|
||||
// 修改时,设置数据
|
||||
if (id) {
|
||||
this.formLoading = true;
|
||||
try {
|
||||
const res = await CarModelApi.getCarModel(id);
|
||||
this.formData = res.data;
|
||||
this.title = "修改车辆品牌型号";
|
||||
} finally {
|
||||
this.formLoading = false;
|
||||
}
|
||||
}
|
||||
this.title = "新增车辆品牌型号";
|
||||
},
|
||||
/** 提交按钮 */
|
||||
async submitForm() {
|
||||
// 校验主表
|
||||
await this.$refs["formRef"].validate();
|
||||
this.formLoading = true;
|
||||
try {
|
||||
const data = this.formData;
|
||||
data.brandId = this.brandId;
|
||||
// 修改的提交
|
||||
if (data.id) {
|
||||
await CarModelApi.updateCarModel(data);
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.dialogVisible = false;
|
||||
this.$emit('success');
|
||||
return;
|
||||
}
|
||||
// 添加的提交
|
||||
await CarModelApi.createCarModel(data);
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.dialogVisible = false;
|
||||
this.$emit('success');
|
||||
} finally {
|
||||
this.formLoading = false;
|
||||
}
|
||||
},
|
||||
/** 表单重置 */
|
||||
reset() {
|
||||
this.formData = {
|
||||
id: undefined,
|
||||
sort: 0,
|
||||
modelName: undefined,
|
||||
remark: undefined,
|
||||
abbName: undefined,
|
||||
};
|
||||
this.resetForm("formRef");
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
170
src/views/base/carbrand/data.vue
Normal file
170
src/views/base/carbrand/data.vue
Normal file
@ -0,0 +1,170 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 搜索工作栏 -->
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="排序" prop="sort">
|
||||
<el-input v-model="queryParams.sort" placeholder="请输入排序" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="型号名称" prop="modelName">
|
||||
<el-input v-model="queryParams.modelName" placeholder="请输入型号名称" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="queryParams.remark" 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 label="型号缩写" prop="abbName">
|
||||
<el-input v-model="queryParams.abbName" placeholder="请输入型号缩写" clearable @keyup.enter.native="handleQuery" />
|
||||
</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-model:create']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
|
||||
:loading="exportLoading" v-hasPermi="['base:car-model:export']">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
||||
<el-table-column label="序号" align="center" prop="num">
|
||||
<template slot-scope="scope">
|
||||
<span style="margin-left: 10px">{{ queryParams.pageSize * (queryParams.pageNo - 1) + scope.$index + 1
|
||||
}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="型号名称" align="center" prop="modelName" />
|
||||
<el-table-column label="型号缩写" align="center" prop="abbName" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<!-- <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-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template v-slot="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="openForm(scope.row.id)"
|
||||
v-hasPermi="['base:car-model:update']">修改</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['base:car-model:delete']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- 分页组件 -->
|
||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
|
||||
@pagination="getList" />
|
||||
<!-- 对话框(添加 / 修改) -->
|
||||
<CarModelForm ref="formRef" @success="getList" :brandId="brandId"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import * as CarModelApi from '@/api/base/carmodel';
|
||||
import CarModelForm from './CarModelForm.vue';
|
||||
export default {
|
||||
name: "CarModel",
|
||||
components: {
|
||||
CarModelForm,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
brandId:"" ,
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 导出遮罩层
|
||||
exportLoading: false,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 车辆品牌型号列表
|
||||
list: [],
|
||||
// 是否展开,默认全部展开
|
||||
isExpandAll: true,
|
||||
// 重新渲染表格状态
|
||||
refreshTable: true,
|
||||
// 选中行
|
||||
currentRow: {},
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
sort: null,
|
||||
modelName: null,
|
||||
remark: null,
|
||||
createTime: [],
|
||||
abbName: null,
|
||||
},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
debugger;
|
||||
console.log(this.$route.query,"params");
|
||||
this.brandId = this.$route.query && this.$route.query.brandId;
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询列表 */
|
||||
async getList() {
|
||||
try {
|
||||
console.log(this.brandId,"brandId");
|
||||
this.loading = true;
|
||||
this.queryParams.brandId = this.brandId;
|
||||
const res = await CarModelApi.getCarModelPage(this.queryParams);
|
||||
this.list = res.data.records;
|
||||
this.total = res.data.total;
|
||||
} finally {
|
||||
this.loading = false;
|
||||
}
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNo = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
/** 添加/修改操作 */
|
||||
openForm(id) {
|
||||
this.$refs["formRef"].open(id);
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
async handleDelete(row) {
|
||||
const id = row.id;
|
||||
await this.$modal.confirm('是否确认删除车辆品牌型号编号为"' + id + '"的数据项?')
|
||||
try {
|
||||
await CarModelApi.deleteCarModel(id);
|
||||
await this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
} catch { }
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
async handleExport() {
|
||||
await this.$modal.confirm('是否确认导出所有车辆品牌型号数据项?');
|
||||
try {
|
||||
this.exportLoading = true;
|
||||
const data = await CarModelApi.exportCarModelExcel(this.queryParams);
|
||||
this.$download.excel(data, '车辆品牌型号.xls');
|
||||
} catch {
|
||||
} finally {
|
||||
this.exportLoading = false;
|
||||
}
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
199
src/views/base/carbrand/index.vue
Normal file
199
src/views/base/carbrand/index.vue
Normal file
@ -0,0 +1,199 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 搜索工作栏 -->
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="品牌名称" prop="brandName" label-width="90">
|
||||
<el-input v-model="queryParams.brandName" placeholder="请输入品牌名称" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable size="small">
|
||||
<el-option label="请选择字典生成" value="" />
|
||||
</el-select>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="备注" prop="remark" label-width="90">
|
||||
<el-input v-model="queryParams.remark" placeholder="请输入备注" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间" prop="createTime" label-width="90">
|
||||
<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 label="品牌英文名称" prop="englishName" label-width="90">
|
||||
<el-input v-model="queryParams.englishName" placeholder="请输入品牌英文名称" clearable
|
||||
@keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="品牌缩写" prop="abbName" label-width="90">
|
||||
<el-input v-model="queryParams.abbName" placeholder="请输入品牌缩写" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="品牌类型" prop="brandType" label-width="90">
|
||||
<el-select v-model="queryParams.brandType" placeholder="请选择品牌类型" clearable size="small">
|
||||
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.DICT_BRAND_TYPE)" :key="dict.value" :label="dict.label"
|
||||
:value="dict.value" />
|
||||
</el-select>
|
||||
</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-brand:create']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
|
||||
:loading="exportLoading" v-hasPermi="['base:car-brand:export']">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
||||
<el-table-column label="序号" align="center" prop="num">
|
||||
<template slot-scope="scope">
|
||||
<span style="margin-left: 10px">{{ queryParams.pageSize * (queryParams.pageNo - 1) + scope.$index + 1
|
||||
}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="车标图片" align="center" prop="logoImg" />
|
||||
<el-table-column label="品牌名称" align="center" prop="brandName">
|
||||
<template v-slot="scope">
|
||||
<router-link class="link-type" @click="routeToData" :to="'car-model' + '?brandId=' + scope.row.id">
|
||||
<span>{{ scope.row.brandName }}</span>
|
||||
</router-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" align="center" prop="status" />
|
||||
|
||||
<el-table-column label="品牌英文名称" align="center" prop="englishName" />
|
||||
<el-table-column label="品牌缩写" align="center" prop="abbName" />
|
||||
<el-table-column label="品牌类型" align="center" prop="brandType">
|
||||
<template v-slot="scope">
|
||||
<dict-tag :type="DICT_TYPE.DICT_BRAND_TYPE" :value="scope.row.brandType" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<!-- <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-column fixed="right" label="操作" align="center" class-name="small-padding fixed-width" width="240">
|
||||
<template v-slot="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="openForm(scope.row.id)"
|
||||
v-hasPermi="['base:car-brand:update']">修改</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['base:car-brand:delete']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- 分页组件 -->
|
||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
|
||||
@pagination="getList" />
|
||||
<!-- 对话框(添加 / 修改) -->
|
||||
<CarBrandForm ref="formRef" @success="getList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import * as CarBrandApi from '@/api/base/carbrand';
|
||||
import CarBrandForm from './CarBrandForm.vue';
|
||||
export default {
|
||||
name: "CarBrand",
|
||||
components: {
|
||||
CarBrandForm,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 导出遮罩层
|
||||
exportLoading: false,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 车辆品牌维护列表
|
||||
list: [],
|
||||
// 是否展开,默认全部展开
|
||||
isExpandAll: true,
|
||||
// 重新渲染表格状态
|
||||
refreshTable: true,
|
||||
// 选中行
|
||||
currentRow: {},
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
brandName: null,
|
||||
status: null,
|
||||
remark: null,
|
||||
createTime: [],
|
||||
logoImg: null,
|
||||
englishName: null,
|
||||
abbName: null,
|
||||
brandType: null,
|
||||
},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询列表 */
|
||||
async getList() {
|
||||
try {
|
||||
this.loading = true;
|
||||
const res = await CarBrandApi.getCarBrandPage(this.queryParams);
|
||||
this.list = res.data.records;
|
||||
this.total = res.data.total;
|
||||
} finally {
|
||||
this.loading = false;
|
||||
}
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNo = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
routeToData() {
|
||||
|
||||
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
/** 添加/修改操作 */
|
||||
openForm(id) {
|
||||
this.$refs["formRef"].open(id);
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
async handleDelete(row) {
|
||||
const id = row.id;
|
||||
await this.$modal.confirm('是否确认删除车辆品牌维护编号为"' + id + '"的数据项?')
|
||||
try {
|
||||
await CarBrandApi.deleteCarBrand(id);
|
||||
await this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
} catch { }
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
async handleExport() {
|
||||
await this.$modal.confirm('是否确认导出所有车辆品牌维护数据项?');
|
||||
try {
|
||||
this.exportLoading = true;
|
||||
const data = await CarBrandApi.exportCarBrandExcel(this.queryParams);
|
||||
this.$download.excel(data, '车辆品牌维护.xls');
|
||||
} catch {
|
||||
} finally {
|
||||
this.exportLoading = false;
|
||||
}
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
@ -64,7 +64,7 @@
|
||||
placeholder="选择最近办理业务的时间" />
|
||||
</el-form-item>
|
||||
<el-form-item label="行驶证图片">
|
||||
<ImageUpload v-model="formData.carLicenseImg"/>
|
||||
<ImageUpload v-model="formData.carLicenseImg" :limit="1"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
|
@ -46,8 +46,7 @@
|
||||
<el-input v-model="queryParams.carBrand" placeholder="请输入车辆品牌" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="车辆性质" prop="carNature" label-width="90">
|
||||
<el-input v-model="queryParams.carNature" placeholder="请输入车辆性质" clearable
|
||||
@keyup.enter.native="handleQuery" />
|
||||
<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"
|
||||
@ -87,18 +86,25 @@
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true" >
|
||||
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
||||
<!-- <el-table-column label="主键标识" align="center" prop="id" /> -->
|
||||
|
||||
<el-table-column label="序号" align="center" prop="num" >
|
||||
<el-table-column label="序号" align="center" prop="num">
|
||||
<template slot-scope="scope">
|
||||
<span style="margin-left: 10px">{{ queryParams.pageSize * (queryParams.pageNo - 1) + scope.$index + 1 }}</span>
|
||||
<span style="margin-left: 10px">{{ queryParams.pageSize * (queryParams.pageNo - 1) + scope.$index + 1
|
||||
}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="车牌号" align="center" prop="licenseNumber" width="150">
|
||||
<template v-slot="scope">
|
||||
<router-link :to="'./check/' + scope.row.id" class="link-type">
|
||||
<span>{{ scope.row.licenseNumber }}</span>
|
||||
</router-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="车牌号" align="center" prop="licenseNumber" width="150"/>
|
||||
<el-table-column label="发动机号码" align="center" prop="engineNumber" width="180" />
|
||||
<el-table-column label="车架号" align="center" prop="vin" width="150"/>
|
||||
|
||||
<el-table-column label="车架号" align="center" prop="vin" width="150" />
|
||||
<el-table-column label="车辆品牌" align="center" prop="carBrand" />
|
||||
<el-table-column label="车辆型号" align="center" prop="carModel" />
|
||||
<!-- <el-table-column label="保养日期" align="center" prop="maintenanceDate" width="180">
|
||||
<template v-slot="scope">
|
||||
@ -121,20 +127,20 @@
|
||||
<span>{{ parseTime(scope.row.checkDate,'{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="车辆品牌" align="center" prop="carBrand" />
|
||||
<el-table-column label="车辆类别" align="center" prop="carCategory" >
|
||||
|
||||
<el-table-column label="车辆类别" align="center" prop="carCategory">
|
||||
<template v-slot="scope">
|
||||
<dict-tag :type="DICT_TYPE.DICT_CAR_CATEGORY" :value="scope.row.carCategory" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="车辆性质" align="center" prop="carNature" >
|
||||
<el-table-column label="车辆性质" align="center" prop="carNature">
|
||||
<template v-slot="scope">
|
||||
<dict-tag :type="DICT_TYPE.DICT_CAR_NATURE" :value="scope.row.carNature" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="车辆注册日期" align="center" prop="carRegisterDate" width="130">
|
||||
<template v-slot="scope">
|
||||
<span>{{ parseTime(scope.row.carRegisterDate,'{y}-{m}-{d}') }}</span>
|
||||
<span>{{ parseTime(scope.row.carRegisterDate, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="最近办理业务" align="center" prop="recentlyHandledBusiness" width="130">
|
||||
@ -144,27 +150,39 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="最近办理业务的时间" align="center" prop="recentlyHandleBusinessTime" width="150">
|
||||
<template v-slot="scope">
|
||||
<span>{{ parseTime(scope.row.recentlyHandleBusinessTime,'{y}-{m}-{d}') }}</span>
|
||||
<span>{{ parseTime(scope.row.recentlyHandleBusinessTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="行驶证图片" align="center" prop="carLicenseImg" /> -->
|
||||
<el-table-column label="登记时间" align="center" prop="createTime" width="120">
|
||||
<template v-slot="scope">
|
||||
<span>{{ parseTime(scope.row.createTime,'{y}-{m}-{d}') }}</span>
|
||||
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="240">
|
||||
<el-table-column fixed="right" label="操作" align="center" class-name="small-padding fixed-width" width="200">
|
||||
<template v-slot="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="openForm(scope.row.id)"
|
||||
v-hasPermi="['base:car-main:update']">查看详情</el-button>
|
||||
<!-- <el-button size="mini" type="text" icon="el-icon-edit" @click="openForm(scope.row.id)"
|
||||
v-hasPermi="['base:car-main:update']">查看详情</el-button> -->
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="openForm(scope.row.id)"
|
||||
v-hasPermi="['base:car-main:update']">修改</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="openForm(scope.row.id)"
|
||||
v-hasPermi="['base:car-main:update']">打标签</el-button>
|
||||
<!-- <el-button size="mini" type="text" icon="el-icon-edit" @click="openForm(scope.row.id)"
|
||||
|
||||
<!-- <el-button size="mini" type="text" icon="el-icon-edit" @click="openForm(scope.row.id)"
|
||||
v-hasPermi="['base:car-main:update']">推送提醒</el-button> -->
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['base:car-main:delete']">删除</el-button>
|
||||
|
||||
<el-dropdown @command="(command) => handleCommand(command, scope.$index, scope.row)"
|
||||
v-hasPermi="['base:car-main:update']">
|
||||
<el-button size="mini" type="text" icon="el-icon-d-arrow-right">更多</el-button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item command="bindCustomer" size="mini" type="text" icon="el-icon-truck"
|
||||
v-hasPermi="['base:customer-main:bindCustomer']">绑定客户</el-dropdown-item>
|
||||
<el-dropdown-item command="markSign" size="mini" type="text" icon="el-icon-truck"
|
||||
v-hasPermi="['base:customer-main:markSign']">打标签</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
|
||||
</el-dropdown>
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@ -179,7 +197,7 @@
|
||||
<script>
|
||||
import * as CarMainApi from '@/api/base/carmain';
|
||||
import CarMainForm from './CarMainForm.vue';
|
||||
import {getDictDatas, DICT_TYPE, getDictData} from '@/utils/dict';
|
||||
import { getDictDatas, DICT_TYPE, getDictData } from '@/utils/dict';
|
||||
export default {
|
||||
name: "CarMain",
|
||||
components: {
|
||||
@ -228,6 +246,20 @@ export default {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/**更多操作*/
|
||||
handleCommand(command, index, row) {
|
||||
switch (command) {
|
||||
case 'markSign':
|
||||
this.openForm(row.id);
|
||||
break;
|
||||
case 'bindCustomer':
|
||||
//绑定车辆信息
|
||||
this.openForm(row.id);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
},
|
||||
/** 查询列表 */
|
||||
async getList() {
|
||||
debugger;
|
||||
@ -259,15 +291,60 @@ export default {
|
||||
/** 删除按钮操作 */
|
||||
async handleDelete(row) {
|
||||
const id = row.id;
|
||||
await this.$modal.confirm('是否确认删除该条车辆信息?')
|
||||
if(row.recentlyHandleBusiness){
|
||||
await this.$modal.confirm('该车曾于 "' + parseTime(row.recentlyHandleBusinessTime,'{y}-{m}-{d}') + '" 发生过 "' + this.getDictData(DICT_CUS_BUSI_TYPE,row.recentlyHandleBusiness) + '" 业务,是否继续删除?')
|
||||
debugger;
|
||||
|
||||
|
||||
let optionValue = 0;
|
||||
await this.$confirm('是否确认删除该条车辆信息?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
debugger;
|
||||
optionValue = 1;
|
||||
}).catch(() => {
|
||||
// this.$message({
|
||||
// type: 'info',
|
||||
// message: '已取消删除'
|
||||
// });
|
||||
});
|
||||
//如果确认删除
|
||||
if (optionValue == 1) {
|
||||
//判断是否发生过业务
|
||||
if (row.recentlyHandledBusiness != null && row.recentlyHandledBusiness != "") {
|
||||
let businessObj = getDictData(DICT_TYPE.DICT_CUS_BUSI_TYPE, row.recentlyHandledBusiness);
|
||||
this.$confirm('该车曾于 "' + this.parseTime(row.recentlyHandleBusinessTime, '{y}-{m}-{d}') + '" 发生过 "' + businessObj.label + '" 业务,是否继续删除?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
debugger;
|
||||
|
||||
CarMainApi.deleteCarMain(id).then(() => {
|
||||
this.getList();
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '删除成功!'
|
||||
});
|
||||
});
|
||||
|
||||
})
|
||||
|
||||
} else {
|
||||
debugger;
|
||||
|
||||
CarMainApi.deleteCarMain(id).then(() => {
|
||||
this.getList();
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '删除成功!'
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
try {
|
||||
await CarMainApi.deleteCarMain(id);
|
||||
await this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
} catch { }
|
||||
|
||||
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
async handleExport() {
|
||||
|
Loading…
Reference in New Issue
Block a user