diff --git a/js/car_basic/child/contract_supplier_detail.js b/js/car_basic/child/contract_supplier_detail.js index f6b3c8f..9688dfd 100644 --- a/js/car_basic/child/contract_supplier_detail.js +++ b/js/car_basic/child/contract_supplier_detail.js @@ -1,9 +1,11 @@ -let objParam = JSON.parse(decodeURIComponent(getUrlParam('obj'))); - +let objParam ; +//let objParam = JSON.parse(decodeURIComponent(getUrlParam('obj'))); let layer, element; layui.use(["layer", 'element'], function () { layer = layui.layer; element = layui.element; + const obj = window.contractObj || {}; + objParam= JSON.parse(obj); // tab 切换事件 element.on('tab(demo-filter-tab)', function (data) { let value = $(this).attr('value'); @@ -12,6 +14,7 @@ layui.use(["layer", 'element'], function () { let supList = objParam.supList; getSupplierList(supList); }); + // 厂家列表 function getSupplierList(list) { let dataList = []; diff --git a/js/car_basic/child/framework_contract_detail.js b/js/car_basic/child/framework_contract_detail.js index 22d3354..48df1ef 100644 --- a/js/car_basic/child/framework_contract_detail.js +++ b/js/car_basic/child/framework_contract_detail.js @@ -1,11 +1,10 @@ let objParam, objParam2 = null; let form, table, upload, tableIns, layer, element; let pageNum = 1; - +let nextObjParam; function setParams(params) { objParam = JSON.parse(params); console.log(objParam); - $('#code').html(objParam.code + '' + setContractStatus()); $('#titleName').html(objParam.name); layui.use(["form", "table", 'upload', 'layer', 'element'], function () { @@ -23,13 +22,19 @@ function setParams(params) { $.each(obj.child, function (index, item) { item.child = []; }) - $('#indexIframe').attr('src', 'contract_supplier_detail.html?obj=' + encodeURIComponent(JSON.stringify(obj))); + nextObjParam=JSON.stringify(obj); + $('#indexIframe').attr('src', 'contract_supplier_detail.html'); + //$('#indexIframe').attr('src', 'contract_supplier_detail.html?obj=' + encodeURIComponent(JSON.stringify(obj))); } }) getCarContractDetail(); }); } - +// 等待 iframe 加载完成后传递数据 +$('#indexIframe').on('load', function() { + // 直接给子页面的 window 对象赋值 + this.contentWindow.contractObj = nextObjParam; +}); function setContractStatus() { if (objParam.status === '已生效') { return "" + "生效中"; @@ -70,14 +75,19 @@ function getCarContractDetail() { $.each(obj.supList, function (index, item) { item.carList = []; }) - $('#indexIframe2').attr('src', 'contract_supplier_detail.html?obj=' + encodeURIComponent(JSON.stringify(obj))); + nextObjParam=JSON.stringify(obj); + $('#indexIframe2').attr('src', 'contract_supplier_detail.html') + // $('#indexIframe2').attr('src', 'contract_supplier_detail.html?obj=' + encodeURIComponent(JSON.stringify(obj))); } else if (obj.type === 2) { $('#crane').removeAttr('style'); initTable(); } } } - +$('#indexIframe2').on('load', function() { + // 直接给子页面的 window 对象赋值 + this.contentWindow.contractObj = nextObjParam; +}); // 厂家信息赋值 function setCjTable(supList) { $('#cj-table tbody tr:not(:first)').remove(); diff --git a/page/car_application_audit/child/car_audit_detail.html b/page/car_application_audit/child/car_audit_detail.html index 2880460..03295e4 100644 --- a/page/car_application_audit/child/car_audit_detail.html +++ b/page/car_application_audit/child/car_audit_detail.html @@ -186,6 +186,7 @@ +