QueryPanel.js 6.4 KB

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