QueryPanel.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292
  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: '备注',
  159. dataIndex: 'pi_remark',
  160. width: 250
  161. }],
  162. relativeColumn: [{
  163. text: 'id',
  164. dataIndex: 'pu_id',
  165. xtype: 'numbercolumn',
  166. hidden: true
  167. }, {
  168. text: '验收单号',
  169. dataIndex: 'pi_inoutno',
  170. width: 150
  171. }, {
  172. text: '单据日期',
  173. dataIndex: 'pi_date',
  174. xtype: 'datecolumn',
  175. width: 110
  176. }, {
  177. text: '供应商名称',
  178. dataIndex: 'pi_vendname',
  179. width: 200
  180. }, {
  181. text: '审核状态',
  182. align: 'center',
  183. dataIndex: 'pi_status',
  184. width: 80
  185. }, {
  186. text: '物料编号',
  187. dataIndex: 'pr_code',
  188. width: 150
  189. }, {
  190. text: '品牌',
  191. dataIndex: 'pr_brand',
  192. width: 100
  193. }, {
  194. text: '物料名称',
  195. dataIndex: 'pr_detail',
  196. width: 150
  197. }, {
  198. text: '型号',
  199. dataIndex: 'pr_orispeccode',
  200. width: 200
  201. }, {
  202. text: '规格',
  203. dataIndex: 'pr_spec',
  204. width: 200
  205. }, {
  206. text: '仓库',
  207. dataIndex: 'pd_whname',
  208. width: 120
  209. }, {
  210. text: '数量',
  211. dataIndex: 'pd_inqty',
  212. xtype: 'numbercolumn',
  213. width: 110,
  214. renderer: function(v, m, r) {
  215. return saas.util.BaseUtil.numberFormat(v, 3, false);
  216. }
  217. }, {
  218. text: '单位',
  219. dataIndex: 'pr_unit',
  220. width: 65
  221. }, {
  222. text: '单价(元)',
  223. dataIndex: 'pd_netprice',
  224. xtype: 'numbercolumn',
  225. renderer: function(v, m, r) {
  226. return saas.util.BaseUtil.numberFormat(v, 4, true);
  227. },
  228. width: 110
  229. }, {
  230. text: '含税单价(元)',
  231. dataIndex: 'pd_orderprice',
  232. xtype: 'numbercolumn',
  233. renderer: function(v, m, r) {
  234. return saas.util.BaseUtil.numberFormat(v, 4, true);
  235. },
  236. width: 110
  237. }, {
  238. text: '金额(元)',
  239. dataIndex: 'pd_nettotal',
  240. xtype: 'numbercolumn',
  241. width: 110,
  242. renderer: function(v, m, r) {
  243. return saas.util.BaseUtil.numberFormat(v, 2, true);
  244. },
  245. }, {
  246. text: '税额(元)',
  247. dataIndex: 'pd_taxamount',
  248. xtype: 'numbercolumn',
  249. width: 110,
  250. renderer: function (v, g, r) {
  251. v = (r.data["pd_ordertotal"] || 0.0) - (r.data["pd_nettotal"] || 0.0);
  252. return saas.util.BaseUtil.numberFormat(v, 2, true);
  253. }
  254. }, {
  255. text: '价税合计(元)',
  256. dataIndex: 'pd_ordertotal',
  257. xtype: 'numbercolumn',
  258. width: 110,
  259. renderer: function(v, m, r) {
  260. return saas.util.BaseUtil.numberFormat(v, 2, true);
  261. },
  262. }, {
  263. text: '币别',
  264. dataIndex: 'pi_currency',
  265. align: 'center',
  266. width: 65
  267. }, {
  268. text: "汇率",
  269. dataIndex: "pi_rate",
  270. xtype: 'numbercolumn',
  271. width: 80,
  272. renderer: function(v, m, r) {
  273. return saas.util.BaseUtil.numberFormat(v, 6, false);
  274. }
  275. }, {
  276. text: '关联采购单号',
  277. dataIndex: 'pi_pucode',
  278. width: 150
  279. }, {
  280. text: '备注',
  281. dataIndex: 'pd_remark',
  282. width: 250
  283. }]
  284. }
  285. });
  286. this.callParent(arguments);
  287. },
  288. });