diff --git a/src/components/UseGoodsScopePop/index copy.jsx b/src/components/UseGoodsScopePop/index copy.jsx index 6e9eb1c4..4e51fb3d 100644 --- a/src/components/UseGoodsScopePop/index copy.jsx +++ b/src/components/UseGoodsScopePop/index copy.jsx @@ -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) // 总预算 diff --git a/src/components/UseGoodsScopePop/index.jsx b/src/components/UseGoodsScopePop/index.jsx index 83d6ef79..4b1195bd 100644 --- a/src/components/UseGoodsScopePop/index.jsx +++ b/src/components/UseGoodsScopePop/index.jsx @@ -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}` // 有效时间段 diff --git a/src/pages/exchangecode/add/add.js b/src/pages/exchangecode/add/add.js index bacd168c..61e468cf 100644 --- a/src/pages/exchangecode/add/add.js +++ b/src/pages/exchangecode/add/add.js @@ -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 }) diff --git a/src/pages/exchangecode/copyCode/index.jsx b/src/pages/exchangecode/copyCode/index.jsx index 9c78be0b..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 - : 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 20ba0d62..7f84558b 100644 --- a/src/pages/exchangecode/edit/edit.js +++ b/src/pages/exchangecode/edit/edit.js @@ -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 diff --git a/src/pages/exchangecode/exchangecodeAdd/index.jsx b/src/pages/exchangecode/exchangecodeAdd/index.jsx index 237214de..38777b96 100644 --- a/src/pages/exchangecode/exchangecodeAdd/index.jsx +++ b/src/pages/exchangecode/exchangecodeAdd/index.jsx @@ -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 diff --git a/src/pages/plan/add/edit.js b/src/pages/plan/add/edit.js index 104dfd44..e653a0fa 100644 --- a/src/pages/plan/add/edit.js +++ b/src/pages/plan/add/edit.js @@ -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) }) diff --git a/src/pages/plan/add/plan-copy.js b/src/pages/plan/add/plan-copy.js index f5b12517..6ad42ad1 100644 --- a/src/pages/plan/add/plan-copy.js +++ b/src/pages/plan/add/plan-copy.js @@ -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) }) diff --git a/src/pages/plan/add/step2.js b/src/pages/plan/add/step2.js index 50250b7a..5bcb8ce9 100644 --- a/src/pages/plan/add/step2.js +++ b/src/pages/plan/add/step2.js @@ -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 }) diff --git a/src/pages/plan/key/edit.js b/src/pages/plan/key/edit.js index 8b8227c1..ad6402f7 100644 --- a/src/pages/plan/key/edit.js +++ b/src/pages/plan/key/edit.js @@ -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