import request from '@/common/axiosHelper.js'

/* 根据项目代码和合同编码获取合同中包含的资料 */
 export function GetMaterials(projectCode, contractCode,searchValue) {
   return request({
 	url: '/MaterialInOut/GetMaterials',
 	method: 'get',
 	params:{projectCode:projectCode,contractCode:contractCode,searchValue:searchValue}
   })
 }
 
 /* 插入入库单主表和子表 */
  export function InsertMaterialIn(data) {
    return request({
  	url: '/MaterialInOut/InsertMaterialIn',
  	method: 'POST',
  	data:data
    })
  }
  
  /* 更新入库单主表和子表 */
   export function UpdateMaterialIn(data) {
     return request({
   	url: '/MaterialInOut/UpdateMaterialIn',
   	method: 'POST',
   	data:data
     })
   }
  
  /* 获取编辑出入库单的主表和子表数据 */
   export function GetMaterialInByMaterialInCode(materialInCode) {
     return request({
   	url: '/MaterialInOut/GetMaterialInByMaterialInCode',
   	method: 'get',
   	params:{materialInCode:materialInCode}
     })
   }
   
   /* 获取编辑出入库单的主表和子表数据 */
    export function getContractAndSupplier(contractCode) {
      return request({
    	url: '/MaterialInOut/GetContractAndSupplier',
    	method: 'get',
    	params:{contractCode:contractCode}
      })
    }
	
	/* 获取编辑出入库单的主表和子表数据 */
	 export function getGroupName(groupCode) {
	   return request({
	 	url: '/MaterialInOut/GetGroupName',
	 	method: 'get',
	 	params:{groupCode:groupCode}
	   })
	 }
	 
	 /* 根据项目代码获取领料列表 */
	  export function GetMaterialOuts(projectCode, searchValue) {
	    return request({
	  	url: '/MaterialInOut/GetMaterialOuts',
	  	method: 'get',
	  	params:{projectCode:projectCode,searchValue:searchValue}
	    })
	  }
	  
	  /* 根据领料单号获取领料单主表和子表数据 */
	   export function GetMaterialOutDetail(materialOutCode) {
	     return request({
	   	url: '/MaterialInOut/GetMaterialOutDetail',
	   	method: 'get',
	   	params:{materialOutCode:materialOutCode}
	     })
	   }
	   
	   /* 获取领料明细 */
	   export function GetMaterialsForOut(projectcode, contractcode) {
	     return request({
	   	url: '/MaterialInOut/GetMaterialsForOut',
	   	method: 'get',
	   	params:{projectcode:projectcode,contractcode:contractcode}
	     })
	   }