output.vue
3.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<template>
<div class="batch-page">
<Row class-name="row-space">
<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">
<Category :field-sort="sort" @on-change="sortChange">
<Button type="primary" @click="exportFile">导出</Button>
</Category>
</Row>
</div>
</template>
<script>
import _ from 'lodash';
import service from 'product-service';
import {Category} from 'product/filter-select';
export default {
data() {
return {
fileType: {
model: 0,
list: [
{
id: 0,
label: '我的商品表'
}
]
},
sort: {
first: {
label: '选择类目',
holder: '选择一级类目',
labelSpan: 6,
fieldSpan: 18,
model: ''
},
second: {
label: '二级类目',
holder: '选择二级类目',
labelSpan: 6,
fieldSpan: 18,
model: ''
},
third: {
label: '三级类目',
holder: '选择三级类目',
labelSpan: 6,
fieldSpan: 18,
model: ''
}
}
}
},
created() {
},
methods: {
exportFile() {
const params = {
maxSortId: this.sort.first.model,
middleSortId: this.sort.second.model,
smallSortId: this.sort.third.model
};
service.exportProductFile(params)
.then(res => {
// todo 接口开发中
});
},
sortChange(val) {
this.sort.first.model = val.first;
this.sort.second.model = val.second;
this.sort.third.model = val.third;
}
},
components: {
Category
}
}
</script>
<style lang="scss">
.field-label {
line-height: 32px;
}
.row-space {
margin-bottom: 20px;
}
</style>