BasePanel.js 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. Ext.define('saas.view.document.product.BasePanel', {
  2. extend: 'saas.view.core.base.BasePanel',
  3. xtype: 'document-product-basepanel',
  4. controller: 'document-product-basepanel',
  5. viewModel: 'document-product-basepanel',
  6. viewName: 'document-product-basepanel',
  7. deleteMoreMsg: '删除的物料将不能恢复,请确认是否删除?',
  8. deleteOneMsg: '删除的物料将不能恢复,请确认是否删除?',
  9. initComponent: function () {
  10. Ext.apply(this, {
  11. searchField: [{
  12. xtype: "textfield",
  13. name: "pr_code",
  14. width: 300,
  15. emptyText: '输入物料编号、名称、型号或品牌',
  16. getCondition: function (v) {
  17. return "(upper(CONCAT(pr_code,'#',pr_detail,'#',ifnull(pr_orispeccode,''),'#',ifnull(pr_brand,''))) like '%" + v.toUpperCase() + "%' )";
  18. },
  19. }, {
  20. editable: true,
  21. hiddenBtn: true,
  22. xtype: "remotecombo",
  23. storeUrl: '/api/document/producttype/getCombo',
  24. name: "pr_kind",
  25. fieldLabel: '物料类型',
  26. emptyText: '全部',
  27. }, {
  28. xtype: 'combobox',
  29. name: 'pr_statuscode',
  30. queryMode: 'local',
  31. displayField: 'pr_status',
  32. valueField: 'pr_statuscode',
  33. fieldLabel: '状态',
  34. emptyText: '全部',
  35. editable: false,
  36. defaultValue: 'ENABLE',
  37. store: Ext.create('Ext.data.ArrayStore', {
  38. fields: ['pr_statuscode', 'pr_status'],
  39. data: [
  40. ["ALL", "全部"],
  41. ["ENABLE", "已启用"],
  42. ["BANNED", "已禁用"]
  43. ]
  44. }),
  45. getCondition: function (value) {
  46. if (value == 'ALL' || !value) {
  47. return '1=1';
  48. } else {
  49. return 'pr_statuscode=\'' + value + '\'';
  50. }
  51. }
  52. }],
  53. //字段属性
  54. caller: 'Product',
  55. _formXtype: 'document-product-formpanel',
  56. _title: '物料资料',
  57. _deleteUrl: '/api/document/product/delete',
  58. _batchOpenUrl: '/api/document/product/batchOpen',
  59. _batchCloseUrl: '/api/document/product/batchClose',
  60. _batchDeleteUrl: '/api/document/product/batchDelete',
  61. gridConfig: {
  62. idField: 'id',
  63. codeField: 'pr_code',
  64. statusCodeField: 'pr_statuscode',
  65. dataUrl: '/api/document/product/list',
  66. caller: 'Product',
  67. columns: [{
  68. text: "id",
  69. width: 0,
  70. dataIndex: "id",
  71. xtype: "numbercolumn",
  72. }, {
  73. text: "物料编号",
  74. dataIndex: "pr_code",
  75. width: 150.0
  76. }, {
  77. text: "品牌",
  78. dataIndex: "pr_brand",
  79. width: 100.0
  80. }, {
  81. text: "物料名称",
  82. dataIndex: "pr_detail",
  83. width: 150.0
  84. }, {
  85. text: "型号",
  86. dataIndex: "pr_orispeccode",
  87. width: 200.0
  88. }, {
  89. text: "规格",
  90. dataIndex: "pr_spec",
  91. width: 200.0
  92. }, {
  93. text: "物料类型",
  94. dataIndex: "pr_kind",
  95. width: 100
  96. }, {
  97. text: "库存",
  98. dataIndex: "po_onhand",
  99. xtype: 'numbercolumn',
  100. width: 100.0,
  101. renderer: function (v, m, r) {
  102. return saas.util.BaseUtil.numberFormat(v, 3, false);
  103. }
  104. }, {
  105. text: "单位",
  106. dataIndex: "pr_unit",
  107. width: 65.0
  108. }, {
  109. text: "标准定价(元)",
  110. dataIndex: "pr_standardprice",
  111. xtype: 'numbercolumn',
  112. width: 110.0,
  113. renderer: function (v, m, r) {
  114. return saas.util.BaseUtil.numberFormat(v, 4, true);
  115. }
  116. }, {
  117. text: "最新购价(元)",
  118. dataIndex: "pr_purcprice",
  119. xtype: 'numbercolumn',
  120. width: 110.0,
  121. renderer: function (v, m, r) {
  122. return saas.util.BaseUtil.numberFormat(v, 4, true);
  123. }
  124. }, {
  125. text: "最新售价(元)",
  126. dataIndex: "pr_saleprice",
  127. xtype: 'numbercolumn',
  128. width: 110.0,
  129. renderer: function (v, m, r) {
  130. return saas.util.BaseUtil.numberFormat(v, 4, true);
  131. }
  132. }, {
  133. text: "备注",
  134. dataIndex: "pr_text1",
  135. width: 250.0
  136. }, {
  137. text: "状态",
  138. dataIndex: "pr_status",
  139. align: 'center',
  140. width: 80.0
  141. }]
  142. },
  143. });
  144. this.callParent(arguments);
  145. },
  146. refresh: function () {
  147. this.items.items[0].store.load()
  148. }
  149. });