FormPanelController.js 19 KB

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