FormPanelController.js 18 KB

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