This commit is contained in:
zhangds 2022-10-12 18:08:53 +08:00
commit e19cebe4d3
1 changed files with 14 additions and 2 deletions

View File

@ -905,8 +905,20 @@ export default class exchangeAdd extends React.Component {
item.type = 1
item.only = item.product_id
item.upstream = "直连天下"
item.stock = item.stock ? item.stock : item.quantity
item.usage = item.usage ? item.usage : 0
/* 赋值 剩余数量 已使用数量*/
/* 新增\复制 */
if ([0, 1].includes(this.state.isState)) {
item.stock = item.quantity
item.usage = 0
}
/* 编辑 */
if (this.state.isState === 2) {
item.stock = parseInt(item.quantity - item.usage)
item.usage = item.usage
}
return item
})
} else {