import request from '@/utils/request'
import state from '@/store'
import router from '@/router'

// 初始化形目名称
export function searchProjectName() {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '发货管理_总装箱单_查询'
    }
  })
}

// 查询装箱单总单据信息
export function searchPackingList() {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '发货管理_总装箱单_查询_通过编号',
      param: '装箱单编号=' + arguments[0]
    }
  })
}

// 查询备件
export function searchSparePart() {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '发货管理_备件_查询数据',
      param: '装箱单编号=' + arguments[0]
    }
  })
}

// 查询随机文件
export function searchFile() {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '发货管理_随机文件_查询数据',
      param: '装箱单编号=' + arguments[0]
    }
  })
}

// 查询主机
export function searchHost() {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '发货管理_主机_查询数据',
      param: '装箱单编号=' + arguments[0]
    }
  })
}

// 查询机床所属部件
export function searchParts() {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '发货管理_机床所属部件_查询数据',
      param: '代号=' + arguments[0]
    }
  })
}

// 查询发货单
export function searchInvoice() {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '发货管理_发货单_查询数据',
      param: '装箱单编号=' + arguments[0]
    }
  })
}
// 收货地址初始化
export function addressSearch(pageCurrent, pageSize) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '发货管理_收货地址查询',
      Pagination: pageCurrent + '&' + pageSize
    }
  })
}
// 省份初始化
export function provinceSearch() {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '发货管理_省份查询'
    }
  })
}
export function citySearch(num1) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '发货管理_市名查询_根据省流水号',
      param: '省份流水号=' + num1
    }
  })
}
export function deleteAdress(num1) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '2',
      name: '发货管理_收货地址删除',
      param: '收货地址流水号=' + num1
    }
  })
}
export function addAdress(num1, num2, num3, num4, num5) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '2',
      name: '发货管理_收货地址增加',
      param: '省份流水号=' + num1 + '&市流水号=' + num2 + '&详细地址=' + num3 + '&联系人=' + num4 + '&联系方式=' + num5
    }
  })
}
export function editAdress(num1, num2, num3, num4, num5, num6) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '2',
      name: '发货管理_收货地址修改',
      param: '省份流水号=' + num1 + '&市流水号=' + num2 + '&详细地址=' + num3 + '&联系人=' + num4 + '&联系方式=' + num5 + '&收货地址流水号=' + num6
    }
  })
}
export function addInvoice() {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '2',
      name: '发货管理_发货单_增加数据',
      param: '装箱单编号=' + arguments[0] + '&车辆牌号=' + arguments[1] + '&运输状态=' + arguments[2] + '&收货地址流水号=' + arguments[3] + '&发货日期=' + arguments[4] + '&运费=' + arguments[5]
    }
  })
}
export function delInvoice() {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '2',
      name: '发货管理_发货单_删除数据',
      param: '发货单编号=' + arguments[0]
    }
  })
}
export function editInvoice() {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '2',
      name: '发货管理_发货单_修改数据',
      param: '车辆牌号=' + arguments[0] + '&运输状态=' + arguments[1] + '&收货地址流水号=' + arguments[2] + '&发货日期=' + arguments[3] + '&发货单编号=' + arguments[4] + '&运费=' + arguments[5]
    }
  })
}
export function searchCargoBox() {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '发货管理_货箱号_查询数据',
      param: '发货单编号=' + arguments[0]
    }
  })
}
export function addCargoBox() {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '2',
      name: '发货管理_货箱号_增加数据',
      param: '发货单编号=' + arguments[0]
    }
  })
}
export function delCargoBox() {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '2',
      name: '发货管理_货箱号_删除数据',
      param: '货箱号编号=' + arguments[0]
    }
  })
}
export function submitMoveInto() {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '2',
      name: '发货管理_货箱明细_移入',
      param: '货箱号编号=' + arguments[0] + '&代号=' + arguments[1] + '&名称=' + arguments[2] + '&规格=' + arguments[3] + '&数量=' + arguments[4] + '&备注=' + arguments[5] + '&部件编号=' + arguments[6] + '&@备件编号=' + arguments[7] + '&文件编号=' + arguments[8]
    }
  })
}
export function searchCargoBoxDetailed() {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '发货管理_货箱明细_查询',
      param: '货箱号编号=' + arguments[0]
    }
  })
}
export function submitRremove() {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '2',
      name: '发货管理_货箱明细_移除',
      param: '货箱明细编号=' + arguments[0] + '&数量=' + arguments[1] + '&部件编号=' + arguments[2] + '&备件编号=' + arguments[3] + '&文件编号=' + arguments[4] + '&货箱号编号=' + arguments[5]
    }
  })
}
export function selectDelivery() {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '发货管理_发货单二维码扫描查询',
      param: '发货单编号=' + arguments[0]
    }
  })
}
