...
|
...
|
@@ -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,7 @@ |
|
|
</Row>
|
|
|
<div class="hr"></div>
|
|
|
<div class="batch-row">
|
|
|
<Button type="success" @click="batchSetOffSale">上架</Button>
|
|
|
<Button type="success" @click="batchSetOnSale">上架</Button>
|
|
|
</div>
|
|
|
<Table border :columns="tableCols" :data="tableData" @on-selection-change="selectChange"></Table>
|
|
|
<div class="list-page">
|
...
|
...
|
@@ -120,27 +132,33 @@ |
|
|
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(
|
...
|
...
|
@@ -166,25 +184,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)) {
|
...
|
...
|
@@ -193,13 +217,13 @@ |
|
|
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('请选择要上架的商品');
|
|
|
}
|
...
|
...
|
@@ -210,7 +234,7 @@ |
|
|
skns.push(item.productSkn);
|
|
|
});
|
|
|
|
|
|
this.setOffSale(skns);
|
|
|
this.setOnSale(skns);
|
|
|
},
|
|
|
changePrice(row) {
|
|
|
row.changePrice = true;
|
...
|
...
|
@@ -252,7 +276,7 @@ |
|
|
}
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
<style lang="scss">
|
|
|
.filter-row {
|
|
|
margin-bottom: 20px;
|
|
|
|
...
|
...
|
@@ -274,4 +298,12 @@ |
|
|
float: right;
|
|
|
margin-top: 20px;
|
|
|
}
|
|
|
|
|
|
.prd-img {
|
|
|
max-height: 200px;
|
|
|
}
|
|
|
|
|
|
.action-btn-row {
|
|
|
margin-top: 10px;
|
|
|
}
|
|
|
</style> |
...
|
...
|
|