|
@@ -99,30 +99,22 @@ export default {
|
|
|
let businessIdTwoList = []
|
|
|
for (let i = 0; i < this.form.details.length; i++) {
|
|
|
let data = resInventory.data.data.filter((item) => item.businessId === this.form.details[i].businessId)
|
|
|
- if (data && data.length > 0) {
|
|
|
- if (data[0].quantity) {
|
|
|
- this.form.details[i].warehouseId = data[0].warehouseId
|
|
|
- this.form.details[i].residueNum = Number(data[0].quantity)
|
|
|
- } else {
|
|
|
- businessIdTwoList.push(this.form.details[i].businessId)
|
|
|
- }
|
|
|
+ if (data && data.length > 0 && data[0].quantity && Number(data[0].quantity) > 0) {
|
|
|
+ this.form.details[i].warehouseId = data[0].warehouseId
|
|
|
+ this.form.details[i].residueNum = Number(data[0].quantity)
|
|
|
} else {
|
|
|
businessIdTwoList.push(this.form.details[i].businessId)
|
|
|
}
|
|
|
}
|
|
|
if (businessIdTwoList && businessIdTwoList.length > 0) {
|
|
|
- inventoryDetails({ businessIdList: businessIdList, subsidiaryId: this.form.subsidiaryId, warehouseId: this.warehouseList[1].id }).then(
|
|
|
+ inventoryDetails({ businessIdList: businessIdTwoList, subsidiaryId: this.form.subsidiaryId, warehouseId: this.warehouseList[1].id }).then(
|
|
|
(inventoryTwo) => {
|
|
|
if (inventoryTwo.data.data && inventoryTwo.data.data.length > 0) {
|
|
|
for (let j = 0; j < this.form.details.length; j++) {
|
|
|
let dataTwo = inventoryTwo.data.data.filter((item) => item.businessId === this.form.details[j].businessId)
|
|
|
- if (dataTwo && dataTwo.length > 0) {
|
|
|
- if (dataTwo[0].quantity) {
|
|
|
- this.form.details[j].warehouseId = dataTwo[0].warehouseId
|
|
|
- this.form.details[j].residueNum = Number(dataTwo[0].quantity)
|
|
|
- } else {
|
|
|
- this.form.details[j].residueNum = 0
|
|
|
- }
|
|
|
+ if (dataTwo && dataTwo.length > 0 && dataTwo[0].quantity && Number(dataTwo[0].quantity) > 0) {
|
|
|
+ this.form.details[j].warehouseId = dataTwo[0].warehouseId
|
|
|
+ this.form.details[j].residueNum = Number(dataTwo[0].quantity)
|
|
|
}
|
|
|
}
|
|
|
}
|