Commit 04495ad9 authored by linxin's avatar linxin

修复银行卡删除问题

parent 7734660f
...@@ -54,6 +54,10 @@ export default { ...@@ -54,6 +54,10 @@ export default {
default: [], default: [],
type: Array, type: Array,
}, },
'from': {
default: null,
type: Boolean,
},
}, },
data () { data () {
return { return {
...@@ -82,26 +86,37 @@ export default { ...@@ -82,26 +86,37 @@ export default {
return num.substring(num.length - 4) return num.substring(num.length - 4)
}, },
deleteFun (e) { deleteFun (e) {
let index = this.getBankList.findIndex(item => { this.hlsPopup.showConfirm({
if (item.bank_account_num === e) { title: '提示',
return true content: '您确认删除吗?',
} onConfirm: data => {
}) console.log(data)
this.getBankList.splice(index, 1) if (data === 1) {
let vm = this let index = this.getBankList.findIndex(item => {
let url = process.env.basePath + 'bp_bank_delete' if (item.bank_account_num === e) {
let param = { return true
'master': { }
'bp_id': window.localStorage.user_id, })
'bank_account_num': e, this.getBankList.splice(index, 1)
let vm = this
let url = process.env.basePath + 'bp_bank_delete'
let param = {
'master': {
'bp_id': this.from ? this.$route.params.bp_id : window.localStorage.getItem('user_id'),
'bank_account_num': e,
},
}
vm.hlsPopup.showLoading('请稍候')
vm.hlsHttp.post(url, param).then(function (res) {
vm.hlsPopup.hideLoading()
if (res.result === 'S') {
vm.hlsPopup.showSuccess('删除成功')
} else {
vm.hlsPopup.showLongCenter(res.message)
}
})
}
}, },
}
vm.hlsPopup.showLoading('请稍候')
vm.hlsHttp.post(url, param).then(function (res) {
vm.hlsPopup.hideLoading()
if (res.result === 'S') {
console.log(res)
}
}) })
}, },
}, },
......
...@@ -257,6 +257,7 @@ ...@@ -257,6 +257,7 @@
<BankInfo <BankInfo
v-show="tabNum==1" v-show="tabNum==1"
:getBankList="getBankList" :getBankList="getBankList"
:from="from"
@getInfo="getInfo" @getInfo="getInfo"
@getList="getList" @getList="getList"
/> />
...@@ -314,7 +315,7 @@ ...@@ -314,7 +315,7 @@
</item> </item>
<item> <item>
<div slot="name">银行名称</div> <div slot="name">银行名称</div>
<input slot="content" v-model="bank.bank_full_name" placeholder="识别银行卡自动填充" > <input slot="content" v-model="bank.bank_full_name" placeholder="识别银行卡自动填充" >
</item> </item>
<item> <item>
<div slot="name">支行名称</div> <div slot="name">支行名称</div>
......
...@@ -61,6 +61,10 @@ export default { ...@@ -61,6 +61,10 @@ export default {
default: [], default: [],
type: Array, type: Array,
}, },
'from': {
default: null,
type: Boolean,
},
}, },
data () { data () {
return { return {
...@@ -90,32 +94,43 @@ export default { ...@@ -90,32 +94,43 @@ export default {
return num.substring(num.length - 4) return num.substring(num.length - 4)
}, },
deleteFun (e) { deleteFun (e) {
let index = this.getBankList.findIndex(item => { this.hlsPopup.showConfirm({
if (item.bank_account_num === e) { title: '提示',
return true content: '您确认删除吗?',
} onConfirm: data => {
}) console.log(data)
this.getBankList.splice(index, 1) if (data === 1) {
let vm = this let index = this.getBankList.findIndex(item => {
let url = process.env.basePath + 'bp_bank_delete' if (item.bank_account_num === e) {
let param = { return true
'master': { }
'bp_id': window.localStorage.user_id, })
'bank_account_num': e, this.getBankList.splice(index, 1)
let vm = this
let url = process.env.basePath + 'bp_bank_delete'
let param = {
'master': {
'bp_id': this.from ? this.$route.params.bp_id : window.localStorage.getItem('user_id'),
'bank_account_num': e,
},
}
vm.hlsPopup.showLoading('请稍候')
vm.hlsHttp.post(url, param).then(function (res) {
vm.hlsPopup.hideLoading()
if (res.result === 'S') {
vm.hlsPopup.showSuccess('删除成功')
} else {
vm.hlsPopup.showLongCenter(res.message)
}
})
}
}, },
}
vm.hlsPopup.showLoading('请稍候')
vm.hlsHttp.post(url, param).then(function (res) {
vm.hlsPopup.hideLoading()
if (res.result === 'S') {
console.log(res)
}
}) })
}, },
}, },
} }
</script> </script>
<style lang="less" scoped> <style lang="less">
#bank-card { #bank-card {
.info { .info {
height: 70px; height: 70px;
......
...@@ -337,7 +337,8 @@ ...@@ -337,7 +337,8 @@
</div> </div>
</div> </div>
<!-- <BankInfo v-show="tabNum==1" :bp_id="bp_id" @getInfo="getInfo" /> --> <!-- <BankInfo v-show="tabNum==1" :bp_id="bp_id" @getInfo="getInfo" /> -->
<BankInfo v-show="tabNum==1" :getBankList="getBankList" @getInfo="getInfo" @getList="getList" /> <BankInfo v-show="tabNum==1" :from="from" :getBankList="getBankList" @getInfo="getInfo"
@getList="getList" />
<InvoiceInfo <InvoiceInfo
v-show="tabNum==2" v-show="tabNum==2"
:tabNum="tabNum" :tabNum="tabNum"
...@@ -971,7 +972,7 @@ export default { ...@@ -971,7 +972,7 @@ export default {
getInfo (i, isClear) { getInfo (i, isClear) {
this.isClear = isClear this.isClear = isClear
if (isClear) { if (isClear) {
// this.bank_lists = {} // this.bank_lists = {}
this.bank_lists.bank_account_num = '' this.bank_lists.bank_account_num = ''
this.bank_lists.bank_account_name = '' this.bank_lists.bank_account_name = ''
this.bank_lists.bank_card_type = '' this.bank_lists.bank_card_type = ''
......
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