BasePanel.js 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  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_orispeccode,''),'#',ifnull(pr_brand,''))) 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. fieldLabel : '物料类型',
  23. emptyText: '全部',
  24. }, {
  25. xtype: 'combobox',
  26. name: 'pr_statuscode',
  27. queryMode: 'local',
  28. displayField: 'pr_status',
  29. valueField: 'pr_statuscode',
  30. fieldLabel : '状态',
  31. emptyText: '全部',
  32. editable:false,
  33. defaultValue:'ENABLE',
  34. store: Ext.create('Ext.data.ArrayStore', {
  35. fields: ['pr_statuscode', 'pr_status'],
  36. data: [
  37. ["ALL", "全部"],
  38. ["ENABLE", "已启用"],
  39. ["BANNED", "已禁用"]
  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. //字段属性
  51. caller:'Product',
  52. _formXtype:'document-product-formpanel',
  53. _title:'物料资料',
  54. _deleteUrl:'/api/document/product/delete',
  55. _batchOpenUrl:'/api/document/product/batchOpen',
  56. _batchCloseUrl:'/api/document/product/batchClose',
  57. _batchDeleteUrl:'/api/document/product/batchDelete',
  58. gridConfig: {
  59. idField: 'id',
  60. codeField: 'pr_code',
  61. statusCodeField:'pr_statuscode',
  62. dataUrl: '/api/document/product/list',
  63. caller: 'Product',
  64. columns : [{
  65. text : "id",
  66. width : 0,
  67. dataIndex : "id",
  68. xtype : "numbercolumn",
  69. },{
  70. text : "物料编号",
  71. dataIndex : "pr_code",
  72. width : 150.0
  73. },{
  74. text : "品牌",
  75. dataIndex : "pr_brand",
  76. width : 100.0
  77. }, {
  78. text : "物料名称",
  79. dataIndex : "pr_detail",
  80. width : 150.0
  81. }, {
  82. text : "型号",
  83. dataIndex : "pr_orispeccode",
  84. width : 200.0
  85. }, {
  86. text : "规格",
  87. dataIndex : "pr_spec",
  88. width : 200.0
  89. }, {
  90. text : "物料类型",
  91. dataIndex : "pr_kind",
  92. width:100
  93. }, {
  94. text : "库存",
  95. dataIndex : "po_onhand",
  96. xtype: 'numbercolumn',
  97. width : 100.0,
  98. renderer : function(v) {
  99. return saas.util.BaseUtil.numberFormat(v, 3, false);
  100. }
  101. }, {
  102. text : "单位",
  103. dataIndex : "pr_unit",
  104. width : 65.0
  105. }, {
  106. text : "标准定价(元)",
  107. dataIndex : "pr_standardprice",
  108. xtype: 'numbercolumn',
  109. width : 110.0,
  110. renderer : function(v) {
  111. return saas.util.BaseUtil.numberFormat(v, 4, true);
  112. }
  113. }, {
  114. text : "最新购价(元)",
  115. dataIndex : "pr_purcprice",
  116. xtype: 'numbercolumn',
  117. width : 110.0,
  118. renderer : function(v) {
  119. return saas.util.BaseUtil.numberFormat(v, 4, true);
  120. }
  121. }, {
  122. text : "最新售价(元)",
  123. dataIndex : "pr_saleprice",
  124. xtype: 'numbercolumn',
  125. width : 110.0,
  126. renderer : function(v) {
  127. return saas.util.BaseUtil.numberFormat(v, 4, true);
  128. }
  129. }, {
  130. text : "备注",
  131. dataIndex : "pr_text1",
  132. width :250.0
  133. }, {
  134. text : "状态",
  135. dataIndex : "pr_status",
  136. align:'center',
  137. width : 80.0
  138. }]
  139. },
  140. refresh:function(){
  141. this.items.items[0].store.load()
  142. }
  143. });