FormPanelController.js 20 KB

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