QueryPanel.js 8.9 KB

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