|
|
@ -17,15 +17,16 @@ |
|
|
|
</view> |
|
|
|
</scroll-view> |
|
|
|
</view> |
|
|
|
<requiredLocation title="目标库位" :locationCode="toLocationCode" @getLocation='getToLocationCode' |
|
|
|
:locationTypeList="toLocationTypeArray"></requiredLocation> |
|
|
|
|
|
|
|
<view class="page-footer"> |
|
|
|
<view class="uni-flex u-col-center space-between padding_10" |
|
|
|
style="background-color:ghostwhite; width: 100%; "> |
|
|
|
<view class=""> |
|
|
|
<requiredLocation title="目标库位" :locationCode="toLocationCode" @getLocation='getToLocationCode' |
|
|
|
:locationTypeList="toLocationTypeArray"></requiredLocation> |
|
|
|
</view> |
|
|
|
<view class=" uni-flex uni-row"> |
|
|
|
<button class="btn_single_commit" hover-class="btn_commit_after">提交</button> |
|
|
|
<button class="btn_single_commit" hover-class="btn_commit_after" @click="commit">提交</button> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
@ -57,6 +58,9 @@ |
|
|
|
|
|
|
|
import { |
|
|
|
getBusinessType, |
|
|
|
createItemInfo, |
|
|
|
createDetailInfo, |
|
|
|
calcHandleQty |
|
|
|
} from '@/common/record.js'; |
|
|
|
|
|
|
|
export default { |
|
|
@ -96,8 +100,7 @@ |
|
|
|
toLocationCode: "", |
|
|
|
toLocationInfo: {}, |
|
|
|
toLocationTypeArray: [], |
|
|
|
fromInventoryStatus: [], |
|
|
|
toInventoryStatus: [], |
|
|
|
toInventoryStatus: "", |
|
|
|
businessType: {}, //业务类型 |
|
|
|
detailSource: [], //绑定在页面上的数据源 |
|
|
|
} |
|
|
@ -128,14 +131,19 @@ |
|
|
|
name = "库存转移记录"; |
|
|
|
}else if(this.businessTypeCode=="HoldToOkRecord"){ |
|
|
|
name = "隔离转合格记录"; |
|
|
|
this.toInventoryStatus = "OK" |
|
|
|
}else if(this.businessTypeCode=="HoldToScrapRecord"){ |
|
|
|
name = "隔离转报废记录"; |
|
|
|
this.toInventoryStatus = "SCRAP" |
|
|
|
}else if(this.businessTypeCode=="OkToHoldRecord"){ |
|
|
|
name = "合格转隔离记录"; |
|
|
|
this.toInventoryStatus ="HOLD" |
|
|
|
}else if(this.businessTypeCode=="OktoScrapRecord"){ |
|
|
|
name = "合格转报废记录"; |
|
|
|
this.toInventoryStatus ="SCRAP" |
|
|
|
}else if(this.businessTypeCode=="ScrapToHoldRecord"){ |
|
|
|
name = "报废转隔离记录"; |
|
|
|
this.toInventoryStatus ="HOLD" |
|
|
|
} |
|
|
|
uni.setNavigationBarTitle({ |
|
|
|
title: name |
|
|
@ -163,14 +171,6 @@ |
|
|
|
this.openScanPopup(); |
|
|
|
}, |
|
|
|
getToLocationCode(location, code) { |
|
|
|
if (this.fromLocationCode == code) { |
|
|
|
uni.showToast({ |
|
|
|
title: "来源库位[" + this.fromLocationCode + "]不能与目标库位[" + code + "]一致", |
|
|
|
duration: 2000 |
|
|
|
}) |
|
|
|
return |
|
|
|
} |
|
|
|
this.toLocationCodeInfo = location; |
|
|
|
this.toLocationCode = code; |
|
|
|
}, |
|
|
|
getScanResult(result) { |
|
|
@ -186,8 +186,8 @@ |
|
|
|
} |
|
|
|
}) |
|
|
|
if (item == undefined) { |
|
|
|
var itemp = this.createItemInfo(balance,pack); |
|
|
|
let newDetail = this.createDetailInfo(balance, pack); // |
|
|
|
var itemp = createItemInfo(balance,pack); |
|
|
|
let newDetail = createDetailInfo(balance, pack); // |
|
|
|
itemp.subList.push(newDetail); |
|
|
|
this.detailSource.push(itemp) |
|
|
|
} else { |
|
|
@ -202,13 +202,13 @@ |
|
|
|
}) |
|
|
|
|
|
|
|
if (detail == undefined) { |
|
|
|
let newDetail = this.createDetailInfo(balance, pack); |
|
|
|
let newDetail = createDetailInfo(balance, pack); |
|
|
|
item.subList.push(newDetail); |
|
|
|
} else { |
|
|
|
this.showErrorMessage(balance.packingNumber + "已经在列表中") |
|
|
|
} |
|
|
|
} |
|
|
|
this.calcHandleQty(); |
|
|
|
calcHandleQty(this.detailSource); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
@ -256,7 +256,13 @@ |
|
|
|
}); |
|
|
|
}, |
|
|
|
updateData() { |
|
|
|
this.calcHandleQty(); |
|
|
|
calcHandleQty(this.detailSource); |
|
|
|
for (var i = 0; i < this.detailSource.length; i++) { |
|
|
|
let item = this.detailSource[i]; |
|
|
|
if (item.qty == 0) { |
|
|
|
this.detailSource.splice(i, 1) |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
removePack() { |
|
|
@ -276,7 +282,36 @@ |
|
|
|
this.detailSource.splice(i, 1) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
commit() { |
|
|
|
uni.showLoading({ |
|
|
|
title: "提交中....", |
|
|
|
mask: true |
|
|
|
}); |
|
|
|
|
|
|
|
if (this.detailSource.length > 0 && this.detailSource[0].subList.length > 0) { |
|
|
|
console.log("提交参数", JSON.stringify(params)); |
|
|
|
|
|
|
|
//直接创建记录 |
|
|
|
//采购退货直接出库,不用查询管理模式 |
|
|
|
var params = this.setRecordParams(true) |
|
|
|
console.log("提交参数", JSON.stringify(params)); |
|
|
|
|
|
|
|
purchaseReturnRecordSubmit(params).then(res => { |
|
|
|
uni.hideLoading() |
|
|
|
if (res.data) { |
|
|
|
this.showCommitSuccessMessage("提交成功<br>生成采购退货记录" + res.data) |
|
|
|
} else { |
|
|
|
this.showErrorMessage("提交失败" + res.msg) |
|
|
|
} |
|
|
|
}).catch(error => { |
|
|
|
uni.hideLoading() |
|
|
|
this.showErrorMessage(error) |
|
|
|
}) |
|
|
|
} else { |
|
|
|
this.showErrorMessage("没有要提交的数据") |
|
|
|
} |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|