BasePanel.js 5.3 KB

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