import request from '@/utils/request'

// 查询党员信息列表
export function listPartymember(query) {
  return request({
    url: '/town/partymember/list',
    method: 'get',
    params: query
  })
}

// 查询党员信息详细
export function getPartymember(id) {
  return request({
    url: '/town/partymember/' + id,
    method: 'get'
  })
}

// 新增党员信息
export function addPartymember(data) {
  return request({
    url: '/town/partymember',
    method: 'post',
    data: data
  })
}

// 修改党员信息
export function updatePartymember(data) {
  return request({
    url: '/town/partymember',
    method: 'put',
    data: data
  })
}

// 删除党员信息
export function delPartymember(id) {
  return request({
    url: '/town/partymember/' + id,
    method: 'delete'
  })
}

//根据用户输入的党员名字查询出ID
export function getPartymemberByName(name) {
  return request({
    url: '/town/partymember/byName' + name,
    method: 'get'
  })
}

//根据用户输入的党员名字查询出ID
export function getPartymemberNameList() {
  return request({
    url: '/town/partymember/nameList',
    method: 'get'
  })
}
