QueryPanel.js 6.6 KB

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