BasePanel.js 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  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 : "productDbfindTrigger",
  10. name : "pr_code",
  11. emptyText : "物料编号",
  12. width:120
  13. },{
  14. xtype : "textfield",
  15. name : "pr_detail",
  16. emptyText : "物料名称",
  17. width:120
  18. },{
  19. xtype : "textfield",
  20. name : "pr_spec",
  21. emptyText : "规格",
  22. width:100
  23. },{
  24. editable:false,
  25. hiddenBtn:true,
  26. xtype : "remotecombo",
  27. storeUrl: '/api/document/producttype/getCombo',
  28. name : "pr_kind",
  29. emptyText : "物料类型",
  30. width:120
  31. },{
  32. xtype : "textfield",
  33. name : "pr_brand",
  34. emptyText : "品牌",
  35. width:100
  36. },{
  37. xtype : "textfield",
  38. name : "pr_orispeccode",
  39. emptyText : "型号",
  40. width:100
  41. }, {
  42. xtype: 'combobox',
  43. name: 'pr_statuscode',
  44. queryMode: 'local',
  45. displayField: 'pr_status',
  46. valueField: 'pr_statuscode',
  47. emptyText :'状态',
  48. width:100,
  49. editable:false,
  50. store: Ext.create('Ext.data.ArrayStore', {
  51. fields: ['pr_statuscode', 'pr_status'],
  52. data: [
  53. ["ALL", "全部"],
  54. ["OPEN", "已开启"],
  55. ["CLOSE", "已关闭"]
  56. ]
  57. }),
  58. getCondition: function(value) {
  59. if(value == 'ALL' || !value) {
  60. return '1=1';
  61. }else {
  62. return 'pr_statuscode=\'' + value + '\'';
  63. }
  64. }
  65. }],
  66. //字段属性
  67. _formXtype:'document-product-formpanel',
  68. _title:'物料资料',
  69. _deleteUrl:'/api/document/product/delete/',
  70. _batchOpenUrl:'/api/document/product/batchOpen',
  71. _batchCloseUrl:'/api/document/product/batchClose',
  72. _batchDeleteUrl:'/api/document/product/batchDelete',
  73. gridConfig: {
  74. idField: 'id',
  75. codeField: 'pr_code',
  76. statusCodeField:'pr_statuscode',
  77. dataUrl: '/api/document/product/list',
  78. columns : [{
  79. text : "id",
  80. width : 0,
  81. dataIndex : "id",
  82. xtype : "numbercolumn",
  83. },{
  84. text : "物料编号",
  85. width : 200.0,
  86. dataIndex : "pr_code"
  87. }, {
  88. text : "物料名称",
  89. dataIndex : "pr_detail",
  90. width : 120.0
  91. }, {
  92. text : "规格",
  93. dataIndex : "pr_spec"
  94. }, {
  95. text : "类型",
  96. dataIndex : "pr_kind"
  97. }, {
  98. text : "单位",
  99. dataIndex : "pr_unit"
  100. }, {
  101. text : "总库存数",
  102. dataIndex : "po_onhand",
  103. xtype: 'numbercolumn',
  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. renderer : function(v) {
  115. var arr = (v + '.').split('.');
  116. var xr = (new Array(arr[1].length > 8 ? 8 : arr[1].length)).fill('0');
  117. var format = '0,000.' + xr.join();
  118. return Ext.util.Format.number(v, format);
  119. }
  120. }, {
  121. text : "最新采购单价",
  122. dataIndex : "pr_purcprice",
  123. xtype: 'numbercolumn',
  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. 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_orispeccode",
  145. width : 200.0,
  146. }, {
  147. text : "品牌",
  148. dataIndex : "pr_brand",
  149. width : 150.0,
  150. }, {
  151. text : "供应商",
  152. dataIndex : "pr_vendname",
  153. width : 150.0,
  154. }, {
  155. text : "最小包装",
  156. dataIndex : "pr_zxbzs",
  157. xtype: 'numbercolumn',
  158. renderer : function(v) {
  159. return Ext.util.Format.number(v, '0');
  160. }
  161. }, {
  162. text : "L/T",
  163. dataIndex : "pr_leadtime",
  164. xtype: 'numbercolumn',
  165. renderer : function(v) {
  166. return Ext.util.Format.number(v, '0');
  167. }
  168. }, {
  169. text : "状态",
  170. dataIndex : "pr_status"
  171. }]
  172. },
  173. refresh:function(){
  174. this.items.items[0].store.load()
  175. }
  176. });