FormController.js 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. Ext.define('saas.view.test.order.FormController', {
  2. extend: 'saas.view.core.form.FormPanelController',
  3. alias: 'controller.test-order-formcontroller',
  4. init: function (form) {
  5. var me = this;
  6. this.control({
  7. /**放大镜新增demo*/
  8. "field[name=combo]":{
  9. beforerender:function(f){
  10. f.addHandler=me.addCombo;
  11. }
  12. },
  13. //主表单选放大镜模板
  14. 'dbfindtrigger[name=pu_vendcode]':{
  15. beforerender:function(f){
  16. Ext.apply(f,{
  17. //数据接口
  18. dataUrl:basePath + 'document/vendor/list',
  19. //赋值
  20. dbfinds:[{
  21. from:'ve_code',to:'pu_vendcode'
  22. },{
  23. from:'ve_name',to:'pu_vendname'
  24. }],
  25. //联想设置
  26. dbtpls:[{
  27. field:'ve_code',width:100
  28. },{
  29. field:'ve_name',width:100
  30. }],
  31. //联想查询条件
  32. //dbCondition:"CONCAT(ve_code, ve_name) like '{0}%'",
  33. //放大镜窗口字段
  34. dbSearchFields:[{
  35. xtype : "textfield",
  36. name : "ve_name",
  37. conditionExpression:"ve_name like '{0}%'",//传入后台条件 替换占位符
  38. fieldLabel : "供应商名称",
  39. columnWidth : 0.25
  40. }],
  41. //放大镜窗口列表
  42. dbColumns:[{
  43. "text": "供应商ID",
  44. "flex": 0,
  45. "dataIndex": "ve_id",
  46. "width": 0,
  47. "xtype": "",
  48. "items": null
  49. },{
  50. "text": "供应商编号",
  51. "flex": 1,
  52. "dataIndex": "ve_code",
  53. "width": 100,
  54. "xtype": "",
  55. "items": null
  56. }, {
  57. "text": "供应商名称",
  58. "flex": 1,
  59. "dataIndex": "ve_name",
  60. "xtype": "",
  61. "items": null
  62. }, {
  63. "text": "供应商类型",
  64. "flex": 0,
  65. "dataIndex": "ve_type",
  66. "width": 200,
  67. "xtype": "",
  68. "items": null
  69. }]
  70. }) ;
  71. }
  72. },
  73. //从表单选放大镜赋值关系 以及 tpl模板
  74. 'dbfindtrigger[name=pd_prodcode]':{
  75. beforerender:function(f){
  76. Ext.apply(f,{
  77. //数据接口
  78. dataUrl:basePath + 'document/product/getProductsByCondition',
  79. //放大镜赋值设置
  80. dbfinds:[{
  81. from:'pr_code',to:'pd_prodcode'
  82. },{
  83. from:'pr_unit',to:'pd_unit'
  84. }],
  85. //联想查询条件
  86. dbCondition:"CONCAT(pr_code, pr_detail) like '{0}%'",
  87. //联想设置
  88. dbtpls:[{
  89. field:'pr_code',width:100
  90. },{
  91. field:'pr_detail',width:100
  92. }],
  93. //窗口字段设置
  94. dbSearchFields:[{
  95. emptyText:'输入物料编号或物料名称',
  96. xtype : "textfield",
  97. name : "search",
  98. conditionExpression:"CONCAT(pr_code, pr_detail) like '{0}%'",
  99. allowBlank : true,
  100. columnWidth : 0.25
  101. }],
  102. //窗口列设置
  103. dbColumns:[{
  104. "text": "物料ID",
  105. "flex": 0,
  106. "dataIndex": "pr_id",
  107. "width": 0,
  108. "xtype": "",
  109. "items": null
  110. },{
  111. "text": "物料编号",
  112. "flex": 1,
  113. "dataIndex": "pr_code",
  114. "width": 100,
  115. "xtype": "",
  116. "items": null
  117. }, {
  118. "text": "物料名称",
  119. "flex": 1,
  120. "dataIndex": "pr_detail",
  121. "xtype": "",
  122. "items": null
  123. }, {
  124. "text": "物料规格",
  125. "flex": 0,
  126. "dataIndex": "pr_spec",
  127. "width": 200,
  128. "xtype": "",
  129. "items": null
  130. }]
  131. }) ;
  132. }
  133. },
  134. //从表多选放大镜赋值关系 以及 tpl模板
  135. 'multidbfindtrigger[name=pd_prodcode]':{
  136. beforerender:function(f){
  137. Ext.apply(f,{
  138. //数据接口
  139. dataUrl:basePath + 'document/product/getProductsByCondition',
  140. //放大镜赋值设置
  141. dbfinds:[{
  142. from:'pr_code',to:'pd_prodcode'
  143. },{
  144. from:'pr_unit',to:'pd_unit'
  145. }],
  146. //联想查询条件
  147. dbCondition:"CONCAT(pr_code, pr_detail) like '{0}%'",
  148. //联想设置
  149. dbtpls:[{
  150. field:'pr_code',width:100
  151. },{
  152. field:'pr_detail',width:100
  153. }],
  154. //窗口字段设置
  155. dbSearchFields:[{
  156. emptyText:'输入物料编号或物料名称',
  157. xtype : "textfield",
  158. name : "search",
  159. conditionExpression:"CONCAT(pr_code, pr_detail) like '{0}%'",
  160. allowBlank : true,
  161. columnWidth : 0.25
  162. }],
  163. //窗口列设置
  164. dbColumns:[{
  165. "text": "物料ID",
  166. "flex": 0,
  167. "dataIndex": "pr_id",
  168. "width": 0,
  169. "xtype": "",
  170. "items": null
  171. },{
  172. "text": "物料编号",
  173. "flex": 1,
  174. "dataIndex": "pr_code",
  175. "width": 100,
  176. "xtype": "",
  177. "items": null
  178. }, {
  179. "text": "物料名称",
  180. "flex": 1,
  181. "dataIndex": "pr_detail",
  182. "xtype": "",
  183. "items": null
  184. }, {
  185. "text": "物料规格",
  186. "flex": 0,
  187. "dataIndex": "pr_spec",
  188. "width": 200,
  189. "xtype": "",
  190. "items": null
  191. }]
  192. }) ;
  193. }
  194. }
  195. });
  196. }
  197. });