
<template>
  <div>
    <basicLayout 
      ref="basicLayout" 
      formPath="Creditbilladj" 
      tableName="creditbilladjTable" 
      idName="sa_creditbillid" 
      :apiId="{query:20221008155103,del:20221008155403}"
      :options="options">
      <template v-slot:tbList="scope">
        <div v-if="scope.data.column.columnname == 'status'" :style="scope.data.column.data[[scope.data.column.columnname]] == '审核' ? 'color: rgb(82, 196, 25);' : ''">{{scope.data.column.data[[scope.data.column.columnname]]}}</div>
        <div v-else>
          {{scope.data.column.data[[scope.data.column.columnname]]}}
        </div>
      </template>
      <template v-slot:tbOpreation="scope">
        <el-button size="mini" type="text" @click="checkBuill(scope.data.data)" v-if="scope.data.data.status == '新建'">审 核</el-button>
        <el-button size="mini" type="text" @click="$router.push({path:'/creditbilladjDetail',query:{id:scope.data.data.sa_creditbillid,rowindex:scope.data.data.rowindex}})">详 情</el-button>
      </template>
    </basicLayout>
  </div>
</template>

<script>

export default {
  data () {
    return {
      options:[
        {
          label:'新建',
          value:'新建'
        },
        {
          label:'审核',
          value:'审核'
        }
      ]
    }
  },
  methods:{
    async checkBuill(data) {
      if(data.status != '新建') return
      let res = this.$api.requested({
        "id": "20221008155303",
        "version":1,
        "content": {
            "sa_creditbillid":data.sa_creditbillid
        }
      })
      this.tool.showMessage(res,() => {
        this.$refs.basicLayout.listData()
      })
    }
  }
}

</script>
<style>
</style>