Commit 5be86eca authored by Asjoker's avatar Asjoker

问卷管理-详情细化

parent 055b4a0f
...@@ -213,6 +213,8 @@ public class GoToCtrl { ...@@ -213,6 +213,8 @@ public class GoToCtrl {
public String getEducationQuestionnaire_information_list(HttpServletRequest request) { public String getEducationQuestionnaire_information_list(HttpServletRequest request) {
String recordId = request.getParameter("recordId"); String recordId = request.getParameter("recordId");
request.setAttribute("recordId", recordId); request.setAttribute("recordId", recordId);
String processStatus = request.getParameter("processStatus");
request.setAttribute("processStatus", processStatus);
return "/education/questionnaire_Information_list"; return "/education/questionnaire_Information_list";
} }
......
...@@ -61,6 +61,7 @@ public class QuestionnaireCtrl { ...@@ -61,6 +61,7 @@ public class QuestionnaireCtrl {
if(record.getProcessStatus()==1||record.getProcessStatus()==3) { if(record.getProcessStatus()==1||record.getProcessStatus()==3) {
map.put("result", false); map.put("result", false);
map.put("msg", "不能重复上报"); map.put("msg", "不能重复上报");
return map;
} }
//3.根据上报记录id删除原上报数据 //3.根据上报记录id删除原上报数据
this.questionnaireService.delAnswer(recordId); this.questionnaireService.delAnswer(recordId);
...@@ -205,8 +206,12 @@ public class QuestionnaireCtrl { ...@@ -205,8 +206,12 @@ public class QuestionnaireCtrl {
while(var10.hasNext()){ while(var10.hasNext()){
Record educationQuestionnaireInformation_list_i = (Record)var10.next(); Record educationQuestionnaireInformation_list_i = (Record)var10.next();
String html_table = ""; String html_table = "";
html_table = html_table +"<span style=\"margin-right: 10px;\" class=\"getAllProject_table\" onclick=\"setAllMaterial_detail('" + educationQuestionnaireInformation_list_i.getId() + "')\">查看</span>"; if (educationQuestionnaireInformation_list_i.getProcessStatus() == 2 || educationQuestionnaireInformation_list_i.getProcessStatus() == 3 ) {
html_table = html_table +"<span style=\"margin-right: 10px;\" class=\"getAllProject_table\" onclick=\"setAllMaterial_edit('" + educationQuestionnaireInformation_list_i.getId() + "')\">审批</span>"; html_table = html_table +"<span style=\"margin-right: 10px;\" class=\"getAllProject_table\" onclick=\"setAllMaterial_edit('" + educationQuestionnaireInformation_list_i.getId() + "')\">查看</span>";
}
if (educationQuestionnaireInformation_list_i.getProcessStatus() == 1) {
html_table = html_table +"<span style=\"margin-right: 10px;\" class=\"getAllProject_table\" onclick=\"setAllMaterial_edit('" + educationQuestionnaireInformation_list_i.getId() + "')\">审批</span>";
}
Map<String, Object> map_temp_i = new HashMap(); Map<String, Object> map_temp_i = new HashMap();
......
...@@ -397,12 +397,108 @@ function fileChangeNo(id) { ...@@ -397,12 +397,108 @@ function fileChangeNo(id) {
/*swal("失败!","请先选择上传文件", "error");*/ /*swal("失败!","请先选择上传文件", "error");*/
return false; return false;
} }
return true; return true;
} }
function option15validate(id){
var maxsize = 30*1024*1024;
var errMsg = "上传的附件文件不能超过30M!!!";
var tipMsg = "您的浏览器暂不支持计算上传文件的大小,确保上传文件不要超过30M,建议使用IE、FireFox、Chrome浏览器。";
var browserCfg = {};
var ua = window.navigator.userAgent;
if (isIE()){
browserCfg.ie = true;
}else if(ua.indexOf("Firefox")>=1){
browserCfg.firefox = true;
}else if(ua.indexOf("Chrome")>=1){
browserCfg.chrome = true;
}
var obj_file = document.getElementById(id);
if(obj_file.value==""){
// alert("请先选择上传文件");
swal("失败!","请先选择上传文件", "error");
return false;
}
var photoExt=obj_file.value.substr(obj_file.value.lastIndexOf(".")).toLowerCase();//获得文件后缀名
if(photoExt!='.jpg' && photoExt!='.gif' && photoExt!='.png' && photoExt!='.JPG' && photoExt!='.PNG' && photoExt!='.GIF' && photoExt!='.bmp' && photoExt!='.doc' && photoExt!='.docx' && photoExt!='.pdf' && photoExt!='.xls' && photoExt!='.xlsx' && photoExt!='.ppt' && photoExt!='.pptx' && photoExt!='.txt' && photoExt!='.sav' && photoExt!='.caj'){
swal("失败!","请上传后缀名为.png、 .jpg、 .gif、 .bmp、 .doc、 .docx、 .pdf、 .xls、 .xlsx、 .ppt、 .pptx、 .txt、 .sav、 .caj的文件!", "error");
return false;
}
var filesize = 0;
if(browserCfg.firefox || browserCfg.chrome ){
filesize = obj_file.files[0].size;
}else if(browserCfg.ie){
var obj_img = document.getElementById(id);
obj_img.dynsrc=obj_file.value;
filesize = obj_img.fileSize;
}else{
//alert(tipMsg);
swal("失败!",tipMsg, "error");
return false;
}
if(filesize==-1){
// alert(tipMsg);
swal("失败!",tipMsg, "error");
return false;
}else if(filesize>maxsize){
//alert(errMsg);
swal("失败!",errMsg, "error");
return false;
}else{
return true;
}
}
function option61validate(id){
var maxsize = 30*1024*1024;
var errMsg = "上传的附件文件不能超过30M!!!";
var tipMsg = "您的浏览器暂不支持计算上传文件的大小,确保上传文件不要超过30M,建议使用IE、FireFox、Chrome浏览器。";
var browserCfg = {};
var ua = window.navigator.userAgent;
if (isIE()){
browserCfg.ie = true;
}else if(ua.indexOf("Firefox")>=1){
browserCfg.firefox = true;
}else if(ua.indexOf("Chrome")>=1){
browserCfg.chrome = true;
}
var obj_file = document.getElementById(id);
if(obj_file.value==""){
// alert("请先选择上传文件");
swal("失败!","请先选择上传文件", "error");
return false;
}
var photoExt=obj_file.value.substr(obj_file.value.lastIndexOf(".")).toLowerCase();//获得文件后缀名
if(photoExt!='.jpg' && photoExt!='.gif' && photoExt!='.JPG' && photoExt!='.GIF' && photoExt!='.pdf'){
swal("失败!","请上传后缀名为.jpg、 .gif、 .pdf的文件!", "error");
return false;
}
var filesize = 0;
if(browserCfg.firefox || browserCfg.chrome ){
filesize = obj_file.files[0].size;
}else if(browserCfg.ie){
var obj_img = document.getElementById(id);
obj_img.dynsrc=obj_file.value;
filesize = obj_img.fileSize;
}else{
//alert(tipMsg);
swal("失败!",tipMsg, "error");
return false;
}
if(filesize==-1){
// alert(tipMsg);
swal("失败!",tipMsg, "error");
return false;
}else if(filesize>maxsize){
//alert(errMsg);
swal("失败!",errMsg, "error");
return false;
}else{
return true;
}
}
function isIE() { //ie? function isIE() { //ie?
if (!!window.ActiveXObject || "ActiveXObject" in window) if (!!window.ActiveXObject || "ActiveXObject" in window)
return true; return true;
......
...@@ -8,11 +8,27 @@ $(function () { ...@@ -8,11 +8,27 @@ $(function () {
}); });
all_order(); all_order();
getSaveData(); getSaveData();
StatusCheck();
}) })
var processStatus = 0
recordId recordId
var oTable; var oTable;
function StatusCheck() {
console.log(processStatus,'!!!!!!!!!!')
console.log(recordId,'!!!!!!!!!!')
if (processStatus === 1){
console.log('I am IN!')
$('#goback_btn').hide()
}else if (processStatus === 2 || processStatus === 3){
$('#tempSave_btn').hide()
$('#pass_btn').hide()
$('#reject_btn').hide()
$('textarea[name*="question_"]').prop('readonly', true)
}
}
// 验证、填数据用列表 // 验证、填数据用列表
var option_list = [ var option_list = [
{ num: 1, name: '1.基本信息', table: '', max: 0 }, { num: 1, name: '1.基本信息', table: '', max: 0 },
...@@ -321,7 +337,6 @@ function countTable(table, standard, max){ ...@@ -321,7 +337,6 @@ function countTable(table, standard, max){
} }
var intialNum = tempTable.find("tr").length - 1 var intialNum = tempTable.find("tr").length - 1
for(;intialNum < standard;){ for(;intialNum < standard;){
console.log('how about this?',intialNum)
if (tempTable.find("tr").length - 1 < standard) { if (tempTable.find("tr").length - 1 < standard) {
fun(tableNameText, firstRowText, max); fun(tableNameText, firstRowText, max);
intialNum++ intialNum++
...@@ -356,24 +371,18 @@ function del($td, limit){ ...@@ -356,24 +371,18 @@ function del($td, limit){
// 下载多文件 // 下载多文件
function downloadMultiFiles(optionId){ function downloadMultiFiles(optionId){
var param = { //虚拟iframe实现无刷新下载文件 get传参
optionId: optionId var url=webroot+"questionnaire/downZipByFileId?optionId="+optionId+"&questionnaireUuid=1&recordId="+recordId;
var downloadFrame = $('#downloadFrame');
if(downloadFrame.length == 0){
downloadFrame = $('<iframe id="downloadFrame" src="" style="display:none"></iframe>');
$('body').append(downloadFrame);
} }
$.ajax({ downloadFrame.attr('src',url);
type : "POST",
url : webroot+"questionnaire/downZipByFileId",
data : JSON.stringify(param),
async:false,
contentType:'application/json;charset=UTF-8',
success : function(result) {
}
});
} }
// 获取暂存数据 // 获取暂存数据
function getSaveData() { function getSaveData() {
var recordIds = parseInt(recordId)
console.log(recordIds,"!!!!!!!!!!")
// var param = { // var param = {
// questionnaireUuid: 1, // questionnaireUuid: 1,
// recordId: parseInt(recordId) // recordId: parseInt(recordId)
...@@ -384,6 +393,7 @@ function getSaveData() { ...@@ -384,6 +393,7 @@ function getSaveData() {
async:false, async:false,
contentType:'application/json;charset=UTF-8', contentType:'application/json;charset=UTF-8',
success : function(result) { success : function(result) {
processStatus = result.data.processStatus
if(result.result==false){ if(result.result==false){
//alert(result.msg); //alert(result.msg);
swal("失败!", result.msg, "error"); swal("失败!", result.msg, "error");
...@@ -399,12 +409,12 @@ function getSaveData() { ...@@ -399,12 +409,12 @@ function getSaveData() {
if (tempOption === i.option){ if (tempOption === i.option){
option_list.forEach(opt => { option_list.forEach(opt => {
if (i.num === opt.num){ if (i.num === opt.num){
console.log(opt.table, item.group, opt.max)
countTable(opt.table, item.group, opt.max); countTable(opt.table, item.group, opt.max);
var tempName = $(this).attr('name') var tempName = $(this).attr('name')
$("[name="+tempName+"]").each(function () { $("[name="+tempName+"]").each(function () {
if($(this.parentNode).parent("tr").prevAll().length + 1 === item.group){ if($(this.parentNode).parent("tr").prevAll().length + 1 === item.group){
$(this).html(item.value) $(this).html(item.value)
$(this).attr('title', item.value)
return false; return false;
} }
}) })
...@@ -413,19 +423,50 @@ function getSaveData() { ...@@ -413,19 +423,50 @@ function getSaveData() {
} }
}) })
} }
else { else if ($(this.parentNode).parent("tr").prevAll().length + 1 === 1){
$(this).html(item.value) $(this).html(item.value)
$(this).attr('title', item.value)
} }
} }
}) })
}) })
});
result.data.answerList.forEach(item => {
if (item.optionsId === 8){
tempImgList.push(item);
}
})
img_DIV_List_Show();
$(document).ready(function () {
$('[name*="question_"]').each(function () {
var tempOption = $(this).attr('name').replace('question_', '');
result.data.reviews.forEach(item => {
if (item.questionsId == tempOption) {
$(this).val(item.remark)
}
})
})
});
$('#rejectReason').val(result.data.reason)
});
} }
}); });
} }
var tempImgList = new Array();
function img_DIV_List_Show() {
var prehtml = "";
for(var file_i in tempImgList) {
prehtml += "<div>";
prehtml += "<div class=\"col-sm-8\">";
prehtml += '<img src="'+tempImgList[file_i].date+'" width="150px" height="100px" style="margin-left: 15px" />';
prehtml += "</div>";
prehtml += "</div>";
}
$("#file_DIV_List_Show_8").html(prehtml);
}
function saveQuestionnaire(){ function saveQuestionnaire(){
$(document).ready(function () { $(document).ready(function () {
...@@ -438,7 +479,7 @@ function saveQuestionnaire(){ ...@@ -438,7 +479,7 @@ function saveQuestionnaire(){
} else { } else {
tempObj['questionsId'] = $(this).attr('name').replace('question_', ''); tempObj['questionsId'] = $(this).attr('name').replace('question_', '');
tempObj['recordId'] = recordId tempObj['recordId'] = recordId
tempObj['remake'] = $(this)[0].value; tempObj['remark'] = $(this)[0].value;
formData.push(tempObj) formData.push(tempObj)
} }
} }
...@@ -446,9 +487,7 @@ function saveQuestionnaire(){ ...@@ -446,9 +487,7 @@ function saveQuestionnaire(){
}); });
var param = { var param = {
id: recordId, reviews: formData
questionnaireUuid: 1,
reviewList: formData
}; };
$.ajax({ $.ajax({
...@@ -472,7 +511,7 @@ function passQuestionnaire(){ ...@@ -472,7 +511,7 @@ function passQuestionnaire(){
} else { } else {
tempObj['questionsId'] = $(this).attr('name').replace('question_', ''); tempObj['questionsId'] = $(this).attr('name').replace('question_', '');
tempObj['recordId'] = recordId tempObj['recordId'] = recordId
tempObj['remake'] = $(this)[0].value; tempObj['remark'] = $(this)[0].value;
formData.push(tempObj) formData.push(tempObj)
} }
} }
...@@ -480,8 +519,9 @@ function passQuestionnaire(){ ...@@ -480,8 +519,9 @@ function passQuestionnaire(){
}); });
var param = { var param = {
id: recordId, id: parseInt(recordId),
questionnaireUuid: 1, questionnaireUuid: 1,
processStatus: 3,
reviewList: formData reviewList: formData
}; };
...@@ -492,12 +532,22 @@ function passQuestionnaire(){ ...@@ -492,12 +532,22 @@ function passQuestionnaire(){
async:false, async:false,
contentType:'application/json;charset=UTF-8', contentType:'application/json;charset=UTF-8',
success : function(result) { success : function(result) {
if(result.result==true){
swal("成功!", '通过成功', "error");
history.go(-1);
}else{
swal("失败!", result.msg, "error");
}
} }
}); });
} }
function rejectQuestionnaire(){ function rejectQuestionnaire(){
var rejectReason = ''; var rejectReason = '';
if($('#rejectReason')[0].value == ''){
swal("失败!", '未填写驳回原因', "error");
return;
}
$(document).ready(function () { $(document).ready(function () {
$('textarea[name*="question_"]').each(function () { $('textarea[name*="question_"]').each(function () {
if ($(this)[0].value){ if ($(this)[0].value){
...@@ -507,7 +557,7 @@ function rejectQuestionnaire(){ ...@@ -507,7 +557,7 @@ function rejectQuestionnaire(){
} else { } else {
tempObj['questionsId'] = $(this).attr('name').replace('question_', ''); tempObj['questionsId'] = $(this).attr('name').replace('question_', '');
tempObj['recordId'] = recordId tempObj['recordId'] = recordId
tempObj['remake'] = $(this)[0].value; tempObj['remark'] = $(this)[0].value;
formData.push(tempObj) formData.push(tempObj)
} }
} }
...@@ -518,6 +568,7 @@ function rejectQuestionnaire(){ ...@@ -518,6 +568,7 @@ function rejectQuestionnaire(){
id: recordId, id: recordId,
questionnaireUuid: 1, questionnaireUuid: 1,
reason: rejectReason, reason: rejectReason,
processStatus: 2,
reviewList: formData reviewList: formData
}; };
...@@ -528,7 +579,17 @@ function rejectQuestionnaire(){ ...@@ -528,7 +579,17 @@ function rejectQuestionnaire(){
async:false, async:false,
contentType:'application/json;charset=UTF-8', contentType:'application/json;charset=UTF-8',
success : function(result) { success : function(result) {
if(result.result==true){
swal("成功!", '驳回成功', "error");
history.go(-1);
}else{
swal("失败!", result.msg, "error");
}
} }
}); });
} }
function gobcak(){
history.go(-1);
}
...@@ -85,123 +85,7 @@ function setAllMaterial_edit(projectID){ ...@@ -85,123 +85,7 @@ function setAllMaterial_edit(projectID){
window.location.href=webroot+"goto/education/questionnaire_information?recordId="+projectID; window.location.href=webroot+"goto/education/questionnaire_information?recordId="+projectID;
} }
function setAllMaterial_Recommend(informationID,state) function setAllMaterial_detail(projectID){
{ window.location.href=webroot+"goto/education/questionnaire_information?recordId="+projectID;
var data={};
data['informationID'] = informationID;
data['state'] = "1";
$.ajax({
type : "POST",
url : webroot+"Material/setMaterialSpaceEducationState",
data : JSON.stringify(data) ,
async:false,
contentType:'application/json;charset=UTF-8',
success : function(result) {
if (result.result==false){
//alert(result.msg);
swal("失败!", result.msg, "error");
}else {
//alert(result.msg);
swal("成功!", result.msg, "success");
//page_start=($('#hidden-table-info').dataTable().fnSettings()._iDisplayStart) / ($('#hidden-table-info').dataTable().fnSettings()._iDisplayLength);//当前页开始
//indexAllArticleTableONLINETeam();
$('#hidden-table-info').DataTable().draw(false);
}
}
});
}
function setAllMaterial_order(projectID,order1){
$("#DIV_id").val(projectID);
$("#myModalLabel_order1").val(order1);
$('#show_DIV').modal('show');
}
function order_DIV_close(){
$('#show_DIV').modal('hide');
}
function order_DIV_save(){
var projectID=$("#DIV_id").val();
var order1=$("#myModalLabel_order1").val();
var data={};
data['informationID'] = projectID;
data['order1'] = order1;
$.ajax({
type : "POST",
url : webroot+"Material/setMaterialSpaceOrder",
data : JSON.stringify(data) ,
async:false,
contentType:'application/json;charset=UTF-8',
success : function(result) {
if (result.result==false){
//alert(result.msg);
swal("失败!", result.msg, "error");
}else {
//alert(result.msg);
swal("成功!", result.msg, "success");
//page_start=($('#hidden-table-info').dataTable().fnSettings()._iDisplayStart) / ($('#hidden-table-info').dataTable().fnSettings()._iDisplayLength);//当前页开始
//indexAllArticleTableONLINETeam();
$('#hidden-table-info').DataTable().draw(false);
order_DIV_close();
}
}
});
}
function setAllMaterial_delete(informationID)
{
swal({
title: "您确定删除吗?",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "确定",
cancelButtonText: "取消",
closeOnConfirm: false,
closeOnCancel: false
},
function (isConfirm) {
if (isConfirm) {
var data={};
data['informationID'] = informationID;
$.ajax({
type : "POST",
url : webroot+"Material/deleteOneMaterial",
data : JSON.stringify(data) ,
async:false,
contentType:'application/json;charset=UTF-8',
success : function(result) {
if (result.result==false){
//alert(result.msg);
swal("失败!", result.msg, "error");
}else {
//alert(result.msg);
swal("成功!", result.msg, "success");
//page_start=($('#hidden-table-info').dataTable().fnSettings()._iDisplayStart) / ($('#hidden-table-info').dataTable().fnSettings()._iDisplayLength);//当前页开始
//indexAllArticleTableONLINETeam();
$('#hidden-table-info').DataTable().draw(false);
changPage();
}
}
});
}else{
swal("已取消", "您已取消操作!", "error");
}
});
} }
//删除当前页最后一条记录,跳到上一页
function changPage(){
var settings = oTable.fnSettings(); //获得datatable的settings; //获得datatable的settings
var paging_length = settings._iDisplayLength; //当前每页显示多少记录
var page_start = settings._iDisplayStart; //当前页开始是第几条记录
var iRecordsDisplay = settings._iRecordsDisplay; //当前页
if ((iRecordsDisplay - page_start) == 1) {
if (page_start > 0) {
oTable.fnPageChange('previous', true);
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment