import { HcApi } from '../../../request/index'
//  合同材料
export default {
    //分页
    async getPage(form) {
        return HcApi({
            url: '/api/blade-meter/contractMaterial/list',
            method: 'get',
            params: form,
        })
    },
    //新增或修改
    async submit(form) {
        return HcApi({
            url: '/api/blade-meter/contractMaterial/submit',
            method: 'post',
            data: form,
        })
    },
    //删除
    async remove(form) {
        return HcApi({
            url: '/api/blade-meter/contractMaterial/remove',
            method: 'post',
            params: form,
        })
    },
     //材料树
     async materialTree(form) {
        return HcApi({
            url: '/api/blade-meter/contractMaterial/materialTree',
            method: 'get',
            params: form,
        })
    },
    //日期树
    async dateTree(form) {
        return HcApi({
            url: '/api/blade-meter/materialValidity/list',
            method: 'get',
            params: form,
        })
    },
    //日期树表格
    async dateTreeTable(id) {
        return HcApi({
            url: '/api/blade-meter/materialValidity/detail',
            method: 'get',
            params: { id },
        })
    },
    //实时价格-获取材料列表不分页
    async getAllMaterial(contractId) {
        return HcApi({
            url: '/api/blade-meter/contractMaterial/get-all-material',
            method: 'get',
            params: { contractId },
        })
    },
    //获取同步数据
    async getSyncData(form) {
        return HcApi({
            url: '/api/blade-meter/contractMaterial/get-sync-data',
            method: 'get',
            params: form,
        })
    },
    //同步材料
    async syncMaterial(form) {
        return HcApi({
            url: '/api/blade-meter/contractMaterial/sync-material',
            method: 'get',
            params: form,
        })
    },
    //同步材料
    async addDateTreeTable(form) {
        return HcApi({
            url: '/api/blade-meter/materialValidity/add',
            method: 'post',
            data: form,
        })
    },
}
