<template>
  <div style="padding: 0 20px">
    <div ref="lxHeader">
      <lx-header icon="md-apps" text="订单管理" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
        <slot>
          <div style="display: flex">
            <Input v-model="select.keyword" class="select" style="width: 200px; margin-right: 10px"
              placeholder="关键字搜索" />
            <Button class="select" type="primary" style="margin-right: 10px;" @click="getList">查询</Button>
            <Button class="select" type="primary" style="margin-right: 10px;"
              @click="$refs.addrecord.isShow=true,$refs.type='add'">新增</Button>
            <Button class="select" type="primary" style="margin-right: 10px;" @click="downloadExel">导出</Button>
          </div>
        </slot>
      </lx-header>
    </div>

    <xy-table :list="list" :table-item="table" :total="total" @pageSizeChange="e => {select.pageSize = e;getList()}"
      @pageIndexChange="pageChange" :auths='[]'>
      <template v-slot:btns>
        <el-table-column fixed="right" label="操作" width="200" header-align="center">
          <template slot-scope="scope">
            <i-button type="primary" size="small" style="margin-right:8px"
            @click="$refs.addrecord.isShow=true,$refs.addrecord.type='edit',$refs.addrecord.id=scope.row.id">
              编辑
            </i-button>
            <i-button type="primary" size="small" style="margin-right:8px"
              @click="$refs.addrecord.isShow=true,$refs.addrecord.type='edit',$refs.addrecord.id=scope.row.id">
              跟踪
            </i-button>
            <Poptip :transfer='true' confirm title="确认要删除吗"
              @click="deleteRow(scope.row.id)">
              <i-button type="error" size="small">
                删除
              </i-button>
            </Poptip>
          </template>
        </el-table-column>
      </template>

    </xy-table>
    <addrecord ref="addrecord"></addrecord>
  </div>
</template>

<script>
  import addrecord from './components/addrecord.vue'
  export default {
    components: {
      addrecord
    },
    data() {
      return {
        select: {
          page: 1,
          pageSize: 10,
          keyword: ""
        },
        list: [{
          id:1,
          name: "123",
          age: '12',
          sex: '男'
        }],
        total: 0,
        table: [{
            prop: "name",
            label: "姓名",
            width: 120,
            align: 'center',
            fixed: 'left'
          },
          {
            prop: "age",
            label: "年龄",
            width: 120,
            align: 'center'
          },
          {
            prop: "sex",
            label: "性别",
            width: 120,
            align: 'center',
          },
          {
            prop: "mobile",
            label: "联系方式",
            width: 180,
            align: 'center'
          },
          {
            prop: "type",
            label: "残疾类别",
            width: 180,
            align: 'center'
          },
          {
            prop: "level",
            label: "残疾等级",
            width: 180,
            align: 'center'
          },
          {
            prop: "person",
            label: "监护人",
            width: 180,
            align: 'center'
          },
          {
            prop: "phone",
            label: "联系方式",
            width: 180,
            align: 'center'
          },
          {
            prop: "age",
            label: "现居住地",
            width: 240,
            align: 'left'
          },
          {
            prop: "created_at",
            label: "创建时间",
            width: 240,
            align: 'left'
          }
        ]

      }
    },
    created() {

    },
    methods: {
      pageChange(e) {
        this.select.page = e
        this.getList()
      },
      getList() {},
      downloadExel() {},
      deleteRow(id) {

      }

    }


  }
</script>

<style scoped lang="scss">

</style>
