|
@@ -617,9 +617,20 @@
|
|
salesPromoSn: this.promo.salesPromoSn
|
|
salesPromoSn: this.promo.salesPromoSn
|
|
})
|
|
})
|
|
// 当删除成功且不是”不参与活动“时
|
|
// 当删除成功且不是”不参与活动“时
|
|
- if(delRet.status == 200 && data != 0){
|
|
|
|
|
|
+ if(delRet.status == 200){
|
|
|
|
+ // 刷下当前活动列表
|
|
|
|
+ this.resetSearchForm()
|
|
// 再添加到其它活动
|
|
// 再添加到其它活动
|
|
- this.$emit("upActive",editRow, data)
|
|
|
|
|
|
+ if(data != 0){
|
|
|
|
+ editRow.productPackQty = editRow.packQty
|
|
|
|
+ editRow.lastStockCost = editRow.showCost
|
|
|
|
+ editRow.productPrice = editRow.price
|
|
|
|
+ editRow.salesNums = editRow.qty
|
|
|
|
+ this.$emit("upActive",editRow, data)
|
|
|
|
+ }else{
|
|
|
|
+ // 刷下正常产品列表
|
|
|
|
+ this.$emit('insterOk')
|
|
|
|
+ }
|
|
}
|
|
}
|
|
this.openUpActiveModal = false
|
|
this.openUpActiveModal = false
|
|
this.spinning = false
|
|
this.spinning = false
|
|
@@ -629,15 +640,15 @@
|
|
console.log(row, promotionFlag, promoProductClz)
|
|
console.log(row, promotionFlag, promoProductClz)
|
|
// 防止多次添加产品
|
|
// 防止多次添加产品
|
|
if (this.isInster) { return }
|
|
if (this.isInster) { return }
|
|
- const _this = this
|
|
|
|
- _this.saveNewProduct(row, promotionFlag, promoProductClz)
|
|
|
|
|
|
+ this.saveNewProduct(row, promotionFlag, promoProductClz)
|
|
},
|
|
},
|
|
// 保存添加的产品到销售列表
|
|
// 保存添加的产品到销售列表
|
|
- saveNewProduct (row, promo, promoProductClz) {
|
|
|
|
|
|
+ saveNewProduct (row, promotionFlag, promoProductClz) {
|
|
this.$message.loading('正在添加产品...', 1)
|
|
this.$message.loading('正在添加产品...', 1)
|
|
this.isInster = true
|
|
this.isInster = true
|
|
this.spinning = true
|
|
this.spinning = true
|
|
- salesDetailInsert({
|
|
|
|
|
|
+ console.log(row)
|
|
|
|
+ const params = {
|
|
salesPromoSn: this.promo.salesPromoSn,
|
|
salesPromoSn: this.promo.salesPromoSn,
|
|
promoRuleSn: this.promo.promoRuleSn,
|
|
promoRuleSn: this.promo.promoRuleSn,
|
|
promoSn: this.promo.promoSn,
|
|
promoSn: this.promo.promoSn,
|
|
@@ -646,7 +657,7 @@
|
|
productSn: row.productSn,
|
|
productSn: row.productSn,
|
|
showCost: row.lastStockCost,
|
|
showCost: row.lastStockCost,
|
|
price: row.productPrice,
|
|
price: row.productPrice,
|
|
- origPrice: row.productPrice,
|
|
|
|
|
|
+ origPrice: row.origPrice,
|
|
promotionGiftsAmount: 0,
|
|
promotionGiftsAmount: 0,
|
|
usePromotionGiftsAmount: 0,
|
|
usePromotionGiftsAmount: 0,
|
|
qty: row.salesNums,
|
|
qty: row.salesNums,
|
|
@@ -658,7 +669,8 @@
|
|
promotableFlag: row.isJoinActivityProduct || 0, // 可促销标记 有活动的传1,没活动的传0
|
|
promotableFlag: row.isJoinActivityProduct || 0, // 可促销标记 有活动的传1,没活动的传0
|
|
promotionFlag: promotionFlag, // 促销标记 正品传0,促销品传1
|
|
promotionFlag: promotionFlag, // 促销标记 正品传0,促销品传1
|
|
warehouseSn: row.warehouseSn
|
|
warehouseSn: row.warehouseSn
|
|
- }).then(res => {
|
|
|
|
|
|
+ }
|
|
|
|
+ salesDetailInsert(params).then(res => {
|
|
if (res.status == 200) {
|
|
if (res.status == 200) {
|
|
this.resetSearchForm()
|
|
this.resetSearchForm()
|
|
this.$message.success('产品添加成功', 2.5)
|
|
this.$message.success('产品添加成功', 2.5)
|