mp_rcXcdjl_excelZxxzAdd.ss.jsp 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338
  1. <html>
  2. <head>
  3. <style type="text/css">
  4. .left-div, .right-div {
  5. float: left;
  6. /*width: 48%;*/
  7. height: 94%;
  8. box-sizing: border-box;
  9. position: relative;
  10. }
  11. .left-div {
  12. width: 37%;
  13. }
  14. .right-div {
  15. width: 62.7%;
  16. }
  17. table.list {
  18. margin-left: 0px !important;
  19. }
  20. table.list th{
  21. /* width: 158px;*/
  22. }
  23. table.list td{
  24. /* width: 158px;*/
  25. }
  26. .list-div tr {
  27. border-bottom: 1px solid #e4e4e4;
  28. background-color: #f0f0f0;
  29. }
  30. .list-div tr:hover {
  31. border-bottom: 1px solid #e4e4e4;
  32. background-color: #c7e3fc;
  33. }
  34. .list tr:nth-child(even):hover {
  35. background-color:#c7e3fc;
  36. }
  37. .list-div td {
  38. /*max-width: 140px !important;*/
  39. padding: 0px 12px 0px 12px !important;
  40. }
  41. .list-div th {
  42. padding: 0px 12px 0px 12px !important;
  43. }
  44. .left-button {
  45. width: 100%;
  46. float: left;
  47. text-align: center;
  48. position: absolute;
  49. bottom: 0;
  50. }
  51. .left-div {
  52. margin-right: 1px;
  53. }
  54. .times {
  55. width: 80px !important;
  56. }
  57. .form-text {
  58. overflow: hidden;
  59. text-overflow: ellipsis;
  60. white-space: nowrap;
  61. }
  62. .cjfs {
  63. width: 60px !important;
  64. }
  65. .list tr td {
  66. padding-right: 28px;
  67. }
  68. input::-webkit-outer-spin-button, input::-webkit-inner-spin-button {
  69. -webkit-appearance: none;
  70. }
  71. input[type="text"] {
  72. -moz-appearance: textfield;
  73. width: 65px;
  74. text-align: right;
  75. }
  76. .content-div {
  77. padding-right:15px!important;
  78. }
  79. .xylist {
  80. display: block;
  81. height: 630px;
  82. overflow-y: auto;
  83. }
  84. .list tr{
  85. display: table;
  86. width: 100%;
  87. table-layout: fixed;
  88. }
  89. .list-highlight {
  90. color: #2b368f!important;
  91. font-size: 14px!important;
  92. }
  93. </style>
  94. <script type="text/javascript">
  95. console.log("start!!!");
  96. window.onload = function () { // 加载数据服务,统一为 ByA。Lin
  97. loadXsCj();
  98. }
  99. function loadXsCj(e){
  100. console.log("loadXsCj");
  101. var rcid = ${rcid};
  102. $.ajax({
  103. url : "<serv.ss name='rcXcdjl_excelInitAddByZxxz'/>",
  104. type : 'post',
  105. async : false,
  106. dataType: "json", // 增加。Lin
  107. data : {
  108. 'rcid' : rcid
  109. },
  110. success : function(result) {
  111. /* 改。Lin
  112. * 增加 dataType: "json", 了
  113. * 只有一组数据
  114. var data = eval("(" + result + ")");
  115. //学员信息
  116. var stuData = data.stulist;
  117. */ var stuData = result;
  118. // var stuStr = ""; // 去掉,没用到。Lin
  119. var jlztmBoolean=true;
  120. for (var i in stuData) {
  121. console.log(stuData[i]);
  122. var stu = stuData[i];
  123. var str = "";
  124. if(stu.jlztm && stu.jlztm == 51){//加灰色样式
  125. str += "<tr class='filter'>";
  126. }else{//不加
  127. str += "<tr>";
  128. }
  129. str += "<input type='hidden' value='" + stu.xcdid + "' name='xcdid' />";
  130. str += "<input type='hidden' value='";
  131. if ("xcdjlid" in stu)
  132. str += stu.xcdjlid;
  133. else
  134. str += "null";
  135. str += "' name='xcdjlid' />"; // + stu.ryid + "' name='xyid' />"。Lin
  136. str += "<td style='width:85px;' class='list-highlight'>" + stu.xcdmc + "</td>"; // + stu.xm +。Lin
  137. var jyfs="";
  138. if(stu.jlztm==51){
  139. jyfs=" readonly='true' ";
  140. }
  141. // 情况描述。Lin
  142. str += "<td style='width:120px;text-align: right;'>" +
  143. "<input "+ jyfs +" type='text' value='"+ stu.qkms +"' name='qkms' tab='tabField'"+
  144. " onfocus='keydown_to_tab(this)' onkeypress='if(event.keyCode==13) focusNextInput(this);'/>" +
  145. "</td>";
  146. // 处理描述。Lin
  147. str += "<td style='width:120px;text-align: right;'>" +
  148. "<input "+ jyfs +" type='text' value='"+ stu.clms +"' name='clms' tab='tabField'"+
  149. " onfocus='keydown_to_tab(this)' onkeypress='if(event.keyCode==13) focusNextInput(this);'/>" +
  150. "</td>";
  151. // 责任人。Lin
  152. str += "<td style='width:50px;text-align: right;'>" +
  153. "<input "+ jyfs +" type='text' value='"+ stu.zrr +"' name='zrr' tab='tabField'"+
  154. " onfocus='keydown_to_tab(this)' onkeypress='if(event.keyCode==13) focusNextInput(this);'/>" +
  155. "</td>";
  156. str += "</tr>";
  157. $('.xylist').append($(str));
  158. if(stu.jlztm==1||!stu.jlztm)
  159. jlztmBoolean=false;
  160. }
  161. //if (stuData[0].jlztm && stuData[0].jlztm != 1) {
  162. if(jlztmBoolean){
  163. $('.xylist input').attr("disabled", "disabled");
  164. $('input[name="save"]').attr('disabled', 'disabled');
  165. $('input[name="subm"]').attr('disabled', 'disabled');
  166. $('input[name="save"]').css("color", "#aaa");
  167. $('input[name="subm"]').css("color", "#aaa");
  168. } else {
  169. $('input[name="save"]').attr('disabled', false);
  170. $('input[name="subm"]').attr('disabled', false);
  171. $('input[name="save"]').css("color", "");
  172. $('input[name="subm"]').css("color", "");
  173. }
  174. }
  175. });
  176. }
  177. </script>
  178. </head>
  179. <body>
  180. <!-- 查询 -->
  181. <%-- 再改,点击 保存 按钮后不能关闭弹出窗口的问题 -- <form action= 里增加 dest=。Lin
  182. <form action="" name="cjform" method="post"> --%>
  183. <form action="<serv.ss name='rcXcdjl_excelSaveAddByZxxz' dest='info' parm='{requestParentViewObject:"${requestParentViewObject}"}'/>" method="post">
  184. <input type="hidden" name="xxx" value="${dataType}" />
  185. <input type="hidden" name="rcid" value="${rcid}" />
  186. <div class="list-div list-search-div right-div content-div "
  187. style="height: 90% overflow-x:hidden; min-height:80%;">
  188. <table class="list aa" style=" float:right;width:100%!important;">
  189. <thead style="width: 100%">
  190. <tr style="border:none;">
  191. <th style="padding: 0 0 0 12px;width: 140px;">巡查点</th>
  192. <th style="width:85px;">情况描述</th>
  193. <th style="width: 275px;">处理描述</th>
  194. <th style="width:120px;">责任人</th>
  195. </tr>
  196. </thead>
  197. <tbody ssOddClazz="list-odd" ssEvenClazz="list-even" ssHovClazz="list-hover" class="xylist scrollbar" ssFith="{list:true,rowHeight:35}" >
  198. <rpt.ss name="ssList" id="item">
  199. <tr class="list-dim" >
  200. <td style='width: 205px;'></td>
  201. <td></td>
  202. <td style='width: 275px;'>
  203. <onoff.ss name="qxfs" val="1,2" mode="play" />
  204. </td>
  205. <td></td>
  206. <td></td>
  207. </tr>
  208. </rpt.ss>
  209. </tbody>
  210. </table>
  211. </div>
  212. <div class="bottom-div">
  213. <equal.ss val='${dataType=="play"}' val2="false">
  214. <div class="bottom-down-div">
  215. <%-- 改,二级对象的保存就是提交,新的提交只是放到二级对象草稿箱(不需要确认)。Lin
  216. <in@put type="button" name="save" value="保存" class="bottom-button"
  217. onclick="submitForm(1);" style="display: inline-block !important;">
  218. 再改,解决点击 保存 按钮后不能关闭弹出窗口的问题 -- <form action= 里增加 dest=
  219. 直接用标准的 <form 的提交。直接写到 <form action= 里
  220. <in@put type="button" name="save" value="保存" class="bottom-button"
  221. onclick="submitForm();" style="display: inline-block !important;"> --%>
  222. <input type="submit" value="保存" class="bottom-button"/>
  223. <%-- 去掉,界面上(业务上),二级对象没有提交 -- 二级对象的保存就是提交。Lin
  224. <in@put type="button" name="subm" value="提交" class="bottom-button"
  225. onclick="tjConfirm();" style="display: inline-block !important;">
  226. --%>
  227. <input type="button" value="取消" class="bottom-button"
  228. onclick="wd.display.closeDialog();">
  229. </div>
  230. </equal.ss>
  231. </div>
  232. </form>
  233. </body>
  234. <script type="text/javascript">
  235. <%-- 去掉,界面上(业务上),二级对象没有提交 -- 二级对象的保存就是提交。Lin
  236. function tjConfirm(){
  237. wd.display.confirm(" ","请确认成绩已全部录完,提交后不能在此页面修改!",function(){submitForm(2)},function(){return;});
  238. }
  239. --%>
  240. <%-- 改,去掉 type,只有一个提交了 -- 二级对象的保存就是提交,新的提交只是放到二级对象草稿箱(不需要确认)。Lin
  241. function submitForm(type) { --%>
  242. <%-- 再去掉,直接写到 <form action= 里 -- 解决点击 保存 按钮后不能关闭弹出窗口的问题 -- <form action= 里增加 dest=。Lin
  243. function submitForm() {
  244. //若是 保存更新,就不提交表单
  245. var f = $('form[name="cjform"]');
  246. --%>
  247. <%-- 去掉,去掉 type,只有一个提交了 -- 二级对象的保存就是提交,新的提交只是放到二级对象草稿箱(不需要确认)。Lin
  248. if (type == 1) {
  249. $.ajax({
  250. url : "<serv.ss name='rcXcdjl_excelSaveAddByZxxz'/>", // :"m_xy_gl_djcj_bc"。Lin
  251. type : "post",
  252. data : f.serialize(),
  253. beforeSend : function(result) {
  254. //将 保存 提交按钮改为 不可用
  255. $('input[name="save"]').attr('disabled', 'disabled');
  256. $('input[name="subm"]').attr('disabled', 'disabled');
  257. $('input[name="save"]').css("color", "#aaa");
  258. $('input[name="subm"]').css("color", "#aaa");
  259. },
  260. success : function(result) {
  261. var data = eval("(" + result + ")");
  262. if (data.result)
  263. //eval('@service{dest:"sys_info",show:"wdDialog",param:{"msg":"保存成功"}}@');
  264. wd.display.alert("保存成功");
  265. else
  266. //eval('@service{dest:"sys_info",show:"wdDialog",param:{"msg":"保存失败"}}@');
  267. wd.display.alert("保存失败");
  268. },
  269. error : function(result) {
  270. //eval('@service{dest:"sys_info",show:"wdDialog",param:{"msg":"保存失败"}}@');
  271. wd.display.alert("保存失败");
  272. },
  273. complete : function(result) {
  274. afterSelectPlan(1);
  275. /*$('input[name="save"]').attr('disabled', false);
  276. $('input[name="subm"]').attr('disabled', false);
  277. $('input[name="save"]').css("color", "#015a31");
  278. $('input[name="subm"]').css("color", "#015a31");*/
  279. }
  280. });
  281. }
  282. if (type == 2) {
  283. --%>
  284. <%-- 改,续传变量,BpmU.saveSq( 需要用到 -- 增加写 二级对象草稿箱。Lin
  285. f.attr('action', '@service{name:"m_xy_gl_djcj_tj",dest:"sys_info"}@'); --%>
  286. <%-- 再去掉,直接写到 <form action= 里 -- 解决点击 保存 按钮后不能关闭弹出窗口的问题 -- <form action= 里增加 dest=。Lin
  287. f.attr('action', "<serv.ss name='rcXcdjl_excelSaveAddByZxxz' parm='{requestParentViewObject:"${requestParentViewObject}"}'/>");
  288. f.submit();
  289. --%>
  290. // } // 去掉,去掉 type,只有一个提交了。Lin
  291. <%-- 再去掉,直接写到 <form action= 里 -- 解决点击 保存 按钮后不能关闭弹出窗口的问题 -- <form action= 里增加 dest=。Lin
  292. }
  293. --%>
  294. // 回车下一个获取焦点
  295. function focusNextInput(thisInput) {
  296. var inputs = $("input[tab='tabField']"); // = $("input[name='cjfs']")。Lin
  297. for (var i = 0; i < inputs.length; i++) {
  298. // 如果是最后一个,则焦点回到第一个
  299. if (i == (inputs.length - 1)) {
  300. inputs[0].focus(); break;
  301. } else if (thisInput == inputs[i]) {
  302. inputs[i + 1].focus(); break;
  303. }
  304. }
  305. }
  306. // 上一个获取焦点
  307. function focusUpInput(thisInput) {
  308. // console.log(11111);
  309. var inputs = $("input[tab='tabField']"); // = $("input[name='cjfs']")。Lin
  310. for (var i = 0; i < inputs.length; i++) {
  311. // 如果是第一个,则焦点回到最后一个
  312. if (thisInput == inputs[i]) {
  313. inputs[i - 1].focus(); break;
  314. } else if (thisInput == inputs[0]) {
  315. inputs[inputs.length - 1].focus(); break;
  316. }
  317. }
  318. }
  319. function keydown_to_tab($input) { //聚焦
  320. // console.log($input)
  321. $($input).bind("keydown", function(e) {
  322. // var n = $('.cjfs').length; // 去掉,没用到。Lin
  323. // console.log(n,e.keyCode)
  324. if (e.keyCode == 40) { //键盘按下
  325. focusNextInput($input)
  326. } else if (e.keyCode == 38) { //键盘按上
  327. focusUpInput($input)
  328. }
  329. });
  330. }
  331. </script>
  332. </html>