ModifyMaterialWin.js 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. Ext.define('make.view.make.makeBase.ModifyMaterialWin', {
  2. extend: 'Ext.window.Window',
  3. xtype: 'make-makebase-modifymaterialwin',
  4. controller: 'make-makebase-modifymaterialwin',
  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: '用料表修改',
  15. viewModel: {
  16. data: {
  17. form : {
  18. id:0,
  19. mm_detno:null,
  20. mm_prodid:null,
  21. mm_prodcode:null,
  22. mm_oneuseqty:null,
  23. mm_qty:0,
  24. mm_remark:null,
  25. pr_detail:null,
  26. pr_spec:null,
  27. pr_orispeccode:null,
  28. pr_brand:null
  29. },
  30. ma_qty:null,
  31. ma_id: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.3 ,
  42. margin: '0 0 10 0',
  43. labelAlign: 'right',
  44. labelWidth: 90
  45. },
  46. bodyPadding: '8 12 8 12',
  47. _saveUrl: '/api/make/make/modifyMaterial',
  48. _deleteUrl:'/api/make/make/deleteDetail',
  49. items: [{
  50. xtype : "hidden",
  51. fieldLabel: 'ID',
  52. name :"id",
  53. bind:'{form.id}',
  54. readOnly:true
  55. },{
  56. xtype : "textfield",
  57. fieldLabel: '序号',
  58. align: 'center',
  59. name :"mm_detno",
  60. bind:'{form.mm_detno}',
  61. readOnly:true,
  62. }, {
  63. fieldLabel: "物料id",
  64. name: "mm_prodid",
  65. bind:'{form.mm_prodid}',
  66. xtype: "hidden",
  67. },{
  68. xtype : "productDbfindTrigger",
  69. fieldLabel: '物料编号',
  70. name :"mm_prodcode",
  71. bind:'{form.mm_prodcode}',
  72. allowBlank:false,
  73. },{
  74. xtype : "textfield",
  75. fieldLabel: '物料名称',
  76. name :"pr_detail",
  77. bind:'{form.pr_detail}',
  78. readOnly:true,
  79. },{
  80. xtype : "textfield",
  81. fieldLabel: '厂家/品牌',
  82. name :"pr_brand",
  83. bind:'{form.pr_brand}',
  84. readOnly:true,
  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 :"pr_spec",
  95. bind:'{form.pr_spec}',
  96. maxLength: 200,
  97. readOnly:true,
  98. },{
  99. xtype : "hiddenfield",
  100. fieldLabel: '数量小数位数',
  101. name :"pu_decimal",
  102. bind:'{form.pu_decimal}'
  103. },{
  104. xtype : "numberfield",
  105. fieldLabel: '单位用量',
  106. name :"mm_oneuseqty",
  107. bind:'{form.mm_oneuseqty}',
  108. allowBlank:false,
  109. listeners: {
  110. change: 'onOneUseChange',
  111. },
  112. decimalPrecision: 6,
  113. },{
  114. xtype : "numberfield",
  115. fieldLabel: '需求数',
  116. name :"mm_qty",
  117. bind:'{form.mm_qty}',
  118. allowBlank:false,
  119. decimalPrecision: 6,
  120. thousandSeparator :','
  121. },{
  122. xtype : "textfield",
  123. fieldLabel: '备注',
  124. name :"mm_remark",
  125. bind:'{form.mm_remark}',
  126. }],
  127. buttons: [{
  128. text:'新增',
  129. formBind: true,
  130. handler:function(){
  131. //将值置空
  132. var win = this.up('window');
  133. win.getViewModel().set('form',null);
  134. win.setTitle('新增用料明细');
  135. }
  136. },{
  137. text:'保存',
  138. disabled: true,
  139. formBind: true,
  140. handler:'onSave'
  141. },{
  142. text:'删除',
  143. handler:'onDelete',
  144. bind:{
  145. disabled:'{form.mm_id}'
  146. }
  147. },{
  148. text: '关闭',
  149. handler:'onClose'
  150. }]
  151. }],
  152. initComponent: function () {
  153. var me = this;
  154. me.callParent();
  155. },
  156. })