<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 :md="6" :sm="8">
            <a-form-item label="服务商">
              <a-input placeholder="模糊搜索" v-model="queryParam.name"></a-input>
            </a-form-item>
          </a-col>
          <a-col :md="6" :sm="8">
            <a-form-item label="开票配置">
              <j-dict-select-tag v-model="queryParam.isInvoice" placeholder="请选择"
                                 dictCode="is_invoice"></j-dict-select-tag>
            </a-form-item>
          </a-col>
          <a-col :md="6" :sm="8" >
            <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>
    <!-- 查询区域-END -->
    
    <!-- 操作按钮区域 -->
    <div class="table-operator">
    </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">

        <span slot="action" slot-scope="text, record">
          <a @click="handleEdit(record)" v-has="'hlw:subcontractor:set'">配置</a>
        </span>

      </a-table>
    </div>

  </a-card>
</template>

<script>

  import '@/assets/less/TableExpand.less'
  import { mixinDevice } from '@/utils/mixin'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'

  export default {
    name: "HlwSubcontractorList",
    mixins:[JeecgListMixin, mixinDevice],
    components: {
    },
    data () {
      return {
        description: 'hlw_subcontractor管理页面',
        // 表头
        columns: [
          {
            title:'服务商全称',
            align:"center",
            dataIndex: 'name'
          },
          {
            title:'服务商简称',
            align:"center",
            dataIndex: 'abbreviation'
          },
          {
            title:'开票配置',
            align:"center",
            dataIndex: 'isInvoice_dictText'
          },
          {
            title:'创建时间',
            align:"center",
            dataIndex: 'createTime',
            customRender:function (text) {
              return text
            }
          },
          {
            title:'创建者',
            align:"center",
            dataIndex: 'createBy'
          },
          {
            title:'更新时间',
            align:"center",
            dataIndex: 'updateTime',
            customRender:function (text) {
              return text
            }
          },
          {
            title:'更新者',
            align:"center",
            dataIndex: 'updateBy'
          },
          {
            title: '操作',
            dataIndex: 'action',
            align:"center",
            fixed:"right",
            width:147,
            scopedSlots: { customRender: 'action' }
          }
        ],
        url: {
          list: "/wisdom/hlwSubcontractor/list",
          delete: "/wisdom/hlwSubcontractor/delete",
          deleteBatch: "/wisdom/hlwSubcontractor/deleteBatch",
          exportXlsUrl: "/wisdom/hlwSubcontractor/exportXls",
          importExcelUrl: "wisdom/hlwSubcontractor/importExcel",
        },
        dictOptions:{},
      }
    },
    computed: {
      importExcelUrl: function(){
        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
      },
    },
    methods: {
      initDictConfig(){
      },
      handleEdit(record){
        this.$router.push({ path: '/wisdom/hlwSubcontractor/add',query:{id: record.id }})
      },
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less';
</style>