From 2e893208fb5856a23faf1b4889da35ec240687db Mon Sep 17 00:00:00 2001 From: Renpc-kilig <308442850@qq.com> Date: Thu, 7 Dec 2023 14:45:06 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E6=94=B9=20=20--renpc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/templates/house/list-popu.html | 26 +++++++++++++++---- .../resources/templates/house/update.html | 5 ++++ 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/src/main/resources/templates/house/list-popu.html b/src/main/resources/templates/house/list-popu.html index b09f9d5..72515c6 100644 --- a/src/main/resources/templates/house/list-popu.html +++ b/src/main/resources/templates/house/list-popu.html @@ -35,7 +35,7 @@
- @@ -83,6 +83,7 @@ var resizeTimeout = null; var tableUrl = 'api/populationinfo/listpage'; top.dialog.dialogData.popuData = {}; + var checkData = null; // 初始化证件类型下拉选择 function initIdcardTypeSelect() { @@ -181,11 +182,16 @@ 'count': data.total, 'data': data.rows }; + }, + done: function(res, curr, count){ + $('#search').removeAttr("disabled"); + $('#search').removeClass("layui-btn-disabled"); } }); } // 重载表格 function reloadTable(currentPage) { + checkData = null; table.reload('dataTable', { url: top.restAjax.path(tableUrl, []), where: { @@ -223,13 +229,18 @@ }); // 事件 - 搜索 $(document).on('click', '#search', function() { + $(this).attr("disabled", "disabled"); + $(this).addClass("layui-btn-disabled"); reloadTable(1); }); + + table.on('radio(dataTable)', function(obj){ + checkData = obj.data; + }); + // 事件 - 增删改 table.on('toolbar(dataTable)', function(obj) { var layEvent = obj.event; - var checkStatus = table.checkStatus('dataTable'); - var checkDatas = checkStatus.data; if(layEvent === 'saveEvent') { top.layer.open({ type: 2, @@ -244,11 +255,16 @@ } }); }else if(layEvent === 'determineEvent') { + if(!checkData) { + top.dialog.msg('必须勾选数据'); + return false; + } // 因为列表是脱敏数据 , 所以需要此处需要再次请求 - var data = checkDatas[0]; + var data = checkData; + console.log(data) var loadLayerIndex; top.restAjax.get(top.restAjax.path('api/populationinfo/get/{populationInfoId}', [data.populationInfoId]), {}, null, function(code, data) { - top.dialog.dialogData.popuData = checkDatas[0]; + top.dialog.dialogData.popuData = checkData; var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引 parent.layer.close(index); }, function(code, data) { diff --git a/src/main/resources/templates/house/update.html b/src/main/resources/templates/house/update.html index 9bb1cd8..dd8216c 100644 --- a/src/main/resources/templates/house/update.html +++ b/src/main/resources/templates/house/update.html @@ -515,6 +515,11 @@ $('#documentNum').val(popuData.idcard); $('#phone').val(popuData.phone); + var selectObj = {}; + selectObj['homeowner'] = popuData.name; + selectObj['documentId'] = 'b7d74045-d984-4822-b0f3-711b15b933ca'; + selectObj['documentNum'] = popuData.idcard; + selectObj['phone'] = popuData.phone; form.val('dataForm', selectObj); } });