diff --git a/src/main/resources/static/route/examapply/list-check.html b/src/main/resources/static/route/examapply/list-check.html index 0d8e048..da2978c 100644 --- a/src/main/resources/static/route/examapply/list-check.html +++ b/src/main/resources/static/route/examapply/list-check.html @@ -308,6 +308,13 @@ return rowData; } }, + {field: 'examMsg', fixed: 'right', width: 180, title: '查看考试信息', align:'center', + templet: function(row) { + var rowData; + rowData = '查看考试信息'; + return rowData; + } + }, {field: 'teacher', fixed: 'right', width: 180, title: '查看讲师信息', align:'center', templet: function(row) { var rowData; @@ -563,6 +570,19 @@ }); } + // 查看考试信息 + function examMsg(data) { + top.dialog.open({ + url: top.restAjax.path('route/examapply/update-check.html?classPlanId={classPlanId}&isView={isView}', [data.examId, 'yes']), + title: "考试信息", + width: '92%', + height: '92%', + onClose: function() { + reloadTable(); + } + }); + } + //监听行单击事件 table.on('tool(dataTable)', function(obj){ var data = obj.data; @@ -576,6 +596,8 @@ addressShow(data) }else if('teacher' == obj.event) { teacher(data) + }else if('examMsg' == obj.event) { + examMsg(data) } }); }); diff --git a/src/main/resources/static/route/examapply/update-check.html b/src/main/resources/static/route/examapply/update-check.html index 0b33982..620e5b6 100644 --- a/src/main/resources/static/route/examapply/update-check.html +++ b/src/main/resources/static/route/examapply/update-check.html @@ -25,40 +25,46 @@ 考试申请基本信息
-
- -
- +
+
+ +
+ +
+
+
+ +
+ +
-
- -
- +
+
+ +
+ +
+
+
+ +
+ +
-
- -
- +
+
+ +
+ +
-
-
- -
- -
-
-
- -
- -
-
-
- -
- +
+ +
+ +
@@ -67,23 +73,121 @@
-
- -
- +
+
+ +
+ +
+
+
+ +
+ +
-
- -
- +
+
+
+ +
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+ +
+
-
+
审核信息
-
+
@@ -103,7 +207,7 @@
-
+
-
- -
- +
+
+ +
+ +
+
+
+ +
+ +
-
- -
- +
+
+ +
+ +
+
+
+ +
+ +
-
- -
- +
+
+ +
+ +
-
-
- -
- -
-
-
- -
- -
-
-
- -
- +
+ +
+ +
@@ -67,16 +73,66 @@
-
- -
- +
+
+ +
+ +
+
+
+ +
+ +
-
- -
- +
+
+
+ +
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+ +
+
@@ -135,6 +191,8 @@ var wangEditor = window.wangEditor; var wangEditorObj = {}; var viewerObj = {}; + var planImagesViewerObj = {}; + var examImagesViewerObj = {}; form.on('radio(checkStatus)', function (data) { var val = data.value; @@ -147,6 +205,146 @@ } }); + // 初始化图片上传 + function initPlanImagesUploadFile() { + var files = $('#planImages').val(); + debugger + initFileList('planImages', files, function(fileName) { + var viewer = new Viewer(document.getElementById(fileName +'FileBox'), {navbar: false}); + planImagesViewerObj[fileName] = viewer; + }); + + form.on('button(planImagesUploadFile)', function(obj) { + var name = this.dataset.name; + var explain = this.dataset.explain; + top.dialog.file({ + type: 'image', + title: '上传'+ explain, + width: '400px', + height: '420px', + maxFileCount: '1', + onClose: function() { + var uploadFileArray = top.dialog.dialogData.uploadFileArray; + if(typeof(uploadFileArray) != 'undefined' && uploadFileArray.length > 0) { + var files = $('#'+ name).val(); + for(var j = 0, file = uploadFileArray[j]; file = uploadFileArray[j++];) { + if(files.length > 0) { + files += ','; + } + files += file.data; + } + initFileList(name, files, function(fileName) { + planImagesViewerObj[fileName].update(); + }); + } + } + }); + }); + + form.on('button(planImagesRemoveFile)', function(obj) { + var name = this.dataset.name; + var id = this.dataset.id; + var files = $('#'+ name).val().replace(id, ''); + files = files.replace(/\,+/g, ','); + if(files.charAt(0) == ',') { + files = files.substring(1); + } + if(files.charAt(files.length - 1) == ',') { + files = files.substring(0, files.length - 1); + } + initFileList(name, files, function(fileName) { + planImagesViewerObj[fileName].update(); + }); + }); + } + + // 初始化PDF上传 + function initPlanPDFUploadFile() { + var files = $('#planPDF').val(); + initFileList('planPDF', files, function(fileName) { + $(document).on('click', '.pdf-open-show', function(obj){ + var fileId = this.dataset.id; + window.open('route/file/download/true/' + fileId); + }) + }); + + form.on('button(planPDFUploadFile)', function(obj) { + var name = this.dataset.name; + var explain = this.dataset.explain; + top.dialog.file({ + type: 'file', + title: '上传'+ explain, + width: '400px', + height: '420px', + maxFileCount: '1', + onClose: function() { + var uploadFileArray = top.dialog.dialogData.uploadFileArray; + if(typeof(uploadFileArray) != 'undefined' && uploadFileArray.length > 0) { + var files = $('#'+ name).val(); + for(var j = 0, file = uploadFileArray[j]; file = uploadFileArray[j++];) { + if(files.length > 0) { + files += ','; + } + files += file.data; + } + initFileList(name, files, function(fileName) { + }); + } + } + }); + }); + + form.on('button(planPDFRemoveFile)', function(obj) { + var name = this.dataset.name; + var id = this.dataset.id; + var files = $('#'+ name).val().replace(id, ''); + files = files.replace(/\,+/g, ','); + if(files.charAt(0) == ',') { + files = files.substring(1); + } + if(files.charAt(files.length - 1) == ',') { + files = files.substring(0, files.length - 1); + } + initFileList(name, files, function(fileName) { + }); + }); + } + + // 初始化文件列表 + 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/list', []), { + ids: ids + }, null, function(code, data) { + refreshDownloadTemplet(fileName, data); + if(callback) { + callback(fileName, data); + } + }, function(code, data) { + top.dialog.msg(data.msg); + }); + } + + 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 closeBox() { parent.layer.close(parent.layer.getFrameIndex(window.name)); } @@ -160,32 +358,6 @@ }); } - // 初始化文件列表 - 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/list', []), { - ids: ids - }, null, function (code, data) { - refreshDownloadTemplet(fileName, data); - if (callback) { - callback(fileName, data); - } - }, function (code, data) { - top.dialog.msg(data.msg); - }); - } - // 初始化内容 function initData() { initExamBaseInfo(); @@ -222,6 +394,7 @@ var loadLayerIndex; top.restAjax.get(top.restAjax.path('api/classplan/get/{classPlanId}', [classPlanId]), {}, null, function (code, data) { orgNameFun.getOrgName(data.orgId, function(nameData) { + console.log(data) data['orgName'] = nameData.institutionName; if ('1' == data.planType) { data.planType = '初训'; @@ -236,6 +409,8 @@ } form.val('initDataForm', dataFormData); form.render(null, 'initDataForm'); + initPlanImagesUploadFile(); + initPlanPDFUploadFile(); }) }, function (code, data) { top.dialog.msg(data.msg);