QueryPanel.js 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. Ext.define('saas.view.money.verification.QueryPanel', {
  2. extend: 'saas.view.core.query.QueryPanel',
  3. xtype: 'money-verification-querypanel',
  4. controller: 'money-verification-querypanel',
  5. viewModel: 'money-verification-querypanel',
  6. viewName: 'money-verification-querypanel',
  7. queryFormItems: [{
  8. xtype: 'textfield',
  9. name: 'vc_code',
  10. fieldLabel: '',
  11. emptyText :'请输入单号或者供应商名或者客户名',
  12. getCondition: function(value) {
  13. if(value == 'ALL') {
  14. return '1=1';
  15. }else {
  16. return ' (vc_code like\'%' + value + '%\' '
  17. +' or vc_vendcode like \'%'+value+'%\' '
  18. +' or vc_custcode like \'%'+value+'%\') ';
  19. }
  20. }
  21. },{
  22. xtype: 'condatefield',
  23. name: 'vc_date',
  24. fieldLabel: '单据日期',
  25. columnWidth: 0.5,
  26. operation: 'between'
  27. },{
  28. xtype: 'combobox',
  29. name: 'vc_statuscode',
  30. fieldLabel: '审核状态',
  31. queryMode: 'local',
  32. displayField: 'name',
  33. valueField: 'value',
  34. emptyText :'全部',
  35. editable:false,
  36. store: Ext.create('Ext.data.ArrayStore', {
  37. fields: ['value', 'name'],
  38. data: [
  39. ["ALL", "全部"],
  40. ["AUDITED", "已审核"],
  41. ["UNAUDITED", "未审核"]
  42. ]
  43. }),
  44. getCondition: function(value) {
  45. if(value == 'ALL') {
  46. return '1=1';
  47. }else {
  48. return 'vc_statuscode=\'' + value + '\'';
  49. }
  50. }
  51. },{
  52. xtype: 'combobox',
  53. name: 'vc_kind',
  54. fieldLabel: '业务类型',
  55. queryMode: 'local',
  56. displayField: 'name',
  57. valueField: 'value',
  58. emptyText :'全部',
  59. editable:false,
  60. store: Ext.create('Ext.data.ArrayStore', {
  61. fields: ['value', 'name'],
  62. data: [
  63. ["ALL", "全部"],
  64. ["预收冲应收", "预收冲应收"],
  65. ["预付冲应付", "预付冲应付"],
  66. ["应收冲应付", "应收冲应付"],
  67. ["应收转应收", "应收转应收"],
  68. ["应付转应付", "应付转应付"]
  69. ]
  70. }),
  71. getCondition: function(value) {
  72. if(value == 'ALL') {
  73. return '1=1';
  74. }else {
  75. return 'vc_kind=\'' + value + '\'';
  76. }
  77. }
  78. }],
  79. moreQueryFormItems: [],
  80. queryGridConfig: {
  81. idField: 'vc_id',
  82. codeField: 'vc_code',
  83. addTitle: '核销单',
  84. addXtype: 'money-verification-formpanel',
  85. defaultCondition:'',
  86. baseVastUrl: '/api/money/verification/',
  87. baseColumn: [{
  88. text: 'id',
  89. dataIndex: 'id',
  90. width: 100,
  91. xtype: 'numbercolumn',
  92. hidden: true
  93. }, {
  94. text: '单据编号',
  95. dataIndex: 'vc_code',
  96. width: 180
  97. }, {
  98. text: '单据日期',
  99. dataIndex: 'vc_date',
  100. xtype: 'datecolumn',
  101. width: 100
  102. },{
  103. text: '审核状态',
  104. dataIndex: 'vc_status',
  105. width: 100
  106. },{
  107. text: '业务类型',
  108. dataIndex: 'vc_kind',
  109. width: 100
  110. }, {
  111. text: '客户编号',
  112. dataIndex: 'vc_custcode',
  113. hidden: true
  114. }, {
  115. text: '客户名称',
  116. dataIndex: 'vc_custname',
  117. width: 130
  118. }, {
  119. text: '供应商编号',
  120. dataIndex: 'vc_vendcode',
  121. hidden: true
  122. }, {
  123. text: '供应商名称',
  124. dataIndex: 'vc_vendname',
  125. width: 130
  126. }, {
  127. text: '核销金额',
  128. dataIndex: 'vc_amount1',
  129. xtype: 'numbercolumn',
  130. width: 100,
  131. renderer : function(v) {
  132. var arr = (v + '.').split('.');
  133. var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  134. var format = '0,000.' + xr.join();
  135. return Ext.util.Format.number(v, format);
  136. }
  137. }]
  138. }
  139. });