listWaiBuAccount.jsp 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380
  1. <%@ page contentType="text/html;charset=GBK"%>
  2. <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  4. <head>
  5. <title>账户列表</title>
  6. <link href="${pageContext.request.contextPath }/liger/lib/ligerUI/skins/${sessionScope.css}/css/ligerui-all.css" rel="stylesheet" type="text/css" />
  7. <script src="${pageContext.request.contextPath }/liger/lib/jquery/jquery-1.3.2.min.js" type="text/javascript"></script>
  8. <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/core/base.js" type="text/javascript"></script>
  9. <script src="${pageContext.request.contextPath }/liger/lib/ligerUI/js/plugins/ligerGrid.js" type="text/javascript"></script>
  10. <link href="${pageContext.request.contextPath}/main.css" rel="stylesheet" type="text/css" />
  11. <script src="${pageContext.request.contextPath}/liger/lib/ligerUI/js/ligerui.all.js"
  12. type="text/javascript"></script>
  13. <script type="text/javascript" src="/shares/js/constant.js"></script>
  14. <script type="text/javascript" src="/shares/js/common.js"></script>
  15. <script type="text/javascript" src="/shares/js/yw/fm/account/accountWaiBuTree.js"></script>
  16. <script type="text/javascript">
  17. // var dialog = null;
  18. var dialog = "";
  19. var grid = null;
  20. var height=400;
  21. $(function() {
  22. initAccountDetailGrid();
  23. });
  24. $(document).ready(function(){
  25. $("#layout1").ligerLayout({
  26. leftWidth : 250,
  27. height : '99%'
  28. });
  29. initAccountDetailGrid();
  30. $("#leftTree").height(height);
  31. });
  32. function initAccountDetailGrid(params) {
  33. var columns = [
  34. {
  35. display : '帐户名',
  36. name : 'account_name',
  37. width : 150
  38. },
  39. {
  40. display : '开户银行',
  41. name : 'blank_name',
  42. width : 150
  43. },{
  44. display : '银行账号',
  45. name : 'blank_account',
  46. width : 200
  47. }
  48. , {
  49. display : '账户类型',
  50. name : 'account_type',
  51. width : 80,
  52. render : function (row){
  53. if(row.account_type=='1'){
  54. return "客户";
  55. }else if(row.account_type=='2'){
  56. return "供应商";
  57. }else{
  58. return "其他";
  59. }
  60. }
  61. }, {
  62. display : '状态',
  63. name : 'state',
  64. width : 80
  65. }, {
  66. display : '创建时间',
  67. name : 'create_date',
  68. width : 150
  69. } ];
  70. columns
  71. .push({
  72. display : '操作',
  73. width : 100,
  74. isAllowHide : false,
  75. render : function(row) {
  76. var html = '<a href=\"#\" onclick=\"editAccountDetail('+ row.universalid + ')\">编辑</a>&nbsp;';
  77. // if(row.state==2){
  78. // html += '<a href=\"#\" onclick=\"delAccountDetail('+ row.universalid +','+row.state+ ')\">删除</a>&nbsp;';
  79. html += '<a href=\"#\" onclick=\"delAccountDetail('+ row.universalid + ')\">删除</a>&nbsp;';
  80. // html += '<a href=\"#\" onclick=\"viewAccountDetail('+ row.universalid + ')\">查看</a>&nbsp;';
  81. return html;
  82. }
  83. });
  84. grid = $("#maingrid4")
  85. .ligerGrid(
  86. {
  87. columns : columns,
  88. pageSize : 20,
  89. url : 'fmAccountDetailAction.do?task=accountDetailList&type=2&time=' + new Date().getTime() + params,
  90. pageParmName : 'p', //页索引参数名,(提交给服务器)
  91. pagesizeParmName : 'pSize', //页记录数参数名,(提交给服务器)
  92. width : '99.9%',
  93. height : '98%'
  94. });
  95. $("#pageloading").hide();
  96. $(".l-grid-hd-cell-btn-checkbox").css("display", "none"); //隱藏checkAll
  97. }
  98. //查询
  99. function searchByKword(tree) {
  100. var s = "";
  101. var account_id ="";
  102. if(tree=="tree"){
  103. account_id = $("#account_id").val();
  104. }else{
  105. account_id = $("#_account_id").val();
  106. }
  107. var account_name = $("#account_name").val();
  108. if(account_name != "" && typeof (account_name) != "undefined"){
  109. s += "&account_name=" + encodeURI(encodeURI(account_name));
  110. }
  111. account_id= $("#account_id").val()
  112. if (account_id != "" && typeof (account_id) != "undefined") {
  113. s += "&account_id=" + account_id;
  114. }
  115. //alert(account_id);
  116. var blank_id = $("#blank_id").val();
  117. if (blank_id != "" && typeof (blank_id) != "undefined") {
  118. s += "&blank_id=" + blank_id;
  119. }
  120. var blank_account = $("#blank_account").val();//规则名称
  121. if (blank_account != "" && typeof (blank_account) != "undefined") {
  122. s += "&blank_account=" + encodeURI(encodeURI(blank_account));
  123. }
  124. //alert(blank_account);
  125. var state = $("#state").val();
  126. // alert(state);
  127. if (state != "" && typeof (state) != "undefined") {
  128. s += "&state=" + state;
  129. }
  130. grid.set("newPage","1");
  131. initAccountDetailGrid(s);
  132. }
  133. function f_select() {
  134. var rows = grid.getCheckedRows();
  135. return rows;
  136. }
  137. //查看账户明细
  138. // function viewTarget(universalid){
  139. // addTab('viewTarget' + getCurrentTabId(), '查看账户明细', '${pageContext.request.contextPath }/hrPerformanceTargetAction.do?task=viewTarget&universalid='
  140. // + universalid + '&tabid=' + getCurrentTabId(),true,true);
  141. // }
  142. //编辑账户明细
  143. function editAccountDetail(universalid){
  144. // addTab('editTarget' + getCurrentTabId(), '编辑考核指标', '${pageContext.request.contextPath }/hrPerformanceTargetAction.do?task=toEditTarget&universalid='
  145. // + universalid + '&tabid=' + getCurrentTabId(),true,true);
  146. dialog = $.ligerDialog.open({ height:320,width:490, title:"编辑银行账号",url: 'fmAccountDetailAction.do?task=toEditAccountDetail&type=2&universalid='+ universalid});
  147. }
  148. //删除账户明细
  149. // function delTarget(universalid,state){
  150. // if(state=='1'){
  151. // alert('请先把指标状态修改成停用!');
  152. // return;
  153. // }
  154. // if (window.confirm("确定要删除吗?")){
  155. // addTab('delTarget' + getCurrentTabId(), '删除账户明细', '${pageContext.request.contextPath }/hrPerformanceTargetAction.do?task=delTarget&universalid='
  156. // + universalid + '&tabid=' + getCurrentTabId(),true,true);
  157. // }
  158. // }
  159. //删除账户明细
  160. function delAccountDetail(universalid){
  161. // if (window.confirm("确定要删除新增银行账号信息吗")){
  162. // addTab('delTeacher' + getCurrentTabId(), '删除新增银行账号信息', '${pageContext.request.contextPath }/fmAccountDetailAction.do?task=delAccountDetail&universalid='
  163. // + universalid + '&tabid=' + getCurrentTabId(),true,true);
  164. // }
  165. // alert(universalid);
  166. $.ligerDialog.confirm('确定要删除新增银行账号吗?', function (yes)
  167. {
  168. if(yes){
  169. $.ajax({
  170. type:"POST",
  171. url:"fmAccountDetailAction.do?task=delAccountDetail",
  172. data : {"universalid":universalid},
  173. timeout:10000,
  174. cache:false,
  175. dataType:"json",
  176. success:function(data){
  177. var success = data.success;
  178. if(success){
  179. $.ligerDialog.success(success);
  180. searchByKword();
  181. // initAccountDetailGrid();
  182. }else{
  183. showAjaxError(null, data.error);
  184. }
  185. },
  186. error:showAjaxError
  187. });
  188. }
  189. });
  190. }
  191. //新增开户银行
  192. function addBlank(){
  193. dialog = $.ligerDialog.open({ height: 440,width:600, title:"新增开户银行",url: 'fmBlankAction.do?task=toAddBlank'});
  194. }
  195. //新增银行账户
  196. function addAccountDetail(){
  197. var account_id= $("#account_id").val();
  198. var status= $("#status").val();
  199. var account_type=$("#account_type").val();
  200. // alert(account_type);
  201. // var data = $("#to_count").ligerGetGridManager().getData();
  202. // alert("date"+data.length);
  203. // alert("star:"+status+"account_id"+account_id);
  204. if(account_id=="" || account_id==null ){
  205. alert("请先选择账户名子类别!");
  206. return ;
  207. }
  208. if(account_id == 1){
  209. $.ligerDialog.warn('根目录不能新增银行账号!');
  210. return;
  211. }
  212. if(status=="" || status==null || status=="2"){
  213. alert("该账户名已被停用,请先启用!");
  214. return ;
  215. }
  216. // if(account_type=="3"){
  217. // alert("该账户名类型是现金,不能新增银行账号!");
  218. // return ;
  219. // }
  220. // if (data.length == 0 ) {
  221. // alert("请先选择添加对应课程测学员!");
  222. // return;
  223. // }
  224. dialog = $.ligerDialog.open({ height:320,width:490,title:"新增银行账号",url: 'fmAccountDetailAction.do?task=toAddAccountDetail&type=2&account_id='+account_id+''});
  225. }
  226. function addProjectRow(){
  227. grid.addEditRow();
  228. }
  229. // 导入
  230. var importDlg;
  231. function importExcel(){
  232. var type="fmAccount";
  233. importDlg = $.ligerDialog.open({
  234. height: 120,
  235. width:440,
  236. url: 'fmSubjectImportAction.do?task=toImport&type='+type,
  237. allowClose:false,
  238. title:'导入科目数据',
  239. buttons : [ {
  240. text : '导入',
  241. onclick : function(item,dialog){
  242. dialog.frame.importExcel(window);
  243. }
  244. },{
  245. text : '关闭',
  246. onclick : function(item,dialog){
  247. importDlg.close();
  248. refreshWindow();
  249. window.parent.loadTree();
  250. grid.loadData();
  251. }
  252. }]
  253. });
  254. }
  255. </script>
  256. <style type="text/css">
  257. body {
  258. padding: 5px;
  259. margin: 0;
  260. }
  261. #layout1 {
  262. width: 99.5%;
  263. margin: 0;
  264. padding: 0;
  265. }
  266. .l-button {
  267. margin-left: 1px;
  268. }
  269. /* #deptBtn { */
  270. /* /* width: 100%; */ */
  271. /* background: #e5ecf9; */
  272. /* text-align: center; */
  273. /* height: 25px; */
  274. /* padding-top: 3px */
  275. /* } */
  276. .l-layout-left {
  277. overflow-y: auto;
  278. }
  279. </style>
  280. </head>
  281. <%-- <BODY onload="refresh(${suc})"> --%>
  282. <BODY>
  283. <%@ include file="/include/button.jsp"%>
  284. <%@ include file="/include/message.jsp"%>
  285. <div class="l-content">
  286. <div id="layout1">
  287. <input type="hidden" name="account_id" id="account_id" value="${account_id}""/>
  288. <input type="hidden" name="status" id="status" value="${status}""/>
  289. <input type="hidden" name="account_type" id="account_type" value="${account_type}""/>
  290. <input type="hidden" name="typeRootId" id="typeRootId" value="${typeRootId }"/>
  291. <input type="hidden" name="asset_search_type" id="asset_search_type" value=""/>
  292. <div position="left" title="账户分类" class="user-tree-style">
  293. <div id="deptBtn">
  294. <input type="button" value="新增" class="l-button" onclick="addAccountType()" id="addAccountTypeBtn" style="width:40px;"/>
  295. <input type="button" value="编辑" class="l-button" onclick="editAccountType()" id="editAccountTypeBtn" style="width:40px;" />
  296. <input type="button" value="删除" class="l-button" onclick="delAccountType()" id="delAccountTypeBtn" style="width:40px;"/>
  297. </div>
  298. <div id="leftTree" style="overflow:auto;position:relative;">
  299. <ul id="accountTree" class="tree" style="margin-top: 3px;">
  300. </ul>
  301. </div>
  302. </div>
  303. <div position="center" id="assetList" title="账户列表">
  304. <div id="deptBtn" style="text-align:left;">
  305. <input type="button" class="l-button" value="新增银行账号" onclick="addAccountDetail()" style="width:90px;margin-left:10px;"/>
  306. <input type="button" class="l-button" value="开户银行" onclick="addBlank()" style="width:90px;margin-left:30px;"/>
  307. <!-- <input type="button" value="导入" class="l-button" onclick="importExcel()" id="importExcelBtn" /> -->
  308. </div>
  309. <div class="default_search" style="margin: 0;">
  310. <ul style="width:39%;">
  311. <li class="title">账户名:</li>
  312. <li class="text">
  313. <input type="text" name="account_name" id="account_name"/>
  314. </li>
  315. </ul>
  316. <ul style="width:30%;">
  317. <li class="title" >开户银行:</li>
  318. <li class="text">
  319. <select id="blank_id" name="blank_id" style="width:140px;">
  320. <option value="" selected="selected">-请选择-</option>
  321. <c:forEach items="${blankList}" var="item">
  322. <option value="${item.universalid }" ${requestScope.blank.universalid==item.universalid ?"selected":"" }>${item.blank_name}</option>
  323. </c:forEach>
  324. </select>
  325. </li>
  326. </ul>
  327. <ul style="width:30%;">
  328. <li class="title" > 银行帐号:</li>
  329. <li class="text"><input style="width: 130px;" type="text" name="blank_account" id="blank_account" />
  330. </li>
  331. </ul>
  332. <ul >
  333. <li class="title" >状态:</li>
  334. <li class="text" >
  335. <select id="state" name="state" style="width:100px;">
  336. <option value="" selected="selected">-请选择-</option>
  337. <c:forEach items="${statusList}" var="item">
  338. <option value="${item.dvalue }" >${item.dname}</option>
  339. </c:forEach>
  340. </select>
  341. </li>
  342. </ul>
  343. <ul >
  344. <li class="search-button"><input type="button" class='l-button'
  345. name="search" onclick="searchByKword()" value="查询" /></li>
  346. </ul>
  347. </div>
  348. <div style="overflow: hidden; clear: both;">
  349. <div id="maingrid4" style="margin: 0; padding: 0"></div>
  350. </div>
  351. </div>
  352. </div>
  353. </div>
  354. </BODY>
  355. </HTML>