|
|
@@ -43,11 +43,11 @@ Page({
|
|
|
|
|
|
],
|
|
|
bill: [
|
|
|
- { code: 'cancelAmount', type: 'cancel', title: '核销应收', bill: 3, amount: 500 },
|
|
|
- { code: 'receivableWaive', type: 'number', title: '待核销金额', readonly: true, },
|
|
|
+ { code: 'cancelAmount', type: 'cancel', title: '核销应收', bill: 4, amount: 500 },
|
|
|
+ { code: 'receivableResidue', type: 'number', title: '待核销金额', readonly: true, },
|
|
|
{ code: 'receiptResidue', type: 'number', title: '使用预存', },
|
|
|
{ code: 'sumWaiveAmt', type: 'number', title: '优惠金额', },
|
|
|
- { code: 'currentReceivableWaive', type: 'number', title: '本次核销', required: true },
|
|
|
+ { code: 'currentReceivableResidue', type: 'number', title: '本次核销', required: true },
|
|
|
],
|
|
|
file: [{
|
|
|
code: 'remarks', type: 'textarea', title: '备注'
|
|
|
@@ -71,6 +71,10 @@ Page({
|
|
|
btnFormData: null,
|
|
|
routeObjName: 'receiptPayment',
|
|
|
accountService: app.globalData['accountService'],
|
|
|
+ receivableResidue: 0,
|
|
|
+ receiptResidue: 0,
|
|
|
+ bill: 0,
|
|
|
+ objInfo: {},
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
@@ -82,6 +86,7 @@ Page({
|
|
|
console.log("chooseData", e, this.data.formData);
|
|
|
let formData = JSON.parse(this.data.formData)
|
|
|
let cardList_ = this.data.cardList
|
|
|
+ let contentObj = this.data.contentObj
|
|
|
let code = e.detail.code
|
|
|
let data = e.detail.data.data
|
|
|
if (code == "supId") { //供应商
|
|
|
@@ -96,12 +101,16 @@ Page({
|
|
|
formData.orgId = data.id
|
|
|
formData.orgName = data.name
|
|
|
}
|
|
|
- if (code == "bill") { //选取应收的返回值
|
|
|
- formData.orgId = data.id
|
|
|
- formData.orgName = data.name
|
|
|
+ if (code == "bill") { //选取应收的返回值
|
|
|
+ _this.setData({
|
|
|
+ objInfo: data.objInfo,
|
|
|
+ receivableResidue: data.receivableResidue,
|
|
|
+ receiptResidue: data.receiptResidue,
|
|
|
+ bill: data.itemLists.length,
|
|
|
+ })
|
|
|
+ this.setForm(formData, contentObj, data.receivableResidue, data.receiptResidue, data.itemLists.length)
|
|
|
+ return
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
this.setData({
|
|
|
cardList: cardList_,
|
|
|
formData: JSON.stringify(formData)
|
|
|
@@ -114,20 +123,68 @@ Page({
|
|
|
* @author : 姜永辉
|
|
|
*/
|
|
|
chooseObjTypeData(e) {
|
|
|
+ let _this = this
|
|
|
console.log("chooseObjTypeData", e, this.data.formData);
|
|
|
let formData = JSON.parse(this.data.formData)
|
|
|
+ let contentObj = this.data.contentObj
|
|
|
let objInfo = e.detail.data.objInfo
|
|
|
let cusId = e.detail.data.cusId
|
|
|
let params = {
|
|
|
- objectId: cusId
|
|
|
+ objectId: cusId,
|
|
|
+ accItemType: '账款类型-应收',
|
|
|
+ amtResidueFlg: true,
|
|
|
}
|
|
|
- this.excute(this.data.accountService, this.data.service.getReceivableAccountItem, params).then(res => {
|
|
|
- console.log("chooseObjTypeData-res", res);
|
|
|
- this.setData({
|
|
|
- objectItem: res.data.data
|
|
|
+ this.excute(this.data.accountService, this.data.accountService.getReceivableAccountItemCount, params).then(res => {
|
|
|
+ formData.cancelAmount = true
|
|
|
+ _this.setForm(formData, contentObj, objInfo.receivableResidue,
|
|
|
+ objInfo.receiptResidue, res.data.data)
|
|
|
+ _this.setData({
|
|
|
+ objInfo,
|
|
|
+ receivableResidue: objInfo.receivableResidue,
|
|
|
+ receiptResidue: objInfo.receiptResidue,
|
|
|
+ bill: res.data.data
|
|
|
})
|
|
|
+
|
|
|
})
|
|
|
+ },
|
|
|
|
|
|
+ /**
|
|
|
+ * @desc : 设置表单的数据
|
|
|
+ * @date : 2024/2/1 15:49
|
|
|
+ * @author : 姜永辉
|
|
|
+ */
|
|
|
+ onCheckChange(e) {
|
|
|
+ let cancelAmount = e.detail.data.cancelAmount
|
|
|
+ let formData = JSON.parse(this.data.formData)
|
|
|
+ let contentObj = this.data.contentObj
|
|
|
+ if (cancelAmount) {
|
|
|
+ this.setForm(formData, contentObj, this.data.receivableResidue, this.data.receiptResidue, this.data.bill)
|
|
|
+ } else {
|
|
|
+
|
|
|
+ this.setForm(formData, contentObj, 0, 0, 0)
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @desc : 设置表单的数据
|
|
|
+ * @date : 2024/2/1 15:49
|
|
|
+ * @author : 姜永辉
|
|
|
+ */
|
|
|
+ setForm(formData, contentObj, receivableResidue, receiptResidue, bill) {
|
|
|
+ formData.receivableResidue = receivableResidue // 总剩余应收
|
|
|
+ formData.currentReceivableResidue = receivableResidue // 总剩余应收
|
|
|
+ formData.receiptResidue = receiptResidue // 预存
|
|
|
+ contentObj['bill'].forEach(itcard => {
|
|
|
+ if (itcard.code === 'cancelAmount') {
|
|
|
+ //单数和金额
|
|
|
+ itcard.bill = bill
|
|
|
+ itcard.amount = receivableResidue //总应收
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.setData({
|
|
|
+ contentObj,
|
|
|
+ formData: JSON.stringify(formData)
|
|
|
+ })
|
|
|
},
|
|
|
|
|
|
/**
|