杂七杂八的修改

This commit is contained in:
xiaofajia 2024-11-21 15:19:48 +08:00
parent 45ef27e1da
commit dd2b850fdf

View File

@ -503,14 +503,14 @@ export default {
this.inLoading = true this.inLoading = true
const res = await getMapBySoIdAndQuery(this.soId, this.inItemsQuery) const res = await getMapBySoIdAndQuery(this.soId, this.inItemsQuery)
this.inItems = Object.entries(res.data) this.inItems = Object.entries(res.data)
this.inItems = this.inItems.filter(([key, value]) => { this.inItems = this.inItems.map(([key, value]) => {
const newValue = value.filter(item => item.inCount !== item.goodsCount) return [key, value.filter(item => (!item.inCount && item.inCount !== item.goodsCount))]
return newValue && newValue.length > 0
}) })
this.inItems = this.inItems.filter(([key, value]) => value.length > 0)
this.inItems.forEach(([key, value]) => { this.inItems.forEach(([key, value]) => {
value.forEach(item => { value.forEach(item => {
item.goodsCount = item.goodsCount - item?.inCount | 0 item.goodsCount = item.goodsCount - (item.inCount ? item.inCount : 0)
item.inCount = item.goodsCount - item?.inCount | 0 item.inCount = item.goodsCount
}) })
}) })
} finally { } finally {