import { HcApi } from '../../request/index'

export default {
    //分页数据
    async getPageData(form) {
        return HcApi({
            url: '/api/blade-meter/task/getFixedFlowPage',
            method: 'post',
            data: form,
        })
    },
    //获取系统所有角色划分
    async queryAllRoleList(form) {
        return HcApi({
            url: '/api/blade-business/fixedFlow/queryAllRoleList',
            method: 'get',
            params: form,
        })
    },
    //详情
    async queryFixedFlowDetail(form) {
        return HcApi({
            url: '/api/blade-meter/task/getFixedFlow',
            method: 'get',
            params: form,
        })
    },
    //新增
    async saveFixedFlow(form) {
        return HcApi({
            url: '/api/blade-meter/task/saveFixedFlow',
            method: 'post',
            data: form,
        })
    },
    //修改
    async updateFixedFlowData(form) {
        return HcApi({
            url: '/api/blade-meter/task/updateFixedFlow',
            method: 'post',
            data: form,
        })
    },
    //删除
    async removeFixedFlowData(form) {
        return HcApi({
            url: '/api/blade-meter/task/deleteFixedFlow',
            method: 'post',
            params: form,
        })
    },
    //计量刪除预设流程分支
    async deleteFixedFlowBranch(form) {
        return HcApi({
            url: '/api/blade-meter/task/deleteFixedFlowBranch',
            method: 'post',
            params: form,
        })
    },
    //检查任务人是否存在签字证书信息
    async checkTaskUserCertificateInfo(form) {
        return HcApi({
            url: '/api/blade-archive/archiveTask/checkTaskUserCertificateInfo',
            method: 'post',
            params: form,
        })
    },
    //批量上报
    async batchReportTaskArchive(form) {
        return HcApi({
            url: '/api/blade-business/task/batch-report-task-archive',
            method: 'post',
            data: form,
        })
    },
    //批量认证
    async batchCertification(form) {
        return HcApi({
            url: '/api/blade-archive/archiveTask/batchCertification',
            method: 'post',
            params: form,
        })
    },
    //批量撤销 //数据类型，=1表示档案文件收集处的废除；=2时表示任务审批处的废除
    async batchRepealTaskArchive(form) {
        return HcApi({
            url: '/api/blade-business/task/batch-repeal-task-archive',
            method: 'post',
            data: form,
        })
    },

    //获取任务名称
    async reportTaskName(form) {
        return HcApi({
            url: '/api/blade-meter/task/name',
            method: 'get',
            params: form,
        })
    },
    //任务上报
    async reportTaskForm(form) {
        return HcApi({
            url: '/api/blade-meter/task/report',
            method: 'post',
            data: form,
        }, false)
    },
    //获取预设流程信息
    async getFixedFlow(form) {
        return HcApi({
            url: '/api/blade-meter/task/getFixedFlow',
            method: 'get',
            params: form,
        })
    },
    //排序
    async batchUpdateSort(form) {
        return HcApi({
            url: '/api/blade-business/task/batchUpdateTaskSort',
            method: 'post',
            data: {
                list: form,
            },
        })
    },
}
