<template>
  <a-card :bordered="false">
    <!-- 查询区域 -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">

        </a-row>
      </a-form>
    </div>
    <!-- 查询区域-END -->
    
    <!-- 操作按钮区域 -->
    <div class="table-operator">

    </div>

    <!-- table区域-begin -->
    <div>


      <a-table
        ref="table"
        size="middle"
        bordered
        rowKey="subcontractorId"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        @change="handleTableChange">
        


        <span slot="action" slot-scope="text, record">
          <a @click="handleEdit(record)" v-has="'subcontractorContract:edit'">编辑</a>

        </span>

      </a-table>
    </div>

    <hwSubcontractorContract-modal ref="modalForm" @ok="modalFormOk"></hwSubcontractorContract-modal>
  </a-card>
</template>

<script>

  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import HwSubcontractorContractModal from './modules/HwSubcontractorContractModal'
  export default {
    name: "HwSubcontractorContractList",
    mixins:[JeecgListMixin],
    components: {
      HwSubcontractorContractModal
    },
    data () {
      return {
        description: 'hw_subcontractor_contract管理页面',
        // 表头
        columns: [
          {
            title:'服务商',
            align:"center",
            dataIndex: 'subcontractorName'
          },
          {
            title:'合同类型',
            align:"center",
            dataIndex: 'subcontractType_dictText',
            customRender: function(text) {
              return text ? text : '--'
            }
          },
          {
            title:'合同',
            align:"center",
            dataIndex: 'subcontract',
            customRender: function(text,record) {
              if(record.subcontractType==1 || record.subcontractType==null){
                return '--'
              }else{
                if(text){
                  return '已上传'
                }else{
                  return '未上传'
                }
              }
            }
          },
          {
            title:'合同到期日期',
            align:"center",
            dataIndex: 'subcontractExpiryDate',
            customRender: function(text) {
              return !text ? '--' : text.substring(0,10)
            }

          },
          {
            title:'外包费率',
            align:"center",
            dataIndex: 'subcontractorFeeRate',
            customRender: function(text) {
              return text ? text+'%' : '--'
            }
          },
          {
            title: '操作',
            dataIndex: 'action',
            align:"center",
            scopedSlots: { customRender: 'action' },
          }
        ],
        url: {
          list: "/saasmanager/hwSubcontractorContract/list",
          delete: "/saasmanager/hwSubcontractorContract/delete",
          deleteBatch: "/saasmanager/hwSubcontractorContract/deleteBatch",
          exportXlsUrl: "/saasmanager/hwSubcontractorContract/exportXls",
          importExcelUrl: "saasmanager/hwSubcontractorContract/importExcel",
        },
        dictOptions:{
        } 
      }
    },
    computed: {
      importExcelUrl: function(){
        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
      }
    },
    methods: {
      initDictConfig(){
      }
       
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less'
</style>