import request from '@/utils/request'

// 列表
export function listStock(data) {
  return request({
    url: '/wisdom/stock/list',
    method: 'get',
    params: data
  })
}

// 修改
export function editStock(data) {
  return request({
    url: '/wisdom/stock/update',
    method: 'post',
    data: data
  })
}

// 统计
export function getTotal(data) {
  return request({
    url: '/wisdom/stock/statistic',
    method: 'post',
    data: data
  })
}



export function printTag(data){
  return request({
    url: '/pk/dat/batchAdd',
    method: 'post',
    data: data
  })
}


























































// 查询库存单据主详细
export function getStock(id) {
  return request({
    url: '/wisdom/stock/' + id,
    method: 'get'
  })
}

// 新增库存单据主
export function addStock(data) {
  return request({
    url: '/wisdom/stock/add',
    method: 'post',
    data: data
  })
}

// 修改库存单据主
export function updateStock(data) {
  return request({
    url: '/wisdom/stock/update',
    method: 'post',
    data: data
  })
}

// 删除库存单据主
export function delStock(id) {
  return request({
    url: '/wisdom/stock/' + id,
    method: 'delete'
  })
}

//根据订单号获取供应计划
export function getPlan(orderNum) {
  // sapNo
  return request({
    url: '/plan/jh/getBySapNo?sapNo='+orderNum,
    method: 'get'
  })
}

//移库
export function moveHouse(data) {
  // sapNo
  return request({
    url: '/inventory/move/add',
    method: 'post',
    data: data
  })
}

//是否开启审核
export function getAudit(data){
  return request({
    url: '/system/config/configKey/rk.audit.enabled',
    method: 'get',
    data: data
  })
}

//撤销入库  整笔

// export function wisdomDelStock(data){
//   return request({
//     url: '/wisdom/stock/deleteByBillNo',
//     method: 'get',
//     data: data
//   })
// }
//撤销入库 单条
export function wisdomDelStock(data){
  return request({
    url: '/wisdom/stock/cancel',
    method: 'post',
    data: data
  })
}
export function ckDelStock(id){
  return request({
    url: '/wisdom/stock/cancelById/'+id,
    method: 'post',
 
  })
}
export function wlSearch(mid){
  return request({
    url: '/information/mtd/list?mid='+mid,
    method: 'get',
 
  })
}
export function uploadContract(data){
  return request({
    url: '/photo/upload/batch',
    method: 'post',
    data: data,
    isUpload:true
  })
}
// export function picDetail(data){
//   return request({
//     url: '/photo/list?billNo='+data.billNo+'&photoType='+data.photoType,
//     method: 'get',
   
//   })
// }
export function picDetail(data){
  return request({
    url: '/photo/listData?billNo='+data.billNo+'&photoType='+data.photoType,
    method: 'get',
   
  })
}
export function delPicF(PicId){
  return request({
    url: '/photo/deleteById?id='+PicId,
    method: 'get'
    
  })
}
export function editBill(data){
  return request({
    url: '/wisdom/stock/editBill',
    method: 'post',
    data: data
  })
}
export function addOneStock(data){
  return request({
    url: '/wisdom/stock/append',
    method: 'post',
    data: data
  })
}


// 左侧修改查询
export function getEditInfo(id){
  return request({
    url: '/wisdom/stock/header/'+id,
    method: 'get'
  })
}



