|
|
@@ -211,7 +211,7 @@ mixins: [mixins],
|
|
|
params.makeStaff = app.globalData.user.staffId // 制单人
|
|
|
let tableData = this.data.tableData.filter(res => { return res.checked })
|
|
|
// 根据formtype不同值
|
|
|
- // formType :1 收款单 ,2 付款单,3 客户收款保存参数,4 客户退款 5 退收款单 6 退付款单 7 订单开单收款
|
|
|
+ // formType :1 收款单 ,2 付款单,3 客户收款保存参数,4 客户退款 5 退收款单 6 退付款单 7 其他收入单 8 订单开单收款 9 其他支出 10 销售退款 的退款 11 销售出库的收款
|
|
|
if (this.data.formType == 1) {
|
|
|
params.rpType = Constants.rpType.receipt
|
|
|
// 1 收款单
|
|
|
@@ -523,7 +523,51 @@ mixins: [mixins],
|
|
|
})
|
|
|
params.accDate = params.accDate ? params.accDate : utils.formatDayTime(new Date())
|
|
|
params.itemListRecPayItemVO = itemListRecPayItemVO
|
|
|
- }
|
|
|
+ }else if (this.data.formType == 10) { //销售出库>>> 客户收款
|
|
|
+ //新建销售退货参数
|
|
|
+ let itemIndex = 0
|
|
|
+ let formData = JSON.parse(this.data.formData)
|
|
|
+ params.fromId = formData.orderId
|
|
|
+ let btnFormData = formData.btnFormData
|
|
|
+ params.flgAutoHandle = btnFormData ? btnFormData.flag : false //自动出库标识
|
|
|
+ formData.goodsList.forEach(res => {
|
|
|
+ res.itemIndex = itemIndex++
|
|
|
+ res.canNegativeFlag = true
|
|
|
+ if (params.flgAutoHandle) {
|
|
|
+ res.outBox = res.box
|
|
|
+ res.outPiece = res.piece
|
|
|
+ } else {
|
|
|
+ res.outingBox = res.box
|
|
|
+ res.outingPiece = res.piece
|
|
|
+ }
|
|
|
+ delete res['itemId']
|
|
|
+ })
|
|
|
+ itemList = formData.goodsList //明细
|
|
|
+ params.makeStaff = app.globalData.user.staffId
|
|
|
+ // params.deleteItemList = params.deleteList ? params.deleteList : []
|
|
|
+ params.addressName = formData.addressName
|
|
|
+ params.objectId = formData.cusId
|
|
|
+ params.canNegativeFlag = true
|
|
|
+ params.outDate = utils.formatDayTime(new Date())
|
|
|
+ //客户退款保存参数
|
|
|
+ params.sumAmtRec = Number(formData.sumAmtRec)
|
|
|
+ params.rpType = Constants.rpType.returnReceipt
|
|
|
+ //编辑退款
|
|
|
+ let itemListRecPayItemVO = []
|
|
|
+ tableData.forEach(item => {
|
|
|
+ itemListRecPayItemVO.push(
|
|
|
+ {
|
|
|
+ amtRec: item.sumAmount,
|
|
|
+ balance: item.balance,
|
|
|
+ macCode: item.macCode,
|
|
|
+ macId: item.macId,
|
|
|
+ macName: item.macName,
|
|
|
+ }
|
|
|
+ )
|
|
|
+ })
|
|
|
+ params.accDate = params.accDate ? params.accDate : utils.formatDayTime(new Date())
|
|
|
+ params.itemListRecPayItemVO = itemListRecPayItemVO
|
|
|
+ }
|
|
|
|
|
|
if (this.data.formType !== 8) {
|
|
|
params.itemList = itemList
|
|
|
@@ -573,11 +617,10 @@ mixins: [mixins],
|
|
|
return this.excute(this.data.otherPayableService, this.data.otherPayableService.insert, this.data.params);
|
|
|
}else if (this.data.formType == 10) { //销售退货 >>> 客户退款
|
|
|
return this.excute(this.data.saleOutBoundReturnService, this.data.saleOutBoundReturnService.outboundInsertRefund, this.data.params);
|
|
|
- }
|
|
|
- outbound_insert_refund
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+ }else if (this.data.formType == 11) { //销售出库 >>> 客户收款
|
|
|
+ return this.excute(this.data.saleOutBoundReturnService, this.data.saleOutBoundReturnService.outboundInsertRefund, this.data.params);
|
|
|
+ }
|
|
|
},
|
|
|
/**
|
|
|
* @desc : 处理保存返回数据
|
|
|
@@ -586,9 +629,9 @@ mixins: [mixins],
|
|
|
*/
|
|
|
handleData() {
|
|
|
if (this.data.formType == 3 || this.data.formType == 4) { //客户收款/退款
|
|
|
- console.log('处理保存返回数据')
|
|
|
+
|
|
|
let pages = getCurrentPages();
|
|
|
- let prevPage = pages[pages.length - 3]; //上二页
|
|
|
+ let prevPage = pages[pages.length - 2]; //上二页
|
|
|
prevPage.setData({
|
|
|
refreshByAdd: true
|
|
|
})
|