...
|
...
|
@@ -11,6 +11,10 @@ |
|
|
:placeholder="filters.prodName.holder"></Input>
|
|
|
</FilterItem>
|
|
|
|
|
|
<FilterItem label="选择类目">
|
|
|
<SelectCategory :value="categoryValue" @select-change="sortChange"></SelectCategory>
|
|
|
</FilterItem>
|
|
|
|
|
|
<FilterItem :label="filters.prodStatus.label">
|
|
|
<Select v-model.trim="filters.prodStatus.model">
|
|
|
<Option v-for="option in filters.prodStatus.options"
|
...
|
...
|
@@ -19,10 +23,6 @@ |
|
|
</Select>
|
|
|
</FilterItem>
|
|
|
|
|
|
<FilterItem label="选择类目">
|
|
|
<SelectCategory :value="categoryValue" @select-change="sortChange"></SelectCategory>
|
|
|
</FilterItem>
|
|
|
|
|
|
<FilterItem>
|
|
|
<Button type="primary" @click="filterSearch">查询</Button>
|
|
|
<Button @click="clearFilter">清空条件</Button>
|
...
|
...
|
@@ -31,14 +31,10 @@ |
|
|
|
|
|
</LayoutFilter>
|
|
|
|
|
|
<LayoutAction>
|
|
|
<Button type="error">取消选择</Button>
|
|
|
</LayoutAction>
|
|
|
|
|
|
<LayoutList>
|
|
|
<Table border :context="self" :columns="tableCols" :data="tableData"></Table>
|
|
|
<Page :total="pageData.total" :current="pageData.current"
|
|
|
@on-change="pageChange" :page-size="20" show-total></Page>
|
|
|
@on-change="pageChange" :page-size="pageData.pageSize" show-total></Page>
|
|
|
</LayoutList>
|
|
|
|
|
|
</LayoutBody>
|
...
|
...
|
@@ -47,83 +43,132 @@ |
|
|
<script>
|
|
|
import _ from 'lodash';
|
|
|
import {SelectCategory} from 'components/select';
|
|
|
import {tableCols, tableData} from '../store'
|
|
|
import methods from '../methods'
|
|
|
import {CellImage} from 'components/cell';
|
|
|
import {tableCols, tableData, pageData} from '../store';
|
|
|
import methods from '../methods';
|
|
|
import service from 'shop-category-service';
|
|
|
import operator from './operator';
|
|
|
|
|
|
export default {
|
|
|
props: ['categoryId'],
|
|
|
props: ['cid'],
|
|
|
data() {
|
|
|
return {
|
|
|
self: this,
|
|
|
tableCols: tableCols,
|
|
|
tableData: tableData,
|
|
|
categoryId: this.cid,
|
|
|
categoryValue: [],
|
|
|
pageData: {
|
|
|
total: 0,
|
|
|
current: 1
|
|
|
},
|
|
|
pageData: pageData(),
|
|
|
filters: {
|
|
|
sknCode: {
|
|
|
label: 'SKN',
|
|
|
model: '',
|
|
|
model: null,
|
|
|
holder: ''
|
|
|
},
|
|
|
prodName: {
|
|
|
label: '商品名称',
|
|
|
model: '',
|
|
|
model: null,
|
|
|
holder: ''
|
|
|
},
|
|
|
prodStatus: {
|
|
|
label: '上下架状态',
|
|
|
model: '',
|
|
|
model: -1,
|
|
|
options: [
|
|
|
{
|
|
|
value: -1,
|
|
|
label: '全部'
|
|
|
},
|
|
|
{
|
|
|
value: 1,
|
|
|
label: '上架'
|
|
|
value: 0,
|
|
|
label: '未上架'
|
|
|
},
|
|
|
{
|
|
|
value: 2,
|
|
|
label: '下架'
|
|
|
label: '已上架'
|
|
|
}
|
|
|
]
|
|
|
}
|
|
|
|
|
|
},
|
|
|
maxSortId: null,
|
|
|
middleSortId: null,
|
|
|
smallSortId: null
|
|
|
},
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
created() {
|
|
|
this.productList();
|
|
|
this.$bus.$on('on-tab-change', this.productList);
|
|
|
},
|
|
|
methods: {
|
|
|
filterParams() {
|
|
|
let page = this.pageData.current;
|
|
|
let size = this.pageData.pageSize;
|
|
|
|
|
|
let productSKN = this.filters.sknCode.model;
|
|
|
let productName = this.filters.prodName.model;
|
|
|
let status = this.filters.prodStatus.model;
|
|
|
let maxSortId = this.filters.maxSortId;
|
|
|
let middleSortId = this.filters.middleSortId;
|
|
|
let smallSortId = this.filters.smallSortId;
|
|
|
let categoryId = this.categoryId;
|
|
|
|
|
|
return Promise.resolve({
|
|
|
page,
|
|
|
size,
|
|
|
productSKN,
|
|
|
productName,
|
|
|
status,
|
|
|
maxSortId,
|
|
|
middleSortId,
|
|
|
smallSortId,
|
|
|
categoryId
|
|
|
});
|
|
|
},
|
|
|
filterSearch() {
|
|
|
this.productList();
|
|
|
},
|
|
|
clearFilter() {
|
|
|
this.filters.sknCode.model = null;
|
|
|
this.filters.prodName.model = null;
|
|
|
this.filters.prodStatus.model = -1;
|
|
|
this.categoryValue = [];
|
|
|
this.filters.maxSortId = null;
|
|
|
this.filters.middleSortId = null;
|
|
|
this.filters.smallSortId = null;
|
|
|
this.pageData.current = 1;
|
|
|
|
|
|
this.productList();
|
|
|
},
|
|
|
productList(params) {
|
|
|
service.listBindProduct(this.categoryId).then((result) => {
|
|
|
if (result.code === 200) {
|
|
|
this.tableData = result.data.list;
|
|
|
}
|
|
|
})
|
|
|
productList() {
|
|
|
this.filterParams().then((result) => {
|
|
|
return service.listBindProduct(result).then((result) => {
|
|
|
if (result.code === 200) {
|
|
|
this.tableData = result.data.list;
|
|
|
this.pageData.total = result.data.total;
|
|
|
this.pageData.current = result.data.page;
|
|
|
}
|
|
|
})
|
|
|
}).catch(() => {
|
|
|
this.$Message.error('查询失败,请重新查询');
|
|
|
});
|
|
|
},
|
|
|
reloadList() {
|
|
|
sortChange(sort) {
|
|
|
this.filters.maxSortId = sort.max;
|
|
|
this.filters.middleSortId = sort.mid;
|
|
|
this.filters.smallSortId = sort.min;
|
|
|
},
|
|
|
pageChange(page) {
|
|
|
this.pageData.current = page;
|
|
|
this.productList();
|
|
|
},
|
|
|
sortChange() {
|
|
|
|
|
|
onColStatusChange() {
|
|
|
this.productList()
|
|
|
},
|
|
|
...methods
|
|
|
},
|
|
|
components: {
|
|
|
SelectCategory
|
|
|
SelectCategory,
|
|
|
CellImage,
|
|
|
operator
|
|
|
}
|
|
|
}
|
|
|
</script>
|
...
|
...
|
|