商品列表加渠道筛选和列表加新的展示

feature/0423
fanfan 10 months ago
parent 8c5f4cd9ed
commit 4a23f820ca
  1. 14
      src/api/goods/index.js
  2. 44
      src/views/goods/Index.vue

@ -9,7 +9,8 @@ const api = {
add: '/goods/add', add: '/goods/add',
edit: '/goods/edit', edit: '/goods/edit',
delete: '/goods/delete', delete: '/goods/delete',
state: '/goods/state' state: '/goods/state',
dataList:'store/platformList',
} }
// 列表记录 // 列表记录
@ -95,3 +96,14 @@ export function deleted (data) {
data: data data: data
}) })
} }
/**
* 获取数据授权
* @param {*} data
*/
export function getDataList (data) {
return axios({
url: api.dataList,
method: 'post',
data: data
})
}

@ -6,13 +6,14 @@
<a-row class="row-item-search"> <a-row class="row-item-search">
<a-form class="search-form" :form="searchForm" layout="inline" @submit="handleSearch"> <a-form class="search-form" :form="searchForm" layout="inline" @submit="handleSearch">
<a-form-item label="商品名称"> <a-form-item label="商品名称">
<a-input v-decorator="['goodsName']" placeholder="请输入商品名称" /> <a-input v-decorator="['goodsName']" class="goodsWidth" placeholder="请输入商品名称" />
</a-form-item> </a-form-item>
<a-form-item label="商品编码"> <a-form-item label="商品编码">
<a-input v-decorator="['goodsNo']" placeholder="请输入商品编码" /> <a-input v-decorator="['goodsNo']" class="goodsWidth" placeholder="请输入商品编码" />
</a-form-item> </a-form-item>
<a-form-item label="商品分类"> <a-form-item label="商品分类">
<a-tree-select <a-tree-select
class="goodsWidth"
:treeData="categoryListTree" :treeData="categoryListTree"
:dropdownStyle="{ maxHeight: '500px', overflow: 'auto' }" :dropdownStyle="{ maxHeight: '500px', overflow: 'auto' }"
allowClear allowClear
@ -26,6 +27,13 @@
</a-select-option> </a-select-option>
</a-select> </a-select>
</a-form-item> </a-form-item>
<a-form-item label="渠道">
<a-select @change="getChannel" placeholder="请选择">
<a-select-option :value="item.id" v-for="item in checkList" :key="item.id">
{{ item.name }}
</a-select-option>
</a-select>
</a-form-item>
<a-form-item class="search-btn"> <a-form-item class="search-btn">
<a-button type="primary" icon="search" html-type="submit">搜索</a-button> <a-button type="primary" icon="search" html-type="submit">搜索</a-button>
</a-form-item> </a-form-item>
@ -111,14 +119,24 @@
import * as GoodsApi from '@/api/goods' import * as GoodsApi from '@/api/goods'
import { ContentHeader, STable } from '@/components' import { ContentHeader, STable } from '@/components'
import CategoryModel from '@/common/model/Category' import CategoryModel from '@/common/model/Category'
// //
const columns = [ const columns = [
{ {
title: '商品ID', title: '商品ID',
dataIndex: 'goods_id', dataIndex: 'goods_id',
width: '100px',
sorter: true, sorter: true,
}, },
{
title: '渠道',
width: '60px',
dataIndex: 'channel_name',
},
{
title: '商品编号',
dataIndex: 'goods_no',
width: '120px',
},
{ {
title: '商品图片', title: '商品图片',
dataIndex: 'goods_image', dataIndex: 'goods_image',
@ -192,6 +210,7 @@ export default {
queryParam: { queryParam: {
listType: 'all', listType: 'all',
spec_type: '', spec_type: '',
channel: '',
}, },
// //
isLoading: false, isLoading: false,
@ -225,6 +244,7 @@ export default {
{ name: '单规格', val: 10 }, { name: '单规格', val: 10 },
{ name: '多规格', val: 20 }, { name: '多规格', val: 20 },
], ],
checkList: [],
} }
}, },
created() { created() {
@ -234,6 +254,7 @@ export default {
} }
// //
this.getCategoryList() this.getCategoryList()
this.getDataList() //
}, },
computed: { computed: {
rowSelection() { rowSelection() {
@ -244,6 +265,17 @@ export default {
}, },
}, },
methods: { methods: {
getChannel(val) {
this.queryParam.channel = val
},
getDataList() {
return GoodsApi.getDataList().then((result) => {
const obj = result.data
Object.keys(obj).forEach((item) => {
this.checkList.push({ id: item, name: obj[item] })
})
})
},
onchangeSpecs(val) { onchangeSpecs(val) {
this.queryParam.spec_type = val this.queryParam.spec_type = val
}, },
@ -347,4 +379,10 @@ export default {
.tab-list { .tab-list {
margin-right: 20px; margin-right: 20px;
} }
/deep/.search-form .ant-form-item-control-wrapper {
min-width: 120px !important;
}
.goodsWidth {
min-width: 220px;
}
</style> </style>

Loading…
Cancel
Save