BasePanel.js 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. Ext.define('saas.view.document.bom.BasePanel', {
  2. extend: 'saas.view.core.base.BasePanel',
  3. xtype: 'document-bom-basepanel',
  4. controller: 'document-bom-basepanel',
  5. viewModel: 'document-bom-basepanel',
  6. viewName: 'document-bom-basepanel',
  7. deleteMoreMsg: '删除的BOM资料将不能恢复,请确认是否删除?',
  8. deleteOneMsg: '删除的BOM资料将不能恢复,请确认是否删除?',
  9. initComponent: function() {
  10. var me = this;
  11. Ext.apply(me, {
  12. searchField:[{
  13. xtype : "textfield",
  14. name : "bo_mothercode",
  15. width:200,
  16. emptyText:'请输入产品编号或名称',
  17. getCondition: function(value) {
  18. return ' (bo_mothername like\'%' + value + '%\''
  19. +' or bo_mothercode like \'%'+value+'%\' ) ';
  20. }
  21. },{
  22. xtype : "textfield",
  23. name : "bo_version",
  24. fieldLabel:'版本号',
  25. emptyText: '全部',
  26. },{
  27. xtype: 'combobox',
  28. name: 'bo_statuscode',
  29. queryMode: 'local',
  30. displayField: 'bo_status',
  31. valueField: 'bo_statuscode',
  32. fieldLabel :'状态',
  33. emptyText: '全部',
  34. editable:false,
  35. store: Ext.create('Ext.data.ArrayStore', {
  36. fields: ['bo_statuscode', 'bo_status'],
  37. data: [
  38. ["ALL", "全部"],
  39. ["ENABLE", "已启用"],
  40. ["BANNED", "已禁用"]
  41. ]
  42. }),
  43. getCondition: function(value) {
  44. if(value == 'ALL'||value==null) {
  45. return '1=1';
  46. }else {
  47. return 'bo_statuscode=\'' + value + '\'';
  48. }
  49. }
  50. }],
  51. //字段属性
  52. _formXtype:'document-bom-formpanel',
  53. _title:'BOM资料',
  54. caller:'Bom',
  55. _deleteUrl:'/api/document/bom/delete',
  56. _batchOpenUrl:'/api/document/bom/batchOpen',
  57. _batchCloseUrl:'/api/document/bom/batchClose',
  58. _batchDeleteUrl:'/api/document/bom/batchDelete',
  59. gridConfig: {
  60. idField: 'id',
  61. codeField: 'bo_mothercode',
  62. statusCodeField:'bo_statuscode',
  63. dataUrl: '/api/document/bom/list',
  64. caller: 'Bom',
  65. columns : [{
  66. text : "id",
  67. width : 0,
  68. dataIndex : "id",
  69. xtype : "numbercolumn",
  70. },{
  71. text : "产品id",
  72. width : 0,
  73. dataIndex : "bo_motherid",
  74. xtype : "numbercolumn",
  75. },{
  76. text : "产品编号",
  77. dataIndex : "bo_mothercode",
  78. width : 150.0,
  79. },
  80. {
  81. text : "产品名称",
  82. dataIndex : "bo_mothername",
  83. width :200.0,
  84. },
  85. {
  86. text : "产品型号",
  87. dataIndex : "pr_orispeccode",
  88. width :150.0,
  89. },
  90. {
  91. text : "产品规格",
  92. dataIndex : "pr_spec",
  93. width :150.0,
  94. },
  95. {
  96. text : "产品状态",
  97. dataIndex : "bo_status",
  98. align:'center',
  99. width : 90.0,
  100. },
  101. {
  102. text : "产品状态码",
  103. dataIndex : "bo_statuscode",
  104. width : 0,
  105. },
  106. {
  107. text : "版本号",
  108. dataIndex : "bo_version",
  109. width :100.0,
  110. }]
  111. },
  112. });
  113. me.callParent(arguments);
  114. },
  115. refresh:function(){
  116. this.items.items[0].store.load()
  117. }
  118. });