76f3e538a9a6bfdb4575325aeb9b31a86a6a0c34.svn-base 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  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. <!--引用资源文件,JS CSS-->
  9. <script type="text/javascript" src="<%=path%>/scripts/jquery/plugins/jquery.extension.util.js"></script>
  10. <script type="text/javascript" src="<%=path%>/scripts/freamwork/com/sinosoft/common/common.js"></script>
  11. <script type="text/javascript" src="<%=path%>/scripts/freamwork/com/sinosoft/common/utils/utils.js"></script>
  12. <script type="text/javascript" src="<%=path%>/scripts/freamwork/com/sinosoft/common/frameWork/frameWork.js"></script>
  13. <script type="text/javascript" src="<%=path%>/scripts/common/common.js"></script>
  14. <script type="text/javascript" src="<%=path%>/scripts/business/he/common/common.js"></script>
  15. <script type="text/javascript" src="<%=path%>/scripts/freamwork/com/sinosoft/common/utils/Request.js"></script>
  16. <script type="text/javascript" src="<%=path%>/scripts/qui/libs/js/tree/ztree/ztree.js"></script>
  17. <link href="<%=path%>/scripts/qui/libs/js/tree/ztree/ztree.css" rel="stylesheet" type="text/css" />
  18. <script type="text/javascript">
  19. var fd_id = "<%=request.getParameter("fd_id")%>";
  20. //取得用户真实名字
  21. var realName = top.com.sinosoft.lz.system.user.LoginInfo.getReal_name();
  22. //部门id
  23. var deptId = top.com.sinosoft.lz.system.user.LoginInfo.getDeptids();
  24. //部门名称
  25. var deptName = top.com.sinosoft.lz.system.user.LoginInfo.getDeptnames();
  26. //父部门id
  27. var parentId = top.com.sinosoft.lz.system.user.LoginInfo.getParent_ids();
  28. //alert(fd_id);
  29. //默认加载
  30. $(function(){
  31. var url = $.pathname() + '/ws/crud/CRUDService/getDataById/';
  32. var params = {
  33. classid : '374',
  34. objectID : fd_id
  35. };
  36. //项目级别
  37. $('#LEVEL_374').initCanstSelect('BM_PROJET_LEVEL');
  38. $.request.query(url,params,function(data){
  39. $("#NAME_374").html(data.NAME_374);//评价项目名
  40. $("#LEVEL_374").html(data.LEVEL_374_SHOW);//项目级别
  41. $("#ITEM_376").val(data.FD_OBJECTID374);
  42. url = $.pathname() + '/ws/crud/CRUDService/getDatByList/';
  43. var params = {
  44. classid : '376',
  45. condition:' ITEM = '+data.FD_OBJECTID374+' AND is_del=0'
  46. };
  47. $.request.query(url,params,function(itmeData){
  48. if(itmeData != null && itmeData.length != 0){
  49. var len = itmeData.length;
  50. for(var i =0;i < len;i++){
  51. if(i == 0){
  52. $('#editForm').ajaxWrite({data:itmeData[0]});
  53. addOneRow(itmeData[i].FD_OBJECTID376,itmeData[i].FD_OBJECTID376,itmeData[i].DETAIL_376);
  54. }else{
  55. addRow(itmeData[i].FD_OBJECTID376,itmeData[i].FD_OBJECTID376,itmeData[i].DETAIL_376);
  56. }
  57. }
  58. }else{
  59. addOneRow();
  60. }
  61. });
  62. });
  63. //填报人
  64. $("#WRITER_376").val(realName);
  65. //填报部门
  66. $("#WRITE_DEPT_376").val(deptName);//广电信息中心
  67. //填报时间
  68. $("#WRITE_TIME_376").val(getDateTime());
  69. });
  70. //返回主页面
  71. function goBack() {
  72. //获取iframe中的元素值
  73. var iframe = parent.document.getElementsByName("frmright")[0];
  74. iframe.src = "/nwyj/page/business/em/evaluate/targetManage/TargetManage.jsp";
  75. }
  76. //保存方法
  77. function save(){
  78. var len = $('.dataClas').length;
  79. for(var i = 0;i < len;i++){
  80. $("#FD_OBJECTID376").val($('.dataClas').eq(i).attr('id'));
  81. $("#DETAIL_376").val($('.dataClas').eq(i).val());
  82. $form = $('#editForm');
  83. var fd_id = $("#FD_OBJECTID376").val();
  84. var url = $.pathname() + '/ws/crud/CRUDService/create/';
  85. if(fd_id != null && fd_id != ""){
  86. url = $.pathname() + '/ws/crud/CRUDService/update/';
  87. }
  88. $.ajax({
  89. url : url,
  90. type : 'post',
  91. data : $form.serialize(),
  92. dataType : 'json',
  93. timeout : 60000,
  94. success : function(data){
  95. // goBack();
  96. },
  97. error : function(){
  98. top.Dialog.alert("操作失败!");
  99. }
  100. });
  101. }
  102. top.Dialog.alert("保存成功!");
  103. goBack();
  104. //alert($('.dataClas').eq(2).val());
  105. }
  106. //获得当前系统时间
  107. function getDateTime(){
  108. var s="";
  109. var d = allGetServerTime();
  110. var vYear = d.getFullYear();
  111. var vMon = d.getMonth() + 1;
  112. var vDay = d.getDate();
  113. var h = d.getHours();
  114. var m = d.getMinutes();
  115. var se = d.getSeconds();
  116. s=vYear+"-"+(vMon<10 ? "0" + vMon : vMon)+"-"+(vDay<10 ? "0"+ vDay : vDay)+" "+(h<10 ? "0"+ h : h)+":"+(m<10 ? "0" + m : m)+":"+(se<10 ? "0" +se : se);
  117. return s;
  118. }
  119. function addOneRow(id,name,val){
  120. if(val == null || val == undefined){
  121. val = '';
  122. }
  123. if(id == null){
  124. id = '';
  125. }
  126. if(name == null){
  127. name = '';
  128. }
  129. $("#rows").append("<tr><td width='15%' align='right'>评估内容:</td><td width='75%' colspan='3'><input id='"+id+"' class='dataClas' style='width:89%;' name='"+name+"' value='"+val+"' type='text'/>&nbsp;&nbsp;<input value='添加一行' onclick='addRow();' type='button'/></td></tr>");
  130. }
  131. function addRow(id,name,val){
  132. if(val == null || val == undefined){
  133. val = '';
  134. }
  135. if(id == null){
  136. id = '';
  137. }
  138. if(name == null){
  139. name = '';
  140. }
  141. $("#rows").append("<tr><td width='15%' align='right'>评估内容:</td><td width='75%' colspan='3'><input id='"+id+"' class='dataClas' style='width:89%;' name='"+name+"' value='"+val+"' type='text'/>&nbsp;&nbsp;<input value='删除一行' onclick='delRow(this);' type='button'/></td></tr>");
  142. }
  143. function delRow(obj){
  144. var fd_id = $(obj).parent().children().attr('id');
  145. $(obj).parent().parent().remove();
  146. if(fd_id != null && fd_id != ""){
  147. var url = $.pathname() +"/ws/crud/CRUDService/delete/";
  148. var params = {
  149. objectIDs : fd_id,
  150. classid : 376
  151. };
  152. top.Dialog.confirm("确定要删除吗?|删除", function() {
  153. $.request.del(url,params,function(result){
  154. if (result.Msg.sucsess == true) {
  155. top.Dialog.alert("删除成功!");
  156. } else {
  157. top.Dialog.alert("删除失败!");
  158. }
  159. });
  160. });
  161. }
  162. }
  163. </script>
  164. <style type="text/css">
  165. input{
  166. height:30px;
  167. line-height: 30px;
  168. background: #eee none;
  169. border:1px solid #ccc;
  170. color:#333333;
  171. background-color:rgb(255,255,255);
  172. }
  173. body,div,ul,li,p{
  174. margin:0;
  175. padding:0;
  176. font-size: 14px;
  177. }
  178. .d_ground{
  179. border: 1px solid #cdcaca;
  180. background: white;
  181. width:1000px;
  182. }
  183. .fieldset{
  184. border-style:solid;
  185. border-width:1px;
  186. border-color:#cdcaca;
  187. margin:0px 20px 20px 20px;
  188. width: 935px
  189. }
  190. .button_jl{
  191. margin:5px 10px 10px 0px;
  192. float:right;
  193. }
  194. .back{
  195. margin:8px 0px 0px 15px;
  196. }
  197. </style>
  198. </head>
  199. <body style="width: 1000px; margin:0 auto; margin-top:15px" align="center"><!-- style="height: 545px;" -->
  200. <div class="d_ground" id="formContent" >
  201. <div style="height: 40px;background: white;" align="center">
  202. <a>
  203. <img align="left" class="back" alt="返回" title="返回" src="/nwyj/images/temp/back.png" onclick="goBack();"></img>
  204. </a>
  205. <font style="font-weight: bold;font-size: 20px;line-height: 45px;color: #3e62a0">项目评价内容</font>
  206. </div>
  207. <hr />
  208. <div class="button_jl">
  209. <input value="取消" onclick="goBack();" type="button" />&nbsp;&nbsp;
  210. <input value="保存" onclick="save();" type="button"/>
  211. </div>
  212. <form id="editForm" style="margin: 0px 10px 10px 10px">
  213. <input name="classid" value="376" type="hidden" />
  214. <input name="FD_OBJECTID376" id="FD_OBJECTID376" type="hidden"/>
  215. <input id="WRITER_376" name="WRITER_376" type="hidden"/>
  216. <input id="WRITE_DEPT_376" name="WRITE_DEPT_376" type="hidden"/>
  217. <input id="WRITE_TIME_376" name="WRITE_TIME_376" type="hidden"/>
  218. <input id="DETAIL_376" name="DETAIL_376" type="hidden" />
  219. <input id="ITEM_376" name="ITEM_376" type="hidden"/>
  220. <table id="rows" class="tableStyle">
  221. <tr>
  222. <td width="15%" align="right">评价项目名:</td>
  223. <td width="30%"><div id="NAME_374"></div></td>
  224. <td width="15%" align="right">项目级别:</td>
  225. <td width="30%"><div id="LEVEL_374"></div></td>
  226. </tr>
  227. <!-- <tr>
  228. <td width="15%" align="right">评估内容:</td>
  229. <td width="75%" colspan="3"><input id="DETAIL_376" name="DETAIL_376" type="text" style="width:90%"/>&nbsp;&nbsp;<input value="添加内容" onclick="addRow();" type="button"/></td>
  230. </tr> -->
  231. </table>
  232. </form>
  233. </div>
  234. </body>