FormPanelController.js 20 KB

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