import request from '@/utils/request'

// 查询审批/付款
export function initApproval(pageCurrent, pageSize, state) {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '1',
      name: '采购管理_采购合同_审批付款_查询数据',
      param: `审批_付款状态=${state}`,
      Pagination: pageCurrent + '&' + pageSize
    }
  })
}
// 执行审批/付款
export function execApproval(num1, num2, reason, person, state) {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '2',
      name: '采购管理_采购合同_审批付款_修改数据',
      param: `采购合同请款流水号=${num1}&审批_付款情况流水号=${num2}&未通过原因=${reason}&操作员编号=${person}&审批_付款状态=${state}`
    }
  })
}
// 查询离线合同审批/付款
export function initApprovalOffline(pageCurrent, pageSize, state) {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '1',
      name: '采购管理_离线合同_审批付款_查询数据',
      param: `审批_付款状态=${state}`,
      Pagination: pageCurrent + '&' + pageSize
    }
  })
}
// 查询离线合同请款信息明细
export function searchRequsetFundDetail1(num) {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '1',
      name: '采购管理_采购合同_请款明细_查询数据',
      param: `采购合同请款流水号=${num}`
    }
  })
}
// 查询离线合同请款信息明细
export function searchRequsetFundDetail2(num) {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '1',
      name: '采购管理_离线合同_请款明细_查询数据',
      param: `离线合同请款流水号=${num}`
    }
  })
}
// 执行审批/付款（离线合同）
export function execApprovalOffline(num1, num2, reason, person, state) {
  return request({
    url: '',
    method: 'post',
    data: {
      type: '2',
      name: '采购管理_离线合同_审批付款_修改数据',
      param: `离线合同请款流水号=${num1}&审批_付款情况流水号=${num2}&未通过原因=${reason}&操作员编号=${person}&审批_付款状态=${state}`
    }
  })
}
