/**
 * 销售机会
 * 
 * @link      http://www.u-bo.com
 * @copyright 南京友博网络科技有限公司 
 * @license   http://www.u-bo.com/license/ 
 * 
 * @author Strief http://blog.u-bo.com
 * @since 0.1
 */
jQuery(function ($) {

	/**********选择联系人操作**********/
	$(document).on('focus', ".contacter", function () {
		curDiv = $(this).closest('td').find('.error');
		curDiv.text('');
		$(this).removeAttr('readonly');
		//若没有选择客户则不允许选择联系人
		if ($('#customer-no').val() != '') {
			var dataUrl = $(this).attr('old-url') + "&customer_no=" + $('#customer-no').val();
			$(this).attr('data-url', dataUrl);
			//selectDialog($(this), singleCallback);
			
			//var url = $(this).data('url');
			var title = $(this).data('title');
			var hiddenId = $(this).data('hiddenId');
			var width = $(this).data('width');
			var height = $(this).data('height');
			width = width || 700;
			height = height || 400;
			art.dialog.data('inputObj', $(this));
			art.dialog.data('hiddenObj', $("#" + hiddenId));
			art.dialog.open(dataUrl, {
				id: 'select-dialog',
				title: title,
				lock: true,
				width: width,
				height: height,
				//ok: okCallback,
				cancel: true
			});
		} else {
			curDiv.text("请先选择客户！");
			$(this).attr('readonly', 'true');
		}
	});
});

/*function linkSelectCallback(input, value) {
	var dataUrl = $('.contacter').attr('old-url') + "&customer_no=" + value;
	$('.contacter').attr('data-url', dataUrl);
}*/