FormPanel.js 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  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: false
  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. dataIndex : "bd_soncode",
  100. editor : {
  101. displayField : "display",
  102. editable : true,
  103. format : "",
  104. hideTrigger : false,
  105. maxLength : 100.0,
  106. minValue : null,
  107. positiveNum : false,
  108. queryMode : "local",
  109. store : null,
  110. valueField : "value",
  111. xtype : "multidbfindtrigger"
  112. }
  113. },
  114. {
  115. allowBlank:false,
  116. text : "单位",
  117. editor : {
  118. xtype : "textfield"
  119. },
  120. dataIndex : "bd_unit",
  121. },
  122. {
  123. allowBlank:false,
  124. text : "单位用量",
  125. editor : {
  126. xtype : "textfield"
  127. },
  128. dataIndex : "bd_baseqty",
  129. },
  130. {
  131. allowBlank:false,
  132. text : "替代料",
  133. dataIndex : "bd_replace",
  134. editor : {
  135. displayField : "display",
  136. editable : true,
  137. format : "",
  138. hideTrigger : false,
  139. maxLength : 100.0,
  140. minValue : null,
  141. positiveNum : false,
  142. queryMode : "local",
  143. store : null,
  144. valueField : "value",
  145. xtype : "multidbfindtrigger"
  146. }
  147. }]
  148. }],
  149. auditTexts: {
  150. auditCode: 'CLOSE',
  151. auditText: '已关闭',
  152. unAuditCode: 'OPEN',
  153. unAuditText: '已开启',
  154. auditBtnText: '禁用',
  155. unAuditBtnText: '启用',
  156. }
  157. });