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

//  合同计量单元
export default {
    //懒加载系统树
    async lazyTree(form, msg = true) {
        return HcApi({
            url: '/api/blade-meter/tree/contract/lazy',
            method: 'get',
            params: form,
        }, msg)
    },
    //合同段树初始化（新增、增量同步）
    async refresh(form, msg = true) {
        return HcApi({
            url: '/api/blade-meter/tree/contract/refresh',
            method: 'get',
            params: form,
        }, msg)
    },
      //获取节点详情
      async getNodeDetail(form, msg = true) {
        return HcApi({
            url: '/api/blade-meter/tree/contract/detail',
            method: 'get',
            params: form,
        }, msg)
    },
    //修改节点
   async updateForm(form, msg = true) {
    return HcApi({
        url: '/api/blade-meter/tree/contract/update',
        method: 'post',
        data: form,
    }, msg)
   },
    //新增节点
    async addNode(form, msg = true) {
        return HcApi({
            url: '/api/blade-meter/tree/contract/save',
            method: 'post',
            data: form,
        }, msg)
    },
    //删除节点
       async deleteNode(form, msg = true) {
        return HcApi({
            url: '/api/blade-meter/tree/contract/remove',
            method: 'get',
            params: form,
        }, msg)
    },
    //调整排序
    async sortForm(form, msg = true) {
        return HcApi({
            url: '/api/blade-meter/tree/contract/sort',
            method: 'post',
            params: form,
        }, msg)
    },
      //合同段树节点锁定-解锁
      async getLock(form, msg = true) {
        return HcApi({
            url: '/api/blade-meter/tree/contract/lock',
            method: 'get',
            params: form,
        }, msg)
    },
    //合同段-新增-增补单元-左边节点列表
    async getLeftList(form, msg = true) {
    return HcApi({
            url: '/api/blade-meter/tree/contract/left-list',
            method: 'get',
            params: form,
        }, msg)
    },
    //系统、项目、合同段获取节点类型列表接口：
    async getNodeTypeList(form, msg = true) {
        return HcApi({
            url: '/api/blade-meter/tree/getNodeTypeList',
            method: 'get',
            params: form,
        }, msg)
    },
       //合同段修改时获取下级节点类型列表接口：
    async getNodeTypeListUpdate(form, msg = true) {
        return HcApi({
            url: '/api/blade-meter/tree/contract/update/getNodeTypeList',
            method: 'get',
            params: form,
        }, msg)
    },
    async removeInfo(form, msg = true) {
        return HcApi({
            url: '/api/blade-meter/inventoryFormMeter/removeInfo',
            method: 'post',
            params: form,
        }, msg)
    },
    //获取当前节点下，当期未被计量的所有清单
    async getCurrentNodeAllForm(form, msg = true) {
        return HcApi({
            url: '/api/blade-meter/middleMeterApply/getWbsNodeInfo',
            method: 'post',
            data: form,
        }, msg)
    },
}