BasePanel.js 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  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:true,
  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. caller:'Product',
  57. _formXtype:'document-product-formpanel',
  58. _title:'物料资料',
  59. _deleteUrl:'/api/document/product/delete',
  60. _batchOpenUrl:'/api/document/product/batchOpen',
  61. _batchCloseUrl:'/api/document/product/batchClose',
  62. _batchDeleteUrl:'/api/document/product/batchDelete',
  63. gridConfig: {
  64. idField: 'id',
  65. codeField: 'pr_code',
  66. statusCodeField:'pr_statuscode',
  67. dataUrl: '/api/document/product/list',
  68. columns : [{
  69. text : "id",
  70. width : 0,
  71. dataIndex : "id",
  72. xtype : "numbercolumn",
  73. },{
  74. text : "物料编号",
  75. dataIndex : "pr_code",
  76. width : 150.0
  77. }, {
  78. text : "物料名称",
  79. dataIndex : "pr_detail",
  80. width : 200.0
  81. }, {
  82. text : "规格",
  83. dataIndex : "pr_spec",
  84. width : 150.0
  85. }, {
  86. text : "类型",
  87. dataIndex : "pr_kind",
  88. width : 110.0
  89. }, {
  90. text : "单位",
  91. dataIndex : "pr_unit",
  92. width : 80.0
  93. }, {
  94. text : "品牌",
  95. dataIndex : "pr_brand",
  96. width : 110.0
  97. }, {
  98. text : "总库存",
  99. dataIndex : "po_onhand",
  100. xtype: 'numbercolumn',
  101. width : 110.0,
  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. width : 110.0,
  113. renderer : function(v) {
  114. var arr = (v + '.').split('.');
  115. var xr = (new Array(arr[1].length > 8 ? 8 : arr[1].length)).fill('0');
  116. var format = '0,000.' + xr.join();
  117. return Ext.util.Format.number(v, format);
  118. }
  119. }, {
  120. text : "最新采购单价",
  121. dataIndex : "pr_purcprice",
  122. xtype: 'numbercolumn',
  123. width : 110.0,
  124. renderer : function(v) {
  125. var arr = (v + '.').split('.');
  126. var xr = (new Array(arr[1].length > 8 ? 8 : arr[1].length)).fill('0');
  127. var format = '0.' + xr.join();
  128. return Ext.util.Format.number(v, format);
  129. },
  130. width : 200.0,
  131. }, {
  132. text : "最新出库价",
  133. dataIndex : "pr_saleprice",
  134. xtype: 'numbercolumn',
  135. width : 110.0,
  136. renderer : function(v) {
  137. var arr = (v + '.').split('.');
  138. var xr = (new Array(arr[1].length > 8 ? 8 : arr[1].length)).fill('0');
  139. var format = '0.' + xr.join();
  140. return Ext.util.Format.number(v, format);
  141. },
  142. width : 200.0,
  143. }, {
  144. text : "备注",
  145. dataIndex : "pr_text1",
  146. width :250.0
  147. }, {
  148. text : "状态",
  149. dataIndex : "pr_status",
  150. width : 90.0
  151. }]
  152. },
  153. refresh:function(){
  154. this.items.items[0].store.load()
  155. }
  156. });