|
|
@@ -169,11 +169,17 @@ Page({
|
|
|
setParams(params) {
|
|
|
let itemIndex = 0
|
|
|
let formData = JSON.parse(this.data.formData)
|
|
|
+
|
|
|
+
|
|
|
params.fromNo = (params.fromNo && params.fromNo.length > 0) ? params.fromNo[0] : null
|
|
|
- params.fromId = this.data.item ? (this.data.item.purId ? this.data.item.purId : params.purId) : null
|
|
|
+ //采购订单ID
|
|
|
+ params.fromId = this.data.item ? (this.data.item.fromId ? this.data.item.fromId : null) : null
|
|
|
+ params.sPurId = this.data.item ? (this.data.item.sPurId ? this.data.item.sPurId : null) : null
|
|
|
params.factAmt = params.intoingAmt
|
|
|
- params.intoQty = this.convertToNegative(params.intoQty)
|
|
|
- params.intoAmt = this.convertToNegative(params.intoAmt)
|
|
|
+ params.intoQty = this.convertToNegative(params.intoQty) ? this.convertToNegative(params.intoQty) : 0
|
|
|
+ params.intoAmt = this.convertToNegative(params.intoAmt) ? this.convertToNegative(params.intoAmt) : 0
|
|
|
+ params.returnQty = Math.abs(params.sumQuantity)
|
|
|
+ params.returnAmt = Math.abs(params.sumAmount)
|
|
|
if (this.data.formMode == 'edit') {
|
|
|
delete params['intoType']
|
|
|
}
|
|
|
@@ -184,15 +190,13 @@ Page({
|
|
|
if (this.data.formMode == 'edit') {
|
|
|
delete res['intoType']
|
|
|
}
|
|
|
- res.sIntoId = res.sIntoId ? res.sIntoId : params.outId
|
|
|
- res.sPurId = res.sPurId ? res.sPurId : params.purId
|
|
|
res.supId = res.supId ? res.supId : null
|
|
|
- res.fromId = res.fromId ? res.fromId : res.sIntoId
|
|
|
- res.fromItemId = res.fromItemId ? res.fromItemId : res.sIntoItemId
|
|
|
res.factPrice = res.priceInto
|
|
|
res.factAmt = res.intoingAmt
|
|
|
res.costAmt = Number(res.intoingQty * res.costPrice)
|
|
|
res.itemIndex = itemIndex++
|
|
|
+ res.returnQty = Math.abs(params.intoingQty)
|
|
|
+ res.returnAmt = Math.abs(params.intoingAmt)
|
|
|
})
|
|
|
let btnFormData = this.data.btnFormData ? JSON.parse(this.data.btnFormData) : ''
|
|
|
params.flgAutoHandle = btnFormData ? btnFormData.flag : false //自动出库标识
|
|
|
@@ -388,10 +392,11 @@ Page({
|
|
|
* @author : 于继渤
|
|
|
*/
|
|
|
saveData() {
|
|
|
+ // return
|
|
|
if (this.data.formMode == Constants.formMode.edit) {
|
|
|
return this.excute(this.data.inboundPurchaseReturnService, this.data.inboundPurchaseReturnService.inboundUpdate, this.data.params);
|
|
|
} else {
|
|
|
- return this.excute(this.data.inboundPurchaseReturnService, this.data.inboundPurchaseReturnService.inboundInsert, this.data.params);
|
|
|
+ return this.excute(this.data.service, this.data.service.insert, this.data.params);
|
|
|
}
|
|
|
},
|
|
|
/**
|