QueryPanel.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324
  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. renderer: function(v) {
  165. return v ? v : '待上传'
  166. }
  167. }, {
  168. text: '备注',
  169. dataIndex: 'pi_remark',
  170. width: 250
  171. }],
  172. relativeColumn: [{
  173. text: 'id',
  174. dataIndex: 'pu_id',
  175. xtype: 'numbercolumn',
  176. hidden: true
  177. }, {
  178. text: '验收单号',
  179. dataIndex: 'pi_inoutno',
  180. width: 150
  181. }, {
  182. text: '单据日期',
  183. dataIndex: 'pi_date',
  184. xtype: 'datecolumn',
  185. width: 110
  186. }, {
  187. text: '供应商名称',
  188. dataIndex: 'pi_vendname',
  189. width: 200
  190. }, {
  191. text: '审核状态',
  192. align: 'center',
  193. dataIndex: 'pi_status',
  194. width: 80
  195. }, {
  196. text: '物料编号',
  197. dataIndex: 'pr_code',
  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: 120
  219. }, {
  220. text: '数量',
  221. dataIndex: 'pd_inqty',
  222. xtype: 'numbercolumn',
  223. width: 110,
  224. renderer: function(v, m, r) {
  225. return saas.util.BaseUtil.numberFormat(v, 3, false);
  226. }
  227. }, {
  228. text: '单位',
  229. dataIndex: 'pr_unit',
  230. width: 65
  231. }, {
  232. text: '单价(元)',
  233. dataIndex: 'pd_netprice',
  234. xtype: 'numbercolumn',
  235. renderer: function(v, m, r) {
  236. return saas.util.BaseUtil.numberFormat(v, 4, true);
  237. },
  238. width: 110
  239. }, {
  240. text: '含税单价(元)',
  241. dataIndex: 'pd_orderprice',
  242. xtype: 'numbercolumn',
  243. renderer: function(v, m, r) {
  244. return saas.util.BaseUtil.numberFormat(v, 4, true);
  245. },
  246. width: 110
  247. }, {
  248. text: '金额(元)',
  249. dataIndex: 'pd_nettotal',
  250. xtype: 'numbercolumn',
  251. width: 110,
  252. renderer: function(v, m, r) {
  253. return saas.util.BaseUtil.numberFormat(v, 2, true);
  254. },
  255. }, {
  256. text: '税率(%)',
  257. dataIndex: 'pd_taxrate',
  258. xtype: 'numbercolumn',
  259. width: 80,
  260. renderer : function(v, m, r) {
  261. return saas.util.BaseUtil.numberFormat(v, 0, true);
  262. }
  263. }, {
  264. text: '税额(元)',
  265. dataIndex: 'pd_taxamount',
  266. xtype: 'numbercolumn',
  267. width: 110,
  268. renderer: function (v, g, r) {
  269. v = (r.data["pd_ordertotal"] || 0.0) - (r.data["pd_nettotal"] || 0.0);
  270. return saas.util.BaseUtil.numberFormat(v, 2, true);
  271. }
  272. }, {
  273. text: '价税合计(元)',
  274. dataIndex: 'pd_ordertotal',
  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: 'pi_currency',
  283. align: 'center',
  284. width: 65
  285. }, {
  286. text: "汇率",
  287. dataIndex: "pi_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: 'pi_pucode',
  296. width: 150
  297. },{
  298. text: "对账状态",
  299. dataIndex: "apcheckStatus",
  300. width: 100.0
  301. },{
  302. text: 'B2B上传状态',
  303. dataIndex: 'b2bStatus',
  304. textAlign: 'center',
  305. width:120,
  306. hidden: !Ext.getCmp('mainView').getViewModel().get('enableB2B'),
  307. initHidden: !Ext.getCmp('mainView').getViewModel().get('enableB2B'),
  308. renderer: function(v) {
  309. return v ? v : '待上传'
  310. }
  311. }, {
  312. text: '备注',
  313. dataIndex: 'pd_remark',
  314. width: 250
  315. }]
  316. }
  317. });
  318. this.callParent(arguments);
  319. },
  320. });