QueryPanel.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314
  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. initComponent: function () {
  8. Ext.apply(this, {
  9. queryFormItems: [{
  10. xtype: 'textfield',
  11. name: 'pi_inoutno',
  12. emptyText: '请输入单号或供应商名称',
  13. getCondition: function (value) {
  14. return ' (pi_inoutno like\'%' + value + '%\' or pi_vendcode like \'%' + value + '%\' or pi_vendname like \'%' + value + '%\') ';
  15. }
  16. }, {
  17. margin: '0 0 0 20',
  18. xtype: 'productDbfindTrigger',
  19. name: 'pr_detail',
  20. emptyText: '输入物料编号、名称或型号',
  21. showDetail: true
  22. }, {
  23. xtype: 'condatefield',
  24. name: 'pi_date',
  25. fieldLabel: '日期',
  26. columnWidth: 0.5,
  27. operation: 'between'
  28. }, {
  29. xtype: 'combobox',
  30. name: 'pi_statuscode',
  31. fieldLabel: '单据状态',
  32. allowBlank: true,
  33. emptyText: '全部',
  34. editable: false,
  35. queryMode: 'local',
  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. ["PAYNONE", "未付款"],
  60. ["PAYPART", "部分付款"],
  61. ["PAYALL", "已付款"]
  62. ]
  63. }, {
  64. xtype: 'warehouseDbfindTrigger',
  65. name: 'pd_whname',
  66. fieldLabel: '仓库',
  67. emptyText: '请输入仓库编号或名称',
  68. showDetail: true
  69. }, {
  70. xtype: 'textfield',
  71. name: 'pi_pucode',
  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. queryGridConfig: {
  93. idField: 'id',
  94. codeField: 'pi_inoutno',
  95. addTitle: '采购验收单',
  96. addXtype: 'purchase-purchasein-formpanel',
  97. defaultCondition: ' pi_class = \'采购验收单\'',
  98. baseVastUrl: '/api/purchase/prodinout/',
  99. caller: 'PurchaseIn',
  100. baseColumn: [{
  101. text: 'id',
  102. dataIndex: 'id',
  103. hidden: true,
  104. xtype: 'numbercolumn'
  105. }, {
  106. text: '验收单号',
  107. dataIndex: 'pi_inoutno',
  108. width: 150
  109. }, {
  110. text: '单据类型',
  111. dataIndex: 'pi_class',
  112. hidden: true
  113. }, {
  114. text: '单据日期',
  115. dataIndex: 'pi_date',
  116. xtype: 'datecolumn',
  117. width: 110
  118. }, {
  119. text: '供应商名称',
  120. dataIndex: 'pi_vendname',
  121. width: 200
  122. }, {
  123. text: '金额(元)',
  124. xtype: 'numbercolumn',
  125. dataIndex: 'pi_nettotal',
  126. width: 110,
  127. renderer: function(v, m, r) {
  128. return saas.util.BaseUtil.numberFormat(v, 2, true);
  129. }
  130. }, {
  131. text: '价税合计(元)',
  132. xtype: 'numbercolumn',
  133. dataIndex: 'pi_total',
  134. width: 110,
  135. renderer: function(v, m, r) {
  136. return saas.util.BaseUtil.numberFormat(v, 2, true);
  137. }
  138. }, {
  139. text: '币别',
  140. dataIndex: 'pi_currency',
  141. align: 'center',
  142. width: 65
  143. }, {
  144. text: '审核状态',
  145. align: 'center',
  146. dataIndex: 'pi_status',
  147. width: 80
  148. }, {
  149. text: '付款状态',
  150. align: 'center',
  151. dataIndex: 'pi_prstatus',
  152. width: 80
  153. }, {
  154. text: '关联采购单号',
  155. dataIndex: 'pi_pucode',
  156. width: 150
  157. }, {
  158. text: 'B2B上传状态',
  159. dataIndex: 'b2bStatus',
  160. textAlign: 'center',
  161. width:120,
  162. hidden: !Ext.getCmp('mainView').getViewModel().get('enableB2B'),
  163. initHidden: !Ext.getCmp('mainView').getViewModel().get('enableB2B'),
  164. }, {
  165. text: '备注',
  166. dataIndex: 'pi_remark',
  167. width: 250
  168. }],
  169. relativeColumn: [{
  170. text: 'id',
  171. dataIndex: 'pu_id',
  172. xtype: 'numbercolumn',
  173. hidden: true
  174. }, {
  175. text: '验收单号',
  176. dataIndex: 'pi_inoutno',
  177. width: 150
  178. }, {
  179. text: '单据日期',
  180. dataIndex: 'pi_date',
  181. xtype: 'datecolumn',
  182. width: 110
  183. }, {
  184. text: '供应商名称',
  185. dataIndex: 'pi_vendname',
  186. width: 200
  187. }, {
  188. text: '审核状态',
  189. align: 'center',
  190. dataIndex: 'pi_status',
  191. width: 80
  192. }, {
  193. text: '物料编号',
  194. dataIndex: 'pr_code',
  195. width: 150
  196. }, {
  197. text: '品牌',
  198. dataIndex: 'pr_brand',
  199. width: 100
  200. }, {
  201. text: '物料名称',
  202. dataIndex: 'pr_detail',
  203. width: 150
  204. }, {
  205. text: '型号',
  206. dataIndex: 'pr_orispeccode',
  207. width: 200
  208. }, {
  209. text: '规格',
  210. dataIndex: 'pr_spec',
  211. width: 200
  212. }, {
  213. text: '仓库',
  214. dataIndex: 'pd_whname',
  215. width: 120
  216. }, {
  217. text: '数量',
  218. dataIndex: 'pd_inqty',
  219. xtype: 'numbercolumn',
  220. width: 110,
  221. renderer: function(v, m, r) {
  222. return saas.util.BaseUtil.numberFormat(v, 3, false);
  223. }
  224. }, {
  225. text: '单位',
  226. dataIndex: 'pr_unit',
  227. width: 65
  228. }, {
  229. text: '单价(元)',
  230. dataIndex: 'pd_netprice',
  231. xtype: 'numbercolumn',
  232. renderer: function(v, m, r) {
  233. return saas.util.BaseUtil.numberFormat(v, 4, true);
  234. },
  235. width: 110
  236. }, {
  237. text: '含税单价(元)',
  238. dataIndex: 'pd_orderprice',
  239. xtype: 'numbercolumn',
  240. renderer: function(v, m, r) {
  241. return saas.util.BaseUtil.numberFormat(v, 4, true);
  242. },
  243. width: 110
  244. }, {
  245. text: '金额(元)',
  246. dataIndex: 'pd_nettotal',
  247. xtype: 'numbercolumn',
  248. width: 110,
  249. renderer: function(v, m, r) {
  250. return saas.util.BaseUtil.numberFormat(v, 2, true);
  251. },
  252. }, {
  253. text: '税率(%)',
  254. dataIndex: 'pd_taxrate',
  255. xtype: 'numbercolumn',
  256. width: 80,
  257. renderer : function(v, m, r) {
  258. return saas.util.BaseUtil.numberFormat(v, 0, true);
  259. }
  260. }, {
  261. text: '税额(元)',
  262. dataIndex: 'pd_taxamount',
  263. xtype: 'numbercolumn',
  264. width: 110,
  265. renderer: function (v, g, r) {
  266. v = (r.data["pd_ordertotal"] || 0.0) - (r.data["pd_nettotal"] || 0.0);
  267. return saas.util.BaseUtil.numberFormat(v, 2, true);
  268. }
  269. }, {
  270. text: '价税合计(元)',
  271. dataIndex: 'pd_ordertotal',
  272. xtype: 'numbercolumn',
  273. width: 110,
  274. renderer: function(v, m, r) {
  275. return saas.util.BaseUtil.numberFormat(v, 2, true);
  276. },
  277. }, {
  278. text: '币别',
  279. dataIndex: 'pi_currency',
  280. align: 'center',
  281. width: 65
  282. }, {
  283. text: "汇率",
  284. dataIndex: "pi_rate",
  285. xtype: 'numbercolumn',
  286. width: 80,
  287. renderer: function(v, m, r) {
  288. return saas.util.BaseUtil.numberFormat(v, 6, false);
  289. }
  290. }, {
  291. text: '关联采购单号',
  292. dataIndex: 'pi_pucode',
  293. width: 150
  294. }, {
  295. text: 'B2B上传状态',
  296. dataIndex: 'b2bStatus',
  297. textAlign: 'center',
  298. width:120,
  299. hidden: !Ext.getCmp('mainView').getViewModel().get('enableB2B'),
  300. initHidden: !Ext.getCmp('mainView').getViewModel().get('enableB2B'),
  301. }, {
  302. text: '备注',
  303. dataIndex: 'pd_remark',
  304. width: 250
  305. }]
  306. }
  307. });
  308. this.callParent(arguments);
  309. },
  310. });