|
@@ -121,6 +121,9 @@ export default {
|
|
|
const no = (data.pageNo - 1) * data.pageSize
|
|
|
for (var i = 0; i < data.list.length; i++) {
|
|
|
data.list[i].no = no + i + 1
|
|
|
+ if (this.activeType === 'PROMO_PROD' && this.discountType === 'DISCOUNT') {
|
|
|
+ data.list[i].resultValue = data.list[i].resultValue ? data.list[i].resultValue * 100 : ''
|
|
|
+ }
|
|
|
}
|
|
|
this.chooseProductNum = data.count
|
|
|
this.disabled = false
|
|
@@ -174,6 +177,9 @@ export default {
|
|
|
conditionValue: typeName === 'conditionValue' ? row.conditionValue : undefined,
|
|
|
resultValue: typeName === 'resultValue' ? row.resultValue : undefined
|
|
|
})
|
|
|
+ if (this.activeType === 'PROMO_PROD' && this.discountType === 'DISCOUNT') {
|
|
|
+ ajaxData[0].resultValue = row.resultValue ? row.resultValue / 100 : ''
|
|
|
+ }
|
|
|
} else {
|
|
|
ajaxData = row || []
|
|
|
}
|
|
@@ -185,14 +191,19 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
// 修改产品活动价、返券金额
|
|
|
- editMorePrice (objInfo) {
|
|
|
+ editMorePrice (oldObjInfo) {
|
|
|
if (!this.rowSelectionInfo || (this.rowSelectionInfo && this.rowSelectionInfo.selectedRows && this.rowSelectionInfo.selectedRows.length === 0)) {
|
|
|
this.$message.warning('请选择要修改的产品!')
|
|
|
return
|
|
|
}
|
|
|
let ajaxArr = []
|
|
|
- if (this.activeType === 'PROMO_PROD' && this.discountType === 'STRAIGHT_DOWN') {
|
|
|
- ajaxArr = this.rowSelectionInfo.selectedRows.map(item => { return { id: item.id, promoSn: this.promoActiveSn, productPrice: item.shopProductPrice, conditionValue: (item.shopProductPrice - objInfo.resultValue), resultValue: objInfo.resultValue } })
|
|
|
+ const objInfo = JSON.parse(JSON.stringify(oldObjInfo))
|
|
|
+ if (this.activeType === 'PROMO_PROD') {
|
|
|
+ if (this.discountType === 'STRAIGHT_DOWN') {
|
|
|
+ ajaxArr = this.rowSelectionInfo.selectedRows.map(item => { return { id: item.id, promoSn: this.promoActiveSn, productPrice: item.shopProductPrice, conditionValue: (item.shopProductPrice - objInfo.resultValue), resultValue: objInfo.resultValue } })
|
|
|
+ } else {
|
|
|
+ ajaxArr = this.rowSelectionInfo.selectedRows.map(item => { return { id: item.id, promoSn: this.promoActiveSn, conditionValue: objInfo.conditionValue, resultValue: objInfo.resultValue / 100 } })
|
|
|
+ }
|
|
|
} else {
|
|
|
ajaxArr = this.rowSelectionInfo.selectedRows.map(item => { return { id: item.id, promoSn: this.promoActiveSn, conditionValue: objInfo.conditionValue, resultValue: objInfo.resultValue } })
|
|
|
}
|