QueryPanel.js 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  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: 'textfield',
  9. name: 'ma_code',
  10. emptyText :'请输入单号',
  11. }, {
  12. xtype: 'condatefield',
  13. name: 'createTime',
  14. fieldLabel: '日期',
  15. columnWidth: 0.5,
  16. operation: 'between'
  17. },{
  18. xtype: 'productDbfindTrigger',
  19. name: 'ma_prodcode',
  20. fieldLabel: '产品',
  21. emptyText :'请输入产品名称或编号',
  22. getCondition: function(value) {
  23. if(value == 'ALL') {
  24. return '1=1';
  25. }else {
  26. return ' (ma_prodcode like\'%' + value + '%\' or ma_proddetail like \'%'+value+'%\') ';
  27. }
  28. }
  29. }, {
  30. xtype: 'combobox',
  31. name: 'ma_type',
  32. fieldLabel: '类型',
  33. allowBlank: true,
  34. editable:false,
  35. columnWidth: 0.25,
  36. emptyText :'全部',
  37. queryMode: 'local',
  38. displayField: 'name',
  39. valueField: 'value',
  40. store: Ext.create('Ext.data.ArrayStore', {
  41. fields: ['name', 'value'],
  42. data: [
  43. ["全部", "ALL"],
  44. ["组装", "组装"],
  45. ["拆件", "拆件"]
  46. ]
  47. }),
  48. getCondition: function(value) {
  49. if(value == 'ALL') {
  50. return '1=1';
  51. }else {
  52. return 'ma_type=\'' + value + '\'';
  53. }
  54. }
  55. }, {
  56. xtype: 'combobox',
  57. name: 'ma_statuscode',
  58. fieldLabel: '单据状态',
  59. queryMode: 'local',
  60. displayField: 'ma_status',
  61. valueField: 'ma_statuscode',
  62. emptyText :'全部',
  63. editable:false,
  64. store: Ext.create('Ext.data.ArrayStore', {
  65. fields: ['ma_statuscode', 'ma_status'],
  66. data: [
  67. ["ALL", "全部"],
  68. ["AUDITED", "已审核"],
  69. ["UNAUDITED", "未审核"]
  70. ]
  71. }),
  72. getCondition: function(value) {
  73. if(value == 'ALL') {
  74. return '1=1';
  75. }else {
  76. return 'ma_statuscode=\'' + value + '\'';
  77. }
  78. }
  79. }, {
  80. xtype: 'accountDbfindTrigger',
  81. name: 'creatorName',
  82. fieldLabel: '录入人',
  83. emptyText:'请输入账户名称或姓名',
  84. getCondition: function(value) {
  85. if(!value) {
  86. return '1=1';
  87. }else {
  88. return 'make.creatorName like\'%' + value + '%\'';
  89. }
  90. }
  91. }, {
  92. xtype: 'accountDbfindTrigger',
  93. name: 'ma_auditman',
  94. fieldLabel: '审核人',
  95. emptyText:'请输入账户名称或姓名'
  96. }],
  97. moreQueryFormItems: [],
  98. queryGridConfig: {
  99. idField: 'id',
  100. codeField: 'ma_code',
  101. addTitle: '制造单',
  102. addXtype: 'stock-make-formpanel',
  103. defaultCondition:'',
  104. baseVastUrl: '/api/storage/make/',
  105. caller:'Make',
  106. baseColumn: [{
  107. text: 'id',
  108. dataIndex: 'id',
  109. hidden:true,
  110. xtype: 'numbercolumn'
  111. }, {
  112. text: '制造单号',
  113. dataIndex: 'ma_code',
  114. width: 150
  115. }, {
  116. text: '类型',
  117. dataIndex: 'ma_type',
  118. width: 110
  119. }, {
  120. text: '产品编号',
  121. dataIndex: 'ma_prodcode',
  122. width: 150
  123. }, {
  124. text: '产品名称',
  125. dataIndex: 'ma_proddetail',
  126. width: 200
  127. }, {
  128. text: '产品型号',
  129. dataIndex: 'ma_prodorispec',
  130. width: 200
  131. }, {
  132. text: '产品规格',
  133. dataIndex: 'ma_prodspec',
  134. width: 200
  135. }, {
  136. text: '版本号',
  137. dataIndex: 'ma_version',
  138. width: 80
  139. }, {
  140. text: '数量',
  141. dataIndex: 'ma_qty',
  142. xtype: 'numbercolumn',
  143. width: 110,
  144. renderer : function(v) {
  145. var arr = (v + '.').split('.');
  146. var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
  147. var format = '0,000.' + xr.join('');
  148. return Ext.util.Format.number(v, format);
  149. },
  150. },{
  151. text: '单位',
  152. dataIndex: 'ma_produnit',
  153. width: 80,
  154. },{
  155. text: '单据状态',
  156. align: 'center',
  157. dataIndex: 'ma_status',
  158. width: 90,
  159. },{
  160. text: '单位成本',
  161. dataIndex: 'ma_total',
  162. xtype: 'numbercolumn',
  163. width: 0,
  164. }],
  165. relativeColumn: []
  166. }
  167. });