import request from '@/config/axios'

// 社保方案 VO
export interface InsuranceSchemeVO {
  schemeId: number // 社保方案id
  schemeName: string // 方案名称
  city: string // 参保城市
  houseType: string // 户籍类型
  schemeType: number // 参保类型 1 比例 2 金额
}

// 社保方案 API
export const InsuranceSchemeApi = {
  queryInsuranceSchemePageList: async (params: any) => {
    return await request.get({ url: `/hr/insurance-scheme/queryInsuranceSchemePageList`, params })
  },
  // 查询社保方案分页
  getInsuranceSchemePage: async (params: any) => {
    return await request.get({ url: `/hr/insurance-scheme/page`, params })
  },

  // 查询社保方案详情
  getInsuranceScheme: async (id: number) => {
    return await request.get({ url: `/hr/insurance-scheme/get?id=` + id })
  },

  // 新增社保方案
  createInsuranceScheme: async (data: InsuranceSchemeVO) => {
    return await request.post({ url: `/hr/insurance-scheme/create`, data })
  },

  // 修改社保方案
  updateInsuranceScheme: async (data: InsuranceSchemeVO) => {
    return await request.put({ url: `/hr/insurance-scheme/update`, data })
  },

  // 删除社保方案
  deleteInsuranceScheme: async (id: number) => {
    return await request.delete({ url: `/hr/insurance-scheme/delete?id=` + id })
  },

  // 导出社保方案 Excel
  exportInsuranceScheme: async (params) => {
    return await request.download({ url: `/hr/insurance-scheme/export-excel`, params })
  },
  //查询社保类型(调用社保100)
  queryInsuranceType: async (data: InsuranceSchemeVO) => {
    return await request.post({
      url: `/hr/insurance-scheme/queryInsuranceType`,
      data,
      headers: {
        'Content-Type': 'application/json;charset=UTF-8'
      }
    })
  },
  /**
   * 添加社保方案
   *
   */
  addInsuranceScheme: async (data) => {
    return await request.post({
      url: `/hr/insurance-scheme/addInsuranceScheme`,
      data,
      headers: {
        'Content-Type': 'application/json;charset=UTF-8'
      }
    })
  },
  //查询参保方案详情
  queryInsuranceSchemeById: async (id) => {
    return await request.post({
      url: `/hr/insurance-scheme/queryInsuranceSchemeById/${id}`
    })
  },
  //社保表详情
  queryInsuranceRecordList: async (id) => {
    return await request.post({
      url: `/hr/insurance-month-record/queryInsuranceRecordList/${id}`
    })
  },
  /**
   * 查询社保数据列表
   *
   */
  queryInsurancePageList: async (data) => {
    return await request.post({
      url: `/hr/insurance-month-record/queryInsurancePageList`,
      data,
      headers: {
        'Content-Type': 'application/json;charset=UTF-8'
      }
    })
  },
  /**
   * 添加参保人员
   *
   */
  addInsuranceEmp: async (data) => {
    return await request.post({
      url: `/hr/insurance-month-emp-record/addInsuranceEmp`,
      data,
      headers: {
        'Content-Type': 'application/json;charset=UTF-8'
      }
    })
  }
}
