BasePanel.js 3.0 KB

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