QueryPanel.js 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  1. Ext.define('saas.view.sale.saleout.QueryPanel', {
  2. extend: 'saas.view.core.query.QueryPanel',
  3. xtype: 'sale-saleout-querypanel',
  4. controller: 'sale-saleout-querypanel',
  5. viewModel: 'sale-saleout-querypanel',
  6. viewName: 'sale-saleout-querypanel',
  7. queryFormItems: [{
  8. xtype: 'hidden',
  9. name: 'pi_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_custcode like \'%'+value+'%\' or pi_custname like \'%'+value+'%\' or pi_iocode like \'%'+value+'%\') ';
  18. }
  19. }, {
  20. xtype: 'hidden',
  21. name: 'pd_prodcode',
  22. fieldLabel: '物料编号',
  23. showDetail: true
  24. }, {
  25. xtype: 'productDbfindTrigger',
  26. name: 'pr_detail',
  27. fieldLabel: '物料',
  28. showDetail: true
  29. }, {
  30. xtype: 'condatefield',
  31. name: 'pi_date',
  32. fieldLabel: '日期',
  33. allowBlank: true,
  34. columnWidth: 0.5
  35. }, {
  36. xtype: 'combobox',
  37. name: 'pi_statuscode',
  38. fieldLabel: '单据状态',
  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. moreQueryFormItems: [],
  61. queryGridConfig: {
  62. idField:'id',
  63. codeField:'pi_inoutno',
  64. addTitle:'出货单',
  65. addXtype:'sale-saleout-formpanel',
  66. defaultCondition:' pi_class = \'出货单\'',
  67. baseVastUrl: '/api/sale/prodinout/',
  68. baseColumn: [{
  69. text: 'id',
  70. dataIndex: 'id',
  71. hidden:true,
  72. xtype: 'numbercolumn'
  73. }, {
  74. text: '出货单号',
  75. dataIndex: 'pi_inoutno',
  76. width: 150
  77. }, {
  78. text: '单据日期',
  79. dataIndex: 'pi_date',
  80. xtype:'datecolumn',
  81. width: 110
  82. },{
  83. text: '客户名称',
  84. dataIndex: 'pi_custname',
  85. width: 250
  86. },{
  87. text: '关联销售单号',
  88. dataIndex: 'pi_sacode',
  89. width: 150
  90. },{
  91. text: '总金额',
  92. dataIndex: 'pi_total',
  93. xtype:'numbercolumn',
  94. width: 110
  95. }, {
  96. text: '单据状态',
  97. align: 'center',
  98. dataIndex: 'pi_status',
  99. width: 90
  100. },{
  101. text: '收款状态',
  102. align: 'center',
  103. dataIndex: 'pi_prstatus',
  104. width: 90
  105. },{
  106. text: '业务员',
  107. dataIndex: 'sa_seller',
  108. width: 90
  109. },{
  110. text: '审核人',
  111. dataIndex: 'pi_auditman',
  112. width: 110
  113. }, {
  114. text: '备注',
  115. dataIndex: 'pi_remark',
  116. width: 250
  117. },{
  118. text: '未含税金额',
  119. dataIndex: 'pi_nettotal',
  120. xtype:'numbercolumn',
  121. hidden :true
  122. },{
  123. text: '单据类型',
  124. dataIndex: 'pi_class',
  125. hidden :true
  126. }],
  127. relativeColumn: [{
  128. text: 'id',
  129. dataIndex: 'id',
  130. hidden:true,
  131. xtype: 'numbercolumn'
  132. }, {
  133. text: '出货单号',
  134. dataIndex: 'pi_inoutno',
  135. width: 150
  136. }, {
  137. text: '单据日期',
  138. dataIndex: 'pi_date',
  139. xtype:'datecolumn',
  140. width: 110
  141. },{
  142. text: '客户名称',
  143. dataIndex: 'pi_custname',
  144. width: 250
  145. }, {
  146. text: '单据状态',
  147. align: 'center',
  148. dataIndex: 'pi_status',
  149. width: 90
  150. }, {
  151. text: '明细序号',
  152. dataIndex: 'pd_pdno',
  153. xtype: 'numbercolumn',
  154. width: 100,
  155. renderer : function(v) {
  156. var format = '0'
  157. return Ext.util.Format.number(v, format);
  158. }
  159. }, {
  160. text: '关联销售单号',
  161. dataIndex: 'pd_ordercode',
  162. width: 150
  163. }, {
  164. text: '订单序号',
  165. dataIndex: 'pd_orderdetno',
  166. xtype:'numbercolumn',
  167. width: 100,
  168. renderer : function(v) {
  169. var format = '0'
  170. return Ext.util.Format.number(v, format);
  171. }
  172. }, {
  173. text: '物料编号',
  174. dataIndex: 'pd_prodcode',
  175. width: 150
  176. }, {
  177. text: '物料名称',
  178. dataIndex: 'pr_detail',
  179. width: 150
  180. }, {
  181. text: '出货数量',
  182. dataIndex: 'pd_outqty',
  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.' + xr.join();
  189. return Ext.util.Format.number(v, format);
  190. }
  191. }, {
  192. text: '销售单价',
  193. dataIndex: 'pd_sendprice',
  194. xtype:'numbercolumn',
  195. width: 110,
  196. renderer : function(v) {
  197. var arr = (v + '.').split('.');
  198. var xr = (new Array(arr[1].length > 8 ? 8 : arr[1].length)).fill('0');
  199. var format = '0.' + xr.join();
  200. return Ext.util.Format.number(v, format);
  201. }
  202. }, {
  203. text: '金额',
  204. dataIndex: 'pd_ordertotal',
  205. xtype:'numbercolumn',
  206. width: 110,
  207. renderer : function(v) {
  208. var arr = (v + '.').split('.');
  209. var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
  210. var format = '0.' + xr.join();
  211. return Ext.util.Format.number(v, format);
  212. }
  213. }, {
  214. text: '税率',
  215. dataIndex: 'pd_taxrate',
  216. xtype:'numbercolumn',
  217. width: 80,
  218. renderer : function(v) {
  219. return Ext.util.Format.number(v, '0');
  220. }
  221. }, {
  222. text: '成本单价',
  223. dataIndex: 'pd_price',
  224. xtype:'numbercolumn',
  225. width: 110,
  226. renderer : function(v) {
  227. var arr = (v + '.').split('.');
  228. var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  229. var format = '0.' + xr.join();
  230. return Ext.util.Format.number(v, format);
  231. }
  232. }, {
  233. text: '备注',
  234. dataIndex: 'pd_remark',
  235. width: 250
  236. }]
  237. }
  238. });