QueryPanel.js 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  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. emptyText: '输入单号',
  68. }, {
  69. xtype: 'accountDbfindTrigger',
  70. name: 'creatorName',
  71. fieldLabel: '录入人',
  72. emptyText:'请输入人员编号或名称',
  73. getCondition: function(value) {
  74. if(!value) {
  75. return '1=1';
  76. }else {
  77. return 'purchase.creatorName like\'%' + value + '%\'';
  78. }
  79. }
  80. }, {
  81. xtype: 'accountDbfindTrigger',
  82. name: 'pu_auditman',
  83. fieldLabel: '审核人',
  84. emptyText:'请输入人员编号或名称'
  85. }],
  86. queryGridConfig: {
  87. idField: 'pu_id',
  88. codeField: 'pu_code',
  89. addTitle: '采购订单',
  90. addXtype: 'purchase-purchase-formpanel',
  91. defaultCondition:'',
  92. baseVastUrl: '/api/purchase/purchase/',
  93. caller:'Purchase',
  94. baseColumn: [
  95. {
  96. text: 'id',
  97. dataIndex: 'pu_id',
  98. width: 0,
  99. xtype: 'numbercolumn',
  100. hidden:true
  101. }, {
  102. text: '采购单号',
  103. dataIndex: 'pu_code',
  104. width: 150
  105. },{
  106. text: '单据日期',
  107. dataIndex: 'pu_date',
  108. xtype: 'datecolumn',
  109. width: 110
  110. },{
  111. text: '供应商名称',
  112. dataIndex: 'pu_vendname',
  113. width:250
  114. }, {
  115. text: '总金额',
  116. dataIndex: 'pu_total',
  117. xtype: 'numbercolumn',
  118. width: 110
  119. }, {
  120. text: '审核状态',
  121. align: 'center',
  122. dataIndex: 'pu_status',
  123. width: 90
  124. },{
  125. text: '业务状态',
  126. align: 'center',
  127. dataIndex: 'pu_acceptstatus',
  128. width: 90
  129. },{
  130. text: '录入人',
  131. dataIndex: 'creatorName',
  132. width: 110
  133. },{
  134. text: '审核人',
  135. dataIndex: 'pu_auditman',
  136. width: 110
  137. },{
  138. text: '关联销售单',
  139. dataIndex: 'pu_sacode',
  140. width: 150
  141. },{
  142. text: '备注',
  143. dataIndex: 'pu_remark',
  144. width: 250
  145. }],
  146. relativeColumn: [
  147. {
  148. text: 'id',
  149. dataIndex: 'pu_id',
  150. width: 0,
  151. hidden: true
  152. }, {
  153. text: '采购单号',
  154. dataIndex: 'pu_code',
  155. width: 150
  156. }, {
  157. text: '单据日期',
  158. dataIndex: 'pu_date',
  159. xtype: 'datecolumn',
  160. width: 110
  161. },{
  162. text: '供应商名称',
  163. dataIndex: 'pu_vendname',
  164. width: 150
  165. }, {
  166. text: '审核状态',
  167. align: 'center',
  168. dataIndex: 'pu_status',
  169. width: 90
  170. },{
  171. text: '业务状态',
  172. align: 'center',
  173. dataIndex: 'pu_acceptstatus',
  174. width: 90
  175. }, {
  176. text: '序号',
  177. dataIndex: 'pd_detno',
  178. xtype: 'numbercolumn',
  179. width: 80,
  180. renderer : function(v) {
  181. return Ext.util.Format.number(v, '0');
  182. }
  183. }, {
  184. text: '物料编号',
  185. dataIndex: 'pd_prodcode',
  186. width: 150
  187. },{
  188. text: '品牌',
  189. dataIndex: 'pr_brand',
  190. width: 150
  191. },{
  192. text: '名称',
  193. dataIndex: 'pr_detail',
  194. width: 200
  195. },{
  196. text: '型号',
  197. dataIndex: 'pr_orispeccode',
  198. width: 200
  199. },{
  200. text: '采购数量',
  201. dataIndex: 'pd_qty',
  202. xtype: 'numbercolumn',
  203. width: 110,
  204. renderer : function(v) {
  205. var arr = (v + '.').split('.');
  206. var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
  207. var format = '0,000.' + xr.join('');
  208. return Ext.util.Format.number(v, format);
  209. }
  210. }, {
  211. text: '单位',
  212. dataIndex: 'pr_unit',
  213. width: 80
  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_delivery',
  228. xtype: 'datecolumn',
  229. width: 110
  230. }, {
  231. text: '税率',
  232. dataIndex: 'pd_taxrate',
  233. xtype: 'numbercolumn',
  234. width: 80,
  235. renderer : function(v) {
  236. return Ext.util.Format.number(v, '0');
  237. },
  238. },{
  239. text: '金额(元)',
  240. dataIndex: 'pd_total',
  241. xtype: 'numbercolumn',
  242. width: 110,
  243. renderer : function(v) {
  244. var arr = (v + '.').split('.');
  245. var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  246. var format = '0,000.' + xr.join('');
  247. return Ext.util.Format.number(v, format);
  248. }
  249. },{
  250. text: '备注',
  251. dataIndex: 'pd_remark',
  252. width: 250
  253. }]
  254. }
  255. });