import request from '@/common/axiosHelper.js'
/* 获取部门用户 */
export function getUnitUser(projectid) {
  //console.warn(data);
  return request({
	url: '/common/GetUnitUser',
	method: 'get',
	params:{projectid}
  })
}
	
/* 获取部门信息 */	 
export function getUnit(projectid) {
  return request({
	url: '/common/getunit',
	method: 'get',
	params:{projectid}
  })
}

/* 根据用户代码返回所属部门 */	 
export function GetUserDepartment(usercode) {
  return request({
	url: '/common/GetUserDepartment',
	method: 'get',
	params:{usercode}
  })
}

 /* 获取项目列表 */
 export function selectProject() {
   return request({
 	url: '/common/GetProjectList',
 	method: 'get'
 	
   })
 }
 /* 显示图片或下载附件*/
 export function showImage(code) {
   return request({
 	url: '/common/ShowImg',
 	method: 'get',
	params:{code:code}
 	
   })
 }
 
 /* 获取入库类型 */
 export function getMaterialTree(classCode) {
   return request({
 	url: '/common/GetMaterialTree',
 	method: 'get',
 	params:{classCode:classCode}
   })
 }
 /* 获取材料合同 */
 export function GetContracts(projectcode,searchValue) {
   return request({
 	url: '/common/GetContracts',
 	method: 'get',
 	params:{projectcode:projectcode,searchValue:searchValue}
   })
 }
 
 /* 获取供应商名称 */
 export function getSupplierNameAndType(supplierCode, supplierTypeCode) {
   return request({
 	url: '/common/GetSupplierNameAndType',
 	method: 'get',
 	params:{supplierCode:supplierCode,supplierTypeCode:supplierTypeCode}
   })
 }
 
 
 /* 根据项目代码获取工程合同 */
 export function GetEngineeringContracts(projectcode, searchValue) {
   return request({
 	url: '/common/GetEngineeringContracts',
 	method: 'get',
 	params:{projectcode:projectcode,searchValue:searchValue}
   })
 }
 
 /*根据合同单号获取合同实体 */
 export function GetContract(contractCode) {
   return request({
 	url: '/Common/GetContract',
 	method: 'get',
 	params:{contractCode:contractCode}
   })
 }
 
 /*根据流程名，项目编号及是否活动获取可使用的工作流程审核列表 */
 export function GetWorkFlowProcedureList(procedureName,projectCode,activity) {
   return request({
 	url: '/Common/GetWorkFlowProcedureList',
 	method: 'get',
 	params:{procedureName:procedureName,projectCode:projectCode,activity:activity}
   })
 }
 /* 工作流程审核*/
 export function WorkFlowAudit(userCode,procedureCode) {
   return request({
 	url: '/Common/WorkFlowAudit',
 	method: 'get',
 	params:{userCode:userCode,procedureCode:procedureCode}
   })
 }
 
 /* 流程审核保存*/
 export function WorkFlowSave(data) {
   return request({
 	url: '/Common/WorkFlowSave',
 	method: 'POST',
 	data:data
   })
 }
 
 
 /* 查询所有材料 */
  export function GetMaterialList(name) {
    return request({
  	url: '/Common/GetMaterialList',
  	method: 'get',
  	params:{name:name}
    })
  }