zhaoxiaoqiang1
2026-01-04 f1d30d03186c79ca2cbcfe60d6d2ce7d73fba97b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<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)"
            >&nbsp;</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>