diff --git a/anrui-buscenter/anrui-finmanage-ui/src/views/anruifinmanagement/chunafukuan/chunafukuanguanli/cashier.vue b/anrui-buscenter/anrui-finmanage-ui/src/views/anruifinmanagement/chunafukuan/chunafukuanguanli/cashier.vue index 4d16f852eb..c35adf14e6 100644 --- a/anrui-buscenter/anrui-finmanage-ui/src/views/anruifinmanagement/chunafukuan/chunafukuanguanli/cashier.vue +++ b/anrui-buscenter/anrui-finmanage-ui/src/views/anruifinmanagement/chunafukuan/chunafukuanguanli/cashier.vue @@ -480,16 +480,12 @@ export default { this.getList() }, changePayBankAccount(value) { - let bb = null - this.payBankAccount_list.forEach((e) => { - if (e.bankAccount === value) { - bb = { - name: e.accountName, - value: e.bankAccount - } - } - }) - this.formobj.payBank = bb.name + const choose = this.payBankAccount_list.filter((item) => item.bankAccount === value) + if (choose !== null && choose.length > 0) { + this.formobj.payBank = choose[0].accountName + } else { + this.formobj.payBank = '' + } }, handleSelectionChange(row) { console.log('aaa', row) @@ -573,16 +569,27 @@ export default { }, changerRceiveCompany(value) { const choose = this.receiveCompany_list.filter((item) => item.name === value) - this.formobj.payCode = choose[0].payCode - getBankList({ sid: choose[0].sid }).then((res) => { - if (res.success) { - this.receiveBankAccount_list = res.data - } - }) + if (choose !== null && choose.length > 0) { + this.formobj.payCode = choose[0].payCode + getBankList({ sid: choose[0].sid }).then((res) => { + if (res.success) { + this.receiveBankAccount_list = res.data + } + }) + } else { + this.formobj.payCode = '' + this.formobj.receiveBankAccount = '' + this.formobj.receiveBank = '' + this.receiveBankAccount_list = [] + } }, changeReceiveBankAccount(value) { const choose = this.receiveBankAccount_list.filter((item) => item.receiveBankAccount === value) - this.formobj.receiveBank = choose[0].receiveBank + if (choose !== null && choose.length > 0) { + this.formobj.receiveBank = choose[0].receiveBank + } else { + this.formobj.receiveBank = '' + } }, handleGetCheck(row) { this.dialogImgVisible = true @@ -649,7 +656,7 @@ export default { this.formobj.receiveCompany = row.receiveCompany this.formobj.receiveBankAccount = row.receiveBankAccount this.formobj.receiveBank = row.receiveBank - this.formobj.payCode = row.payCode + this.changerRceiveCompany(this.formobj.receiveCompany) this.formobj.payWayValue = row.payWayValue this.changePayWay(row.payWayValue) const aa = []