diff --git a/src/pages/exchangecode/add/add.js b/src/pages/exchangecode/add/add.js index e6cbb5d7..61e468cf 100644 --- a/src/pages/exchangecode/add/add.js +++ b/src/pages/exchangecode/add/add.js @@ -204,7 +204,7 @@ 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 = Math.ceil( + obj.stock = parseInt( divNum( item1.entity.all_budget, item1.entity.reduce_amount @@ -214,7 +214,7 @@ export default class acclist extends React.Component { item1.entity.reduce_amount ) ) - obj.usage = Math.ceil( + obj.usage = parseInt( divNum( item1.entity.all_budget, item1.entity.reduce_amount @@ -548,7 +548,7 @@ export default class acclist extends React.Component { : item.reduce_amount //官方价 newObj.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 return newObj }) diff --git a/src/pages/exchangecode/copyCode/index.jsx b/src/pages/exchangecode/copyCode/index.jsx index 44ba36e6..5c0bf40c 100644 --- a/src/pages/exchangecode/copyCode/index.jsx +++ b/src/pages/exchangecode/copyCode/index.jsx @@ -445,7 +445,7 @@ export default class acclist extends React.Component { : item.reduce_amount //官方价 newObj.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.id = item.goods_id ? item.goods_id : item.id return newObj diff --git a/src/pages/exchangecode/edit/edit.js b/src/pages/exchangecode/edit/edit.js index 8756ed00..e6c25c1c 100644 --- a/src/pages/exchangecode/edit/edit.js +++ b/src/pages/exchangecode/edit/edit.js @@ -367,16 +367,16 @@ 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 = Math.ceil(divNum(item1.all_budget, item1.reduce_amount)) - obj.stock = Math.ceil(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 = Math.ceil( + obj.stock = parseInt( divNum(item1.all_budget, 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.used_amount, item1.reduce_amount) ) @@ -420,11 +420,11 @@ 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: Math.ceil( + stock: parseInt( divNum(item.entity.all_budget, 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.used_amount, @@ -836,10 +836,10 @@ export default class exchangedit extends React.Component { : item.reduce_amount //官方价 newObj.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 ? item.quantity - : Math.ceil(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 diff --git a/src/pages/plan/add/edit.js b/src/pages/plan/add/edit.js index 32eb578f..c58fe337 100644 --- a/src/pages/plan/add/edit.js +++ b/src/pages/plan/add/edit.js @@ -235,9 +235,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 = Math.ceil( - divNum(item3.all_budget, item3.reduce_amount) - ) //总库存 + obj.quantity = parseInt(divNum(item3.all_budget, item3.reduce_amount)) //总库存 obj.origin = item3 item1.products.push(obj) }) diff --git a/src/pages/plan/add/plan-copy.js b/src/pages/plan/add/plan-copy.js index 32b05188..068a562b 100644 --- a/src/pages/plan/add/plan-copy.js +++ b/src/pages/plan/add/plan-copy.js @@ -181,9 +181,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 = Math.ceil( - divNum(item3.all_budget, item3.reduce_amount) - ) //总库存 + obj.quantity = parseInt(divNum(item3.all_budget, item3.reduce_amount)) //总库存 obj.origin = item3 item1.products.push(obj) }) diff --git a/src/pages/plan/add/step2.js b/src/pages/plan/add/step2.js index 84a2fa92..861573e0 100644 --- a/src/pages/plan/add/step2.js +++ b/src/pages/plan/add/step2.js @@ -368,7 +368,7 @@ export default class acclist extends React.Component { : item.reduce_amount //官方价 newObj.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 return newObj }) diff --git a/src/pages/plan/key/edit.js b/src/pages/plan/key/edit.js index 30641ded..c9e69f13 100644 --- a/src/pages/plan/key/edit.js +++ b/src/pages/plan/key/edit.js @@ -204,7 +204,7 @@ export default class acclist extends React.Component { item1.time_limit?.effect_time.end_time, //有效时间 contract_price: item1.price, //单价 official_price: item1.reduce_amount, //官方价 - quantity: Math.ceil( + quantity: parseInt( divNum(item1.all_budget, item1.reduce_amount) ), //总库 ...item1 @@ -490,7 +490,7 @@ export default class acclist extends React.Component { : item.reduce_amount //官方价 newObj.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.id = item.goods_id ? item.goods_id : item.id return newObj