QueryPanel.js 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. Ext.define('saas.view.stock.make.QueryPanel', {
  2. extend: 'saas.view.core.query.QueryPanel',
  3. xtype: 'stock-make-querypanel',
  4. controller: 'stock-make-querypanel',
  5. viewModel: 'stock-make-querypanel',
  6. viewName: 'stock-make-querypanel',
  7. queryFormItems: [{
  8. xtype: 'hidden',
  9. name: 'ma_id',
  10. fieldLabel: 'ID',
  11. allowBlank: true,
  12. getCondition: function(value) {
  13. return 'ma_id=' + value;
  14. }
  15. },{
  16. xtype: 'textfield',
  17. name: 'ma_code',
  18. fieldLabel: '单据编号'
  19. },{
  20. xtype: 'textfield',
  21. name: 'ma_prodcode',
  22. fieldLabel: '产品',
  23. emptyText :'请输入产品名称或编号',
  24. getCondition: function(value) {
  25. if(value == 'ALL') {
  26. return '1=1';
  27. }else {
  28. return ' (ma_prodcode like\'%' + value + '%\' or ma_proddetail like \'%'+value+'%\') ';
  29. }
  30. }
  31. }, {
  32. xtype: 'condatefield',
  33. name: 'createTime',
  34. fieldLabel: '日期',
  35. columnWidth: 0.5,
  36. operation: 'between'
  37. }, {
  38. xtype: 'combobox',
  39. name: 'ma_type',
  40. fieldLabel: '类型',
  41. allowBlank: true,
  42. editable:false,
  43. columnWidth: 0.25,
  44. emptyText :'全部',
  45. queryMode: 'local',
  46. displayField: 'name',
  47. valueField: 'value',
  48. store: Ext.create('Ext.data.ArrayStore', {
  49. fields: ['name', 'value'],
  50. data: [
  51. ["全部", "ALL"],
  52. ["组装", "组装"],
  53. ["拆件", "拆件"]
  54. ]
  55. }),
  56. getCondition: function(value) {
  57. if(value == 'ALL') {
  58. return '1=1';
  59. }else {
  60. return 'ma_type=\'' + value + '\'';
  61. }
  62. }
  63. }, {
  64. xtype: 'combobox',
  65. name: 'ma_statuscode',
  66. fieldLabel: '单据状态',
  67. queryMode: 'local',
  68. displayField: 'ma_status',
  69. valueField: 'ma_statuscode',
  70. emptyText :'全部',
  71. editable:false,
  72. store: Ext.create('Ext.data.ArrayStore', {
  73. fields: ['ma_statuscode', 'ma_status'],
  74. data: [
  75. ["ALL", "全部"],
  76. ["AUDITED", "已审核"],
  77. ["UNAUDITED", "未审核"]
  78. ]
  79. }),
  80. getCondition: function(value) {
  81. if(value == 'ALL') {
  82. return '1=1';
  83. }else {
  84. return 'ma_statuscode=\'' + value + '\'';
  85. }
  86. }
  87. }],
  88. moreQueryFormItems: [],
  89. queryGridConfig: {
  90. idField: 'id',
  91. codeField: 'ma_code',
  92. addTitle: '制造单',
  93. addXtype: 'stock-make-formpanel',
  94. defaultCondition:'',
  95. baseVastUrl: '/api/storage/make/',
  96. baseColumn: [{
  97. text: 'id',
  98. dataIndex: 'id',
  99. hidden:true,
  100. xtype: 'numbercolumn'
  101. }, {
  102. text: '制造单号',
  103. dataIndex: 'ma_code',
  104. width: 150
  105. }, {
  106. text: '类型',
  107. dataIndex: 'ma_type',
  108. width: 110
  109. }, {
  110. text: '产品编号',
  111. dataIndex: 'ma_prodcode',
  112. width: 150
  113. }, {
  114. text: '产品名称',
  115. dataIndex: 'ma_proddetail',
  116. width: 200
  117. }, {
  118. text: '版本号',
  119. dataIndex: 'ma_version',
  120. width: 80
  121. }, {
  122. text: '数量',
  123. dataIndex: 'ma_qty',
  124. xtype: 'numbercolumn',
  125. width: 110,
  126. },{
  127. text: '单位',
  128. dataIndex: 'ma_produnit',
  129. width: 80,
  130. },{
  131. text: '单据状态',
  132. dataIndex: 'ma_status',
  133. width: 90,
  134. },{
  135. text: '单位成本',
  136. dataIndex: 'ma_total',
  137. xtype: 'numbercolumn',
  138. width: 0,
  139. }],
  140. relativeColumn: []
  141. }
  142. });