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

export default {
    //获取任务类型
    async queryTaskType() {
        return HcApi({
            url: '/api/blade-system/dict/dictionary?code=meter_task_type',
            method: 'get',
            params: {},
        }, false)
    },
    //获取任务状态
    async queryTaskStatus(form) {
        return HcApi({
            url: '/api/blade-business/task/query-task-type-status',
            method: 'get',
            params: form,
        }, false)
    },
    //获取当前合同段的上报批次
    async queryBatchList(form) {
        return HcApi({
            url: '/api/blade-business/task/query-batch-list',
            method: 'get',
            params: form,
        }, false)
    },
    //获取任务列表分页
    async getPage(form) {
        return HcApi({
            url: '/api/blade-meter/task/page',
            method: 'post',
            data: form,
        }, false)
    },
    //获取任务详情
    async getDetail(id) {
        return HcApi({
            url: '/api/blade-meter/task/detail',
            method: 'get',
            params: { id },
        }, false)
    },
    //获取任务数据信息详情
    async getDataDetail(form) {
        return HcApi({
            url: '/api/blade-meter/task/data/detail',
            method: 'get',
            params: form,
        }, false)
    },
    //任务关联的数据删除（清单、变更令删除）
    async tableRemove(form) {
        return HcApi({
            url: '/api/blade-meter/task/data/remove',
            method: 'post',
            data: form,
        }, false)
    },
    //清单数据修改
    async tableUpdate(form) {
        return HcApi({
            url: '/api/blade-meter/task/data/inventoryFormApplyTask/update',
            method: 'post',
            data: form,
        }, false)
    },
    //清单数据新增（添加清单）
    async tableFormApplyTaskSave(form) {
        return HcApi({
            url: '/api/blade-meter/task/data/inventoryFormApplyTask/save',
            method: 'post',
            data: form,
        }, false)
    },
    //附件文件上传
    async taskUploadFile(form) {
        return HcApi({
            url: '/api/blade-meter/task/data/uploadFile',
            method: 'post',
            data: form,
        }, false)
    },
    //附件文件删除
    async removeFile(form) {
        return HcApi({
            url: '/api/blade-meter/task/data/removeFile',
            method: 'get',
            params: form,
        }, false)
    },
    //批注信息列表
    async taskCommentList(form) {
        return HcApi({
            url: '/api/blade-meter/task/comment/list',
            method: 'get',
            params: form,
        }, false)
    },
    //批注信息新增或修改
    async taskCommentSubmit(form) {
        return HcApi({
            url: '/api/blade-meter/task/comment/submit',
            method: 'post',
            data: form,
        }, false)
    },
    //单条数据同意或驳回
    async taskAudit(form) {
        return HcApi({
            url: '/api/blade-meter/task/data/audit',
            method: 'post',
            data: form,
        }, false)
    },
    //同意审批
    async taskApprove(form) {
        return HcApi({
            url: '/api/blade-meter/task/approve',
            method: 'post',
            data: form,
        }, false)
    },
    //任务废除（任务撤销、驳回审批）
    async taskRepeal(form) {
        return HcApi({
            url: '/api/blade-meter/task/repeal',
            method: 'post',
            data: form,
        }, false)
    },
    //材料数据修改
    async taskMaterialUpdate(form) {
        return HcApi({
            url: '/api/blade-meter/task/data/materialMeterFormServiceTask/update',
            method: 'post',
            data: form,
        }, false)
    },
    //开工预付款数据修改
    async taskStartPayUpdate(form) {
        return HcApi({
            url: '/api/blade-meter/task/data/startPayMeterFormServiceTask/update',
            method: 'post',
            data: form,
        }, false)
    },

    //变更令-基础信息修改
    async changeTokenFromUpdate(form) {
        return HcApi({
            url: '/api/blade-meter/task/data/changeTokenFrom/update',
            method: 'post',
            data: form,
        }, false)
    },
    //变更令-申请部位合同图号修改
    async changeTokenMeterUpdate(form) {
        return HcApi({
            url: '/api/blade-meter/task/data/changeTokenMeter/update',
            method: 'post',
            data: form,
        }, false)
    },
    //变更令-申请清单修改
    async changeTokenInventoryUpdate(form) {
        return HcApi({
            url: '/api/blade-meter/task/data/changeTokenInventory/update',
            method: 'post',
            data: form,
        }, false)
    },
    //变更令-申请清单添加
    async changeTokenInventorySave(form) {
        return HcApi({
            url: '/api/blade-meter/task/data/changeTokenInventory/save',
            method: 'post',
            data: form,
        }, false)
    },
}
