import request from '@/utils/request'

export function getEnforceList(params) {
    return request.get('/v2/api/enforce-obj', {params})
}

export function addEnforce(params) {
    return request.post('/v2/api/enforce-obj', params)
    // ({
    //     url: '/v2/api/enforce-obj',
    //     method: 'post',
    //     params
    // })
}

// 查询公司信息
export function getEnforceItem(id) {
    return request.get(`/v2/api/enforce-obj/${id}`)
}

export function updateEnforce(id, params) {
    return request.put(`/v2/api/enforce-obj/${id}`, params)
}

export function removeEnforce(id) {
    return request.delete(`/v2/api/enforce-obj/${id}`)
}

export function updateEnforceInfo(id) {
    return request.patch(`/v2/api/enforce-obj/${id}`)
}

export function getEnforceProblem(id, params) {
    return request.get(`/v2/api/enforce-obj/${id}/his-problem`, {params})
}

export function getPlaceTypes() {
    return request.get('/v2/api/dictionary/place_type/items')
}

export function loadTags(id) {
    return request.get(`/v2/api/enforce-obj/${id}/tag`)
}

export function updateTag(id, params) {
    return request.post(`/v2/api/enforce-obj/${id}/tag`, params)
}

export function statEnforce(params = {}) {
    return request.get(`/v2/api/enforce-obj/statistics`, {params})
}

// 主协查人员变更
export function executorChange(id, params) {
  return request.put(`/v2/api/enforce-job/${id}/executor-change`, params)
}
