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. fieldLabel: ' ',
  11. labelSeparator:' ',
  12. emptyText:'请输入单号或供应商',
  13. getCondition: function(value) {
  14. return ' (pu_code like\'%' + value + '%\' or pu_vendcode like \'%'+value+'%\' or pu_vendname like \'%'+value+'%\') ';
  15. }
  16. }, {
  17. xtype: 'condatefield',
  18. name: 'pu_date',
  19. fieldLabel: '日期',
  20. columnWidth: 0.5,
  21. operation: 'between'
  22. }, {
  23. xtype: 'productDbfindTrigger',
  24. name: 'pr_detail',
  25. fieldLabel: '物料',
  26. showDetail: true,
  27. emptyText:'输入物料编号或名称',
  28. }, {
  29. xtype: 'combobox',
  30. name: 'pu_statuscode',
  31. fieldLabel: '单据状态',
  32. queryMode: 'local',
  33. displayField: 'pu_status',
  34. valueField: 'pu_statuscode',
  35. emptyText :'全部',
  36. editable:false,
  37. store: Ext.create('Ext.data.ArrayStore', {
  38. fields: ['pu_statuscode', 'pu_status'],
  39. data: [
  40. ["ALL", "全部"],
  41. ["AUDITED", "已审核"],
  42. ["UNAUDITED", "未审核"]
  43. ]
  44. }),
  45. getCondition: function(value) {
  46. if(value == 'ALL') {
  47. return '1=1';
  48. }else {
  49. return 'pu_statuscode=\'' + value + '\'';
  50. }
  51. }
  52. }, {
  53. xtype: 'multicombo',
  54. name: 'pu_acceptstatuscode',
  55. fieldLabel: '业务状态',
  56. emptyText :'全部',
  57. datas: [
  58. ["TURNIN", "已入库"],
  59. ["UNTURNIN", "未入库"],
  60. ["PART2IN", "部分入库"],
  61. ["CLOSE", "已关闭"]
  62. ]
  63. }, {
  64. xtype: 'textfield',
  65. name: 'pu_sacode',
  66. fieldLabel: '关联销售单号',
  67. emptyText: '输入单号',
  68. }, {
  69. xtype: 'accountDbfindTrigger',
  70. name: 'creatorName',
  71. fieldLabel: '录入人',
  72. emptyText:'请输入账户名称或姓名',
  73. getCondition: function(value) {
  74. if(!value) {
  75. return '1=1';
  76. }else {
  77. return 'purchase.creatorName like\'%' + value + '%\'';
  78. }
  79. }
  80. }, {
  81. xtype: 'accountDbfindTrigger',
  82. name: 'pu_auditman',
  83. fieldLabel: '审核人',
  84. emptyText:'请输入账户名称或姓名'
  85. }],
  86. queryGridConfig: {
  87. idField: 'pu_id',
  88. codeField: 'pu_code',
  89. addTitle: '采购订单',
  90. addXtype: 'purchase-purchase-formpanel',
  91. defaultCondition:'',
  92. baseVastUrl: '/api/purchase/purchase/',
  93. caller:'Purchase',
  94. baseColumn: [
  95. {
  96. text: 'id',
  97. dataIndex: 'pu_id',
  98. width: 0,
  99. xtype: 'numbercolumn',
  100. hidden:true
  101. }, {
  102. text: '采购单号',
  103. dataIndex: 'pu_code',
  104. width: 150
  105. },{
  106. text: '单据日期',
  107. dataIndex: 'pu_date',
  108. xtype: 'datecolumn',
  109. width: 110
  110. },{
  111. text: '供应商名称',
  112. dataIndex: 'pu_vendname',
  113. width:200
  114. }, {
  115. text: '金额(元)',
  116. dataIndex: 'pu_taxtotal',
  117. xtype: 'numbercolumn',
  118. width: 110,
  119. renderer : function(v) {
  120. return saas.util.BaseUtil.numberFormat(v, 2, true);
  121. }
  122. }, {
  123. text: '价税合计(元)',
  124. dataIndex: 'pu_total',
  125. xtype: 'numbercolumn',
  126. width: 110,
  127. renderer : function(v) {
  128. return saas.util.BaseUtil.numberFormat(v, 2, true);
  129. }
  130. },{
  131. text: '币别',
  132. dataIndex: 'pu_currency',
  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, true);
  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. });