Commit de59c470 by zhangquan

bug修复

1 parent f27d9593
......@@ -19,7 +19,7 @@
<el-button :size="size" type="primary" plain @click="batchPriceChange">批量改价</el-button>
</div>
</div>
<GLTable ref="tableRef" :pageConf="pageConf" @sortChange="sortChange" :searchForm="goodsFormObj" :tableParams="tableParams" :getListApi="getListApi" :beforeSearchFn="beforeSearchFn">
<GLTable ref="tableRef" :pageConf="pageConf" @sortChange="sortChange" :searchForm="searchForm" :tableParams="tableParams" :getListApi="getListApi" :beforeSearchFn="beforeSearchFn">
<div slot="goodsNameSlot" class="goodsNameSlot" slot-scope="scope">
<img :src="scope.scope.goodsImgUrl" alt="">
<el-tooltip class="item" effect="dark" :content="(scope.scope.brandName || '') + (scope.scope.goodsSkuName || '')" placement="top">
......@@ -57,6 +57,7 @@ export default {
curEditId: '',
isVisible: false,
batchPrice: '',
searchForm: {},
goodsFormObj: {
goodsPosition: 2,
goodsSkuName: '',
......@@ -292,7 +293,12 @@ export default {
if(isAll){
let list = this.getAllData()
params = {
modifyPriceRequestList : list.map(item => {return { id: item.id, salePrice: this.batchPrice}})
modifyPriceRequestList : list.map(item => {
let curPrice = item.salePrice || 0
let addPrice = this.batchPrice || 0
let priceAmount = Number(((+curPrice) + (+addPrice)).toFixed(2))
return { id: item.id, salePrice: priceAmount}
})
}
}else{
if(!(+e.target.value)){
......
......@@ -226,7 +226,12 @@ export default {
if(isAll){
let list = this.getAllData()
params = {
modifyPriceRequestList : list.map(item => {return { id: item.id, salePrice: this.batchPrice}})
modifyPriceRequestList : list.map(item => {
let curPrice = item.salePrice || 0
let addPrice = this.batchPrice || 0
let priceAmount = Number(((+curPrice) + (+addPrice)).toFixed(2))
return { id: item.id, salePrice: priceAmount}
})
}
}else{
if(!(+e.target.value)){
......
......@@ -135,6 +135,7 @@ export default {
},
{
label: '差价',
// tips: '市场价和供货价的价格差',
addHtml: 'spreadPriceSlot'
},
],
......@@ -173,7 +174,7 @@ export default {
startDiffPrice,
pageNum,
pageSize,
categoryCode: categoryCode && categoryCode.length ? categoryCode.pop() : ''
categoryCode: categoryCode && categoryCode.length ? categoryCode[categoryCode.length-1] : ''
}
this.$apis.platformGoods.getGoodsListApi(params).then(res=>{
if(res){
......@@ -214,6 +215,7 @@ export default {
this.getGoodsList()
},
handleSearch(){
this.pageObj.pageNum = 1
this.getGoodsList()
},
addWarehouseFn(item, isAll){
......@@ -232,7 +234,7 @@ export default {
this.$apis.platformGoods.addWarehouseApi(params).then(res=>{
if(res){
this.$message.success('操作成功')
this.handleReset()
this.getGoodsList()
}
})
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!