import request from '@/utils/request'

import { business } from '@/api/index'


//获取列表
export function getTabList(data, params) {
    return request({
        url: `${business}cityZpbm/findByPage/${params.page}/${params.size}`,
        method: 'post',
        data: data
    })
}

//条件查询列表
// export function getSearchList(params) {
//     return request({
//         url: `${business}/cityZpbm/findByPage/${params.page}/${params.size}`,
//         method: 'post',
//         data: params.obj
//     })
// }

//查看详情
export function getDetailList(params) {
    return request({
        url: `${business}cityZpbm/findById/${params.id}`,
        method: 'get',
        data: params
    })
}


//编辑保存
export function save(params) {
    return request({
        url: `${business}cityZpbm/update`,
        method: 'post',
        data: params
    })
}


//发布
export function commits(params) {
    return request({
        url: `${business}cityZpbm/publish/${params.id}`,
        method: 'get',
        data: params
    })
}
//批量发布
export function batchPublish(year) {
    return request({
        url: `${business}/cityZpbm/publishALL/${year}`,
        method: 'get'
    })
}
//判断数据是否已提交
// type 类型:10 省配合部门 20 省牵头部门 30 市自评部门 40 市配合部门 50 市牵头部门 60 省级平时牵头部门 70 省级平时配合部门 80 州市任务分配管理(市考核办)
export function isPeportFun(data) {
    return request({
        url: `${business}respScoreInput/findByIsSubmit`,
        method: 'post',
        data: data
    })
}
//年份
export function getYear(params) {
    return request({
        url: `${business}scoringWeight/findByYear/${params.page}`,
        method: 'get',
        data: params
    })
}

//状态
export function getStatus(params) {
    return request({
        url: `${business}responsibility/findByCityStatus`,
        method: 'get',
        data: params
    })
}

//任务汇总
export function totalTask(params) {
    return request({
        url: `${business}cityZpbm/findByTaskDistributionRatio/${params.year}/${params.type}/${params.areaCode}`,
        method: 'get'
    })
}

//考核截止时间
export function khendtime(year, status) {
    return request({
        url: `${business}scoringWeight/findByYearAndStatus/${year}/${status}`,
        method: 'get'
    })
}
/* -------自评审核-------*/

// 自评牵头和配合部门列表
export function searchBranch(code, areaCode) {
    return request({
        url: `${business}respUser/findByDeptList/${code}/${areaCode}`,
        method: 'post'
    })
}

//新加审核与驳回接口
export function updateStatus(data) {
    return request({
        url: `${business}cityZpbm/updateStatus`,
        method: 'post',
        data: data
    })
}


//新加批量审核
export function publishALL(year, status) {
    return request({
        url: `${business}cityZpbm/publishALL/${year}/${status}`,
        method: 'get'
    })
}

