123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347 |
- <%@page contentType="text/html" pageEncoding="UTF-8"%>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title></title>
- <%@include file="../../../include.jsp"%>
- <script type="text/javascript" src="<%=path%>/scripts/business/am/org/maintenance/orgSel.js"></script>
- <script type="text/javascript" src="<%=path%>/scripts/business/em/evaluate/admin/sysAdminEdit.js"></script>
- <script type="text/javascript">
- var fd_id = "<%=request.getParameter("fd_id")%>"
- //取得用户id
- var user_id = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
- var user_name = top.com.sinosoft.lz.system.user.LoginInfo.getReal_name();
- var corp_id = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
- $(function() {
- /* $("#QUESTION_AREA_NAME_365").OrgSel({selectedMulti : true,loadId_in:corp_id,setMulti : {
- "Y" : "s",
- "N" : "s"
- }}); */
- $("#TITLE_TEMPLATE_601").initYewuSelect("602","FD_OBJECTID","TEMPLATE_NAME"," IS_DEL='0' and WRITER_DEPT = '"+corp_id+"' order by updatedate desc"); //模板
- //设置标题
- if(""==fd_id){
- $(".titleShow").text("新增考试任务");
- $("#WRITER_ID_601").val(user_id);
- $("#WRITER_NAME_601").val(user_name);
- $("#WRITER_DEPT_601").val(corp_id);
- }else{
- $(".titleShow").text("修改考试任务");
- var url = $.pathname() + '/ws/crud/CRUDService/getDataById/';
- var params = {
- classid : '601',
- objectID : fd_id
- };
- $.request.query(url,params,function(data){
- $('#editForm').ajaxWrite({data:data});
- $('#editForm input[name="classid"]').val('601');
- if(data.TITLE_TEMPLATE_601!=""){
- templateChange();
- }
- var sum = data.QUESTION_SUM_601.split(",");
- var score = data.QUESTION_TOTAL_SCORE_601.split(",");
- for(var i=0;i<sum.length;i++){
- $("input[name='QUESTION_SUM']").eq(i).val(sum[i]);
- $("input[name='QUESTION_TOTAL_SCORE']").eq(i).val(score[i])
- }
- })
- }
-
- //返回
- $("#back").hover(function(){
- $(this).attr("src","/nwyj/images/temp/back_hover.png");
- },function(){
- $(this).attr("src","/nwyj/images/temp/back.png");
- });
-
- $("#back").bind("click",goBack);
-
- $('#save').bind('click',function(){
- save();
- });
-
- $("#dept_select").on('click',function(){
- var diag = new top.Dialog();
- diag.Title = '单位选择';
- diag.URL = $.pathname() + '/page/business/exercise/examineManagement/deptSelect.jsp';
- diag.OkButtonText = '确定';
- diag.OKEvent = function(){
- var dept_ids = diag.innerFrame.contentWindow.$("#dept_id").val();
- $("#EXAMINATION_AREA_ID_601").val(dept_ids);
- diag.close();
- setHight();
- };
- diag.CancelEvent = function(){
- diag.close();
- setHight();
- };
- diag.Width = 400; //宽度
- diag.Height =400; //高度
- diag.ButtonAlign = 'center';//发送和取消按钮的位置
- diag.show();
- })
-
- $("#show_template").on("click",function(){
- tempId = $("#TITLE_TEMPLATE_601").val();
- if(tempId == ""){
- top.Dialog.alert("请选择模板");
- return;
- }
- $.noIndexOpenNextWindow($.pathname()+ "/page/business/exercise/examineManagement/show_questionTemplate.jsp?template_id="+tempId);
- })
-
- $("#TITLE_TEMPLATE_601").bind("change",function(){
- templateChange();
- })
-
- $("input[name='QUESTION_SUM']").bind("change",function(){
- var sum = $(this).val();
- if(sum==0&&sum!=""){
- $(this).val(1)
- }
- })
-
- $("input[name='QUESTION_TOTAL_SCORE']").bind("change",function(){
- var score = $(this).val();
- if(score==0&&score!=""){
- $(this).val(1)
- }
- })
-
- });
-
- function templateChange(){
- var id = $("#TITLE_TEMPLATE_601").val();
- if(id==""){
- for(var i=0;i<4;i++){
- $("input[name='QUESTION_SUM']").eq(i).val("");
- $("input[name='QUESTION_SUM']").eq(i).attr("disabled",false);
- $("input[name='QUESTION_TOTAL_SCORE']").eq(i).val("");
- $("input[name='QUESTION_TOTAL_SCORE']").eq(i).attr("disabled",false);
- }
- }else{
- for(var i=0;i<4;i++){
- $("input[name='QUESTION_SUM']").eq(i).val("");
- $("input[name='QUESTION_SUM']").eq(i).attr("disabled",false);
- $("input[name='QUESTION_TOTAL_SCORE']").eq(i).attr("disabled",false);
- }//disabled="disabled"
- $.ajax({
- url : $.pathname() + '/ws/Examine/ExamineManagementService/getQuestionTypeByTemplate/',
- type : 'post',
- dataType : 'json',
- data:{templateId:id},
- success: function(data){
- var str = '';
- for(var i=0;i<data.length;i++){
- var type = data[i].QUESTION_TYPE;
- var count = data[i].COUNT;
- if(type =="1"){
- $("input[name='QUESTION_SUM']").eq(0).val(count);
- str+= "1";
- }
- if(type =="2"){
- $("input[name='QUESTION_SUM']").eq(1).val(count);
- str+= "2";
- }
- if(type =="3"){
- $("input[name='QUESTION_SUM']").eq(2).val(count);
- str+= "3";
- }
- if(type =="4"){
- $("input[name='QUESTION_SUM']").eq(3).val(count);
- str+= "4";
- }
-
- }
- for(var i=1;i<5;i++){
- $("input[name='QUESTION_SUM']").eq(i-1).attr("disabled","disabled");
- if(str.indexOf(i)==-1){
- $("input[name='QUESTION_TOTAL_SCORE']").eq(i-1).attr("disabled","disabled");
- }
- }
- }
- })
- }
- }
-
- save = function(){
- var question_num = $("input[name='QUESTION_SUM']");
- var question_total_score = $("input[name='QUESTION_TOTAL_SCORE']");
- var questionNum='';
- var questionScore='';
- var totalScore = 0;//总分
- for(var i=0;i<question_num.length;i++){
- var num = question_num.eq(i).val();
- var score = question_total_score.eq(i).val();
- if((num==""&&score!="")||(num!=""&&score=="")){
- var name ="";
- if(i==0){name="单选";}
- if(i==1){name="多选";}
- if(i==2){name="判断";}
- if(i==3){name="情景";}
- top.Dialog.alert("请将"+name+"题填写完整!");
- return;
- }
- if(score!=""){
- totalScore += parseInt(score);//统计分数
- }
- questionNum+= num+",";
- questionScore+= score+",";
- }
-
- $("#QUESTION_SUM_601").val(questionNum.substring(0, questionNum.length-1));
- $("#QUESTION_TOTAL_SCORE_601").val(questionScore.substring(0, questionScore.length-1));
-
- $form = $('#editForm');
- var valid = $form.validationEngine({returnIsValid: true});
- if(!valid){
- top.Dialog.alert(CHECKREDBOX);
- return;
- }
- var areaId = $("#EXAMINATION_AREA_ID_601").val();
- if(areaId == ""){
- top.Dialog.alert("请选择考试范围");
- return;
- }
- if(totalScore!=100){
- top.Dialog.alert("题目总分不等于100分!");
- totalScore = 0;
- return;
- }
- if(valid){
- showProgressBar("正在提交中...");
- var url = $.pathname() + '/ws/crud/CRUDService/create/';
- if(fd_id!=undefined&&fd_id!=""){
- url = $.pathname() + '/ws/crud/CRUDService/update/';
- }
- var formValue = $form.serialize();
-
- $.request.add(url,formValue,function(data){//保存题目主表数据
- top.Dialog.alert("保存成功!");
- $('#frmright',window.parent.document).attr('src',$.pathname()+"/page/business/exercise/examineManagement/questionTask.jsp");
- });
- }
- }
-
- function goBack() {
- //获取iframe中的元素值
- var iframe = parent.document.getElementsByName("frmright")[0];
- iframe.src = "/nwyj/page/business/exercise/examineManagement/questionTask.jsp";
- }
-
- </script>
- <style >
- .mybox{
- width: 1000px;
- margin: 10px auto;
- padding: 10px 20px;
- background: #fff;
- padding-bottom:60px;
- }
- .class_color{
- background-color: rgb(237, 239, 253);
- }
- </style>
- </head>
- <body >
- <div class="mybox" id="formContent" align="center">
- <div class="" align="center">
- <a href="javascript:;"><img id="back" align="left" src="/nwyj/images/temp/back.png" /></a>
- <font style="font-weight: bold;font-size: 20px;line-height: 45px;" class="titleShow"> </font>
- </div>
- <form id="editForm">
- <input name="classid" value="601" type="hidden" />
- <input name="FD_OBJECTID601" id="FD_OBJECTID601" type="hidden" />
- <input id="WRITER_ID_601" name="WRITER_ID_601" type="hidden" />
- <input id="WRITER_NAME_601" name="WRITER_NAME_601" type="hidden" />
- <input id="WRITER_DEPT_601" name="WRITER_DEPT_601" type="hidden" />
- <input id="STATE_601" name="STATE_601" value="0" type="hidden" />
- <input id="EXAMINATION_AREA_ID_601" name="EXAMINATION_AREA_ID_601" value="" type="hidden"/>
- <input id="QUESTION_SUM_601" name="QUESTION_SUM_601" value="" type="hidden"/>
- <input id="QUESTION_TOTAL_SCORE_601" name="QUESTION_TOTAL_SCORE_601" value="" type="hidden"/>
- <!-- 保存和重置 -->
- <br />
- <div class="" align="right" >
- <input value="保存" type="button" id="save" />
- <input value="重置" type="button" id="reset" onclick="formReset();"/>
- <!-- 新增重置 -->
- </div>
- <br />
- <!-- 正文表格 -->
- <table class="tableStyle" align="center" id="contentTable">
- <tr>
- <td colspan="1" align="right" class="class_color">题目模板:</td>
- <td colspan="3" align="left">
- <select editable=false name="TITLE_TEMPLATE_601" id="TITLE_TEMPLATE_601" selAlign="" prompt="请选择" selWidth="500"></select>
- <span style="margin:10px 10px"><input type="button" id="show_template" value="浏览模板"/></span>
- </td>
- </tr>
- <tr>
- <td colspan="1" align="right" class="class_color" ><span class="star">*</span>任务名称:</td>
- <td colspan="3" align="left">
- <input type="text" id="TASK_NAME_601" name="TASK_NAME_601" class="validate[required]" maxlength="100" style="width: 500px"/>
- </td>
- </tr>
- <tr>
- <td colspan="1" align="right" class="class_color" ><span class="star">*</span>开始时间:</td>
- <td colspan="3" align="left">
- <input style="width: 500px" type="text" id="START_TIME_601" name="START_TIME_601" class="validate[required] date" dateFmt="yyyy-MM-dd HH:mm:ss"/>
- </td>
- </tr>
- <tr>
- <td colspan="1" align="right" class="class_color" ><span class="star">*</span>结束时间:</td>
- <td colspan="3" align="left">
- <input style="width: 500px" type="text" id="END_TIME_601" name="END_TIME_601" class="validate[required] date" dateFmt="yyyy-MM-dd HH:mm:ss"/>
- </td>
- </tr>
- <tr>
- <td colspan="1" align="right" class="class_color" ><span class="star">*</span>考试时间:</td>
- <td colspan="3" align="left">
- <input type="text" id="QUESTION_TIME_601" name="QUESTION_TIME_601" inputMode="numberOnly" class="validate[required]" maxlength="10" style="width: 160px"/> 分钟
- </td>
- </tr>
- <tr>
- <td align="right" width="120px" class="class_color"><span class="star">*</span>考试范围:</td>
- <td colspan="3"><!-- <div style="width: 826px;" allclickset="1" id="QUESTION_AREA_NAME_365"></div> -->
- <input type="button" id="dept_select" value="选择单位范围"/>
- </td>
- </tr>
- <tr>
- <td colspan="1" rowspan="4" align="right" class="class_color" ><span class="star">*</span>题目分数:</td>
- <td colspan="3" align="left">
- <label>单选题数:</label>
- <input type="text" name="QUESTION_SUM" inputMode="numberOnly" maxlength="3" style="width: 160px;text-align:center;"/>
- <label style="margin-left:20px">总分值:</label>
- <input type="text" name="QUESTION_TOTAL_SCORE" inputMode="numberOnly" maxlength="3" style="width: 160px;text-align:center;"/>
- </td>
- </tr>
- <tr>
- <td colspan="3" align="left">
- <label>多选题数:</label>
- <input type="text" name="QUESTION_SUM" inputMode="numberOnly" maxlength="3" style="width: 160px;text-align:center;"/>
- <label style="margin-left:20px">总分值:</label>
- <input type="text" name="QUESTION_TOTAL_SCORE" inputMode="numberOnly" maxlength="3" style="width: 160px;text-align:center;"/>
- </td>
- </tr>
- <tr>
- <td colspan="3" align="left">
- <label>判断题数:</label>
- <input type="text" name="QUESTION_SUM" inputMode="numberOnly" maxlength="3" style="width: 160px;text-align:center;"/>
- <label style="margin-left:20px">总分值:</label>
- <input type="text" name="QUESTION_TOTAL_SCORE" inputMode="numberOnly" maxlength="3" style="width: 160px;text-align:center;"/>
- </td>
- </tr>
- <tr>
- <td colspan="3" align="left">
- <label>情景题数:</label>
- <input type="text" name="QUESTION_SUM" inputMode="numberOnly" maxlength="3" style="width: 160px;text-align:center;"/>
- <label style="margin-left:20px">总分值:</label>
- <input type="text" name="QUESTION_TOTAL_SCORE" inputMode="numberOnly" maxlength="3" style="width: 160px;text-align:center;"/>
- </td>
- </tr>
- </table>
- </form>
- </div>
- </body>
- </html>
|