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

// 查询表格数据
export function searchtable(check1, ManufacturerAbbreviation, check2, starttime, endTime) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '车间生产管理工艺_外协付款_查询',
      param: '外协厂家_check=' + check1 + '&外协厂家=' + ManufacturerAbbreviation + '&时间_check=' + check2 + '&开始时间=' + starttime + '&结束时间=' + endTime
    }
  })
}
export function getInvoice(Number, check2, starttime, endTime, pageCurrent, pageSize) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '车间生产管理工艺_外协发票管理_查询数据',
      param: '外协厂家流水号_check=1&外协厂家流水号=' + Number + '&时间_check=' + check2 + '&开始时间=' + starttime + '&结束时间=' + endTime,
      Pagination: pageCurrent + '&' + pageSize
    }
  })
}
export function getPayment(Number, check2, starttime, endTime, pageCurrent, pageSize) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '车间生产管理工艺_外协付款记录_查询数据',
      param: '外协厂家流水号=' + Number + '&时间_check=' + check2 + '&开始时间=' + starttime + '&结束时间=' + endTime,
      Pagination: pageCurrent + '&' + pageSize
    }
  })
}
// 增加
export function AddType1(num1, num2, num3, num4) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '2',
      name: '车间生产管理工艺_外协付款_新增发票',
      param: '外协厂家流水号=' + num1 + '&发票号=' + num2 + '&开票时间=' + num3 + '&开票金额=' + num4
    }
  })
}
export function AddType2(num1, num2, num3) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '2',
      name: '车间生产管理工艺_外协付款_新增付款',
      param: '外协厂家流水号=' + num1 + '&付款金额=' + num2 + '&付款日期=' + num3
    }
  })
}
// 编辑
export function handleChange1(num, num2, num3, num4) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '2',
      name: '车间生产管理工艺_外协发票管理_编辑数据',
      param: 'id=' + num + '&发票号=' + num2 + '&开票时间=' + num3 + '&开票金额=' + num4
    }
  })
}
// 删除
export function handleDelete1(num) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '2',
      name: '车间生产管理工艺_外协发票管理_删除数据',
      param: 'id=' + num
    }
  })
}
export function handleChange2(num, num2, num3) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '2',
      name: '车间生产管理工艺_外协付款管理_编辑数据',
      param: '外协付款流水号=' + num + '&付款金额=' + num2 + '&付款日期=' + num3
    }
  })
}
// 删除
export function handleDelete2(num) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '2',
      name: '车间生产管理工艺_外协付款管理_删除数据',
      param: '外协付款流水号=' + num
    }
  })
}
