...
|
...
|
@@ -58,7 +58,7 @@ |
|
|
<label class="field-label">{{filters.verifyStatus.label}}:</label>
|
|
|
</Col>
|
|
|
<Col :span="filters.verifyStatus.fieldSpan">
|
|
|
<Select v-model="filters.verifyStatus.model">
|
|
|
<Select v-model="filters.verifyStatus.model" clearable>
|
|
|
<Option v-for="option in filters.verifyStatus.options" :value="option.value" :key="option.value">{{option.label}}</Option>
|
|
|
</Select>
|
|
|
</Col>
|
...
|
...
|
@@ -70,12 +70,24 @@ |
|
|
<label class="field-label">{{filters.stockStatus.label}}:</label>
|
|
|
</Col>
|
|
|
<Col :span="filters.stockStatus.fieldSpan">
|
|
|
<Select v-model="filters.stockStatus.model">
|
|
|
<Select v-model="filters.stockStatus.model" clearable>
|
|
|
<Option v-for="option in filters.stockStatus.options" :value="option.value" :key="option.value">{{option.label}}</Option>
|
|
|
</Select>
|
|
|
</Col>
|
|
|
</Row>
|
|
|
</Col>
|
|
|
<Col span="6">
|
|
|
<Row>
|
|
|
<Col :span="filters.publishStatus.labelSpan">
|
|
|
<label class="field-label">{{filters.publishStatus.label}}:</label>
|
|
|
</Col>
|
|
|
<Col :span="filters.publishStatus.fieldSpan">
|
|
|
<Select v-model="filters.publishStatus.model" clearable>
|
|
|
<Option v-for="option in filters.publishStatus.options" :value="option.value" :key="option.value">{{option.label}}</Option>
|
|
|
</Select>
|
|
|
</Col>
|
|
|
</Row>
|
|
|
</Col>
|
|
|
</Row>
|
|
|
<div class="filter-row">
|
|
|
<Category :field-sort="filters.sort" @on-change="sortChange"></Category>
|
...
|
...
|
@@ -86,7 +98,8 @@ |
|
|
</Row>
|
|
|
<div class="hr"></div>
|
|
|
<div class="batch-row">
|
|
|
<Button type="error" @click="batchSetOffSale">下架</Button>
|
|
|
<Button type="primary" @click="batchSetOnSale">启用</Button>
|
|
|
<Button type="error" @click="batchSetOnSale">禁用</Button>
|
|
|
</div>
|
|
|
<Table border :columns="tableCols" :data="tableData" @on-selection-change="selectChange"></Table>
|
|
|
<div class="list-page">
|
...
|
...
|
@@ -104,7 +117,6 @@ |
|
|
import {filterFields, initialFields, tableCols, tableData, pageData} from './store';
|
|
|
|
|
|
export default {
|
|
|
name: 'vips',
|
|
|
data() {
|
|
|
return {
|
|
|
tableCols,
|
...
|
...
|
@@ -121,32 +133,38 @@ |
|
|
this.initialFilters = JSON.stringify(filterFields);
|
|
|
},
|
|
|
methods: {
|
|
|
filterSearch() {
|
|
|
const params = {
|
|
|
productSkn: this.filters.sknCode.model,
|
|
|
factoryCode: this.filters.prodCode.model,
|
|
|
productName: this.filters.prodName.model,
|
|
|
skuFactoryCode: this.filters.prodBarCode.model,
|
|
|
maxSortId: this.filters.sort.first.model,
|
|
|
middleSortId: this.filters.sort.second.model,
|
|
|
smallSortId: this.filters.sort.third.model,
|
|
|
brandId: this.filters.brand.model,
|
|
|
auditStatus: this.filters.verifyStatus.model,
|
|
|
stock: this.filters.stockStatus.model != -1 ? this.filters.stockStatus.model : null
|
|
|
filterParams() {
|
|
|
const fts = this.filters;
|
|
|
const data = {
|
|
|
productSkn: fts.sknCode.model,
|
|
|
factoryCode: fts.prodCode.model,
|
|
|
skuFactoryCode: fts.prodBarCode.model,
|
|
|
maxSortId: fts.sort.first.model,
|
|
|
middleSortId: fts.sort.second.model,
|
|
|
smallSortId: fts.sort.third.model,
|
|
|
isPublished: fts.publishStatus.model,
|
|
|
brandId: fts.brand.model != -1 ? fts.brand.model : null,
|
|
|
auditStatus: fts.verifyStatus.model != -1 ? fts.verifyStatus.model : null,
|
|
|
stock: fts.stockStatus.model != -1 ? this.filters.stockStatus.model : null
|
|
|
};
|
|
|
|
|
|
return data;
|
|
|
},
|
|
|
filterSearch() {
|
|
|
const params = this.filterParams();
|
|
|
|
|
|
this.useFilterSign = true;
|
|
|
this.productList(params);
|
|
|
},
|
|
|
clearFilter() {
|
|
|
this.filters = JSON.parse(this.initialFilters);
|
|
|
this.productList();
|
|
|
this.useFilterSign = false;
|
|
|
this.filters = JSON.parse(this.initialFilters);
|
|
|
},
|
|
|
productList(params) {
|
|
|
service.productList(
|
|
|
_.merge(params || {}, {
|
|
|
shelfStatus: 1,
|
|
|
shelfStatus: 0,
|
|
|
size: 20
|
|
|
}))
|
|
|
.then(res => {
|
...
|
...
|
@@ -167,25 +185,31 @@ |
|
|
this.pageData.current = 1;
|
|
|
},
|
|
|
sortChange(sort) {
|
|
|
this.filters.sort.first.model = sort.first || null;
|
|
|
this.filters.sort.second.model = sort.second || null;
|
|
|
this.filters.sort.third.model = sort.third || null;
|
|
|
this.filters.sort.first.model = sort.first;
|
|
|
this.filters.sort.second.model = sort.second;
|
|
|
this.filters.sort.third.model = sort.third;
|
|
|
},
|
|
|
brandChange(val) {
|
|
|
_.set(this.filters, 'brand.model', val);
|
|
|
},
|
|
|
pageChange(page) {
|
|
|
let params = {
|
|
|
let params = {};
|
|
|
|
|
|
if(this.useFilterSign) {
|
|
|
params = this.filterParams();
|
|
|
}
|
|
|
|
|
|
_.merge(params, {
|
|
|
page,
|
|
|
size: 20,
|
|
|
productStatusStr: 1
|
|
|
};
|
|
|
});
|
|
|
|
|
|
this.productList(params);
|
|
|
},
|
|
|
setOffSale(skns) {
|
|
|
setOnSale(skns) {
|
|
|
const params = {
|
|
|
targetStatus: 0
|
|
|
targetStatus: 1
|
|
|
};
|
|
|
|
|
|
if(_.isArray(skns)) {
|
...
|
...
|
@@ -194,15 +218,15 @@ |
|
|
params['productSkns'] = `[${skns}]`
|
|
|
}
|
|
|
|
|
|
service.setOffSale(params)
|
|
|
service.setOnSale(params)
|
|
|
.then(res => {
|
|
|
this.$Message.success(res.data.message);
|
|
|
});
|
|
|
},
|
|
|
|
|
|
batchSetOffSale() {
|
|
|
batchSetOnSale() {
|
|
|
if(!this.batchOffSale.length) {
|
|
|
return this.$Message.error('请选择要下架的商品');
|
|
|
return this.$Message.error('请选择要上架的商品');
|
|
|
}
|
|
|
|
|
|
let skns = [];
|
...
|
...
|
@@ -211,7 +235,7 @@ |
|
|
skns.push(item.productSkn);
|
|
|
});
|
|
|
|
|
|
this.setOffSale(skns);
|
|
|
this.setOnSale(skns);
|
|
|
},
|
|
|
changePrice(row) {
|
|
|
row.changePrice = true;
|
...
|
...
|
@@ -253,7 +277,7 @@ |
|
|
}
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
<style lang="scss">
|
|
|
.filter-row {
|
|
|
margin-bottom: 20px;
|
|
|
|
...
|
...
|
@@ -275,4 +299,12 @@ |
|
|
float: right;
|
|
|
margin-top: 20px;
|
|
|
}
|
|
|
|
|
|
.prd-img {
|
|
|
max-height: 200px;
|
|
|
}
|
|
|
|
|
|
.action-btn-row {
|
|
|
margin-top: 10px;
|
|
|
}
|
|
|
</style> |
...
|
...
|
|