QueryPanel.js 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282
  1. Ext.define('saas.view.purchase.purchaseOut.QueryPanel', {
  2. extend: 'saas.view.core.query.QueryPanel',
  3. xtype: 'purchase-purchaseout-querypanel',
  4. controller: 'purchase-purchaseout-querypanel',
  5. viewModel: 'purchase-purchaseout-querypanel',
  6. viewName: 'purchase-purchaseout-querypanel',
  7. queryFormItems: [{
  8. xtype: 'textfield',
  9. name: 'pi_inoutno',
  10. emptyText:'请输入单号或供应商',
  11. getCondition: function(value) {
  12. return ' (pi_inoutno like\'%' + value + '%\' or pi_vendcode like \'%'+value+'%\' or pi_vendname like \'%'+value+'%\') ';
  13. }
  14. }, {
  15. xtype: 'condatefield',
  16. name: 'pi_date',
  17. fieldLabel: '日期',
  18. columnWidth: 0.5,
  19. operation: 'between'
  20. }, {
  21. xtype: 'productDbfindTrigger',
  22. name: 'pr_detail',
  23. fieldLabel: '物料',
  24. emptyText:'输入物料编号或名称',
  25. showDetail: true,
  26. getCondition: function(value) {
  27. console.log('物料:'+value);
  28. if(!value) {
  29. return '1=1';
  30. }else {
  31. return ' upper(concat(IFNULL(product.pr_detail,\' \'),\'#\',IFNULL(product.pr_code,\' \')) like \'%' + value.toUpperCase() + '%\' ';
  32. }
  33. }
  34. }, {
  35. xtype: 'combobox',
  36. name: 'pi_statuscode',
  37. fieldLabel: '单据状态',
  38. allowBlank: true,
  39. emptyText :'全部',
  40. editable:false,
  41. queryMode: 'local',
  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: 'multicombo',
  61. name: 'pi_prstatuscode',
  62. fieldLabel: '付款状态',
  63. emptyText :'全部',
  64. datas: [
  65. ["PAYNONE", "未付款"],
  66. ["PAYPART", "部分付款"],
  67. ["PAYALL", "已付款"]
  68. ]
  69. }, {
  70. xtype: 'warehouseDbfindTrigger',
  71. name: 'pd_whname',
  72. fieldLabel: '仓库',
  73. emptyText:'请输入仓库编号或名称',
  74. showDetail: true,
  75. getCondition: function(value) {
  76. if(!value) {
  77. return '1=1';
  78. }else {
  79. return 'prodiodetail.pd_whname like\'%' + value + '%\'';
  80. }
  81. }
  82. }, {
  83. xtype: 'textfield',
  84. name: 'pi_iocode',
  85. fieldLabel: '关联验收单号',
  86. emptyText: '输入单号',
  87. }, {
  88. xtype: 'accountDbfindTrigger',
  89. name: 'creatorName',
  90. fieldLabel: '录入人',
  91. emptyText:'请输入人员编号或名称',
  92. getCondition: function(value) {
  93. if(!value) {
  94. return '1=1';
  95. }else {
  96. return 'prodinout.creatorName like\'%' + value + '%\'';
  97. }
  98. }
  99. }, {
  100. xtype: 'accountDbfindTrigger',
  101. name: 'pi_auditman',
  102. fieldLabel: '审核人',
  103. emptyText:'请输入人员编号或名称'
  104. }],
  105. queryGridConfig: {
  106. idField:'id',
  107. codeField:'pi_inoutno',
  108. addTitle:'采购验退单',
  109. addXtype:'purchase-purchaseout-formpanel',
  110. defaultCondition:' pi_class = \'采购验退单\'',
  111. baseVastUrl:'/api/purchase/prodinout/',
  112. caller:'PurchaseOut',
  113. baseColumn: [{
  114. text: 'id',
  115. dataIndex: 'id',
  116. hidden:true,
  117. xtype: 'numbercolumn'
  118. }, {
  119. text: '验退单号',
  120. dataIndex: 'pi_inoutno',
  121. width: 150
  122. },{
  123. text: '单据类型',
  124. dataIndex: 'pi_class',
  125. width: 0
  126. },{
  127. text: '单据日期',
  128. dataIndex: 'pi_date',
  129. xtype:'datecolumn',
  130. width: 110
  131. },{
  132. text: '供应商名称',
  133. dataIndex: 'pi_vendname',
  134. width: 150
  135. },{
  136. text: '关联验收单号',
  137. dataIndex: 'pi_iocode',
  138. width: 150
  139. },{
  140. text: '总金额',
  141. dataIndex: 'pi_total',
  142. width: 110
  143. },{
  144. text: '单据状态',
  145. align: 'center',
  146. dataIndex: 'pi_status',
  147. width: 90
  148. },{
  149. text: '付款状态',
  150. align: 'center',
  151. dataIndex: 'pi_prstatus',
  152. width: 90
  153. },{
  154. text: '录入人',
  155. dataIndex: 'creatorName',
  156. width: 110
  157. },{
  158. text: '审核人',
  159. dataIndex: 'pi_auditman',
  160. width: 110
  161. },{
  162. text: '备注',
  163. dataIndex: 'pi_remark',
  164. width: 250
  165. }],
  166. relativeColumn: [
  167. {
  168. text: 'id',
  169. dataIndex: 'pu_id',
  170. xtype: 'numbercolumn',
  171. hidden:true
  172. }, {
  173. text: '单据编号',
  174. dataIndex: 'pi_inoutno',
  175. width: 150
  176. }, {
  177. text: '单据类型',
  178. dataIndex: 'pd_piclass',
  179. width: 0
  180. },{
  181. text: '单据日期',
  182. dataIndex: 'pi_date',
  183. xtype:'datecolumn',
  184. width: 110
  185. },{
  186. text: '供应商编号',
  187. dataIndex: 'pi_vendcode',
  188. width: 0
  189. },{
  190. text: '供应商名称',
  191. dataIndex: 'pi_vendname',
  192. width: 250
  193. },{
  194. text: '审核状态',
  195. align: 'center',
  196. dataIndex: 'pi_status',
  197. width: 90
  198. },{
  199. text: '序号',
  200. dataIndex: 'pd_pdno',
  201. width: 80,
  202. renderer : function(v) {
  203. return Ext.util.Format.number(v, '0');
  204. }
  205. },{
  206. text: '关联验收单号',
  207. dataIndex: 'pi_iocode',
  208. width: 150
  209. },{
  210. text: '关联验收序号号',
  211. dataIndex: 'iodetno',
  212. width: 150
  213. },{
  214. text: '物料编号',
  215. dataIndex: 'pd_prodcode',
  216. width: 150,
  217. renderer : function(v) {
  218. return Ext.util.Format.number(v, '0');
  219. }
  220. },{
  221. text: '物料名称',
  222. dataIndex: 'pr_detail',
  223. width: 200
  224. },{
  225. text: '物料规格',
  226. dataIndex: 'pr_spec',
  227. width: 150
  228. },{
  229. text: '单位',
  230. dataIndex: 'pr_unit',
  231. width: 80
  232. },{
  233. text: '数量',
  234. dataIndex: 'pd_outqty',
  235. xtype:'numbercolumn',
  236. width: 110,
  237. renderer : function(v) {
  238. var arr = (v + '.').split('.');
  239. var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
  240. var format = '0,000.' + xr.join();
  241. return Ext.util.Format.number(v, format);
  242. },
  243. },{
  244. text: '仓库',
  245. dataIndex: 'pd_whname',
  246. width: 150
  247. },{
  248. text: '单价',
  249. dataIndex: 'pd_orderprice',
  250. xtype:'numbercolumn',
  251. renderer : function(v) {
  252. var arr = (v + '.').split('.');
  253. var xr = (new Array(arr[1].length)).fill('0');
  254. var format = '0,000.' + xr.join();
  255. return Ext.util.Format.number(v, format);
  256. },
  257. width: 110
  258. },{
  259. text: '税率',
  260. dataIndex: 'pd_taxrate',
  261. xtype:'numbercolumn',
  262. width: 80,
  263. renderer : function(v) {
  264. return Ext.util.Format.number(v, '0');
  265. },
  266. },{
  267. text: '金额',
  268. dataIndex: 'pd_ordertotal',
  269. xtype:'numbercolumn',
  270. width: 110,
  271. renderer : function(v) {
  272. var arr = (v + '.').split('.');
  273. var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  274. var format = '0,000.' + xr.join();
  275. return Ext.util.Format.number(v, format);
  276. },
  277. }]
  278. }
  279. });