import {
	Base
} from '../../static/util/base.js'
class SampleList extends Base {
	constructor() {
		super();
	}

	getAhSampleSheet(item,callBack) {
		var params = {
			url: '/ah/ahSampleSheet/list?pageNum=1&pageSize=100&zoneId='+item.zoneId+
			'&sampleId='+item.sampleId+'&taskId='+item.taskId+'&checkId='+item.checkId,
			sCallBack: function(res) {
				callBack && callBack(res)
			}
		}
		this.serviceRequest(params);
	}

	/**
	 * 上报全部抽样单
	 * @param taskId
	 * @param zoneId
	 * @param checkId
	 * @param sampleId
	 * @param callBack
	 */
	upBatchSampleSheet({taskId,zoneId,checkId,sampleId},callBack){
		var params = {
			url: '/ah/ahSampleSheet/upBatchSampleSheet?zoneId='+zoneId+
				'&sampleId='+sampleId+'&taskId='+taskId+'&checkId='+checkId,
			type:"POST",
			sCallBack: function(res) {
				callBack && callBack(res.data)
			}
		}
		this.serviceRequest(params);
	}

	/**
	 * 删除抽样单
	 * @param id
	 * @param callBack
	 */
	deleteAhSampleSheet(id,callBack){
		const params = {
			url: '/ah/ahSampleSheet/'+id,
			type:"delete",
			sCallBack: function(res) {
				callBack && callBack(res.data)
			}
		}
		this.serviceRequest(params);
	}

	/**
	 * 获取抽样单下载地址
	 * @param id
	 * @param callBack
	 */
exportSampleSheetPdf(id,callBack){
		const params = {
			url: '/ah/ahSampleSheet/exportSampleSheetPdf?sampleSheetId='+id,
			sCallBack: function(res) {
				callBack && callBack(res.data)
			}
		}
		this.serviceRequest(params);
	}




}

const _sampleList = new SampleList();
export {
	_sampleList
}