ModifyBomDetailWin.js 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. Ext.define('make.view.make.bom.ModifyBomDetailWin', {
  2. extend: 'Ext.window.Window',
  3. xtype: 'make-bom-modifybomdetailwin',
  4. controller: 'make-bom-modifybomdetailwin',
  5. cls: 'x-window-dbfind',
  6. modal: true,
  7. width: 1000,
  8. minHeight: 300,
  9. scrollable: true,
  10. bodyPadding: 10,
  11. constrain: true,
  12. closable: true,
  13. layout: 'fit',
  14. title: 'BOM明细表修改',
  15. viewModel: {
  16. data: {
  17. form : {
  18. id:0,
  19. bd_detno:null,
  20. bd_sonid:null,
  21. bd_soncode:null,
  22. bd_baseqty:null,
  23. bd_location:null,
  24. bd_remark:null,
  25. pr_detail:null,
  26. pr_orispeccode:null,
  27. pr_brand:null,
  28. pr_spec:null,
  29. },
  30. bo_id:null,
  31. bo_mothercode:null,
  32. },
  33. },
  34. items: [{
  35. xtype: 'form',
  36. layout: 'column',
  37. autoScroll: true,
  38. buttonAlign : 'center',
  39. //bodyPadding: 5,
  40. defaults:{
  41. columnWidth:0.5,
  42. margin: '0 0 10 0',
  43. labelAlign: 'right',
  44. labelWidth: 90
  45. },
  46. bodyPadding: '8 12 8 12',
  47. _saveUrl: '/api/make/bom/modifyBomDetail',
  48. _deleteUrl:'/api/make/bom/deleteDetail',
  49. items: [{
  50. xtype : "hidden",
  51. fieldLabel: 'ID',
  52. name :"id",
  53. bind:'{form.id}',
  54. readOnly:true
  55. },{
  56. xtype : "productDbfindTrigger",
  57. fieldLabel: '物料编号',
  58. name :"bd_soncode",
  59. bind:'{form.bd_soncode}',
  60. allowBlank:false,
  61. },{
  62. xtype : "textfield",
  63. fieldLabel: '序号',
  64. align: 'center',
  65. name :"bd_detno",
  66. bind:'{form.bd_detno}',
  67. readOnly:true,
  68. }, {
  69. xtype : "textfield",
  70. fieldLabel: '物料名称',
  71. name :"pr_detail",
  72. bind:'{form.pr_detail}',
  73. readOnly:true,
  74. },{
  75. xtype : "numberfield",
  76. decimalPrecision: 6,
  77. minValue: 0,
  78. fieldLabel: '单位用量',
  79. name :"bd_baseqty",
  80. bind:'{form.bd_baseqty}',
  81. allowBlank:false,
  82. /*listeners: {
  83. change: 'onOneUseChange',
  84. }*/
  85. },{
  86. xtype : "textfield",
  87. fieldLabel: '型号',
  88. name :"pr_orispeccode",
  89. bind:'{form.pr_orispeccode}',
  90. readOnly:true,
  91. },{
  92. xtype : "textfield",
  93. fieldLabel: '位号',
  94. name :"bd_location",
  95. bind:'{form.bd_location}',
  96. },{
  97. xtype : "textfield",
  98. fieldLabel: '厂家/品牌',
  99. name :"pr_brand",
  100. bind:'{form.pr_brand}',
  101. readOnly:true,
  102. },{
  103. xtype : "textfield",
  104. fieldLabel: '备注',
  105. name :"bd_remark",
  106. bind:'{form.bd_remark}',
  107. },{
  108. xtype : "textfield",
  109. fieldLabel: '物料规格',
  110. name :"pr_spec",
  111. bind:'{form.pr_spec}',
  112. columnWidth:1,
  113. readOnly:true,
  114. },{
  115. fieldLabel: "物料id",
  116. name: "bd_sonid",
  117. bind:'{form.bd_sonid}',
  118. xtype: "hidden",
  119. }],
  120. buttons: [{
  121. text:'新增',
  122. formBind: true,
  123. handler:function(){
  124. //将值置空
  125. var win = this.up('window');
  126. win.getViewModel().set('form',{
  127. id:0,
  128. bd_detno:null,
  129. bd_sonid:null,
  130. bd_soncode:null,
  131. bd_baseqty:null,
  132. bd_location:null,
  133. bd_remark:null,
  134. pr_detail:null,
  135. pr_orispeccode:null,
  136. pr_brand:null,
  137. pr_spec:null,
  138. });
  139. win.setTitle('新增BOM明细');
  140. }
  141. },{
  142. text:'保存',
  143. disabled: true,
  144. formBind: true,
  145. handler:'onSave'
  146. },{
  147. text:'删除',
  148. handler:'onDelete',
  149. bind:{
  150. disabled:'{form.bd_id}'
  151. }
  152. },{
  153. text: '关闭',
  154. handler:'onClose'
  155. }]
  156. }],
  157. initComponent: function () {
  158. var me = this;
  159. me.callParent();
  160. },
  161. })