|
@@ -307,16 +307,17 @@ export default {
|
|
|
this.showStockCol = true
|
|
|
},
|
|
|
// 当满足发货经销商显示条件时 查询
|
|
|
- searchTableData (list) {
|
|
|
- this.dataSource = list.filter(item => {
|
|
|
+ transferTableData (list) {
|
|
|
+ console.log(list, this.warehouseSn)
|
|
|
+ this.dataSource = list.filter(item => this.warehouseSn != '' ? item.warehouseSn == this.warehouseSn : true).filter(item => {
|
|
|
if (this.transferQty == '0') { // 不满足
|
|
|
return (!item.transferDealerStockQty || (item.transferDealerStockQty && item.transferDealerStockQty * 1 < item.qty * 1))
|
|
|
} else if (this.transferQty == '1') { // 满足
|
|
|
return (item.transferDealerStockQty && item.transferDealerStockQty * 1 >= item.qty * 1)
|
|
|
} else {
|
|
|
- return false
|
|
|
+ return true
|
|
|
}
|
|
|
- }).filter(item => item.warehouseSn == this.warehouseSn)
|
|
|
+ })
|
|
|
},
|
|
|
// 查询表格数据
|
|
|
async searchTable () {
|
|
@@ -330,23 +331,21 @@ export default {
|
|
|
warehouseSn: this.warehouseSn,
|
|
|
promotionFlag: this.promoFlag == '' ? undefined : this.promoFlag
|
|
|
}
|
|
|
-
|
|
|
- // 查询正常产品明细列表
|
|
|
- const normalList = this.type == 'normal' ? await salesDetailAllList(params).then(res => res.data) : []
|
|
|
- this.countData = this.type == 'normal' ? await salesDetaiCount(params).then(res => res.data) : null
|
|
|
- // 查询活动产品明细列表
|
|
|
- const activeList = this.type == 'active' ? await salesDetailExtPromoList({ salesPromoSnSet: [], ...params }).then(res => res.data) : []
|
|
|
- // 发货经销商时 查询
|
|
|
+ // 查询正常产品
|
|
|
if (this.type == 'normal') {
|
|
|
+ // 转单时
|
|
|
if (this.chooseList && this.chooseList.length) {
|
|
|
- this.searchTableData(this.chooseList)
|
|
|
+ this.transferTableData(this.chooseList)
|
|
|
} else {
|
|
|
+ // 查询正常产品明细列表
|
|
|
+ const normalList = await salesDetailAllList(params).then(res => res.data || [])
|
|
|
+ this.countData = await salesDetaiCount(params).then(res => res.data || null)
|
|
|
// 赋值
|
|
|
this.dataSource = normalList
|
|
|
}
|
|
|
} else {
|
|
|
- // 查询活动产品
|
|
|
- this.dataSource = activeList
|
|
|
+ // 查询活动产品明细列表
|
|
|
+ this.dataSource = await salesDetailExtPromoList({ salesPromoSnSet: [], ...params }).then(res => res.data || [])
|
|
|
}
|
|
|
|
|
|
// 没用数据,则不显示当前表格
|