
<template>
  <div>
    <basicLayout 
      ref="list" 
      formPath="remitvoucher"
      tableName="remitvoucherTable" 
      idName="sa_paybillid" 
      :apiId="{query:20221226152904,del:20221226153104}"
      :options="options"
      :detailPath="{
        path:'/remitvoucherDetail'
      }">
      <div slot="custom" style="display:flex">
        <div class="label_center">
          <p class="search__label">状态:</p>
          <el-select @clear="$refs.list.param.content.pageNumber = 1 ;$refs.list.param.content.where.status = '';$refs.list.listData()" v-model="status" clearable style="margin-right:10px" size="small" placeholder="请选择状态" @change="$refs.list.param.content.pageNumber = 1 ;$refs.list.param.content.where.status = status;$refs.list.listData()">
            <el-option label="新建" value="新建" />
            <el-option label="提交" value="提交" />
            <el-option label="审核" value="审核" />
          </el-select>
        </div>
        <div  class="label_center">
        <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>
      <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>
          <span style="color:#d90a0a" 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]]}}
        </div>
      </template>
      <template v-slot:tbOpreation="scope">
      </template>
    </basicLayout>
  </div>
</template>

<script>
export default {
  data () {
    return {
      options:[],
      status:'',
      dateSelect:'',
    }
  },
  methods:{
    selectChange(){
      if (this.dateSelect !== '' && this.dateSelect !== null){
        this.$refs.list.param.content.where.startdate = this.dateSelect[0]
        this.$refs.list.param.content.where.enddate = this.dateSelect[1]
      }else {
        this.$refs.list.param.content.where.startdate = ''
        this.$refs.list.param.content.where.enddate = ''
      }
      this.$refs.list.listData()
    },
  }
}

</script>
<style>
</style>