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

export default {
    //分页
    async page(form) {
        return HcApi({
            url: '/api/blade-manager/projectInfo/list',
            method: 'get',
            params: form,
        })
    },
    //详情
    async detail(id) {
        return HcApi({
            url: '/api/blade-manager/projectInfo/detail',
            method: 'get',
            params: { id },
        })
    },
    //详情
    async detail2(form) {
        return HcApi({
            url: '/api/blade-manager/projectInfo/detail2',
            method: 'get',
            params: form,
        })
    },
    //合同段详情
    async detail3(id) {
        return HcApi({
            url: '/api/blade-manager/contractInfo/detail2',
            method: 'get',
            params: { id },
        })
    },
    //新增和编辑
    async submit(form) {
        return HcApi({
            url: '/api/blade-manager/projectInfo/submit',
            method: 'post',
            data: form,
        })
    },
    //删除
    async del(ids) {
        return HcApi({
            url: '/api/blade-manager/projectInfo/remove',
            method: 'post',
            params: { ids },
        })
    },
    async getProjectDeatilWbsId(id, ReferenceWbsTemplateId, ReferenceWbsTemplateType) {
        return HcApi({
            url: '/api/blade-manager/projectInfo/detail2',
            method: 'get',
            params: { id, ReferenceWbsTemplateId, ReferenceWbsTemplateType },
        })
    },
    async findLogWbsTreeList() {
        return HcApi({
            url: '/api/blade-manager/wbsInfo/queryLogTree',
            method: 'get',
            params: {},
        })
    },
    async findWbsTreeList(type) {
        return HcApi({
            url: '/api/blade-manager/projectInfo/get-wbsTree-list',
            method: 'get',
            params: { type },
        })
    },
    async findProjectTree(form) {
        return HcApi({
            url: '/api/blade-manager/projectInfo/tree',
            method: 'get',
            params: form,
        })
    },
    //获取试验配合比树接口
    async findProjectTreeTrial(form) {
        return HcApi({
            url: '/api/blade-manager/projectInfo/tree-record-trial',
            method: 'get',
            params: form,
        })
    },
    async getContractRelation(contractId) {
        return HcApi({
            url: '/api/blade-manager/contractInfo/get-contract-relationInfo',
            method: 'get',
            params: { contractId },
        })
    },
    async submitLogWbsTreeInProject(form) {
        return HcApi({
            url: '/api/blade-manager/wbsPrivate/saveContractLogNode',
            method: 'post',
            data: form,
        })
    },
    async submitWbsTreeInProject(form) {
        return HcApi({
            url: '/api/blade-manager/projectInfo/submit-wbsTree-project',
            method: 'post',
            data: form,
        })
    },
    async treeAllConstruction(form) {
        return HcApi({
            url: '/api/blade-manager/contractInfo/tree-all-construction',
            method: 'get',
            params: form,
        })
    },
}
