QueryPanel_bomcheck.js 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. Ext.define('saas.view.make.bomComposite.QueryPanel_bomcheck', {
  2. extend: 'Ext.grid.Panel',
  3. xtype: 'make-bomcomposite-querypanel-bomcheck',
  4. plugins: [
  5. 'gridexporter',
  6. ],
  7. initComponent: function () {
  8. var me = this;
  9. Ext.apply(me, {
  10. columns: [{
  11. xtype: 'rownumberer',
  12. text: '序号',
  13. width: 50
  14. }, {
  15. text: '反查料号',
  16. dataIndex: 'bm_prcode',
  17. width: 220
  18. }, {
  19. text: '母件编号',
  20. dataIndex: 'bm_mothercode',
  21. width: 220
  22. }, {
  23. text: '母件名称',
  24. dataIndex: 'mo_proddetail',
  25. width: 200
  26. }, {
  27. text: '母件规格',
  28. dataIndex: 'mo_prodspec',
  29. width: 250
  30. },{
  31. text: '单位用量',
  32. dataIndex: 'bm_baseqty'
  33. }, {
  34. text: '备注',
  35. dataIndex: 'bm_remark'
  36. }, {
  37. text: '反查层级',
  38. dataIndex: 'bm_level'
  39. }, {
  40. text: '是否顶层',
  41. dataIndex: 'bm_iftop',
  42. xtype: 'yncolumn'
  43. },{
  44. text: '类型',
  45. dataIndex: 'bm_type'
  46. }],
  47. tbar: [{
  48. xtype: 'radiogroup',
  49. name: 'redio_bomcheck',
  50. width: 300,
  51. simpleValue: true,
  52. items: [
  53. { boxLabel: '多级反查', inputValue: '/api/make/bom/bomMutiBack/', checked: true },
  54. { boxLabel: '单级反查', inputValue: '/api/make/bom/bomMutiBackOne/' }
  55. ],
  56. listeners:{
  57. change:function(){
  58. me.store.reload();
  59. }
  60. }
  61. }],
  62. store: {
  63. proxy: {
  64. type: 'ajax',
  65. url: '/api/make/bom/bomMutiBack',
  66. timeout: 8000,
  67. actionMethods: {
  68. read: 'GET'
  69. },
  70. reader: {
  71. type: 'json',
  72. rootProperty: 'data',
  73. totalProperty: '',
  74. },
  75. listeners: {
  76. exception: function (proxy, response, operation, eOpts) {
  77. if (operation.success) {
  78. if (response.timedout) {
  79. saas.util.BaseUtil.showErrorToast('请求超时');
  80. }
  81. } else {
  82. if (response.timedout) {
  83. saas.util.BaseUtil.showErrorToast('请求超时');
  84. } else {
  85. console.error('exception: ', response);
  86. var message = response.responseJson ? (response.responseJson.message == null ? '没有数据' : response.responseJson.message) : '请求超时';
  87. saas.util.BaseUtil.showErrorToast('查询失败:' + message);
  88. }
  89. }
  90. }
  91. }
  92. },
  93. listeners: {
  94. beforeload: function (store, op) {
  95. if(me.ownerCt){
  96. var prCode = me.ownerCt.ownerCt.down('productDbfindTrigger').getRawValue();
  97. if(prCode){
  98. store.getProxy().url = me.down('radiogroup[name=redio_bomcheck]').lastValue + prCode;
  99. }else{
  100. return false;
  101. }
  102. }
  103. },
  104. load: function (store, records, successful, operation, eOpts) {
  105. }
  106. }
  107. }
  108. });
  109. me.callParent(arguments);
  110. },
  111. });