<template>
  <div>
    <basicLayout
        ref="list"
        formPath="cashcouponPay"
        tableName="cashcouponpayTable"
        idName="sa_cashbillid"
        :apiId="{query:20230217095002,del:'20230302140502'}"
        :detailPath="{
        path:'/cashcouponPayDetail'
        }">
      <div slot="titleRight">
        <!--        <importExcel style="margin-left:10px" @onSuccess="onSuccess"></importExcel>-->
      </div>
      <template #custom >
        <div class="mt-10">
          <label class="search__label" >单据日期:</label>
          <el-date-picker
              style="margin-right: 24px !important;"
              size="small"
              @change="selectChange"
              value-format="yyyy-MM-dd"
              v-model="dateSelect"
              type="daterange"
              range-separator="至"
              start-placeholder="开始日期"
              end-placeholder="结束日期"
              clearable>
          </el-date-picker>
        </div>
<!--        <div class="mt-10">
          <label class="search__label" >状态:</label>
          <el-select  class="inline-24" @change="selectChange" v-model="selectParam.status" placeholder="请选择状态" size="small" clearable>
            <el-option v-for="item in statusData" :key="item.value" :value="item.value" :label="item.label"></el-option>
          </el-select>
        </div>-->
      </template>
      <template v-slot:tbList="scope">
        <div v-if="scope.data.column.columnname == 'status'">
          <span style="color:#000000" v-if="scope.data.column.data[[scope.data.column.columnname]] == '新建'">{{scope.data.column.data[[scope.data.column.columnname]]}}</span>
          <span style="color:#52C41A" v-else-if="scope.data.column.data[[scope.data.column.columnname]] == '审核'">{{scope.data.column.data[[scope.data.column.columnname]]}}</span>
        </div>
        <div v-else>
          {{scope.data.column.data[[scope.data.column.columnname]]?scope.data.column.data[[scope.data.column.columnname]]:'--'}}
        </div>
<!--        {{scope.data.column.data[[scope.data.column.columnname]]}}-->
      </template>
      <template v-slot:tbOpreation="scope">
      </template>
    </basicLayout>
  </div>
</template>

<script>
export default {
  name: "index",
  data(){
    return {
      statusData:[
        {
          value:'新建',
          label:'新建'
        },
        {
          value:'审核',
          label:'审核'
        }
      ],
      selectParam:{
        status:'',
        begindate:'',
        enddate:''
      },
      dateSelect:[]
    }
  },
  methods:{
    selectChange(){
      if (this.dateSelect !== '' && this.dateSelect !== null){
        this.selectParam.begindate = this.dateSelect[0]
        this.selectParam.enddate = this.dateSelect[1]
      }else {
        this.selectParam.begindate = ''
        this.selectParam.enddate = ''
      }
      this.$refs.list.param.content.where = this.selectParam
      this.$refs.list.param.content.pageNumber = 1
      this.$refs.list.listData()
    }
  }
}
</script>

<style scoped>

</style>