Commit 5d5945f5 by zhangquan

bug修复

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