FormPanelController.js 19 KB

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