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

// 初始化合同
export function initArrivalStateContact(num) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '采购管理_采购请款表_查询数据',
      param: `供应商流水号_check=1&供应商流水号=${num}`
    }
  })
}
// 查询到货情况
export function searchArrivalState(pageCurrent, pageSize, check1, num, check2, name) {
  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}`,
      Pagination: pageCurrent + '&' + pageSize
    }
  })
}
// 查询仓库到货情况
export function searchArrivalState1(pageCurrent, pageSize, check1, num, check2, name) {
  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}`,
      Pagination: pageCurrent + '&' + pageSize
    }
  })
}
// 查询到货情况
export function searchArrivalNum(num) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '采购管理_合同物料到货情况_查询数据',
      param: `采购合同流水号=${num}`
    }
  })
}
// 更改到货情况
export function submit(num) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '2',
      name: '采购管理_仓库到货情况_到货',
      param: `采购合同流水号=${num}`
    }
  })
}
// 查询仓库到货情况
export function searchArrivalState12(pageCurrent, pageSize, check1, num, check2, name) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '采购管理_仓库到货情况_查询数据_NEW',
      param: `采购合同流水号_check=${check1}&采购合同流水号=${num}&供应商流水号_check=${check2}&供应商流水号=${name}`,
      Pagination: pageCurrent + '&' + pageSize
    }
  })
}
export function searchgongyings() {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '采购管理_仓库到货情况_供货商查询数据'
    }
  })
}
