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

// 根据条件查发票结算申请单
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]}&结束日期=${group[2]}&是否提交=1&角色编号=${group[5]}&外协厂家_check=${group[6]}&外协厂家_流水号=${group[7]}`,
      Pagination: group[3] + '&' + group[4]
    }
  })
}
// 发票结算申请单明细列表
export function searchTable2(num) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '外协管理_发票结算申请单明细_查询数据',
      param: `发票结算申请单流水号=${num}`
    }
  })
}
// 撤回审批
export function cancel(...data) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '2',
      name: '外协管理_发票结算申请单_撤回审批',
      param: `发票结算申请单流水号=${data[0]}&审批代号=${data[1]}`
    }
  })
}
