QueryPanel.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309
  1. Ext.define('saas.view.purchase.purchase.QueryPanel', {
  2. extend: 'saas.view.core.query.QueryPanel',
  3. xtype: 'purchase-purchase-querypanel',
  4. controller: 'purchase-purchase-querypanel',
  5. viewModel: 'purchase-purchase-querypanel',
  6. viewName: 'purchase-purchase-querypanel',
  7. caller: 'Purchase',
  8. importUploadPath: '/api/purchase/purchase/saveToFormal',
  9. initComponent: function () {
  10. Ext.apply(this, {
  11. queryFormItems: [{
  12. xtype: 'textfield',
  13. name: 'pu_code',
  14. labelSeparator: ' ',
  15. emptyText: '请输入单号或供应商名称',
  16. getCondition: function (value) {
  17. return ' (pu_code like\'%' + value + '%\' or pu_vendcode like \'%' + value + '%\' or pu_vendname like \'%' + value + '%\') ';
  18. }
  19. }, {
  20. margin: '0 0 0 20',
  21. xtype: 'productDbfindTrigger',
  22. name: 'pr_detail',
  23. showDetail: true,
  24. emptyText: '输入物料编号、名称或型号',
  25. }, {
  26. xtype: 'condatefield',
  27. name: 'pu_date',
  28. fieldLabel: '日期',
  29. columnWidth: 0.5,
  30. operation: 'between'
  31. }, {
  32. xtype: 'combobox',
  33. name: 'pu_statuscode',
  34. fieldLabel: '单据状态',
  35. queryMode: 'local',
  36. displayField: 'pu_status',
  37. valueField: 'pu_statuscode',
  38. emptyText: '全部',
  39. editable: false,
  40. store: Ext.create('Ext.data.ArrayStore', {
  41. fields: ['pu_statuscode', 'pu_status'],
  42. data: [
  43. ["ALL", "全部"],
  44. ["AUDITED", "已审核"],
  45. ["UNAUDITED", "未审核"]
  46. ]
  47. }),
  48. getCondition: function (value) {
  49. if (value == 'ALL') {
  50. return '1=1';
  51. } else {
  52. return 'pu_statuscode=\'' + value + '\'';
  53. }
  54. }
  55. }, {
  56. xtype: 'multicombo',
  57. name: 'pu_acceptstatuscode',
  58. fieldLabel: '业务状态',
  59. emptyText: '全部',
  60. datas: [
  61. ["TURNIN", "已入库"],
  62. ["UNTURNIN", "未入库"],
  63. ["PART2IN", "部分入库"],
  64. ["CLOSE", "已关闭"]
  65. ]
  66. }, {
  67. xtype: 'textfield',
  68. name: 'pu_sacode',
  69. fieldLabel: '关联销售单号',
  70. emptyText: '输入关联销售单号',
  71. }, {
  72. xtype: 'accountDbfindTrigger',
  73. name: 'creatorName',
  74. fieldLabel: '录入人',
  75. emptyText: '请输入账户名称或姓名',
  76. getCondition: function (value) {
  77. if (!value) {
  78. return '1=1';
  79. } else {
  80. return 'purchase.creatorName like\'%' + value + '%\'';
  81. }
  82. }
  83. }, {
  84. xtype: 'accountDbfindTrigger',
  85. name: 'pu_auditman',
  86. fieldLabel: '审核人',
  87. emptyText: '请输入账户名称或姓名'
  88. }],
  89. queryGridConfig: {
  90. idField: 'pu_id',
  91. codeField: 'pu_code',
  92. addTitle: '采购订单',
  93. addXtype: 'purchase-purchase-formpanel',
  94. defaultCondition: '',
  95. baseVastUrl: '/api/purchase/purchase/',
  96. caller: 'Purchase',
  97. baseColumn: [{
  98. text: 'id',
  99. dataIndex: 'pu_id',
  100. xtype: 'numbercolumn',
  101. hidden: true
  102. }, {
  103. text: '采购单号',
  104. dataIndex: 'pu_code',
  105. width: 150
  106. }, {
  107. text: '单据日期',
  108. dataIndex: 'pu_date',
  109. xtype: 'datecolumn',
  110. width: 110
  111. }, {
  112. text: '供应商名称',
  113. dataIndex: 'pu_vendname',
  114. width: 200
  115. }, {
  116. text: '金额(元)',
  117. dataIndex: 'pu_taxtotal',
  118. xtype: 'numbercolumn',
  119. width: 110,
  120. renderer: function(v, m, r) {
  121. return saas.util.BaseUtil.numberFormat(v, 2, true);
  122. }
  123. }, {
  124. text: '价税合计(元)',
  125. dataIndex: 'pu_total',
  126. xtype: 'numbercolumn',
  127. width: 110,
  128. renderer: function(v, m, r) {
  129. return saas.util.BaseUtil.numberFormat(v, 2, true);
  130. }
  131. }, {
  132. text: '币别',
  133. dataIndex: 'pu_currency',
  134. align: 'center',
  135. width: 65
  136. }, {
  137. text: '审核状态',
  138. align: 'center',
  139. dataIndex: 'pu_status',
  140. width: 80
  141. }, {
  142. text: '业务状态',
  143. align: 'center',
  144. dataIndex: 'pu_acceptstatus',
  145. width: 80
  146. }, {
  147. text: '采购员',
  148. dataIndex: 'pu_buyername',
  149. width: 80
  150. }, {
  151. text: '关联销售单号',
  152. dataIndex: 'pu_sacode',
  153. width: 150
  154. }, {
  155. text: 'B2B上传状态',
  156. dataIndex: 'b2bStatus',
  157. textAlign: 'center',
  158. width:120,
  159. hidden: !Ext.getCmp('mainView').getViewModel().get('enableB2B'),
  160. initHidden: !Ext.getCmp('mainView').getViewModel().get('enableB2B'),
  161. renderer: function(v) {
  162. return v ? v : '待上传'
  163. }
  164. }, {
  165. text: '备注',
  166. dataIndex: 'pu_remark',
  167. width: 250
  168. }],
  169. relativeColumn: [{
  170. text: 'id',
  171. dataIndex: 'pu_id',
  172. hidden: true
  173. }, {
  174. text: '采购单号',
  175. dataIndex: 'pu_code',
  176. width: 150
  177. }, {
  178. text: '单据日期',
  179. dataIndex: 'pu_date',
  180. xtype: 'datecolumn',
  181. width: 110
  182. }, {
  183. text: '供应商名称',
  184. dataIndex: 'pu_vendname',
  185. width: 200
  186. }, {
  187. text: '审核状态',
  188. align: 'center',
  189. dataIndex: 'pu_status',
  190. width: 80
  191. }, {
  192. text: '物料编号',
  193. dataIndex: 'pd_prodcode',
  194. width: 150
  195. }, {
  196. text: '品牌',
  197. dataIndex: 'pr_brand',
  198. width: 100
  199. }, {
  200. text: '物料名称',
  201. dataIndex: 'pr_detail',
  202. width: 150
  203. }, {
  204. text: '型号',
  205. dataIndex: 'pr_orispeccode',
  206. width: 200
  207. }, {
  208. text: '规格',
  209. dataIndex: 'pr_spec',
  210. width: 200
  211. }, {
  212. text: '数量',
  213. dataIndex: 'pd_qty',
  214. xtype: 'numbercolumn',
  215. width: 110,
  216. renderer: function(v, m, r) {
  217. return saas.util.BaseUtil.numberFormat(v, 3, false);
  218. }
  219. }, {
  220. text: '单位',
  221. dataIndex: 'pr_unit',
  222. width: 65
  223. }, {
  224. text: '单价(元)',
  225. dataIndex: 'pd_taxprice',
  226. xtype: 'numbercolumn',
  227. width: 110,
  228. renderer: function(v, m, r) {
  229. return saas.util.BaseUtil.numberFormat(v, 4, true);
  230. }
  231. }, {
  232. text: '含税单价(元)',
  233. dataIndex: 'pd_price',
  234. xtype: 'numbercolumn',
  235. width: 110,
  236. renderer: function(v, m, r) {
  237. return saas.util.BaseUtil.numberFormat(v, 4, true);
  238. }
  239. }, {
  240. text: '金额(元)',
  241. dataIndex: 'pd_taxtotal',
  242. xtype: 'numbercolumn',
  243. width: 110,
  244. renderer: function(v, m, r) {
  245. return saas.util.BaseUtil.numberFormat(v, 2, true);
  246. }
  247. }, {
  248. text: '税率(%)',
  249. dataIndex: 'pd_taxrate',
  250. xtype: 'numbercolumn',
  251. width: 80,
  252. renderer : function(v, m, r) {
  253. return saas.util.BaseUtil.numberFormat(v, 0, true);
  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_total"] || 0.0) - (r.data["pd_taxtotal"] || 0.0);
  262. return saas.util.BaseUtil.numberFormat(v, 2, true);
  263. }
  264. }, {
  265. text: '最新购价(元)',
  266. dataIndex: 'pd_lastprice',
  267. xtype: 'numbercolumn',
  268. width: 110,
  269. renderer: function(v, m, r) {
  270. return saas.util.BaseUtil.numberFormat(v, 4, true);
  271. }
  272. },{
  273. text: '价税合计(元)',
  274. dataIndex: 'pd_total',
  275. xtype: 'numbercolumn',
  276. width: 110,
  277. renderer: function(v, m, r) {
  278. return saas.util.BaseUtil.numberFormat(v, 2, true);
  279. }
  280. }, {
  281. text: '币别',
  282. dataIndex: 'pu_currency',
  283. align: 'center',
  284. width: 65
  285. }, {
  286. text: "汇率",
  287. dataIndex: "pu_rate",
  288. xtype: 'numbercolumn',
  289. width: 80,
  290. renderer: function(v, m, r) {
  291. return saas.util.BaseUtil.numberFormat(v, 6, false);
  292. }
  293. }, {
  294. text: '关联销售单号',
  295. dataIndex: 'pd_salecode',
  296. width: 150
  297. }, {
  298. text: '备注',
  299. dataIndex: 'pd_remark',
  300. width: 250
  301. }]
  302. }
  303. });
  304. this.callParent(arguments);
  305. },
  306. });