Commit e8fe61e7 by zhangquan

修改搜索下拉

1 parent 036186c6
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
</div> </div>
</div> </div>
<div slot="categorySlot"> <div slot="categorySlot">
<brandCascader :disabled="disabled" :listTree="categoryData" :defaultProps="defaultProps" @clickItem="selectCategory" :curInfo="curCategoryInfo" class="category-class"></brandCascader> <brandCascader :disabled="disabled" @clickItem="selectCategory" class="category-class"></brandCascader>
</div> </div>
</glsx-combi-form> </glsx-combi-form>
</div> </div>
...@@ -173,7 +173,6 @@ export default { ...@@ -173,7 +173,6 @@ export default {
associationClassifyFirstId: '', associationClassifyFirstId: '',
associationClassifySecondId: '' associationClassifySecondId: ''
}, },
categoryData: [],
merchantRequestList:[], merchantRequestList:[],
vehicleSeriesRequestList: [], vehicleSeriesRequestList: [],
myRule: { myRule: {
......
...@@ -29,10 +29,6 @@ export default { ...@@ -29,10 +29,6 @@ export default {
curBrand: {}, curBrand: {},
expandedList:[], expandedList:[],
categoryData: [], categoryData: [],
defaultProps: {
children: 'childs',
label: 'categoryName'
},
} }
}, },
model: { model: {
...@@ -40,15 +36,15 @@ export default { ...@@ -40,15 +36,15 @@ export default {
event: 'changeItem', // 默认是input event: 'changeItem', // 默认是input
}, },
props: { props: {
// defaultProps: { defaultProps: {
// type: Object, type: Object,
// default: ()=> { default: ()=> {
// return { return {
// children: 'children', children: 'childs',
// label: 'label' label: 'categoryName'
// } }
// } }
// }, },
disabled:{ disabled:{
type: Boolean, type: Boolean,
default: false default: false
...@@ -112,7 +108,6 @@ export default { ...@@ -112,7 +108,6 @@ export default {
} }
}) })
this.categoryData = list this.categoryData = list
console.log(this.categoryData)
} }
}) })
}, },
...@@ -183,6 +178,7 @@ export default { ...@@ -183,6 +178,7 @@ export default {
z-index: 20; z-index: 20;
max-height: 300px; max-height: 300px;
overflow-y: auto; overflow-y: auto;
overflow-x: hidden;
.filter-tree { .filter-tree {
.custom-tree-node{ .custom-tree-node{
width: 100%; width: 100%;
......
...@@ -2,7 +2,11 @@ ...@@ -2,7 +2,11 @@
<div class="goods-list-cntr"> <div class="goods-list-cntr">
<!-- <GLTabs v-model="activeName" :tabPaneList="tabPaneList" @tab-click="handleClick"></GLTabs> --> <!-- <GLTabs v-model="activeName" :tabPaneList="tabPaneList" @tab-click="handleClick"></GLTabs> -->
<div class="table-wrap"> <div class="table-wrap">
<GLCombiForm ref="showSearch" :rowNumber="1" :formObj="tableSearchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm> <GLCombiForm ref="showSearch" class="search-wrap" :rowNumber="1" :formObj="tableSearchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset">
<div slot="categorySlot">
<brandCascader ref="cascaderRef" @clickItem="selectCategory" class="category-slot-class"></brandCascader>
</div>
</GLCombiForm>
<div class="operate-wrap"> <div class="operate-wrap">
<span class="table-title">发现商品列表</span> <span class="table-title">发现商品列表</span>
<el-button class="operate-btn" type="primary" size="small" @click="handleAdd">新增商品</el-button> <el-button class="operate-btn" type="primary" size="small" @click="handleAdd">新增商品</el-button>
...@@ -46,14 +50,20 @@ ...@@ -46,14 +50,20 @@
<script> <script>
import url from '@/assets/empty.png' import url from '@/assets/empty.png'
import * as dayjs from 'dayjs' import brandCascader from './components/brandCascader'
export default { export default {
name: 'App', name: 'App',
components: {
brandCascader,
},
data() { data() {
return { return {
tableSearchForm: { tableSearchForm: {
channelName: '', channelName: '',
createDate: [] createDate: [],
associationClassifyFirstId: '',
associationClassifySecondId: '',
merchantName: ''
}, },
tabPaneList: [{name: 'sa', label: '配置升级'}, {name: 'sa', label: '车主优选'}], tabPaneList: [{name: 'sa', label: '配置升级'}, {name: 'sa', label: '车主优选'}],
buttonList: [ buttonList: [
...@@ -152,8 +162,8 @@ ...@@ -152,8 +162,8 @@
}, },
{ {
label: '商品分类', label: '商品分类',
name: 'channelName', name: 'goodsCategory',
type: 'input' addHtml: 'categorySlot'
}, },
], ],
getListApi: this.$apis.goods.getGoodsListApi, getListApi: this.$apis.goods.getGoodsListApi,
...@@ -220,6 +230,10 @@ ...@@ -220,6 +230,10 @@
created() {}, created() {},
mounted() {}, mounted() {},
methods: { methods: {
selectCategory(e){
this.tableSearchForm.associationClassifyFirstId = e?.parent?.id
this.tableSearchForm.associationClassifySecondId = e?.data?.id
},
shelfGoodsFn(item, type){ shelfGoodsFn(item, type){
if(type==1){ if(type==1){
this.updateStatus(item.id, type) this.updateStatus(item.id, type)
...@@ -288,8 +302,12 @@ ...@@ -288,8 +302,12 @@
handleReset() { handleReset() {
this.tableSearchForm = { this.tableSearchForm = {
channelName: '', channelName: '',
createDate: [] createDate: [],
} associationClassifyFirstId: '',
associationClassifySecondId: '',
merchantName: ''
},
this.$refs?.cascaderRef?.curBrand && (this.$refs.cascaderRef.curBrand = {})
this.searchForm = {} this.searchForm = {}
this.handleSearch() this.handleSearch()
}, },
...@@ -315,6 +333,14 @@ ...@@ -315,6 +333,14 @@
<style scoped lang="scss"> <style scoped lang="scss">
.goods-list-cntr{ .goods-list-cntr{
.search-wrap{
/deep/ .gl-search{
overflow: unset;
.tree-box{
width: 300px;
}
}
}
.table-wrap{ .table-wrap{
margin-top: 16px; margin-top: 16px;
padding: 20px; padding: 20px;
......
...@@ -2,10 +2,13 @@ ...@@ -2,10 +2,13 @@
<div class="edit-wrap" v-if="isFlag"> <div class="edit-wrap" v-if="isFlag">
<GLTabs v-model="activeName" :tabPaneList="tabPaneList" @tab-click="handleClick"></GLTabs> <GLTabs v-model="activeName" :tabPaneList="tabPaneList" @tab-click="handleClick"></GLTabs>
<div class="container mgt16"> <div class="container mgt16">
<GLCombiForm ref="showSearch" v-if="searchFormData.length" :rowNumber="1" :formObj="tableSearchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"> <GLCombiForm class="search-wrap" ref="showSearch" v-if="searchFormData.length" :rowNumber="1" :formObj="tableSearchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset">
<div slot="createdDate"> <div slot="createdDate">
<el-date-picker v-model="tableSearchForm.createdDate" type="date" value-format="yyyy-MM-dd" placeholder="选择日期" :picker-options="pickerOptions"></el-date-picker> <el-date-picker v-model="tableSearchForm.createdDate" type="date" value-format="yyyy-MM-dd" placeholder="选择日期" :picker-options="pickerOptions"></el-date-picker>
</div> </div>
<div slot="categorySlot">
<brandCascader ref="cascaderRef" @clickItem="selectCategory" class="category-slot-class"></brandCascader>
</div>
</GLCombiForm> </GLCombiForm>
<div class="store-head"> <div class="store-head">
<div class="info">{{ tabPaneText }}列表</div> <div class="info">{{ tabPaneText }}列表</div>
...@@ -76,10 +79,14 @@ ...@@ -76,10 +79,14 @@
<script> <script>
import url from '@/assets/empty.png' import url from '@/assets/empty.png'
import brandCascader from '../goods/components/brandCascader'
import * as dayjs from 'dayjs' import * as dayjs from 'dayjs'
import { mapState, mapMutations } from 'vuex' import { mapState, mapMutations } from 'vuex'
export default { export default {
name: 'App', name: 'App',
components: {
brandCascader,
},
data() { data() {
return { return {
isFlag: false, isFlag: false,
...@@ -92,6 +99,7 @@ export default { ...@@ -92,6 +99,7 @@ export default {
createDate: [] createDate: []
}, },
searchForm: {}, searchForm: {},
ClassifyInfo: {},
url: url, url: url,
mode: 'mid', mode: 'mid',
tabPaneList: [], tabPaneList: [],
...@@ -147,8 +155,8 @@ export default { ...@@ -147,8 +155,8 @@ export default {
}, },
{ {
label: '商品分类', label: '商品分类',
name: 'channelName', name: 'goodsCategory',
type: 'input', addHtml: 'categorySlot',
filter: '5' filter: '5'
}, },
], ],
...@@ -337,6 +345,10 @@ export default { ...@@ -337,6 +345,10 @@ export default {
SET_CHANNEL_STYLE: 'channel/SET_CHANNEL_STYLE', SET_CHANNEL_STYLE: 'channel/SET_CHANNEL_STYLE',
SET_CHANNEL_TYPE: 'channel/SET_CHANNEL_TYPE' SET_CHANNEL_TYPE: 'channel/SET_CHANNEL_TYPE'
}), }),
selectCategory(e){
this.ClassifyInfo.associationClassifyFirstId = e?.parent?.id
this.ClassifyInfo.associationClassifySecondId = e?.data?.id
},
filterData({merchantList: list}){ filterData({merchantList: list}){
return list?.map(item => { return list?.map(item => {
let activityPrice = item.activityPrice ? Number((Number(item.activityPrice)/100).toFixed(2)) : 0 let activityPrice = item.activityPrice ? Number((Number(item.activityPrice)/100).toFixed(2)) : 0
...@@ -359,6 +371,9 @@ export default { ...@@ -359,6 +371,9 @@ export default {
if(this.activeName == 5){ if(this.activeName == 5){
this.searchForm.apiType = 5 this.searchForm.apiType = 5
this.searchForm.merchantId =this.merchantId this.searchForm.merchantId =this.merchantId
const {associationClassifyFirstId, associationClassifySecondId} = this.ClassifyInfo
this.searchForm.associationClassifyFirstId = associationClassifyFirstId
this.searchForm.associationClassifySecondId = associationClassifySecondId
} }
// delete this.searchForm.createDate // delete this.searchForm.createDate
resolve() resolve()
...@@ -488,6 +503,8 @@ export default { ...@@ -488,6 +503,8 @@ export default {
merchantName: '', merchantName: '',
createDate: [] createDate: []
} }
this.ClassifyInfo = {}
this.$refs?.cascaderRef?.curBrand && (this.$refs.cascaderRef.curBrand = {})
this.searchForm = {} this.searchForm = {}
this.handleSearch() this.handleSearch()
}, },
...@@ -519,6 +536,14 @@ export default { ...@@ -519,6 +536,14 @@ export default {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.search-wrap{
/deep/ .gl-search{
overflow: unset;
.tree-box{
width: 300px;
}
}
}
.edit-wrap { .edit-wrap {
.store-head { .store-head {
display: flex; display: flex;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!