<template>
|
<div class="enterprise">
|
<el-dialog :visible.sync="visible" :close-on-click-modal="false" @close="closeDialog" center>
|
<el-form label-position="right" ref="form" :model="form" id="search-form">
|
<el-row :gutter="20">
|
<el-col :md="8" :lg="6">
|
<el-form-item label="支行名称" prop="bankname">
|
<el-input v-model.trim="form.bankname" placeholder="请输入"></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :md="8" :lg="6" style="margin-left:100px">
|
<el-button class="search-btn" @click="handleFormReset">重置</el-button>
|
<el-button class="search-btn" type="primary" @click="handleFormSearch">搜索</el-button>
|
</el-col>
|
</el-row>
|
</el-form>
|
<el-table
|
:data="bankData"
|
height="400"
|
:header-cell-style="{background:'#FAFAFA',color:'#222222'}"
|
>
|
<el-table-column label width="50">
|
<template slot-scope="scope">
|
<el-radio
|
v-model="enterprise"
|
:label="scope.$index"
|
@change="getCurrentRow(scope.row,scope.$index)"
|
> </el-radio>
|
</template>
|
</el-table-column>
|
<el-table-column prop="bankno" label="支行编号"></el-table-column>
|
<el-table-column prop="bankname" label="支行名称"></el-table-column>
|
</el-table>
|
<pagination
|
v-show="total > 0"
|
:total="total"
|
:page.sync="form.currentPage"
|
:limit.sync="form.pageSize"
|
@pagination="initTable"
|
/>
|
<span slot="footer" class="dialog-footer">
|
<el-button plain @click="closeDialog">返回</el-button>
|
<el-button type="primary" @click="submit">确定</el-button>
|
</span>
|
</el-dialog>
|
</div>
|
</template>
|
<script>
|
import { qryBankBranchList } from '@/api/area/partner'
|
import Pagination from '@components/Pagination'
|
export default {
|
props: ['bankVisible', 'bankcode', 'bankIndex'],
|
components: {
|
Pagination
|
},
|
data() {
|
return {
|
currentPage: 1,
|
total: 0,
|
bankData: [],
|
bandkName: '',
|
enterprise: '',
|
form: {
|
currentPage: 1,
|
pageSize: 10,
|
bankname: ''
|
}
|
}
|
},
|
computed: {
|
visible: {
|
get() {
|
return this.bankVisible
|
},
|
set() {}
|
}
|
},
|
created() {
|
this.initTable()
|
},
|
methods: {
|
async initTable() {
|
const { bankcode, form } = this
|
const { result } = await qryBankBranchList({ bankcode, ...form })
|
const { records, total } = result
|
this.bankData = records
|
this.total = total
|
},
|
|
// 获取当前选中行
|
getCurrentRow(row, index) {
|
this.enterprise = index
|
this.bandkName = row
|
},
|
// 重置
|
handleFormReset() {
|
this.form.bandkName = ''
|
},
|
|
// 搜索
|
handleFormSearch() {
|
this.initTable()
|
},
|
closeDialog() {
|
this.$emit('closeBank', false)
|
},
|
submit() {
|
this.$emit('sendBankData', this.bandkName)
|
this.$emit('closeBank', false)
|
}
|
}
|
}
|
</script>
|
<style lang="stylus">
|
.enterprise {
|
.el-dialog {
|
min-width:790px;
|
.dialog-footer {
|
.el-button {
|
width: 120px;
|
font-size: 14px;
|
line-height: 20px;
|
padding: 5px 0;
|
}
|
}
|
}
|
}
|
</style>
|