FormPanelController.js 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505
  1. Ext.define('saas.view.stock.appropriationInOut.FormPanelController', {
  2. extend: 'saas.view.core.form.FormPanelController',
  3. alias: 'controller.stock-appropriationinout-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:'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:'id',
  47. "text": "供应商ID",
  48. "flex": 0,
  49. "dataIndex": "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. 'dbfindtrigger[name=pi_custname]':{
  82. beforerender:function(f){
  83. Ext.apply(f,{
  84. addXtype: 'document-customer-formpanel',
  85. addTitle: '客户资料',
  86. dataUrl:'/api/document/customer/list',
  87. // dataUrl:'http://localhost:9480/customer/list',
  88. dbfinds:[{
  89. from:'id',to:'pi_custid'
  90. },{
  91. from:'cu_code',to:'pi_custcode'
  92. },{
  93. from:'cu_name',to:'pi_custname'
  94. }],
  95. dbtpls:[{
  96. field:'pi_custcode',width:100
  97. },{
  98. field:'pi_custname',width:100
  99. }],
  100. defaultCondition:"cu_statuscode='OPEN'",
  101. //放大镜窗口字段
  102. dbSearchFields:[{
  103. emptyText:'输入客户编号或名称',
  104. xtype : "textfield",
  105. name : "cu_name",
  106. allowBlank : true,
  107. columnWidth : 0.25,
  108. getCondition:function(v){
  109. return "upper(cu_name) like '%"+v.toUpperCase()+"%' or upper(cu_code) like '%"+v.toUpperCase()+"%'";
  110. }
  111. }],
  112. dbColumns:[{
  113. "text": "客户ID",
  114. "flex": 0,
  115. "dataIndex": "id",
  116. "width": 0,
  117. "xtype": "",
  118. "items": null
  119. },{
  120. "text": "客户编号",
  121. "flex": 1,
  122. "dataIndex": "cu_code",
  123. "width": 100,
  124. "xtype": "",
  125. "items": null
  126. }, {
  127. "text": "客户名称",
  128. "flex": 1,
  129. "dataIndex": "cu_name",
  130. "xtype": "",
  131. "items": null
  132. },{
  133. "text": "客户类型",
  134. "flex": 1,
  135. "dataIndex": "cu_name",
  136. "xtype": "",
  137. "items": null
  138. },{
  139. "text": "业务员",
  140. "flex": 1,
  141. "dataIndex": "cu_sellername",
  142. "xtype": "",
  143. "items": null
  144. },{
  145. "text": "税率",
  146. "flex": 1,
  147. "dataIndex": "cu_taxrate",
  148. "xtype": "",
  149. "items": null
  150. },{
  151. "text": "承付天数",
  152. "flex": 1,
  153. "dataIndex": "cu_promisedays",
  154. "xtype": "",
  155. "items": null
  156. },{
  157. "text": "额度",
  158. "flex": 1,
  159. "dataIndex": "cu_credit",
  160. "xtype": "",
  161. "items": null
  162. }]
  163. }) ;
  164. }
  165. },
  166. //放大镜赋值关系 以及 tpl模板
  167. 'multidbfindtrigger[name=pd_prodcode]':{
  168. beforerender:function(f){
  169. Ext.apply(f,{
  170. dataUrl:'/api/document/product/list',
  171. // dataUrl:'http://localhost:9480/product/list',
  172. addXtype: 'document-product-formpanel',
  173. addTitle: '物料资料',
  174. dbfinds:[{
  175. from:'id',to:'pd_prodid'
  176. },{
  177. from:'pr_code',to:'pd_prodcode'
  178. },{
  179. from:'pr_detail',to:'pr_detail'
  180. },{
  181. from:'pr_spec',to:'pr_spec'
  182. },{
  183. from:'pr_whid',to:'pd_whid'
  184. },{
  185. from:'pr_whcode',to:'pd_whcode'
  186. },{
  187. from:'pr_whname',to:'pd_whname'
  188. }],
  189. dbtpls:[{
  190. field:'pr_code',width:100
  191. },{
  192. field:'pr_detail',width:100
  193. },{
  194. field:'pr_spec',width:100
  195. }],
  196. defaultCondition: "pr_statuscode='OPEN'",
  197. dbSearchFields:[{
  198. emptyText:'输入物料编号、名称或规格',
  199. xtype : "textfield",
  200. name : "search",
  201. width: 200,
  202. getCondition: function(v) {
  203. return "(upper(pr_spec) like '%" + v.toUpperCase()+"%' or upper(pr_code) like '%"+v.toUpperCase()+"%' or upper(pr_detail) like '%"+v.toUpperCase()+"%')";
  204. },
  205. allowBlank : true,
  206. columnWidth : 0.25
  207. }],
  208. dbColumns:[{
  209. "text": "物料ID",
  210. "hidden": true,
  211. "dataIndex": "id",
  212. },{
  213. "text": "物料编号",
  214. "dataIndex": "pr_code",
  215. "width": 100,
  216. "xtype": "",
  217. "items": null
  218. }, {
  219. "text": "物料名称",
  220. "width": 100,
  221. "dataIndex": "pr_detail",
  222. "xtype": "",
  223. "items": null
  224. }, {
  225. "text": "规格",
  226. "flex": 0,
  227. "dataIndex": "pr_spec",
  228. "width": 100,
  229. "xtype": "",
  230. "items": null
  231. }, {
  232. "text": "单位",
  233. "flex": 0,
  234. "dataIndex": "pr_spec",
  235. "width": 100,
  236. "xtype": "",
  237. "items": null
  238. },{
  239. "text": "仓库id",
  240. "flex": 0,
  241. "dataIndex": "pr_whid",
  242. "width": 0,
  243. "xtype": "",
  244. "items": null
  245. },{
  246. "text": "仓库编号",
  247. "flex": 0,
  248. "dataIndex": "pr_whcode",
  249. "width": 0,
  250. "xtype": "",
  251. "items": null
  252. },{
  253. "text": "仓库",
  254. "flex": 0,
  255. "dataIndex": "pr_whname",
  256. "width": 100,
  257. "xtype": "",
  258. "items": null
  259. },{
  260. "text": "总库存数",
  261. "flex": 0,
  262. "dataIndex": "po_onhand",
  263. "width": 100,
  264. "xtype": "",
  265. "items": null
  266. },{
  267. "text": "类型",
  268. "flex": 0,
  269. "dataIndex": "pr_kind",
  270. "width": 100,
  271. "xtype": "",
  272. "items": null
  273. },{
  274. "text": "型号",
  275. "flex": 0,
  276. "dataIndex": "pr_orispeccode",
  277. "width": 100,
  278. "xtype": "",
  279. "items": null
  280. },{
  281. "text": "品牌",
  282. "flex": 0,
  283. "dataIndex": "pr_brand",
  284. "width": 100,
  285. "xtype": "",
  286. "items": null
  287. },{
  288. "text": "供应商",
  289. "flex": 0,
  290. "dataIndex": "pr_vendname",
  291. "width": 100,
  292. "xtype": "",
  293. "items": null
  294. },{
  295. "text": "最小包装",
  296. "flex": 0,
  297. "dataIndex": "pr_zxbzs",
  298. "width": 100,
  299. "xtype": "",
  300. "items": null
  301. },{
  302. "text": "L/T",
  303. "flex": 0,
  304. "dataIndex": "pr_leadtime",
  305. "width": 100,
  306. "xtype": "",
  307. "items": null
  308. }]
  309. }) ;
  310. }
  311. },
  312. //放大镜赋值关系 以及 tpl模板
  313. 'dbfindtrigger[name=pd_whname]':{
  314. beforerender:function(f){
  315. Ext.apply(f,{
  316. dataUrl:'/api/document/warehouse/list',
  317. // dataUrl:'http://localhost:9480/warehouse/list',
  318. addXtype: 'other-warehouse',
  319. addTitle: '仓库资料',
  320. defaultCondition:"wh_statuscode='OPEN'",
  321. dbfinds:[{
  322. from:'id',to:'pd_whid'
  323. },{
  324. from:'wh_code',to:'pd_whcode'
  325. },{
  326. from:'wh_description',to:'pd_whname'
  327. }],
  328. dbtpls:[{
  329. field:'pd_whcode',width:100
  330. },{
  331. field:'pd_whname',width:100
  332. }],
  333. dbSearchFields:[{
  334. emptyText:'输入仓库编号或名称',
  335. xtype : "textfield",
  336. name : "wh_code",
  337. allowBlank : true,
  338. columnWidth : 0.25,
  339. getCondition:function(v){
  340. return "upper(wh_code) like '%"+v.toUpperCase()+"%' or upper(wh_description) like '%"+v.toUpperCase()+"%'";
  341. }
  342. }],
  343. dbColumns:[{
  344. "text": "仓库ID",
  345. "flex": 0,
  346. "dataIndex": "id",
  347. "width": 0,
  348. "xtype": "",
  349. "items": null
  350. },{
  351. "text": "仓库编号",
  352. "flex": 1,
  353. "dataIndex": "wh_code",
  354. "width": 100,
  355. "xtype": "",
  356. "items": null
  357. }, {
  358. "text": "仓库名称",
  359. "flex": 1,
  360. "dataIndex": "wh_description",
  361. "xtype": "",
  362. "items": null
  363. }, ]
  364. }) ;
  365. }
  366. },
  367. //放大镜赋值关系 以及 tpl模板
  368. 'dbfindtrigger[name=pd_inwhname]':{
  369. beforerender:function(f){
  370. Ext.apply(f,{
  371. dataUrl:'/api/document/warehouse/list',
  372. // dataUrl:'http://localhost:9480/warehouse/list',
  373. addXtype: 'other-warehouse',
  374. addTitle: '仓库资料',
  375. defaultCondition:"wh_statuscode='OPEN'",
  376. dbfinds:[{
  377. from:'id',to:'pd_inwhid'
  378. },{
  379. from:'wh_code',to:'pd_inwhcode'
  380. },{
  381. from:'wh_description',to:'pd_inwhname'
  382. }],
  383. dbtpls:[{
  384. field:'pd_inwhcode',width:100
  385. },{
  386. field:'pd_inwhname',width:100
  387. }],
  388. dbSearchFields:[{
  389. emptyText:'输入仓库编号或名称',
  390. xtype : "textfield",
  391. name : "wh_code",
  392. allowBlank : true,
  393. columnWidth : 0.25,
  394. getCondition:function(v){
  395. return "upper(wh_code) like '%"+v.toUpperCase()+"%' or upper(wh_description) like '%"+v.toUpperCase()+"%'";
  396. }
  397. }],
  398. dbColumns:[{
  399. "text": "仓库ID",
  400. "flex": 0,
  401. "dataIndex": "id",
  402. "width": 0,
  403. "xtype": "",
  404. "items": null
  405. },{
  406. "text": "仓库编号",
  407. "flex": 1,
  408. "dataIndex": "wh_code",
  409. "width": 100,
  410. "xtype": "",
  411. "items": null
  412. }, {
  413. "text": "仓库名称",
  414. "flex": 1,
  415. "dataIndex": "wh_description",
  416. "xtype": "",
  417. "items": null
  418. },{
  419. "text": "仓库类型",
  420. "flex": 1,
  421. "dataIndex": "wh_type",
  422. "xtype": "",
  423. "items": null
  424. }]
  425. }) ;
  426. }
  427. },
  428. //放大镜赋值关系 以及 tpl模板
  429. 'dbfindtrigger[name=pd_inwhname]':{
  430. beforerender:function(f){
  431. Ext.apply(f,{
  432. dataUrl:'/api/document/warehouse/list',
  433. // dataUrl:'http://localhost:9480/warehouse/list',
  434. dbfinds:[{
  435. from:'id',to:'pd_inwhid'
  436. },{
  437. from:'wh_code',to:'pd_inwhcode'
  438. },{
  439. from:'wh_description',to:'pd_inwhname'
  440. }],
  441. dbtpls:[{
  442. field:'pd_inwhcode',width:100
  443. },{
  444. field:'pd_inwhname',width:100
  445. }],
  446. dbColumns:[{
  447. "text": "仓库ID",
  448. "flex": 0,
  449. "dataIndex": "id",
  450. "width": 0,
  451. "xtype": "",
  452. "items": null
  453. },{
  454. "text": "仓库编号",
  455. "flex": 1,
  456. "dataIndex": "wh_code",
  457. "width": 100,
  458. "xtype": "",
  459. "items": null
  460. }, {
  461. "text": "仓库名称",
  462. "flex": 1,
  463. "dataIndex": "wh_description",
  464. "xtype": "",
  465. "items": null
  466. }, ]
  467. }) ;
  468. }
  469. }
  470. });
  471. },
  472. addCombo:function(){
  473. var combo=this.ownerCmp;
  474. Ext.create('Ext.window.Window',{
  475. layout:'vbox',
  476. bodyPadding: 15,
  477. width:500,
  478. items:[{
  479. fieldLabel:'实际值',
  480. xtype:'textfield'
  481. },{
  482. fieldLabel:'显示值',
  483. xtype:'textfield'
  484. }],
  485. buttons:[{
  486. text:'确认',
  487. handler:function(b){
  488. combo.setValue('ok');
  489. b.up('window').close();
  490. }
  491. }],
  492. renderTo:this.ownerCmp.ownerCt.getEl()
  493. }).show();
  494. }
  495. });