Compare commits

..

No commits in common. "27375030c17aba46ec9ea5ce27f2171339533ecd" and "ff9ee36b48367b8bebcfa4b722d6e6b50e18b0cd" have entirely different histories.

View File

@ -393,15 +393,13 @@ export default {
}).then(res => { }).then(res => {
this.partList = Object.entries(res.data) this.partList = Object.entries(res.data)
this.partList = this.partList.map(([key, value]) => { this.partList = this.partList.map(([key, value]) => {
return [key, value.filter(item => { return [key, value.filter(item => (!item.inCount && item.inCount !== item.goodsCount))]
return item.inCount !== item.goodsCount
})]
}) })
this.partList = this.partList.filter(([key, value]) => value.length > 0) this.partList = this.partList.filter(([key, value]) => value.length > 0)
this.partList.forEach(([key, value]) => { this.partList.forEach(([key, value]) => {
value.forEach(item => { value.forEach(item => {
item.goodsCount = item.goodsCount - (item.inCount ? item.inCount : 0) item.goodsCount = item.goodsCount - item?.inCount | 0
item.inCount = item.goodsCount item.inCount = item.goodsCount - item?.inCount | 0
}) })
}) })
const values = this.partList.map(([key, value]) => value) const values = this.partList.map(([key, value]) => value)
@ -428,13 +426,11 @@ export default {
id: this.soId, id: this.soId,
soNo: createUniqueCodeByHead("RK") soNo: createUniqueCodeByHead("RK")
} }
const values = this.partList.map(([key, value]) => value).reduce((acc, item) => acc.concat(item))
if (this.selectRows && this.selectRows.length > 0){ if (this.selectRows && this.selectRows.length > 0){
const ids = this.selectRows.map(item => item.id) data.soiList = [...this.selectRows]
const newSelect = values.filter(item => ids.includes(item.id)) data.waresList = [...this.selectRows.map(item => item.wares)]
data.soiList = [...newSelect]
data.waresList = [...newSelect.map(item => item.wares)]
}else { }else {
const values = this.partList.map(([key, value]) => value).reduce((acc, item) => acc.concat(item))
data.soiList = [...values] data.soiList = [...values]
data.waresList = [...values.map(item => item.wares)] data.waresList = [...values.map(item => item.wares)]
} }