QueryPanel.js 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. Ext.define('saas.view.purchase.purchase.QueryPanel', {
  2. extend: 'saas.view.core.query.QueryPanel',
  3. xtype: 'purchase-purchase-querypanel',
  4. controller: 'purchase-purchase-querypanel',
  5. viewModel: 'purchase-purchase-querypanel',
  6. viewName: 'purchase-purchase-querypanel',
  7. queryFormItems: [{
  8. xtype: 'textfield',
  9. name: 'pu_code',
  10. fieldLabel: ' ',
  11. labelSeparator:' ',
  12. emptyText:'请输入单号或供应商',
  13. getCondition: function(value) {
  14. return ' (pu_code like\'%' + value + '%\' or pu_vendcode like \'%'+value+'%\' or pu_vendname like \'%'+value+'%\') ';
  15. }
  16. }, {
  17. xtype: 'condatefield',
  18. name: 'pu_date',
  19. fieldLabel: '日期',
  20. columnWidth: 0.5,
  21. operation: 'between'
  22. }, {
  23. xtype: 'productDbfindTrigger',
  24. name: 'pr_detail',
  25. fieldLabel: '物料',
  26. showDetail: true,
  27. emptyText:'输入物料编号或名称',
  28. }, {
  29. xtype: 'combobox',
  30. name: 'pu_statuscode',
  31. fieldLabel: '单据状态',
  32. queryMode: 'local',
  33. displayField: 'pu_status',
  34. valueField: 'pu_statuscode',
  35. emptyText :'全部',
  36. editable:false,
  37. store: Ext.create('Ext.data.ArrayStore', {
  38. fields: ['pu_statuscode', 'pu_status'],
  39. data: [
  40. ["ALL", "全部"],
  41. ["AUDITED", "已审核"],
  42. ["UNAUDITED", "未审核"]
  43. ]
  44. }),
  45. getCondition: function(value) {
  46. if(value == 'ALL') {
  47. return '1=1';
  48. }else {
  49. return 'pu_statuscode=\'' + value + '\'';
  50. }
  51. }
  52. }, {
  53. xtype: 'multicombo',
  54. name: 'pu_acceptstatuscode',
  55. fieldLabel: '业务状态',
  56. emptyText :'全部',
  57. datas: [
  58. ["TURNIN", "已入库"],
  59. ["UNTURNIN", "未入库"],
  60. ["PART2IN", "部分入库"],
  61. ["CLOSE", "已关闭"]
  62. ]
  63. }, {
  64. xtype: 'textfield',
  65. name: 'pu_sacode',
  66. fieldLabel: '关联销售单号'
  67. }, {
  68. xtype: 'employeeDbfindTrigger',
  69. name: 'creatorName',
  70. fieldLabel: '录入人',
  71. emptyText:'请输入人员编号或名称',
  72. getCondition: function(value) {
  73. if(!value) {
  74. return '1=1';
  75. }else {
  76. return 'purchase.creatorName like\'%' + value + '%\'';
  77. }
  78. }
  79. }, {
  80. xtype: 'employeeDbfindTrigger',
  81. name: 'pu_auditman',
  82. fieldLabel: '审核人',
  83. emptyText:'请输入人员编号或名称'
  84. }],
  85. queryGridConfig: {
  86. idField: 'pu_id',
  87. codeField: 'pu_code',
  88. addTitle: '采购订单',
  89. addXtype: 'purchase-purchase-formpanel',
  90. defaultCondition:'',
  91. baseVastUrl: '/api/purchase/purchase/',
  92. caller:'Purchase',
  93. baseColumn: [
  94. {
  95. text: 'id',
  96. dataIndex: 'pu_id',
  97. width: 0,
  98. xtype: 'numbercolumn',
  99. hidden:true
  100. }, {
  101. text: '采购单号',
  102. dataIndex: 'pu_code',
  103. width: 150
  104. },{
  105. text: '单据日期',
  106. dataIndex: 'pu_date',
  107. xtype: 'datecolumn',
  108. width: 110
  109. },{
  110. text: '供应商名称',
  111. dataIndex: 'pu_vendname',
  112. width:250
  113. }, {
  114. text: '总金额',
  115. dataIndex: 'pu_total',
  116. xtype: 'numbercolumn',
  117. width: 110
  118. }, {
  119. text: '审核状态',
  120. align: 'center',
  121. dataIndex: 'pu_status',
  122. width: 90
  123. },{
  124. text: '业务状态',
  125. align: 'center',
  126. dataIndex: 'pu_acceptstatus',
  127. width: 90
  128. },{
  129. text: '录入人',
  130. dataIndex: 'creatorName',
  131. width: 110
  132. },{
  133. text: '审核人',
  134. dataIndex: 'pu_auditman',
  135. width: 110
  136. },{
  137. text: '关联销售单',
  138. dataIndex: 'pu_sacode',
  139. width: 150
  140. },{
  141. text: '备注',
  142. dataIndex: 'pu_remark',
  143. width: 250
  144. }],
  145. relativeColumn: [
  146. {
  147. text: 'id',
  148. dataIndex: 'pu_id',
  149. width: 0,
  150. hidden: true
  151. }, {
  152. text: '采购单号',
  153. dataIndex: 'pu_code',
  154. width: 150
  155. }, {
  156. text: '单据日期',
  157. dataIndex: 'pu_date',
  158. xtype: 'datecolumn',
  159. width: 110
  160. },{
  161. text: '供应商名称',
  162. dataIndex: 'pu_vendname',
  163. width: 150
  164. }, {
  165. text: '审核状态',
  166. align: 'center',
  167. dataIndex: 'pu_status',
  168. width: 90
  169. },{
  170. text: '业务状态',
  171. align: 'center',
  172. dataIndex: 'pu_acceptstatus',
  173. width: 90
  174. }, {
  175. text: '序号',
  176. dataIndex: 'pd_detno',
  177. xtype: 'numbercolumn',
  178. width: 80,
  179. renderer : function(v) {
  180. return Ext.util.Format.number(v, '0');
  181. }
  182. }, {
  183. text: '物料编号',
  184. dataIndex: 'pd_prodcode',
  185. width: 150
  186. },{
  187. text: '物料名称',
  188. dataIndex: 'pr_detail',
  189. width: 200
  190. }, {
  191. text: '物料规格',
  192. dataIndex: 'pr_spec',
  193. width: 150
  194. }, {
  195. text: '单位',
  196. dataIndex: 'pr_unit',
  197. width: 80
  198. },{
  199. text: '采购数量',
  200. dataIndex: 'pd_qty',
  201. xtype: 'numbercolumn',
  202. width: 110,
  203. renderer : function(v) {
  204. var arr = (v + '.').split('.');
  205. var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
  206. var format = '0,000.' + xr.join();
  207. return Ext.util.Format.number(v, format);
  208. },
  209. }, {
  210. text: '需求日期',
  211. dataIndex: 'pd_delivery',
  212. xtype: 'datecolumn',
  213. width: 110
  214. },{
  215. text: '单价',
  216. dataIndex: 'pd_price',
  217. xtype: 'numbercolumn',
  218. width: 110,
  219. renderer : function(v) {
  220. var arr = (v + '.').split('.');
  221. var xr = (new Array(arr[1].length > 8 ? 8 : arr[1].length)).fill('0');
  222. var format = '0,000.' + xr.join();
  223. return Ext.util.Format.number(v, format);
  224. }
  225. }, {
  226. text: '税率',
  227. dataIndex: 'pd_taxrate',
  228. xtype: 'numbercolumn',
  229. width: 80,
  230. renderer : function(v) {
  231. return Ext.util.Format.number(v, '0');
  232. },
  233. },{
  234. text: '金额',
  235. dataIndex: 'pd_total',
  236. xtype: 'numbercolumn',
  237. width: 110,
  238. renderer : function(v) {
  239. var arr = (v + '.').split('.');
  240. var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  241. var format = '0,000.' + xr.join();
  242. return Ext.util.Format.number(v, format);
  243. }
  244. },{
  245. text: '备注',
  246. dataIndex: 'pd_remark',
  247. width: 250
  248. }]
  249. }
  250. });