Commit f9e8801b by zhangquan

处理车系弹框

1 parent 3ca7f0e1
import { http } from '@/main'
const url = 'rop-scrm-shopmall/router'
const getGoodsListApi = params => {
params.method = 'scrm.api.shopmall.goods.configuration.page'
return http({
url,
method: 'post',
data: params,
sign: true
})
}
export default {
getGoodsListApi
}
\ No newline at end of file \ No newline at end of file
...@@ -20,14 +20,14 @@ ...@@ -20,14 +20,14 @@
width="400" width="400"
trigger="hover"> trigger="hover">
<span> <span>
{{scope.scope.brandList.join('、')}} {{filterBrand(scope.scope).join('、')}}
</span> </span>
<span class="more-brand" slot="reference">...[{{ scope.scope.brandList.length }}]</span> <span class="more-brand" slot="reference">...[{{ scope.scope.brandList.length }}]</span>
</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">--</span>
<span>{{ filterBrand(scope.scope).join('、') }}</span> <span v-else>{{ filterBrand(scope.scope).join('、') }}</span>
</template> </template>
</div> </div>
<div class="table-btns" slot="auth-button" slot-scope="scope"> <div class="table-btns" slot="auth-button" slot-scope="scope">
...@@ -228,6 +228,7 @@ ...@@ -228,6 +228,7 @@
background-color: #fff; background-color: #fff;
padding: 20px; padding: 20px;
.more-brand{ .more-brand{
white-space: nowrap;
color: #5850FF; color: #5850FF;
cursor: pointer; cursor: pointer;
} }
......
...@@ -10,23 +10,32 @@ ...@@ -10,23 +10,32 @@
<GLTable ref="channelRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :beforeSearchFn="beforeSearchFn" :tableParams="tableParams" :pageConf="pageConf" @setTableFinishFun="setTableFinishFun"> <GLTable ref="channelRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :beforeSearchFn="beforeSearchFn" :tableParams="tableParams" :pageConf="pageConf" @setTableFinishFun="setTableFinishFun">
<div slot="imageSlot" class="table-image" slot-scope="scope"> <div slot="imageSlot" class="table-image" slot-scope="scope">
<el-popover placement="top" width="160" trigger="hover" popper-class="table-popover-block"> <el-popover placement="top" width="160" trigger="hover" popper-class="table-popover-block">
<img class="table-popover-img" :src="scope.scope.publicityImg" /> <img class="table-popover-img" :src="scope.scope.goodsImage" />
<img class="img-36 pointer" slot="reference" :src="scope.scope.publicityImg" /> <img class="img-36 pointer" slot="reference" :src="scope.scope.goodsImage" />
</el-popover> </el-popover>
</div> </div>
<div slot="statusSlot" slot-scope="scope"> <div slot="statusSlot" slot-scope="scope">
<span :class="['status', scope.scope.channelType==3 ? 'success-status': 'error-status']"></span> <span :class="['status', scope.scope.goodsStatus==1 ? 'success-status': 'error-status']"></span>
<span>{{scope.scope.channelType==3 ? '上架' : '下架' }}</span> <span>{{scope.scope.goodsStatus==1 ? '上架' : '下架' }}</span>
</div>
<div slot="merchantPriceSlot" slot-scope="scope">
<template v-if="scope.scope.merchantList && scope.scope.merchantList.length > 1">
<span>{{ filterData(scope.scope).slice(0, 1).join('、') }}</span>
<el-popover
placement="top"
width="400"
trigger="hover">
<div v-for="(item,index) in filterData(scope.scope)" :key="index">
{{item}}
</div>
<span class="more-info" slot="reference">...[{{ scope.scope.merchantList.length }}]</span>
</el-popover>
</template>
<template v-else>
<span v-if="!scope.scope.merchantList || !scope.scope.merchantList.length">--</span>
<span v-else>{{ filterData(scope.scope).join('、') }}</span>
</template>
</div> </div>
<template slot="activityLink" slot-scope="scope">
<span class="relink">{{ scope.scope.activityName }}</span>
</template>
<template slot="moveCarCodeCount" slot-scope="scope">
<span class="moveCarCodeCount" @click="opneMoveMessage(scope.scope)">{{ scope.scope.moveCarCodeCount }}</span>
</template>
<template slot="switch" slot-scope="scope">
<el-switch v-model="scope.scope.isOpen" @change="updateState(scope.scope)"></el-switch>
</template>
<div class="table-btns" slot="auth-button" slot-scope="scope"> <div class="table-btns" slot="auth-button" slot-scope="scope">
<GLTableButton :buttonList="buttonList" :buttonItem="scope" :buttonNum="3"></GLTableButton> <GLTableButton :buttonList="buttonList" :buttonItem="scope" :buttonNum="3"></GLTableButton>
</div> </div>
...@@ -65,7 +74,7 @@ ...@@ -65,7 +74,7 @@
searchFormData: [ searchFormData: [
{ {
label: '商品名称', label: '商品名称',
name: 'channelName', name: 'goodsName',
type: 'input' type: 'input'
}, },
{ {
...@@ -85,7 +94,7 @@ ...@@ -85,7 +94,7 @@
}, },
{ {
label: '商户名称', label: '商户名称',
name: 'channelName', name: 'merchantName',
type: 'input' type: 'input'
}, },
{ {
...@@ -94,7 +103,7 @@ ...@@ -94,7 +103,7 @@
type: 'select' type: 'select'
}, },
], ],
getListApi: this.$apis.channel.getChannelListApi, getListApi: this.$apis.goods.getGoodsListApi,
tableParams: { tableParams: {
listName: 'list', listName: 'list',
tableOption: { tableOption: {
...@@ -103,7 +112,7 @@ ...@@ -103,7 +112,7 @@
tableColumns: [ tableColumns: [
{ {
label: '商品名称', label: '商品名称',
prop: 'channelName' prop: 'goodsName'
}, },
{ {
label: '缩略图', label: '缩略图',
...@@ -112,20 +121,25 @@ ...@@ -112,20 +121,25 @@
{ {
label: '收款方式', label: '收款方式',
formatter: cellValue => { formatter: cellValue => {
return cellValue.channelName || '--' return cellValue.paymentType==1 ? '全款' : '定金+尾款'
} }
}, },
{ {
label: '定金(元)', label: '定金(元)',
prop: 'channelName' formatter: cellValue => {
return cellValue.depositPrice ? Number((Number(cellValue.depositPrice)/100).toFixed(2)) : '--'
}
}, },
{ {
label: '门店活动价(元)', label: '门店活动价(元)',
prop: 'channelName' width: 200,
addHtml: 'merchantPriceSlot'
}, },
{ {
label: '分类', label: '分类',
prop: 'channelName' formatter: cellValue => {
return `${cellValue.associationClassifyFirstName||''}-${cellValue.associationClassifySecondName||''}`
}
}, },
{ {
label: '状态', label: '状态',
...@@ -134,20 +148,16 @@ ...@@ -134,20 +148,16 @@
{ {
label: '创建日期', label: '创建日期',
prop: 'createdDate', prop: 'createdDate',
formatter: cellValue => { width: 220
return dayjs(cellValue.createdDate).format('YYYY-MM-DD HH:mm:ss')
}
}, },
{ {
label: '更新时间', label: '更新时间',
prop: 'createdDate', prop: 'updatedDate',
formatter: cellValue => { width: 220
return dayjs(cellValue.createdDate).format('YYYY-MM-DD HH:mm:ss')
}
}, },
{ {
label: '操作人', label: '操作人',
prop: 'channelName' prop: 'operator',
}, },
] ]
}, },
...@@ -157,13 +167,18 @@ ...@@ -157,13 +167,18 @@
created() {}, created() {},
mounted() {}, mounted() {},
methods: { methods: {
filterData({merchantList: list}){
return list?.map(item => {
let activityPrice = item.activityPrice ? Number((Number(item.activityPrice)/100).toFixed(2)) : 0
return `${item.merchantName || '--'}:${activityPrice || '0'}`
}) || []
},
getParams() { getParams() {
var params = JSON.parse(JSON.stringify(this.tableSearchForm)) var params = JSON.parse(JSON.stringify(this.tableSearchForm))
if (this.tableSearchForm.createDate.length) { if (this.tableSearchForm.createDate.length) {
params.createdDateStrat = new Date(this.tableSearchForm.createDate[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00' params.createdDateStrat = new Date(this.tableSearchForm.createDate[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
params.createdDateEnd = new Date(this.tableSearchForm.createDate[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59' params.createdDateEnd = new Date(this.tableSearchForm.createDate[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
} }
return params return params
}, },
beforeSearchFn() { beforeSearchFn() {
...@@ -217,6 +232,11 @@ ...@@ -217,6 +232,11 @@
.error-status{ .error-status{
background-color: #999999; background-color: #999999;
} }
.more-info{
white-space: nowrap;
color: #5850FF;
cursor: pointer;
}
} }
} }
</style> </style>
......
...@@ -14,18 +14,17 @@ ...@@ -14,18 +14,17 @@
</div> </div>
</div> </div>
<div class="wrap"> <div class="wrap">
<div class="item flex-center" v-for="(item, index) in sonBrandList" :key="item.id"> <div class="item son-brand-wrap" v-for="(item, index) in sonBrandList" :key="item.id">
<el-checkbox :indeterminate="isIndeterminate(item)" v-model="item.checked" @change="selectCarSeries(index, item)"> <el-checkbox :indeterminate="isIndeterminate(item)" :value="isChecked(item.id, 'son')" @change="selectSonBrand($event, item, index)"></el-checkbox>
<span class="flex-center"> <span class="son-brand-label" @click="showCarSeries(item)">
{{ item.name }} {{ item.name }}{{ isIndeterminate(item) }}
<i class="el-icon-arrow-right"></i> <i class="el-icon-arrow-right"></i>
</span> </span>
</el-checkbox>
</div> </div>
</div> </div>
<div class="wrap"> <div class="wrap">
<el-checkbox-group v-model="selectdData" @change="handleCheckedCitiesChange"> <el-checkbox-group v-model="selectdData" @change="selectCarSeries()">
<el-checkbox class="item" v-for="item in carSeriesList" :label="item.name" :key="item.id">{{item.name}}</el-checkbox> <el-checkbox class="item" v-for="item in carSeriesList" :label="item.id" :key="item.id">{{item.name}}</el-checkbox>
</el-checkbox-group> </el-checkbox-group>
</div> </div>
</div> </div>
...@@ -40,15 +39,14 @@ ...@@ -40,15 +39,14 @@
return { return {
carSeriesData: [], carSeriesData: [],
sonBrandList: [], sonBrandList: [],
curSonBrandIdx: -1, carSeriesList: [],
curSonBrandId: '',
selectdData: [], selectdData: [],
isIndeterminate: true checkedList: [],
checked: true,
} }
}, },
computed:{ computed:{
carSeriesList() {
return this.curSonBrandIdx == -1 ? [] : this.sonBrandList[this.curSonBrandIdx]?.childs?.forEach(item => item.checked = false)
}
}, },
props: { props: {
dialogVisible:{ dialogVisible:{
...@@ -62,8 +60,21 @@ ...@@ -62,8 +60,21 @@
}, },
methods:{ methods:{
isChecked(id, type){
const _target = this.checkedList.find(ele => ele == id)
if(type=='son'){
return !!_target
}else{
return !!_target?.child?.includes(id)
}
},
isIndeterminate(item){
const _existItem = item?.childs?.find(row => !this.selectdData.includes(row.id))
const _notExistItem= item?.childs?.find(row => this.selectdData.includes(row.id))
return !!_existItem && !!_notExistItem
},
getCarSeriesData() { getCarSeriesData() {
this.$apis.store.getCarSeriesApi({needCarSeries:true}).then(res => { this.$apis.case.getCarSeriesApi({needCarSeries:true}).then(res => {
console.log(res) console.log(res)
if(res?.length){ if(res?.length){
this.carSeriesData = res this.carSeriesData = res
...@@ -71,12 +82,37 @@ ...@@ -71,12 +82,37 @@
}) })
}, },
selectBrand(item) { selectBrand(item) {
this.curSonBrandIdx = -1 this.sonBrandList = item?.childs || []
this.sonBrandList = item.childs
console.log(item, this.sonBrandList) console.log(item, this.sonBrandList)
}, },
selectCarSeries(idx, item){ selectSonBrand(e, item , index){
if(this.curSonBrandIdx != idx) this.curSonBrandIdx = idx console.log(e, item , index)
const { id } = item
const _targetIdx = this.checkedList.findIndex(ele => ele == id)
if(_targetIdx>-1){
this.checkedList.splice(_targetIdx, 1)
}else{
this.checkedList.push(id)
}
console.log(this.checkedList)
},
selectCarSeries(){
const unChecked = this.carSeriesList.find(item => !this.selectdData.includes(item.id))
const checked = this.carSeriesList.find(item => this.selectdData.includes(item.id))
if(!unChecked) {
this.checkedList.push(this.curSonBrandId)
}
if(!checked){
const _targetIdx = this.checkedList.findIndex(ele => ele == this.curSonBrandId)
this.checkedList.splice(_targetIdx, 1)
}
},
showCarSeries(item){
this.curSonBrandId = item.id
this.carSeriesList = item?.childs
},
handleConfirm(){
console.log(this.selectdData,155)
} }
} }
} }
...@@ -108,12 +144,31 @@ ...@@ -108,12 +144,31 @@
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
} }
.son-item{ .son-brand-wrap{
display: inline-flex; width: 100%;
justify-content: space-between; display: flex;
align-items: center; align-items: center;
width: calc(100% - 14px); .son-brand-label{
margin-left: 4px;
line-height: 29px;
flex: 1;
display: flex;
justify-content: space-between;
align-items: center;
}
} }
// .son-brand-checkbox{
// &, .el-checkbox__label{
// width: 100%;
// }
// &, .son-brand-label{
// display: flex;
// align-items: center;
// }
// .son-brand-label{
// justify-content: space-between;
// }
// }
} }
} }
</style> </style>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!