FormPanelController.js 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256
  1. Ext.define('saas.view.stock.otherIn.FormPanelController', {
  2. extend: 'saas.view.core.form.FormPanelController',
  3. alias: 'controller.stock-otherin-formpanel',
  4. init: function (form) {
  5. var me = this;
  6. this.control({
  7. //放大镜赋值关系 以及 tpl模板
  8. 'dbfindtrigger[name=pi_vendname]':{
  9. beforerender:function(f){
  10. Ext.apply(f,{
  11. dataUrl:'/api/document/vendor/list',
  12. // dataUrl:'http://localhost:9480/vendor/list',
  13. addXtype: 'document-vendor-formpanel',
  14. addTitle: '供应商资料',
  15. dbfinds:[{
  16. from:'id',to:'pi_vendid'
  17. },{
  18. from:'ve_code',to:'pi_vendcode'
  19. },{
  20. from:'ve_name',to:'pi_vendname'
  21. }],
  22. dbtpls:[{
  23. field:'ve_code',width:100
  24. },{
  25. field:'ve_name',width:100
  26. }],
  27. //联想查询条件
  28. dbtplfield:"ve_name",
  29. //放大镜窗口字段
  30. dbSearchFields:[{
  31. xtype : "textfield",
  32. name : "ve_name",
  33. fieldLabel : "供应商名称",
  34. columnWidth : 0.25
  35. }],
  36. dbColumns:[{
  37. conditionCode:'id',
  38. "text": "供应商ID",
  39. "flex": 0,
  40. "dataIndex": "id",
  41. "width": 0,
  42. "xtype": "",
  43. "items": null
  44. },{
  45. conditionCode:'ve_code',
  46. "text": "供应商编号",
  47. "flex": 1,
  48. "dataIndex": "ve_code",
  49. "width": 100,
  50. "xtype": "",
  51. "items": null
  52. }, {
  53. conditionCode:'ve_name',
  54. "text": "供应商名称",
  55. "flex": 1,
  56. "dataIndex": "ve_name",
  57. "xtype": "",
  58. "items": null
  59. }, {
  60. conditionCode:'ve_type',
  61. "text": "供应商类型",
  62. "flex": 0,
  63. "dataIndex": "ve_type",
  64. "width": 200,
  65. "xtype": "",
  66. "items": null
  67. }]
  68. }) ;
  69. }
  70. },
  71. //放大镜赋值关系 以及 tpl模板
  72. 'dbfindtrigger[name=pi_custname]': {
  73. beforerender: function (f) {
  74. Ext.apply(f, {
  75. addXtype: 'document-customer-formpanel',
  76. addTitle: '客户资料',
  77. dataUrl: '/api/document/customer/list',
  78. // dataUrl:'http://localhost:9480/customer/list',
  79. dbfinds: [{
  80. from: 'id',
  81. to: 'pi_custid'
  82. }, {
  83. from: 'cu_code',
  84. to: 'pi_custcode'
  85. }, {
  86. from: 'cu_name',
  87. to: 'pi_custname'
  88. }],
  89. dbtpls: [{
  90. field: 'pi_custcode',
  91. width: 100
  92. }, {
  93. field: 'pi_custname',
  94. width: 100
  95. }],
  96. //联想查询条件
  97. dbtplfield:"cu_name",
  98. //放大镜窗口字段
  99. dbSearchFields:[{
  100. xtype : "textfield",
  101. name : "cu_name",
  102. fieldLabel : "客户名称",
  103. columnWidth : 0.25
  104. }],
  105. dbColumns: [{
  106. conditionCode: 'id',
  107. "text": "客户ID",
  108. "flex": 0,
  109. "dataIndex": "id",
  110. "width": 0,
  111. "xtype": "",
  112. "items": null
  113. }, {
  114. conditionCode: 'cu_code',
  115. "text": "客户编号",
  116. "flex": 1,
  117. "dataIndex": "cu_code",
  118. "width": 100,
  119. "xtype": "",
  120. "items": null
  121. }, {
  122. conditionCode: 'cu_name',
  123. "text": "客户名称",
  124. "flex": 1,
  125. "dataIndex": "cu_name",
  126. "xtype": "",
  127. "items": null
  128. }]
  129. });
  130. }
  131. },
  132. //放大镜赋值关系 以及 tpl模板
  133. 'multidbfindtrigger[name=pd_prodcode]': {
  134. beforerender: function (f) {
  135. Ext.apply(f, {
  136. dataUrl: '/api/document/product/list',
  137. // dataUrl:'http://localhost:9480/product/list',
  138. addXtype: 'document-product-formpanel',
  139. addTitle: '物料资料',
  140. dbfinds: [{
  141. from: 'id',
  142. to: 'pd_prodid'
  143. }, {
  144. from: 'pr_code',
  145. to: 'pd_prodcode'
  146. }, {
  147. from: 'pr_detail',
  148. to: 'pr_detail'
  149. }, {
  150. from: 'pr_spec',
  151. to: 'pr_spec'
  152. }],
  153. dbtpls: [{
  154. field: 'pr_code',
  155. width: 100
  156. }, {
  157. field: 'pr_detail',
  158. width: 100
  159. }, {
  160. field: 'pr_spec',
  161. width: 100
  162. }],
  163. dbColumns: [{
  164. "text": "物料ID",
  165. "flex": 0,
  166. "dataIndex": "pr_id",
  167. "width": 0,
  168. "xtype": "",
  169. "items": null
  170. }, {
  171. "text": "物料编号",
  172. "flex": 1,
  173. "dataIndex": "pr_code",
  174. "width": 100,
  175. "xtype": "",
  176. "items": null
  177. }, {
  178. "text": "物料名称",
  179. "flex": 1,
  180. "dataIndex": "pr_detail",
  181. "xtype": "",
  182. "items": null
  183. }, {
  184. "text": "物料规格",
  185. "flex": 0,
  186. "dataIndex": "pr_spec",
  187. "width": 200,
  188. "xtype": "",
  189. "items": null
  190. }, {
  191. "text": "物料单位",
  192. "flex": 0,
  193. "dataIndex": "pr_unit",
  194. "width": 200,
  195. "xtype": "",
  196. "items": null
  197. }]
  198. });
  199. }
  200. },
  201. //放大镜赋值关系 以及 tpl模板
  202. 'dbfindtrigger[name=pd_whname]': {
  203. beforerender: function (f) {
  204. Ext.apply(f, {
  205. dataUrl: '/api/document/warehouse/list',
  206. // dataUrl:'http://localhost:9480/warehouse/list',
  207. addXtype: 'other-warehouse',
  208. addTitle: '仓库资料',
  209. dbfinds: [{
  210. from: 'id',
  211. to: 'pd_whid'
  212. }, {
  213. from: 'wh_code',
  214. to: 'pd_whcode'
  215. }, {
  216. from: 'wh_description',
  217. to: 'pd_whname'
  218. }],
  219. dbtpls: [{
  220. field: 'pd_whcode',
  221. width: 100
  222. }, {
  223. field: 'pd_whname',
  224. width: 100
  225. }],
  226. dbColumns: [{
  227. "text": "仓库ID",
  228. "flex": 0,
  229. "dataIndex": "id",
  230. "width": 0,
  231. "xtype": "",
  232. "items": null
  233. }, {
  234. "text": "仓库编号",
  235. "flex": 1,
  236. "dataIndex": "wh_code",
  237. "width": 100,
  238. "xtype": "",
  239. "items": null
  240. }, {
  241. "text": "仓库名称",
  242. "flex": 1,
  243. "dataIndex": "wh_description",
  244. "xtype": "",
  245. "items": null
  246. }, ]
  247. });
  248. },
  249. },
  250. });
  251. }
  252. });