调整
This commit is contained in:
parent
6d153049e3
commit
a7cf0cc008
@ -1,33 +1,54 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="block">
|
<div class="block">
|
||||||
<el-cascader
|
<el-cascader
|
||||||
placeholder="搜索型号"
|
placeholder="车辆品牌型号"
|
||||||
:options="options"
|
:options="options"
|
||||||
v-model="selectedOptions"
|
v-model="selectedValues"
|
||||||
filterable/>
|
filterable/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import * as CarBrandSelectorApi from '@/layout/components/CarBrandSelector/Api';
|
import * as CarBrandSelectorApi from '@/layout/components/CarBrandSelector/Api';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
name: 'CarBrandSelector',
|
||||||
|
|
||||||
|
props: {
|
||||||
|
//v-model绑定的值
|
||||||
|
value: {
|
||||||
|
type: Array,
|
||||||
|
default: () => [],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
//子组件赋值
|
||||||
|
selectedValues:this.value,
|
||||||
|
options: [], //选项集合
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
watch: {
|
watch: {
|
||||||
selectedOptions(newVal, oldVal) {
|
value: {
|
||||||
console.log("newS is ", newVal);
|
immediate: true,
|
||||||
|
handler(newVal) {
|
||||||
|
this.selectedValues = newVal;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
selectedValues(newVal) {
|
||||||
|
this.$emit('input', newVal);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
created() {
|
created() {
|
||||||
this.getData();
|
this.getData();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 处理过滤方法
|
|
||||||
handleFilter(node, keyword) {
|
|
||||||
console.log(keyword, 'Filtering:');
|
|
||||||
//请求相关选项
|
|
||||||
this.getData(keyword);
|
|
||||||
},
|
|
||||||
getData(keyword) {
|
getData(keyword) {
|
||||||
|
// this.reset()
|
||||||
let param = {
|
let param = {
|
||||||
modelName: keyword,
|
modelName: keyword,
|
||||||
}
|
}
|
||||||
@ -35,18 +56,8 @@
|
|||||||
this.options = res.data
|
this.options = res.data
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
selectedOptions: [], // 存储已选择的选项
|
|
||||||
|
|
||||||
options: [], //选项集合
|
|
||||||
|
|
||||||
};
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
@ -12,10 +12,8 @@
|
|||||||
<el-form-item label="车牌号" prop="licenseNumber">
|
<el-form-item label="车牌号" prop="licenseNumber">
|
||||||
<el-input v-model="formData.licenseNumber" placeholder="请输入车牌号" />
|
<el-input v-model="formData.licenseNumber" placeholder="请输入车牌号" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="车辆型号" prop="carModel">
|
<el-form-item label="品牌型号" prop="carModel">
|
||||||
<!-- <el-input v-model="formData.carModel" placeholder="请输入车辆型号" /> -->
|
<CarBrandSelector v-model="formData.brandAndModel" ref="brandForm" />
|
||||||
<!-- <CarBrandSelector v-model="formData.carModel" ref="brandForm" /> -->
|
|
||||||
<CarBrandSelector v-model="tesst" ref="brandForm" />
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="保养日期" prop="maintenanceDate">
|
<el-form-item label="保养日期" prop="maintenanceDate">
|
||||||
<el-date-picker clearable v-model="formData.maintenanceDate" type="date" value-format="timestamp"
|
<el-date-picker clearable v-model="formData.maintenanceDate" type="date" value-format="timestamp"
|
||||||
@ -105,7 +103,7 @@ export default {
|
|||||||
engineNumber: undefined,
|
engineNumber: undefined,
|
||||||
vin: undefined,
|
vin: undefined,
|
||||||
licenseNumber: undefined,
|
licenseNumber: undefined,
|
||||||
carModel: undefined,
|
brandAndModel: [],
|
||||||
maintenanceDate: undefined,
|
maintenanceDate: undefined,
|
||||||
maintenanceMileage: undefined,
|
maintenanceMileage: undefined,
|
||||||
inspectionDate: undefined,
|
inspectionDate: undefined,
|
||||||
@ -146,16 +144,13 @@ export default {
|
|||||||
}
|
}
|
||||||
this.title = "新增车辆信息";
|
this.title = "新增车辆信息";
|
||||||
},
|
},
|
||||||
|
|
||||||
/** 提交按钮 */
|
/** 提交按钮 */
|
||||||
async submitForm() {
|
async submitForm() {
|
||||||
// 校验主表
|
// 校验主表
|
||||||
await this.$refs["formRef"].validate();
|
// await this.$refs["formRef"].validate();
|
||||||
this.formLoading = true;
|
this.formLoading = true;
|
||||||
try {
|
try {
|
||||||
console.log("before",this.formData);
|
|
||||||
this.formData.carModel = this.formData.carModel[this.formData.carModel.length-1];
|
|
||||||
console.log("after",this.formData);
|
|
||||||
|
|
||||||
const data = this.formData;
|
const data = this.formData;
|
||||||
// 修改的提交
|
// 修改的提交
|
||||||
if (data.id) {
|
if (data.id) {
|
||||||
@ -181,7 +176,7 @@ export default {
|
|||||||
engineNumber: undefined,
|
engineNumber: undefined,
|
||||||
vin: undefined,
|
vin: undefined,
|
||||||
licenseNumber: undefined,
|
licenseNumber: undefined,
|
||||||
carModel: undefined,
|
brandAndModel: [],
|
||||||
maintenanceDate: undefined,
|
maintenanceDate: undefined,
|
||||||
maintenanceMileage: undefined,
|
maintenanceMileage: undefined,
|
||||||
inspectionDate: undefined,
|
inspectionDate: undefined,
|
||||||
|
@ -104,8 +104,8 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="发动机号码" align="center" prop="engineNumber" width="180" />
|
<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="brandStr" />
|
||||||
<el-table-column label="车辆型号" align="center" prop="carModel" />
|
<el-table-column label="车辆型号" align="center" prop="modelStr" />
|
||||||
<!-- <el-table-column label="保养日期" align="center" prop="maintenanceDate" width="180">
|
<!-- <el-table-column label="保养日期" align="center" prop="maintenanceDate" width="180">
|
||||||
<template v-slot="scope">
|
<template v-slot="scope">
|
||||||
<span>{{ parseTime(scope.row.maintenanceDate,'{y}-{m}-{d}') }}</span>
|
<span>{{ parseTime(scope.row.maintenanceDate,'{y}-{m}-{d}') }}</span>
|
||||||
@ -317,7 +317,7 @@ export default {
|
|||||||
// this.$message({
|
// this.$message({
|
||||||
// type: 'info',
|
// type: 'info',
|
||||||
// message: '已取消删除'
|
// message: '已取消删除'
|
||||||
// });
|
// });
|
||||||
});
|
});
|
||||||
//如果确认删除
|
//如果确认删除
|
||||||
if (optionValue == 1) {
|
if (optionValue == 1) {
|
||||||
|
Loading…
Reference in New Issue
Block a user