@@ -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 @@