库存数量取整

This commit is contained in:
wangsongsole 2022-09-20 12:11:26 +08:00
parent 4582b2ccea
commit a888b05722
10 changed files with 64 additions and 48 deletions

View File

@ -64,9 +64,8 @@ const UseGoodsScopePop = forwardRef((props, ref) => {
table_obj.product_name = form_model.batch_goods_name //
table_obj.official_price = form_model.reduce_amount //
table_obj.contract_price = form_model.price //
table_obj.quantity = divNum(
form_model.all_budget,
form_model.reduce_amount
table_obj.quantity = parseInt(
(form_model.all_budget, form_model.reduce_amount)
) //
table_obj.channel_activity_id = form_model.channel_activity_id //
table_obj.all_budget = Number(form_model.all_budget) //

View File

@ -62,7 +62,9 @@ const UseGoodsScopePop = forwardRef((props, ref) => {
table_obj.product_name = form_model.batch_goods_name //
table_obj.official_price = form_model.reduce_amount //
table_obj.contract_price = form_model.price //
table_obj.quantity = divNum(form_model.all_budget, form_model.reduce_amount) //
table_obj.quantity = parseInt(
divNum(form_model.all_budget, form_model.reduce_amount)
) //
table_obj.channel_activity_id = form_model.channel_activity_id //
table_obj.all_budget = Number(form_model.all_budget) //
table_obj.effectDate = `${form_model.time_limit.effect_time.end_time}${form_model.time_limit.effect_time.start_time}` //

View File

@ -204,21 +204,26 @@ export default class acclist extends React.Component {
obj.product_name = item1.entity.batch_goods_name
obj.quantity = item1.entity.stock
item1.entity.weight = item1.weight
obj.stock =
obj.stock = parseInt(
divNum(
item1.entity.all_budget,
item1.entity.reduce_amount
) -
divNum(item1.entity.used_amount, item1.entity.reduce_amount)
obj.usage =
divNum(
item1.entity.used_amount,
item1.entity.reduce_amount
)
)
obj.usage = parseInt(
divNum(
item1.entity.all_budget,
item1.entity.reduce_amount
) -
divNum(
item1.entity.all_budget - item1.entity.used_amount,
item1.entity.reduce_amount
)
divNum(
item1.entity.all_budget - item1.entity.used_amount,
item1.entity.reduce_amount
)
)
obj.effectDate =
item1.entity.time_limit.effect_time.start_time +
" 至 " +
@ -543,7 +548,7 @@ export default class acclist extends React.Component {
: item.reduce_amount //官方价
newObj.quantity = item.quantity
? item.quantity
: divNum(item.all_budget, item.reduce_amount) //总库
: parseInt(divNum(item.all_budget, item.reduce_amount)) //总库
newObj.origin = item?.origin ? item?.origin : item
return newObj
})

View File

@ -445,7 +445,7 @@ export default class acclist extends React.Component {
: item.reduce_amount //
newObj.quantity = item.quantity
? item.quantity
: divNum(item.all_budget, item.reduce_amount) //
: parseInt(divNum(item.all_budget, item.reduce_amount)) //
newObj.origin = item.origin ? item.origin : item
newObj.id = item.goods_id ? item.goods_id : item.id
return newObj

View File

@ -366,17 +366,19 @@ export default class exchangedit extends React.Component {
obj.channel_activity_id = item1.channel_activity_id
obj.product_name = item1.batch_goods_name
if (type) {
obj.quantity = divNum(item1.all_budget, item1.reduce_amount)
obj.stock = divNum(item1.all_budget, item1.reduce_amount)
obj.quantity = parseInt(divNum(item1.all_budget, item1.reduce_amount))
obj.stock = parseInt(divNum(item1.all_budget, item1.reduce_amount))
obj.usage = 0
} else {
obj.quantity = item1.stock
obj.stock =
obj.stock = parseInt(
divNum(item1.all_budget, item1.reduce_amount) -
divNum(item1.used_amount, item1.reduce_amount)
obj.usage =
divNum(item1.used_amount, item1.reduce_amount)
)
obj.usage = parseInt(
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)
)
}
obj.effectDate =
item1.time_limit.effect_time.start_time +
@ -417,15 +419,17 @@ export default class exchangedit extends React.Component {
channel_activity_id: item.entity.channel_activity_id,
product_name: item.entity.batch_goods_name,
quantity: item.entity.stock,
stock:
stock: parseInt(
divNum(item.entity.all_budget, item.entity.reduce_amount) -
divNum(item.entity.used_amount, item.entity.reduce_amount),
usage:
divNum(item.entity.used_amount, item.entity.reduce_amount)
),
usage: parseInt(
divNum(item.entity.all_budget, item.entity.reduce_amount) -
divNum(
item.entity.all_budget - item.entity.used_amount,
item.entity.reduce_amount
),
divNum(
item.entity.all_budget - item.entity.used_amount,
item.entity.reduce_amount
)
),
effectDate:
item.entity.time_limit.effect_time.start_time +
" 至 " +
@ -831,10 +835,10 @@ export default class exchangedit extends React.Component {
: item.reduce_amount //官方价
newObj.quantity = item.quantity
? item.quantity
: divNum(item.all_budget, item.reduce_amount) //总库
: parseInt((item.all_budget, item.reduce_amount)) //总库
newObj.stock = item.quantity
? item.quantity
: divNum(item.all_budget, item.reduce_amount) //剩余
: parseInt(divNum(item.all_budget, item.reduce_amount)) //剩余
newObj.usage = 0 //已使用
newObj.origin = item.origin ? item.origin : item
newObj.id = item.goods_id ? item.goods_id : item.id

View File

@ -387,18 +387,20 @@ export default class exchangeAdd extends React.Component {
obj.channel_activity_id = item1.channel_activity_id
obj.product_name = item1.batch_goods_name
if (type) {
obj.quantity = divNum(item1.all_budget, item1.reduce_amount)
obj.stock = divNum(item1.all_budget, item1.reduce_amount)
obj.quantity = parseInt(divNum(item1.all_budget, item1.reduce_amount))
obj.stock = parseInt(divNum(item1.all_budget, item1.reduce_amount))
obj.usage = 0
} else {
obj.quantity = item1.stock
obj.stock =
obj.stock = parseInt(
divNum(item1.all_budget, item1.reduce_amount) -
divNum(item1.used_amount, item1.reduce_amount)
divNum(item1.used_amount, item1.reduce_amount)
)
obj.usage =
obj.usage = parseInt(
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)
)
}
obj.effectDate =
item1.time_limit.effect_time.start_time +
@ -441,15 +443,17 @@ export default class exchangeAdd extends React.Component {
channel_activity_id: item.entity.channel_activity_id,
product_name: item.entity.batch_goods_name,
quantity: item.entity.stock,
stock:
stock: parseInt(
divNum(item.entity.all_budget, item.entity.reduce_amount) -
divNum(item.entity.used_amount, item.entity.reduce_amount),
usage:
divNum(item.entity.used_amount, item.entity.reduce_amount)
),
usage: parseInt(
divNum(item.entity.all_budget, item.entity.reduce_amount) -
divNum(
item.entity.all_budget - item.entity.used_amount,
item.entity.reduce_amount
),
divNum(
item.entity.all_budget - item.entity.used_amount,
item.entity.reduce_amount
)
),
effectDate:
item.entity.time_limit.effect_time.start_time +
" 至 " +
@ -917,10 +921,10 @@ export default class exchangeAdd extends React.Component {
: item.reduce_amount //
newObj.quantity = item.quantity
? item.quantity
: divNum(item.all_budget, item.reduce_amount) //
: parseInt(divNum(item.all_budget, item.reduce_amount)) //
newObj.stock = item.quantity
? item.quantity
: divNum(item.all_budget, item.reduce_amount) //
: parseInt(divNum(item.all_budget, item.reduce_amount)) //
newObj.usage = 0 //使
newObj.origin = item.origin ? item.origin : item
newObj.id = item.goods_id ? item.goods_id : item.id

View File

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

View File

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

View File

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

View File

@ -203,7 +203,9 @@ export default class acclist extends React.Component {
item1.time_limit?.effect_time.end_time, //有效时间
contract_price: item1.price, //单价
official_price: item1.reduce_amount, //官方价
quantity: divNum(item1.all_budget, item1.reduce_amount), //总库
quantity: parseInt(
divNum(item1.all_budget, item1.reduce_amount)
), //总库
...item1
})
})
@ -487,7 +489,7 @@ export default class acclist extends React.Component {
: item.reduce_amount //官方价
newObj.quantity = item.quantity
? item.quantity
: divNum(item.all_budget, item.reduce_amount) //总库
: parseInt(divNum(item.all_budget, item.reduce_amount)) //总库
newObj.origin = item.origin ? item.origin : item
newObj.id = item.goods_id ? item.goods_id : item.id
return newObj