|
@@ -58,7 +58,7 @@ |
|
@@ -58,7 +58,7 @@ |
58
|
<label class="field-label">{{filters.verifyStatus.label}}:</label>
|
58
|
<label class="field-label">{{filters.verifyStatus.label}}:</label>
|
59
|
</Col>
|
59
|
</Col>
|
60
|
<Col :span="filters.verifyStatus.fieldSpan">
|
60
|
<Col :span="filters.verifyStatus.fieldSpan">
|
61
|
- <Select v-model="filters.verifyStatus.model">
|
61
|
+ <Select v-model="filters.verifyStatus.model" clearable>
|
62
|
<Option v-for="option in filters.verifyStatus.options" :value="option.value" :key="option.value">{{option.label}}</Option>
|
62
|
<Option v-for="option in filters.verifyStatus.options" :value="option.value" :key="option.value">{{option.label}}</Option>
|
63
|
</Select>
|
63
|
</Select>
|
64
|
</Col>
|
64
|
</Col>
|
|
@@ -70,12 +70,24 @@ |
|
@@ -70,12 +70,24 @@ |
70
|
<label class="field-label">{{filters.stockStatus.label}}:</label>
|
70
|
<label class="field-label">{{filters.stockStatus.label}}:</label>
|
71
|
</Col>
|
71
|
</Col>
|
72
|
<Col :span="filters.stockStatus.fieldSpan">
|
72
|
<Col :span="filters.stockStatus.fieldSpan">
|
73
|
- <Select v-model="filters.stockStatus.model">
|
73
|
+ <Select v-model="filters.stockStatus.model" clearable>
|
74
|
<Option v-for="option in filters.stockStatus.options" :value="option.value" :key="option.value">{{option.label}}</Option>
|
74
|
<Option v-for="option in filters.stockStatus.options" :value="option.value" :key="option.value">{{option.label}}</Option>
|
75
|
</Select>
|
75
|
</Select>
|
76
|
</Col>
|
76
|
</Col>
|
77
|
</Row>
|
77
|
</Row>
|
78
|
</Col>
|
78
|
</Col>
|
|
|
79
|
+ <Col span="6">
|
|
|
80
|
+ <Row>
|
|
|
81
|
+ <Col :span="filters.publishStatus.labelSpan">
|
|
|
82
|
+ <label class="field-label">{{filters.publishStatus.label}}:</label>
|
|
|
83
|
+ </Col>
|
|
|
84
|
+ <Col :span="filters.publishStatus.fieldSpan">
|
|
|
85
|
+ <Select v-model="filters.publishStatus.model" clearable>
|
|
|
86
|
+ <Option v-for="option in filters.publishStatus.options" :value="option.value" :key="option.value">{{option.label}}</Option>
|
|
|
87
|
+ </Select>
|
|
|
88
|
+ </Col>
|
|
|
89
|
+ </Row>
|
|
|
90
|
+ </Col>
|
79
|
</Row>
|
91
|
</Row>
|
80
|
<div class="filter-row">
|
92
|
<div class="filter-row">
|
81
|
<Category :field-sort="filters.sort" @on-change="sortChange"></Category>
|
93
|
<Category :field-sort="filters.sort" @on-change="sortChange"></Category>
|
|
@@ -86,7 +98,8 @@ |
|
@@ -86,7 +98,8 @@ |
86
|
</Row>
|
98
|
</Row>
|
87
|
<div class="hr"></div>
|
99
|
<div class="hr"></div>
|
88
|
<div class="batch-row">
|
100
|
<div class="batch-row">
|
89
|
- <Button type="error" @click="batchSetOffSale">下架</Button>
|
101
|
+ <Button type="primary" @click="batchSetOnSale">启用</Button>
|
|
|
102
|
+ <Button type="error" @click="batchSetOnSale">禁用</Button>
|
90
|
</div>
|
103
|
</div>
|
91
|
<Table border :columns="tableCols" :data="tableData" @on-selection-change="selectChange"></Table>
|
104
|
<Table border :columns="tableCols" :data="tableData" @on-selection-change="selectChange"></Table>
|
92
|
<div class="list-page">
|
105
|
<div class="list-page">
|
|
@@ -104,7 +117,6 @@ |
|
@@ -104,7 +117,6 @@ |
104
|
import {filterFields, initialFields, tableCols, tableData, pageData} from './store';
|
117
|
import {filterFields, initialFields, tableCols, tableData, pageData} from './store';
|
105
|
|
118
|
|
106
|
export default {
|
119
|
export default {
|
107
|
- name: 'vips',
|
|
|
108
|
data() {
|
120
|
data() {
|
109
|
return {
|
121
|
return {
|
110
|
tableCols,
|
122
|
tableCols,
|
|
@@ -121,32 +133,38 @@ |
|
@@ -121,32 +133,38 @@ |
121
|
this.initialFilters = JSON.stringify(filterFields);
|
133
|
this.initialFilters = JSON.stringify(filterFields);
|
122
|
},
|
134
|
},
|
123
|
methods: {
|
135
|
methods: {
|
124
|
- filterSearch() {
|
|
|
125
|
- const params = {
|
|
|
126
|
- productSkn: this.filters.sknCode.model,
|
|
|
127
|
- factoryCode: this.filters.prodCode.model,
|
|
|
128
|
- productName: this.filters.prodName.model,
|
|
|
129
|
- skuFactoryCode: this.filters.prodBarCode.model,
|
|
|
130
|
- maxSortId: this.filters.sort.first.model,
|
|
|
131
|
- middleSortId: this.filters.sort.second.model,
|
|
|
132
|
- smallSortId: this.filters.sort.third.model,
|
|
|
133
|
- brandId: this.filters.brand.model,
|
|
|
134
|
- auditStatus: this.filters.verifyStatus.model,
|
|
|
135
|
- stock: this.filters.stockStatus.model != -1 ? this.filters.stockStatus.model : null
|
136
|
+ filterParams() {
|
|
|
137
|
+ const fts = this.filters;
|
|
|
138
|
+ const data = {
|
|
|
139
|
+ productSkn: fts.sknCode.model,
|
|
|
140
|
+ factoryCode: fts.prodCode.model,
|
|
|
141
|
+ skuFactoryCode: fts.prodBarCode.model,
|
|
|
142
|
+ maxSortId: fts.sort.first.model,
|
|
|
143
|
+ middleSortId: fts.sort.second.model,
|
|
|
144
|
+ smallSortId: fts.sort.third.model,
|
|
|
145
|
+ isPublished: fts.publishStatus.model,
|
|
|
146
|
+ brandId: fts.brand.model != -1 ? fts.brand.model : null,
|
|
|
147
|
+ auditStatus: fts.verifyStatus.model != -1 ? fts.verifyStatus.model : null,
|
|
|
148
|
+ stock: fts.stockStatus.model != -1 ? this.filters.stockStatus.model : null
|
136
|
};
|
149
|
};
|
137
|
|
150
|
|
|
|
151
|
+ return data;
|
|
|
152
|
+ },
|
|
|
153
|
+ filterSearch() {
|
|
|
154
|
+ const params = this.filterParams();
|
|
|
155
|
+
|
138
|
this.useFilterSign = true;
|
156
|
this.useFilterSign = true;
|
139
|
this.productList(params);
|
157
|
this.productList(params);
|
140
|
},
|
158
|
},
|
141
|
clearFilter() {
|
159
|
clearFilter() {
|
|
|
160
|
+ this.filters = JSON.parse(this.initialFilters);
|
142
|
this.productList();
|
161
|
this.productList();
|
143
|
this.useFilterSign = false;
|
162
|
this.useFilterSign = false;
|
144
|
- this.filters = JSON.parse(this.initialFilters);
|
|
|
145
|
},
|
163
|
},
|
146
|
productList(params) {
|
164
|
productList(params) {
|
147
|
service.productList(
|
165
|
service.productList(
|
148
|
_.merge(params || {}, {
|
166
|
_.merge(params || {}, {
|
149
|
- shelfStatus: 1,
|
167
|
+ shelfStatus: 0,
|
150
|
size: 20
|
168
|
size: 20
|
151
|
}))
|
169
|
}))
|
152
|
.then(res => {
|
170
|
.then(res => {
|
|
@@ -167,25 +185,31 @@ |
|
@@ -167,25 +185,31 @@ |
167
|
this.pageData.current = 1;
|
185
|
this.pageData.current = 1;
|
168
|
},
|
186
|
},
|
169
|
sortChange(sort) {
|
187
|
sortChange(sort) {
|
170
|
- this.filters.sort.first.model = sort.first || null;
|
|
|
171
|
- this.filters.sort.second.model = sort.second || null;
|
|
|
172
|
- this.filters.sort.third.model = sort.third || null;
|
188
|
+ this.filters.sort.first.model = sort.first;
|
|
|
189
|
+ this.filters.sort.second.model = sort.second;
|
|
|
190
|
+ this.filters.sort.third.model = sort.third;
|
173
|
},
|
191
|
},
|
174
|
brandChange(val) {
|
192
|
brandChange(val) {
|
175
|
_.set(this.filters, 'brand.model', val);
|
193
|
_.set(this.filters, 'brand.model', val);
|
176
|
},
|
194
|
},
|
177
|
pageChange(page) {
|
195
|
pageChange(page) {
|
178
|
- let params = {
|
196
|
+ let params = {};
|
|
|
197
|
+
|
|
|
198
|
+ if(this.useFilterSign) {
|
|
|
199
|
+ params = this.filterParams();
|
|
|
200
|
+ }
|
|
|
201
|
+
|
|
|
202
|
+ _.merge(params, {
|
179
|
page,
|
203
|
page,
|
180
|
size: 20,
|
204
|
size: 20,
|
181
|
productStatusStr: 1
|
205
|
productStatusStr: 1
|
182
|
- };
|
206
|
+ });
|
183
|
|
207
|
|
184
|
this.productList(params);
|
208
|
this.productList(params);
|
185
|
},
|
209
|
},
|
186
|
- setOffSale(skns) {
|
210
|
+ setOnSale(skns) {
|
187
|
const params = {
|
211
|
const params = {
|
188
|
- targetStatus: 0
|
212
|
+ targetStatus: 1
|
189
|
};
|
213
|
};
|
190
|
|
214
|
|
191
|
if(_.isArray(skns)) {
|
215
|
if(_.isArray(skns)) {
|
|
@@ -194,15 +218,15 @@ |
|
@@ -194,15 +218,15 @@ |
194
|
params['productSkns'] = `[${skns}]`
|
218
|
params['productSkns'] = `[${skns}]`
|
195
|
}
|
219
|
}
|
196
|
|
220
|
|
197
|
- service.setOffSale(params)
|
221
|
+ service.setOnSale(params)
|
198
|
.then(res => {
|
222
|
.then(res => {
|
199
|
this.$Message.success(res.data.message);
|
223
|
this.$Message.success(res.data.message);
|
200
|
});
|
224
|
});
|
201
|
},
|
225
|
},
|
202
|
|
226
|
|
203
|
- batchSetOffSale() {
|
227
|
+ batchSetOnSale() {
|
204
|
if(!this.batchOffSale.length) {
|
228
|
if(!this.batchOffSale.length) {
|
205
|
- return this.$Message.error('请选择要下架的商品');
|
229
|
+ return this.$Message.error('请选择要上架的商品');
|
206
|
}
|
230
|
}
|
207
|
|
231
|
|
208
|
let skns = [];
|
232
|
let skns = [];
|
|
@@ -211,7 +235,7 @@ |
|
@@ -211,7 +235,7 @@ |
211
|
skns.push(item.productSkn);
|
235
|
skns.push(item.productSkn);
|
212
|
});
|
236
|
});
|
213
|
|
237
|
|
214
|
- this.setOffSale(skns);
|
238
|
+ this.setOnSale(skns);
|
215
|
},
|
239
|
},
|
216
|
changePrice(row) {
|
240
|
changePrice(row) {
|
217
|
row.changePrice = true;
|
241
|
row.changePrice = true;
|
|
@@ -253,7 +277,7 @@ |
|
@@ -253,7 +277,7 @@ |
253
|
}
|
277
|
}
|
254
|
</script>
|
278
|
</script>
|
255
|
|
279
|
|
256
|
-<style lang="scss" scoped>
|
280
|
+<style lang="scss">
|
257
|
.filter-row {
|
281
|
.filter-row {
|
258
|
margin-bottom: 20px;
|
282
|
margin-bottom: 20px;
|
259
|
|
283
|
|
|
@@ -275,4 +299,12 @@ |
|
@@ -275,4 +299,12 @@ |
275
|
float: right;
|
299
|
float: right;
|
276
|
margin-top: 20px;
|
300
|
margin-top: 20px;
|
277
|
}
|
301
|
}
|
|
|
302
|
+
|
|
|
303
|
+ .prd-img {
|
|
|
304
|
+ max-height: 200px;
|
|
|
305
|
+ }
|
|
|
306
|
+
|
|
|
307
|
+ .action-btn-row {
|
|
|
308
|
+ margin-top: 10px;
|
|
|
309
|
+ }
|
278
|
</style> |
310
|
</style> |