QueryPanel.js 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  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. align: 'center',
  133. width: 65
  134. }, {
  135. text: '审核状态',
  136. align: 'center',
  137. dataIndex: 'pu_status',
  138. width: 80
  139. },{
  140. text: '业务状态',
  141. align: 'center',
  142. dataIndex: 'pu_acceptstatus',
  143. width: 80
  144. },{
  145. text: '采购员',
  146. dataIndex: 'pu_buyername',
  147. width: 80
  148. },{
  149. text: '关联销售单号',
  150. dataIndex: 'pu_sacode',
  151. width: 150
  152. },{
  153. text: '备注',
  154. dataIndex: 'pu_remark',
  155. width: 250
  156. }],
  157. relativeColumn: [
  158. {
  159. text: 'id',
  160. dataIndex: 'pu_id',
  161. width: 0,
  162. hidden: true
  163. }, {
  164. text: '采购单号',
  165. dataIndex: 'pu_code',
  166. width: 150
  167. }, {
  168. text: '单据日期',
  169. dataIndex: 'pu_date',
  170. xtype: 'datecolumn',
  171. width: 110
  172. },{
  173. text: '供应商名称',
  174. dataIndex: 'pu_vendname',
  175. width: 200
  176. }, {
  177. text: '审核状态',
  178. align: 'center',
  179. dataIndex: 'pu_status',
  180. width: 80
  181. }, {
  182. text: '物料编号',
  183. dataIndex: 'pd_prodcode',
  184. width: 150
  185. },{
  186. text: '品牌',
  187. dataIndex: 'pr_brand',
  188. width: 100
  189. },{
  190. text: '物料名称',
  191. dataIndex: 'pr_detail',
  192. width: 150
  193. },{
  194. text: '型号',
  195. dataIndex: 'pr_orispeccode',
  196. width: 200
  197. },{
  198. text: '规格',
  199. dataIndex: 'pr_spec',
  200. width: 200
  201. },{
  202. text: '数量',
  203. dataIndex: 'pd_qty',
  204. xtype: 'numbercolumn',
  205. width: 110,
  206. renderer : function(v) {
  207. return saas.util.BaseUtil.numberFormat(v, 3, false);
  208. }
  209. }, {
  210. text: '单位',
  211. dataIndex: 'pr_unit',
  212. width: 65
  213. }, {
  214. text: '单价(元)',
  215. dataIndex: 'pd_taxprice',
  216. xtype: 'numbercolumn',
  217. width: 110,
  218. renderer : function(v) {
  219. return saas.util.BaseUtil.numberFormat(v, 4, true);
  220. }
  221. },{
  222. text: '金额(元)',
  223. dataIndex: 'pd_taxtotal',
  224. xtype: 'numbercolumn',
  225. width: 110,
  226. renderer : function(v) {
  227. return saas.util.BaseUtil.numberFormat(v, 2, true);
  228. }
  229. },{
  230. text: '税额(元)',
  231. dataIndex: 'pd_taxamount',
  232. xtype: 'numbercolumn',
  233. width: 110,
  234. renderer : function(v,g,r) {
  235. v = (r.data["pd_total"]||0.0) - (r.data["pd_taxtotal"]||0.0);
  236. return saas.util.BaseUtil.numberFormat(v, 2, true);
  237. }
  238. },{
  239. text: '价税合计(元)',
  240. dataIndex: 'pd_total',
  241. xtype: 'numbercolumn',
  242. width: 110,
  243. renderer : function(v) {
  244. return saas.util.BaseUtil.numberFormat(v, 2, true);
  245. }
  246. }, {
  247. text: '关联销售单号',
  248. dataIndex: 'pd_salecode',
  249. width: 150
  250. }, {
  251. text: '备注',
  252. dataIndex: 'pd_remark',
  253. width: 250
  254. }]
  255. }
  256. });