QueryPanel.js 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294
  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. xtype: 'numbercolumn',
  137. dataIndex: 'pi_nettotal',
  138. width: 110
  139. }, {
  140. text: '价税合计(元)',
  141. xtype: 'numbercolumn',
  142. dataIndex: 'pi_total',
  143. width: 110
  144. }, {
  145. text: '审核状态',
  146. align: 'center',
  147. dataIndex: 'pi_status',
  148. width: 80
  149. }, {
  150. text: '付款状态',
  151. align: 'center',
  152. dataIndex: 'pi_prstatus',
  153. width: 80
  154. }, {
  155. text: '关联验收单号',
  156. dataIndex: 'pi_iocode',
  157. width: 150
  158. }, {
  159. text: '备注',
  160. dataIndex: 'pi_remark',
  161. width: 250
  162. }],
  163. relativeColumn: [{
  164. text: 'id',
  165. dataIndex: 'pu_id',
  166. xtype: 'numbercolumn',
  167. hidden: true
  168. }, {
  169. text: '验退单号',
  170. dataIndex: 'pi_inoutno',
  171. width: 150
  172. }, {
  173. text: '单据日期',
  174. dataIndex: 'pi_date',
  175. xtype: 'datecolumn',
  176. width: 110
  177. }, {
  178. text: '供应商名称',
  179. dataIndex: 'pi_vendname',
  180. width: 200
  181. }, {
  182. text: '审核状态',
  183. align: 'center',
  184. dataIndex: 'pi_status',
  185. width: 80
  186. }, {
  187. text: '物料编号',
  188. dataIndex: 'pd_prodcode',
  189. width: 150
  190. }, {
  191. text: '品牌',
  192. dataIndex: 'pr_brand',
  193. width: 100
  194. }, {
  195. text: '物料名称',
  196. dataIndex: 'pr_detail',
  197. width: 150
  198. }, {
  199. text: '型号',
  200. dataIndex: 'pr_orispeccode',
  201. width: 200
  202. }, {
  203. text: '规格',
  204. dataIndex: 'pr_spec',
  205. width: 200
  206. }, {
  207. text: '仓库',
  208. dataIndex: 'pd_whname',
  209. width: 80
  210. }, {
  211. text: '验退数量',
  212. dataIndex: 'pd_outqty',
  213. xtype: 'numbercolumn',
  214. width: 110,
  215. renderer: function (v) {
  216. var arr = (v + '.').split('.');
  217. var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
  218. var format = '0,000.' + xr.join('');
  219. return Ext.util.Format.number(v, format);
  220. },
  221. }, {
  222. text: '单位',
  223. dataIndex: 'pr_unit',
  224. width: 65
  225. }, {
  226. text: '单价(元)',
  227. dataIndex: 'pd_netprice',
  228. xtype: 'numbercolumn',
  229. renderer: function (v) {
  230. var arr = (v + '.').split('.');
  231. var xr = (new Array(arr[1].length > 4 ? 4 : arr[1].length)).fill('0');
  232. var format = '0,000.' + xr.join('');
  233. return Ext.util.Format.number(v, format);
  234. },
  235. width: 110
  236. }, {
  237. text: '含税单价(元)',
  238. dataIndex: 'pd_netprice',
  239. xtype: 'numbercolumn',
  240. renderer: function (v) {
  241. var arr = (v + '.').split('.');
  242. var xr = (new Array(arr[1].length > 4 ? 4 : arr[1].length)).fill('0');
  243. var format = '0,000.' + xr.join('');
  244. return Ext.util.Format.number(v, format);
  245. },
  246. width: 110
  247. }, {
  248. text: '金额(元)',
  249. dataIndex: 'pd_nettotal',
  250. xtype: 'numbercolumn',
  251. width: 110,
  252. renderer: function (v) {
  253. var arr = (v + '.').split('.');
  254. var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  255. var format = '0,000.' + xr.join('');
  256. return Ext.util.Format.number(v, format);
  257. },
  258. }, {
  259. text: '税额(元)',
  260. dataIndex: 'pd_taxamount',
  261. xtype: 'numbercolumn',
  262. width: 110,
  263. renderer: function (v, g, r) {
  264. v = (r.data["pd_ordertotal"] || 0.0) - (r.data["pd_nettotal"] || 0.0);
  265. var arr = (v + '.').split('.');
  266. var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  267. var format = '0,000.' + xr.join('');
  268. return Ext.util.Format.number(v, format);
  269. }
  270. }, {
  271. text: '价税合计(元)',
  272. dataIndex: 'pd_ordertotal',
  273. xtype: 'numbercolumn',
  274. width: 110,
  275. renderer: function (v) {
  276. var arr = (v + '.').split('.');
  277. var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
  278. var format = '0,000.' + xr.join('');
  279. return Ext.util.Format.number(v, format);
  280. },
  281. }, {
  282. text: '关联验收单号',
  283. dataIndex: 'pi_iocode',
  284. width: 150
  285. }, {
  286. text: '备注',
  287. dataIndex: 'iodetno',
  288. width: 250
  289. }]
  290. }
  291. });