FormPanelController.js 19 KB

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