<template>
  <div v-if="allow.includes('financeBankInfoList')">
    <gridToolbar
			:query.sync="query"
			@refresh="refresh"
			@add="add"
			addAuthority="financeBankInfoAdd" />
    <data-grid
			:api="request_api.finance_bank_info"
			:query="requestQuery"
			ref="dataGrid"
			@change="handleChange">
      <a-table-column
				title="银行logo"
				dataIndex="bank_logo"
				:filterIcon="filterSearchIcon"
				:filterDropdown="filterSearchDropdown" />
      <a-table-column
				title="银行名称"
				dataIndex="bank_name"
				:filterIcon="filterSearchIcon"
				:filterDropdown="filterSearchDropdown" />
      <a-table-column
				title="银行编码"
				dataIndex="bank_info_code" />
      <a-table-column
				title="银行类型"
				dataIndex="bank_type">
        <template slot-scope="text">{{ text | bank_type }}</template>
      </a-table-column>
      <a-table-column title="创建/更新时间" dataIndex="created_date">
        <template slot-scope="text, record">
					<div class="multi_line">
						<span>{{ text | moment }}</span>
						<span>{{ record.updated_date | moment }}</span>
					</div>
        </template>
      </a-table-column>
      <a-table-column title="备注" dataIndex="memo" class="memo" :customCell="cellTitle('memo')" />
      <a-table-column title="操作" v-if="allow.includes('financeBankInfoEdit') || allow.includes('financeBankInfoDel')">
				<div class="table-btn-group" slot-scope="text, record">
					<a-button @click="edit(record)" v-authority="'financeBankInfoEdit'">编辑</a-button>
          <a-popconfirm
            title="是否确定删除?"
            v-authority="'financeBankInfoDel'"
            @confirm="del(record)">
            <a-button :loading="record.deleting" type="danger">删除</a-button>
          </a-popconfirm>
				</div>
      </a-table-column>
    </data-grid>
  </div>
</template>
<script>
import DataGrid from '../../components/DataGrid'
import gridToolbar from '../../components/gridToolbar/default'

import mix from '../../mixins/mixins'
import tableFilter from '../../mixins/tableFilter'
import finance from '../../mixins/finance'
import common from '../../mixins/common'
export default {
	mixins: [common, mix, tableFilter, finance()],
	components: {
		DataGrid, gridToolbar
	},
  data() {
    return {
      // 混入配置
      mixConofig: {
        addTitle: '添加银行信息',
        editTitle: '编辑银行信息',
        apiName: 'finance_bank_info',
        modalName: 'bankInfo'
			}
    }
	}
}
</script>
