
<template>
  <div>
    <basicLayout 
      ref="basicLayout"
      tableName="clueImportList" 
      idName="sat_orderclueuploadbillid" 
      :apiId="{query:20221101094702,del:20221101100702}" 
      :options="options"
      :detailPath="{path:'/importClueDetail'}"
    >
      <div slot="custom" style="display:flex">
        <!-- <div class="label_center">
          <p class="search__label">人员类别:</p>
          <el-select v-model="search.cluetype" style="margin-right:10px" size="small" placeholder="请选择人员类别" @change="typeChange" clearable>
            <el-option label="经销商" value="经销商">
            </el-option>
            <el-option label="业务员" value="业务员">
            </el-option>
          </el-select>
        </div> -->
        <div class="label_center">
          <p class="search__label">状态:</p>
          <el-select v-model="search.status" style="margin-right:10px" size="small" placeholder="请选择状态" @change="statusChange" clearable>
            <el-option
              v-for="item in options"
              :key="item.value"
              :label="item.value"
              :value="item.value">
            </el-option>
          </el-select>
        </div>
      </div>
      <div slot="titleRight" style="display:flex;margin-left:10px">
        <importClue v-if="tool.checkAuth($route.name,'import')" @onSuccess="$refs.basicLayout.listData()"></importClue>
      </div>
      <template v-slot:tbList="scope">
        <div v-if="scope.data.column.columnname == 'status'">
          <span style="color:#333333" v-if="scope.data.column.data[[scope.data.column.columnname]] == '已审核'">{{scope.data.column.data[[scope.data.column.columnname]]}}</span>
          <span style="color:#3874f6" 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>
        <span v-if="!scope.data.column.data[scope.data.column.columnname] ">--</span>

      </template>
    </basicLayout>
  </div>
</template>

<script>
import importClue from './modules/importClue.vue'
import {mapGetters} from 'vuex'

export default {
  components:{
    importClue
  },
  data () {
    return {
      options:[
        {label:'待审核',value:'待审核'},
        {label:'已审核',value:'已审核'},
      ],
      search: {}
      
    }
  },
  computed:{
    ...mapGetters({
      sys_options:'sys_options'
    })
  },
  methods:{
    statusChange () {
      this.$refs.basicLayout.param.content.pageNumber = 1
      this.$refs.basicLayout.param.content.pageSize = 20
      this.$refs.basicLayout.param.content.where.status = this.search.status
      this.$refs.basicLayout.listData()
    },
    typeChange () {
      this.$refs.basicLayout.param.content.pageNumber = 1
      this.$refs.basicLayout.param.content.pageSize = 20
      this.$refs.basicLayout.param.content.where.cluetype = this.search.cluetype
      this.$refs.basicLayout.listData()
    }
  }
}

</script>
<style>
</style>