From 31b6ea7f05446a68b800fdf860f7a7713c5e8b5b Mon Sep 17 00:00:00 2001 From: Renpc-kilig <308442850@qq.com> Date: Wed, 25 Nov 2020 16:57:30 +0800 Subject: [PATCH] =?UTF-8?q?select=E6=A1=86=E7=B1=BB=E5=9E=8B=E7=9A=84?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E4=BF=9D=E5=AD=98=E4=B8=BA=E6=B1=89=E5=AD=97?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/censusmsg/censusmsg-mapper.xml | 9 +- .../mapper/homeperson/homeperson-mapper.xml | 2 - .../keyteenagers/keyteenagers-mapper.xml | 2 - .../overseaspersonnel-mapper.xml | 2 - .../route/censusmsg/save-censusmsg.html | 16 +++- .../route/censusmsg/update-censusmsg.html | 36 ++++++- .../save-floatingpopulation.html | 13 ++- .../update-floatingpopulation.html | 33 ++++++- .../route/homeperson/save-homeperson.html | 15 ++- .../route/homeperson/update-homeperson.html | 35 ++++++- .../route/keyteenagers/save-keyteenagers.html | 16 +++- .../keyteenagers/update-keyteenagers.html | 35 ++++++- .../save-overseaspersonnel.html | 20 +++- .../update-overseaspersonnel.html | 93 +++++++------------ .../rentalhousing/save-rentalhousing.html | 15 ++- .../rentalhousing/update-rentalhousing.html | 34 ++++++- 16 files changed, 281 insertions(+), 95 deletions(-) diff --git a/src/main/resources/mybatis/mapper/censusmsg/censusmsg-mapper.xml b/src/main/resources/mybatis/mapper/censusmsg/censusmsg-mapper.xml index 1cce3bb..06f7486 100644 --- a/src/main/resources/mybatis/mapper/censusmsg/censusmsg-mapper.xml +++ b/src/main/resources/mybatis/mapper/censusmsg/censusmsg-mapper.xml @@ -12,7 +12,7 @@ - + @@ -153,7 +153,6 @@ t1.census_number, t1.id_card_of_householder, t1.relationship_with_householder, - dt1.dictionary_name relationship_with_householder_dictionary_name, t1.people_same_census, t1.census_msg_id, t1.base_id, @@ -165,12 +164,6 @@ t2.current_residence FROM gen_census_msg t1 - LEFT JOIN - data_dictionary dt1 - ON - dt1.dictionary_id = t1.relationship_with_householder - AND - dt1.is_delete = 0 LEFT JOIN gen_base_population_info t2 ON t1.base_id = t2.base_population_info_id AND t2.is_delete = 0 WHERE t1.is_delete = 0 diff --git a/src/main/resources/mybatis/mapper/homeperson/homeperson-mapper.xml b/src/main/resources/mybatis/mapper/homeperson/homeperson-mapper.xml index e6d9867..e1c885a 100644 --- a/src/main/resources/mybatis/mapper/homeperson/homeperson-mapper.xml +++ b/src/main/resources/mybatis/mapper/homeperson/homeperson-mapper.xml @@ -212,7 +212,6 @@ t1.people_same_census, t1.leading_name, t1.home_person_id, - t2.dictionary_name AS relationship_with_home_people_name, t3.id_card_number, t3.full_name, t3.gender, @@ -221,7 +220,6 @@ t3.current_residence FROM gen_home_person t1 - LEFT JOIN data_dictionary t2 ON t1.relationship_with_home_people = t2.dictionary_id LEFT JOIN gen_base_population_info t3 ON t1.base_id = t3.base_population_info_id AND t3.is_delete = 0 WHERE t1.is_delete = 0 diff --git a/src/main/resources/mybatis/mapper/keyteenagers/keyteenagers-mapper.xml b/src/main/resources/mybatis/mapper/keyteenagers/keyteenagers-mapper.xml index 81d4a02..94744ed 100644 --- a/src/main/resources/mybatis/mapper/keyteenagers/keyteenagers-mapper.xml +++ b/src/main/resources/mybatis/mapper/keyteenagers/keyteenagers-mapper.xml @@ -212,7 +212,6 @@ t1.guardian_address, t1.guardian_phone, t1.key_teenagers_id, - dt1.dictionary_name relationship_with_guardian_name, t2.full_name, t2.gender, t2.telephone, @@ -220,7 +219,6 @@ t2.current_residence FROM gen_key_teenagers t1 - LEFT JOIN data_dictionary dt1 ON dt1.dictionary_id = t1.relationship_with_guardian AND dt1.is_delete = 0 LEFT JOIN gen_base_population_info t2 ON t1.base_id = t2.base_population_info_id AND t2.is_delete = 0 WHERE t1.is_delete = 0 diff --git a/src/main/resources/mybatis/mapper/overseaspersonnel/overseaspersonnel-mapper.xml b/src/main/resources/mybatis/mapper/overseaspersonnel/overseaspersonnel-mapper.xml index d48b55b..3b333a2 100644 --- a/src/main/resources/mybatis/mapper/overseaspersonnel/overseaspersonnel-mapper.xml +++ b/src/main/resources/mybatis/mapper/overseaspersonnel/overseaspersonnel-mapper.xml @@ -223,7 +223,6 @@ t1.to_china_purpose, t1.service_address, t1.nationality, - t2.dictionary_name AS nationality_name, t1.card_year, t1.card_number, t1.leave_date, @@ -244,7 +243,6 @@ t1.overseas_personnel_id FROM gen_overseas_personnel t1 - LEFT JOIN data_dictionary t2 ON t1.nationality = t2.dictionary_id WHERE t1.is_delete = 0 diff --git a/src/main/resources/static/route/censusmsg/save-censusmsg.html b/src/main/resources/static/route/censusmsg/save-censusmsg.html index a1ab2a6..0caa221 100644 --- a/src/main/resources/static/route/censusmsg/save-censusmsg.html +++ b/src/main/resources/static/route/censusmsg/save-censusmsg.html @@ -21,7 +21,7 @@
-
+
@@ -127,7 +127,7 @@ @@ -252,10 +252,22 @@ top.dialog.close(loadLayerIndex); }); } + initData(); + function valueFun(formData) { + $("#dataForm").find('select').each(function(){ + var value; + var selId; + value = $(this).find('option:selected').text(); + selId = $(this).attr('id'); + formData.field['' + selId] = value; + }); + } + // 提交表单 form.on('submit(submitForm)', function(formData) { + valueFun(formData); top.dialog.confirm(top.dataMessage.commit, function(index) { top.dialog.close(index); var loadLayerIndex; diff --git a/src/main/resources/static/route/censusmsg/update-censusmsg.html b/src/main/resources/static/route/censusmsg/update-censusmsg.html index 0a8e6d0..96144a3 100644 --- a/src/main/resources/static/route/censusmsg/update-censusmsg.html +++ b/src/main/resources/static/route/censusmsg/update-censusmsg.html @@ -21,7 +21,7 @@
- +
@@ -127,7 +127,7 @@ @@ -226,6 +226,24 @@ }); } + function backData(data) { + $("#dataForm").find('select').each(function(){ + var selId; + selId = $(this).attr('id'); + $('#' + selId + ' option').each(function () { + for(var key in data) { + if(key == selId) { + if ($(this).text() == data[key]) { + var val = $(this).val(); + var select = 'dd[lay-value=' + val + ']'; + $('#' + key).siblings("div.layui-form-select").find('dl').find(select).click(); + } + } + } + }); + }); + } + // 初始化内容 function initData() { $('#submitBtn').addClass("layui-btn-disabled").attr("disabled",true); @@ -239,6 +257,7 @@ form.render(null, 'dataForm'); initRelationshipWithHouseholderSelect(data['relationshipWithHouseholder']); queryBasePopulationInfo(data['idCardNumber']); + backData(data); }, function(code, data) { top.dialog.msg(data.msg); }, function() { @@ -248,9 +267,20 @@ }); } initData(); - + + function valueFun(formData) { + $("#dataForm").find('select').each(function(){ + var value; + var selId; + value = $(this).find('option:selected').text(); + selId = $(this).attr('id'); + formData.field['' + selId] = value; + }); + } + // 提交表单 form.on('submit(submitForm)', function(formData) { + valueFun(formData); top.dialog.confirm(top.dataMessage.commit, function(index) { top.dialog.close(index); var loadLayerIndex; diff --git a/src/main/resources/static/route/floatingpopulation/save-floatingpopulation.html b/src/main/resources/static/route/floatingpopulation/save-floatingpopulation.html index 2d10b6a..0523e29 100644 --- a/src/main/resources/static/route/floatingpopulation/save-floatingpopulation.html +++ b/src/main/resources/static/route/floatingpopulation/save-floatingpopulation.html @@ -21,7 +21,7 @@
- +
@@ -273,8 +273,19 @@ } initData(); + function valueFun(formData) { + $("#dataForm").find('select').each(function(){ + var value; + var selId; + value = $(this).find('option:selected').text(); + selId = $(this).attr('id'); + formData.field['' + selId] = value; + }); + } + // 提交表单 form.on('submit(submitForm)', function(formData) { + valueFun(formData); top.dialog.confirm(top.dataMessage.commit, function(index) { top.dialog.close(index); var loadLayerIndex; diff --git a/src/main/resources/static/route/floatingpopulation/update-floatingpopulation.html b/src/main/resources/static/route/floatingpopulation/update-floatingpopulation.html index 999b04d..68957c8 100644 --- a/src/main/resources/static/route/floatingpopulation/update-floatingpopulation.html +++ b/src/main/resources/static/route/floatingpopulation/update-floatingpopulation.html @@ -21,7 +21,7 @@
- +
@@ -241,6 +241,24 @@ }); } + function backData(data) { + $("#dataForm").find('select').each(function(){ + var selId; + selId = $(this).attr('id'); + $('#' + selId + ' option').each(function () { + for(var key in data) { + if(key == selId) { + if ($(this).text() == data[key]) { + var val = $(this).val(); + var select = 'dd[lay-value=' + val + ']'; + $('#' + key).siblings("div.layui-form-select").find('dl').find(select).click(); + } + } + } + }); + }); + } + // 初始化内容 function initData() { $('#submitBtn').addClass("layui-btn-disabled").attr("disabled",true); @@ -255,6 +273,7 @@ initCardExpireDateDateTime(); initRegisterDateDateTime(); queryBasePopulationInfo(data['idCardNumber']); + backData(data); }, function(code, data) { top.dialog.msg(data.msg); }, function() { @@ -263,10 +282,22 @@ top.dialog.close(loadLayerIndex); }); } + initData(); + + function valueFun(formData) { + $("#dataForm").find('select').each(function(){ + var value; + var selId; + value = $(this).find('option:selected').text(); + selId = $(this).attr('id'); + formData.field['' + selId] = value; + }); + } // 提交表单 form.on('submit(submitForm)', function(formData) { + valueFun(formData); top.dialog.confirm(top.dataMessage.commit, function(index) { top.dialog.close(index); var loadLayerIndex; diff --git a/src/main/resources/static/route/homeperson/save-homeperson.html b/src/main/resources/static/route/homeperson/save-homeperson.html index 17284eb..0af8501 100644 --- a/src/main/resources/static/route/homeperson/save-homeperson.html +++ b/src/main/resources/static/route/homeperson/save-homeperson.html @@ -21,7 +21,7 @@
- +
@@ -118,7 +118,7 @@ @@ -318,8 +318,19 @@ initData(); + function valueFun(formData) { + $("#dataForm").find('select').each(function(){ + var value; + var selId; + value = $(this).find('option:selected').text(); + selId = $(this).attr('id'); + formData.field['' + selId] = value; + }); + } + // 提交表单 form.on('submit(submitForm)', function(formData) { + valueFun(formData); top.dialog.confirm(top.dataMessage.commit, function(index) { top.dialog.close(index); var loadLayerIndex; diff --git a/src/main/resources/static/route/homeperson/update-homeperson.html b/src/main/resources/static/route/homeperson/update-homeperson.html index 7d8dc1f..6604b7f 100644 --- a/src/main/resources/static/route/homeperson/update-homeperson.html +++ b/src/main/resources/static/route/homeperson/update-homeperson.html @@ -21,7 +21,7 @@
- +
@@ -118,7 +118,7 @@ @@ -291,6 +291,24 @@ }); } + function backData(data) { + $("#dataForm").find('select').each(function(){ + var selId; + selId = $(this).attr('id'); + $('#' + selId + ' option').each(function () { + for(var key in data) { + if(key == selId) { + if ($(this).text() == data[key]) { + var val = $(this).val(); + var select = 'dd[lay-value=' + val + ']'; + $('#' + key).siblings("div.layui-form-select").find('dl').find(select).click(); + } + } + } + }); + }); + } + // 初始化内容 function initData() { $('#submitBtn').addClass("layui-btn-disabled").attr("disabled",true); @@ -304,6 +322,7 @@ form.render(null, 'dataForm'); initRelationshipWithHomePeopleSelect(data['relationshipWithHomePeople']); queryBasePopulationInfo(data['idCardNumber']); + backData(data); }, function(code, data) { top.dialog.msg(data.msg); }, function() { @@ -312,10 +331,22 @@ top.dialog.close(loadLayerIndex); }); } + initData(); + + function valueFun(formData) { + $("#dataForm").find('select').each(function(){ + var value; + var selId; + value = $(this).find('option:selected').text(); + selId = $(this).attr('id'); + formData.field['' + selId] = value; + }); + } // 提交表单 form.on('submit(submitForm)', function(formData) { + valueFun(formData); top.dialog.confirm(top.dataMessage.commit, function(index) { top.dialog.close(index); var loadLayerIndex; diff --git a/src/main/resources/static/route/keyteenagers/save-keyteenagers.html b/src/main/resources/static/route/keyteenagers/save-keyteenagers.html index dd6b343..5124321 100644 --- a/src/main/resources/static/route/keyteenagers/save-keyteenagers.html +++ b/src/main/resources/static/route/keyteenagers/save-keyteenagers.html @@ -21,7 +21,7 @@
- +
@@ -140,7 +140,7 @@ @@ -320,10 +320,22 @@ top.dialog.close(loadLayerIndex); }); } + initData(); + function valueFun(formData) { + $("#dataForm").find('select').each(function(){ + var value; + var selId; + value = $(this).find('option:selected').text(); + selId = $(this).attr('id'); + formData.field['' + selId] = value; + }); + } + // 提交表单 form.on('submit(submitForm)', function(formData) { + valueFun(formData); top.dialog.confirm(top.dataMessage.commit, function(index) { top.dialog.close(index); var loadLayerIndex; diff --git a/src/main/resources/static/route/keyteenagers/update-keyteenagers.html b/src/main/resources/static/route/keyteenagers/update-keyteenagers.html index f30b21d..de44352 100644 --- a/src/main/resources/static/route/keyteenagers/update-keyteenagers.html +++ b/src/main/resources/static/route/keyteenagers/update-keyteenagers.html @@ -21,7 +21,7 @@
- +
@@ -140,7 +140,7 @@ @@ -293,6 +293,24 @@ }); } + function backData(data) { + $("#dataForm").find('select').each(function(){ + var selId; + selId = $(this).attr('id'); + $('#' + selId + ' option').each(function () { + for(var key in data) { + if(key == selId) { + if ($(this).text() == data[key]) { + var val = $(this).val(); + var select = 'dd[lay-value=' + val + ']'; + $('#' + key).siblings("div.layui-form-select").find('dl').find(select).click(); + } + } + } + }); + }); + } + // 初始化内容 function initData() { $('#submitBtn').addClass("layui-btn-disabled").attr("disabled",true); @@ -306,6 +324,7 @@ form.render(null, 'dataForm'); initRelationshipWithGuardianSelect(data['relationshipWithGuardian']); queryBasePopulationInfo(data['idCardNumber']); + backData(data); }, function(code, data) { top.dialog.msg(data.msg); }, function() { @@ -314,10 +333,22 @@ top.dialog.close(loadLayerIndex); }); } + initData(); + + function valueFun(formData) { + $("#dataForm").find('select').each(function(){ + var value; + var selId; + value = $(this).find('option:selected').text(); + selId = $(this).attr('id'); + formData.field['' + selId] = value; + }); + } // 提交表单 form.on('submit(submitForm)', function(formData) { + valueFun(formData); top.dialog.confirm(top.dataMessage.commit, function(index) { top.dialog.close(index); var loadLayerIndex; diff --git a/src/main/resources/static/route/overseaspersonnel/save-overseaspersonnel.html b/src/main/resources/static/route/overseaspersonnel/save-overseaspersonnel.html index 71c8f16..b3621bd 100644 --- a/src/main/resources/static/route/overseaspersonnel/save-overseaspersonnel.html +++ b/src/main/resources/static/route/overseaspersonnel/save-overseaspersonnel.html @@ -21,7 +21,7 @@
- +
@@ -70,7 +70,7 @@ @@ -84,7 +84,7 @@ @@ -96,7 +96,7 @@ @@ -384,10 +384,22 @@ top.dialog.close(loadLayerIndex); }); } + initData(); + function valueFun(formData) { + $("#dataForm").find('select').each(function(){ + var value; + var selId; + value = $(this).find('option:selected').text(); + selId = $(this).attr('id'); + formData.field['' + selId] = value; + }); + } + // 提交表单 form.on('submit(submitForm)', function(formData) { + valueFun(formData); top.dialog.confirm(top.dataMessage.commit, function(index) { top.dialog.close(index); var loadLayerIndex; diff --git a/src/main/resources/static/route/overseaspersonnel/update-overseaspersonnel.html b/src/main/resources/static/route/overseaspersonnel/update-overseaspersonnel.html index 02b9b3a..1f8347d 100644 --- a/src/main/resources/static/route/overseaspersonnel/update-overseaspersonnel.html +++ b/src/main/resources/static/route/overseaspersonnel/update-overseaspersonnel.html @@ -21,7 +21,7 @@
- +
@@ -70,7 +70,7 @@ @@ -84,7 +84,7 @@ @@ -96,7 +96,7 @@ @@ -219,64 +219,10 @@ var laydate = layui.laydate; var overseasPersonnelId = top.restAjax.params(window.location.href).overseasPersonnelId; - var wangEditor = window.wangEditor; - var wangEditorObj = {}; - var viewerObj = {}; - function closeBox() { parent.layer.close(parent.layer.getFrameIndex(window.name)); } - function refreshDownloadTemplet(fileName, file) { - var dataRander = {}; - dataRander[fileName] = file; - - laytpl(document.getElementById(fileName +'FileDownload').innerHTML).render(dataRander, function(html) { - document.getElementById(fileName +'FileBox').innerHTML = html; - }); - } - - // 初始化文件列表 - function initFileList(fileName, ids, callback) { - var dataForm = {}; - dataForm[fileName] = ids; - form.val('dataForm', dataForm); - - if(!ids) { - refreshDownloadTemplet(fileName, []); - if(callback) { - callback(fileName, []); - } - return; - } - - top.restAjax.get(top.restAjax.path('api/file/listfilebyfileid', []), { - ids: ids - }, null, function(code, data) { - refreshDownloadTemplet(fileName, data); - if(callback) { - callback(fileName, data); - } - }, function(code, data) { - top.dialog.msg(data.msg); - }); - } - - // 初始化视频 - function initVideo(fileName, data) { - for(var i = 0, item; item = data[i++];) { - var player = new ckplayer({ - container: '#'+ fileName + i, - variable: 'player', - flashplayer: false, - video: { - file: 'route/file/downloadfile/true/'+ item.fileId, - type: 'video/mp4' - } - }); - } - } - // 初始化预计离开日期日期 function initLeaveDateDate() { laydate.render({ @@ -371,6 +317,24 @@ }); } + function backData(data) { + $("#dataForm").find('select').each(function(){ + var selId; + selId = $(this).attr('id'); + $('#' + selId + ' option').each(function () { + for(var key in data) { + if(key == selId) { + if ($(this).text() == data[key]) { + var val = $(this).val(); + var select = 'dd[lay-value=' + val + ']'; + $('#' + key).siblings("div.layui-form-select").find('dl').find(select).click(); + } + } + } + }); + }); + } + // 初始化内容 function initData() { var loadLayerIndex; @@ -386,6 +350,7 @@ initNationalitySelect(data['nationality']); initReligiousBeliefSelect(data['religiousBelief']); initCardCodeSelect(data['cardCode']); + backData(data); }, function(code, data) { top.dialog.msg(data.msg); }, function() { @@ -394,10 +359,22 @@ top.dialog.close(loadLayerIndex); }); } + initData(); + + function valueFun(formData) { + $("#dataForm").find('select').each(function(){ + var value; + var selId; + value = $(this).find('option:selected').text(); + selId = $(this).attr('id'); + formData.field['' + selId] = value; + }); + } // 提交表单 form.on('submit(submitForm)', function(formData) { + valueFun(formData); top.dialog.confirm(top.dataMessage.commit, function(index) { top.dialog.close(index); var loadLayerIndex; diff --git a/src/main/resources/static/route/rentalhousing/save-rentalhousing.html b/src/main/resources/static/route/rentalhousing/save-rentalhousing.html index c90e0f0..fdeb7fb 100644 --- a/src/main/resources/static/route/rentalhousing/save-rentalhousing.html +++ b/src/main/resources/static/route/rentalhousing/save-rentalhousing.html @@ -21,7 +21,7 @@
- +
@@ -67,7 +67,7 @@ @@ -260,8 +260,19 @@ map.addOverlay(marker); } + function valueFun(formData) { + $("#dataForm").find('select').each(function(){ + var value; + var selId; + value = $(this).find('option:selected').text(); + selId = $(this).attr('id'); + formData.field['' + selId] = value; + }); + } + // 提交表单 form.on('submit(submitForm)', function(formData) { + valueFun(formData); top.dialog.confirm(top.dataMessage.commit, function(index) { top.dialog.close(index); var loadLayerIndex; diff --git a/src/main/resources/static/route/rentalhousing/update-rentalhousing.html b/src/main/resources/static/route/rentalhousing/update-rentalhousing.html index 94f38dd..a0b966a 100644 --- a/src/main/resources/static/route/rentalhousing/update-rentalhousing.html +++ b/src/main/resources/static/route/rentalhousing/update-rentalhousing.html @@ -21,7 +21,7 @@
- +
@@ -67,7 +67,7 @@ @@ -219,6 +219,24 @@ }); } + function backData(data) { + $("#dataForm").find('select').each(function(){ + var selId; + selId = $(this).attr('id'); + $('#' + selId + ' option').each(function () { + for(var key in data) { + if(key == selId) { + if ($(this).text() == data[key]) { + var val = $(this).val(); + var select = 'dd[lay-value=' + val + ']'; + $('#' + key).siblings("div.layui-form-select").find('dl').find(select).click(); + } + } + } + }); + }); + } + // 初始化内容 function initData() { var loadLayerIndex; @@ -231,6 +249,7 @@ form.render(null, 'dataForm'); initCardCodeSelect(data['cardCode']); initMap(dataFormData['longitude'],dataFormData['latitude']); + backData(data); }, function(code, data) { top.dialog.msg(data.msg); }, function() { @@ -271,9 +290,20 @@ var marker = new BMap.Marker(point); map.addOverlay(marker); } + + function valueFun(formData) { + $("#dataForm").find('select').each(function(){ + var value; + var selId; + value = $(this).find('option:selected').text(); + selId = $(this).attr('id'); + formData.field['' + selId] = value; + }); + } // 提交表单 form.on('submit(submitForm)', function(formData) { + valueFun(formData); top.dialog.confirm(top.dataMessage.commit, function(index) { top.dialog.close(index); var loadLayerIndex;