BasePanel.js 5.0 KB

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