QueryPanel.js 6.6 KB

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