FormPanelController.js 19 KB

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