FormPanelController.js 13 KB

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