QueryPanel.js 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  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. align: 'center',
  107. dataIndex: 'pi_status',
  108. width: 90
  109. },{
  110. text: '付款状态',
  111. align: 'center',
  112. dataIndex: 'pi_prstatus',
  113. width: 90
  114. },{
  115. text: '录入人',
  116. dataIndex: 'creatorName',
  117. width: 110
  118. },{
  119. text: '审核人',
  120. dataIndex: 'pi_auditman',
  121. width: 110
  122. },{
  123. text: '备注',
  124. dataIndex: 'pi_remark',
  125. width: 250
  126. }],
  127. relativeColumn: [
  128. {
  129. text: 'id',
  130. dataIndex: 'pu_id',
  131. xtype: 'numbercolumn',
  132. hidden:true
  133. }, {
  134. text: '单据编号',
  135. dataIndex: 'pi_inoutno',
  136. width: 150
  137. }, {
  138. text: '单据类型',
  139. dataIndex: 'pd_piclass',
  140. width: 0
  141. },{
  142. text: '单据日期',
  143. dataIndex: 'pi_date',
  144. xtype:'datecolumn',
  145. width: 110
  146. },{
  147. text: '供应商编号',
  148. dataIndex: 'pi_vendcode',
  149. width: 0
  150. },{
  151. text: '供应商名称',
  152. dataIndex: 'pi_vendname',
  153. width: 150
  154. },{
  155. text: '审核状态',
  156. align: 'center',
  157. dataIndex: 'pi_status',
  158. width: 90
  159. },{
  160. text: '序号',
  161. dataIndex: 'pd_pdno',
  162. width: 80
  163. },{
  164. text: '相关单号',
  165. dataIndex: 'pd_ordercode',
  166. width: 150
  167. },{
  168. text: '物料编号',
  169. dataIndex: 'pd_prodcode',
  170. width: 150
  171. },{
  172. text: '物料名称',
  173. dataIndex: 'pr_detail',
  174. width: 200
  175. },{
  176. text: '物料规格',
  177. dataIndex: 'pr_spec',
  178. width: 150
  179. },{
  180. text: '单位',
  181. dataIndex: 'pr_unit',
  182. width: 80
  183. },{
  184. text: '数量',
  185. dataIndex: 'pd_inqty',
  186. xtype:'numbercolumn',
  187. width: 110,
  188. renderer : function(v) {
  189. var arr = (v + '.').split('.');
  190. var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
  191. var format = '0,000.' + xr.join();
  192. return Ext.util.Format.number(v, format);
  193. },
  194. },{
  195. text: '仓库',
  196. dataIndex: 'pd_whname',
  197. width: 150
  198. },{
  199. text: '单价',
  200. dataIndex: 'pd_orderprice',
  201. xtype:'numbercolumn',
  202. renderer : function(v) {
  203. var arr = (v + '.').split('.');
  204. var xr = (new Array(arr[1].length)).fill('0');
  205. var format = '0,000.' + xr.join();
  206. return Ext.util.Format.number(v, format);
  207. },
  208. width: 110
  209. },{
  210. text: '税率',
  211. dataIndex: 'pd_taxrate',
  212. xtype:'numbercolumn',
  213. width: 80,
  214. renderer : function(v) {
  215. return Ext.util.Format.number(v, '0');
  216. },
  217. },{
  218. text: '金额',
  219. dataIndex: 'pd_total',
  220. xtype:'numbercolumn',
  221. width: 110,
  222. renderer : function(v) {
  223. var arr = (v + '.').split('.');
  224. var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  225. var format = '0,000.' + xr.join();
  226. return Ext.util.Format.number(v, format);
  227. },
  228. }]
  229. }
  230. });