QueryPanel.js 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  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. if(!value) {
  28. return '1=1';
  29. }else {
  30. return ' pr_detail = \'' + value + '\' ';
  31. }
  32. }
  33. }, {
  34. xtype: 'combobox',
  35. name: 'pi_statuscode',
  36. fieldLabel: '单据状态',
  37. allowBlank: true,
  38. emptyText :'全部',
  39. editable:false,
  40. queryMode: 'local',
  41. displayField: 'pi_status',
  42. valueField: 'pi_statuscode',
  43. store: Ext.create('Ext.data.ArrayStore', {
  44. fields: ['pi_statuscode', 'pi_status'],
  45. data: [
  46. ["ALL", "全部"],
  47. ["AUDITED", "已审核"],
  48. ["UNAUDITED", "未审核"]
  49. ]
  50. }),
  51. getCondition: function(value) {
  52. if(value == 'ALL') {
  53. return '1=1';
  54. }else {
  55. return 'pi_statuscode=\'' + value + '\'';
  56. }
  57. }
  58. }, {
  59. xtype: 'multicombo',
  60. name: 'pi_prstatuscode',
  61. fieldLabel: '付款状态',
  62. emptyText :'全部',
  63. datas: [
  64. ["PAYNONE", "未付款"],
  65. ["PAYPART", "部分付款"],
  66. ["PAYALL", "已付款"]
  67. ]
  68. }, {
  69. xtype: 'warehouseDbfindTrigger',
  70. name: 'pd_whname',
  71. fieldLabel: '仓库',
  72. emptyText:'请输入仓库编号或名称',
  73. showDetail: true,
  74. getCondition: function(value) {
  75. if(!value) {
  76. return '1=1';
  77. }else {
  78. return 'prodiodetail.pd_whname like\'%' + value + '%\'';
  79. }
  80. }
  81. }, {
  82. xtype: 'textfield',
  83. name: 'pi_iocode',
  84. fieldLabel: '关联验收单号',
  85. emptyText: '请输入采购验收单号',
  86. }, {
  87. xtype: 'accountDbfindTrigger',
  88. name: 'creatorName',
  89. fieldLabel: '录入人',
  90. emptyText:'请输入账户名称或姓名',
  91. getCondition: function(value) {
  92. if(!value) {
  93. return '1=1';
  94. }else {
  95. return 'prodinout.creatorName like\'%' + value + '%\'';
  96. }
  97. }
  98. }, {
  99. xtype: 'accountDbfindTrigger',
  100. name: 'pi_auditman',
  101. fieldLabel: '审核人',
  102. emptyText:'请输入账户名称或姓名'
  103. }],
  104. queryGridConfig: {
  105. idField:'id',
  106. codeField:'pi_inoutno',
  107. addTitle:'采购验退单',
  108. addXtype:'purchase-purchaseout-formpanel',
  109. defaultCondition:' pi_class = \'采购验退单\'',
  110. baseVastUrl:'/api/purchase/prodinout/',
  111. caller:'PurchaseOut',
  112. baseColumn: [{
  113. text: 'id',
  114. dataIndex: 'id',
  115. hidden:true,
  116. xtype: 'numbercolumn'
  117. }, {
  118. text: '验退单号',
  119. dataIndex: 'pi_inoutno',
  120. width: 150
  121. },{
  122. text: '单据类型',
  123. dataIndex: 'pi_class',
  124. width: 0
  125. },{
  126. text: '单据日期',
  127. dataIndex: 'pi_date',
  128. xtype:'datecolumn',
  129. width: 110
  130. },{
  131. text: '供应商名称',
  132. dataIndex: 'pi_vendname',
  133. width: 150
  134. }, {
  135. text: '金额(元)',
  136. dataIndex: 'pi_nettotal',
  137. width: 110
  138. }, {
  139. text: '价税合计(元)',
  140. dataIndex: 'pi_total',
  141. width: 110
  142. },{
  143. text: '审核状态',
  144. align: 'center',
  145. dataIndex: 'pi_status',
  146. width: 80
  147. },{
  148. text: '付款状态',
  149. align: 'center',
  150. dataIndex: 'pi_prstatus',
  151. width: 80
  152. }, {
  153. text: '关联验收单号',
  154. dataIndex: 'pi_iocode',
  155. width: 150
  156. }, {
  157. text: '备注',
  158. dataIndex: 'pi_remark',
  159. width: 250
  160. }],
  161. relativeColumn: [
  162. {
  163. text: 'id',
  164. dataIndex: 'pu_id',
  165. xtype: 'numbercolumn',
  166. hidden:true
  167. }, {
  168. text: '验退单号',
  169. dataIndex: 'pi_inoutno',
  170. width: 150
  171. }, {
  172. text: '单据日期',
  173. dataIndex: 'pi_date',
  174. xtype:'datecolumn',
  175. width: 110
  176. },{
  177. text: '供应商名称',
  178. dataIndex: 'pi_vendname',
  179. width: 200
  180. },{
  181. text: '审核状态',
  182. align: 'center',
  183. dataIndex: 'pi_status',
  184. width: 80
  185. }, {
  186. text: '物料编号',
  187. dataIndex: 'pd_prodcode',
  188. width: 150
  189. }, {
  190. text: '品牌',
  191. dataIndex: 'pr_brand',
  192. width: 100
  193. },{
  194. text: '物料名称',
  195. dataIndex: 'pr_detail',
  196. width: 150
  197. },{
  198. text: '型号',
  199. dataIndex: 'pr_orispeccode',
  200. width: 200
  201. },{
  202. text: '规格',
  203. dataIndex: 'pr_spec',
  204. width: 200
  205. },{
  206. text: '仓库',
  207. dataIndex: 'pd_whname',
  208. width: 80
  209. },{
  210. text: '验退数量',
  211. dataIndex: 'pd_outqty',
  212. xtype:'numbercolumn',
  213. width: 110,
  214. renderer : function(v) {
  215. var arr = (v + '.').split('.');
  216. var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
  217. var format = '0,000.' + xr.join('');
  218. return Ext.util.Format.number(v, format);
  219. },
  220. }, {
  221. text: '单位',
  222. dataIndex: 'pr_unit',
  223. width: 65
  224. }, {
  225. text: '单价(元)',
  226. dataIndex: 'pd_netprice',
  227. xtype:'numbercolumn',
  228. renderer : function(v) {
  229. var arr = (v + '.').split('.');
  230. var xr = (new Array(arr[1].length > 4 ? 4 : arr[1].length)).fill('0');
  231. var format = '0,000.' + xr.join('');
  232. return Ext.util.Format.number(v, format);
  233. },
  234. width: 110
  235. }, {
  236. text: '含税单价(元)',
  237. dataIndex: 'pd_netprice',
  238. xtype:'numbercolumn',
  239. renderer : function(v) {
  240. var arr = (v + '.').split('.');
  241. var xr = (new Array(arr[1].length > 4 ? 4 : arr[1].length)).fill('0');
  242. var format = '0,000.' + xr.join('');
  243. return Ext.util.Format.number(v, format);
  244. },
  245. width: 110
  246. }, {
  247. text: '金额(元)',
  248. dataIndex: 'pd_nettotal',
  249. xtype:'numbercolumn',
  250. width: 110,
  251. renderer : function(v) {
  252. var arr = (v + '.').split('.');
  253. var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  254. var format = '0,000.' + xr.join('');
  255. return Ext.util.Format.number(v, format);
  256. },
  257. }, {
  258. text: '税额(元)',
  259. dataIndex: 'pd_taxamount',
  260. xtype:'numbercolumn',
  261. width: 110,
  262. renderer : function(v,g,r) {
  263. v = (r.data["pd_ordertotal"]||0.0) - (r.data["pd_nettotal"]||0.0);
  264. var arr = (v + '.').split('.');
  265. var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  266. var format = '0,000.' + xr.join('');
  267. return Ext.util.Format.number(v, format);
  268. }
  269. }, {
  270. text: '价税合计(元)',
  271. dataIndex: 'pd_ordertotal',
  272. xtype:'numbercolumn',
  273. width: 110,
  274. renderer : function(v) {
  275. var arr = (v + '.').split('.');
  276. var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  277. var format = '0,000.' + xr.join('');
  278. return Ext.util.Format.number(v, format);
  279. },
  280. }, {
  281. text: '关联验收单号',
  282. dataIndex: 'pi_iocode',
  283. width: 150
  284. }, {
  285. text: '备注',
  286. dataIndex: 'iodetno',
  287. width: 250
  288. }]
  289. }
  290. });