import request from '@/utils/request'

/**
 * 获取生成的单号
 * @param data
 * @returns {*}
 */

export function getCodeNo(data) {
  return request({
    url: 'api/asn/maxNo?code='+data,
    method: 'get'
  })
}

export function getIdByAsn(id) {
  return request({
    url: 'api/asn/getIdByAsn?id='+id,
    method: 'get'
  })
}

export function queryAsnAll(data) {
  return request({
    url: 'api/asn/queryAsnAll',
    method: 'get',
    data
  })
}

export function add(data) {
  return request({
    url: 'api/asn',
    method: 'post',
    data
  })
}

export function del(ids) {
  return request({
    url: 'api/asn/',
    method: 'delete',
    data: ids
  })
}

export function edit(data) {
  return request({
    url: 'api/asn',
    method: 'put',
    data
  })
}

export function zlRegister(ids) {
  return request({
    url: 'api/asn/zlRegister',
    method: 'post',
    data: ids
  })
}

export function cyRegister(ids) {
  return request({
    url: 'api/asn/cyRegister',
    method: 'post',
    data: ids
  })
}

export function zjRegister(ids) {
  return request({
    url: 'api/asn/zjRegister',
    method: 'post',
    data: ids
  })
}

export default { add, edit, del,zlRegister,cyRegister,zjRegister }
