import request from '../../../../utils/request'

//应急物资

//应急物资 操作记录
export function OrderPagedOperate(params) {
	return new Promise((resolve, reject) => {
		request.post("/CM/MaterialOperateRecord/OrderPaged", params).then((result) => {
			if (result.IsSuccessful) {
				resolve(result);
			}
		}).catch((error) => {
			reject(error)
		})
	})
}

// 操作记录 单查看
export function GetOperate(params) {
	return new Promise((resolve, reject) => {
		request.post("/CM/MaterialOperateRecord/Get", params).then((result) => {
			if (result.IsSuccessful) {
				resolve(result);
			}
		}).catch((error) => {
			reject(error)
		})
	})
}

// 盘存查看
export function GetInventory(params) {
	return new Promise((resolve, reject) => {
		request.post("/CM/CMMaterialOperateRecord/GetInventory", params).then((result) => {
			if (result.IsSuccessful) {
				resolve(result);
			}
		}).catch((error) => {
			reject(error)
		})
	})
}
//  盘存操作
export function FullUpdateInventory(params) {
	return new Promise((resolve, reject) => {
		request.post("/CM/CMMaterialOperateRecord/FullUpdateInventory", params).then((result) => {
			if (result.IsSuccessful) {
				resolve(result);
			}
		}).catch((error) => {
			reject(error)
		})
	})
}

//  应急物资库列表 
export function OrderPagedMaterialLibrary(params) {
	return new Promise((resolve, reject) => {
		request.post("/CM/MaterialLibrary/OrderPaged", params).then((result) => {
			if (result.IsSuccessful) {
				resolve(result);
			}
		}).catch((error) => {
			reject(error)
		})
	})
}

//  应急物资类型
export function OrderPagedType(params) {
	return new Promise((resolve, reject) => {
		request.post("/CM/MaterialType/OrderPaged", params).then((result) => {
			if (result.IsSuccessful) {
				resolve(result);
			}
		}).catch((error) => {
			reject(error)
		})
	})
}

//  应急物资 编辑查看
export function GetLibrary(params) {
	return new Promise((resolve, reject) => {
		request.post("/CM/MaterialLibrary/Get", params).then((result) => {
			if (result.IsSuccessful) {
				resolve(result);
			}
		}).catch((error) => {
			reject(error)
		})
	})
}

//  应急物资 操作 查看
export function GetPer(params) {
	return new Promise((resolve, reject) => {
		request.post("/CM/CMMaterialOperateRecord/GetPer", params).then((result) => {
			if (result.IsSuccessful) {
				resolve(result);
			}
		}).catch((error) => {
			reject(error)
		})
	})
}

//  应急物资 借出归还
export function FullUpdatePer(params) {
	return new Promise((resolve, reject) => {
		request.post("/CM/CMMaterialOperateRecord/FullUpdatePer", params).then((result) => {
			if (result.IsSuccessful) {
				resolve(result);
			}
		}).catch((error) => {
			reject(error)
		})
	})
}

//  应急物资 编辑
export function FullUpdateMaterialInfo(params) {
	return new Promise((resolve, reject) => {
		request.post("/CM/CMMaterialLibrary/FullUpdate", params).then((result) => {
			if (result.IsSuccessful) {
				resolve(result);
			}
		}).catch((error) => {
			reject(error)
		})
	})
}

// 借出单归还    CM046  相对
export function FullUpdateReturnApp(params) {
	return new Promise((resolve, reject) => {
		request.post("/CM/CMMaterialOperateRecord/FullUpdateReturnApp", params).then((result) => {
			if (result.IsSuccessful) {
				resolve(result);
			}
		}).catch((error) => {
			reject(error)
		})
	})
}
