FormPanelController.js 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  1. Ext.define('saas.view.stock.otherOut.FormPanelController', {
  2. extend: 'saas.view.core.form.FormPanelController',
  3. alias: 'controller.stock-otherout-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',to:'pi_custid'
  81. },{
  82. from:'cu_code',to:'pi_custcode'
  83. },{
  84. from:'cu_name',to:'pi_custname'
  85. }],
  86. dbtpls:[{
  87. field:'pi_custcode',width:100
  88. },{
  89. field:'pi_custname',width:100
  90. }],
  91. //联想查询条件
  92. dbtplfield:"cu_name",
  93. //放大镜窗口字段
  94. dbSearchFields:[{
  95. xtype : "textfield",
  96. name : "cu_name",
  97. fieldLabel : "客户名称",
  98. columnWidth : 0.25
  99. }],
  100. dbColumns:[{
  101. conditionCode:'id',
  102. "text": "客户ID",
  103. "flex": 0,
  104. "dataIndex": "id",
  105. "width": 0,
  106. "xtype": "",
  107. "items": null
  108. },{
  109. conditionCode:'cu_code',
  110. "text": "客户编号",
  111. "flex": 1,
  112. "dataIndex": "cu_code",
  113. "width": 100,
  114. "xtype": "",
  115. "items": null
  116. }, {
  117. conditionCode:'cu_name',
  118. "text": "客户名称",
  119. "flex": 1,
  120. "dataIndex": "cu_name",
  121. "xtype": "",
  122. "items": null
  123. }]
  124. }) ;
  125. }
  126. },
  127. //放大镜赋值关系 以及 tpl模板
  128. 'multidbfindtrigger[name=pd_prodcode]':{
  129. beforerender:function(f){
  130. Ext.apply(f,{
  131. dataUrl:'/api/document/product/list',
  132. // dataUrl:'http://localhost:9480/product/list',
  133. addXtype: 'document-product-formpanel',
  134. addTitle: '物料资料',
  135. dbfinds:[{
  136. from:'id',to:'pd_prodid'
  137. },{
  138. from:'pr_code',to:'pd_prodcode'
  139. },{
  140. from:'pr_detail',to:'pr_detail'
  141. },{
  142. from:'pr_spec',to:'pr_spec'
  143. }],
  144. dbtpls:[{
  145. field:'pr_code',width:100
  146. },{
  147. field:'pr_detail',width:100
  148. },{
  149. field:'pr_spec',width:100
  150. }],
  151. dbColumns:[{
  152. "text": "物料ID",
  153. "flex": 0,
  154. "dataIndex": "pr_id",
  155. "width": 0,
  156. "xtype": "",
  157. "items": null
  158. },{
  159. "text": "物料编号",
  160. "flex": 1,
  161. "dataIndex": "pr_code",
  162. "width": 100,
  163. "xtype": "",
  164. "items": null
  165. }, {
  166. "text": "物料名称",
  167. "flex": 1,
  168. "dataIndex": "pr_detail",
  169. "xtype": "",
  170. "items": null
  171. }, {
  172. "text": "物料规格",
  173. "flex": 0,
  174. "dataIndex": "pr_spec",
  175. "width": 200,
  176. "xtype": "",
  177. "items": null
  178. }, {
  179. "text": "物料单位",
  180. "flex": 0,
  181. "dataIndex": "pr_unit",
  182. "width": 200,
  183. "xtype": "",
  184. "items": null
  185. }]
  186. }) ;
  187. }
  188. },
  189. //放大镜赋值关系 以及 tpl模板
  190. 'dbfindtrigger[name=pd_whname]':{
  191. beforerender:function(f){
  192. Ext.apply(f,{
  193. dataUrl:'/api/document/warehouse/list',
  194. // dataUrl:'http://localhost:9480/warehouse/list',
  195. dbfinds:[{
  196. from:'id',to:'pd_whid'
  197. },{
  198. from:'wh_code',to:'pd_whcode'
  199. },{
  200. from:'wh_description',to:'pd_whname'
  201. }],
  202. dbtpls:[{
  203. field:'pd_whcode',width:100
  204. },{
  205. field:'pd_whname',width:100
  206. }],
  207. dbColumns:[{
  208. "text": "仓库ID",
  209. "flex": 0,
  210. "dataIndex": "id",
  211. "width": 0,
  212. "xtype": "",
  213. "items": null
  214. },{
  215. "text": "仓库编号",
  216. "flex": 1,
  217. "dataIndex": "wh_code",
  218. "width": 100,
  219. "xtype": "",
  220. "items": null
  221. }, {
  222. "text": "仓库名称",
  223. "flex": 1,
  224. "dataIndex": "wh_description",
  225. "xtype": "",
  226. "items": null
  227. }, ]
  228. }) ;
  229. }
  230. }
  231. });
  232. },
  233. addCombo: function () {
  234. var combo = this.ownerCmp;
  235. Ext.create('Ext.window.Window', {
  236. layout: 'vbox',
  237. bodyPadding: 15,
  238. width: 500,
  239. items: [{
  240. fieldLabel: '实际值',
  241. xtype: 'textfield'
  242. }, {
  243. fieldLabel: '显示值',
  244. xtype: 'textfield'
  245. }],
  246. buttons: [{
  247. text: '确认',
  248. handler: function (b) {
  249. combo.setValue('ok');
  250. b.up('window').close();
  251. }
  252. }],
  253. renderTo: this.ownerCmp.ownerCt.getEl()
  254. }).show();
  255. }
  256. });