diff --git a/js/demandPlan/child/delivery_all_list.js b/js/demandPlan/child/delivery_all_list.js index 58806f2..1256d28 100644 --- a/js/demandPlan/child/delivery_all_list.js +++ b/js/demandPlan/child/delivery_all_list.js @@ -1,7 +1,11 @@ let objParam = JSON.parse(decodeURIComponent(getUrlParam('obj'))); +let type = getUrlParam('type'); // type let form, table, element, tableIns, layer; let pageNum = 1; layui.use(["form", "table", 'element', 'layer'], function () { + if(type){ + objParam = JSON.parse(objParam); + } form = layui.form; table = layui.table; element = layui.element; @@ -9,6 +13,19 @@ layui.use(["form", "table", 'element', 'layer'], function () { initTable(); }); +function isJsonString(str) { + try { + JSON.parse(str); + } catch (e) { + return false; + } + return true; +} + +function isJsonObject(obj) { + return obj && typeof obj === 'object' && !Array.isArray(obj) && !isJsonString(JSON.stringify(obj)); +} + // 查询/重置 function queryTable(type) { if (type === 1) { diff --git a/js/demandPlan/child/delivery_detail_list.js b/js/demandPlan/child/delivery_detail_list.js index bf26ad5..4479394 100644 --- a/js/demandPlan/child/delivery_detail_list.js +++ b/js/demandPlan/child/delivery_detail_list.js @@ -13,7 +13,7 @@ function setParams(obj) { element.on('tab(demo-filter-tab)', function (data) { let value = $(this).attr('value'); if (value === '') { // 全部 - $('#indexIframe').attr('src', 'delivery_all_list.html?obj=' + encodeURIComponent(JSON.stringify(obj))); + $('#indexIframe').attr('src', 'delivery_all_list.html?obj=' + encodeURIComponent(JSON.stringify(obj)) + '&type=' + 1); } else if (value !== '0') { let time = $(this).attr('tiem'); $('#indexIframe').attr('src', 'delivery_batch_list.html?obj=' + encodeURIComponent(JSON.stringify(obj)) + '&id=' + value + '&time=' + time);