Window.js 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. /**
  2. * Created by zhouy on 2018/10/18.
  3. */
  4. Ext.define('make.saas.view.document.warehouse.Window', {
  5. extend: 'saas.view.document.kind.ChildForm',
  6. xtype: 'document-warehouse-window',
  7. dataKind:'warehouse',//类型标识
  8. caller:'WareHouse',
  9. belong:{
  10. columns: [{
  11. text: '编号',
  12. dataIndex: 'wh_code',
  13. width: 150
  14. },{
  15. text: '仓库名称',
  16. dataIndex: 'wh_description',
  17. width: 200
  18. },{
  19. text: '类型',
  20. dataIndex: 'wh_type',
  21. width: 110
  22. },{
  23. text: '参与MRP运算',
  24. dataIndex: 'wh_ifmrp',
  25. width: 0
  26. },{
  27. text: '仓库状态码',
  28. dataIndex: 'wh_status',
  29. hidden:true,
  30. },{
  31. text: '仓库状态',
  32. dataIndex: 'wh_statuscode',
  33. width:90,
  34. xtype: 'actioncolumn',
  35. align : 'center',
  36. items: [{
  37. iconCls:'',
  38. getClass: function(v, meta, rec) {
  39. if(rec.get('wh_statuscode')=='ENABLE'){
  40. return 'x-grid-checkcolumn-checked-btn';
  41. }else{
  42. return 'x-grid-checkcolumn-btn';
  43. }
  44. },
  45. handler: function(view, rowIndex, colIndex) {
  46. var rec = view.getStore().getAt(rowIndex);
  47. var type=rec.get('wh_statuscode')=='ENABLE'?true:false;
  48. // 禁用/启用
  49. var form = this.ownerCt.ownerCt.ownerCt;
  50. var grid = this.ownerCt.ownerCt;
  51. saas.util.BaseUtil.request({
  52. url: (!type?form._openUrl:form._closeUrl)+'/'+rec.get('id'),
  53. params: '',
  54. method: 'POST',
  55. })
  56. .then(function(localJson) {
  57. if(localJson.success){
  58. saas.util.BaseUtil.showSuccessToast('操作成功');
  59. grid.store.load();
  60. }
  61. })
  62. .catch(function(e) {
  63. saas.util.BaseUtil.showErrorToast('操作失败: ' + e.message);
  64. });
  65. }
  66. }]
  67. }],
  68. keyField:'id',
  69. reqUrl: '/api/document/warehouse/save',
  70. delUrl: '/api/document/warehouse/delete'
  71. },
  72. etc:{
  73. warehouse:{
  74. items:[{
  75. xtype:'hidden',
  76. name:'id'
  77. },{
  78. xtype:'textfield',
  79. fieldLabel: '仓库编号',
  80. name: 'wh_code',
  81. autoCode:true,
  82. allowBlank:false,
  83. maxLength: 20
  84. },{
  85. xtype:'textfield',
  86. fieldLabel: '仓库名称',
  87. name: 'wh_description',
  88. allowBlank:false,
  89. maxLength: 20
  90. },{
  91. xtype:'combo',
  92. fieldLabel: '仓库类型',
  93. name: 'wh_type',
  94. allowBlank:false,
  95. displayField : "display",
  96. editable:false,
  97. hideTrigger : false,
  98. maxLength : 100.0,
  99. minValue : null,
  100. positiveNum : false,
  101. queryMode : "local",
  102. valueField : "value",
  103. store:{
  104. fields: ['display', 'value'],
  105. data : [
  106. {"display":"良品仓", "value":'良品仓'},
  107. {"display":"不良品仓", "value":'不良品仓'}
  108. ]
  109. }
  110. }/*,{
  111. xtype:'combo',
  112. fieldLabel: '参与MRP运算',
  113. name: 'wh_ifmrp',
  114. allowBlank:false,
  115. displayField : "display",
  116. editable:false,
  117. hideTrigger : false,
  118. maxLength : 100.0,
  119. minValue : null,
  120. value:1,
  121. positiveNum : false,
  122. queryMode : "local",
  123. valueField : "value",
  124. store:{
  125. fields: ['display', 'value'],
  126. data : [
  127. {"display":"是", "value":'1'},
  128. {"display":"否", "value":'0'}
  129. ]
  130. }
  131. }*/,{
  132. readOnly:true,
  133. xtype:'textfield',
  134. fieldLabel: '仓库状态',
  135. name: 'wh_status',
  136. value:'已启用',
  137. maxLength: 20
  138. },{
  139. xtype:'hidden',
  140. fieldLabel: '仓库状态码',
  141. name: 'wh_statuscode',
  142. value:'ENABLE'
  143. }]
  144. }
  145. }
  146. });