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

新增收款单bug

parent 9798c226
...@@ -1139,9 +1139,10 @@ export default { ...@@ -1139,9 +1139,10 @@ export default {
} }
// params.receiptAccountList.length = params.receiptAccountList.length - 1 // params.receiptAccountList.length = params.receiptAccountList.length - 1
params.receiptAccountList.splice(params.receiptAccountList.length - 1,1)
var saveStatus = true var saveStatus = true
params.receiptAccountList.map(v => { params.receiptAccountList.forEach(v => {
if(v.type!='total'){
if(!v.platformAccountId){ if(!v.platformAccountId){
saveStatus = false saveStatus = false
} }
...@@ -1153,7 +1154,7 @@ export default { ...@@ -1153,7 +1154,7 @@ export default {
} }
delete v.discountTotal delete v.discountTotal
v.writeOffRate = Number(v.writeOffRate) v.writeOffRate = Number(v.writeOffRate)
return v }
}) })
if(!saveStatus){ if(!saveStatus){
this.$modal.msgError(this.$t('请添加收款账户')); this.$modal.msgError(this.$t('请添加收款账户'));
...@@ -1178,10 +1179,11 @@ export default { ...@@ -1178,10 +1179,11 @@ export default {
}); });
if (valid) { if (valid) {
this.saveBtnLoading = true this.saveBtnLoading = true
params.receiptAccountList.splice(params.receiptAccountList.length - 1,1)
if (this.id && this.id != 0) { if (this.id && this.id != 0) {
updateReceipt(params).then(res => { updateReceipt(params).then(res => {
this.$modal.msgSuccess(this.$t('修改成功')); this.$modal.msgSuccess(this.$t('修改成功'));
this.$router.back(); this.$store.dispatch('tagsView/delCurrentView')
}).finally(() => { }).finally(() => {
this.saveBtnLoading = false this.saveBtnLoading = false
}) })
...@@ -1189,7 +1191,7 @@ export default { ...@@ -1189,7 +1191,7 @@ export default {
params.currencyId = this.showCurrencyId params.currencyId = this.showCurrencyId
createReceipt(params).then(res => { createReceipt(params).then(res => {
this.$modal.msgSuccess(this.$t('保存成功')); this.$modal.msgSuccess(this.$t('保存成功'));
this.$router.back(); this.$store.dispatch('tagsView/delCurrentView')
}).finally(() => { }).finally(() => {
this.saveBtnLoading = false this.saveBtnLoading = false
}) })
...@@ -1201,11 +1203,12 @@ export default { ...@@ -1201,11 +1203,12 @@ export default {
this.$refs.form.validate ((valid)=>{ this.$refs.form.validate ((valid)=>{
if (valid) { if (valid) {
this.saveBtnLoading = true this.saveBtnLoading = true
params.receiptAccountList.splice(params.receiptAccountList.length - 1,1)
if (this.id && this.id != 0) { if (this.id && this.id != 0) {
if(params.state==0) params.state = 1 if(params.state==0) params.state = 1
updateReceipt(params).then(res => { updateReceipt(params).then(res => {
this.$modal.msgSuccess(this.$t('修改成功')); this.$modal.msgSuccess(this.$t('修改成功'));
this.$router.back(); this.$store.dispatch('tagsView/delCurrentView')
}).finally(() => { }).finally(() => {
this.saveBtnLoading = false this.saveBtnLoading = false
}) })
...@@ -1213,7 +1216,7 @@ export default { ...@@ -1213,7 +1216,7 @@ export default {
params.currencyId = this.showCurrencyId params.currencyId = this.showCurrencyId
createReceipt(params).then(res => { createReceipt(params).then(res => {
this.$modal.msgSuccess(this.$t('新增成功')); this.$modal.msgSuccess(this.$t('新增成功'));
this.$router.back(); this.$store.dispatch('tagsView/delCurrentView')
}).finally(() => { }).finally(() => {
this.saveBtnLoading = false 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