
<template>
  <div>
    <basicLayout 
      ref="list" 
      :oldFormPath="{
        add:'HDrpManagement/numberManage/components'
      }"
      tableName="numberTable" 
      idName="sa_itemskuid" 
      :apiId="{query:20221215101003,del:20221215101103}"
      :options="options"
      :detailPath="{
        path:'/numberManageDetail'
      }"
      @listData="list"
      @listCreate="listCreate">
      <div slot="titleRight">
        <ImportNumber style="margin-left:10px" ref="number" @onSuccess="$refs.list.listData()" />
      </div>
      <div slot="custom" style="display:flex">
        <div class="label_center">
          <p class="search__label">状态:</p>
          <el-select clearable @clear="$refs.list.param.content.pageNumber = 1 ;$refs.list.param.content.where.status = '';$refs.list.listData()" v-model="status" 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-option label="报废" value="报废" />
          </el-select>
        </div>
        <div class="label_center">
          <p class="search__label">是否已使用:</p>
          <el-select clearable @clear="$refs.list.param.content.pageNumber = 1 ;$refs.list.param.content.where.isused = '';$refs.list.listData()" v-model="isused" style="margin-right:10px" size="small" placeholder="请选择状态" @change="$refs.list.param.content.pageNumber = 1 ;$refs.list.param.content.where.isused = isused;$refs.list.listData()">
            <el-option label="已使用" value="已使用" />
            <el-option label="未使用" value="未使用" />
          </el-select>
        </div>
      </div>
      <template v-slot:tbList="scope">
        <span 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:#d90a0a" v-else-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:#b2c0ea" v-else>{{scope.data.column.data[[scope.data.column.columnname]]}}</span>
        </span>
        <div v-else-if="scope.data.column.columnname == 'islimit'">
          <span>{{scope.data.column.data[[scope.data.column.columnname]] ? '是' : '否'}}</span>
        </div>
        <div v-else-if="scope.data.column.columnname == 'isused'">
          <span>{{scope.data.column.data[[scope.data.column.columnname]] ? '是' : '否'}}</span>
        </div>
        <span v-else>
          {{scope.data.column.data[[scope.data.column.columnname]]}}
        </span>
        <div v-if="scope.data.column.columnname != 'operation' && !scope.data.column.data[[scope.data.column.columnname]] && scope.data.column.data[[scope.data.column.columnname]] !== 0">--</div>
      </template>
      <template v-slot:tbOpreation="scope">
      </template>
    </basicLayout>
  </div>
</template>

<script>
import ImportNumber from './components/importNumber'
export default {
  data () {
    return {
      options:[],
      status:'',
      isused:''
      
    }
  },
  components:{ImportNumber},
  methods:{
    list (data) {
      console.log(data);
      
    },
    listCreate (param) {
    }
  }
}

</script>
<style>
</style>