FormPanel.js 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. Ext.define('saas.view.document.bom.FormPanel', {
  2. extend: 'saas.view.core.form.FormPanel',
  3. xtype: 'document-bom-formpanel',
  4. controller: 'document-bom-formpanel',
  5. viewModel: 'document-bom-formpanel',
  6. caller:'Bom',
  7. //字段属性
  8. _title:'BOM资料',
  9. _idField: 'id',
  10. _codeField: 'bo_mothercode',
  11. _statusField: 'bo_status',
  12. _statusCodeField: 'bo_statuscode',
  13. _readUrl:'/api/document/bom/read/',
  14. _saveUrl:'/api/document/bom/save',
  15. _openUrl:'/api/document/bom/open',
  16. _closeUrl:'/api/document/bom/close',
  17. _deleteUrl:'/api/document/bom/delete/',
  18. initId:0,
  19. codeInHeader: false,
  20. defaultButtons:[{
  21. cls: 'x-formpanel-btn-orange',
  22. xtype: 'button',
  23. text: '新增',
  24. bind: {
  25. hidden: '{!id}'
  26. },
  27. handler: 'add'
  28. }, {
  29. xtype: 'button',
  30. text: '保存',
  31. handler: 'onSave'
  32. }, {
  33. xtype: 'button',
  34. text: '删除',
  35. handler: 'delete'
  36. }, {
  37. xtype: 'button',
  38. bind: {
  39. text: '{auditBtnText}'
  40. },
  41. handler: "auditBtnClick",
  42. }],
  43. defaultItems: [{
  44. xtype: 'hidden',
  45. name: 'id',
  46. fieldLabel: 'id',
  47. },{
  48. xtype: 'hidden',
  49. name: 'bo_motherid',
  50. fieldLabel: '母件id'
  51. },{
  52. xtype: 'textfield',
  53. name: 'bo_mothername',
  54. fieldLabel: 'BOM名称',
  55. allowBlank: false
  56. },{
  57. xtype: 'textfield',
  58. name: 'bo_mothercode',
  59. fieldLabel: 'BOM编号',
  60. allowBlank: true
  61. },{
  62. xtype: 'textfield',
  63. name: 'bo_status',
  64. fieldLabel: 'BOM状态'
  65. },{
  66. xtype: 'hidden',
  67. name: 'bo_statuscode',
  68. fieldLabel: '状态码'
  69. },{
  70. xtype : "datefield",
  71. name : "createTime",
  72. fieldLabel : "创建时间"
  73. },{
  74. xtype : "datefield",
  75. name : "updateTime",
  76. fieldLabel : "更新时间"
  77. }, {
  78. xtype : "detailGridField",
  79. detnoColumn: 'bd_detno',
  80. showCount: false,
  81. storeModel:'saas.model.document.bomdetail',
  82. deleteDetailUrl:'/api/document/bom/deleteDetail/',
  83. columns : [
  84. {
  85. text : "ID",
  86. dataIndex : "id",
  87. hidden : true,
  88. xtype : "numbercolumn"
  89. },
  90. {
  91. text : "关联ID",
  92. dataIndex : "bd_bomid",
  93. hidden : true,
  94. xtype : "numbercolumn"
  95. },
  96. {
  97. allowBlank:false,
  98. text : "子件编号",
  99. editor : {
  100. xtype : "textfield"
  101. },
  102. dataIndex : "bd_soncode",
  103. },
  104. {
  105. allowBlank:false,
  106. text : "单位",
  107. editor : {
  108. xtype : "textfield"
  109. },
  110. dataIndex : "bd_unit",
  111. },
  112. {
  113. allowBlank:false,
  114. text : "单位用量",
  115. editor : {
  116. xtype : "textfield"
  117. },
  118. dataIndex : "bd_baseqty",
  119. },
  120. {
  121. allowBlank:false,
  122. text : "替代料",
  123. editor : {
  124. xtype : "textfield"
  125. },
  126. dataIndex : "bd_replace",
  127. }]
  128. }],
  129. auditTexts: {
  130. auditCode: 'CLOSE',
  131. auditText: '已关闭',
  132. unAuditCode: 'OPEN',
  133. unAuditText: '已开启',
  134. auditBtnText: '禁用',
  135. unAuditBtnText: '启用',
  136. }
  137. });