修正 【兑换码管理】编辑页面,立减金商品未展示剩余数量以及已使用数量

This commit is contained in:
wangsongsole 2022-06-14 14:38:49 +08:00
parent 83bde773ed
commit 2f205ac994
1 changed files with 11 additions and 0 deletions

View File

@ -337,6 +337,13 @@ export default class exchangedit extends React.Component {
channel_activity_id: item.entity.channel_activity_id, channel_activity_id: item.entity.channel_activity_id,
product_name: item.entity.batch_goods_name, product_name: item.entity.batch_goods_name,
quantity: item.entity.stock, quantity: item.entity.stock,
stock:
item.entity.all_budget / item.entity.reduce_amount -
item.entity.used_amount / item.entity.reduce_amount,
usage:
item.entity.all_budget / item.entity.reduce_amount -
(item.entity.all_budget - item.entity.used_amount) /
item.entity.reduce_amount,
effectDate: effectDate:
item.entity.time_limit.effect_time.start_time + item.entity.time_limit.effect_time.start_time +
' 至 ' + ' 至 ' +
@ -728,6 +735,10 @@ export default class exchangedit extends React.Component {
newObj.quantity = item.quantity newObj.quantity = item.quantity
? item.quantity ? item.quantity
: Math.trunc(item.all_budget / item.reduce_amount) //总库 : Math.trunc(item.all_budget / item.reduce_amount) //总库
newObj.stock = item.quantity
? item.quantity
: Math.trunc(item.all_budget / item.reduce_amount) //剩余
newObj.usage = 0 //已使用
newObj.origin = item.origin ? item.origin : item newObj.origin = item.origin ? item.origin : item
newObj.id = item.goods_id ? item.goods_id : item.id newObj.id = item.goods_id ? item.goods_id : item.id
return newObj return newObj