贾小兵 3 mesi fa
parent
commit
9e11eb34d8

+ 201 - 13
application/admin/controller/student/Collection.php

@@ -5,9 +5,12 @@ namespace app\admin\controller\student;
 use app\common\controller\Backend;
 use app\common\model\Config as ConfigModel;
 use app\admin\model\Report;
+use app\admin\model\Fault;
 use think\exception\DbException;
+use think\exception\PDOException;
+use think\exception\ValidateException;
 use think\response\Json;
-
+use think\Db;
 /**
  * sim-考试集合管理
  *
@@ -35,6 +38,13 @@ class Collection extends Backend
         $this->whereExtend['exam_collection_type'] = 3;
         $this->whereExtend['exam_collection_state'] = 2;
         $this->assignConfig('sim_sim_type', ConfigModel::getSimTypeList());
+
+        $groupIds = $this->auth->getGroupIds();
+        //学员查看自己区队的考试集合
+        if(in_array(8, $groupIds)){
+            $departid = $this->auth->depart_id;
+            $this->whereExtend[] = ['exp',Db::raw("FIND_IN_SET($departid,depart_ids)")];
+        }
     }
 
 
@@ -69,7 +79,7 @@ class Collection extends Backend
             ->order($sort, $order)
             ->paginate($limit);
         foreach ($list as $k => $v){
-            $exam_isset =  $this->exam_model->where(['user_id'=>$this->auth->id,'exam_collection_id'=>$v['exam_collection_id'],'exam_collection_type'=>3])->find();
+            $exam_isset =  $this->exam_model->where(['user_id'=>$this->auth->id,'exam_collection_id'=>$v['exam_collection_id'],'exam_collection_type'=>3,'endtime'=>['>',0]])->find();
             if(isset($exam_isset)){
                 $v->is_user_examed = 1;
             }else{
@@ -81,6 +91,7 @@ class Collection extends Backend
         return json($result);
     }
 
+
     //进入考试
     public function  into($ids = null)
     {
@@ -90,6 +101,7 @@ class Collection extends Backend
         }
         $info = $this->exam_model->where(['user_id'=>$this->auth->id,'exam_collection_id'=>$ids])->find();
         if(empty($info)){
+            //考试表
             $arr = [
                 'exam_collection_id' => $ids,
                 'user_id' => $this->auth->id,
@@ -100,9 +112,33 @@ class Collection extends Backend
                 'exam_collection_type' => 3,
                 'sim_type' => $row->sim_type,
                 'seat_id' => 1,
-                'sim_id' => 12,
+                'sim_id' => intval($row->sim_type),
             ];
             $this->exam_model->save($arr);
+
+            //考试和故障关联表
+            $fault_list = fault::where(['sim_type' => $row->sim_type, 'fault_state' => 0,'fault_type'=>3])->select();
+            $fault_key = array_rand($fault_list, 3);
+            foreach ($fault_list as $key=> $item){
+                $flag = 0;
+                if(in_array($key,$fault_key)){
+                    $flag = 1;
+                }
+                $add= [
+                    'exam_id'=>$this->exam_model->exam_id,
+                    'fault_id'=>$item->fault_id,
+                    'ref_type'=>2,
+                    'flag'=>$flag,
+                    'ref_state'=>3,
+                    'sim_fault_question_value'=>'0000000'.rand(1,2),
+                    'createtime'=>time(),
+                    'updatetime'=>time(),
+                    'create_time'=>date('Y-m-d H:i:s'),
+                    'update_time'=>date('Y-m-d H:i:s'),
+                ];
+                Db::name('real_exam_fault')->insert($add);
+            }
+            unset($item);
         }
         if ($this->request->isPost()) {
             $exam_collection_id = $this->request->post('exam_collection_id');
@@ -124,24 +160,176 @@ class Collection extends Backend
         if(!$row){
             $this->error('未找到记录');
         }
-        $this->assignConfig('timer', 60*$this->model->where(['exam_collection_id'=>$row['exam_collection_id']])->value('limit_duration'));
-        $this->view->assign('row', $row);
-
-        $departmentdata = [];
-        $departmentdata = Report::where(['level'=>4,'is_replace'=>1])->select();
         if ($this->request->isPost()) {
+            //计算分数,保存记录
             $params = $this->request->post('row/a');
-            $row->end_time = date('Y-m-d H:i:s');
-            $row->endtime = time();
-            $row->exam_status = 5;
-            $row->save();
-            $this->success('交卷成功','/ZQOtIMLKud.php/student/collection/analysis/ids/'.$row['exam_id']);
+
+            $result = false;
+            $score = 100;
+            $fault_one_score = 0;
+            $fault_two_score = 0;
+            $fault_three_score = 0;
+            $xianxian_score = 0;
+            $yuanyin_socre= 0;
+            $buwei_score= 0;
+            $fangfa_score= 0;
+            $jielun_score = 0;
+            Db::startTrans();
+            try {
+                //更新考试结束时间
+                $row->end_time = date('Y-m-d H:i:s');
+                $row->endtime = time();
+                $row->exam_status = 5;
+                $result = $row->save();
+
+                $info = $this->exam_model->where(['exam_id'=>$ids])->find();
+
+                //更新考试关联表,计算得分 mx_real_exam_fault
+                $fault_list = Db::name('real_exam_fault')->where(['exam_id'=>$ids,'flag'=>1])->select();
+                foreach ($fault_list as $it)
+                {
+                    $update['sim_fault_answer_value'] ='0000000'.rand(1,2);
+                    if($update['sim_fault_answer_value']==$it['sim_fault_question_value']){
+                        $update['answer_right'] = 1;
+                    }else{
+                        $update['answer_right'] = 2;
+                    }
+                    Db::name('real_exam_fault')->where('ref_id',$it['ref_id'])->update($update);
+                }
+                unset($it);
+
+                //计算得分,故障是否有扣分  扣分制
+                $fault_right_list = Db::name('real_exam_fault')->where(['exam_id'=>$ids,'flag'=>1,'answer_right'=>['>',0]])->select();
+                if($fault_right_list[0]['answer_right']==2){
+                    $fault_one_score = 25;
+                }
+                if($fault_right_list[1]['answer_right']==2){
+                    $fault_two_score = 25;
+                }
+                if($fault_right_list[2]['answer_right']==2){
+                    $fault_three_score = 25;
+                }
+                $xianxian_score = rand(1,3);
+                $yuanyin_socre= rand(1,3);
+                $buwei_score= rand(1,3);
+                $fangfa_score= rand(1,3);
+                if(empty($params['other_jielun'])){
+                    $jielun_score = rand(1,3);
+                }
+                //是否超时
+                $overtime_fen = intval((time()-$info['endtime']) / 60);
+                if($overtime_fen>=5){
+                    $overtime_score = 5;
+                }else if($overtime_fen>0 && $overtime_fen<5){
+                    $overtime_score = $overtime_fen ;
+                }else{
+                    $overtime_score =0;
+                }
+                $fault_score = $score-$fault_one_score-$fault_two_score-$fault_three_score-$xianxian_score-$yuanyin_socre-$buwei_score-$fangfa_score-$jielun_score-$overtime_score;
+
+                //更新考试结果表
+                $params['exam_id'] = $ids;
+                $params['total'] = $fault_score;//得分;
+                $params['fault_one_score'] = $fault_one_score;//得分;
+                $params['fault_two_score'] = $fault_two_score;//得分;
+                $params['fault_three_score'] = $fault_three_score;//得分;
+                $params['xianxian_score'] = $xianxian_score;//得分;
+                $params['yuanyin_socre'] = $yuanyin_socre;//得分;
+                $params['buwei_score'] = $buwei_score;//得分;
+                $params['fangfa_score'] = $fangfa_score;//得分;
+                $params['jielun_score'] = $jielun_score;//得分;
+                $params['overtime_score'] = $overtime_score;//得分;
+                Db::name('real_exam_score')->insert($params);
+
+                $this->exam_model->where(['exam_id'=>$ids])->update(['total_score'=>$fault_score]);
+
+                Db::commit();
+            } catch (ValidateException|PDOException|Exception $e) {
+                Db::rollback();
+                $this->error($e->getMessage());
+            }
+            if ($result === false) {
+                $this->error(__('No rows were inserted'));
+            }
+            $this->success('交卷成功,待老师确认成绩','/ZQOtIMLKud.php/student/exam/index');
         }
+
+
+        //还未开始考试
+        $row->limit_duration = $this->model->where(['exam_collection_id'=>$row['exam_collection_id']])->value('limit_duration');
+        if(empty($row->starttime)){
+            $timer = 60*$row->limit_duration;
+        }else{
+            $fen =  $row->limit_duration - intval((time()-$row->starttime) / 60);
+            $timer = 60*$fen;
+        }
+        $row->other_replace_arr = json_decode($row->other_replace,true)??[];
+
+        $this->assignConfig('other_replace_arr', $row->other_replace_arr);
+//        halt($row->other_replace_arr);
+        $row->replace_list =Db::name('real_exam_comp_request')->where(['exam_id'=>$ids])->select();
+        $this->assignConfig('ids',$ids);
+        $this->assignConfig('timer',$timer);
+        $this->view->assign('row', $row);
+
+        $departmentdata = [];
+        $departmentdata = Fault::where(['replace_part'=>1])->select();
+
         $this->view->assign('departmentdata', $departmentdata);
+//        echo "<pre>";
+//        print_r(collection($departmentdata)->toArray());
+
         return $this->view->fetch();
     }
 
 
+    public function replace($ids = null)
+    {
+        if ($this->request->isPost()) {
+            $params = $this->request->post('other_replace','');
+            $param = json_decode($params,true);
+            if(!empty($param)){
+                foreach ($param as $key=>$item){
+                    $isreplace = Db::name('real_exam_comp_request')->where(['exam_id'=>$ids,'fault_id'=>$item['fault_id']])->find();
+                    if(empty($isreplace)){
+                        $add = [
+                            'exam_id'=>$ids,
+                            'fault_id'=>$item['fault_id'],
+                            'request_status'=>1,
+                            'create_by_user_id'=>$this->auth->id,
+                            'create_by'=>$this->auth->nickname,
+                            'createtime'=>time(),
+                            'updatetime'=>time(),
+                            'create_time'=>date('Y-m-d H:i:s'),
+                            'update_time'=>date('Y-m-d H:i:s'),
+                        ];
+                        Db::name('real_exam_comp_request')->insert($add);
+                    }else{
+                        $add = [
+                            'exam_id'=>$ids,
+                            'fault_id'=>$item['fault_id'],
+                            'fault_name'=>Fault::where('fault_id',$item['fault_id'])->value('replace_name'),
+                            'request_status'=>$isreplace['request_status'],
+                            'create_by_user_id'=>$this->auth->id,
+                            'create_by'=>$this->auth->nickname,
+                            'createtime'=>time(),
+                            'updatetime'=>time(),
+                            'create_time'=>date('Y-m-d H:i:s'),
+                            'update_time'=>date('Y-m-d H:i:s'),
+                        ];
+                        Db::name('real_exam_comp_request')->where('rel_id',$isreplace['rel_id'])->update($add);
+                    }
+                }
+                unset($item);
+                $row = $this->exam_model->get($ids);
+                $row-> other_replace = $params;
+                $result = $row->save();
+            }
+            $this->success('申请成功,待老师审批');
+        }
+    }
+
+
     public function analysis($ids = null)
     {
         $row = $this->exam_model->get($ids);

+ 0 - 1
application/admin/controller/student/Exam.php

@@ -30,7 +30,6 @@ class Exam extends Backend
             $this->whereExtend['user_id'] = $this->auth->id;
         }
         $this->assignconfig("groupIds", $groupIds[0]);
-//        $this->assignConfig('sim_exam_status', ConfigModel::getSimExamStatus());
     }
 
 

+ 49 - 9
application/admin/controller/teacher/Collection.php

@@ -91,6 +91,45 @@ class Collection extends Backend
         }
         $this->success();
     }
+
+    public function edit($ids = null)
+    {
+        $row = $this->model->get($ids);
+        if (!$row) {
+            $this->error(__('No Results were found'));
+        }
+        if (false === $this->request->isPost()) {
+            $this->view->assign('row', $row);
+            $this->assignConfig('row_info', $row);
+            return $this->view->fetch();
+        }
+        $params = $this->request->post('row/a');
+        if (empty($params)) {
+            $this->error(__('Parameter %s can not be empty', ''));
+        }
+        $params = $this->preExcludeFields($params);
+        $result = false;
+        Db::startTrans();
+        try {
+            //是否采用模型验证
+            if ($this->modelValidate) {
+                $name = str_replace("\\model\\", "\\validate\\", get_class($this->model));
+                $validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.edit' : $name) : $this->modelValidate;
+                $row->validateFailException()->validate($validate);
+            }
+            $result = $row->allowField(true)->save($params);
+            Db::commit();
+        } catch (ValidateException|PDOException|Exception $e) {
+            Db::rollback();
+            $this->error($e->getMessage());
+        }
+        if (false === $result) {
+            $this->error(__('No rows were updated'));
+        }
+        $this->success();
+    }
+
+
     public function multi($ids = null)
     {
         if (false === $this->request->isPost()) {
@@ -105,7 +144,8 @@ class Collection extends Backend
             $this->error(__('No rows were updated'));
         }
         parse_str($this->request->post('params'), $values);
-        $values = $this->auth->isSuperAdmin() ? $values : array_intersect_key($values, array_flip(is_array($this->multiFields) ? $this->multiFields : explode(',', $this->multiFields)));
+        $values = true ? $values : array_intersect_key($values, array_flip(is_array($this->multiFields) ? $this->multiFields : explode(',', $this->multiFields)));
+//        $values = $this->auth->isSuperAdmin() ? $values : array_intersect_key($values, array_flip(is_array($this->multiFields) ? $this->multiFields : explode(',', $this->multiFields)));
         if (empty($values)) {
             $this->error(__('You have no permission'));
         }
@@ -113,14 +153,14 @@ class Collection extends Backend
         if (is_array($adminIds)) {
             $this->model->where($this->dataLimitField, 'in', $adminIds);
         }
-//        if(!empty($values['exam_collection_state'])){
-//            if($values['exam_collection_state']==2){
-//                $state_count = $this->model->where(['exam_collection_state'=>$values['exam_collection_state'],'exam_collection_id'=>$ids])->count();
-//                if($state_count>0){
-//                    $this->error('已有启用的考试,请先关闭');
-//                }
-//            }
-//        }
+        if(!empty($values['exam_collection_state'])){
+            if($values['exam_collection_state']==2){
+                $state_count = $this->model->where(['exam_collection_state'=>$values['exam_collection_state'],'exam_collection_type'=>3])->count();
+                if($state_count>0){
+                    $this->error('已有启用的考试,请先关闭原来的考试');
+                }
+            }
+        }
         $count = 0;
         Db::startTrans();
         try {

+ 105 - 2
application/admin/controller/teacher/Exams.php

@@ -3,6 +3,9 @@
 namespace app\admin\controller\teacher;
 
 use app\common\controller\Backend;
+use think\Db;
+use think\exception\PDOException;
+use think\exception\ValidateException;
 
 /**
  * sim-考试表/成绩总分
@@ -32,13 +35,53 @@ class Exams extends Backend
      * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
      */
 
+    public function edit($ids = null)
+    {
+        $row = Db::name('real_exam_score')->where('exam_id', $ids)->find();
+        if (!$row) {
+            $this->error(__('No Results were found'));
+        }
+        $rows = $this->model->get($ids);
+        $row['seat_id'] = $rows->seat_id;
+        $row['user_nickname'] = $rows->user_nickname;
+        $row['user_username'] = $rows->user_username;
+        $row['is_sure'] = $rows->is_sure;
+        if (false === $this->request->isPost()) {
+            $this->view->assign('row', $row);
+            return $this->view->fetch();
+        }
+        $params = $this->request->post('row/a');
+        if (empty($params)) {
+            $this->error(__('Parameter %s can not be empty', ''));
+        }
+        $params = $this->preExcludeFields($params);
+        $result = false;
+        Db::startTrans();
+        try {
+            //是否采用模型验证
+            $params['total'] = 100-$params['fault_one_score']-$params['fault_two_score']-$params['fault_three_score']-$params['overtime_score']-$params['jielun_score'];
+            $result = Db::name('real_exam_score')->where('id', $row['id'])->update($params);
+
+            $rows->total_score = $params['total'];
+            $rows->is_sure = 1;
+            $rows->save();
+            Db::commit();
+        } catch (ValidateException|PDOException|Exception $e) {
+            Db::rollback();
+            $this->error($e->getMessage());
+        }
+        if (false === $result) {
+            $this->error(__('No rows were updated'));
+        }
+        $this->success();
+    }
+
     public function view($ids = null)
     {
         $row = $this->model->get($ids);
         if(!$row){
             $this->error('未找到记录');
         }
-
         $this->view->assign('row', $row);
         return $this->view->fetch();
     }
@@ -46,6 +89,66 @@ class Exams extends Backend
     //正在考试
     public function persent()
     {
-        return $this->view->fetch();
+        //设置过滤方法
+        $this->request->filter(['strip_tags', 'trim']);
+        if (false === $this->request->isAjax()) {
+
+            $examlist = $this->model->select();
+            foreach ($examlist as $k => $v){
+                $examlist[$k]['score'] = Db::name('real_exam_score')->where('exam_id',$v['exam_id'])->find();
+            }
+            $this->view->assign('examlist', $examlist);
+            return $this->view->fetch();
+        }
+        //如果发送的来源是 Selectpage,则转发到 Selectpage
+        if ($this->request->request('keyField')) {
+            return $this->selectpage();
+        }
+        [$where, $sort, $order, $offset, $limit] = $this->buildparams();
+        $list = Db::name('real_exam_comp_request')
+            ->where($where)->where($this->whereExtend)
+            ->order($sort, $order)
+            ->paginate($limit);
+        unset($v);
+        $result = ['total' => $list->total(), 'rows' => $list->items()];
+        return json($result);
     }
+
+
+    public function examing()
+    {
+        //设置过滤方法
+        $this->request->filter(['strip_tags', 'trim']);
+        if (false === $this->request->isAjax()) {
+            return $this->view->fetch();
+        }
+        //如果发送的来源是 Selectpage,则转发到 Selectpage
+        if ($this->request->request('keyField')) {
+            return $this->selectpage();
+        }
+        [$where, $sort, $order, $offset, $limit] = $this->buildparams();
+        $list = $this->model
+            ->where($where)->where($this->whereExtend)
+            ->order($sort, $order)
+            ->paginate($limit);
+        $result = ['total' => $list->total(), 'rows' => $list->items()];
+        return json($result);
+    }
+    public function handle($type = null,$ids = null)
+    {
+        $row = Db::name('real_exam_comp_request')->where('rel_id',$ids)->find($ids);
+        if(!$row){
+            $this->error('未找到记录');
+        }
+        if($type ==1){
+            $request_status = 2;
+        }
+        if($type==2)
+        {
+            $request_status= 3;
+        }
+        Db::name('real_exam_comp_request')->where('rel_id',$ids)->update(['request_status'=>$request_status]);
+        $this->success();
+    }
+
 }

+ 14 - 1
application/admin/model/teacher/Collection.php

@@ -26,7 +26,7 @@ class Collection extends Model
 
     // 追加属性
     protected $append = [
-
+        'sim_type_text'
     ];
 
     protected static function init()
@@ -48,6 +48,19 @@ class Collection extends Model
             }
         });
     }
+
+    public function getSimTypeTextAttr($value, $data)
+    {
+        $sim_type_text = '';
+        if($data['sim_type']=='0001'){
+            $sim_type_text = 'FZD04B型侦毒器';
+        }else if ($data['sim_type']=='0002'){
+            $sim_type_text = 'FZB006型毒剂报警器';
+        }else if ($data['sim_type']=='0003'){
+            $sim_type_text = '防化兵用毒剂报警器';
+        }
+        return $sim_type_text;
+    }
     
 
 

+ 13 - 3
application/admin/model/teacher/Task.php

@@ -5,6 +5,7 @@ use app\admin\library\Auth;
 use app\admin\model\department\Department;
 use think\Exception;
 use think\Model;
+use think\Db;
 use traits\model\SoftDelete;
 
 
@@ -26,7 +27,8 @@ class Task extends Model
 
     // 追加属性
     protected $append = [
-
+        'xianxiang_count',
+        'buwei_count'
     ];
 
     protected static function init()
@@ -49,9 +51,17 @@ class Task extends Model
             }
         });
     }
-    
 
-    
+    public function getXianxiangCountAttr($value, $data)
+    {
+        $faultid = Db::name('task_fault')->where('task_id',$data['task_id'])->column('fault_id');
+        $faultpid = Db::name('fault')->where('fault_id','in',$faultid)->where('sim_type',$data['sim_type'])->column('parent_fault_id');
+        return Db::name('fault')->where('fault_id','in',$faultpid)->where('sim_type',$data['sim_type'])->count();
+    }
+
+    public function getBuweiCountAttr($value, $data){
+        return Db::name('task_fault')->where('task_id',$data['task_id'])->count();
+    }
 
 
 

+ 32 - 38
application/admin/view/student/collection/examing.html

@@ -104,105 +104,99 @@
 <div class="row animated fadeInRight">
     <div class="col-md-12">
         <div class="box box-primary">
-
             <div class="panel-body">
-                <form id="update-form" role="form" data-toggle="validator" method="POST" action="">
-                    {:token()}
                     <div class="panel-heading">
-                        <div class="readme">正在考试中,考试时间 50 分钟</div>
+                        <div class="readme">正在考试中,考试时间 {$row.limit_duration} 分钟</div>
                         <div class="djs">距离考试结束还有 <span id="timer"></span> </div>
                     </div>
                     <div class="box-body box-profile">
+                        <form id="update-form" role="form" data-toggle="validator" method="POST" action="">
                         <div class="col-xs-12 col-sm-12">
                             <div class="form-group">
                                 <label  style=" width: 10%;" class="control-label col-xs-3 col-sm-3 addRedStar">{:__('更换件列表')}:</label>
                                 <div class="col-xs-9 col-sm-9">
-                                    <dl class="fieldlist" data-name="row[other_supplier]" data-template="other_suppliertpl">
+                                    <dl class="fieldlist" data-name="row[other_replace]" data-template="other_suppliertpl">
                                         <dd>
-                                            <ins style="width: 450px;">更换件类型</ins>
-                                            <ins style="width: 300px;">状态</ins>
+                                            <ins style="width: 550px;">更换件类型</ins>
+                                            <ins style="width: 430px;">状态</ins>
                                         </dd>
                                         <dd>
                                             <a href="javascript:;" class="btn btn-sm btn-info btn-append"><i class="fa fa-plus"></i> 追加</a>
                                         </dd>
-                                        <textarea name="row[other_supplier]" class="form-control hide" cols="30" rows="5" data-rule="required"></textarea>
+                                        <textarea name="row[other_replace]" class="form-control other_replace" cols="30" rows="5" data-rule="required">{$row.other_replace}</textarea>
                                     </dl>
                                     <!--定义模板,模板语法使用Art-Template模板语法-->
                                     <script type="text/html" id="other_suppliertpl">
                                         <dd class="form-inline">
-<!--                                            <input type="text" name="unwin[<%=index%>][name]"-->
-<!--                                                   class="form-control" value="<%=row['name']%>" style="width: 450px;" >-->
-                                            <select class="form-control" name="unwin[<%=index%>][name]" style="width: 550px;">
+                                            <select class="form-control" name="unwin[<%=index%>][fault_id]" style="width: 550px;">
                                                 {foreach name="departmentdata" item="vo"}
-                                                <option value="{$vo.report_id}" >{$vo.name}</option>
+                                                <option value="{$vo.fault_id}" <%if(row.fault_id =='{$vo.fault_id}'){%> selected <% }%> >{$vo.replace_name}</option>
+<!--                                                <input type="text" value="<%=row['fault_id']%>" >-->
                                                 {/foreach}
                                             </select>
-                                            <select class="form-control" name="unwin[<%=index%>][states]" style="width: 420px;">
-                                                <option value="0">未送</option>
-                                                <option value="0">已送</option>
+                                            <select class="form-control" name="unwin[<%=index%>][request_status]" style="width: 430px;">
+                                                <option value="0" <%if(row["request_status"]==0){%> selected <%}%>>未申请</option>
+                                                <option value="1" <%if(row["request_status"]==1){%> selected <%}%>>已申请</option>
+                                                <option value="2" <%if(row["request_status"]==2){%> selected <%}%>>已处理</option>
+                                                <option value="3" <%if(row["request_status"]==3){%> selected <%}%>>已驳回</option>
                                             </select>
-<!--                                            <input type="text" name="unwin[<%=index%>][price]"-->
-<!--                                                   style="width: 300px;"-->
-<!--                                                   class="form-control" value="<%=row['price']%>" >-->
                                             <span class="btn btn-sm btn-danger btn-remove" title="移除"><i class="fa fa-times"></i></span>
-                                            <span class="btn btn-sm btn-success btn-save" title="保存"><i class="fa fa-check"></i></span>
+                                            <span class="btn btn-sm btn-success btn-replace" title="保存"><i class="fa fa-check"></i></span>
                                         </dd>
                                     </script>
                                 </div>
                             </div>
                         </div>
-
                         <div class="col-xs-12 col-sm-12">
                             <div class="form-group">
-                                <label  style=" width: 10%;" class="control-label col-xs-3 col-sm-3 addRedStar">{:__('更换件列表')}:</label>
+                                <label  style=" width: 10%;" class="control-label col-xs-3 col-sm-3 addRedStar">{:__('维修报告列表')}:</label>
                                 <div class="col-xs-9 col-sm-9">
-                                    <dl class="fieldlist" data-name="row[other_supplier1]" data-template="other_suppliertpl1">
+                                    <dl class="fieldlist" data-name="row[other_report]" data-template="other_suppliertpl1">
                                         <dd>
                                             <ins style="width: 250px;">故障现象</ins>
                                             <ins style="width: 250px;">可能原因</ins>
                                             <ins style="width: 250px;">故障部位</ins>
                                             <ins style="width: 250px;">排除方法</ins>
-
                                         </dd>
                                         <dd>
                                             <a href="javascript:;" class="btn btn-sm btn-info btn-append"><i class="fa fa-plus"></i> 追加</a>
                                         </dd>
-                                        <textarea name="row[other_supplier1]" class="form-control hide" cols="30" rows="5" data-rule="required"></textarea>
+                                        <textarea name="row[other_report]" class="form-control" cols="30" rows="5" data-rule="required"></textarea>
                                     </dl>
                                     <!--定义模板,模板语法使用Art-Template模板语法-->
                                     <script type="text/html" id="other_suppliertpl1">
                                         <dd class="form-inline">
-                                            <input type="text" name="unwin[<%=index%>][name]"
-                                                   class="form-control" value="<%=row['name']%>" style="width: 250px;" >
-                                            <input type="text" name="unwin[<%=index%>][price]"
+                                            <input type="text" name="unwin[<%=index%>][xx_id]"
+                                                   class="form-control" value="<%=row['xx_id']%>" style="width: 250px;" >
+                                            <input type="text" name="unwin[<%=index%>][yy_id]"
                                                    style="width: 250px;"
-                                                   class="form-control" value="<%=row['price']%>" >
-                                            <input type="text" name="unwin[<%=index%>][price]"
+                                                   class="form-control" value="<%=row['yy_id']%>" >
+                                            <input type="text" name="unwin[<%=index%>][bw_id]"
                                                    style="width: 250px;"
-                                                   class="form-control" value="<%=row['price']%>" >
-                                            <input type="text" name="unwin[<%=index%>][price]"
+                                                   class="form-control" value="<%=row['bw_id']%>" >
+                                            <input type="text" name="unwin[<%=index%>][pc_id]"
                                                    style="width: 250px;"
-                                                   class="form-control" value="<%=row['price']%>" >
+                                                   class="form-control" value="<%=row['pc_id']%>" >
                                             <span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span>
                                         </dd>
                                     </script>
                                 </div>
                             </div>
                         </div>
-
                         <div class="col-xs-12 col-sm-12">
                             <div class="form-group">
                                 <label  style=" width: 10%;" class="control-label col-xs-3 col-sm-3 addRedStar">{:__('修复结论')}:</label>
                                 <div class="col-xs-9 col-sm-9">
-                                    <textarea class="form-control" data-rule="required" name="row[jielun]" style="width: 91%"></textarea>
+                                    <textarea class="form-control" data-rule="required" name="row[other_jielun]" style="width: 91%"></textarea>
                                 </div>
                             </div>
                         </div>
+                        <div class="form-group" style="text-align: center">
+                            <button type="submit" class="btn btn-info" style="text-align: center;width: 10%;margin-top: 5%">{:__('交卷')}</button>
+                        </div>
+                        </form>
                     </div>
-                    <div class="form-group" style="text-align: center;">
-                        <button type="submit" class="btn btn-info" style="text-align: center;width: 10%">{:__('交卷')}</button>
-                    </div>
-                </form>
+
             </div>
         </div>
     </div>

+ 1 - 1
application/admin/view/student/collection/into.html

@@ -57,7 +57,7 @@
                             </div>
                             <div class="form-group col-sm-6">
                                 <label class="control-label">{:__('模拟器类型')}:</label>
-                                <input type="text" class="form-control" value="{$admin.nickname|htmlentities}" readonly/>
+                                <input type="text" class="form-control" value="{$row.sim_type_text|htmlentities}" readonly/>
                             </div>
                             <div class="form-group col-sm-6">
                                 <label class="control-label">{:__('模拟器状态')}:</label>

+ 1 - 1
application/admin/view/teacher/collection/add.html

@@ -4,7 +4,7 @@
         <input class="form-control" name="row[exam_collection_type]" type="hidden" value="3">
         <input class="form-control" name="row[create_user_id]" type="hidden" value="{$auth->id}">
         <input class="form-control" name="row[create_by]" type="hidden" value="{$auth->nickname}">
-        <input class="form-control depart_ids" name="row[depart_ids]" type="text" value="0">
+        <input class="form-control depart_ids" name="row[depart_ids]" type="hidden" value="">
         <div class="form-group col-sm-6">
             <label class="control-label col-xs-12 col-sm-3 addRedStar">{:__('Exam_collection_name')}:</label>
             <div class="col-xs-12 col-sm-7">

+ 1 - 0
application/admin/view/teacher/collection/edit.html

@@ -1,5 +1,6 @@
 <form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
     <div class="row">
+        <input class="form-control depart_ids" name="row[depart_ids]" type="hidden" value="{$row.depart_ids|htmlentities}">
         <div class="form-group col-sm-6">
             <label class="control-label col-xs-12 col-sm-3 addRedStar">{:__('Exam_collection_name')}:</label>
             <div class="col-xs-12 col-sm-7">

+ 15 - 11
application/admin/view/teacher/exams/edit.html

@@ -68,7 +68,7 @@
                     <thead>
                     <tr style="height: 3.5rem">
                         <td >评分标准</td>
-                        <td >分</td>
+                        <td >分</td>
                     </tr>
                     </thead>
                     <tbody class="task_list">
@@ -76,37 +76,40 @@
                         <td colspan="2">一.排除故障(75分)</td>
                     </tr>
                     <tr>
-                        <td>故障一未排除扣25分</td><td><input type="text" name="row[guzhang_score]" value="0"></td>
+                        <td>故障一未排除扣25分</td><td><input type="text" name="row[fault_one_score]" value="{$row.fault_one_score|htmlentities}"></td>
                     </tr>
                     <tr>
-                        <td>故障二未排除扣25分</td><td><input type="text" name="row[guzhang_score]" value="0"></td>
+                        <td>故障二未排除扣25分</td><td><input type="text" name="row[fault_two_score]" value="{$row.fault_two_score|htmlentities}"></td>
                     </tr>
                     <tr>
-                        <td>故障三未排除扣25分</td><td><input type="text" name="row[guzhang_score]" value="0"></td>
+                        <td>故障三未排除扣25分</td><td><input type="text" name="row[fault_three_score]" value="{$row.fault_three_score|htmlentities}"></td>
                     </tr>
                     <tr>
                         <td colspan="2">二.维修报告表(15分)</td>
                     </tr>
                     <tr>
-                        <td>故障现象少写或错写1条扣1分</td><td><input type="text" name="row[guzhang_score]" value="0"></td>
+                        <td>故障现象少写或错写1条扣1分</td><td><input type="text" name="row[xianxian_score]" value="{$row.xianxian_score|htmlentities}"></td>
                     </tr>
                     <tr>
-                        <td>可能原因少写或错写1条扣1分</td><td><input type="text" name="row[guzhang_score]" value="0"></td>
+                        <td>可能原因少写或错写1条扣1分</td><td><input type="text" name="row[yuanyin_score]" value="{$row.yuanyin_score|htmlentities}"></td>
                     </tr>
                     <tr>
-                        <td>故障部位少写或错写1条扣1分</td><td><input type="text" name="row[guzhang_score]" value="0"></td>
+                        <td>故障部位少写或错写1条扣1分</td><td><input type="text" name="row[buwei_score]" value="{$row.buwei_score|htmlentities}"></td>
                     </tr>
                     <tr>
-                        <td>排除方法少写或错写1条扣1分</td><td><input type="text" name="row[guzhang_score]" value="0"></td>
+                        <td>排除方法少写或错写1条扣1分</td><td><input type="text" name="row[fangfa_score]" value="{$row.fangfa_score|htmlentities}"></td>
                     </tr>
                     <tr>
-                        <td>修复结论错扣2分</td><td><input type="text" name="row[guzhang_score]" value="0"></td>
+                        <td>修复结论错扣2分</td><td><input type="text" name="row[jielun_score]" value="{$row.jielun_score|htmlentities}"></td>
                     </tr>
                     <tr>
                         <td colspan="2">三.维修时间(10分)</td>
                     </tr>
                     <tr>
-                        <td>按每超过1分钟扣1分的比例扣分</td><td><input type="text" name="row[guzhang_score]" value="0"></td>
+                        <td>按每超过1分钟扣1分的比例扣分</td><td><input type="text" name="row[overtime_score]" value="{$row.overtime_score|htmlentities}"></td>
+                    </tr>
+                    <tr>
+                        <td colspan="2" style="height: 3.5rem">总得分:{$row.total|htmlentities}</td>
                     </tr>
                     </tbody>
                 </table>
@@ -115,11 +118,12 @@
     </div>
 
 
-
+    {if $row.is_sure eq 0}
     <div class="form-group layer-footer">
         <label class="control-label col-xs-12 col-sm-2"></label>
         <div class="col-xs-12 col-sm-8">
             <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
         </div>
     </div>
+    {/if}
 </form>

+ 209 - 181
application/admin/view/teacher/exams/persent.html

@@ -20,7 +20,7 @@
         background-color: #CCE8EB;
         width: 100px;
     }
-    .new_table input{background-color:#f2f2f2;;border: 0px solid #cad9ea;}
+    .new_table input{background-color:#f2f2f2;;border: 0px solid #cad9ea;width: 90%}
 </style>
 
 <div class="row">
@@ -59,187 +59,215 @@
                 </div>
             </div>
 
-        </div>
-    </div>
-    <div class="col-lg-12" style="margin: 10px 10px 0 10px">
-        <form id="update-form" role="form" data-toggle="validator" method="POST" action="">
-            <div class="tab-content" style="margin-top:5px;">
-                <div class="tab-pane tab_log1" style="display: block">
-                    <table class="new_table">
-                        <tr>
-                            <td style="width:15%">座号</td>
-                            <td>坐席1</td>
-                            <td>坐席2</td>
-                            <td>坐席3</td>
-                            <td>坐席4</td>
-                            <td>坐席5</td>
-                            <td>坐席6</td>
-                            <td>坐席7</td>
-                            <td>坐席8</td>
-                            <td>坐席9</td>
-                            <td>坐席10</td>
-                        </tr>
-                        <tr>
-                            <td>姓名</td>
-                            <td></td>
-                            <td>姓名</td>
-                            <td>姓名</td>
-                            <td>姓名</td>
-                            <td>姓名</td>
-                            <td>姓名</td>
-                            <td>姓名</td>
-                            <td>姓名</td>
-                            <td>姓名</td>
-                            <td>姓名</td>
-                        </tr>
-                        <tr>
-                            <td>学号</td>
-                            <td>学号</td>
-                            <td>学号</td>
-                            <td>学号</td>
-                            <td>学号</td>
-                            <td>学号</td>
-                            <td>学号</td>
-                            <td>学号</td>
-                            <td>学号</td>
-                            <td>学号</td>
-                            <td>学号</td>
-                        </tr>
-                        <tr>
-                            <td colspan="11" style="text-align: left;padding-left: 1%">一.故障排除(75分)</td>
-                        </tr>
-                        <tr>
-                            <td>故障一未排除扣25分</td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                        </tr>
-                        <tr>
-                            <td>故障二未排除扣25分</td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                        </tr>
-                        <tr>
-                            <td>故障三未排除扣25分</td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                        </tr>
-                        <tr>
-                            <td colspan="11" style="text-align: left;padding-left: 1%">二.修理报告表(15分)</td>
-                        </tr>
-                        <tr>
-                            <td>故障现象少写或错写1条扣1分</td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                        </tr>
-                        <tr>
-                            <td>可能原因少写或错写1条扣1分</td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                        </tr>
-                        <tr>
-                            <td>故障部位少写或错写1条扣1分</td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                        </tr>
-                        <tr>
-                            <td>排除方法少写或错写1条扣1分</td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                        </tr>
-                        <tr>
-                            <td>修复结论错扣2分</td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                        </tr>
-                        <tr>
-                            <td colspan="11" style="text-align: left;padding-left: 1%">三.维修时间(10分)</td>
-                        </tr>
-                        <tr>
-                            <td>按没超过1分钟扣1分的比例扣分</td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                            <td><input type="text" name="row[guzhang_score]" value="0"></td>
-                        </tr>
-                    </table>
-                </div>
-            </div>
-            <div class="form-group layer-footer" style="margin-top: 3%;text-align: center">
-                <label class="control-label col-xs-12 col-sm-2"></label>
-                <div class="col-xs-12 col-sm-8">
-                    <button type="submit" class="btn btn-info">{:__('确认成绩并结束本批次考试')}</button>
+
+            <div id="" class="tab-content">
+                <div class="tab-pane fade active in" id="three">
+                    <div class="tableTitle" style="font-size: 16px;margin: 10px 0">得分情况</div>
+                    <div class="widget-body no-padding">
+                        <div id="toolbar2" class="toolbar">
+                            <a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
+                        </div>
+                        <table id="table2" class="table table-striped table-bordered table-hover table-nowrap"
+                               data-operate-edit="{:$auth->check('teacher/exams/edit')}"
+                               data-operate-del="{:$auth->check('teacher/exams/del')}"
+                               width="100%">
+                        </table>
+                    </div>
                 </div>
             </div>
-        </form>
+
+        </div>
     </div>
+<!--    <div class="col-lg-12" style="margin: 10px 10px 0 10px">-->
+<!--        <form id="update-form" role="form" data-toggle="validator" method="POST" action="">-->
+<!--            <div class="tab-content" style="margin-top:5px;">-->
+<!--                <div class="tab-pane tab_log1" style="display: block">-->
+<!--                    <table class="new_table">-->
+<!--                        <tr>-->
+<!--                            <td style="width:25%">座号</td>-->
+<!--                            <td>坐席1</td>-->
+<!--                            <td>坐席2</td>-->
+<!--                            <td>坐席3</td>-->
+<!--                            <td>坐席4</td>-->
+<!--                            <td>坐席5</td>-->
+<!--                            <td>坐席6</td>-->
+<!--                            <td>坐席7</td>-->
+<!--                            <td>坐席8</td>-->
+<!--                            <td>坐席9</td>-->
+<!--                            <td>坐席10</td>-->
+<!--                        </tr>-->
+<!--                        <tr>-->
+<!--                            <td>姓名</td>-->
+<!--                            <td>{$examlist[0]['user_nickname']}</td>-->
+<!--                            <td></td>-->
+<!--                            <td></td>-->
+<!--                            <td></td>-->
+<!--                            <td></td>-->
+<!--                            <td></td>-->
+<!--                            <td></td>-->
+<!--                            <td></td>-->
+<!--                            <td></td>-->
+<!--                            <td></td>-->
+<!--                        </tr>-->
+<!--                        <tr>-->
+<!--                            <td>学号</td>-->
+<!--                            <td>{$examlist[0]['user_username']}</td>-->
+<!--                            <td></td>-->
+<!--                            <td></td>-->
+<!--                            <td></td>-->
+<!--                            <td></td>-->
+<!--                            <td></td>-->
+<!--                            <td></td>-->
+<!--                            <td></td>-->
+<!--                            <td></td>-->
+<!--                            <td></td>-->
+<!--                        </tr>-->
+<!--                        <tr>-->
+<!--                            <td colspan="11" style="text-align: left;padding-left: 1%">一.故障排除(75分)</td>-->
+<!--                        </tr>-->
+<!--                        <tr>-->
+<!--                            <td>故障一未排除扣25分</td>-->
+<!--                            <td><input type="text" name="row[0][fault_one_score]" value="{$examlist[0]['score']['fault_one_score']}"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                        </tr>-->
+<!--                        <tr>-->
+<!--                            <td>故障二未排除扣25分</td>-->
+<!--                            <td><input type="text" name="row[0][fault_two_score]" value="{$examlist[0]['score']['fault_two_score']}"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                        </tr>-->
+<!--                        <tr>-->
+<!--                            <td>故障三未排除扣25分</td>-->
+<!--                            <td><input type="text" name="row[0][fault_three_score]" value="{$examlist[0]['score']['fault_three_score']}"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                        </tr>-->
+<!--                        <tr>-->
+<!--                            <td colspan="11" style="text-align: left;padding-left: 1%">二.修理报告表(15分)</td>-->
+<!--                        </tr>-->
+<!--                        <tr>-->
+<!--                            <td>故障现象少写或错写1条扣1分</td>-->
+<!--                            <td><input type="text" name="row[0][xianxian_score]" value="{$examlist[0]['score']['xianxian_score']}"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                        </tr>-->
+<!--                        <tr>-->
+<!--                            <td>可能原因少写或错写1条扣1分</td>-->
+<!--                            <td><input type="text" name="row[0][yuanyin_socre]" value="{$examlist[0]['score']['yuanyin_socre']}"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                        </tr>-->
+<!--                        <tr>-->
+<!--                            <td>故障部位少写或错写1条扣1分</td>-->
+<!--                            <td><input type="text" name="row[0][buwei_score]" value="{$examlist[0]['score']['buwei_score']}"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                        </tr>-->
+<!--                        <tr>-->
+<!--                            <td>排除方法少写或错写1条扣1分</td>-->
+<!--                            <td><input type="text" name="row[0][fangfa_score]" value="{$examlist[0]['score']['fangfa_score']}"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                        </tr>-->
+<!--                        <tr>-->
+<!--                            <td>修复结论错扣2分</td>-->
+<!--                            <td><input type="text" name="row[0][jielun_score]" value="{$examlist[0]['score']['jielun_score']}"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                        </tr>-->
+<!--                        <tr>-->
+<!--                            <td colspan="11" style="text-align: left;padding-left: 1%">三.维修时间(10分)</td>-->
+<!--                        </tr>-->
+<!--                        <tr>-->
+<!--                            <td>按没超过1分钟扣1分的比例扣分</td>-->
+<!--                            <td><input type="text" name="row[0][overtime_score]" value="{$examlist[0]['score']['overtime_score']}"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                            <td><input type="text"></td>-->
+<!--                        </tr>-->
+<!--                        <tr>-->
+<!--                            <td>总分</td>-->
+<!--                            <td>{$examlist[0]['total_score']}</td>-->
+<!--                            <td></td>-->
+<!--                            <td></td>-->
+<!--                            <td></td>-->
+<!--                            <td></td>-->
+<!--                            <td></td>-->
+<!--                            <td></td>-->
+<!--                            <td></td>-->
+<!--                            <td></td>-->
+<!--                            <td></td>-->
+<!--                        </tr>-->
+<!--                    </table>-->
+<!--                </div>-->
+<!--            </div>-->
+<!--            <div class="form-group layer-footer" style="margin-top: 3%;text-align: center">-->
+<!--                <label class="control-label col-xs-12 col-sm-2"></label>-->
+<!--                <div class="col-xs-12 col-sm-8">-->
+<!--                    <button type="submit" class="btn btn-info">{:__('确认成绩并结束本批次考试')}</button>-->
+<!--                </div>-->
+<!--            </div>-->
+<!--        </form>-->
+<!--    </div>-->
 </div>

+ 23 - 1
public/assets/js/backend/student/collection.js

@@ -110,9 +110,31 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                     }
                 }, 1000);
             });
+
+            $(document).on('click', '.btn-replace', function () {
+                console.log($(".other_replace").val());
+                $.ajax({
+                    url: "student/collection/replace/ids/"+Config.ids,
+                    type: 'post',
+                    data: {
+                        other_replace: $(".other_replace").val(),
+                    },
+                    success: function (data) {
+                        if(data.code==1){
+                            window.location.reload();
+                        }
+                        if(data.code==0){
+                            Layer.alert(data.msg);
+                        }
+                    }
+                });
+            });
+            console.log(Config.other_replace_arr)
+
             Form.api.bindevent($("form[role=form]"), function(data, ret) {
                 if(ret.code==1){
-                    Backend.api.addtabs( ret.url,'得分分析');
+                    // Backend.api.addtabs( ret.url,'得分分析');
+                    Backend.api.addtabs( ret.url);
                 }
             });
         },

+ 51 - 63
public/assets/js/backend/teacher/collection.js

@@ -69,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/collection/edit',
-                                },{
-                                    name: 'dispatch',
-                                    text: '',
-                                    icon: 'fa fa-trash',
-                                    title: '删除',
-                                    classname: 'btn btn-danger btn-xs btn-magic btn-ajax',
-                                    url: 'teacher/collection/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/collection/del',
+                                //     confirm: '确定要删除吗?',
+                                //     success: function (data, ret) {
+                                //         $(".btn-refresh").trigger("click");
+                                //     },
+                                //     error: function (data, ret) {
+                                //         Layer.alert(ret.msg);
+                                //         return false;
+                                //     }
+                                // }
                             ],
                         }
                     ]
@@ -95,48 +96,6 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
             Table.api.bindevent(table);
         },
         add: function () {
-            // Table.api.init({
-            //     extend: {
-            //         index_url: 'department/admin/departadmintotal' + location.search,
-            //     }
-            // });
-            // var table = $("#table1");
-            // // 初始化表格
-            // table.bootstrapTable({
-            //     url: $.fn.bootstrapTable.defaults.extend.index_url,
-            //     pk: 'id',
-            //     sortName: 'id',
-            //     fixedColumns: true,
-            //     fixedRightNumber: 1,
-            //     searchFormVisible:false,
-            //     Search:false,
-            //     columns: [
-            //         [
-            //             {checkbox: true},
-            //             {field: 'department_name', title: __('区队名称'), operate: false,width: '400px', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
-            //             {field: 'department_admin_count', title: __('全部人员数量'),operate: false},
-            //         ]
-            //     ]
-            // });
-            //
-            // // 为表格绑定事件
-            // Table.api.bindevent(table);
-
-            //全选
-            $("input[name='btSelectAll']").click(function () {
-                var ids = Table.api.selectedids(table);
-                console.log(ids);
-                $(".depart_ids").val(ids);
-            });
-            //单个选择
-            // $("#table1>.selected>.bs-checkbox>input[name='btSelectItem']").click(function () {
-            //     alert('111111')
-            //     console.log('asdfasdf')
-            //     console.log($("#table").bootstrapTable('getSelections'));
-            //     console.log('asdfasdf')
-            //     // var ids =  Table.api.selectedids(table);
-            //     // $(".banjiid").val(ids);
-            // });
             Controller.api.bindevent();
         },
         edit: function () {
@@ -144,6 +103,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,
@@ -161,7 +121,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},
                         ]
@@ -172,12 +141,31 @@ 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());
                 });
 
+                // $("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]"));
             }
         }

+ 138 - 41
public/assets/js/backend/teacher/exams.js

@@ -107,7 +107,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
             Table.api.init({
                 extend: {
                     index_url: 'teacher/exams/persent' + location.search,
-                    indexed_url: 'teacher/exams/index' + location.search,
+                    indexed_url: 'teacher/exams/examing' + location.search,
                     table: 'teacher_exams',
                 }
             });
@@ -116,8 +116,8 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
             // 初始化表格
             table.bootstrapTable({
                 url: $.fn.bootstrapTable.defaults.extend.index_url,
-                pk: 'exam_id',
-                sortName: 'exam_id',
+                pk: 'rel_id',
+                sortName: 'rel_id',
                 toolbar: '#toolbar',
                 fixedColumns: true,
                 fixedRightNumber: 1,
@@ -125,24 +125,58 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                 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");
+                                    },
+                                }
                             ],
                         }
                     ]
@@ -167,31 +201,39 @@ 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: __('考试成绩')},
+                        // {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',
+                        //         // }
+                        //     ],
+                        // }
                     ]
                 ]
             });
@@ -200,6 +242,61 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
             Table.api.bindevent(table1);
 
 
+
+            var table2 = $("#table2");
+            // 初始化表格
+            table2.bootstrapTable({
+                url: $.fn.bootstrapTable.defaults.extend.indexed_url,
+                pk: 'exam_id',
+                sortName: 'exam_id',
+                toolbar: '#toolbar2',
+                fixedColumns: true,
+                pageSize: 10,
+                pagination:false,
+                fixedRightNumber: 1,
+                searchFormVisible:false,
+                columns: [
+                    [
+                        // {checkbox: true},
+                        {field: 'seat_id', title: __('座号')},
+                        {field: 'user_username', title: __('学员学号')},
+                        {field: 'user_nickname', title: __('学员姓名')},
+                        {field: 'total_score', title: __('考试成绩')},
+                        {field: '', title: __('总分')},
+                        {field: '', title: __('故障一未排除扣25分')},
+                        {field: '', title: __('故障二未排除扣25分')},
+                        {field: '', title: __('故障三未排除扣25分')},
+                        {field: '', title: __('故障现象少写或错写1条扣1分')},
+                        {field: '', title: __('可能原因少写或错写1条扣1分')},
+                        {field: '', title: __('故障部位少写或错写1条扣1分')},
+                        {field: '', title: __('排除方法少写或错写1条扣1分')},
+                        {field: '', title: __('修复结论错扣2分')},
+                        {field: '', title: __('按每超时1分钟扣分的比例扣分')},
+                        // {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',
+                        //         // }
+                        //     ],
+                        // }
+                    ]
+                ]
+            });
+
+            // 为表格绑定事件
+            Table.api.bindevent(table2);
+
         },
         add: function () {
             Controller.api.bindevent();

+ 77 - 25
public/assets/js/backend/teacher/task.js

@@ -37,8 +37,8 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                             }
                         },
                         {field: 'name', title: __('Name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
-                        {field: '', title: __('故障现象数量')},
-                        {field: '', title: __('故障部位数量')},
+                        {field: 'xianxiang_count', title: __('故障现象数量')},
+                        {field: 'buwei_count', title: __('故障部位数量')},
                         {field: 'create_by', title: __('Create_by'), operate: 'LIKE'},
                         {field: 'createtime', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false,formatter: Table.api.formatter.datetime},
                         // {field: 'update_by', title: __('Update_by'), operate: 'LIKE'},
@@ -90,29 +90,6 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
         },
         api: {
             bindevent: function () {
-                // 选中全部
-                $(".btnselectall").click(function () {
-                    $("input[name='checkbox']").each(function (){
-                        console.log( $( this ).val());
-                        // if ($( this ).attr( "checked" )) {
-                        //     $(this).removeAttr( "checked" );
-                        // } else {
-                            $(this).attr( "checked" , "true" );
-                            $(".fault_ids").val($(this).val()+','+$(".fault_ids").val());
-                        // }
-                    });
-                });
-                //取消选择
-                $(".cancelselectall").click(function () {
-                    $("input[name='checkbox']").each(function (){
-                        console.log( $( this ).val());
-                        if ($( this ).attr( "checked" )) {
-                             $(this).removeAttr( "checked" );
-                            $(".fault_ids").val('');
-                        }
-                    });
-                });
-
                 $('select[name="row[sim_type]"]').change(function () {
                     $(".fault_ids").val('');
                     console.log($(this).val());
@@ -179,6 +156,81 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                         }
                     });
                 });
+
+                var rel_Ids = [];
+                $(document).on('click', "input[type='checkbox']", function () {
+                    // console.log($(this).val());
+                    if ($(this).attr("checked")) {
+                        $(this).removeAttr("checked");
+                        var index = rel_Ids.indexOf($(this).val());
+                        if (index > -1) {
+                            rel_Ids.splice(index, 1);
+                        }
+                        $(".fault_ids").val(rel_Ids.join(','));
+                    } else {
+                        $(this).attr("checked", "true");
+                        rel_Ids.push($(this).val());
+                       $(".fault_ids").val(rel_Ids.join())
+                   }
+                });
+
+
+                // 选中全部
+                $(document).on('click', ".btnselectall", function () {
+                    rel_Ids = [];
+                    $("input[name='checkbox']").each(function (){
+                        $(this).attr( "checked" , "true");
+                        // console.log(rel_Ids+'####')
+                        // if(!$.inArray($(this).val(),rel_Ids)){
+                        //     var index = rel_Ids.indexOf($(this).val());
+                        //     if (index > -1) {
+                        //         rel_Ids.splice(index, 1);
+                        //     }
+                        //     // $(".fault_ids").val(rel_Ids.join(','));
+                        //     // rel_Ids = arr;
+                        // }else{
+                        //     rel_Ids.push($(this).val());
+                        // }
+                        // //
+                        rel_Ids.push($(this).val());
+                        $(".fault_ids").val(rel_Ids);
+                    });
+                });
+                //取消选择
+                $(document).on('click', ".cancelselectall", function () {
+                    $("input[name='checkbox']").each(function (){
+                        var index = rel_Ids.indexOf($(this).val());
+                        if (index > -1) {
+                            rel_Ids.splice(index, 1);
+                        }
+                        $(".fault_ids").val(rel_Ids.join(','));
+                        $(this).removeAttr("checked");
+                    });
+                });
+
+                // $(".btnselectall").click(function () {
+                //     $("input[name='checkbox']").each(function (){
+                //         console.log( $( this ).val());
+                //         // if ($( this ).attr( "checked" )) {
+                //         //     $(this).removeAttr( "checked" );
+                //         // } else {
+                //             $(this).attr( "checked" , "true" );
+                //             $(".fault_ids").val($(this).val()+','+$(".fault_ids").val());
+                //         // }
+                //     });
+                // });
+                // //取消选择
+                // $(".cancelselectall").click(function () {
+                //     $("input[name='checkbox']").each(function (){
+                //         console.log( $( this ).val());
+                //         if ($( this ).attr( "checked" )) {
+                //              $(this).removeAttr( "checked" );
+                //             $(".fault_ids").val('');
+                //         }
+                //     });
+                // });
+
+
                 Form.api.bindevent($("form[role=form]"));
             }
         }