<!-- 供应商信息列表 -->
<template>
  <div class="app-container">
    <el-card>
      <el-form :model="queryParams" ref="queryForm" size="small" :inline="true">
        <div class="filter-box">
          <div class="filter-lf">
            <el-form-item label="对方户名">
              <el-input v-model="queryParams.roleName" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
            </el-form-item>
            <el-form-item label="收款银行">
              <el-input v-model="queryParams.roleName" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
            </el-form-item>
            <el-form-item label="交易日期">
              <el-date-picker v-model="value1" type="date" placeholder="选择日期">
              </el-date-picker>
            </el-form-item>
            <el-form-item label="认款人">
              <el-input v-model="queryParams.roleName" placeholder="请输入" clearable @keyup.enter.native="handleQuery" />
            </el-form-item>
            <el-form-item>
              <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
              <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
              <el-button type="primary" size="mini" v-hasPermi="['subscription:auto:export']" @click="handleExport">导出</el-button>
              <el-button type="primary" size="mini"  v-hasPermi="['subscription:auto:add']"  @click="handleShow">添加认款</el-button>
            </el-form-item>
          </div>
        </div>

      </el-form>
      <el-table v-loading="loading" stripe border v-hasPermi="['subscription:auto:list']" @filter-change="handleFilter" :data="tableList" @selection-change="handleSelectionChange">
        <el-table-column type="selection" width="55" />
        <el-table-column type="index" width="55" label="序号" />
        <el-table-column label="规则类型" prop="roleName" />
        <el-table-column label="收款账号" prop="roleName" />
        <el-table-column label="对方户名" prop="roleName" />
        <el-table-column label="对方账号" prop="roleName" />
        <el-table-column label="业务类型" prop="roleName" />
        <el-table-column label="认款人" prop="roleName" />
        <el-table-column label="认款部门" prop="roleName" :filters="bankList" :filter-multiple="false" column-key="states" />
        <el-table-column label="操作" align="center" width="200">
          <template slot-scope="scope">
            <el-button size="mini" type="text" v-hasPermi="['subscription:auto:show']" icon="el-icon-view" @click="handleShow(scope.row,1)">查看
            </el-button>
            <el-button size="mini" type="text" v-hasPermi="['subscription:auto:del']" icon="el-icon-delete" @click="handleDel(scope.row.id)">删除
            </el-button>
            <el-button size="mini" type="text" v-hasPermi="['subscription:auto:edit']" icon="el-icon-delete" @click="handleShow(scope.row.id)">
              修改
            </el-button>
          </template>
        </el-table-column>
      </el-table>
      <pagination :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getTableList" />
    </el-card>
    <!-- 查看 -->
    <Detail :isOpen="isOpen" @onClose="handleCancel" @onConfirm="handleSave" />
  </div>
</template>

<script>
import { msgListApi, msgExportApi, msgDetailApi } from '@/api/subscription/msg'
export default {
  name: 'supplierMsg',
  props: {},
  components: {
    Detail: () => import('./components/detail.vue'),
    ConfirmDialog: () => import('./components/confirmDialog.vue')
  },
  computed: {},
  data() {
    return {
      value1: null,
      confirmShow: false,
      bankList: [],
      selectArr: [],
      disabled: false,
      id: null,
      isOpen: false,
      total: 0,
      loading: false,
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        roleName: undefined,
      },
      tableList: [
        { roleName: 'roleName' }
      ]
    }
  },
  created() {
    this.getTableList()
  },
  methods: {
    handleAdd() {

    },
    handleConfirmCancel() {
      this.confirmShow = false
    },
    handleConfirmSave() {
      this.confirmShow = false
    },
    handleConfirm() {
      this.confirmShow = true
    },
    handleFilter(obj) {
      console.log('obj..', obj);
    },
    handleImPort() {

    },
    handleExport() {
      if (!this.selectArr.length) {
        this.$fm('请选择要导出的数据！')
      }
    },
    handleShow(row, type) {
      this.isOpen = true
    },
    handleSave() {
      this.isOpen = false
    },
    handleCancel() {
      this.isOpen = false
    },
    handleAddMsg() {
      this.isOpen = true
    },
    handleUpdate() {

    },
    handleDelete(id) {
      this.$confirm('您确定要删除吗?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        this.$sm('删除成功！')
        this.getTableList()
      })
    },
    getTableList() {

    },
    resetQuery() {

    },
    handleQuery() {

    },
    handleSelectionChange(val) {
      this.selectArr = val
    },
  },



}

</script>
<style lang='scss' scoped>
@import '@/assets/styles/header/index.scss';
@import '@/assets/styles/common/index.scss';
</style>