<!-- 供应商信息列表 -->
<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-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>
              <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-form-item>
          </div>
        </div>
      </el-form>
      <el-table v-loading="loading" stripe border v-hasPermi="['subscription:exist:list']" :data="tableList" @selection-change="handleSelectionChange">
        <el-table-column type="index" width="55" />
        <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" />
        <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="操作" align="center" width="200">
          <template slot-scope="scope">
            <el-button size="mini" type="text" v-hasPermi="['subscription:exist:confirm']" icon="el-icon-view" @click="handleConfirm(scope.row,1)">核销
            </el-button>
            <el-button size="mini" type="text" v-hasPermi="['subscription:exist:cancel']" icon="el-icon-delete" @click="handleCancelPay(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>
  </div>
</template>

<script>
import { existListApi, msgExportApi, msgDetailApi } from '@/api/subscription/exist'
export default {
  name: 'supplierMsg',
  props: {},
  computed: {},
  data() {
    return {
      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: {
    handleImPort() {

    },
    handleExport() {
      if (!this.selectArr.length) {
        this.$fm('请选择要导出的数据！')
      }
    },
    handleConfirm(row, type) {
      if (type === 1) {
        this.id = null
        this.disabled = true
      } else {
        this.id = 1
        this.disabled = false
      }
      this.isOpen = true
    },

    handleCancelPay(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>