Authored by 李奇

未上架商品修改

... ... @@ -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>
... ...
... ... @@ -68,14 +68,14 @@ let filterFields = {
label: '选择品牌',
labelSpan: 6,
fieldSpan: 18,
model: ''
model: -1
},
verifyStatus: {
label: '审核状态',
labelSpan: 6,
fieldSpan: 18,
model: '',
model: -1,
options: [
{
value: -1,
... ... @@ -83,11 +83,11 @@ let filterFields = {
},
{
value: 1,
label: '架待审核'
label: '架待审核'
},
{
value: 2,
label: '架驳回'
label: '架驳回'
}
]
},
... ... @@ -111,6 +111,27 @@ let filterFields = {
label: '无库存'
}
]
},
publishStatus: {
label: '商品状态',
labelSpan: 6,
fieldSpan: 18,
model: -1,
options: [
{
value: -1,
label: '全部'
},
{
value: 0,
label: '从未发布'
},
{
value: 1,
label: '我下架的'
}
]
}
};
... ... @@ -127,7 +148,7 @@ let tableCols = [
key: 'image',
align: 'center',
render (row, column, index) {
return `<img src="${row.picImgUrl}">`;
return `<img class="prd-img" src="${row.picImgUrl}">`;
}
},
{
... ... @@ -164,7 +185,7 @@ let tableCols = [
},
{
title: '下架时间',
key: 'shelveTime',
key: 'offshelveTime',
align: 'center'
},
{
... ... @@ -180,11 +201,11 @@ let tableCols = [
key: 'action',
align: 'center',
render: function(row, column, index) {
return `<div class="">
return `<div class="action-btn-row">
<i-button type="primary" size="small">尺码维护</i-button>
<i-button type="primary" size="small" @click="editProduct(${row.productSkn})">内容编辑</i-button>
</div>
<i-button type="success" size="small" @click="setOffSale(${row.productSkn})">上架</i-button>`;
<div class="action-btn-row"><i-button type="success" size="small" @click="setOnSale(${row.productSkn})">上架</i-button></div>`;
}
}
];
... ...
... ... @@ -13,6 +13,7 @@ let domainApis = {
querySortSize: '/SellerSortSizeController/querySortSize',
querySellerProductList: '/SellerProductController/querySellerProductList',
productOutSale: '/SellerSknStatusController/productOutSale',
productOnSale: '/SellerSknStatusController/productOnSale',
querySellerProductMaterial: '/SellerProductController/querySellerProductMaterial',
addProduct: '/SellerProductController/addProduct',
getSellerAllSortInfo: '/SellerProductController/getSellerAllSortInfo',
... ...