GLDetail.js 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825
  1. Ext.QuickTips.init();
  2. Ext.define('erp.controller.fa.gla.GLDetail', {
  3. extend: 'Ext.app.Controller',
  4. FormUtil: Ext.create('erp.util.FormUtil'),
  5. BaseUtil: Ext.create('erp.util.BaseUtil'),
  6. views: ['core.trigger.DbfindTrigger', 'fa.gla.GLDetail', 'fa.gla.LedgerDetail', 'core.form.MonthDateField', 'core.trigger.CateTreeDbfindTrigger',
  7. 'core.form.ConMonthDateField', 'core.form.ConDateField', 'core.form.YearDateField', 'core.trigger.MultiDbfindTrigger'],
  8. init:function(){
  9. var me = this;
  10. this.control({
  11. 'button[id=query]': {
  12. afterrender: function(btn) {
  13. setTimeout(function(){
  14. var y = getUrlParam('y'),
  15. c = getUrlParam('c'),
  16. cr = getUrlParam('cr'),
  17. at = getUrlParam('at'),
  18. ac = getUrlParam('ac'),
  19. an = getUrlParam('an'),
  20. un = getUrlParam('un');
  21. me.showFilterPanel(btn, y, c, cr, at, ac, an, un);
  22. me.getCateSetting();
  23. if(y && y != 'undefined') {
  24. var fl = Ext.getCmp('query-filter'),
  25. con = me.getCondition(fl);
  26. con.querytype = 'current';
  27. me.query(con);
  28. }
  29. }, 200);
  30. },
  31. click: function(btn) {
  32. me.showFilterPanel(btn);
  33. }
  34. },
  35. 'button[id=prev]': {
  36. click: function(btn) {
  37. var fl = Ext.getCmp('query-filter'),
  38. con = me.getCondition(fl);
  39. con.querytype = 'prev';
  40. me.query(con);
  41. }
  42. },
  43. 'button[id=next]': {
  44. click: function(btn) {
  45. var fl = Ext.getCmp('query-filter'),
  46. con = me.getCondition(fl);
  47. con.querytype = 'next';
  48. me.query(con);
  49. }
  50. },
  51. 'ledgerdetail': {
  52. itemclick: function(selModel, record) {
  53. me.loadVoucher(record);
  54. }
  55. },
  56. 'button[name=export]': {
  57. click: function() {
  58. var grid = Ext.getCmp('ledger');
  59. me.BaseUtil.exportGrid(grid, '明细账');
  60. }
  61. },
  62. '#ak_asscode': {
  63. change: function(f) {
  64. if(!Ext.isEmpty(f.value)) {
  65. var ch = f.up('window').down('#chkall');
  66. if(!ch.value) {
  67. ch.setValue(true);
  68. }
  69. }
  70. }
  71. }
  72. });
  73. },
  74. getCateSetting : function() {
  75. var me = this;
  76. Ext.Ajax.request({
  77. url : basePath + 'common/getFieldData.action',
  78. params: {
  79. caller: 'Setting',
  80. field: 'se_value',
  81. condition: 'se_what=\'CateTreeSearch\''
  82. },
  83. method : 'post',
  84. async : false,
  85. callback : function(opt, s, res){
  86. var r = new Ext.decode(res.responseText);
  87. if(r.exceptionInfo){
  88. showError(r.exceptionInfo);
  89. } else if(r.success && r.data == 'true' ){
  90. me.CateTreeSearch = true;
  91. }
  92. }
  93. });
  94. },
  95. showFilterPanel: function(btn, ym, caCode, curr, at, ac, an, un) {
  96. var filter = Ext.getCmp(btn.getId() + '-filter');
  97. if(!filter) {
  98. filter = this.createFilterPanel(btn);
  99. }
  100. filter.show();
  101. if(ym && ym != 'undefined') {
  102. filter.down('#sl_yearmonth').setValue(ym);
  103. filter.hide();
  104. }
  105. if(caCode && caCode != 'undefined') {
  106. filter.down('#ca_code').setValue(caCode);
  107. this.catecode = caCode;//当前科目
  108. }
  109. if(curr && curr != 'undefined') {
  110. filter.down('#sl_currency').setValue(curr);
  111. }
  112. if(at && at != 'undefined') {
  113. filter.down('#ak_name').setValue(at);
  114. filter.down('#ak_name').asskind = {
  115. ak_name: at
  116. };
  117. filter.down('#ak_name').autoDbfind('form', caller, 'ak_name', 'ak_name like \'%' + at + '%\'');
  118. }
  119. if(ac && ac != 'undefined') {
  120. filter.down('#ak_asscode').setValue(ac);
  121. filter.down('#chkall').setValue(true);
  122. }
  123. if(an && an != 'undefined') {
  124. filter.down('#ak_assname').setValue(an);
  125. }
  126. if(un && un != 'undefined') {
  127. filter.down('#chkhaveun').setValue(un);
  128. }
  129. },
  130. hideFilterPanel: function(btn) {
  131. var filter = Ext.getCmp(btn.getId() + '-filter');
  132. if(filter) {
  133. filter.hide();
  134. }
  135. },
  136. query: function(cond) {
  137. var me = this,
  138. grid = Ext.getCmp('ledger');
  139. grid.setLoading(true);
  140. Ext.Ajax.request({
  141. url: basePath + 'fa/ars/getGLDetail.action',
  142. params: {
  143. condition: Ext.encode(cond)
  144. },
  145. callback: function(opt, s, r) {
  146. var res = Ext.decode(r.responseText);
  147. if(grid && res.data) {
  148. var chkoth = cond.chkoth,/*强制显示对方科目*/
  149. chkcatelist = cond.chkcatelist,/*按明细科目列表显示*/
  150. sl_doubledebit = grid.down('gridcolumn[dataIndex=sl_doubledebit]'),
  151. cacode = grid.down('gridcolumn[dataIndex=ca_code]'),
  152. caname = grid.down('gridcolumn[dataIndex=ca_name]'),
  153. sl_othercate = grid.down('gridcolumn[dataIndex=sl_othercate]');
  154. grid.store.loadData(res.data);
  155. if(res.data.length > 0) {
  156. if(res.data[0].ca_code) {
  157. cond.catecode = me.catecode = res.data[0].ca_code;
  158. cond.catename = res.data[0].ca_name;
  159. }
  160. cond.asstype = res.data[0].asl_asstype;
  161. cond.asscode = res.data[0].asl_asscode;
  162. cond.assname = res.data[0].asl_assname;
  163. Ext.getCmp('ak_name').asskind = {
  164. ak_name: cond.asstype
  165. };
  166. Ext.getCmp('ak_name').setValue(cond.asstype);
  167. Ext.getCmp('ak_asscode').setValue(cond.asscode);
  168. Ext.getCmp('ak_assname').setValue(cond.assname);
  169. } else {
  170. cond.catecode = me.catecode;
  171. cond.catename = '<font color=red>(无数据)</font>';
  172. cond.asstype = null;
  173. cond.asscode = null;
  174. cond.assname = null;
  175. }
  176. me._updateInfo(cond);
  177. if(chkoth) {
  178. if(sl_othercate && sl_othercate.hidden)
  179. sl_othercate.show();
  180. } else {
  181. if(sl_othercate && !sl_othercate.hidden)
  182. sl_othercate.hide();
  183. }
  184. if(chkcatelist) {
  185. if(cacode && cacode.hidden) {
  186. cacode.show();
  187. caname.show();
  188. }
  189. } else {
  190. if(cacode && !cacode.hidden) {
  191. cacode.hide();
  192. caname.hide();
  193. }
  194. }
  195. if(cond.sl_currency != '0') {//显示原币
  196. if(!sl_doubledebit) {
  197. grid.reconfigure(grid.store, grid.doubleColumns);
  198. }
  199. } else {//只显示本币
  200. if(sl_doubledebit) {
  201. grid.reconfigure(grid.store, grid.defaultColumns);
  202. }
  203. }
  204. }
  205. grid.setLoading(false);
  206. }
  207. });
  208. },
  209. getCondition: function(pl) {
  210. var r = new Object(),v;
  211. Ext.each(pl.items.items, function(item){
  212. if(item.getValue !== undefined) {
  213. v = item.getValue();
  214. if(!Ext.isEmpty(v)) {
  215. r[item.id] = v;
  216. }
  217. }
  218. });
  219. if(this.catecode) {
  220. r.catecode = this.catecode;
  221. }
  222. return r;
  223. },
  224. _updateInfo: function(r) {
  225. var tb = Ext.getCmp('gl_info_ym');
  226. if(tb)
  227. tb.updateInfo(r);
  228. tb = Ext.getCmp('gl_info_c');
  229. if(tb)
  230. tb.updateInfo(r);
  231. tb = Ext.getCmp('gl_info_ass');
  232. if(tb)
  233. tb.updateInfo(r);
  234. },
  235. loadVoucher: function(record) {
  236. var me = this, vc = record.get('sl_vocode');
  237. Ext.Ajax.request({
  238. url : basePath + 'common/getFieldData.action',
  239. params: {
  240. caller: 'Voucher',
  241. field: 'vo_id',
  242. condition: 'vo_code=\'' + vc + '\''
  243. },
  244. method : 'post',
  245. callback : function(options,success,response){
  246. var rs = new Ext.decode(response.responseText);
  247. if(rs.exceptionInfo){
  248. showError(rs.exceptionInfo);return null;
  249. }
  250. if(rs.success){
  251. if(rs.data != null){
  252. me.BaseUtil.onAdd('Voucher_' + vc, '凭证', 'jsps/fa/ars/voucher.jsp?formCondition=vo_idIS' + rs.data +
  253. '&gridCondition=vd_voidIS' + rs.data);
  254. }
  255. }
  256. }
  257. });
  258. },
  259. createYearmonthField : function() {
  260. return Ext.create('Ext.form.FieldContainer', {
  261. margin: '10 2 2 10',
  262. columnWidth: 1,
  263. height: 70,
  264. layout: 'column',
  265. items: [{
  266. xtype: 'radio',
  267. boxLabel: '按期间查询',
  268. name: 'dateorym',
  269. columnWidth: 0.3,
  270. checked: true,
  271. listeners: {
  272. change: function(f) {
  273. var s = Ext.getCmp('sl_yearmonth');
  274. if(f.checked) {
  275. s.setDisabled(false);
  276. } else {
  277. s.setDisabled(true);
  278. }
  279. }
  280. }
  281. },{
  282. id: 'sl_yearmonth',
  283. name: 'sl_yearmonth',
  284. xtype: 'conmonthdatefield',
  285. columnWidth: .7,
  286. height: 30,
  287. getValue: function() {
  288. if(!Ext.isEmpty(this.value)) {
  289. return {begin: this.firstVal, end: this.secondVal};
  290. }
  291. return null;
  292. }
  293. },{
  294. xtype: 'radio',
  295. boxLabel: '按日期查询',
  296. name: 'dateorym',
  297. columnWidth: 0.3,
  298. listeners: {
  299. change: function(f) {
  300. var s = Ext.getCmp('sl_date');
  301. if(f.checked) {
  302. s.setDisabled(false);
  303. } else {
  304. s.setDisabled(true);
  305. }
  306. }
  307. }
  308. },{
  309. id: 'sl_date',
  310. name: 'sl_date',
  311. xtype: 'condatefield',
  312. disabled: true,
  313. columnWidth: .7,
  314. height: 30,
  315. getValue: function() {
  316. if(!Ext.isEmpty(this.value)) {
  317. return {begin: Ext.Date.toString(this.firstVal), end: Ext.Date.toString(this.secondVal)};
  318. }
  319. return null;
  320. }
  321. }],
  322. getValue: function() {
  323. var a = Ext.getCmp('sl_yearmonth'),b = Ext.getCmp('sl_date');
  324. this.id = b.disabled ? 'sl_yearmonth' : 'sl_date';
  325. return b.disabled ? a.getValue() : b.getValue();
  326. }
  327. });
  328. },
  329. createCateField : function() {
  330. var me = this, t, t1;
  331. if (me.CateTreeSearch) {
  332. t = Ext.create('erp.view.core.trigger.CateTreeDbfindTrigger', {
  333. name: 'vd_catecode',
  334. id: 'vd_catecode',
  335. autoDbfind: false,
  336. columnWidth: 0.4,
  337. listeners: {
  338. change: function() {
  339. me.catecode = null;
  340. },
  341. aftertrigger: function(t, d) {
  342. t.ownerCt.down('#vd_catename').setValue(d[0].raw.data.ca_name);
  343. }
  344. }
  345. });
  346. t1 = Ext.create('erp.view.core.trigger.CateTreeDbfindTrigger', {
  347. name: 'vd_catecode1',
  348. id: 'vd_catecode1',
  349. autoDbfind: false,
  350. columnWidth: 0.4,
  351. listeners: {
  352. change: function() {
  353. me.catecode = null;
  354. },
  355. aftertrigger: function(t, d) {
  356. t.ownerCt.down('#vd_catename1').setValue(d[0].raw.data.ca_name);
  357. }
  358. }
  359. });
  360. } else {
  361. t = Ext.create('erp.view.core.trigger.DbfindTrigger', {
  362. id: 'vd_catecode',
  363. name: 'vd_catecode',
  364. columnWidth: 0.4,
  365. listeners: {
  366. aftertrigger: function(t, d) {
  367. t.setValue(d.data.ca_code);
  368. t.ownerCt.down('#vd_catename').setValue(d.data.ca_name);
  369. }
  370. }
  371. });
  372. t1 = Ext.create('erp.view.core.trigger.DbfindTrigger', {
  373. id: 'vd_catecode1',
  374. name: 'vd_catecode1',
  375. columnWidth: 0.4,
  376. listeners: {
  377. aftertrigger: function(t, d) {
  378. t.setValue(d.data.ca_code);
  379. t.ownerCt.down('#vd_catename1').setValue(d.data.ca_name);
  380. }
  381. }
  382. });
  383. }
  384. return Ext.create('Ext.form.FieldContainer', {
  385. id: 'ca_code',
  386. margin: '2 2 2 10',
  387. columnWidth: 1,
  388. height: 100,
  389. layout: 'column',
  390. items: [{
  391. xtype: 'radio',
  392. boxLabel: '连续科目范围',
  393. columnWidth: 0.3,
  394. checked: true,
  395. name: 'continueornot',
  396. listeners: {
  397. change: function(f) {
  398. var s = Ext.getCmp('con_vd_catecode');
  399. if(f.checked) {
  400. s.setDisabled(false);
  401. } else {
  402. s.setDisabled(true);
  403. }
  404. }
  405. }
  406. },{
  407. labelWidth: 80,
  408. layout: 'column',
  409. columnWidth: 0.7,
  410. height: 56,
  411. xtype: 'fieldcontainer',
  412. id: 'con_vd_catecode',
  413. defaults: {
  414. fieldStyle : "background:#FFFAFA;color:#515151;"
  415. },
  416. items: [t, {
  417. xtype: 'textfield',
  418. name: 'vd_catename',
  419. id: 'vd_catename',
  420. columnWidth: 0.6,
  421. readOnly: true,
  422. fieldStyle: 'background:#f1f1f1;'
  423. },t1 ,{
  424. xtype: 'textfield',
  425. name: 'vd_catename1',
  426. id: 'vd_catename1',
  427. columnWidth: 0.6,
  428. readOnly: true,
  429. fieldStyle: 'background:#f1f1f1;'
  430. }],
  431. getValue: function() {
  432. var a = this.down('#vd_catecode').value,b = this.down('#vd_catecode1').value,
  433. x = Ext.isEmpty(a), y = Ext.isEmpty(b);
  434. if(x && y) {
  435. return null;
  436. } else if(x && !y) {
  437. a = b;
  438. } else if(!x && y){
  439. b = a;
  440. }
  441. return {begin: a, end: b};
  442. }
  443. },{
  444. xtype: 'radio',
  445. boxLabel: '非连续科目范围',
  446. columnWidth: 0.3,
  447. name: 'continueornot',
  448. listeners: {
  449. change: function(f) {
  450. var s = Ext.getCmp('un_vd_catecode');
  451. if(f.checked) {
  452. s.setDisabled(false);
  453. } else {
  454. s.setDisabled(true);
  455. }
  456. }
  457. }
  458. },{
  459. xtype: 'cateTreeDbfindTrigger',
  460. mode: 'MULTI',
  461. id: 'un_vd_catecode',
  462. name: 'un_vd_catecode',
  463. disabled: true,
  464. columnWidth: 0.7
  465. }],
  466. getValue: function() {
  467. var a = Ext.getCmp('con_vd_catecode'),b = Ext.getCmp('un_vd_catecode');
  468. var val = b.disabled ? a.getValue() : b.value;
  469. if(val) {
  470. if(!b.disabled) {
  471. var arr = val.split('#');
  472. if(me.catecode != null && !Ext.Array.contains(arr, me.catecode)) {
  473. me.catecode = null;
  474. }
  475. } else {
  476. if(me.catecode == null) {
  477. me.catecode = val.begin;
  478. }
  479. }
  480. return b.disabled ? {continuous: true,value: val} : {continuous: false, value: val};
  481. }
  482. return null;
  483. },
  484. setValue: function(v) {
  485. Ext.getCmp('vd_catecode').setValue(v);
  486. Ext.getCmp('vd_catecode1').setValue(v);
  487. }
  488. });
  489. },
  490. createCateLevelField : function() {
  491. return Ext.create('Ext.form.FieldContainer', {
  492. fieldLabel: '科目级别',
  493. labelWidth: 80,
  494. height: 23,
  495. layout: 'hbox',
  496. columnWidth: .51,
  497. id: 'ca_level',
  498. defaults: {
  499. fieldStyle : "background:#FFFAFA;color:#515151;"
  500. },
  501. items: [{
  502. xtype: 'combo',
  503. flex: 1,
  504. editable: false,
  505. name: 'ca_level1',
  506. id: 'ca_level1',
  507. displayField: 'display',
  508. valueField: 'value',
  509. queryMode: 'local',
  510. value: 1,
  511. store: Ext.create('Ext.data.Store', {
  512. fields: ['display', 'value'],
  513. data : [
  514. {"display": 1, "value": 1},
  515. {"display": 2, "value": 2},
  516. {"display": 3, "value": 3},
  517. {"display": 4, "value": 4},
  518. {"display": 5, "value": 5}
  519. ]
  520. })
  521. },{
  522. xtype: 'combo',
  523. flex: 1,
  524. name: 'ca_level2',
  525. id: 'ca_level2',
  526. editable: false,
  527. displayField: 'display',
  528. valueField: 'value',
  529. queryMode: 'local',
  530. value: 5,
  531. store: Ext.create('Ext.data.Store', {
  532. fields: ['display', 'value'],
  533. data : [
  534. {"display": 1, "value": 1},
  535. {"display": 2, "value": 2},
  536. {"display": 3, "value": 3},
  537. {"display": 4, "value": 4},
  538. {"display": 5, "value": 5}
  539. ]
  540. })
  541. }],
  542. getValue: function() {
  543. var a = this.down('#ca_level1').value,b = this.down('#ca_level2').value;
  544. return {begin: Math.min(a, b), end: Math.max(a, b)};
  545. },
  546. setValue: function() {
  547. }
  548. });
  549. },
  550. createCurrencyField : function() {
  551. var me = this;
  552. return Ext.create('Ext.form.field.ComboBox', {
  553. fieldLabel: '币别',
  554. labelWidth: 80,
  555. height: 23,
  556. layout: 'hbox',
  557. columnWidth: .51,
  558. id: 'sl_currency',
  559. queryMode: 'local',
  560. displayField: 'display',
  561. valueField: 'value',
  562. editable: false,
  563. store: Ext.create('Ext.data.Store', {
  564. fields: ['display', 'value'],
  565. data : [
  566. {"display": '本位币', "value": '0'},
  567. {"display": '所有币别', "value": '99'}
  568. ]
  569. }),
  570. value: '0',
  571. listeners: {
  572. afterrender: function(f) {
  573. me.getCurrency(f);
  574. }
  575. }
  576. });
  577. },
  578. createAssField : function() {
  579. return Ext.create('Ext.form.FieldContainer', {
  580. fieldLabel: '辅助核算',
  581. labelWidth: 80,
  582. height: 23,
  583. layout: 'hbox',
  584. columnWidth: 1,
  585. id: 'vds_asscode',
  586. defaults: {
  587. fieldStyle : "background:#FFFAFA;color:#515151;"
  588. },
  589. items: [{
  590. labelWidth: 35,
  591. xtype: 'dbfindtrigger',
  592. flex: 0.2,
  593. id: 'ak_name',
  594. name: 'ak_name',
  595. listeners: {
  596. aftertrigger: function(f, r) {
  597. if(!Ext.isEmpty(f.value)) {
  598. f.asskind = r.data;
  599. var c = Ext.getCmp('ak_asscode'),
  600. n = Ext.getCmp('ak_assname');
  601. c.name = r.data.ak_asscode;
  602. n.name = r.data.ak_assname;
  603. } else {
  604. f.asskind = null;
  605. }
  606. },
  607. change: function() {
  608. var a = Ext.getCmp('ak_asscode'),
  609. b = Ext.getCmp('ak_assname');
  610. a.setValue(null);
  611. b.setValue(null);
  612. }
  613. }
  614. },{
  615. xtype: 'dbfindtrigger',
  616. id: 'ak_asscode',
  617. flex: 0.2,
  618. listeners: {
  619. beforetrigger: function(f) {
  620. var a = Ext.getCmp('ak_name');
  621. f.dbBaseCondition = null;
  622. if(!a.asskind) {
  623. a.focus(false, 200);
  624. showError('请先选择核算项!');
  625. return false;
  626. } else if(f.name == 'akd_asscode') {
  627. f.dbBaseCondition = 'ak_name=\'' + a.value + '\'';
  628. }
  629. },
  630. aftertrigger: function(f, r) {
  631. var a = f.ownerCt.down('#ak_name'),
  632. n = Ext.getCmp('ak_assname');
  633. if(a.asskind) {
  634. f.setValue(r.data[f.name]);
  635. n.setValue(r.data[n.name]);
  636. }
  637. }
  638. }
  639. },{
  640. xtype: 'textfield',
  641. id: 'ak_assname',
  642. flex: 0.6,
  643. readOnly: true,
  644. fieldStyle: 'background:#f1f1f1;'
  645. }],
  646. getValue: function() {
  647. var a = Ext.getCmp('ak_name'),
  648. c = Ext.getCmp('ak_asscode');
  649. if(a.asskind) {
  650. return {asl_asstype: a.asskind.ak_name, asl_asscode: c.value};
  651. }
  652. return null;
  653. }
  654. });
  655. },
  656. createFilterPanel: function(btn) {
  657. var me = this;
  658. var filter = Ext.create('Ext.Window', {
  659. id: btn.getId() + '-filter',
  660. style: 'background:#f1f1f1',
  661. title: '筛选条件',
  662. width: 500,
  663. height: 500,
  664. layout: 'column',
  665. defaults: {
  666. margin: '2 2 2 10'
  667. },
  668. items: [me.createYearmonthField(), me.createCateField(), me.createCateLevelField(),
  669. me.createCurrencyField(), me.createAssField(), {
  670. xtype: 'checkbox',
  671. id: 'chkall',
  672. name: 'chkall',
  673. columnWidth: .5,
  674. boxLabel: '显示辅助核算'
  675. },{
  676. xtype: 'checkbox',
  677. id: 'chkdis',
  678. name: 'chkdis',
  679. columnWidth: .5,
  680. boxLabel: '显示禁用科目'
  681. },{
  682. xtype: 'checkbox',
  683. id: 'chkymno',
  684. name: 'chkymno',
  685. columnWidth: .5,
  686. boxLabel: '显示无发生额的期间合计'
  687. },{
  688. xtype: 'checkbox',
  689. id: 'chkhaveun',
  690. name: 'chkhaveun',
  691. columnWidth: .5,
  692. boxLabel: '包含未记账凭证'
  693. },{
  694. xtype: 'checkbox',
  695. id: 'chkno',
  696. name: 'chkno',
  697. columnWidth: .5,
  698. boxLabel: '无发生额不显示',
  699. listeners: {
  700. change: function(f){
  701. var s = Ext.getCmp('chkzeroandno');
  702. if(f.checked) {
  703. s.setDisabled(true);
  704. } else {
  705. s.setDisabled(false);
  706. }
  707. }
  708. }
  709. },{
  710. xtype: 'checkbox',
  711. id: 'chkDispLeaf',
  712. name: 'chkDispLeaf',
  713. columnWidth: .5,
  714. boxLabel: '只显示末级科目'
  715. },{
  716. xtype: 'checkbox',
  717. id: 'chkzeroandno',
  718. name: 'chkzeroandno',
  719. columnWidth: .5,
  720. boxLabel: '余额为零且无发生额不显示'
  721. },{
  722. xtype: 'checkbox',
  723. id: 'chkunused',
  724. name: 'chkunused',
  725. columnWidth: .5,
  726. boxLabel: '从未使用不显示'
  727. },{
  728. xtype: 'checkbox',
  729. id: 'chkoth',
  730. name: 'chkoth',
  731. columnWidth: .5,
  732. boxLabel: '强制显示对方科目'
  733. },{
  734. xtype: 'checkbox',
  735. id: 'chkothass',
  736. name: 'chkothass',
  737. columnWidth: .5,
  738. boxLabel: '显示对方科目核算项目'
  739. },{
  740. xtype: 'checkbox',
  741. id: 'chkothasslist',
  742. name: 'chkothasslist',
  743. columnWidth: .5,
  744. boxLabel: '按对方科目多条显示',
  745. listeners: {
  746. change: function(f){
  747. var s = Ext.getCmp('chkoth');
  748. if(f.checked) {
  749. s.setValue(true);
  750. }
  751. }
  752. }
  753. },{
  754. xtype: 'checkbox',
  755. id: 'chkcatelist',
  756. name: 'chkcatelist',
  757. columnWidth: .5,
  758. boxLabel: '按明细科目列表显示'
  759. }],
  760. buttonAlign: 'center',
  761. buttons: [{
  762. text: '确定',
  763. width: 60,
  764. cls: 'x-btn-blue',
  765. handler: function(btn) {
  766. var fl = Ext.getCmp('query-filter'),
  767. con = me.getCondition(fl);
  768. con.querytype = 'current';
  769. me.query(con);
  770. fl.hide();
  771. }
  772. },{
  773. text: '关闭',
  774. width: 60,
  775. cls: 'x-btn-blue',
  776. handler: function(btn) {
  777. var fl = btn.ownerCt.ownerCt;
  778. fl.hide();
  779. }
  780. }]
  781. });
  782. this.getCurrentMonth(filter.down('#sl_yearmonth'));
  783. return filter;
  784. },
  785. getCurrency: function(f) {
  786. Ext.Ajax.request({
  787. url : basePath + 'common/getFieldDatas.action',
  788. async: false,
  789. params: {
  790. caller: 'Currencys',
  791. field: 'cr_name',
  792. condition: 'cr_statuscode=\'CANUSE\''
  793. },
  794. method : 'post',
  795. callback : function(options,success,response){
  796. var rs = new Ext.decode(response.responseText);
  797. if(rs.exceptionInfo){
  798. showError(rs.exceptionInfo);return null;
  799. }
  800. if(rs.success && rs.data){
  801. var cr = rs.data.split('#'),c = new Array();
  802. Ext.each(cr, function(r){
  803. c.push({display: r, value: r});
  804. });
  805. f.store.add(c);
  806. }
  807. }
  808. });
  809. },
  810. getCurrentMonth: function(f) {
  811. Ext.Ajax.request({
  812. url: basePath + 'fa/getMonth.action',
  813. params: {
  814. type: 'MONTH-A'
  815. },
  816. callback: function(opt, s, r) {
  817. var rs = Ext.decode(r.responseText);
  818. if(rs.data) {
  819. f.setValue(rs.data.PD_DETNO);
  820. }
  821. }
  822. });
  823. }
  824. });