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

// 项目
export function getProject(role, personnel) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: 'PDM_项目名称_综合查询',
      param: '角色编号=' + role + '&人员编号=' + personnel
    }
  })
}
// 机床
export function getToolNum(check, num) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: 'PDM_项目名称_查询数据_是否显示_初始化',
      param: '项目流水号_check=' + check + '=int&项目流水号=' + num
    }
  })
}
export function searchTotal(num) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '合同管理_项目档案_查询数据',
      param: '机床流水号=' + num
    }
  })
}
export function updateTotal(num, projecValue, projectName, projectNumber, projectTime, delivery, deliverGoods, customerName, customerAddress, customerPeople, projectManager, ManagerMarketing, ProjectDesign, Installation, Mechanical, Electrical, IsItNecessary, RandomReturn, DoNotReturn, SpecimenTime, SpecimenNumber, IsItQualified, PreAcceptanceDate, CustomerPersonnel, OurStaff, PreAcceptanceConclusion, FinalAcceptanceDate, FinalCustomerPersonnel, FinalOurStaff, FinalAcceptanceConclusion, Tabulation, approval, approval1, TabulationDate) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '2',
      name: '合同管理_项目档案_编辑数据',
      param: '机床流水号=' + num + '&项目编号=' + projecValue + '&项目名称=' + projectName + '&数量=' + projectNumber + '&合同签订日期=' + projectTime + '&合同交货期=' + delivery + '&发货日期=' + deliverGoods + '&客户名称=' + customerName + '&客户地址=' + customerAddress + '&客户联系人=' + customerPeople + '&项目经理=' + projectManager + '&营销经理=' + ManagerMarketing + '&项目主设计=' + ProjectDesign + '&安装总负责=' + Installation + '&机械主调试=' + Mechanical + '&电气主调试=' + Electrical + '&是否需要=' + IsItNecessary + '&随机返回=' + RandomReturn + '&不返回=' + DoNotReturn + '&试件提供日期=' + SpecimenTime + '&试件数量=' + SpecimenNumber + '&是否合格=' + IsItQualified + '&预验收日期=' + PreAcceptanceDate + '&预验收客户人员=' + CustomerPersonnel + '&预验收我司人员=' + OurStaff + '&预验收结论=' + PreAcceptanceConclusion + '&终验收日期=' + FinalAcceptanceDate + '&终验收客户人员=' + FinalCustomerPersonnel + '&终验收我司人员=' + FinalOurStaff + '&验收结论=' + FinalAcceptanceConclusion + '&制表=' + Tabulation + '&批准=' + approval + '&批准1=' + approval1 + '&日期=' + TabulationDate
    }
  })
}
export function searchTable(num) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '合同管理_项目档案_预验收情况_查询数据',
      param: '机床流水号=' + num
    }
  })
}
export function insertTable(num) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '2',
      name: '合同管理_项目档案_预验收情况_增加数据',
      param: '机床流水号=' + num
    }
  })
}
export function updateTable(num, problem, solve, people, handle, number) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '2',
      name: '合同管理_项目档案_预验收情况_编辑数据',
      param: 'ID=' + num + '&问题描述=' + problem + '&解决办法=' + solve + '&负责人=' + people + '&处理结果=' + handle + '&序号=' + number
    }
  })
}
export function searchTable1(num) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '1',
      name: '合同管理_项目档案_安装调试情况_查询数据',
      param: '机床流水号=' + num
    }
  })
}
export function insertTable1(num) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '2',
      name: '合同管理_项目档案_安装调试情况_增加数据',
      param: '机床流水号=' + num
    }
  })
}
export function updateTable1(num, time, problem, solve, people, handle, number) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '2',
      name: '合同管理_项目档案_安装调试情况_编辑数据',
      param: 'ID=' + num + '&问题提出日期=' + time + '&问题描述=' + problem + '&解决办法=' + solve + '&负责人=' + people + '&处理结果=' + handle + '&序号=' + number
    }
  })
}
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 insertTable2(num) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '2',
      name: '合同管理_项目档案_终验收情况_增加数据',
      param: '机床流水号=' + num
    }
  })
}
export function updateTable2(num, problem, solve, people, handle, number) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '2',
      name: '合同管理_项目档案_终验收情况_编辑数据',
      param: 'ID=' + num + '&存在问题=' + problem + '&解决办法=' + solve + '&负责人=' + people + '&处理结果=' + handle + '&序号=' + number
    }
  })
}
export function deleteTable(num) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '2',
      name: '合同管理_项目档案_预验收情况_删除数据',
      param: 'ID=' + num
    }
  })
}
export function deleteTable1(num) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '2',
      name: '合同管理_项目档案_安装调试情况_删除数据',
      param: 'ID=' + num
    }
  })
}
export function deleteTable2(num) {
  return request({
    url: '',
    method: 'post',
    data: {
      UserID: state.state.user.id,
      ModularID: router.currentRoute.path,
      type: '2',
      name: '合同管理_项目档案_终验收情况_删除数据',
      param: 'ID=' + num
    }
  })
}
