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

export function initProject() {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '合同信息管理_项目名称_总_查询'
    }
  })
}
export function searchTableData1(pageCurrent, pageSize, num1, num2, num3, num4, num5, num6, num7, num8, num9, num10) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '合同资金管理_开票记录_合同信息统计_查询',
      param: '合同ID=' + num1 + '=int&人员ID=' + num2 + '=int&项目流水号_check=' + num3 + '=int&营销经理流水号_check=' + num4 + '=int&开始日期_check=' + num5 + '=int&结束日期_check=' + num6 + '=int&开始日期=' + num7 + '=date&结束日期=' + num8 + '=date&客户名称=' + num9 + '=string&客户名称_check=' + num10 + '=int',
      Pagination: pageCurrent + '&' + pageSize
    }
  })
}
export function searchTableData2(num1) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '合同信息管理_开票记录_查询',
      param: '项目流水号=' + num1 + '=int'
    }
  })
}
export function revisionOfTaxRate(num1, num2) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '2',
      name: '合同信息管理_开票记录_税率修改',
      param: '项目流水号=' + num1 + '=int&税率=' + num2 + '=float'
    }
  })
}
export function selectProvince() {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '发货管理_省份查询'
    }
  })
}
export function SelectMarketingManager(code) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '客户关系管理系统_按姓名查询_营销经理',
      param: '姓名=' + code
    }
  })
}
export function fetchCustomerData(PageCurrent, PageSize, name) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: 1,
      name: '创建合同_客户信息查询',
      param: '客户名称=' + name + '=string',
      Pagination: PageCurrent + '&' + PageSize
    }
  })
}
export function addSubmit(num1, num2, num3, num4, num5) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '2',
      name: '合同信息管理_开票记录_增加',
      param: '项目流水号=' + num1 + '=int&客户流水号=' + num2 + '=int&开票金额=' + num3 + '=float&开票时间=' + num4 + '=string&备注=' + num5 + '=string'
    }
  })
}
export function editSubmit(num2, num3, num4, num5, num6) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '2',
      name: '合同信息管理_开票记录_修改',
      param: '客户流水号=' + num2 + '=int&开票金额=' + num3 + '=float&开票时间=' + num4 + '=string&备注=' + num5 + '=string&开票记录流水号=' + num6 + '=string'
    }
  })
}
export function delSubmit(num1) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '2',
      name: '合同信息管理_开票记录_删除',
      param: '开票记录流水号=' + num1 + '=int'
    }
  })
}
export function searchTableData_Excel(num1, num2, num3, num4, num5, num6, num7, num8, num9, num10) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '报表_开票记录_导出',
      param: '合同ID=' + num1 + '=int&人员ID=' + num2 + '=int&项目流水号_check=' + num3 + '=int&营销经理流水号_check=' + num4 + '=int&开始日期_check=' + num5 + '=int&结束日期_check=' + num6 + '=int&开始日期=' + num7 + '=date&结束日期=' + num8 + '=date&客户名称=' + num9 + '=string&客户名称_check=' + num10 + '=int'
    }
  })
}
