Authored by 李奇

列表页价格变更添加

... ... @@ -89,7 +89,7 @@
</Col>
</Row>
<Row class-name="filter-row">
<Button type="primary">筛选</Button>
<Button type="primary" @click="filterSearch">筛选</Button>
<Button>清空条件</Button>
</Row>
<div class="hr"></div>
... ... @@ -119,30 +119,39 @@
}
},
created() {
const params = {
productStatusStr: 1,
size: 20
};
service.productList(params).then(res => {
let code = _.get(res, 'data.code');
if(code === 200) {
this.updateStore(res.data.data);
}
});
this.productList();
},
methods: {
productList(params) {
service.productList(_.merge(params, {size: 20})).then(res => {
let code = _.get(res, 'data.code');
filterSearch() {
const params = {
// productSkn: this.filters.sknCode.model,
// factoryCode: this.filters.factoryCode.model,
// productName: this.filters.productName.model,
// skuFactoryCode: this.filters.skuFactoryCode.model,
// maxSortId: this.filters.maxSortId.model,
// maxSortId: this.filters.maxSortId.model,
// middleSortId: this.filters.middleSortId.model,
// smallSortId: this.filters.smallSortId.model,
// auditStatus: this.filters.auditStatus.model,
// stock: this.filters.stock.model
};
if(code === 200) {
this.updateStore(res.data.data);
}
});
this.productList(params);
},
productList(params) {
service.productList(
_.merge(params || {}, {
shelfStatus: 1,
size: 20
}))
.then(res => {
let code = _.get(res, 'data.code');
if(code === 200) {
this.updateStore(res.data.data);
}
});
},
updateStore(data) {
this.pageData.total = data.total;
... ... @@ -152,15 +161,12 @@
this.tableData = data.list;
},
categoryChange(val) {
_.set(this.filters, 'category.model', val);
},
brandChange(val) {
_.set(this.filters, 'brand.model', val);
},
pageChange(page) {
let params = {
page,
... ... @@ -191,23 +197,27 @@
batchSetOffSale() {
},
changePrice(row) {
changePrice(row, index) {
console.log(index)
row.changePrice = true;
},
updatePrice(row) {
row.changePrice = false;
const index = row.lineIndex;
const salesPrice = row.salesPrice;
const productSkn = row.productSkn;
const params = {
productSkn: row.productSkn,
salesPrice: row.salesPrice
salesPrice,
productSkn
};
service.updateSalesPrice(params)
.then(res => {
this.tableData[index].salesPrice = salesPrice;
row.changePrice = false;
this.$Message.success(res.data.message);
})
},
editProduct(skn) {
this.$router.push({
name: 'product.create.step1',
... ... @@ -215,6 +225,10 @@
skn
}
});
},
priceChange(val) {
console.log(val)
}
},
components: {
... ...
... ... @@ -3,18 +3,11 @@
* @author: qi.li <qi.li@yoho.cn>
* @date: 2017/04/13
*/
const status = {
0: '已下架',
1: '已上架',
2: '上架待审核',
3: '上架驳回',
4: '通过',
5: '再上架待审核',
6: '再上架驳回',
7: '再上架通过',
8: '待上架',
9: '下架审核驳回',
10: '下架待审核'
const auditStatus = {
0: '无状态',
1: '提出审核',
2: '审核驳回',
3: '审核通过'
};
let filterFields = {
... ... @@ -137,6 +130,7 @@ let tableCols = [
align: 'center',
label: 'test',
render(row, column, index) {
row.lineIndex = index;
return `<p>吊牌价:${row.retailPrice}</p>
<p v-if="!row.changePrice">销售价:${row.salesPrice}
<i-button type="info" size="small" @click="changePrice(row)"></i-button>
... ... @@ -161,7 +155,7 @@ let tableCols = [
key: 'verify',
align: 'center',
render(row, column, index) {
return `${status[row.status]}`
return `${auditStatus[row.auditStatus]}`
}
},
{
... ...