QueryPanel.js 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. Ext.define('saas.view.money.othspendings.QueryPanel', {
  2. extend: 'saas.view.core.query.QueryPanel',
  3. xtype: 'money-othspendings-querypanel',
  4. controller: 'money-othspendings-querypanel',
  5. viewModel: 'money-othspendings-querypanel',
  6. viewName: 'money-othspendings-querypanel',
  7. queryFormItems: [{
  8. xtype: 'hidden',
  9. name: 'os_id',
  10. fieldLabel: 'ID',
  11. allowBlank: true,
  12. columnWidth: 0,
  13. getCondition: function(value) {
  14. return 'os_id=' + value;
  15. }
  16. },{
  17. xtype: 'textfield',
  18. name: 'os_code',
  19. emptyText:'请输入单号或客户或账号',
  20. getCondition: function(value) {
  21. if(value == 'ALL') {
  22. return '1=1';
  23. }else {
  24. return ' (os_code like\'%' + value + '%\''
  25. +' or os_vendcode like \'%'+value+'%\''
  26. +' or os_vendname like \'%'+value+'%\''
  27. +' or os_bankcode like \'%'+value+'%\''
  28. +' or os_bankname like \'%'+value+'%\''
  29. +') ';
  30. }
  31. }
  32. },{
  33. xtype: 'condatefield',
  34. name: 'os_date',
  35. columnWidth: 0.5,
  36. fieldLabel: '日期'
  37. },{
  38. name: 'ord_type',
  39. fieldLabel: '支出类别',
  40. xtype : "remotecombo",
  41. emptyText :'全部',
  42. storeUrl:'/api/document/fundinouttype/getCombo?condition=支出',
  43. hiddenBtn:true,//true 则会关闭新增按钮功能
  44. getCondition: function(value) {
  45. if(!value) {
  46. return '1=1';
  47. }else {
  48. return 'ord_type like \'%' + value + '%\'';
  49. }
  50. }
  51. },{
  52. xtype: 'combobox',
  53. name: 'os_statuscode',
  54. fieldLabel: '状态',
  55. queryMode: 'local',
  56. displayField: 'os_status',
  57. valueField: 'os_statuscode',
  58. emptyText :'全部',
  59. editable:false,
  60. store: Ext.create('Ext.data.ArrayStore', {
  61. fields: ['os_statuscode', 'os_status'],
  62. data: [
  63. ["ALL", "全部"],
  64. ["AUDITED", "已审核"],
  65. ["UNAUDITED", "未审核"]
  66. ]
  67. }),
  68. getCondition: function(value) {
  69. if(value == 'ALL') {
  70. return '1=1';
  71. }else {
  72. return 'os_statuscode=\'' + value + '\'';
  73. }
  74. }
  75. }],
  76. moreQueryFormItems: [],
  77. queryGridConfig: {
  78. idField: 'id',
  79. codeField: 'os_code',
  80. addTitle: '其它支出单',
  81. addXtype: 'money-othspendings-formpanel',
  82. defaultCondition:'',
  83. baseVastUrl: '/api/money/othspendings/',
  84. baseColumn: [{
  85. text: 'id',
  86. dataIndex: 'id',
  87. hidden:true,
  88. xtype: 'numbercolumn'
  89. }, {
  90. text: '单据编号',
  91. dataIndex: 'os_code',
  92. width: 150
  93. }, {
  94. text: '日期',
  95. dataIndex: 'os_date',
  96. xtype: 'datecolumn',
  97. width: 110
  98. }, {
  99. text: '供应商名称',
  100. dataIndex: 'os_vendname',
  101. width:250
  102. },{
  103. text: '结算账户',
  104. dataIndex: 'os_bankname',
  105. width: 150
  106. },{
  107. text: '付款金额',
  108. dataIndex: 'os_amount',
  109. width: 110,
  110. renderer : function(v) {
  111. var arr = (v + '.').split('.');
  112. var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  113. var format = '0,000.' + xr.join();
  114. return Ext.util.Format.number(v, format);
  115. }
  116. }, {
  117. text: '单据状态',
  118. dataIndex: 'os_status',
  119. width: 90
  120. },{
  121. text: '录入人',
  122. dataIndex: 'creatorName',
  123. width: 110
  124. }, {
  125. text: '审核人',
  126. dataIndex: 'os_auditman',
  127. width: 110
  128. }, {
  129. text: '备注',
  130. dataIndex: 'os_remark',
  131. width: 250
  132. }],
  133. relativeColumn: []
  134. }
  135. });