FormPanelController.js 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507
  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. //窗口字段设置
  198. dbSearchFields:[{
  199. emptyText:'输入物料编号、名称或规格',
  200. xtype : "textfield",
  201. name : "search",
  202. allowBlank : true,
  203. columnWidth : 0.25,
  204. getCondition:function(v){
  205. return "upper(pr_code) like '%"+v.toUpperCase()+"%' or upper(pr_detail) like '%"+v.toUpperCase()+"%' or upper(pr_spec) like '%"+v.toUpperCase()+"%'";
  206. }
  207. }],
  208. dbColumns:[{
  209. "text": "物料ID",
  210. "dataIndex": "id",
  211. "width": 0,
  212. "xtype": "",
  213. "items": null
  214. },{
  215. "text": "物料编号",
  216. "dataIndex": "pr_code",
  217. "width": 100,
  218. "xtype": "",
  219. "items": null
  220. }, {
  221. "text": "物料名称",
  222. "width": 100,
  223. "dataIndex": "pr_detail",
  224. "xtype": "",
  225. "items": null
  226. }, {
  227. "text": "规格",
  228. "flex": 0,
  229. "dataIndex": "pr_spec",
  230. "width": 100,
  231. "xtype": "",
  232. "items": null
  233. }, {
  234. "text": "单位",
  235. "flex": 0,
  236. "dataIndex": "pr_spec",
  237. "width": 100,
  238. "xtype": "",
  239. "items": null
  240. },{
  241. "text": "仓库id",
  242. "flex": 0,
  243. "dataIndex": "pr_whid",
  244. "width": 0,
  245. "xtype": "",
  246. "items": null
  247. },{
  248. "text": "仓库编号",
  249. "flex": 0,
  250. "dataIndex": "pr_whcode",
  251. "width": 0,
  252. "xtype": "",
  253. "items": null
  254. },{
  255. "text": "仓库",
  256. "flex": 0,
  257. "dataIndex": "pr_whname",
  258. "width": 100,
  259. "xtype": "",
  260. "items": null
  261. },{
  262. "text": "总库存数",
  263. "flex": 0,
  264. "dataIndex": "po_onhand",
  265. "width": 100,
  266. "xtype": "",
  267. "items": null
  268. },{
  269. "text": "类型",
  270. "flex": 0,
  271. "dataIndex": "pr_kind",
  272. "width": 100,
  273. "xtype": "",
  274. "items": null
  275. },{
  276. "text": "型号",
  277. "flex": 0,
  278. "dataIndex": "pr_orispeccode",
  279. "width": 100,
  280. "xtype": "",
  281. "items": null
  282. },{
  283. "text": "品牌",
  284. "flex": 0,
  285. "dataIndex": "pr_brand",
  286. "width": 100,
  287. "xtype": "",
  288. "items": null
  289. },{
  290. "text": "供应商",
  291. "flex": 0,
  292. "dataIndex": "pr_vendname",
  293. "width": 100,
  294. "xtype": "",
  295. "items": null
  296. },{
  297. "text": "最小包装",
  298. "flex": 0,
  299. "dataIndex": "pr_zxbzs",
  300. "width": 100,
  301. "xtype": "",
  302. "items": null
  303. },{
  304. "text": "L/T",
  305. "flex": 0,
  306. "dataIndex": "pr_leadtime",
  307. "width": 100,
  308. "xtype": "",
  309. "items": null
  310. }]
  311. }) ;
  312. }
  313. },
  314. //放大镜赋值关系 以及 tpl模板
  315. 'dbfindtrigger[name=pd_whname]':{
  316. beforerender:function(f){
  317. Ext.apply(f,{
  318. dataUrl:'/api/document/warehouse/list',
  319. // dataUrl:'http://localhost:9480/warehouse/list',
  320. addXtype: 'other-warehouse',
  321. addTitle: '仓库资料',
  322. defaultCondition:"wh_statuscode='OPEN'",
  323. dbfinds:[{
  324. from:'id',to:'pd_whid'
  325. },{
  326. from:'wh_code',to:'pd_whcode'
  327. },{
  328. from:'wh_description',to:'pd_whname'
  329. }],
  330. dbtpls:[{
  331. field:'pd_whcode',width:100
  332. },{
  333. field:'pd_whname',width:100
  334. }],
  335. dbSearchFields:[{
  336. emptyText:'输入仓库编号或名称',
  337. xtype : "textfield",
  338. name : "wh_code",
  339. allowBlank : true,
  340. columnWidth : 0.25,
  341. getCondition:function(v){
  342. return "upper(wh_code) like '%"+v.toUpperCase()+"%' or upper(wh_description) like '%"+v.toUpperCase()+"%'";
  343. }
  344. }],
  345. dbColumns:[{
  346. "text": "仓库ID",
  347. "flex": 0,
  348. "dataIndex": "id",
  349. "width": 0,
  350. "xtype": "",
  351. "items": null
  352. },{
  353. "text": "仓库编号",
  354. "flex": 1,
  355. "dataIndex": "wh_code",
  356. "width": 100,
  357. "xtype": "",
  358. "items": null
  359. }, {
  360. "text": "仓库名称",
  361. "flex": 1,
  362. "dataIndex": "wh_description",
  363. "xtype": "",
  364. "items": null
  365. }, ]
  366. }) ;
  367. }
  368. },
  369. //放大镜赋值关系 以及 tpl模板
  370. 'dbfindtrigger[name=pd_inwhname]':{
  371. beforerender:function(f){
  372. Ext.apply(f,{
  373. dataUrl:'/api/document/warehouse/list',
  374. // dataUrl:'http://localhost:9480/warehouse/list',
  375. addXtype: 'other-warehouse',
  376. addTitle: '仓库资料',
  377. defaultCondition:"wh_statuscode='OPEN'",
  378. dbfinds:[{
  379. from:'id',to:'pd_inwhid'
  380. },{
  381. from:'wh_code',to:'pd_inwhcode'
  382. },{
  383. from:'wh_description',to:'pd_inwhname'
  384. }],
  385. dbtpls:[{
  386. field:'pd_inwhcode',width:100
  387. },{
  388. field:'pd_inwhname',width:100
  389. }],
  390. dbSearchFields:[{
  391. emptyText:'输入仓库编号或名称',
  392. xtype : "textfield",
  393. name : "wh_code",
  394. allowBlank : true,
  395. columnWidth : 0.25,
  396. getCondition:function(v){
  397. return "upper(wh_code) like '%"+v.toUpperCase()+"%' or upper(wh_description) like '%"+v.toUpperCase()+"%'";
  398. }
  399. }],
  400. dbColumns:[{
  401. "text": "仓库ID",
  402. "flex": 0,
  403. "dataIndex": "id",
  404. "width": 0,
  405. "xtype": "",
  406. "items": null
  407. },{
  408. "text": "仓库编号",
  409. "flex": 1,
  410. "dataIndex": "wh_code",
  411. "width": 100,
  412. "xtype": "",
  413. "items": null
  414. }, {
  415. "text": "仓库名称",
  416. "flex": 1,
  417. "dataIndex": "wh_description",
  418. "xtype": "",
  419. "items": null
  420. },{
  421. "text": "仓库类型",
  422. "flex": 1,
  423. "dataIndex": "wh_type",
  424. "xtype": "",
  425. "items": null
  426. }]
  427. }) ;
  428. }
  429. },
  430. //放大镜赋值关系 以及 tpl模板
  431. 'dbfindtrigger[name=pd_inwhname]':{
  432. beforerender:function(f){
  433. Ext.apply(f,{
  434. dataUrl:'/api/document/warehouse/list',
  435. // dataUrl:'http://localhost:9480/warehouse/list',
  436. dbfinds:[{
  437. from:'id',to:'pd_inwhid'
  438. },{
  439. from:'wh_code',to:'pd_inwhcode'
  440. },{
  441. from:'wh_description',to:'pd_inwhname'
  442. }],
  443. dbtpls:[{
  444. field:'pd_inwhcode',width:100
  445. },{
  446. field:'pd_inwhname',width:100
  447. }],
  448. dbColumns:[{
  449. "text": "仓库ID",
  450. "flex": 0,
  451. "dataIndex": "id",
  452. "width": 0,
  453. "xtype": "",
  454. "items": null
  455. },{
  456. "text": "仓库编号",
  457. "flex": 1,
  458. "dataIndex": "wh_code",
  459. "width": 100,
  460. "xtype": "",
  461. "items": null
  462. }, {
  463. "text": "仓库名称",
  464. "flex": 1,
  465. "dataIndex": "wh_description",
  466. "xtype": "",
  467. "items": null
  468. }, ]
  469. }) ;
  470. }
  471. }
  472. });
  473. },
  474. addCombo:function(){
  475. var combo=this.ownerCmp;
  476. Ext.create('Ext.window.Window',{
  477. layout:'vbox',
  478. bodyPadding: 15,
  479. width:500,
  480. items:[{
  481. fieldLabel:'实际值',
  482. xtype:'textfield'
  483. },{
  484. fieldLabel:'显示值',
  485. xtype:'textfield'
  486. }],
  487. buttons:[{
  488. text:'确认',
  489. handler:function(b){
  490. combo.setValue('ok');
  491. b.up('window').close();
  492. }
  493. }],
  494. renderTo:this.ownerCmp.ownerCt.getEl()
  495. }).show();
  496. }
  497. });