Commit 5d5945f5 by zhangquan

bug修复

1 parent fcb46b4d
......@@ -9,10 +9,10 @@
</div>
<div slot="selectBrandSlot">
<el-radio-group v-model="formObj.applyBrandType">
<el-radio :label="1">全部品牌</el-radio>
<el-radio :label="2">部分品牌</el-radio>
<el-radio :label="0">全部品牌</el-radio>
<el-radio :label="1">部分品牌</el-radio>
</el-radio-group>
<div v-if="formObj.applyBrandType == 2">
<div v-if="formObj.applyBrandType == 1">
<el-button class="el-icon-plus" size="small" @click="openBrandDialog">选择品牌</el-button>
<div class="brand-wrap" v-if="brandList && brandList.length">
<div class="brand-item" v-for="item in brandList" :key="item.id">{{ item.name }}</div>
......@@ -47,7 +47,7 @@ export default {
caseName: '',
coverUrl: '',
introduction: '',
applyBrandType: 1,
applyBrandType: 0,
videoCoverArr: []
},
brandList: [],
......@@ -69,7 +69,7 @@ export default {
}, trigger: 'change' }],
introduction: [{ required: true, message: '请输入宣传文案', trigger: 'change' }],
brand: [{ required: true, validator: (rule, value, callback) => {
if(this.formObj.applyBrandType==2 && !this.brandList?.length) {
if(this.formObj.applyBrandType==1 && !this.brandList?.length) {
callback(new Error(`请选择品牌`))
}else{
callback()
......@@ -152,7 +152,7 @@ export default {
if(valid){
let params = JSON.parse(JSON.stringify(this.formObj))
params.coverUrl = this.formObj.videoCoverArr[0]
if(params.applyBrandType == 2){
if(params.applyBrandType == 1){
params.brandList = this.brandList.map(item => {
return { brandId: item.id , brandName: item.name}
})
......
......@@ -26,7 +26,7 @@
</el-popover>
</template>
<template v-else>
<span v-if="!scope.scope.brandList || !scope.scope.brandList.length">--</span>
<span v-if="!scope.scope.brandList || !scope.scope.brandList.length">{{ scope.scope.applyBrandType==1? '--' : '全部' }}</span>
<span v-else>{{ filterBrand(scope.scope).join('、') }}</span>
</template>
</div>
......
......@@ -66,7 +66,8 @@ export default {
{
label: '主营品牌车系',
name: 'carId',
addHtml: 'carSeriesHtml'
addHtml: 'carSeriesHtml',
isHide: true
},
],
selectedList: [],
......@@ -146,6 +147,10 @@ export default {
this.editForm.channelIds = []
res.forEach(item => {
this.editForm.channelIds.push(item.channelId)
if(item.channelId==5) {
const _target = this.editFormData.find(item => item.name == 'carId')
_target.isHide = false
}
})
})
},
......@@ -163,7 +168,7 @@ export default {
merchantId: this.editForm.merchantId,
merchantName: this.editForm.merchantName,
channelIds: this.editForm.channelIds,
vehicleSeriesRequests: this.editForm.vehicleSeriesRequests
vehicleSeriesRequests: this.editForm?.channelIds?.includes(5) ? this.editForm.vehicleSeriesRequests : []
}
this.loading = true
this.$apis.store.configMerchant(params).then(res => {
......@@ -181,7 +186,13 @@ export default {
})
},
handleCheckedChannelChange(val) {
// console.log(this.editForm.channelIds)
const _target = this.editFormData.find(item => item.name == 'carId')
if(val?.includes(5)){
_target.isHide = false
}else{
_target.isHide = true
this.editForm.vehicleSeriesRequests = []
}
},
//选择车系
handleCarSeriesClose(){
......
......@@ -6,12 +6,17 @@
:close-on-click-modal="false"
@onOk="handleConfirm"
@onCancel="handleClose">
<div class="search-wrap">
<el-input size="small" placeholder="请输入搜索关键字" v-model="curbrandName">
<i slot="suffix" class="el-input__icon el-icon-search"></i>
</el-input>
</div>
<div v-if="loading" class="loading-wrap">
<img class="loading-img" :src="url" alt="">
</div>
<div class="car-container" v-else>
<div class="wrap">
<div class="item son-brand-wrap" v-for="(item, index) in carSeriesData" :key="item.id">
<div class="item son-brand-wrap" v-for="(item, index) in filterBrandList" :key="item.id">
<el-checkbox v-if="!singleChoice" :disabled="!(item.childs && item.childs.length)" :indeterminate="isIndeterminate(item, 1)" :value="isChecked(item, 1)" @change="changeBrandStatus($event, item, index)"></el-checkbox>
<span :class="['son-brand-label', {'curItem' : curBrandInfo.id==item.id}]" @click="showSonBrandList(item)">
{{ item.name }}
......@@ -43,7 +48,9 @@
return {
url,
loading: true,
curbrandName: '',
carSeriesData: [],
filterBrandList: [],
sonBrandList: [],
carSeriesList: [],
selectdData: {},
......@@ -55,7 +62,7 @@
id: '',
name: ''
},
isClearData: true
isClearData: true //品牌为单选的时候,是否需要清空数据
}
},
computed:{
......@@ -74,6 +81,16 @@
default: ()=>[]
},
},
watch:{
curbrandName:{
handler(nVal, oVal){
this.sonBrandList = []
this.carSeriesList = []
this.filterBrandList = this.carSeriesData.filter(item => item.name.indexOf(nVal)>-1)
},
deep: true
}
},
created(){
this.echoDataFn()
},
......@@ -215,6 +232,7 @@
this.$apis.case.getCarSeriesApi({needCarSeries:true}).then(res => {
if(res?.length){
this.carSeriesData = res
this.filterBrandList = res
}
}).finally(end =>{
this.loading = false
......@@ -232,7 +250,15 @@
</script>
<style lang="scss">
.search-wrap{
margin-bottom: 12px;
.el-input {
&, .el-input__inner{
height: 36px;
width: 432px;
}
}
}
.loading-wrap{
height: 200px;
width: 100%;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!