QueryPanel.js 8.6 KB

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