重新计算立减金库存数量

This commit is contained in:
wangsongsole 2022-09-20 11:41:22 +08:00
parent b6158a714f
commit 64ff85866e
7 changed files with 17 additions and 21 deletions

View File

@ -204,7 +204,7 @@ export default class acclist extends React.Component {
obj.product_name = item1.entity.batch_goods_name obj.product_name = item1.entity.batch_goods_name
obj.quantity = item1.entity.stock obj.quantity = item1.entity.stock
item1.entity.weight = item1.weight item1.entity.weight = item1.weight
obj.stock = Math.ceil( obj.stock = parseInt(
divNum( divNum(
item1.entity.all_budget, item1.entity.all_budget,
item1.entity.reduce_amount item1.entity.reduce_amount
@ -214,7 +214,7 @@ export default class acclist extends React.Component {
item1.entity.reduce_amount item1.entity.reduce_amount
) )
) )
obj.usage = Math.ceil( obj.usage = parseInt(
divNum( divNum(
item1.entity.all_budget, item1.entity.all_budget,
item1.entity.reduce_amount item1.entity.reduce_amount
@ -548,7 +548,7 @@ export default class acclist extends React.Component {
: item.reduce_amount //官方价 : item.reduce_amount //官方价
newObj.quantity = item.quantity newObj.quantity = item.quantity
? item.quantity ? item.quantity
: Math.ceil(divNum(item.all_budget, item.reduce_amount)) //总库 : parseInt(divNum(item.all_budget, item.reduce_amount)) //总库
newObj.origin = item?.origin ? item?.origin : item newObj.origin = item?.origin ? item?.origin : item
return newObj return newObj
}) })

View File

@ -445,7 +445,7 @@ export default class acclist extends React.Component {
: item.reduce_amount // : item.reduce_amount //
newObj.quantity = item.quantity newObj.quantity = item.quantity
? item.quantity ? item.quantity
: Math.ceil(divNum(item.all_budget, item.reduce_amount)) // : parseInt(divNum(item.all_budget, item.reduce_amount)) //
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

View File

@ -367,16 +367,16 @@ export default class exchangedit extends React.Component {
obj.channel_activity_id = item1.channel_activity_id obj.channel_activity_id = item1.channel_activity_id
obj.product_name = item1.batch_goods_name obj.product_name = item1.batch_goods_name
if (type) { if (type) {
obj.quantity = Math.ceil(divNum(item1.all_budget, item1.reduce_amount)) obj.quantity = parseInt(divNum(item1.all_budget, item1.reduce_amount))
obj.stock = Math.ceil(divNum(item1.all_budget, item1.reduce_amount)) obj.stock = parseInt(divNum(item1.all_budget, item1.reduce_amount))
obj.usage = 0 obj.usage = 0
} else { } else {
obj.quantity = item1.stock obj.quantity = item1.stock
obj.stock = Math.ceil( obj.stock = parseInt(
divNum(item1.all_budget, item1.reduce_amount) - divNum(item1.all_budget, item1.reduce_amount) -
divNum(item1.used_amount, item1.reduce_amount) divNum(item1.used_amount, item1.reduce_amount)
) )
obj.usage = Math.ceil( obj.usage = parseInt(
divNum(item1.all_budget, item1.reduce_amount) - divNum(item1.all_budget, item1.reduce_amount) -
divNum(item1.all_budget - item1.used_amount, item1.reduce_amount) divNum(item1.all_budget - item1.used_amount, item1.reduce_amount)
) )
@ -420,11 +420,11 @@ 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: Math.ceil( stock: parseInt(
divNum(item.entity.all_budget, item.entity.reduce_amount) - divNum(item.entity.all_budget, item.entity.reduce_amount) -
divNum(item.entity.used_amount, item.entity.reduce_amount) divNum(item.entity.used_amount, item.entity.reduce_amount)
), ),
usage: Math.ceil( usage: parseInt(
divNum(item.entity.all_budget, item.entity.reduce_amount) - divNum(item.entity.all_budget, item.entity.reduce_amount) -
divNum( divNum(
item.entity.all_budget - item.entity.used_amount, item.entity.all_budget - item.entity.used_amount,
@ -836,10 +836,10 @@ export default class exchangedit extends React.Component {
: item.reduce_amount //官方价 : item.reduce_amount //官方价
newObj.quantity = item.quantity newObj.quantity = item.quantity
? item.quantity ? item.quantity
: Math.ceil(divNum(item.all_budget, item.reduce_amount)) //总库 : parseInt(divNum(item.all_budget, item.reduce_amount)) //总库
newObj.stock = item.quantity newObj.stock = item.quantity
? item.quantity ? item.quantity
: Math.ceil(divNum(item.all_budget, item.reduce_amount)) //剩余 : parseInt(divNum(item.all_budget, item.reduce_amount)) //剩余
newObj.usage = 0 //已使用 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

View File

@ -235,9 +235,7 @@ export default class add extends React.Component {
item3.time_limit.effect_time.end_time //有效时间 item3.time_limit.effect_time.end_time //有效时间
obj.contract_price = item3.price //单价 obj.contract_price = item3.price //单价
obj.official_price = item3.reduce_amount //官方价 obj.official_price = item3.reduce_amount //官方价
obj.quantity = Math.ceil( obj.quantity = parseInt(divNum(item3.all_budget, item3.reduce_amount)) //总库存
divNum(item3.all_budget, item3.reduce_amount)
) //总库存
obj.origin = item3 obj.origin = item3
item1.products.push(obj) item1.products.push(obj)
}) })

View File

@ -181,9 +181,7 @@ export default class add extends React.Component {
item3.time_limit.effect_time.end_time //有效时间 item3.time_limit.effect_time.end_time //有效时间
obj.contract_price = item3.price //单价 obj.contract_price = item3.price //单价
obj.official_price = item3.reduce_amount //官方价 obj.official_price = item3.reduce_amount //官方价
obj.quantity = Math.ceil( obj.quantity = parseInt(divNum(item3.all_budget, item3.reduce_amount)) //总库存
divNum(item3.all_budget, item3.reduce_amount)
) //总库存
obj.origin = item3 obj.origin = item3
item1.products.push(obj) item1.products.push(obj)
}) })

View File

@ -368,7 +368,7 @@ export default class acclist extends React.Component {
: item.reduce_amount //官方价 : item.reduce_amount //官方价
newObj.quantity = item.quantity newObj.quantity = item.quantity
? item.quantity ? item.quantity
: Math.ceil(divNum(item.all_budget, item.reduce_amount)) //总库 : parseInt(divNum(item.all_budget, item.reduce_amount)) //总库
newObj.origin = item?.origin ? item?.origin : item newObj.origin = item?.origin ? item?.origin : item
return newObj return newObj
}) })

View File

@ -204,7 +204,7 @@ export default class acclist extends React.Component {
item1.time_limit?.effect_time.end_time, //有效时间 item1.time_limit?.effect_time.end_time, //有效时间
contract_price: item1.price, //单价 contract_price: item1.price, //单价
official_price: item1.reduce_amount, //官方价 official_price: item1.reduce_amount, //官方价
quantity: Math.ceil( quantity: parseInt(
divNum(item1.all_budget, item1.reduce_amount) divNum(item1.all_budget, item1.reduce_amount)
), //总库 ), //总库
...item1 ...item1
@ -490,7 +490,7 @@ export default class acclist extends React.Component {
: item.reduce_amount //官方价 : item.reduce_amount //官方价
newObj.quantity = item.quantity newObj.quantity = item.quantity
? item.quantity ? item.quantity
: Math.ceil(divNum(item.all_budget, item.reduce_amount)) //总库 : parseInt(divNum(item.all_budget, item.reduce_amount)) //总库
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