QueryPanel.js 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. Ext.define('saas.view.purchase.purchase.QueryPanel', {
  2. extend: 'saas.view.core.query.QueryPanel',
  3. xtype: 'purchase-purchase-querypanel',
  4. controller: 'purchase-purchase-querypanel',
  5. viewModel: 'purchase-purchase-querypanel',
  6. viewName: 'purchase-purchase-querypanel',
  7. queryFormItems: [{
  8. xtype: 'textfield',
  9. name: 'pu_code',
  10. labelSeparator:' ',
  11. emptyText:'请输入单号或供应商名称',
  12. getCondition: function(value) {
  13. return ' (pu_code like\'%' + value + '%\' or pu_vendcode like \'%'+value+'%\' or pu_vendname like \'%'+value+'%\') ';
  14. }
  15. },{
  16. margin:'0 0 0 20',
  17. xtype: 'productDbfindTrigger',
  18. name: 'pr_detail',
  19. showDetail: true,
  20. emptyText:'输入物料编号或名称',
  21. }, {
  22. xtype: 'condatefield',
  23. name: 'pu_date',
  24. fieldLabel: '日期',
  25. columnWidth: 0.5,
  26. operation: 'between'
  27. }, {
  28. xtype: 'combobox',
  29. name: 'pu_statuscode',
  30. fieldLabel: '单据状态',
  31. queryMode: 'local',
  32. displayField: 'pu_status',
  33. valueField: 'pu_statuscode',
  34. emptyText :'全部',
  35. editable:false,
  36. store: Ext.create('Ext.data.ArrayStore', {
  37. fields: ['pu_statuscode', 'pu_status'],
  38. data: [
  39. ["ALL", "全部"],
  40. ["AUDITED", "已审核"],
  41. ["UNAUDITED", "未审核"]
  42. ]
  43. }),
  44. getCondition: function(value) {
  45. if(value == 'ALL') {
  46. return '1=1';
  47. }else {
  48. return 'pu_statuscode=\'' + value + '\'';
  49. }
  50. }
  51. }, {
  52. xtype: 'multicombo',
  53. name: 'pu_acceptstatuscode',
  54. fieldLabel: '业务状态',
  55. emptyText :'全部',
  56. datas: [
  57. ["TURNIN", "已入库"],
  58. ["UNTURNIN", "未入库"],
  59. ["PART2IN", "部分入库"],
  60. ["CLOSE", "已关闭"]
  61. ]
  62. }, {
  63. xtype: 'textfield',
  64. name: 'pu_sacode',
  65. fieldLabel: '关联销售单号',
  66. emptyText: '输入关联销售单号',
  67. }, {
  68. xtype: 'accountDbfindTrigger',
  69. name: 'creatorName',
  70. fieldLabel: '录入人',
  71. emptyText:'请输入账户名称或姓名',
  72. getCondition: function(value) {
  73. if(!value) {
  74. return '1=1';
  75. }else {
  76. return 'purchase.creatorName like\'%' + value + '%\'';
  77. }
  78. }
  79. }, {
  80. xtype: 'accountDbfindTrigger',
  81. name: 'pu_auditman',
  82. fieldLabel: '审核人',
  83. emptyText:'请输入账户名称或姓名'
  84. }],
  85. queryGridConfig: {
  86. idField: 'pu_id',
  87. codeField: 'pu_code',
  88. addTitle: '采购订单',
  89. addXtype: 'purchase-purchase-formpanel',
  90. defaultCondition:'',
  91. baseVastUrl: '/api/purchase/purchase/',
  92. caller:'Purchase',
  93. baseColumn: [
  94. {
  95. text: 'id',
  96. dataIndex: 'pu_id',
  97. width: 0,
  98. xtype: 'numbercolumn',
  99. hidden:true
  100. }, {
  101. text: '采购单号',
  102. dataIndex: 'pu_code',
  103. width: 150
  104. },{
  105. text: '单据日期',
  106. dataIndex: 'pu_date',
  107. xtype: 'datecolumn',
  108. width: 110
  109. },{
  110. text: '供应商名称',
  111. dataIndex: 'pu_vendname',
  112. width:200
  113. }, {
  114. text: '金额(元)',
  115. dataIndex: 'pu_taxtotal',
  116. xtype: 'numbercolumn',
  117. width: 110,
  118. renderer : function(v) {
  119. return saas.util.BaseUtil.numberFormat(v, 2, true);
  120. }
  121. }, {
  122. text: '价税合计(元)',
  123. dataIndex: 'pu_total',
  124. xtype: 'numbercolumn',
  125. width: 110,
  126. renderer : function(v) {
  127. return saas.util.BaseUtil.numberFormat(v, 2, true);
  128. }
  129. },{
  130. text: '币别',
  131. dataIndex: 'pu_currency',
  132. width: 65
  133. }, {
  134. text: '审核状态',
  135. align: 'center',
  136. dataIndex: 'pu_status',
  137. width: 80
  138. },{
  139. text: '业务状态',
  140. align: 'center',
  141. dataIndex: 'pu_acceptstatus',
  142. width: 80
  143. },{
  144. text: '采购员',
  145. dataIndex: 'pu_buyername',
  146. width: 80
  147. },{
  148. text: '关联销售单',
  149. dataIndex: 'pu_sacode',
  150. width: 150
  151. },{
  152. text: '备注',
  153. dataIndex: 'pu_remark',
  154. width: 250
  155. }],
  156. relativeColumn: [
  157. {
  158. text: 'id',
  159. dataIndex: 'pu_id',
  160. width: 0,
  161. hidden: true
  162. }, {
  163. text: '采购单号',
  164. dataIndex: 'pu_code',
  165. width: 150
  166. }, {
  167. text: '单据日期',
  168. dataIndex: 'pu_date',
  169. xtype: 'datecolumn',
  170. width: 110
  171. },{
  172. text: '供应商名称',
  173. dataIndex: 'pu_vendname',
  174. width: 200
  175. }, {
  176. text: '审核状态',
  177. align: 'center',
  178. dataIndex: 'pu_status',
  179. width: 80
  180. }, {
  181. text: '物料编号',
  182. dataIndex: 'pd_prodcode',
  183. width: 150
  184. },{
  185. text: '品牌',
  186. dataIndex: 'pr_brand',
  187. width: 100
  188. },{
  189. text: '物料名称',
  190. dataIndex: 'pr_detail',
  191. width: 150
  192. },{
  193. text: '型号',
  194. dataIndex: 'pr_orispeccode',
  195. width: 200
  196. },{
  197. text: '规格',
  198. dataIndex: 'pr_spec',
  199. width: 200
  200. },{
  201. text: '数量',
  202. dataIndex: 'pd_qty',
  203. xtype: 'numbercolumn',
  204. width: 110,
  205. renderer : function(v) {
  206. return saas.util.BaseUtil.numberFormat(v, 3, false);
  207. }
  208. }, {
  209. text: '单位',
  210. dataIndex: 'pr_unit',
  211. width: 65
  212. }, {
  213. text: '单价(元)',
  214. dataIndex: 'pd_taxprice',
  215. xtype: 'numbercolumn',
  216. width: 110,
  217. renderer : function(v) {
  218. return saas.util.BaseUtil.numberFormat(v, 4, true);
  219. }
  220. },{
  221. text: '金额(元)',
  222. dataIndex: 'pd_taxtotal',
  223. xtype: 'numbercolumn',
  224. width: 110,
  225. renderer : function(v) {
  226. return saas.util.BaseUtil.numberFormat(v, 2, true);
  227. }
  228. },{
  229. text: '税额(元)',
  230. dataIndex: 'pd_taxamount',
  231. xtype: 'numbercolumn',
  232. width: 110,
  233. renderer : function(v,g,r) {
  234. v = (r.data["pd_total"]||0.0) - (r.data["pd_taxtotal"]||0.0);
  235. return saas.util.BaseUtil.numberFormat(v, 2, true);
  236. }
  237. },{
  238. text: '价税合计(元)',
  239. dataIndex: 'pd_total',
  240. xtype: 'numbercolumn',
  241. width: 110,
  242. renderer : function(v) {
  243. return saas.util.BaseUtil.numberFormat(v, 2, true);
  244. }
  245. }, {
  246. text: '关联销售单号',
  247. dataIndex: 'pd_salecode',
  248. width: 150
  249. }, {
  250. text: '备注',
  251. dataIndex: 'pd_remark',
  252. width: 250
  253. }]
  254. }
  255. });