import { getAction, postAction, deleteAction } from '@/api/manage'

/** 单证 -- 发运明细 **/

// 分页列表查询
const shipmentList = params => getAction('/shippingDetails/syShippingDetails/list', params)

// 新增
const addShipmentList = params => postAction('/shippingDetails/syShippingDetails/add', params)

// ID查询
const shipmentQueryById = params => getAction('/shippingDetails/syShippingDetails/queryById', params)

//详情
const queryByDetails = params => getAction('/shippingDetails/syShippingDetails/queryByDetails', params)

// 编辑
const editById = params => postAction('/shippingDetails/syShippingDetails/edit', params)

//  删除
const deleteShipment = params => deleteAction('/shippingDetails/syShippingDetails/delete', params)

// 提交
const submitShipment = params => postAction('/shippingDetails/syShippingDetails/syShippingDetailsSubmit', params)

// 取消提交
const cancelSubmitShipment = params => postAction('/shippingDetails/syShippingDetails/syShippingDetailsSubmit', params)

// 推送
const pushShipment = params => getAction('/shippingDetails/syShippingDetails/pushSyShippingInfo', params)

// 重新推送
const rePushShipment = params => getAction('/shippingDetails/syShippingDetails/pushSyShippingInfo', params)

// 申报要素查询
const queryDeclarationElements = params =>
  getAction('/shippingDetails/syShippingDetails/queryDeclarationElements', params)

// 新增报关要素（保存）  文档上显示 为 get
const syDeclarationElementsAdd = params =>
  postAction('/shippingDetails/syShippingDetails/syDeclarationElementsAdd', params)

// 参照订单数据
const queryOrderData = params => getAction('/shippingDetails/syShippingDetails/queryOrderData', params)

// 维护款号成分
const addItemNumEle = params => postAction('/shippingDetails/syShippingDetails/updateByTcNumberMaterial', params)

// 参照订单数据  确定

const confimOrderData = params => postAction('/shippingDetails/syShippingDetails/displayDetails', params)

export {
  shipmentList,
  addShipmentList,
  deleteShipment,
  submitShipment,
  queryOrderData,
  shipmentQueryById,
  queryByDetails,
  editById,
  queryDeclarationElements,
  syDeclarationElementsAdd,
  cancelSubmitShipment,
  pushShipment,
  rePushShipment,
  addItemNumEle,
  confimOrderData
}
