QueryPanel.js 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303
  1. Ext.define('saas.view.sale.saleIn.QueryPanel', {
  2. extend: 'saas.view.core.query.QueryPanel',
  3. xtype: 'sale-salein-querypanel',
  4. controller: 'sale-salein-querypanel',
  5. viewModel: 'sale-salein-querypanel',
  6. viewName: 'sale-salein-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. fieldLabel: '仓库',
  67. emptyText: '输入仓库编号或名称',
  68. showDetail: true
  69. }, {
  70. xtype: 'textfield',
  71. name: 'pi_iocode',
  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-salein-formpanel',
  98. defaultCondition:' pi_class = \'销售退货单\'',
  99. baseVastUrl: '/api/sale/prodinout/',
  100. caller:'SaleIn',
  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. renderer : function(v) {
  125. var arr = (v + '.').split('.');
  126. var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  127. var format = '0.' + xr.join('');
  128. return Ext.util.Format.number(v, format);
  129. }
  130. }, {
  131. text: '价税合计(元)',
  132. dataIndex: 'pi_total',
  133. xtype:'numbercolumn',
  134. width: 110,
  135. renderer : function(v) {
  136. var arr = (v + '.').split('.');
  137. var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  138. var format = '0.' + xr.join('');
  139. return Ext.util.Format.number(v, format);
  140. }
  141. },{
  142. text: '币别',
  143. align: 'center',
  144. dataIndex: "pi_currency",
  145. defaultValue: 'RMB',
  146. width:80
  147. }, {
  148. text: '审核状态',
  149. align: 'center',
  150. dataIndex: 'pi_status',
  151. width: 80
  152. }, {
  153. text: '收款状态',
  154. align: 'center',
  155. dataIndex: 'pi_prstatus',
  156. width: 80
  157. }, {
  158. text: '关联出货单',
  159. dataIndex: 'pi_iocode',
  160. width: 150
  161. }, {
  162. text: '备注',
  163. dataIndex: 'pi_remark',
  164. width: 250
  165. }],
  166. relativeColumn: [{
  167. text: 'id',
  168. dataIndex: 'id',
  169. hidden:true,
  170. xtype: 'numbercolumn'
  171. }, {
  172. text: '退货单号',
  173. dataIndex: 'pi_inoutno',
  174. width: 150
  175. }, {
  176. text: '单据日期',
  177. dataIndex: 'pi_date',
  178. xtype:'datecolumn',
  179. width: 110
  180. },{
  181. text: '客户名称',
  182. dataIndex: 'pi_custname',
  183. width: 200
  184. }, {
  185. text: '币别',
  186. align: 'center',
  187. dataIndex: "pi_currency",
  188. defaultValue: 'RMB',
  189. width:80
  190. },{
  191. text: '审核状态',
  192. align: 'center',
  193. dataIndex: 'pi_status',
  194. width: 80
  195. }, {
  196. text: '物料编号',
  197. dataIndex: 'pd_prodcode',
  198. width: 150
  199. },{
  200. text: '品牌',
  201. dataIndex: 'pr_brand',
  202. width: 100
  203. },{
  204. text: '物料名称',
  205. dataIndex: 'pr_detail',
  206. width: 150
  207. },{
  208. text: '型号',
  209. dataIndex: 'pr_orispeccode',
  210. width: 200
  211. },{
  212. text: '规格',
  213. dataIndex: 'pr_spec',
  214. width: 200
  215. }, {
  216. text: '仓库',
  217. dataIndex: 'pd_whname',
  218. width: 150
  219. },{
  220. text: '退货数量',
  221. dataIndex: 'pd_inqty',
  222. xtype:'numbercolumn',
  223. width: 110,
  224. renderer : function(v) {
  225. var arr = (v + '.').split('.');
  226. var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
  227. var format = '0.' + xr.join('');
  228. return Ext.util.Format.number(v, format);
  229. }
  230. }, {
  231. text: '单位',
  232. dataIndex: 'pr_unit',
  233. width: 65
  234. }, {
  235. text: '单价(元)',
  236. dataIndex: 'pd_netprice',
  237. xtype:'numbercolumn',
  238. width: 110,
  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.' + xr.join('');
  243. return Ext.util.Format.number(v, format);
  244. }
  245. }, {
  246. text: '含税单价(元)',
  247. dataIndex: 'pd_sendprice',
  248. xtype:'numbercolumn',
  249. width: 110,
  250. renderer : function(v) {
  251. var arr = (v + '.').split('.');
  252. var xr = (new Array(arr[1].length > 4 ? 4 : arr[1].length)).fill('0');
  253. var format = '0.' + xr.join('');
  254. return Ext.util.Format.number(v, format);
  255. }
  256. }, {
  257. text: '金额(元)',
  258. dataIndex: 'pd_nettotal',
  259. xtype:'numbercolumn',
  260. width: 110,
  261. renderer : function(v) {
  262. var arr = (v + '.').split('.');
  263. var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
  264. var format = '0.' + xr.join('');
  265. return Ext.util.Format.number(v, format);
  266. }
  267. }, {
  268. text: '税额(元)',
  269. dataIndex: 'pd_taxamount',
  270. xtype:'numbercolumn',
  271. width: 110,
  272. renderer : function(v,g,r) {
  273. v = (r.data["pd_ordertotal"]||0.0) - (r.data["pd_nettotal"]||0.0);
  274. var arr = (v + '.').split('.');
  275. var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  276. var format = '0,000.' + xr.join('');
  277. return Ext.util.Format.number(v, format);
  278. }
  279. }, {
  280. text: '价税合计(元)',
  281. dataIndex: 'pd_ordertotal',
  282. xtype:'numbercolumn',
  283. width: 110,
  284. renderer : function(v) {
  285. var arr = (v + '.').split('.');
  286. var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
  287. var format = '0.' + xr.join('');
  288. return Ext.util.Format.number(v, format);
  289. }
  290. }, {
  291. text: '关联出货单号',
  292. dataIndex: 'pi_iocode',
  293. width: 150
  294. }, {
  295. text: '备注',
  296. dataIndex: 'pd_remark',
  297. width: 250
  298. }]
  299. }
  300. });