Commit 1aede14e authored by Asjoker's avatar Asjoker

问卷管理-详情细化

parent ca0354e0
......@@ -141,14 +141,14 @@ public class QuestionnaireCtrl {
Map<String, Object> data = new HashMap();
data.put("answerList",answerList);
if(reviews.size()>0) {
data.put("reviews", reviews);
data.put("reviews", reviews);
}
//3.根据记录id查询状态
Record record= this.questionnaireService.selectById(recordId);
data.put("createBy",record.getCreateBy());
data.put("phoneNumber",record.getPhoneNumber());
if(record.getProcessStatus()==2) {
data.put("reason", record.getReason());
data.put("reason", record.getReason());
}
map.put("data",data);
return map;
......@@ -192,7 +192,7 @@ public class QuestionnaireCtrl {
*/
@RequestMapping({"/selectRecordList"})
@ResponseBody
public Map<String, Object> selectRecordList( Record record){
public Map<String, Object> selectRecordList(Record record){
List<Record> recordList= this.questionnaireService.selectRecordList(record);
Map<String, Object> map = new HashMap();
Map<String, Object> data = new HashMap();
......
......@@ -145,13 +145,10 @@ String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.
<div class="row" style="margin-top: 15px">
<%-- 此处为option_8 --%>
<label class="col-sm-3 control-label">每块场地实景照片1张 <span class="text-danger">*</span></label>
<%-- <div class="col-sm-10" id="demo1">--%>
<%-- <input type="hidden" id="material_img" value="<%=request.getContextPath()%>/res/image/a8e5f2d84a324822886b39c74b460288.jpg">--%>
<%-- <img src="<%=request.getContextPath()%>/res/image/a8e5f2d84a324822886b39c74b460288.jpg" width="150px" height="100px" id="img" >--%>
<%-- <a class="btn btn-primary" onclick="upImg()">上传图片</a>--%>
<%-- </div>--%>
<div class="col-sm-4">
<a class="btn btn-primary" onclick="file_DIV_Show('0')" id="upload_place"><strong>添加</strong></a>
<div class="col-sm-4" id="demo1">
<input type="hidden" id="material_img" value="<%=request.getContextPath()%>/res/image/a8e5f2d84a324822886b39c74b460288.jpg">
<img src="<%=request.getContextPath()%>/res/image/a8e5f2d84a324822886b39c74b460288.jpg" width="150px" height="100px" id="img" >
<a class="btn btn-primary" onclick="upImg()">上传图片</a>
</div>
</div>
</div>
......@@ -1424,10 +1421,10 @@ String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.
<div class="row">
<label class="col-sm-3" style="font-size: 18px;padding-left: 40px">20.是否为国家级备案众创空间 <span class="text-danger">*</span></label>
<div style="margin: 0 20px">
<input type="radio" name="last_two" value="是">
<input type="radio" name="last_two" id="radio_1" value="是" checked>
</div>
<div style="margin: 0 20px">
<input type="radio" name="last_two" value="否">
<input type="radio" name="last_two" id="radio_2" value="否">
</div>
</div>
</div>
......@@ -1441,10 +1438,10 @@ String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.
<div class="row">
<label class="col-sm-3" style="font-size: 18px;padding-left: 40px">21.是否为国家创业孵化示范基地 <span class="text-danger">*</span></label>
<div style="margin: 0 20px">
<input type="radio" name="last_one" value="是">
<input type="radio" name="last_one" id="radio_3" value="是" checked>
</div>
<div style="margin: 0 20px">
<input type="radio" name="last_one" value="否">
<input type="radio" name="last_one" id="radio_4" value="否">
</div>
</div>
</div>
......@@ -1475,20 +1472,19 @@ String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title" id="myModalLabel">附件</h4>
<h4 class="modal-title" id="myModalLabel">场地照片</h4>
</div>
<div class="modal-body">
<div class="form-group">
<form method="get" class="form-horizontal">
<label class="col-sm-3 control-label">选择附件:</label>
<form method="get" class="form-horizontal">
<div class="form-group">
<label class="col-sm-3 control-label">选择场地照片:</label>
<div class="col-sm-9" id="projectPlanbookFile_file_div">
<input type="file" id="projectPlanbookFile_file" name="mainfile" class="form-control" >
</div>
<span class="help-block m-b-none" style="text-align: center;color: #ff0000">上传的文件最大10M</span>
</div>
<span class="help-block m-b-none" style="text-align: center;color: #ff0000">请上传后缀名为jpeg、jpg、gif、png的文件,最大1M</span>
</form>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" onclick="projectPlanbookFile_update()" id="projectPlanbookFile_DIV_SC">上传</button>
......
......@@ -8,10 +8,247 @@ $(function () {
});
all_order();
testListApi();
getSaveData();
})
var oTable;
// 验证、填数据用列表
var option_list = [
{ num: 1, name: '1.基本信息' },
{ num: 2, name: '2.众创空间场地情况' },
{ num: 3, name: '3.是否租赁场地' },
{ num: 4, name: '4.众创空间配备专职工作人员情况' },
{ num: 5, name: '5.入孵企业情况' },
{ num: 6, name: '6.新增就业情况' },
{ num: 7, name: '7.开设创新创业课程情况' },
{ num: 8, name: '8.签约创业导师情况' },
{ num: 9, name: '9.组织双创活动情况' },
{ num: 10, name: '10.参赛情况' },
{ num: 11, name: '11.2021年创新创业工作经费' },
{ num: 12, name: '12.申报成功高校众创空间联盟发布的创新创业研究课题信息' },
{ num: 13, name: '13.在孵企业销售收入或累计合同额情况(表1)' },
{ num: 14, name: '13.本评估周期实现股权或债权融资情况(表2)' },
{ num: 15, name: '14.主办或承办市级及以上级别路演、双创周活动' },
{ num: 16, name: '15.在孵企业在OTC高校板挂牌情况' },
{ num: 17, name: '16.在孵企业新增知识产权(包括专利、软著等)' },
{ num: 18, name: '17.获得“互联网+”大赛全国赛事奖项情况' },
{ num: 19, name: '18.获得创客马拉松大赛及市教委组织的其他双创大赛奖项情况' },
{ num: 20, name: '19.入选天津市创业拔尖项目情况' },
{ num: 21, name: '20.是否为国家级备案众创空间' },
{ num: 22, name: '21.是否为国家创业孵化示范基地' },
];
var broList = [
{ option: '1', num: 1},
{ option: '2', num: 1},
{ option: '3', num: 1},
{ option: '4', num: 1},
{ option: '5', num: 2},
{ option: '6', num: 2},
{ option: '7', num: 3},
{ option: '8', num: 3},
{ option: '9', num: 4},
{ option: '10', num: 4},
{ option: '11', num: 4},
{ option: '12', num: 4},
{ option: '13', num: 4},
{ option: '14', num: 4},
{ option: '15', num: 4},
{ option: '16', num: 5},
{ option: '17', num: 5},
{ option: '18', num: 5},
{ option: '19', num: 5},
{ option: '20', num: 5},
{ option: '21', num: 6},
{ option: '22', num: 6},
{ option: '23', num: 6},
{ option: '24', num: 6},
{ option: '25', num: 7},
{ option: '26', num: 7},
{ option: '27', num: 7},
{ option: '28', num: 7},
{ option: '29', num: 7},
{ option: '30', num: 7},
{ option: '31', num: 7},
{ option: '32', num: 7},
{ option: '35', num: 7},
{ option: '36', num: 8},
{ option: '37', num: 8},
{ option: '38', num: 8},
{ option: '39', num: 8},
{ option: '40', num: 8},
{ option: '41', num: 8},
{ option: '42', num: 8},
{ option: '43', num: 8},
{ option: '44', num: 8},
{ option: '45', num: 8},
{ option: '46', num: 8},
{ option: '47', num: 8},
{ option: '48', num: 8},
{ option: '49', num: 8},
{ option: '50', num: 8},
{ option: '51', num: 8},
{ option: '52', num: 9},
{ option: '53', num: 9},
{ option: '54', num: 9},
{ option: '55', num: 9},
{ option: '56', num: 9},
{ option: '57', num: 10},
{ option: '58', num: 10},
{ option: '59', num: 10},
{ option: '60', num: 11},
{ option: '61', num: 11},
{ option: '75', num: 16},
{ option: '76', num: 16}
];
var waitingList = [
{ option: '1', num: 1},
{ option: '2', num: 1},
{ option: '3', num: 1},
{ option: '4', num: 1},
{ option: '5', num: 2},
{ option: '6', num: 2},
{ option: '7', num: 3},
{ option: '8', num: 3},
{ option: '9', num: 4},
{ option: '10', num: 4},
{ option: '11', num: 4},
{ option: '12', num: 4},
{ option: '13', num: 4},
{ option: '14', num: 4},
{ option: '15', num: 4},
{ option: '16', num: 5},
{ option: '17', num: 5},
{ option: '18', num: 5},
{ option: '19', num: 5},
{ option: '20', num: 5},
{ option: '21', num: 6},
{ option: '22', num: 6},
{ option: '23', num: 6},
{ option: '24', num: 6},
{ option: '25', num: 7},
{ option: '26', num: 7},
{ option: '27', num: 7},
{ option: '28', num: 7},
{ option: '29', num: 7},
{ option: '30', num: 7},
{ option: '31', num: 7},
{ option: '32', num: 7},
{ option: '33', num: 7},
{ option: '34', num: 7},
{ option: '35', num: 7},
{ option: '36', num: 8},
{ option: '37', num: 8},
{ option: '38', num: 8},
{ option: '39', num: 8},
{ option: '40', num: 8},
{ option: '41', num: 8},
{ option: '42', num: 8},
{ option: '43', num: 8},
{ option: '44', num: 8},
{ option: '45', num: 8},
{ option: '46', num: 8},
{ option: '47', num: 8},
{ option: '48', num: 8},
{ option: '49', num: 8},
{ option: '50', num: 8},
{ option: '51', num: 8},
{ option: '52', num: 9},
{ option: '53', num: 9},
{ option: '54', num: 9},
{ option: '55', num: 9},
{ option: '56', num: 9},
{ option: '57', num: 10},
{ option: '58', num: 10},
{ option: '59', num: 10},
{ option: '60', num: 11},
{ option: '61', num: 11},
{ option: '62', num: 12},
{ option: '63', num: 12},
{ option: '64', num: 12},
{ option: '65', num: 13},
{ option: '66', num: 13},
{ option: '67', num: 13},
{ option: '68', num: 14},
{ option: '69', num: 14},
{ option: '70', num: 14},
{ option: '71', num: 14},
{ option: '72', num: 15},
{ option: '73', num: 15},
{ option: '74', num: 15},
{ option: '75', num: 16},
{ option: '76', num: 16},
{ option: '77', num: 17},
{ option: '78', num: 17},
{ option: '79', num: 17},
{ option: '80', num: 17},
{ option: '81', num: 17},
{ option: '82', num: 18},
{ option: '83', num: 18},
{ option: '84', num: 18},
{ option: '85', num: 18},
{ option: '86', num: 19},
{ option: '87', num: 19},
{ option: '88', num: 19},
{ option: '89', num: 19},
{ option: '90', num: 19},
{ option: '91', num: 19},
{ option: '92', num: 19},
{ option: '93', num: 20},
{ option: '94', num: 20},
{ option: '95', num: 20},
{ option: '96', num: 20}
];
function toValidate() {
$(document).ready(function () {
$('input[name*="option_"]').each(function () {
if (!$(this).val()) {
var tempOption = $(this).attr('name').replace('option_', '');
broList.forEach(item =>{
if (tempOption === item.option) {
var itemName = '';
option_list.forEach(i => {
if (item.num === i.num){
itemName = i.name
return false;
}
})
swal("失败!", itemName + ' 存在未填项', "error");
return false;
}
})
return false;
}
});
});
$(document).ready(function () {
$('select[name*="option_"]').each(function () {
if (!$(this).val()) {
var tempOption = $(this).attr('name').replace('option_', '');
broList.forEach(item =>{
if (tempOption === item.option) {
var itemName = '';
option_list.forEach(i => {
if (item.num === i.num){
itemName = i.name
return false;
}
})
swal("失败!", itemName + ' 存在未填项', "error");
return false;
}
})
return false;
}
});
});
}
// 问卷全部数据
var formData=[];
// 各表格序号-总方法
function all_order() {
employ_order();
......@@ -155,120 +392,101 @@ function del($td, limit){
}
// 上传多个附件
function file_DIV_Show(fileID){
if(fileID == "0"){
$("#projectPlanbookFile_file_div").empty();
$("#projectPlanbookFile_file_div").html('<input type="file" id="projectPlanbookFile_file" name="mainfile" class="form-control" >');
$( '#projectPlanbookFile_file' ).prettyFile();
}else {
for(var file_list_i in file_list){
if(file_list[file_list_i].id == parseInt(fileID)){
$("#projectPlanbookFile_file_div").empty();
$("#projectPlanbookFile_file_div").html('<input type="file" id="projectPlanbookFile_file" name="mainfile" class="form-control" >');
$( '#projectPlanbookFile_file' ).prettyFile();
$("#projectPlanbookFile_file_div input[class='input-large form-control']").val(file_list[file_list_i].fileName);
}
}
}
$('#projectPlanbookFile_DIV').modal('show');
function upImg(){
$("#projectPlanbookFile_file_div").empty();
$("#projectPlanbookFile_file_div").html('<input type="file" id="projectPlanbookFile_file" name="mainfile" class="form-control" >');
$( '#projectPlanbookFile_file' ).prettyFile();
$("#projectPlanbookFile_DIV").modal('show');
}
var imgCount = 0;
function projectPlanbookFile_update(){
if(fileChangeNo("projectPlanbookFile_file")==true){
if(pdfFileChange("projectPlanbookFile_file")==false){
if(imgFileChange("projectPlanbookFile_file")==false){
return;
}
$("#projectPlanbookFile_DIV_ZZSC").show();
$("#projectPlanbookFile_DIV_SC").hide();
$.ajaxFileUpload({
url: webroot+'File/upload',
url: webroot+'File/uploadImg',
secureuri:false,
dataType: 'json',
fileElementId : ["projectPlanbookFile_file"],
success: function (data){//上传成功
imgCount++;
$("#projectPlanbookFile_DIV_ZZSC").hide();
$("#projectPlanbookFile_DIV_SC").show();
var fileName=data.fileName;
var fileId=data.fileID;
var id = file_list_update_id;
file_list_update_id++;
var file_class_i = file_class(id,fileId,fileName);
file_list.push(file_class_i);
file_DIV_List_Show();
if(data.return==false){
//alert("只支持jpg、png、gif格式");
swal("失败!", "只支持jpg、png、gif格式", "error");
return;
}
if (imgCount > 1){
var picHtml = '<img src="'+data.date+'" width="150px" height="100px" >'
$("#demo1").prepend(picHtml);
} else {
$("#img").attr('src',data.date);
$("#material_img").val(data.date);
}
var tempOb ={
optionsId: 8,
value: data.date,
group: imgCount
}
formData.push(tempOb);
$('#projectPlanbookFile_DIV').modal('hide');
$("#projectPlanbookFile_file_div").empty();
$("#projectPlanbookFile_file_div").html('<input type="file" id="projectPlanbookFile_file" name="mainfile" class="form-control" >');
$( '#projectPlanbookFile_file' ).prettyFile();
}
});
}else{
//alert("请选择文件!");
swal("失败!","请选择文件!", "error");
// alert("请先选择上传文件");
swal("失败!", "请先选择上传文件", "error");
}
}
// 上传单张图片
function getMaterialInformationExercise(){
var data={};
data['exerciseID'] = $("#exerciseID").val();
data['exerciseType'] =$("#exerciseType").val();
// 获取暂存数据
function getSaveData() {
var param = {
questionnaireUuid: 1
}
$.ajax({
type : "POST",
url : webroot+"Material/getOneMaterialSpaceExercise",
data : JSON.stringify(data) ,
url : webroot+"questionnaire/selectDetails?questionnaireUuid=1",
async:false,
contentType:'application/json;charset=UTF-8',
success : function(result) {
if(result.result==false){
//alert(result.msg);
swal("失败!", result.msg, "error");
return;
}
var materialInformation=result.materialInformation;
var materialClassBinding_list=result.materialClassBinding_list;
$("#id_projectID").val(materialInformation.informationID); //id
$("#exerciseType").val(materialInformation.exerciseType); //活动方式
$("#exerciseID").val(materialInformation.exerciseID); //活动id
$("#material_DIV_title").val(materialInformation.title); //标题
/* CKEDITOR.instances.material_DIV_content.setData(materialInformation.content); //内容
*/ $("#material_DIV_content").html(materialInformation.content)
$("#material_DIV_describe1").val(materialInformation.describe1); //描述
$("#material_DIV_order1").val(materialInformation.order1); //权重
$("#material_img").val(materialInformation.img); //封页
$("#img").attr('src',materialInformation.img);
$("#material_DIV_startTime").val(materialInformation.startTime); //创建时间
if(materialClassBinding_list!=null){
for(var materialClassBinding_list_i in materialClassBinding_list){
$("input[name=material_DIV_class]:radio[value='"+materialClassBinding_list[materialClassBinding_list_i].classID+"']").iCheck('check');
}
}
var i =0;
$(document).ready(function () {
$('input[name*="option_"]').each(function () {
var tempOption = $(this).attr('name').replace('option_', '');
result.data.answersList.forEach(item => {
if (item.optionsId === tempOption) {
$(this).val(item.value)
}
})
})
});
}
});
});
}
// function totalTest(){
// $(document).ready(function () {
// $('input[name*="option_"]').each(function () {
// if ($(this).val()) {
// var opid = $(this).attr('name').replace('option_', '')
// console.log('options_id:', opid)
// if ($(this.parentNode).parent("tr").prevAll().length + 1) {
// if ($(this.parentNode).parent("tr").prevAll().length > 0){
// console.log('group:', $(this.parentNode).parent("tr").prevAll().length + 1)
// } else {
// console.log('group:', 1)
// }
// }
// console.log('value', $(this).val())
// }
// });
// });
// }
function saveQuestionnaire(){
var data=[];
$(document).ready(function () {
$('input[name*="option_"]').each(function () {
if ($(this).val()) {
console.log('iamIN!!!!!!!!!')
var tempObj = {};
tempObj['optionsId'] = $(this).attr('name').replace('option_', '');
if ($(this.parentNode).parent("tr").prevAll().length + 1) {
......@@ -279,7 +497,7 @@ function saveQuestionnaire(){
}
}
tempObj['value'] = $(this).val();
data.push(tempObj)
formData.push(tempObj)
}
});
});
......@@ -296,32 +514,31 @@ function saveQuestionnaire(){
}
}
tempObj['value'] = $(this).val();
data.push(tempObj);
formData.push(tempObj);
}
});
});
console.log(formData,'!!!!!!!!!')
if ($('input:radio[name=last_two]:checked').val()) {
var tempObj1 = {};
tempObj1['optionsId'] = 97;
tempObj1['group'] = 1;
tempObj1['value'] = $('input:radio[name=last_two]:checked').val();
data.push(tempObj1);
formData.push(tempObj1);
}
if ($('input:radio[name=last_one]:checked').val()) {
var tempObj2 = {};
tempObj2['optionsId'] = 98;
tempObj2['group'] = 1;
tempObj2['value'] = $('input:radio[name=last_one]:checked').val();
data.push(tempObj2);
formData.push(tempObj2);
}
console.log(sessionStorage.getItem('realId'), '!!!!!!!!!!!!!!')
var param = {
id: 1,
type: 0,
answersList: data
answersList: formData
};
$.ajax({
......@@ -336,11 +553,13 @@ function saveQuestionnaire(){
}
function submitQuestionnaire() {
toValidate();
saveQuestionnaire();
}
function testListApi() {
var url=webroot+"questionnaire/selectRecordList";
var url=webroot+"questionnaire/selectRecordList?questionnaireUuid=1";
$(document).ready(function() {
oTable = $('#hidden-table-info').dataTable( {
......@@ -367,9 +586,6 @@ function testListApi() {
"ajax": { //ajax方式向后台发送请求
"type": "POST",
"url": url,
"data": function (d){
d.questionnaireUuid = 1
},
"dataType": "json",
"dataSrc": "data.recordList"
},
......
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