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

export function getNotice(params) {
	return new Promise((resolve, reject) => {
		request.post("/BS/BSSafeCheck/GetCheckInfoBS034", params).then((result) => {
			console.log('org list app', result)
			if (result.IsSuccessful) {
				resolve(result.Data);
			}
		}).catch((error) => {
			reject(error)
		})
	})
}

export function sureCheck(params) {
	return new Promise((resolve, reject) => {
		request.post("/BS/BSSafeCheck/sendCheck", params).then((result) => {
			// console.log('org list app', result)
			if (result.IsSuccessful) {
				resolve(result.Data);
			}
		}).catch((error) => {
			reject(error)
		})
	})
}

//检查任务
export function orderPage(params) {
	return new Promise((resolve, reject) => {
		request.post("/BS/SafeCheck/OrderPaged", params).then((result) => {
			// console.log('org list app', result)
			if (result.IsSuccessful) {
				resolve(result);
			}
		}).catch((error) => {
			reject(error)
		})
	})
}

// 审批同意
export function handlePassAudit(params, url) {
	return new Promise((resolve, reject) => {
		request.post("/" + url, params).then((result) => {
			if (result.IsSuccessful) {
				resolve(result);
			}
		}).catch((error) => {
			reject(error)
		})
	})
}

// 审批驳回
export function handleRejestAudit(params, url) {
	return new Promise((resolve, reject) => {
		request.post("/" + url, params).then((result) => {
			if (result.IsSuccessful) {
				resolve(result);
			}
		}).catch((error) => {
			reject(error)
		})
	})
}


// 审批同意 执行回调
export function handlePassAuditCallBack(url) {
	return new Promise((resolve, reject) => {
		request.get("/" + url, null).then((result) => {
			if (result.IsSuccessful) {
				resolve(result);
			}
		}).catch((error) => {
			reject(error)
		})
	})
}

