mirror of
http://112.124.100.131/GFRS/ebiz-h5.git
synced 2025-12-23 14:22:52 +08:00
【津贴模块,津贴申请和我的资料增加开户银行支行字段】调用子组件方法--通过所在市编码获取银行信息(开户银行)
This commit is contained in:
@@ -21,7 +21,7 @@ import { Popup, Field, List } from 'vant'
|
||||
Vue.use(Popup)
|
||||
.use(Field)
|
||||
.use(List)
|
||||
import { getBranchCodeValue } from '@/api/ebiz/sale/sale'
|
||||
import { getBranchCodeValue } from '@/api/ebiz/allowance/allowance'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@@ -74,9 +74,10 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
// 获取银行卡列表
|
||||
getBankList(bankCode) {
|
||||
getBankList(bankCode,areaCode) {
|
||||
let data = {
|
||||
code: bankCode
|
||||
code: bankCode,
|
||||
areaCode: areaCode
|
||||
}
|
||||
getBranchCodeValue(data).then(res => {
|
||||
if (res.result == '0') {
|
||||
|
||||
105
src/components/ebiz/account/SelectBankNameAllowance.vue
Normal file
105
src/components/ebiz/account/SelectBankNameAllowance.vue
Normal file
@@ -0,0 +1,105 @@
|
||||
<template>
|
||||
<div>
|
||||
<!-- 开户银行选择 -->
|
||||
<van-popup v-model="show" position="bottom" :style="{ height: '50%' }">
|
||||
<div v-if="inputShow">
|
||||
<van-field v-model="inputvalue" left-icon="search" placeholder="请输入银行名称" />
|
||||
</div>
|
||||
|
||||
<div class="vanlist">
|
||||
<van-list>
|
||||
<van-cell v-for="item in bankList" :key="item.code" :title="item.bankName" class="text-center" @click="clickList(item)" />
|
||||
</van-list>
|
||||
</div>
|
||||
</van-popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Vue from 'vue'
|
||||
import { Popup, Field, List } from 'vant'
|
||||
|
||||
Vue.use(Popup)
|
||||
.use(Field)
|
||||
.use(List)
|
||||
import { getCodeValue } from '@/api/ebiz/allowance/allowance'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
inputvalue: '',
|
||||
// 银行列表
|
||||
bankList: [],
|
||||
bankList1: []
|
||||
}
|
||||
},
|
||||
components: {},
|
||||
name: 'SelectBankNameAllowance',
|
||||
props: {
|
||||
operateType: {
|
||||
type: String
|
||||
},
|
||||
listShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
inputShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
|
||||
created() {
|
||||
this.getBankList()
|
||||
},
|
||||
watch: {
|
||||
inputvalue(val) {
|
||||
if (val) {
|
||||
this.bankList = this.bankList.filter(item => {
|
||||
return item.bankName.indexOf(val) != -1
|
||||
})
|
||||
} else {
|
||||
this.bankList = this.bankList1
|
||||
}
|
||||
document.querySelector('.vanlist').scrollTo(0, 0) //重置滚动条
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
show: {
|
||||
get() {
|
||||
return this.listShow
|
||||
},
|
||||
set(value) {
|
||||
this.$emit('update:listShow', value)
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 获取银行卡列表
|
||||
getBankList(bankAreaCode) {
|
||||
let data = {
|
||||
bankAreaCode: bankAreaCode
|
||||
}
|
||||
getCodeValue(data).then(res => {
|
||||
if (res.result == '0') {
|
||||
this.bankList = res.content
|
||||
this.bankList1 = res.content
|
||||
this.$emit('getBankList', this.bankList)
|
||||
} else {
|
||||
this.$toast(res.resultMessage)
|
||||
}
|
||||
})
|
||||
},
|
||||
// 选择银行卡
|
||||
clickList(item) {
|
||||
this.$emit('getBank', item)
|
||||
this.show = false
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.vanlist {
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user