FormPanelController.js 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328
  1. Ext.define('saas.view.purchase.purchaseOut.FormPanelController', {
  2. extend: 'saas.view.core.form.FormPanelController',
  3. alias: 'controller.purchase-purchaseout-formpanel',
  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. //放大镜赋值关系 以及 tpl模板
  14. 'dbfindtrigger[name=pi_vendname]':{
  15. beforerender:function(f){
  16. Ext.apply(f,{
  17. dataUrl:'/api/document/vendor/list',
  18. // dataUrl:'http://localhost:9480/vendor/list',
  19. addXtype: 'document-vendor-formpanel',
  20. addTitle: '供应商资料',
  21. defaultCondition:"ve_statuscode='OPEN'",
  22. dbfinds:[{
  23. from:'ve_id',to:'pi_vendid'
  24. },{
  25. from:'ve_code',to:'pi_vendcode'
  26. },{
  27. from:'ve_name',to:'pi_vendname'
  28. }],
  29. dbtpls:[{
  30. field:'ve_code',width:100
  31. },{
  32. field:'ve_name',width:100
  33. }],
  34. //联想查询条件
  35. dbtplfield:"ve_name",
  36. //放大镜窗口字段
  37. dbSearchFields:[{
  38. emptyText:'输入供应商编号或名称',
  39. xtype : "textfield",
  40. name : "ve_name",
  41. allowBlank : true,
  42. columnWidth : 0.25,
  43. getCondition:function(v){
  44. return "ve_name like '%" + v + "%' or ve_code like '%"+ v +"%'";
  45. }
  46. }],
  47. dbColumns:[{
  48. conditionCode:'ve_id',
  49. "text": "供应商ID",
  50. "flex": 0,
  51. "dataIndex": "ve_id",
  52. "width": 0,
  53. "xtype": "",
  54. "items": null
  55. },{
  56. conditionCode:'ve_code',
  57. "text": "供应商编号",
  58. "flex": 1,
  59. "dataIndex": "ve_code",
  60. "width": 100,
  61. "xtype": "",
  62. "items": null
  63. }, {
  64. conditionCode:'ve_name',
  65. "text": "供应商名称",
  66. "flex": 1,
  67. "dataIndex": "ve_name",
  68. "xtype": "",
  69. "items": null
  70. }, {
  71. conditionCode:'ve_type',
  72. "text": "供应商类型",
  73. "flex": 0,
  74. "dataIndex": "ve_type",
  75. "width": 200,
  76. "xtype": "",
  77. "items": null
  78. }]
  79. }) ;
  80. }
  81. },
  82. //放大镜赋值关系 以及 tpl模板
  83. 'multidbfindtrigger[name=pd_prodcode]':{
  84. beforerender:function(f){
  85. Ext.apply(f,{
  86. dataUrl:'/api/document/product/list',
  87. // dataUrl:'http://localhost:9480/product/list',
  88. addXtype: 'document-product-formpanel',
  89. addTitle: '物料资料',
  90. dbfinds:[{
  91. from:'id',to:'pd_prodid'
  92. },{
  93. from:'pr_code',to:'pd_prodcode'
  94. },{
  95. from:'pr_detail',to:'pr_detail'
  96. },{
  97. from:'pr_unit',to:'pd_unit'
  98. },{
  99. from:'pr_whid',to:'pd_whid'
  100. },{
  101. from:'pr_whcode',to:'pd_whcode'
  102. },{
  103. from:'pr_whname',to:'pd_whname'
  104. }],
  105. dbtpls:[{
  106. field:'pr_code',width:100
  107. },{
  108. field:'pr_detail',width:100
  109. },{
  110. field:'pr_unit',width:100
  111. }],
  112. //窗口字段设置
  113. dbSearchFields:[{
  114. emptyText:'输入物料编号或物料名称',
  115. xtype : "textfield",
  116. name : "search",
  117. allowBlank : true,
  118. columnWidth : 0.25,
  119. getCondition:function(v){
  120. return "pr_code like '%" + v + "%' or pr_detail like '%"+ v +"%'";
  121. }
  122. }],
  123. //窗口列设置
  124. dbColumns:[{
  125. "text": "物料ID",
  126. "dataIndex": "id",
  127. "width": 0,
  128. "xtype": "",
  129. "items": null
  130. },{
  131. "text": "物料编号",
  132. "dataIndex": "pr_code",
  133. "width": 100,
  134. "xtype": "",
  135. "items": null
  136. }, {
  137. "text": "物料名称",
  138. "width": 100,
  139. "dataIndex": "pr_detail",
  140. "xtype": "",
  141. "items": null
  142. }, {
  143. "text": "规格",
  144. "flex": 0,
  145. "dataIndex": "pr_spec",
  146. "width": 100,
  147. "xtype": "",
  148. "items": null
  149. }, {
  150. "text": "单位",
  151. "flex": 0,
  152. "dataIndex": "pr_spec",
  153. "width": 100,
  154. "xtype": "",
  155. "items": null
  156. },{
  157. "text": "仓库id",
  158. "flex": 0,
  159. "dataIndex": "pr_whid",
  160. "width": 0,
  161. "xtype": "",
  162. "items": null
  163. },{
  164. "text": "仓库编号",
  165. "flex": 0,
  166. "dataIndex": "pr_whcode",
  167. "width": 0,
  168. "xtype": "",
  169. "items": null
  170. },{
  171. "text": "仓库",
  172. "flex": 0,
  173. "dataIndex": "pr_whname",
  174. "width": 100,
  175. "xtype": "",
  176. "items": null
  177. },{
  178. "text": "总库存数",
  179. "flex": 0,
  180. "dataIndex": "po_onhand",
  181. "width": 100,
  182. "xtype": "",
  183. "items": null
  184. },{
  185. "text": "类型",
  186. "flex": 0,
  187. "dataIndex": "pr_kind",
  188. "width": 100,
  189. "xtype": "",
  190. "items": null
  191. },{
  192. "text": "型号",
  193. "flex": 0,
  194. "dataIndex": "pr_orispeccode",
  195. "width": 100,
  196. "xtype": "",
  197. "items": null
  198. },{
  199. "text": "品牌",
  200. "flex": 0,
  201. "dataIndex": "pr_brand",
  202. "width": 100,
  203. "xtype": "",
  204. "items": null
  205. },{
  206. "text": "供应商",
  207. "flex": 0,
  208. "dataIndex": "pr_vendname",
  209. "width": 100,
  210. "xtype": "",
  211. "items": null
  212. },{
  213. "text": "最小包装",
  214. "flex": 0,
  215. "dataIndex": "pr_zxbzs",
  216. "width": 100,
  217. "xtype": "",
  218. "items": null
  219. },{
  220. "text": "L/T",
  221. "flex": 0,
  222. "dataIndex": "pr_leadtime",
  223. "width": 100,
  224. "xtype": "",
  225. "items": null
  226. }]
  227. }) ;
  228. }
  229. },
  230. //放大镜赋值关系 以及 tpl模板
  231. 'dbfindtrigger[name=pd_whname]':{
  232. beforerender:function(f){
  233. Ext.apply(f,{
  234. dataUrl:'/api/document/warehouse/list',
  235. // dataUrl:'http://localhost:9480/warehouse/list',
  236. addXtype: 'other-warehouse',
  237. addTitle: '仓库资料',
  238. defaultCondition:"wh_statuscode='OPEN'",
  239. dbfinds:[{
  240. from:'id',to:'pd_whid'
  241. },{
  242. from:'wh_code',to:'pd_whcode'
  243. },{
  244. from:'wh_description',to:'pd_whname'
  245. }],
  246. dbtpls:[{
  247. field:'pd_whcode',width:100
  248. },{
  249. field:'pd_whname',width:100
  250. }],
  251. dbSearchFields:[{
  252. emptyText:'输入仓库编号或名称',
  253. xtype : "textfield",
  254. name : "wh_code",
  255. allowBlank : true,
  256. columnWidth : 0.25,
  257. getCondition:function(v){
  258. return "wh_code like '%" + v + "%' or wh_description like '%"+ v +"%'";
  259. }
  260. }],
  261. dbColumns:[{
  262. "text": "仓库ID",
  263. "flex": 0,
  264. "dataIndex": "id",
  265. "width": 0,
  266. "xtype": "",
  267. "items": null
  268. },{
  269. "text": "仓库编号",
  270. "flex": 1,
  271. "dataIndex": "wh_code",
  272. "width": 100,
  273. "xtype": "",
  274. "items": null
  275. },{
  276. "text": "仓库名称",
  277. "flex": 1,
  278. "dataIndex": "wh_description",
  279. "xtype": "",
  280. "items": null
  281. },{
  282. "text": "仓库类型",
  283. "flex": 1,
  284. "dataIndex": "wh_type",
  285. "xtype": "",
  286. "items": null
  287. }]
  288. }) ;
  289. }
  290. }
  291. });
  292. },
  293. addCombo:function(){
  294. var combo=this.ownerCmp;
  295. Ext.create('Ext.window.Window',{
  296. layout:'vbox',
  297. bodyPadding: 15,
  298. width:500,
  299. items:[{
  300. fieldLabel:'实际值',
  301. xtype:'textfield'
  302. },{
  303. fieldLabel:'显示值',
  304. xtype:'textfield'
  305. }],
  306. buttons:[{
  307. text:'确认',
  308. handler:function(b){
  309. combo.setValue('ok');
  310. b.up('window').close();
  311. }
  312. }],
  313. renderTo:this.ownerCmp.ownerCt.getEl()
  314. }).show();
  315. }
  316. });