Commit d8ff3ad9 authored by 我在何方's avatar 我在何方

新增收款单bug

parent 9798c226
......@@ -1139,21 +1139,22 @@ export default {
}
// params.receiptAccountList.length = params.receiptAccountList.length - 1
params.receiptAccountList.splice(params.receiptAccountList.length - 1,1)
var saveStatus = true
params.receiptAccountList.map(v => {
if(!v.platformAccountId){
saveStatus = false
}
var bankname = this.bankData.filter(item=>item.id == v.platformAccountId)
if(bankname.length>0){
v.platformAccountName = bankname[0].baAccountName
v.platformAccountNo = bankname[0].baAccountNum
v.platformAccountBlankName = bankname[0].baBankName
params.receiptAccountList.forEach(v => {
if(v.type!='total'){
if(!v.platformAccountId){
saveStatus = false
}
var bankname = this.bankData.filter(item=>item.id == v.platformAccountId)
if(bankname.length>0){
v.platformAccountName = bankname[0].baAccountName
v.platformAccountNo = bankname[0].baAccountNum
v.platformAccountBlankName = bankname[0].baBankName
}
delete v.discountTotal
v.writeOffRate = Number(v.writeOffRate)
}
delete v.discountTotal
v.writeOffRate = Number(v.writeOffRate)
return v
})
if(!saveStatus){
this.$modal.msgError(this.$t('请添加收款账户'));
......@@ -1178,10 +1179,11 @@ export default {
});
if (valid) {
this.saveBtnLoading = true
params.receiptAccountList.splice(params.receiptAccountList.length - 1,1)
if (this.id && this.id != 0) {
updateReceipt(params).then(res => {
this.$modal.msgSuccess(this.$t('修改成功'));
this.$router.back();
this.$store.dispatch('tagsView/delCurrentView')
}).finally(() => {
this.saveBtnLoading = false
})
......@@ -1189,7 +1191,7 @@ export default {
params.currencyId = this.showCurrencyId
createReceipt(params).then(res => {
this.$modal.msgSuccess(this.$t('保存成功'));
this.$router.back();
this.$store.dispatch('tagsView/delCurrentView')
}).finally(() => {
this.saveBtnLoading = false
})
......@@ -1201,11 +1203,12 @@ export default {
this.$refs.form.validate ((valid)=>{
if (valid) {
this.saveBtnLoading = true
params.receiptAccountList.splice(params.receiptAccountList.length - 1,1)
if (this.id && this.id != 0) {
if(params.state==0) params.state = 1
updateReceipt(params).then(res => {
this.$modal.msgSuccess(this.$t('修改成功'));
this.$router.back();
this.$store.dispatch('tagsView/delCurrentView')
}).finally(() => {
this.saveBtnLoading = false
})
......@@ -1213,7 +1216,7 @@ export default {
params.currencyId = this.showCurrencyId
createReceipt(params).then(res => {
this.$modal.msgSuccess(this.$t('新增成功'));
this.$router.back();
this.$store.dispatch('tagsView/delCurrentView')
}).finally(() => {
this.saveBtnLoading = false
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment