QueryPanelController.js 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. Ext.define('saas.view.purchase.purchaseIn.QueryPanelController', {
  2. extend: 'saas.view.core.query.QueryPanelController',
  3. alias: 'controller.purchase-purchasein-querypanel',
  4. init: function (form) {
  5. var me = this;
  6. this.control({
  7. //放大镜赋值关系 以及 tpl模板
  8. 'dbfindtrigger[name=pu_vendname]':{
  9. beforerender:function(f){
  10. Ext.apply(f,{
  11. dataUrl:'/api/document/vendor/list',
  12. addXtype: 'document-vendor-formpanel',
  13. addTitle: '供应商资料',
  14. dbfinds:[{
  15. from:'ve_code',to:'pu_vendcode'
  16. },{
  17. from:'ve_name',to:'pu_vendname'
  18. }],
  19. dbtpls:[{
  20. field:'ve_code',width:100
  21. },{
  22. field:'ve_name',width:100
  23. }],
  24. defaultCondition: "ve_statuscode='OPEN'",
  25. dbSearchFields:[{
  26. emptyText:'输入供应商编号或名称',
  27. xtype : "textfield",
  28. name : "search",
  29. getCondition: function(v) {
  30. return "(upper(ve_code) like '%"+v.toUpperCase()+"%' or upper(ve_name) like '%"+v.toUpperCase()+"%')";
  31. },
  32. allowBlank : true,
  33. columnWidth : 0.25
  34. }],
  35. dbColumns:[{
  36. conditionCode:'ve_id',
  37. "text": "供应商ID",
  38. "hidden": true,
  39. "dataIndex": "ve_id",
  40. "width": 0,
  41. "xtype": "",
  42. "items": null
  43. },{
  44. conditionCode:'ve_code',
  45. "text": "供应商编号",
  46. "flex": 1,
  47. "dataIndex": "ve_code",
  48. "width": 100,
  49. "xtype": "",
  50. "items": null
  51. }, {
  52. conditionCode:'ve_name',
  53. "text": "供应商名称",
  54. "flex": 1,
  55. "dataIndex": "ve_name",
  56. "xtype": "",
  57. "items": null
  58. }, {
  59. conditionCode:'ve_type',
  60. "text": "供应商类型",
  61. "flex": 0,
  62. "dataIndex": "ve_type",
  63. "width": 200,
  64. "xtype": "",
  65. "items": null
  66. }]
  67. }) ;
  68. }
  69. },
  70. //放大镜赋值关系 以及 tpl模板
  71. 'dbfindtrigger[name=pd_prodcode]':{
  72. beforerender:function(f){
  73. Ext.apply(f,{
  74. conditionCode:'pr_code',
  75. dataUrl:'/api/document/product/list',
  76. addXtype: 'document-product-formpanel',
  77. addTitle: '物料资料',
  78. dbfinds:[{
  79. from:'pr_code',to:'pd_prodcode',
  80. from:'pr_unit',to:'pd_unit'
  81. }],
  82. dbtpls:[{
  83. field:'pr_code',width:100
  84. },{
  85. field:'pr_detail',width:100
  86. }],
  87. defaultCondition: "pr_statuscode='OPEN'",
  88. dbSearchFields:[{
  89. emptyText:'输入物料编号、名称或规格',
  90. xtype : "textfield",
  91. name : "search",
  92. width: 200,
  93. getCondition: function(v) {
  94. return "(upper(pr_spec) like '%" + v.toUpperCase()+"%' or upper(pr_code) like '%"+v.toUpperCase()+"%' or upper(pr_detail) like '%"+v.toUpperCase()+"%')";
  95. },
  96. allowBlank : true,
  97. columnWidth : 0.25
  98. }],
  99. dbColumns:[{
  100. "text": "物料ID",
  101. "hidden": true,
  102. "dataIndex": "id",
  103. }, {
  104. "text": "物料编号",
  105. "flex": 1,
  106. "dataIndex": "pr_code",
  107. "width": 100,
  108. "xtype": "",
  109. "items": null
  110. }, {
  111. "text": "物料名称",
  112. "flex": 1,
  113. "dataIndex": "pr_detail",
  114. "xtype": "",
  115. "items": null
  116. }, {
  117. "text": "物料规格",
  118. "flex": 0,
  119. "dataIndex": "pr_spec",
  120. "width": 200,
  121. "xtype": "",
  122. "items": null
  123. }, {
  124. "text": "物料单位",
  125. "flex": 0,
  126. "dataIndex": "pr_unit",
  127. "width": 200,
  128. "xtype": "",
  129. "items": null
  130. }]
  131. }) ;
  132. }
  133. }
  134. });
  135. }
  136. });