BasePanel.js 5.0 KB

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