0e5a05ef0d1d1ab0b3f3c1f3d65f4905364c8bbb.svn-base 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347
  1. <%@page contentType="text/html" pageEncoding="UTF-8"%>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6. <title></title>
  7. <%@include file="../../../include.jsp"%>
  8. <script type="text/javascript" src="<%=path%>/scripts/business/am/org/maintenance/orgSel.js"></script>
  9. <script type="text/javascript" src="<%=path%>/scripts/business/em/evaluate/admin/sysAdminEdit.js"></script>
  10. <script type="text/javascript">
  11. var fd_id = "<%=request.getParameter("fd_id")%>"
  12. //取得用户id
  13. var user_id = top.com.sinosoft.lz.system.user.LoginInfo.getUser_id();
  14. var user_name = top.com.sinosoft.lz.system.user.LoginInfo.getReal_name();
  15. var corp_id = top.com.sinosoft.lz.system.user.LoginInfo.getCorp_ids();
  16. $(function() {
  17. /* $("#QUESTION_AREA_NAME_365").OrgSel({selectedMulti : true,loadId_in:corp_id,setMulti : {
  18. "Y" : "s",
  19. "N" : "s"
  20. }}); */
  21. $("#TITLE_TEMPLATE_601").initYewuSelect("602","FD_OBJECTID","TEMPLATE_NAME"," IS_DEL='0' and WRITER_DEPT = '"+corp_id+"' order by updatedate desc"); //模板
  22. //设置标题
  23. if(""==fd_id){
  24. $(".titleShow").text("新增考试任务");
  25. $("#WRITER_ID_601").val(user_id);
  26. $("#WRITER_NAME_601").val(user_name);
  27. $("#WRITER_DEPT_601").val(corp_id);
  28. }else{
  29. $(".titleShow").text("修改考试任务");
  30. var url = $.pathname() + '/ws/crud/CRUDService/getDataById/';
  31. var params = {
  32. classid : '601',
  33. objectID : fd_id
  34. };
  35. $.request.query(url,params,function(data){
  36. $('#editForm').ajaxWrite({data:data});
  37. $('#editForm input[name="classid"]').val('601');
  38. if(data.TITLE_TEMPLATE_601!=""){
  39. templateChange();
  40. }
  41. var sum = data.QUESTION_SUM_601.split(",");
  42. var score = data.QUESTION_TOTAL_SCORE_601.split(",");
  43. for(var i=0;i<sum.length;i++){
  44. $("input[name='QUESTION_SUM']").eq(i).val(sum[i]);
  45. $("input[name='QUESTION_TOTAL_SCORE']").eq(i).val(score[i])
  46. }
  47. })
  48. }
  49. //返回
  50. $("#back").hover(function(){
  51. $(this).attr("src","/nwyj/images/temp/back_hover.png");
  52. },function(){
  53. $(this).attr("src","/nwyj/images/temp/back.png");
  54. });
  55. $("#back").bind("click",goBack);
  56. $('#save').bind('click',function(){
  57. save();
  58. });
  59. $("#dept_select").on('click',function(){
  60. var diag = new top.Dialog();
  61. diag.Title = '单位选择';
  62. diag.URL = $.pathname() + '/page/business/exercise/examineManagement/deptSelect.jsp';
  63. diag.OkButtonText = '确定';
  64. diag.OKEvent = function(){
  65. var dept_ids = diag.innerFrame.contentWindow.$("#dept_id").val();
  66. $("#EXAMINATION_AREA_ID_601").val(dept_ids);
  67. diag.close();
  68. setHight();
  69. };
  70. diag.CancelEvent = function(){
  71. diag.close();
  72. setHight();
  73. };
  74. diag.Width = 400; //宽度
  75. diag.Height =400; //高度
  76. diag.ButtonAlign = 'center';//发送和取消按钮的位置
  77. diag.show();
  78. })
  79. $("#show_template").on("click",function(){
  80. tempId = $("#TITLE_TEMPLATE_601").val();
  81. if(tempId == ""){
  82. top.Dialog.alert("请选择模板");
  83. return;
  84. }
  85. $.noIndexOpenNextWindow($.pathname()+ "/page/business/exercise/examineManagement/show_questionTemplate.jsp?template_id="+tempId);
  86. })
  87. $("#TITLE_TEMPLATE_601").bind("change",function(){
  88. templateChange();
  89. })
  90. $("input[name='QUESTION_SUM']").bind("change",function(){
  91. var sum = $(this).val();
  92. if(sum==0&&sum!=""){
  93. $(this).val(1)
  94. }
  95. })
  96. $("input[name='QUESTION_TOTAL_SCORE']").bind("change",function(){
  97. var score = $(this).val();
  98. if(score==0&&score!=""){
  99. $(this).val(1)
  100. }
  101. })
  102. });
  103. function templateChange(){
  104. var id = $("#TITLE_TEMPLATE_601").val();
  105. if(id==""){
  106. for(var i=0;i<4;i++){
  107. $("input[name='QUESTION_SUM']").eq(i).val("");
  108. $("input[name='QUESTION_SUM']").eq(i).attr("disabled",false);
  109. $("input[name='QUESTION_TOTAL_SCORE']").eq(i).val("");
  110. $("input[name='QUESTION_TOTAL_SCORE']").eq(i).attr("disabled",false);
  111. }
  112. }else{
  113. for(var i=0;i<4;i++){
  114. $("input[name='QUESTION_SUM']").eq(i).val("");
  115. $("input[name='QUESTION_SUM']").eq(i).attr("disabled",false);
  116. $("input[name='QUESTION_TOTAL_SCORE']").eq(i).attr("disabled",false);
  117. }//disabled="disabled"
  118. $.ajax({
  119. url : $.pathname() + '/ws/Examine/ExamineManagementService/getQuestionTypeByTemplate/',
  120. type : 'post',
  121. dataType : 'json',
  122. data:{templateId:id},
  123. success: function(data){
  124. var str = '';
  125. for(var i=0;i<data.length;i++){
  126. var type = data[i].QUESTION_TYPE;
  127. var count = data[i].COUNT;
  128. if(type =="1"){
  129. $("input[name='QUESTION_SUM']").eq(0).val(count);
  130. str+= "1";
  131. }
  132. if(type =="2"){
  133. $("input[name='QUESTION_SUM']").eq(1).val(count);
  134. str+= "2";
  135. }
  136. if(type =="3"){
  137. $("input[name='QUESTION_SUM']").eq(2).val(count);
  138. str+= "3";
  139. }
  140. if(type =="4"){
  141. $("input[name='QUESTION_SUM']").eq(3).val(count);
  142. str+= "4";
  143. }
  144. }
  145. for(var i=1;i<5;i++){
  146. $("input[name='QUESTION_SUM']").eq(i-1).attr("disabled","disabled");
  147. if(str.indexOf(i)==-1){
  148. $("input[name='QUESTION_TOTAL_SCORE']").eq(i-1).attr("disabled","disabled");
  149. }
  150. }
  151. }
  152. })
  153. }
  154. }
  155. save = function(){
  156. var question_num = $("input[name='QUESTION_SUM']");
  157. var question_total_score = $("input[name='QUESTION_TOTAL_SCORE']");
  158. var questionNum='';
  159. var questionScore='';
  160. var totalScore = 0;//总分
  161. for(var i=0;i<question_num.length;i++){
  162. var num = question_num.eq(i).val();
  163. var score = question_total_score.eq(i).val();
  164. if((num==""&&score!="")||(num!=""&&score=="")){
  165. var name ="";
  166. if(i==0){name="单选";}
  167. if(i==1){name="多选";}
  168. if(i==2){name="判断";}
  169. if(i==3){name="情景";}
  170. top.Dialog.alert("请将"+name+"题填写完整!");
  171. return;
  172. }
  173. if(score!=""){
  174. totalScore += parseInt(score);//统计分数
  175. }
  176. questionNum+= num+",";
  177. questionScore+= score+",";
  178. }
  179. $("#QUESTION_SUM_601").val(questionNum.substring(0, questionNum.length-1));
  180. $("#QUESTION_TOTAL_SCORE_601").val(questionScore.substring(0, questionScore.length-1));
  181. $form = $('#editForm');
  182. var valid = $form.validationEngine({returnIsValid: true});
  183. if(!valid){
  184. top.Dialog.alert(CHECKREDBOX);
  185. return;
  186. }
  187. var areaId = $("#EXAMINATION_AREA_ID_601").val();
  188. if(areaId == ""){
  189. top.Dialog.alert("请选择考试范围");
  190. return;
  191. }
  192. if(totalScore!=100){
  193. top.Dialog.alert("题目总分不等于100分!");
  194. totalScore = 0;
  195. return;
  196. }
  197. if(valid){
  198. showProgressBar("正在提交中...");
  199. var url = $.pathname() + '/ws/crud/CRUDService/create/';
  200. if(fd_id!=undefined&&fd_id!=""){
  201. url = $.pathname() + '/ws/crud/CRUDService/update/';
  202. }
  203. var formValue = $form.serialize();
  204. $.request.add(url,formValue,function(data){//保存题目主表数据
  205. top.Dialog.alert("保存成功!");
  206. $('#frmright',window.parent.document).attr('src',$.pathname()+"/page/business/exercise/examineManagement/questionTask.jsp");
  207. });
  208. }
  209. }
  210. function goBack() {
  211. //获取iframe中的元素值
  212. var iframe = parent.document.getElementsByName("frmright")[0];
  213. iframe.src = "/nwyj/page/business/exercise/examineManagement/questionTask.jsp";
  214. }
  215. </script>
  216. <style >
  217. .mybox{
  218. width: 1000px;
  219. margin: 10px auto;
  220. padding: 10px 20px;
  221. background: #fff;
  222. padding-bottom:60px;
  223. }
  224. .class_color{
  225. background-color: rgb(237, 239, 253);
  226. }
  227. </style>
  228. </head>
  229. <body >
  230. <div class="mybox" id="formContent" align="center">
  231. <div class="" align="center">
  232. <a href="javascript:;"><img id="back" align="left" src="/nwyj/images/temp/back.png" /></a>
  233. <font style="font-weight: bold;font-size: 20px;line-height: 45px;" class="titleShow"> </font>
  234. </div>
  235. <form id="editForm">
  236. <input name="classid" value="601" type="hidden" />
  237. <input name="FD_OBJECTID601" id="FD_OBJECTID601" type="hidden" />
  238. <input id="WRITER_ID_601" name="WRITER_ID_601" type="hidden" />
  239. <input id="WRITER_NAME_601" name="WRITER_NAME_601" type="hidden" />
  240. <input id="WRITER_DEPT_601" name="WRITER_DEPT_601" type="hidden" />
  241. <input id="STATE_601" name="STATE_601" value="0" type="hidden" />
  242. <input id="EXAMINATION_AREA_ID_601" name="EXAMINATION_AREA_ID_601" value="" type="hidden"/>
  243. <input id="QUESTION_SUM_601" name="QUESTION_SUM_601" value="" type="hidden"/>
  244. <input id="QUESTION_TOTAL_SCORE_601" name="QUESTION_TOTAL_SCORE_601" value="" type="hidden"/>
  245. <!-- 保存和重置 -->
  246. <br />
  247. <div class="" align="right" >
  248. <input value="保存" type="button" id="save" />
  249. <input value="重置" type="button" id="reset" onclick="formReset();"/>
  250. <!-- 新增重置 -->
  251. </div>
  252. <br />
  253. <!-- 正文表格 -->
  254. <table class="tableStyle" align="center" id="contentTable">
  255. <tr>
  256. <td colspan="1" align="right" class="class_color">题目模板:</td>
  257. <td colspan="3" align="left">
  258. <select editable=false name="TITLE_TEMPLATE_601" id="TITLE_TEMPLATE_601" selAlign="" prompt="请选择" selWidth="500"></select>
  259. <span style="margin:10px 10px"><input type="button" id="show_template" value="浏览模板"/></span>
  260. </td>
  261. </tr>
  262. <tr>
  263. <td colspan="1" align="right" class="class_color" ><span class="star">*</span>任务名称:</td>
  264. <td colspan="3" align="left">
  265. <input type="text" id="TASK_NAME_601" name="TASK_NAME_601" class="validate[required]" maxlength="100" style="width: 500px"/>
  266. </td>
  267. </tr>
  268. <tr>
  269. <td colspan="1" align="right" class="class_color" ><span class="star">*</span>开始时间:</td>
  270. <td colspan="3" align="left">
  271. <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"/>
  272. </td>
  273. </tr>
  274. <tr>
  275. <td colspan="1" align="right" class="class_color" ><span class="star">*</span>结束时间:</td>
  276. <td colspan="3" align="left">
  277. <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"/>
  278. </td>
  279. </tr>
  280. <tr>
  281. <td colspan="1" align="right" class="class_color" ><span class="star">*</span>考试时间:</td>
  282. <td colspan="3" align="left">
  283. <input type="text" id="QUESTION_TIME_601" name="QUESTION_TIME_601" inputMode="numberOnly" class="validate[required]" maxlength="10" style="width: 160px"/> 分钟
  284. </td>
  285. </tr>
  286. <tr>
  287. <td align="right" width="120px" class="class_color"><span class="star">*</span>考试范围:</td>
  288. <td colspan="3"><!-- <div style="width: 826px;" allclickset="1" id="QUESTION_AREA_NAME_365"></div> -->
  289. <input type="button" id="dept_select" value="选择单位范围"/>
  290. </td>
  291. </tr>
  292. <tr>
  293. <td colspan="1" rowspan="4" align="right" class="class_color" ><span class="star">*</span>题目分数:</td>
  294. <td colspan="3" align="left">
  295. <label>单选题数:</label>
  296. <input type="text" name="QUESTION_SUM" inputMode="numberOnly" maxlength="3" style="width: 160px;text-align:center;"/>
  297. <label style="margin-left:20px">总分值:</label>
  298. <input type="text" name="QUESTION_TOTAL_SCORE" inputMode="numberOnly" maxlength="3" style="width: 160px;text-align:center;"/>
  299. </td>
  300. </tr>
  301. <tr>
  302. <td colspan="3" align="left">
  303. <label>多选题数:</label>
  304. <input type="text" name="QUESTION_SUM" inputMode="numberOnly" maxlength="3" style="width: 160px;text-align:center;"/>
  305. <label style="margin-left:20px">总分值:</label>
  306. <input type="text" name="QUESTION_TOTAL_SCORE" inputMode="numberOnly" maxlength="3" style="width: 160px;text-align:center;"/>
  307. </td>
  308. </tr>
  309. <tr>
  310. <td colspan="3" align="left">
  311. <label>判断题数:</label>
  312. <input type="text" name="QUESTION_SUM" inputMode="numberOnly" maxlength="3" style="width: 160px;text-align:center;"/>
  313. <label style="margin-left:20px">总分值:</label>
  314. <input type="text" name="QUESTION_TOTAL_SCORE" inputMode="numberOnly" maxlength="3" style="width: 160px;text-align:center;"/>
  315. </td>
  316. </tr>
  317. <tr>
  318. <td colspan="3" align="left">
  319. <label>情景题数:</label>
  320. <input type="text" name="QUESTION_SUM" inputMode="numberOnly" maxlength="3" style="width: 160px;text-align:center;"/>
  321. <label style="margin-left:20px">总分值:</label>
  322. <input type="text" name="QUESTION_TOTAL_SCORE" inputMode="numberOnly" maxlength="3" style="width: 160px;text-align:center;"/>
  323. </td>
  324. </tr>
  325. </table>
  326. </form>
  327. </div>
  328. </body>
  329. </html>