QueryPanel.js 6.9 KB

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