BasePanel.js 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  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. searchField:[{
  7. xtype : "dbfindtrigger",
  8. name : "pr_code",
  9. emptyText : "物料编号",
  10. width:120
  11. },{
  12. xtype : "textfield",
  13. name : "pr_detail",
  14. emptyText : "物料名称",
  15. width:120
  16. },{
  17. xtype : "textfield",
  18. name : "pr_spec",
  19. emptyText : "规格",
  20. width:100
  21. },{
  22. editable:false,
  23. hiddenBtn:true,
  24. xtype : "remotecombo",
  25. storeUrl: '/api/document/producttype/getCombo',
  26. name : "pr_kind",
  27. emptyText : "物料类型",
  28. width:120
  29. },{
  30. xtype : "textfield",
  31. name : "pr_brand",
  32. emptyText : "品牌",
  33. width:100
  34. },{
  35. xtype : "textfield",
  36. name : "pr_orispeccode",
  37. emptyText : "型号",
  38. width:100
  39. }, {
  40. xtype: 'combobox',
  41. name: 'pr_statuscode',
  42. fieldLabel: '状态',
  43. queryMode: 'local',
  44. displayField: 'pr_status',
  45. valueField: 'pr_statuscode',
  46. emptyText :'全部',
  47. editable:false,
  48. store: Ext.create('Ext.data.ArrayStore', {
  49. fields: ['pr_statuscode', 'pr_status'],
  50. data: [
  51. ["ALL", "全部"],
  52. ["OPEN", "已开启"],
  53. ["CLOSE", "已关闭"]
  54. ]
  55. }),
  56. getCondition: function(value) {
  57. if(value == 'ALL') {
  58. return '1=1';
  59. }else {
  60. return 'pr_statuscode=\'' + value + '\'';
  61. }
  62. }
  63. }],
  64. //字段属性
  65. _formXtype:'document-product-formpanel',
  66. _title:'物料资料',
  67. _deleteUrl:'/api/document/product/delete/',
  68. _batchOpenUrl:'/api/document/product/batchOpen',
  69. _batchCloseUrl:'/api/document/product/batchClose',
  70. _batchDeleteUrl:'/api/document/product/batchDelete',
  71. gridConfig: {
  72. idField: 'id',
  73. codeField: 'pr_code',
  74. statusCodeField:'pr_statuscode',
  75. dataUrl: '/api/document/product/list',
  76. columns : [{
  77. text : "id",
  78. width : 0,
  79. dataIndex : "id",
  80. xtype : "numbercolumn",
  81. },{
  82. text : "物料编号",
  83. width : 200.0,
  84. dataIndex : "pr_code"
  85. }, {
  86. text : "物料名称",
  87. dataIndex : "pr_detail",
  88. width : 120.0
  89. }, {
  90. text : "规格",
  91. dataIndex : "pr_spec"
  92. }, {
  93. text : "类型",
  94. dataIndex : "pr_kind"
  95. }, {
  96. text : "单位",
  97. dataIndex : "pr_unit"
  98. }, {
  99. text : "总库存数",
  100. dataIndex : "po_onhand",
  101. xtype: 'numbercolumn',
  102. renderer : function(v) {
  103. var arr = (v + '.').split('.');
  104. var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
  105. var format = '0.' + xr.join();
  106. return Ext.util.Format.number(v, format);
  107. }
  108. }, {
  109. text : "标准单价",
  110. dataIndex : "pr_standardprice",
  111. xtype: 'numbercolumn',
  112. renderer : function(v) {
  113. var arr = (v + '.').split('.');
  114. var xr = (new Array(arr[1].length > 8 ? 8 : arr[1].length)).fill('0');
  115. var format = '0,000.' + xr.join();
  116. return Ext.util.Format.number(v, format);
  117. }
  118. }, {
  119. text : "最新采购单价",
  120. dataIndex : "pr_purcprice",
  121. xtype: 'numbercolumn',
  122. renderer : function(v) {
  123. var arr = (v + '.').split('.');
  124. var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
  125. var format = '0.' + xr.join();
  126. return Ext.util.Format.number(v, format);
  127. },
  128. width : 200.0,
  129. }, {
  130. text : "最新出库单价",
  131. dataIndex : "pr_saleprice",
  132. xtype: 'numbercolumn',
  133. renderer : function(v) {
  134. var arr = (v + '.').split('.');
  135. var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
  136. var format = '0.' + xr.join();
  137. return Ext.util.Format.number(v, format);
  138. },
  139. width : 200.0,
  140. }, {
  141. text : "型号",
  142. dataIndex : "pr_orispeccode"
  143. }, {
  144. text : "品牌",
  145. dataIndex : "pr_brand"
  146. }, {
  147. text : "供应商",
  148. dataIndex : "pr_vendname"
  149. }, {
  150. text : "最小包装",
  151. dataIndex : "pr_zxbzs",
  152. xtype: 'numbercolumn',
  153. renderer : function(v) {
  154. return Ext.util.Format.number(v, '0');
  155. }
  156. }, {
  157. text : "L/T",
  158. dataIndex : "pr_leadtime",
  159. xtype: 'numbercolumn',
  160. renderer : function(v) {
  161. return Ext.util.Format.number(v, '0');
  162. }
  163. }, {
  164. text : "状态",
  165. dataIndex : "pr_status"
  166. }]
  167. },
  168. refresh:function(){
  169. this.items.items[0].store.load()
  170. }
  171. });