主要是因为修改功能,原来页面填写数据如图
其中点击填写明细弹出框
填写完毕后点击确认返回,同事这里因为她是存的多表,所以点击确认就直接保存数据了,改的这个功能原本保存是整体保存,我就不想改原来的逻辑,只想把填写的值带回去用隐藏控件存一下,到时候按照原来的逻辑整体存,所以没办法参考她的,最后搜索很多,解决了问题,具体代码如下:
<>强父页面:强>
& lt; div类="行"比; & lt; div类=癱ol-md-6”比; & lt; div class="形式的班级PadTB10”比; & lt;标签类=癓abelW150”比; 经费来源总计(元)& lt;/label> & lt;输入类型=拔谋尽皉eadonly=皉eadonly”类=氨淼タ丶d=" AmountSum " name=" AmountSum "占位符=疤钚蠢丛疵飨? value=" https://www.yisu.com/zixun/@pro.AmountSum "/比; & lt;输入类型="按钮" value=" https://www.yisu.com/zixun/填写来源明细”/比; & lt;输入类型=耙亍眓ame=" CenterAmount " id=" CenterAmount " value=" https://www.yisu.com/zixun/@pro.CenterAmount "/比; & lt;输入类型=耙亍眓ame=" CityAmount " id=" CityAmount " value=" https://www.yisu.com/zixun/@pro.CityAmount "/比; & lt;输入类型=耙亍眓ame=" DisAmount " id=" DisAmount " value=" https://www.yisu.com/zixun/@pro.DisAmount "/比; & lt;输入类型=耙亍眓ame=" StreetAmount " id=" StreetAmount " value=" https://www.yisu.com/zixun/@pro.StreetAmount "/比; & lt;输入类型=耙亍眓ame=" OtherAmount " id=" OtherAmount " value=" https://www.yisu.com/zixun/@pro.OtherAmount "/比; & lt;/div> & lt;/div> & lt;/div>
<强> js: 强>
//弹出经费来源明细 函数ShowAmountDetail () { var指数=layer.open ({ 类型:2 标题:“填写经费明细”, shadeClose:假的, 皮肤:“layui-layer-rim”, 面积:“50%”,“50%”, 最大最小:没错, 内容:'/项目/AmountDetail& # 63; ProjectCode=?“@ProjectCode”, btn:['确定”、“关闭”), 是的:函数(指数、layero) { 调试器; var=层。getChildFrame(“身体”,指数);//得到iframe页的身体内容 var CenterAmount=body.find (“# CenterAmount”) .val (); var CityAmount=body.find (“# CityAmount”) .val (); var DisAmount=body.find (“# DisAmount”) .val (); var StreetAmount=body.find (“# StreetAmount”) .val (); var OtherAmount=body.find (“# OtherAmount”) .val (); 如果(CenterAmount==null | | CenterAmount==" ") CenterAmount=0; 如果(CityAmount==null | | CityAmount==" ") CityAmount=0; 如果(DisAmount==null | | DisAmount==" ") DisAmount=0; 如果(StreetAmount==null | | StreetAmount==" ") StreetAmount=0; 如果(OtherAmount==null | | OtherAmount==" ") OtherAmount=0; 数量金额=(CenterAmount) +数量(CityAmount) +数量(DisAmount) +数量(StreetAmount) +数量(OtherAmount); . getelementbyid (“CenterAmount”)。值=https://www.yisu.com/zixun/CenterAmount; . getelementbyid (“CityAmount”)。值=https://www.yisu.com/zixun/CityAmount; . getelementbyid (“DisAmount”)。值=https://www.yisu.com/zixun/DisAmount; . getelementbyid (“StreetAmount”)。值=https://www.yisu.com/zixun/StreetAmount; . getelementbyid (“OtherAmount”)。值=https://www.yisu.com/zixun/OtherAmount; . getelementbyid (“AmountSum”)。值=https://www.yisu.com/zixun/sum;//最后关闭弹出层 layer.close(指数); }, 取消:函数(){//右上角关闭回调 } });//layer.full(指数); } >之前<强>子页面:强>
& lt; !DOCTYPE html> & lt; html> & lt; head> & lt; meta name=" viewport "内容=翱矶?设备宽度”/比; & lt; title> AmountDetail & lt;/head> & lt; body> & lt; div> & lt;表类=氨韙able-bordered”比; & lt; tr> & lt; td行宽=?”的在经济来源明细& lt;/td> & lt; td>中央拨款(元)& lt;/td> & lt; td> & lt;输入id=" CenterAmount " class="表单控件" name=癈enterAmount”类型=拔谋尽?比; & lt;/td> & lt;/tr> & lt; tr> & lt; td>市级专款(元)& lt;/td> & lt; td> & lt;输入id=" CityAmount " class="表单控件" name=癈ityAmount”类型=拔谋尽?比; & lt;/td> & lt;/tr> & lt; tr> & lt; td>区级资金(元)& lt;/td> & lt; td> & lt;输入id=" DisAmount " class="表单控件" name=癉isAmount”类型=拔谋尽?比; & lt;/td> & lt;/tr> & lt; tr> & lt; td>街镇配套(元)& lt;/td> & lt; td> & lt;输入id=癝treetAmount”类=氨淼タ丶泵?类型=拔谋尽薄癝treetAmount/比; & lt;/td> & lt;/tr> & lt; tr> & lt; td>其他(元)& lt;/td> & lt; td> & lt;输入id=" OtherAmount " class="表单控件" name=癘therAmount”类型=拔谋尽?比; & lt;/td> & lt;/tr> & lt;/table> & lt;/div> & lt;/body> & lt;/html>层父页获取弹出层输入框里面的值方法