import { config, networkUtils } from '../../../utils'

const { api } = config
const { contract } = api
const { contracts,contractUpdateStatus } = contract

export async function query(params) {
  return networkUtils.request({
    url: contracts,
    method: 'get',
    data: params,
  })
}

export async function getSingle(id) {
  return networkUtils.request({
    url: `${contracts}/${id}`,
    method: 'get',
  })
}



export async function remove(ids) {
  return networkUtils.request({
    url: contracts,
    method: 'post',
    data: ids,
  })
}

export async function update(params) {
  return networkUtils.request({
    url: `${contracts}/save`,
    method: 'post',
    data: params,
  })
}

export async function updateStatus(params) {
  return networkUtils.request({
    url: `${contracts}/updateStatus`,
    method: 'form',
    params,
  })
}


export async function queryPrint(id) {
  return networkUtils.request({
    url: `${contracts}/${id}/print`,
    method: 'get',
  })
}

export async function queryTpmlVars(params) {
  return networkUtils.request({
    url: `${contracts}/tmplVars`,
    method: 'get',
    data: params,
  })
}


export async function roleId() {
  return networkUtils.request({
    url: `${contracts}/roleId`,
    method: 'get',
  })
}

export async function checkDate(params) {
  return networkUtils.request({
    url: `${contracts}/checkDate`,
    method: 'post',
    data: params,
  })
}

export async function deleteContract(id) {
  return networkUtils.request({
    url: `${contracts}/${id}/x`,
    method: 'post',
  })
}
