QueryPanel.js 6.4 KB

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