layer的一种用法,自己画出弹出框样式

本文介绍了一个用于导出报表类型的JavaScript弹出窗口实现方法。该弹窗提供了两种子物料类型选择及两种导出格式(Excel和PDF)供用户选择,并通过调用特定API完成报表导出。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

/**导出报表类型选择  弹出框
	*/
	function selectExportType(){
		var template = '<div style="padding:50px;">';
			template +=	'<div class="layui-input-block"><input type="radio" id="subMaterial" name="subMaterial"  value="1" > <%=title_hasSubMaterialType %>  ';
			template +=	'<input type="radio" id="subMaterial" name="subMaterial" value="2" checked> <%=title_notHasSubMaterialType %>';
			template +=	'</div>';
			template +=	'<br>';
			template +=	'<div class="layui-input-block"><input type="radio" id="excelType" name="excelType" value="excel" > <%=title_excelType %>  ';
			template +=	'<input type="radio" id="excelType"  name="excelType" value="PDF" checked> <%=title_PDFType %>';
			template +=	'</div>';
			template +=	'<br>';
			template +=	'<br>';
			template +=	'<div class="layui-input-block">';
			template +=	'<button class="layui-btn" lay-submit lay-filter="formDemo" οnclick="selectExportTypeConfirm();"><%=button_confirm%></button>';
			template +=	'</div>';
			template +=	'</div>';
		
		layer.open({
			  type: 1 //Page层类型
			  ,area: ['500px', '300px']
			  ,title: '<%=title_selectExportType %>'
			  ,closeBtn: 0 //不显示关闭按钮
			  ,shadeClose: true
			  ,shade: 0.6 //遮罩透明度
			  ,content: template
			});  
	}

	/**导出报表确定方法
	*/
	function selectExportTypeConfirm(){
		var bomMasterId = $("#hidden_bomMasterId").val();
		var subMaterial = $("input[name='subMaterial']:checked").val();
		var excelType = $("input[name='excelType']:checked").val();
		window.open(contentPath + '/productData/exportBOMList.do?bomMasterId=' + bomMasterId + '&exportType=' + excelType + '&subMaterial=' + subMaterial);
		layer.closeAll();
	}
	

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值