Commit 6045c471 authored by Asjoker's avatar Asjoker

问卷管理-详情细化

parent fc4f35e3
...@@ -172,7 +172,7 @@ public class QuestionnaireCtrl { ...@@ -172,7 +172,7 @@ public class QuestionnaireCtrl {
*/ */
@RequestMapping({"/selectRecordList"}) @RequestMapping({"/selectRecordList"})
@ResponseBody @ResponseBody
public Map<String, Object> selectRecordList(@RequestBody Record record){ public Map<String, Object> selectRecordList( Record record){
List<Record> recordList= this.questionnaireService.selectRecordList(record); List<Record> recordList= this.questionnaireService.selectRecordList(record);
Map<String, Object> map = new HashMap(); Map<String, Object> map = new HashMap();
Map<String, Object> data = new HashMap(); Map<String, Object> data = new HashMap();
......
...@@ -243,8 +243,104 @@ function getMaterialInformationExercise(){ ...@@ -243,8 +243,104 @@ function getMaterialInformationExercise(){
}); });
} }
// 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()) {
var tempObj = {};
tempObj['optionsId'] = $(this).attr('name').replace('option_', '');
if ($(this.parentNode).parent("tr").prevAll().length + 1) {
if ($(this.parentNode).parent("tr").prevAll().length > 0){
tempObj['group'] = $(this.parentNode).parent("tr").prevAll().length + 1;
} else {
tempObj['group'] = 1;
}
}
tempObj['value'] = $(this).val();
data.push(tempObj)
}
});
});
$(document).ready(function () {
$('select[name*="option_"]').each(function () {
if ($(this).val()) {
var tempObj = {};
tempObj['optionsId'] = $(this).attr('name').replace('option_', '');
if ($(this.parentNode).parent("tr").prevAll().length + 1) {
if ($(this.parentNode).parent("tr").prevAll().length > 0){
tempObj['group'] = $(this.parentNode).parent("tr").prevAll().length + 1;
} else {
tempObj['group'] = 1;
}
}
tempObj['value'] = $(this).val();
data.push(tempObj);
}
});
});
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);
}
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);
}
console.log(sessionStorage.getItem('realId'), '!!!!!!!!!!!!!!')
var param = {
id: 1,
type: 0,
answersList: data
};
$.ajax({
type : "POST",
url : webroot+"questionnaire/save",
data : JSON.stringify(param),
async:false,
contentType:'application/json;charset=UTF-8',
success : function(result) {
}
});
}
function submitQuestionnaire() {
}
function testListApi() { function testListApi() {
var url=webroot+"questionnaire/selectRecordList?questionnaireUuid=1"; var url=webroot+"questionnaire/selectRecordList";
$(document).ready(function() { $(document).ready(function() {
oTable = $('#hidden-table-info').dataTable( { oTable = $('#hidden-table-info').dataTable( {
...@@ -271,6 +367,9 @@ function testListApi() { ...@@ -271,6 +367,9 @@ function testListApi() {
"ajax": { //ajax方式向后台发送请求 "ajax": { //ajax方式向后台发送请求
"type": "POST", "type": "POST",
"url": url, "url": url,
"data": function (d){
d.questionnaireUuid = 1
},
"dataType": "json", "dataType": "json",
"dataSrc": "data.recordList" "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