BasePanel.js 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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. caller:'Bom',
  51. _deleteUrl:'/api/document/bom/delete',
  52. _batchOpenUrl:'/api/document/bom/batchOpen',
  53. _batchCloseUrl:'/api/document/bom/batchClose',
  54. _batchDeleteUrl:'/api/document/bom/batchDelete',
  55. gridConfig: {
  56. idField: 'id',
  57. codeField: 'bo_mothercode',
  58. statusCodeField:'bo_statuscode',
  59. dataUrl: '/api/document/bom/list',
  60. caller: 'Bom',
  61. columns : [{
  62. text : "id",
  63. width : 0,
  64. dataIndex : "id",
  65. xtype : "numbercolumn",
  66. },{
  67. text : "产品id",
  68. width : 0,
  69. dataIndex : "bo_motherid",
  70. xtype : "numbercolumn",
  71. },{
  72. text : "产品编号",
  73. dataIndex : "bo_mothercode",
  74. width : 150.0,
  75. },
  76. {
  77. text : "产品名称",
  78. dataIndex : "bo_mothername",
  79. width :200.0,
  80. },
  81. {
  82. text : "产品型号",
  83. dataIndex : "pr_orispeccode",
  84. width :150.0,
  85. },
  86. {
  87. text : "产品规格",
  88. dataIndex : "pr_spec",
  89. width :150.0,
  90. },
  91. {
  92. text : "产品状态",
  93. dataIndex : "bo_status",
  94. width : 90.0,
  95. },
  96. {
  97. text : "产品状态码",
  98. dataIndex : "bo_statuscode",
  99. width : 0,
  100. },
  101. {
  102. text : "产品版本号",
  103. dataIndex : "bo_version",
  104. width :80.0,
  105. }]
  106. },
  107. refresh:function(){
  108. this.items.items[0].store.load()
  109. }
  110. });