editAccount.jsp 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435
  1. <%@ include file="/include/head.jsp"%>
  2. <%@ page contentType="text/html;charset=GBK"%>
  3. <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
  4. <%@ taglib uri="/WEB-INF/tlds/taglib.tld" prefix="OA"%>
  5. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  6. <head>
  7. <title>编辑账户名分类</title>
  8. <link href="main.css" rel="stylesheet" type="text/css"></link>
  9. <link href="./liger/lib/ligerUI/skins/${sessionScope.css}/css/ligerui-all.css"
  10. rel="stylesheet" type="text/css"></link>
  11. <script type="text/javascript" src="/shares/js/jquery-1.3.2.min.js"></script>
  12. <script src="${pageContext.request.contextPath}/liger/lib/ligerUI/js/ligerui.all.js"
  13. type="text/javascript"></script>
  14. <script type="text/javascript" src="/shares/js/common.js"></script>
  15. <script type="text/javascript" src="/shares/js/constant.js"></script>
  16. <script type="text/javascript">
  17. function editAccountType(){
  18. $("#sys_user_names").val($("#sys_user_name").val());
  19. //alert("DD"+$("#share_type").val())
  20. var type=$("#share_type").val();
  21. var type1=$("#account_type1").val();
  22. var rs = $.validate({name:"account.account_name",model:[{type:"require",msg:"账户名不能为空!"},{type:"len",min:0,max:30,msg:"账户名长度输入过长!"}]});
  23. rs &=$.validate({name :"account.remark",model :[{type:"len",min:0,max:500,msg:"备注长度输入过长!"}]});
  24. if(type=="2"){
  25. // alert("ddd");
  26. rs &=$.validate({name :"sys_user_names",model :[{type:"require",msg :"负责人不能为空!"}]});
  27. }
  28. if(type1==3){
  29. // alert("ddd");
  30. rs &= $.validate({
  31. name : "begin_balance",
  32. model : [
  33. {type:"require",msg:"期初余额不能为空!"},{
  34. type : "isNumber",
  35. msg : "期初余额只能为数字!"
  36. }, {
  37. type : "len",
  38. min : 0,
  39. max : 18,
  40. msg : "期初余额长度输入过长!"
  41. } ]
  42. });
  43. }
  44. if(!rs)return;
  45. $("#editAccountForm").submit();
  46. }
  47. $(function() {
  48. // showSuccessMsg("${requestScope.suc}");
  49. $(function (){
  50. var suc = "${requestScope.suc}";
  51. if(suc){
  52. // window.parent.initFinishMygrid3();
  53. var tabid = getCurrentTabId(); //刷新整个页面
  54. parent.window.location=tabid;
  55. window.parent.dialog.close();
  56. }
  57. });
  58. });
  59. function showSuccessMsg(isSucc) {
  60. if (isSucc) {
  61. var succMsg = '';
  62. if (isSucc == '1') {
  63. succMsg = '<a href="#"></a>&nbsp;新建成功!'
  64. + ' <br/><br/>是否继续添加?<br/>';
  65. } else if (isSucc == '2') {
  66. succMsg = '<a href="#"></a>&nbsp;修改成功!'
  67. + ' <br/><br/>是否继续编辑?<br/>';
  68. }
  69. $.ligerDialog({
  70. content : succMsg,
  71. title : "操作成功",
  72. type : "success",
  73. width : 200,
  74. height : 60,
  75. allowClose : false,
  76. buttons : [
  77. {
  78. text : "是",
  79. onclick : function() {
  80. // window.parent.initAccountDetailGrid();
  81. window.location.href = 'fmAccountAction.do?task=toEditAccount&account_id==${account.universalid}';
  82. }
  83. },
  84. {
  85. text : "否",
  86. onclick : function() {
  87. var tabid = getCurrentTabId(); //刷新整个页面
  88. parent.window.location=tabid;
  89. window.parent.dialog.close();
  90. }
  91. } ]
  92. });
  93. }
  94. }
  95. //选负责人
  96. $(function (){
  97. loadTypeTree("userButton", {
  98. type : "usersingle",
  99. backId : "sys_user_id",
  100. backName : "sys_user_name",
  101. tab:"1"
  102. });
  103. });
  104. $(function() {
  105. var is_share = "${account.is_share}";
  106. var sharePermission = is_share.split(",");
  107. $("input[name='is_share']").each(function(){
  108. var vl=$(this).val();
  109. //$(this).attr("disabled",false);
  110. for(var i=0;i<sharePermission.length;i++){
  111. if(vl == sharePermission[i]){
  112. $(this).attr("checked",true);
  113. }
  114. }
  115. });
  116. var shareType = "${account.account_attribute}";
  117. var type = "${account.account_type}";
  118. if(type == 3){
  119. $("#sharePermission2").removeAttr("style");
  120. }
  121. if(shareType == 1){
  122. $("#shareDept2").removeAttr("style");
  123. document.getElementById("shareDept3").style.display = "none";
  124. document.getElementById("shareDept").style.display = "none";
  125. document.getElementById("sharePermission").style.display = "none";
  126. }else if(shareType == 2){
  127. $("#shareDept").removeAttr("style");
  128. document.getElementById("shareDept2").style.display = "none";
  129. $("#shareDept3").removeAttr("style");
  130. $("#sharePermission").removeAttr("style");
  131. }
  132. });
  133. function changeShare(){
  134. if($("#share_type").val() == 2){
  135. $("#shareDept").removeAttr("style");
  136. document.getElementById("shareDept2").style.display = "none";
  137. $("#shareDept3").removeAttr("style");
  138. $("#sharePermission").removeAttr("style");
  139. }else if($("#share_type").val() ==1){
  140. document.getElementById("shareDept").style.display = "none";
  141. $("#shareDept2").removeAttr("style");
  142. document.getElementById("shareDept3").style.display = "none";
  143. document.getElementById("sharePermission").style.display = "none";
  144. }
  145. }
  146. function changeShare3(){
  147. if($("#account_type1").val() == 3){
  148. if($("#already2").val()==2){
  149. alert("该用户有银行账号,改为现金将会删除银行账号!")
  150. }
  151. $("#sharePermission2").removeAttr("style");
  152. }
  153. else if($("#account_type1").val() == 1){
  154. document.getElementById("sharePermission2").style.display = "none";
  155. }
  156. else if($("#account_type1").val() == 2){
  157. document.getElementById("sharePermission2").style.display = "none";
  158. }
  159. }
  160. </script>
  161. <style type="text/css">
  162. body {
  163. padding: 5px;
  164. margin: 0;
  165. }
  166. #layout1 {
  167. width: 100%;
  168. margin: 0;
  169. padding: 0;
  170. }
  171. .l-button {
  172. margin-left: 1px;
  173. }
  174. #deptBtn {
  175. width: 100%;
  176. background: #e5ecf9;
  177. text-align: center;
  178. height: 25px;
  179. padding-top: 3px
  180. }
  181. #leftBtn{
  182. width: 100%;
  183. background: #e5ecf9;
  184. height: 25px;
  185. padding-top: 3px
  186. }
  187. .l-layout-left {
  188. overflow-y: auto;
  189. }
  190. </style>
  191. </head>
  192. <body>
  193. <%@ include file="/include/button.jsp"%>
  194. <%@ include file="/include/message.jsp"%>
  195. <div class="l-content">
  196. <form id="editAccountForm" name="editAccountForm" method="post" action="fmAccountAction.do?task=editAccount">
  197. <input type="hidden" name="account_id" id="account_id" value="${account.universalid}" />
  198. <input id="already2" name="already2" type='hidden' value="${already2}" />
  199. <input id="already" name="already" type='hidden' value="${already}" />
  200. <input id="money" name="money" type='hidden' value="${account.account_type}" />
  201. <div id="layout1">
  202. <div position="center" id="center" class="forum-container">
  203. <c:if test="${already != 1}">
  204. </c:if>
  205. <c:if test="${already == 1}">
  206. <font color=red>该账户已发生交易,只能修改部分信息!</font>
  207. </c:if>
  208. <table border="0" cellspacing="1" cellpadding="0" class="l-table-edit line">
  209. <tr>
  210. <td class="l-table-edit-text">账户名<FONT COLOR="red">*</FONT>:</td>
  211. <td class="l-table-edit-td">
  212. <c:if test="${already != 1}">
  213. <input id="account.account_name" name="account.account_name" type='text' value=${account.account_name} style="width:150px"/>
  214. </c:if>
  215. <c:if test="${already == 1}">
  216. <input disabled="disabled" id="account.account_name" name="account.account_name" type='text' value=${account.account_name} style="width:150px"/>
  217. </c:if>
  218. <div><span id="tnmsg"></span></div></td>
  219. </tr>
  220. <tr>
  221. <td class="l-table-edit-text">账户属性<FONT COLOR="red">*</FONT>:</td>
  222. <td class="l-table-edit-td">
  223. <c:if test="${already != 1}">
  224. <!-- <select id="share_type" name="account_attribute" onchange="changeShare()" style="width:150px;"> -->
  225. <input type="hidden" id="share_type" name="account_attribute" value="1"/>
  226. 内部账户
  227. <%-- <c:if test="${account.account_attribute == 1}"> --%>
  228. <!-- <option value="1">内部账户</option> -->
  229. <!-- <option value="2">外部账户</option> -->
  230. <%-- </c:if> --%>
  231. <%-- <c:if test="${account.account_attribute == 2}"> --%>
  232. <!-- <option value="2">外部账户</option> -->
  233. <!-- <option value="1">内部账户</option> -->
  234. <%-- </c:if> --%>
  235. <!-- </select> -->
  236. </c:if>
  237. <c:if test="${already == 1}">
  238. <!-- <select disabled="disabled" id="share_type" name="account_attribute" onchange="changeShare()" style="width:150px;"> -->
  239. <input type="hidden" id="share_type" name="account_attribute" value="1"/>
  240. 内部账户
  241. <%-- <c:if test="${account.account_attribute == 1}"> --%>
  242. <!-- <option value="1">内部账户</option> -->
  243. <!-- <option value="2">外部账户</option> -->
  244. <%-- </c:if> --%>
  245. <%-- <c:if test="${account.account_attribute == 2}"> --%>
  246. <!-- <option value="2">外部账户</option> -->
  247. <!-- <option value="1">内部账户</option> -->
  248. <%-- </c:if> --%>
  249. <!-- </select> -->
  250. </c:if>
  251. </td>
  252. </tr>
  253. <tr id="shareDept2" style="display: ;">
  254. <td class="l-table-edit-text">账户类型<FONT COLOR="red">*</FONT>:</td>
  255. <td class="l-table-edit-td">
  256. <c:if test="${already != 1}">
  257. <select id="account_type1" name="account_type1" style="width:150px;" onchange="changeShare3()">
  258. <%-- <option value="${requestScope.target.state}" selected="selected">-请选择-</option> --%>
  259. <c:forEach items="${accountTypeList}" var="item">
  260. <option
  261. <c:if test="${item.dvalue eq requestScope.account.account_type}">
  262. selected="selected"
  263. </c:if>
  264. value="${item.dvalue }" >
  265. ${item.dname }
  266. </option>
  267. </c:forEach>
  268. </select>
  269. </c:if>
  270. <c:if test="${already == 1}">
  271. <select disabled="disabled" id="account_type1" name="account_type1" style="width:150px;" onchange="changeShare3()">
  272. <%-- <option value="${requestScope.target.state}" selected="selected">-请选择-</option> --%>
  273. <c:forEach items="${accountTypeList}" var="item">
  274. <option
  275. <c:if test="${item.dvalue eq requestScope.account.account_type}">
  276. selected="selected"
  277. </c:if>
  278. value="${item.dvalue }" >
  279. ${item.dname }
  280. </option>
  281. </c:forEach>
  282. </select>
  283. </c:if>
  284. </td>
  285. </tr>
  286. <tr id="shareDept3" style="display: none;">
  287. <td class="l-table-edit-text">账户类型<FONT COLOR="red">*</FONT>:</td>
  288. <td class="l-table-edit-td">
  289. <c:if test="${already != 1}">
  290. <select id="account_type2" name="account_type2" style="width:150px;">
  291. <%-- <option value="${requestScope.target.state}" selected="selected">-请选择-</option> --%>
  292. <c:forEach items="${accountTypeList2}" var="item">
  293. <option
  294. <c:if test="${item.dvalue eq requestScope.account.account_type}">
  295. selected="selected"
  296. </c:if>
  297. value="${item.dvalue }" >
  298. ${item.dname }
  299. </option>
  300. </c:forEach>
  301. </select>
  302. </c:if>
  303. <c:if test="${already == 1}">
  304. <select disabled="disabled" id="account_type2" name="account_type2" style="width:150px;">
  305. <%-- <option value="${requestScope.target.state}" selected="selected">-请选择-</option> --%>
  306. <c:forEach items="${accountTypeList2}" var="item">
  307. <option
  308. <c:if test="${item.dvalue eq requestScope.account.account_type}">
  309. selected="selected"
  310. </c:if>
  311. value="${item.dvalue }" >
  312. ${item.dname }
  313. </option>
  314. </c:forEach>
  315. </select>
  316. </c:if>
  317. </td>
  318. </tr>
  319. <tr id="shareDept3" style="display: none;">
  320. <td class="l-table-edit-text">账户类型<FONT COLOR="red">*</FONT>:</td>
  321. <td class="l-table-edit-td">
  322. <c:if test="${already != 1}">
  323. <select id="account_type1" name="account_type2" style="width:150px;">
  324. <%-- <option value="${requestScope.target.state}" selected="selected">-请选择-</option> --%>
  325. <c:forEach items="${accountTypeList2}" var="item">
  326. <option
  327. <c:if test="${item.dvalue eq requestScope.account.account_type}">
  328. selected="selected"
  329. </c:if>
  330. value="${item.dvalue }" >
  331. ${item.dname }
  332. </option>
  333. </c:forEach>
  334. </select>
  335. </c:if>
  336. <c:if test="${already == 1}">
  337. <select disabled="disabled" id="account_type1" name="account_type2" style="width:150px;">
  338. <%-- <option value="${requestScope.target.state}" selected="selected">-请选择-</option> --%>
  339. <c:forEach items="${accountTypeList2}" var="item">
  340. <option
  341. <c:if test="${item.dvalue eq requestScope.account.account_type}">
  342. selected="selected"
  343. </c:if>
  344. value="${item.dvalue }" >
  345. ${item.dname }
  346. </option>
  347. </c:forEach>
  348. </select>
  349. </c:if>
  350. </td>
  351. </tr>
  352. <tr id="sharePermission2" style="display:none;">
  353. <td class="l-table-edit-text">期初余额<FONT COLOR="red"></FONT>:
  354. </td>
  355. <td class="l-table-edit-td">
  356. <c:if test="${already!= 1}">
  357. <input
  358. id="begin_balance"
  359. name="begin_balance" type='text' value="${money}"
  360. style="width: 150px" />
  361. </c:if>
  362. <c:if test="${already == 1}">
  363. <input disabled="disabled"
  364. id="begin_balance"
  365. name="begin_balance" type='text' value="${money}"
  366. style="width: 150px" />
  367. </c:if>
  368. <div>
  369. <span id="tnmsg"></span>
  370. </div></td>
  371. </tr>
  372. <!-- <tr id="shareDept" style="display: ;"> -->
  373. <!-- <td class="l-table-edit-text">负责人<FONT COLOR="red">*</FONT>:</td> -->
  374. <!-- <td class="l-table-edit-td"> -->
  375. <%-- <input type="text" id="sys_user_name" name="sys_user_name" style="width:150px;" readonly="readonly" value="${account.account_operator}"/> --%>
  376. <%-- <input type="hidden" name="sys_user_id" id="sys_user_id" value="-${account.account_operator_id}"/> --%>
  377. <!-- <input type="button" class="l-button" value="选择" id="userButton"/> -->
  378. <!-- <input type="hidden" id="sys_user_names" name="sys_user_names" value=""/> -->
  379. <!-- </td> -->
  380. <!-- </tr> -->
  381. <!-- <tr id="sharePermission" style="display: "> -->
  382. <!-- <td class="l-table-edit-text">是否共享<FONT COLOR="red"></FONT>:</td> -->
  383. <!-- <td class="l-table-edit-td"> -->
  384. <!-- <input type="checkbox" id="is_share" name="is_share" value="1"/>是&nbsp; -->
  385. <!-- <input type="hidden" id="is_share" name="account.is_share" value=""/> -->
  386. <!-- </td> -->
  387. <!-- </tr> -->
  388. <tr>
  389. <td class="l-table-edit-text" >状态<FONT COLOR="red"></FONT>:</td>
  390. <td class="l-table-edit-td">
  391. <select id="account.status" name="account.status" style="width:150px;">
  392. <%-- <option value="${requestScope.target.state}" selected="selected">-请选择-</option> --%>
  393. <c:forEach items="${statusList}" var="item">
  394. <option
  395. <c:if test="${item.dvalue eq requestScope.account.status}">
  396. selected="selected"
  397. </c:if>
  398. value="${item.dvalue }" >
  399. ${item.dname }
  400. </option>
  401. </c:forEach>
  402. </select>
  403. </td>
  404. </tr>
  405. <tr>
  406. <td class="l-table-edit-text">备注<FONT COLOR="red"></FONT>:</td>
  407. <td class="l-table-edit-td">
  408. <textarea id="account.remark" name="account.remark" rows="6" cols="35">${requestScope.account.remark}</textarea>
  409. </td>
  410. </tr>
  411. </table>
  412. </div>
  413. </div>
  414. </form>
  415. </div>
  416. </body>
  417. </html>