<template>
  <div>
    <basicLayout ref="list" formPath="payvoucher" tableName="payvoucherTable" idName="sa_cashbillid" :apiId="{query:20221010102903,del:20221009103203}" :options="options">
      <div slot="custom"></div>
      <template v-slot:tbList="scope">
        <div>
          {{scope.data.column.data[[scope.data.column.columnname]]}}
        </div>
      </template>
      <template v-slot:tbOpreation="scope">
        <el-popconfirm
            title="确定通过此凭证的审核嘛？"
            @confirm="examineRow(scope.data)">
          <el-button :disabled="scope.data.data.status === '审核'" slot="reference" size="small" type="text">审 核</el-button>
        </el-popconfirm>
      </template>
    </basicLayout>
  </div>
</template>

<script>
export default {
  name: "index",
  data() {
    return {
      options:[
        {
          label:'新建',
          value:'新建'
        },
        {
          label:'审核',
          value:'审核'
        }
      ]
    }
  },
  methods:{
    async examineRow(data){
      console.log(data)
      const res = await this.$api.requested({
        "id": "20221009103103",
        "version":1,
        "content": {
          "sa_cashbillid":data.data.sa_cashbillid
        }
      })
      this.tool.showMessage(res,()=>{
        this.$refs.list.listData()
      })
    }
  }
}
</script>

<style scoped>

</style>