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

// 查询供应商
export function searchSupplier() {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '采购管理_供应商_查询数据_根据条件'
    }
  })
}
// 根据条件查发票结算申请单
export function searchTable1(...group) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '车间采购管理_发票结算申请单_查询数据',
      param: `发票号_check=${group[0]}&发票号=${group[1]}`,
      Pagination: group[2] + '&' + group[3]
    }
  })
}
export function cancel(...group) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '2',
      name: '车间采购管理_发票结算申请单_撤回审批',
      param: `发票结算申请单流水号=${group[0]}&审批代号=${group[1]}`
    }
  })
}
// 发票结算申请单明细列表
export function searchTable2(num) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '车间采购管理_发票结算申请单明细_查询数据',
      param: `发票结算申请单流水号=${num}`
    }
  })
}
