import { Common } from 'pc-component-v3';

/**
 * 工具类自动生成的API，请勿做任何修改，请勿做任何修改，请勿做任何修改（重要的事情说3遍）
 * 工具作者: 杨志杰
 *  
 */
export default {

	/**
	 * 工具类自动生成的方法
	 * 工具作者: 杨志杰
	 * 根据登记详表Id查询出所有位号 
	 */
	queryCheckOutSiteNoOrderByRegistrationOrderLineId: function(registrationOrderLineId){
		var requestUrl = "SiteNoOrderResource/queryCheckOutSiteNoOrderByRegistrationOrderLineId";
		var paramCount = 0;
		if(registrationOrderLineId != null){
			requestUrl += (paramCount > 0) ? '&' : '?';
			requestUrl += ('registrationOrderLineId=' + registrationOrderLineId);
			paramCount ++;
		}


		return new Promise((resolve, reject) => {
			$.ajax({
				url: Common.getApiURL(requestUrl),
				type: "post",
				
				dataType: "json",
				
				
				beforeSend: function(request) {
					Common.addTokenToRequest(request);
				},
				success: function(data) {
					resolve(data);
				},
				error: function(XMLHttpRequest, textStatus, errorThrown) {
					reject(XMLHttpRequest);
				}
			});
		});
	},

	/**
	 * 工具类自动生成的方法
	 * 工具作者: 杨志杰
	 * 根据登记详表Id查询出所有位号（点料） 
	 */
	querySiteNoOrderByRegistrationOrderLineId: function(registrationOrderLineId){
		var requestUrl = "SiteNoOrderResource/querySiteNoOrderByRegistrationOrderLineId";
		var paramCount = 0;
		if(registrationOrderLineId != null){
			requestUrl += (paramCount > 0) ? '&' : '?';
			requestUrl += ('registrationOrderLineId=' + registrationOrderLineId);
			paramCount ++;
		}


		return new Promise((resolve, reject) => {
			$.ajax({
				url: Common.getApiURL(requestUrl),
				type: "post",
				
				dataType: "json",
				
				
				beforeSend: function(request) {
					Common.addTokenToRequest(request);
				},
				success: function(data) {
					resolve(data);
				},
				error: function(XMLHttpRequest, textStatus, errorThrown) {
					reject(XMLHttpRequest);
				}
			});
		});
	},

	/**
	 * 工具类自动生成的方法
	 * 工具作者: 杨志杰
	 * 根据登记详表Id查询出所有位号（电装） 
	 */
	querySiteNoOrderByRegistrationOrderLineId1: function(registrationOrderLineId){
		var requestUrl = "SiteNoOrderResource/querySiteNoOrderByRegistrationOrderLineId1";
		var paramCount = 0;
		if(registrationOrderLineId != null){
			requestUrl += (paramCount > 0) ? '&' : '?';
			requestUrl += ('registrationOrderLineId=' + registrationOrderLineId);
			paramCount ++;
		}


		return new Promise((resolve, reject) => {
			$.ajax({
				url: Common.getApiURL(requestUrl),
				type: "post",
				
				dataType: "json",
				
				
				beforeSend: function(request) {
					Common.addTokenToRequest(request);
				},
				success: function(data) {
					resolve(data);
				},
				error: function(XMLHttpRequest, textStatus, errorThrown) {
					reject(XMLHttpRequest);
				}
			});
		});
	},

	/**
	 * 工具类自动生成的方法
	 * 工具作者: 杨志杰
	 * 根据领用详情id或短接详情id查询位号 
	 */
	querySiteNoOrderBySoplOrOrolId: function(stockOutPrepareLineId, otherRecipientsOrderLineId, uuid){
		var requestUrl = "SiteNoOrderResource/querySiteNoOrderBySoplOrOrolId";
		var paramCount = 0;
		if(stockOutPrepareLineId != null){
			requestUrl += (paramCount > 0) ? '&' : '?';
			requestUrl += ('stockOutPrepareLineId=' + stockOutPrepareLineId);
			paramCount ++;
		}
		if(otherRecipientsOrderLineId != null){
			requestUrl += (paramCount > 0) ? '&' : '?';
			requestUrl += ('otherRecipientsOrderLineId=' + otherRecipientsOrderLineId);
			paramCount ++;
		}
		if(uuid != null){
			requestUrl += (paramCount > 0) ? '&' : '?';
			requestUrl += ('uuid=' + uuid);
			paramCount ++;
		}


		return new Promise((resolve, reject) => {
			$.ajax({
				url: Common.getApiURL(requestUrl),
				type: "post",
				
				dataType: "json",
				
				
				beforeSend: function(request) {
					Common.addTokenToRequest(request);
				},
				success: function(data) {
					resolve(data);
				},
				error: function(XMLHttpRequest, textStatus, errorThrown) {
					reject(XMLHttpRequest);
				}
			});
		});
	},

	/**
	 * 工具类自动生成的方法
	 * 工具作者: 杨志杰
	 * 电装搜索位号信息 
	 */
	querySiteNoOrderInfoByRegistrationOrderLineId: function(registrationOrderLineId){
		var requestUrl = "SiteNoOrderResource/querySiteNoOrderInfoByRegistrationOrderLineId";
		var paramCount = 0;
		if(registrationOrderLineId != null){
			requestUrl += (paramCount > 0) ? '&' : '?';
			requestUrl += ('registrationOrderLineId=' + registrationOrderLineId);
			paramCount ++;
		}


		return new Promise((resolve, reject) => {
			$.ajax({
				url: Common.getApiURL(requestUrl),
				type: "post",
				
				dataType: "json",
				
				
				beforeSend: function(request) {
					Common.addTokenToRequest(request);
				},
				success: function(data) {
					resolve(data);
				},
				error: function(XMLHttpRequest, textStatus, errorThrown) {
					reject(XMLHttpRequest);
				}
			});
		});
	},

	/**
	 * 工具类自动生成的方法
	 * 工具作者: 杨志杰
	 * 点击确定保存登记位号表及更新日志表 
	 */
	saveAllRegistration: function(siteNoOrderDto1List){
		var requestUrl = "SiteNoOrderResource/saveAllRegistration";


		return new Promise((resolve, reject) => {
			$.ajax({
				url: Common.getApiURL(requestUrl),
				type: "post",
				contentType: "application/json",
				
				dataType: "json",
				data: JSON.stringify(siteNoOrderDto1List),
				
				beforeSend: function(request) {
					Common.addTokenToRequest(request);
				},
				success: function(data) {
					resolve(data);
				},
				error: function(XMLHttpRequest, textStatus, errorThrown) {
					reject(XMLHttpRequest);
				}
			});
		});
	},

	/**
	 * 工具类自动生成的方法
	 * 工具作者: 杨志杰
	 * 检验保存位号表及更新日志表 
	 */
	saveCheckOutSiteNoOrderBySiteNoOrderDto: function(siteNoOrderDto1){
		var requestUrl = "SiteNoOrderResource/saveCheckOutSiteNoOrderBySiteNoOrderDto";


		return new Promise((resolve, reject) => {
			$.ajax({
				url: Common.getApiURL(requestUrl),
				type: "post",
				contentType: "application/json",
				
				dataType: "json",
				data: JSON.stringify(siteNoOrderDto1),
				
				beforeSend: function(request) {
					Common.addTokenToRequest(request);
				},
				success: function(data) {
					resolve(data);
				},
				error: function(XMLHttpRequest, textStatus, errorThrown) {
					reject(XMLHttpRequest);
				}
			});
		});
	},

	/**
	 * 工具类自动生成的方法
	 * 工具作者: 杨志杰
	 * 保存位号表及更新日志表(电装) 
	 */
	saveSiteNoOrderBySiteNoOrderDto: function(siteNoOrderDto1){
		var requestUrl = "SiteNoOrderResource/saveSiteNoOrderBySiteNoOrderDto";


		return new Promise((resolve, reject) => {
			$.ajax({
				url: Common.getApiURL(requestUrl),
				type: "post",
				contentType: "application/json",
				
				dataType: "json",
				data: JSON.stringify(siteNoOrderDto1),
				
				beforeSend: function(request) {
					Common.addTokenToRequest(request);
				},
				success: function(data) {
					resolve(data);
				},
				error: function(XMLHttpRequest, textStatus, errorThrown) {
					reject(XMLHttpRequest);
				}
			});
		});
	},

	/**
	 * 工具类自动生成的方法
	 * 工具作者: 杨志杰
	 * 保存位号表及更新日志表 
	 */
	saveSiteNoOrderBySiteNoOrderDto1: function(siteNoOrderDto1){
		var requestUrl = "SiteNoOrderResource/saveSiteNoOrderBySiteNoOrderDto1";


		return new Promise((resolve, reject) => {
			$.ajax({
				url: Common.getApiURL(requestUrl),
				type: "post",
				contentType: "application/json",
				
				dataType: "json",
				data: JSON.stringify(siteNoOrderDto1),
				
				beforeSend: function(request) {
					Common.addTokenToRequest(request);
				},
				success: function(data) {
					resolve(data);
				},
				error: function(XMLHttpRequest, textStatus, errorThrown) {
					reject(XMLHttpRequest);
				}
			});
		});
	},

	/**
	 * 工具类自动生成的方法
	 * 工具作者: 杨志杰
	 *  
	 */
	updateSiteNoOrderBySiteNoOrderDto1: function(siteNoOrderDto1){
		var requestUrl = "SiteNoOrderResource/updateSiteNoOrderBySiteNoOrderDto1";


		return new Promise((resolve, reject) => {
			$.ajax({
				url: Common.getApiURL(requestUrl),
				type: "post",
				contentType: "application/json",
				
				dataType: "json",
				data: JSON.stringify(siteNoOrderDto1),
				
				beforeSend: function(request) {
					Common.addTokenToRequest(request);
				},
				success: function(data) {
					resolve(data);
				},
				error: function(XMLHttpRequest, textStatus, errorThrown) {
					reject(XMLHttpRequest);
				}
			});
		});
	}
}
