Commit b9e39214 by cwq0219

预录客户-车架号,车型

1 parent 0ecd4aa1
<template>
<el-row class="table-header">
<el-col :span="12">
<d2-el-icon
name="s-grid"
class="grid"
/>
<span v-text="title"></span>
<slot name="left"></slot>
</el-col>
......
......@@ -195,7 +195,6 @@
v-if="form.carChildsBrandId"
v-model="form.carSeriesId"
placeholder="请选择车系"
@change="getCarType(form.carSeriesId)"
style="width:150px; margin-right: 20px;"
>
<el-option
......@@ -205,7 +204,7 @@
:label="item.carSeriesName"
/>
</el-select>
<el-select
<!-- <el-select
v-if="form.carSeriesId"
v-model="form.carTypeId"
placeholder="请选择车型"
......@@ -218,7 +217,7 @@
:value="item.id"
:label="item.name"
/>
</el-select>
</el-select> -->
</el-form-item>
<el-form-item
label="车架号:"
......@@ -232,6 +231,7 @@
placeholder="请输入车架号"
clearable
/>
<p class="tips">完整的车架号是17位的车辆识别代码(VIN码)</p>
</el-form-item>
<el-form-item
label="钥匙号:"
......@@ -346,7 +346,7 @@
import _ from 'lodash'
import { Util } from '@/common/util'
import util from '@/libs/util'
import { getServiceStore, getParkStore, getStaff, getCarInfo, getCarType, getGoods, addOrder, editOrder } from '@api/editCustomer'
import { getServiceStore, getParkStore, getStaff, getCarInfo, getGoods, addOrder, editOrder } from '@api/editCustomer'
import { BaseData } from '@/common/constants.js'
import { mapActions } from 'vuex'
export default {
......@@ -361,15 +361,15 @@ export default {
}
function checkContacts(rule, value, callback) {
if (value) {
if (value.length != 17) {
callback(new Error('车架号必须为17位数字或字符'))
// if (value.length != 17) {
// callback(new Error('车架号必须为17位数字或字符'))
// return false
// } else {
if (Util.validationInput(value)) {
callback(new Error('车架号必须为数字或字符'))
return false
} else {
if (Util.validationInput(value)) {
callback(new Error('车架号必须为17位数字或字符'))
return false
}
}
// }
}
callback()
}
......@@ -398,7 +398,7 @@ export default {
carBrandOptions: [],
carSmallBrandOptions: [],
carSeriesOptions: [],
carTypeOptions: [],
// carTypeOptions: [],
goodsType: '',
productTypeList: [],
TB_height: 90,
......@@ -471,9 +471,9 @@ export default {
this.form.carChildsBrandId = this.$route.params.form.carChildsBrandId
this.$route.params.form.carSeriesId && this.changeCarSmallBrand(this.form.carChildsBrandId, () => {
this.form.carSeriesId = this.$route.params.form.carSeriesId
this.$route.params.form.carTypeId && this.getCarType(this.form.carSeriesId, () => {
this.form.carTypeId = this.$route.params.form.carTypeId
})
// this.$route.params.form.carTypeId && this.getCarType(this.form.carSeriesId, () => {
// this.form.carTypeId = this.$route.params.form.carTypeId
// })
})
})
})
......@@ -563,7 +563,7 @@ export default {
this.carSmallBrandOptions = []
this.$set(this.form, 'carChildsBrandId', '')
this.$set(this.form, 'carSeriesId', '')
this.$set(this.form, 'carTypeId', '')
// this.$set(this.form, 'carTypeId', '')
for (var i = 0; i < this.carInfoList.length; i++) {
if (this.carInfoList[i].carBrandId == id) {
this.carSmallBrandOptions.push(this.carInfoList[i])
......@@ -583,7 +583,7 @@ export default {
// 获取车系
changeCarSmallBrand(id, fn = () => { }) {
this.$set(this.form, 'carSeriesId', '')
this.$set(this.form, 'carTypeId', '')
// this.$set(this.form, 'carTypeId', '')
this.carSeriesOptions = []
for (var i = 0; i < this.carInfoList.length; i++) {
if (this.carInfoList[i].carChildsBrandId == id) {
......@@ -604,25 +604,25 @@ export default {
},
// 根据车系id获取车辆类型
getCarType(id, fn = () => { }) {
this.$set(this.form, 'carTypeId', '')
this.carTypeOptions = []
if (id) {
const params = { 'seriesId': id }
getCarType(params).then(res => {
this.carTypeOptions = res || []
const o = this.carSeriesOptions.find(k => k.carSeriesId == id)
this.form.carSeriesName = o.carSeriesName
})
fn()
}
},
changeCarType(id) {
const o = this.carTypeOptions.find(k => k.id == id)
this.form.carTypeName = o.name
},
// getCarType(id, fn = () => { }) {
// this.$set(this.form, 'carTypeId', '')
// this.carTypeOptions = []
// if (id) {
// const params = { 'seriesId': id }
// getCarType(params).then(res => {
// this.carTypeOptions = res || []
// const o = this.carSeriesOptions.find(k => k.carSeriesId == id)
// this.form.carSeriesName = o.carSeriesName
// })
// fn()
// }
// },
// changeCarType(id) {
// const o = this.carTypeOptions.find(k => k.id == id)
// this.form.carTypeName = o.name
// },
searchGoods() {
/** 根据门店商户号获取基础商品列表 */
......@@ -720,10 +720,10 @@ export default {
customer.carSeriesId = this.form.carSeriesId
customer.carSeriesName = this.form.carSeriesName
}
if (this.form.carTypeId) {
customer.carTypeId = this.form.carTypeId
customer.carTypeName = this.form.carTypeName
}
// if (this.form.carTypeId) {
// customer.carTypeId = this.form.carTypeId
// customer.carTypeName = this.form.carTypeName
// }
if (this.form.carKeyNo) {
customer.carKeyNo = this.form.carKeyNo
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!