Authored by 李奇

导出功能修改

... ... @@ -31,7 +31,7 @@ export default {
max-width: 100px;
}
.item-col {
input, select, .ivu-select {
input, select, .ivu-select, .ivu-cascader {
max-width: 300px;
}
}
... ...
<template>
<div>
<Cascader :data="categoryList" change-on-select @on-change="selectChange"></Cascader>
<Cascader :value="value" :data="categoryList" change-on-select @on-change="selectChange"></Cascader>
<slot></slot>
</div>
</template>
... ... @@ -12,18 +12,18 @@
export default {
name: 'SelcetCategory',
props: {
value: {
type: Array
}
},
data() {
return {
categoryList: []
}
},
computed: {
},
created() {
this.getSortInfo(1);
},
methods: {
getSortInfo(level, sortId) {
const params = {
... ... @@ -47,11 +47,11 @@
};
});
},
selectChange(val) {
selectChange(val, data) {
const len = val.length;
const max = val[0];
const mid = val[1];
const max = val[0] || '';
const mid = val[1] || '';
const min = val[2] || '';
switch(len) {
case 1:
... ... @@ -106,8 +106,13 @@
break;
}
},
this.$emit('select-change', {
max,
mid,
min
});
},
getChildren(level, sortId) {
const params = {
level,
... ... @@ -129,13 +134,10 @@
return children;
});
},
}
}
}
</script>
<style lang="scss" scoped>
.field-label {
line-height: 32px;
}
</style>
\ No newline at end of file
... ...
... ... @@ -52,7 +52,7 @@
</Select>
</FilterItem>
<FilterItem label="选择类目">
<SelectCategory :field-sort="filters.sort" @on-change="sortChange"></SelectCategory>
<SelectCategory :value="categoryValue" @select-change="sortChange"></SelectCategory>
</FilterItem>
<FilterItem>
<Button type="primary" @click="filterSearch">筛选</Button>
... ... @@ -95,7 +95,8 @@
initialFilters: '',
batchOnSale: [],
useFilterSign: false,
showSizeEdit: false
showSizeEdit: false,
categoryValue: []
}
},
created() {
... ... @@ -136,6 +137,7 @@
this.productList();
this.useFilterSign = false;
this.pageData.current = 1;
this.categoryValue = [];
},
productList(params) {
... ... @@ -183,9 +185,9 @@
this.pageData.total = data.total;
},
sortChange(sort) {
this.filters.sort.first.model = sort.first;
this.filters.sort.second.model = sort.second;
this.filters.sort.third.model = sort.third;
this.filters.sort.first.model = sort.max;
this.filters.sort.second.model = sort.mid;
this.filters.sort.third.model = sort.min;
},
brandChange(val) {
_.set(this.filters, 'brand.model', val);
... ...
... ... @@ -45,7 +45,7 @@
</Select>
</FilterItem>
<FilterItem label="选择类目">
<SelectCategory :field-sort="filters.sort" @on-change="sortChange"></SelectCategory>
<SelectCategory :value="categoryValue" @select-change="sortChange"></SelectCategory>
</FilterItem>
<FilterItem>
<Button type="primary" @click="filterSearch">筛选</Button>
... ... @@ -87,7 +87,8 @@
filters: filterFields,
initialFilters: '',
batchOffSale: [],
useFilterSign: false
useFilterSign: false,
categoryValue: []
}
},
created() {
... ... @@ -121,12 +122,14 @@
this.useFilterSign = true;
this.productList(params);
this.pageData.current = 1;
},
clearFilter() {
this.filters = JSON.parse(this.initialFilters);
this.productList();
this.useFilterSign = false;
this.pageData.current = 1;
this.categoryValue = [];
},
productList(params) {
... ... @@ -174,9 +177,9 @@
this.pageData.total = data.total;
},
sortChange(sort) {
this.filters.sort.first.model = sort.first;
this.filters.sort.second.model = sort.second;
this.filters.sort.third.model = sort.third;
this.filters.sort.first.model = sort.max;
this.filters.sort.second.model = sort.mid;
this.filters.sort.third.model = sort.min;
},
brandChange(val) {
_.set(this.filters, 'brand.model', val);
... ...
<template>
<div class="batch-page">
<Row class-name="row-space">
<LayoutBody>
<LayoutFilter :no-line="true" :col="1">
<h3>导出</h3>
</Row>
<Row :gutter="24" class-name="row-space">
<Col :span="6">
<Row>
<Col span="6">
<span class="field-label">文件类型:</span>
</Col>
<Col span="18">
<Select v-model="fileType.model">
<Option v-for="item in fileType.list" :value="item.id" :key="item">{{ item.label }}</Option>
</Select>
</Col>
</Row>
</Col>
</Row>
<Row class-name="row-space">
<SelectCategory :field-sort="sort" @on-change="sortChange">
<FilterItem label="文件类型">
<Select v-model="fileType.model">
<Option v-for="item in fileType.list" :value="item.id" :key="item">{{ item.label }}</Option>
</Select>
</FilterItem>
<FilterItem label="选择类目">
<SelectCategory @select-change="sortChange">
</SelectCategory>
</FilterItem>
<FilterItem>
<Button type="primary" @click="exportFile">导出</Button>
</SelectCategory>
</Row>
</div>
</FilterItem>
</LayoutFilter>
</LayoutBody>
</template>
<script>
... ... @@ -69,22 +62,20 @@
},
methods: {
exportFile() {
const params = {
maxSortId: this.sort.first.model,
middleSortId: this.sort.second.model,
smallSortId: this.sort.third.model
};
const max = this.sort.first.model;
const mid = this.sort.second.model;
const min = this.sort.third.model;
service.exportProductFile(params)
.then(res => {
// todo 接口开发中
});
const href = "/Api/platform/exportSellerProductList?"
+ `maxSortId=${max}&middleSortId=${mid}&smallSortId=${min}`;
window.open(href, '_blank');
},
sortChange(val) {
this.sort.first.model = val.first;
this.sort.second.model = val.second;
this.sort.third.model = val.third;
console.log(val)
this.sort.first.model = val.max;
this.sort.second.model = val.mid;
this.sort.third.model = val.min;
}
},
components: {
... ... @@ -94,11 +85,4 @@
</script>
<style lang="scss">
.field-label {
line-height: 32px;
}
.row-space {
margin-bottom: 20px;
}
</style>
... ...