<template>
  <a-card :bordered="false">
    <!-- 查询区域 -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="证件编号">
              <j-input placeholder="请输入证件编号" v-model="queryParam.cardNo"></j-input>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="客户名称">
              <j-input placeholder="请输入客户名称" v-model="queryParam.cardName"></j-input>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
            </span>
          </a-col>
        </a-row>
      </a-form>
    </div>
    <!-- table区域-begin -->
    <div>
      <a-table
        ref="table"
        size="middle"
        :scroll="{x:true}"
        bordered
        rowKey="id"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        class="j-table-force-nowrap"
        @change="handleTableChange">


        <!-- 任务名称可点击 -->
        <template v-slot:cardNo="text, record" >
          <a @click="goDetails(record)">{{text}}</a>
        </template>
      </a-table>
    </div>
  </a-card>
</template>

<script>

import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import SmsCheckWorkLogModal from '../smscheck/modules/SmsCheckWorkLogModal'
import {getAction} from "@api/manage";

export default {
  name: 'CompanyList',
  mixins:[JeecgListMixin],
  components: {
    SmsCheckWorkLogModal
  },
  props: {
    task: {
      type: Object,
      require: true
    }
  },

  data () {
    return {
      description: '行短公司列表',
      // 表头
      columns: [
        {
          title: '#',
          dataIndex: '',
          key:'rowIndex',
          width:60,
          align:"center",
          customRender:function (t,r,index) {
            return parseInt(index)+1;
          }
        },
        {
          title: '证件编号',
          align: "center",
          dataIndex: 'cardNo',
          scopedSlots: {customRender: 'cardNo'}
        }, {
          title: '客户名称',
          align: "center",
          dataIndex: 'cardName'
        }
        , {
          title: '新办手机号',
          align: "center",
          dataIndex: 'newPhone'
        },
        //{
        //   title: '创建人工号',
        //   align: "center",
        //   sorter: (a, b) =>a.createBy.localeCompare(b.createBy),
        //   dataIndex: 'createBy'
        // }
        // , {
        //   title: '创建时间',
        //   align: "center",
        //   sorter:(a, b) => { return a.createTime>= b.createTime? 1 : -1 },
        //   dataIndex: 'createTime'
        // }
      ],
      url: {
        list: "/smsCheck/customerInfo/selectCustomerList"
      },
      dictOptions:{},
      superFieldList:[],

      dataSource1:{}
    }
  },
  created() {
    /*this.init()*/
  },
  methods: {
    init(){
      getAction(this.url,this.queryParam).then(resp=>{
        if (resp.success){
          this.dataSource=resp.resultList
        }
      })
    },
    goDetails(record){
       let info = {
        info: record
      };
      this.$emit("goDetails",info)
    }
  }
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>