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 excuteApprove(...data) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '2',
      name: '采购管理_发票结算申请单_执行审批',
      param: `发票结算申请单流水号=${data[0]}&人员编号=${data[1]}&审批代号=${data[2]}&审批流水号=${data[3]}&未通过原因=${data[4]}`
    }
  })
}
// 查询供应商
export function searchSupplier(check1, value1, check2, value2, check3, value3, check4, value4, check5, value5, check6, value6, check7, value7, check8, value8, check9, value9, check10, value10, check11, value11, check12, value12) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '采购管理_供应商_查询数据_根据条件',
      param: '供应商名称_check=' + check1 + '&供应商名称=' + value1 + '&企业性质_check=' + check2 + '&企业性质=' + value2 + '&创立日期_check=' + check3 + '&创立日期=' + value3 + '&注册资本_check=' + check4 + '&注册资本=' + value4 + '&税号_check=' + check5 + '&税号=' + value5 + '&电子信箱_check=' + check6 + '&电子信箱=' + value6 + '&地址_check=' + check7 + '&地址=' + value7 + '&帐号_check=' + check8 + '&帐号=' + value8 + '&开户行_check=' + check9 + '&开户行=' + value9 + '&电话号码_check=' + check10 + '&电话号码=' + value10 + '&传真_check=' + check11 + '&传真=' + value11 + '&货期_check=' + check12 + '&货期=' + value12
    }
  })
}
// 发票结算申请单明细列表
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 searchTable3(num, num1, num2) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '采购管理_发票结算申请单明细_查询数据',
      param: `发票结算申请单流水号=${num}&采购合同流水号=${num1}&离线合同流水号=${num2}`
    }
  })
}
export function searchPic(num) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '发票管理_图片_查询数据',
      param: '发票结算申请单流水号=' + num
    }
  })
}
