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 searchTable1(pageCurrent, pageSize, num1, num3, num5, num6, num7, num8, num9, num10, num11, num12) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '合同信息管理_合同信息_制造部_查询_新',
      param: '合同ID=' + num1 + '=int&项目流水号_check=' + num3 + '=int&开始日期_check=' + num5 + '=int&结束日期_check=' + num6 + '=int&开始日期=' + num7 + '=date&结束日期=' + num8 + '=date&机床型号_check=' + num9 + '=int&机床型号=' + num10 + '=string&合同编号_check=' + num11 + '=int&合同编号=' + num12 + '=string'
    }
  })
}
export function selectMachine(code) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: 'PDM_机床名称_查询数据_通过项目流水号',
      param: '项目流水号=' + code
    }
  })
}
export function addList() {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '2',
      name: '基础表_合同信息表_制造部_增加数据',
      param: '项目名称=' + arguments[0] + '&备注=' + arguments[1] + '&合同签订日期=' + arguments[2] + '&自家创建人员编号=' + arguments[3]
    }
  })
}
export function editchar() {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '2',
      name: '合同信息管理_合同信息_制造部_编辑',
      param: '项目名称=' + arguments[0] + '&合同信息备注=' + arguments[1] + '&项目流水号=' + arguments[2] + '&合同签订日期=' + arguments[3]
    }
  })
}
export function delList(num) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '2',
      name: '合同信息管理_合同信息_删除',
      param: '合同ID=' + num + '=int'
    }
  })
}
export function submitMachine() {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '2',
      name: '创建合同_机床名称_增加数据',
      param: '项目流水号=' + arguments[0] + '&机床图号=' + arguments[1] + '&机床名称=' + arguments[2] + '&机床数量=' + arguments[3]
    }
  })
}
export function editMachine() {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '2',
      name: '创建合同_机床名称_修改数据',
      param: '机床流水号=' + arguments[0] + '&机床图号=' + arguments[1] + '&机床名称=' + arguments[2] + '&机床数量=' + arguments[3]
    }
  })
}
export function delMachine() {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '2',
      name: 'PDM_机床名称_删除数据',
      param: '机床流水号=' + arguments[0]
    }
  })
}
