|
@@ -32,6 +32,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
|
[
|
|
|
{checkbox: true},
|
|
|
{field: 'exam_collection_id', title: __('编号')},
|
|
|
+ {field: 'exam_collection_name', title: __('Exam_collection_name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
|
|
{field: 'sim_type', title: __('Sim_type'),searchList:{"0001":"FZD04B型侦毒器","0002":"FZB006型毒剂报警器","0003":"防化兵用毒剂报警器"},formatter: Table.api.formatter.simtype},
|
|
|
{field: 'question_setting_method', title: __('Question_setting_method'),searchList:{"1":"系统随机","2":"教师自选","3":"任务自选"},formatter: Table.api.formatter.simmethod},
|
|
|
{field: 'exam_collection_type', title: __('Exam_collection_type'),operate: false,formatter: function (value, row, index) {
|
|
@@ -45,7 +46,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
|
table: table,
|
|
|
formatter: Table.api.formatter.collectonstate
|
|
|
},
|
|
|
- {field: 'exam_collection_name', title: __('Exam_collection_name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
|
|
+
|
|
|
// {field: 'task_id', title: __('Task_id')},
|
|
|
{field: 'limit_duration', title: __('Limit_duration')},
|
|
|
{field: 'start_time', title: __('Start_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
|
|
@@ -68,22 +69,23 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
|
classname: 'btn btn-success btn-xs btn-magic btn-dialog',
|
|
|
extend: 'data-area=\'["85%","85%"]\'',
|
|
|
url: 'teacher/practice/edit',
|
|
|
- },{
|
|
|
- name: 'dispatch',
|
|
|
- text: '',
|
|
|
- icon: 'fa fa-trash',
|
|
|
- title: '删除',
|
|
|
- classname: 'btn btn-danger btn-xs btn-magic btn-ajax',
|
|
|
- url: 'teacher/practice/del',
|
|
|
- confirm: '确定要删除吗?',
|
|
|
- success: function (data, ret) {
|
|
|
- $(".btn-refresh").trigger("click");
|
|
|
- },
|
|
|
- error: function (data, ret) {
|
|
|
- Layer.alert(ret.msg);
|
|
|
- return false;
|
|
|
- }
|
|
|
- }
|
|
|
+ },
|
|
|
+ // {
|
|
|
+ // name: 'dispatch',
|
|
|
+ // text: '',
|
|
|
+ // icon: 'fa fa-trash',
|
|
|
+ // title: '删除',
|
|
|
+ // classname: 'btn btn-danger btn-xs btn-magic btn-ajax',
|
|
|
+ // url: 'teacher/practice/del',
|
|
|
+ // confirm: '确定要删除吗?',
|
|
|
+ // success: function (data, ret) {
|
|
|
+ // $(".btn-refresh").trigger("click");
|
|
|
+ // },
|
|
|
+ // error: function (data, ret) {
|
|
|
+ // Layer.alert(ret.msg);
|
|
|
+ // return false;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
],
|
|
|
}
|
|
|
]
|
|
@@ -97,7 +99,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
|
Table.api.init({
|
|
|
extend: {
|
|
|
index_url: 'teacher/practice/persent' + location.search,
|
|
|
- indexed_url: 'teacher/practice/index' + location.search,
|
|
|
+ indexed_url: 'teacher/practice/examing' + location.search,
|
|
|
table: 'teacher_exams',
|
|
|
}
|
|
|
});
|
|
@@ -112,27 +114,63 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
|
fixedColumns: true,
|
|
|
fixedRightNumber: 1,
|
|
|
searchFormVisible:false,
|
|
|
+ showExport:false,
|
|
|
+ search:false,
|
|
|
columns: [
|
|
|
[
|
|
|
// {checkbox: true},
|
|
|
- {field: '', title: __('更换件')},
|
|
|
- {field: '', title: __('学员姓名')},
|
|
|
- {field: '', title: __('状态')},
|
|
|
- {field: 'endtime', title: __('申请时间'), formatter: Table.api.formatter.datetime, operate: false, addclass: 'datetimerange', sortable: true},
|
|
|
+ {field: 'fault_name', title: __('更换件')},
|
|
|
+ {field: 'create_by', title: __('学员姓名')},
|
|
|
+ {field: 'request_status', title: __('状态'),
|
|
|
+ formatter: function(value, row,index) {
|
|
|
+ if(value==1){
|
|
|
+ return '<span class="text-warning">待处理</span>';
|
|
|
+ }else if(value==2){
|
|
|
+ return '<span class="text-success">已送</span>';
|
|
|
+ }else if(value==3){
|
|
|
+ return '<span class="text-danger">已驳回</span>';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {field: 'createtime', title: __('申请时间'), formatter: Table.api.formatter.datetime, operate: false, addclass: 'datetimerange', sortable: true},
|
|
|
{field: 'operate', title: __('Operate'), table: table,
|
|
|
events: Table.api.events.operate,
|
|
|
// formatter: Table.api.formatter.operate
|
|
|
formatter: Table.api.formatter.buttons,
|
|
|
buttons: [
|
|
|
- // {
|
|
|
- // name: 'dispatch',
|
|
|
- // text: '',
|
|
|
- // icon: 'fa fa-pencil',
|
|
|
- // title: '编辑',
|
|
|
- // classname: 'btn btn-success btn-xs btn-magic btn-dialog',
|
|
|
- // extend: 'data-area=\'["55%","95%"]\'',
|
|
|
- // url: 'teacher/exams/edit',
|
|
|
- // }
|
|
|
+ {
|
|
|
+ name: 'dispatch',
|
|
|
+ text: '',
|
|
|
+ icon: 'fa fa-check',
|
|
|
+ title: '已送',
|
|
|
+ classname: 'btn btn-success btn-xs btn-magic btn-ajax',
|
|
|
+ url: 'teacher/exams/handle/type/1',
|
|
|
+ visible: function (rr) {
|
|
|
+ if(rr.request_status == 1 || rr.request_status == 0){
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ },
|
|
|
+ success: function (data, ret) {
|
|
|
+ table.bootstrapTable("refresh");
|
|
|
+ },
|
|
|
+ },{
|
|
|
+ name: 'dispatch',
|
|
|
+ text: '',
|
|
|
+ icon: 'fa fa-reply-all',
|
|
|
+ title: '驳回',
|
|
|
+ classname: 'btn btn-danger btn-xs btn-magic btn-ajax',
|
|
|
+ url: 'teacher/exams/handle/type/2',
|
|
|
+ visible: function (rr) {
|
|
|
+ if(rr.request_status == 1 || rr.request_status == 0){
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ },
|
|
|
+ success: function (data, ret) {
|
|
|
+ table.bootstrapTable("refresh");
|
|
|
+ },
|
|
|
+ }
|
|
|
],
|
|
|
}
|
|
|
]
|
|
@@ -157,31 +195,20 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
|
columns: [
|
|
|
[
|
|
|
// {checkbox: true},
|
|
|
- {field: '', title: __('座号')},
|
|
|
- {field: '', title: __('模拟器状态')},
|
|
|
- {field: '', title: __('学员学号')},
|
|
|
- {field: '', title: __('学员姓名')},
|
|
|
- {field: '', title: __('考试状态')},
|
|
|
- {field: '', title: __('考试成绩')},
|
|
|
- {field: '', title: __('故障现象')},
|
|
|
- {field: '', title: __('故障部位')},
|
|
|
- {field: '', title: __('排除方法')},
|
|
|
- {field: 'operate', title: __('Operate'), table: table1,
|
|
|
- events: Table.api.events.operate,
|
|
|
- // formatter: Table.api.formatter.operate
|
|
|
- formatter: Table.api.formatter.buttons,
|
|
|
- buttons: [
|
|
|
- // {
|
|
|
- // name: 'dispatch',
|
|
|
- // text: '',
|
|
|
- // icon: 'fa fa-pencil',
|
|
|
- // title: '编辑',
|
|
|
- // classname: 'btn btn-success btn-xs btn-magic btn-dialog',
|
|
|
- // extend: 'data-area=\'["55%","95%"]\'',
|
|
|
- // url: 'teacher/exams/edit',
|
|
|
- // }
|
|
|
- ],
|
|
|
- }
|
|
|
+ {field: 'seat_id', title: __('座号')},
|
|
|
+ {field: '', title: __('模拟器状态'),
|
|
|
+ formatter: function(value, row,index) {
|
|
|
+ return '<span class="text-success">就绪</span>';
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {field: 'user_username', title: __('学员学号')},
|
|
|
+ {field: 'user_nickname', title: __('学员姓名')},
|
|
|
+ {field: '', title: __('状态'),
|
|
|
+ formatter: function(value, row,index) {
|
|
|
+ return '<span class="text-success">已交卷</span>';
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {field: 'total_score', title: __('模拟成绩')},
|
|
|
]
|
|
|
]
|
|
|
});
|
|
@@ -197,7 +224,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
|
},
|
|
|
api: {
|
|
|
bindevent: function () {
|
|
|
-
|
|
|
+ var rel_Ids = [];
|
|
|
Table.api.init({
|
|
|
extend: {
|
|
|
index_url: 'department/admin/departadmintotal' + location.search,
|
|
@@ -215,7 +242,16 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
|
Search:false,
|
|
|
columns: [
|
|
|
[
|
|
|
- {checkbox: true},
|
|
|
+ {checkbox: true,
|
|
|
+ formatter: function(value,row,index){
|
|
|
+ // console.log(row.id+'####'+Config.row_info.depart_ids)
|
|
|
+ if(Config.row_info != undefined && Config.row_info.depart_ids.indexOf(row.id)>-1){
|
|
|
+ rel_Ids.push(row.id);
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ },
|
|
|
{field: 'department_name', title: __('区队名称'), operate: false,width: '400px', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
|
|
{field: 'department_admin_count', title: __('全部人员数量'),operate: false},
|
|
|
]
|
|
@@ -225,14 +261,85 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
|
// 为表格绑定事件
|
|
|
Table.api.bindevent(table);
|
|
|
|
|
|
-
|
|
|
- $("input[name='btSelectAll']").click(function () {
|
|
|
- var ids = Table.api.selectedids(table);
|
|
|
- console.log(ids);
|
|
|
- $(".depart_ids").val(ids);
|
|
|
+ table.on('click-row.bs.table', function (e, row, element) {
|
|
|
+ console.log(rel_Ids)
|
|
|
+ // console.log('row')
|
|
|
+ if(!$.inArray(row.id,rel_Ids)){
|
|
|
+ arr = $.grep(rel_Ids, function(value) {
|
|
|
+ return value != row["id"];
|
|
|
+ });
|
|
|
+ rel_Ids = arr;
|
|
|
+ }else if(rel_Ids.indexOf(row.id)>-1){
|
|
|
+ var index = rel_Ids.indexOf(row.id);
|
|
|
+ if (index > -1) {
|
|
|
+ rel_Ids.splice(index, 1);
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ rel_Ids.push(row.id);
|
|
|
+ }
|
|
|
+ $(".depart_ids").val(rel_Ids.join());
|
|
|
});
|
|
|
|
|
|
+ $(document).on('change', '#c-question_setting_method', function () {
|
|
|
+ if($(this).val()==1){
|
|
|
+ $(".btn-sm,.btn-task").css('display','none');
|
|
|
+ }else if($(this).val()==2){
|
|
|
+ $(".btn-sm").css('display','block');
|
|
|
+ $(".btn-task").css('display','none');
|
|
|
+ }else if($(this).val()==3){
|
|
|
+ $(".btn-sm").css('display','none');
|
|
|
+ $(".btn-task").css('display','block');
|
|
|
+ }
|
|
|
+ $(".question_ids").val(0);
|
|
|
+ });
|
|
|
+ //考题
|
|
|
+ $(document).on('click', '.btn-sm', function () {
|
|
|
+ var simtype = $("#c-sim_type").val();
|
|
|
+ if(!simtype){
|
|
|
+ Layer.alert('请选择模拟器类型');
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ var title = '选择考题';
|
|
|
+ Fast.api.open(Fast.api.fixurl("teacher/collection/faults/type/"+simtype), title, {
|
|
|
+ area: ["85%", "85%"],
|
|
|
+ maxmin: true,
|
|
|
+ moveOut: false,
|
|
|
+ offset: ['40px'],
|
|
|
+ callback: function(value) {
|
|
|
+ console.log(value)
|
|
|
+ if (value.task_id) {
|
|
|
+ $(".question_ids").val(value.task_id);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ //任务
|
|
|
+ $(document).on('click', '.btn-task', function () {
|
|
|
+ var simtype = $("#c-sim_type").val();
|
|
|
+ if(!simtype){
|
|
|
+ Layer.alert('请选择模拟器类型');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ var title = '选择任务';
|
|
|
+ parent.Fast.api.open(Fast.api.fixurl("teacher/collection/task/type/"+simtype), title, {
|
|
|
+ area: ["85%", "85%"],
|
|
|
+ maxmin: true,
|
|
|
+ moveOut: false,
|
|
|
+ offset: ['40px'],
|
|
|
+ callback: function(value) {
|
|
|
+ if (value.task_id) {
|
|
|
+ $(".question_ids").val(value.task_id);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
|
|
|
+ // $("input[name='btSelectAll']").click(function () {
|
|
|
+ // var ids = Table.api.selectedids(table);
|
|
|
+ // console.log(ids);
|
|
|
+ // $(".depart_ids").val(ids);
|
|
|
+ // });
|
|
|
+ $("input[name='btSelectAll']").css('display','none');
|
|
|
Form.api.bindevent($("form[role=form]"));
|
|
|
}
|
|
|
}
|