Commit de59c470 by zhangquan

bug修复

1 parent f27d9593
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
<el-button :size="size" type="primary" plain @click="batchPriceChange">批量改价</el-button> <el-button :size="size" type="primary" plain @click="batchPriceChange">批量改价</el-button>
</div> </div>
</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"> <div slot="goodsNameSlot" class="goodsNameSlot" slot-scope="scope">
<img :src="scope.scope.goodsImgUrl" alt=""> <img :src="scope.scope.goodsImgUrl" alt="">
<el-tooltip class="item" effect="dark" :content="(scope.scope.brandName || '') + (scope.scope.goodsSkuName || '')" placement="top"> <el-tooltip class="item" effect="dark" :content="(scope.scope.brandName || '') + (scope.scope.goodsSkuName || '')" placement="top">
...@@ -57,6 +57,7 @@ export default { ...@@ -57,6 +57,7 @@ export default {
curEditId: '', curEditId: '',
isVisible: false, isVisible: false,
batchPrice: '', batchPrice: '',
searchForm: {},
goodsFormObj: { goodsFormObj: {
goodsPosition: 2, goodsPosition: 2,
goodsSkuName: '', goodsSkuName: '',
...@@ -292,7 +293,12 @@ export default { ...@@ -292,7 +293,12 @@ export default {
if(isAll){ if(isAll){
let list = this.getAllData() let list = this.getAllData()
params = { 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{ }else{
if(!(+e.target.value)){ if(!(+e.target.value)){
......
...@@ -226,7 +226,12 @@ export default { ...@@ -226,7 +226,12 @@ export default {
if(isAll){ if(isAll){
let list = this.getAllData() let list = this.getAllData()
params = { 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{ }else{
if(!(+e.target.value)){ if(!(+e.target.value)){
......
...@@ -135,6 +135,7 @@ export default { ...@@ -135,6 +135,7 @@ export default {
}, },
{ {
label: '差价', label: '差价',
// tips: '市场价和供货价的价格差',
addHtml: 'spreadPriceSlot' addHtml: 'spreadPriceSlot'
}, },
], ],
...@@ -173,7 +174,7 @@ export default { ...@@ -173,7 +174,7 @@ export default {
startDiffPrice, startDiffPrice,
pageNum, pageNum,
pageSize, pageSize,
categoryCode: categoryCode && categoryCode.length ? categoryCode.pop() : '' categoryCode: categoryCode && categoryCode.length ? categoryCode[categoryCode.length-1] : ''
} }
this.$apis.platformGoods.getGoodsListApi(params).then(res=>{ this.$apis.platformGoods.getGoodsListApi(params).then(res=>{
if(res){ if(res){
...@@ -214,6 +215,7 @@ export default { ...@@ -214,6 +215,7 @@ export default {
this.getGoodsList() this.getGoodsList()
}, },
handleSearch(){ handleSearch(){
this.pageObj.pageNum = 1
this.getGoodsList() this.getGoodsList()
}, },
addWarehouseFn(item, isAll){ addWarehouseFn(item, isAll){
...@@ -232,7 +234,7 @@ export default { ...@@ -232,7 +234,7 @@ export default {
this.$apis.platformGoods.addWarehouseApi(params).then(res=>{ this.$apis.platformGoods.addWarehouseApi(params).then(res=>{
if(res){ if(res){
this.$message.success('操作成功') 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!