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

// 查询离线合同
export function searchOfflineContract(pageCurrent, pageSize, check1, num, check2, name, order, partName, check3, dateRange0, dateRange1) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '采购管理_离线合同_查询数据',
      param: `离线合同编号_check=${check1}&离线合同编号=${num}&供应商名称_check=${check2}&供应商名称=${name}&排序方式=${order}&排序名称=${partName}&时间_check=${check3}&开始时间=${dateRange0}&结束时间=${dateRange1}&是否不包含编辑中=1`,
      Pagination: pageCurrent + '&' + pageSize
    }
  })
}
// 查询离线合同明细
export function searchOfflineContractContent(num) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '采购管理_离线合同明细_查询数据',
      param: `离线合同流水号=${num}`
    }
  })
}
// 打回离线合同
export function back(num) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '2',
      name: '采购管理_离线合同_打回合同',
      param: `离线合同流水号=${num}`
    }
  })
}
