FormPanelController.js 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428
  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. addXtype: 'other-warehouse',
  281. addTitle: '仓库资料',
  282. defaultCondition:"wh_statuscode='OPEN'",
  283. dbfinds:[{
  284. from:'id',to:'id',ignore:true
  285. },{
  286. from:'wh_code',to:'wh_code'
  287. },{
  288. from:'wh_description',to:'pd_whname'
  289. }],
  290. dbtpls:[{
  291. field:'pd_whcode',width:100
  292. },{
  293. field:'pd_whname',width:100
  294. }],
  295. dbSearchFields:[{
  296. emptyText:'输入仓库编号或名称',
  297. xtype : "textfield",
  298. name : "wh_code",
  299. allowBlank : true,
  300. columnWidth : 0.25,
  301. getCondition:function(v){
  302. return "(upper(wh_code) like '%"+v.toUpperCase()+"%' or upper(wh_description) like '%"+v.toUpperCase()+"%')";
  303. }
  304. }],
  305. dbColumns:[{
  306. "text": "仓库ID",
  307. "flex": 0,
  308. "dataIndex": "id",
  309. "width": 0,
  310. "xtype": "",
  311. "items": null
  312. },{
  313. "text": "仓库编号",
  314. "flex": 1,
  315. "dataIndex": "wh_code",
  316. "width": 100,
  317. "xtype": "",
  318. "items": null
  319. }, {
  320. "text": "仓库名称",
  321. "flex": 1,
  322. "dataIndex": "wh_description",
  323. "xtype": "",
  324. "items": null
  325. }, {
  326. "text": "仓库类型",
  327. "flex": 1,
  328. "dataIndex": "wh_type",
  329. "xtype": "",
  330. "items": null
  331. }]
  332. }) ;
  333. }
  334. },
  335. //放大镜赋值关系 以及 tpl模板
  336. 'dbfindtrigger[name=pd_inwhname]':{
  337. beforerender:function(f){
  338. Ext.apply(f,{
  339. dataUrl:'/api/document/warehouse/list',
  340. addXtype: 'other-warehouse',
  341. addTitle: '仓库资料',
  342. defaultCondition:"wh_statuscode='OPEN'",
  343. dbfinds:[{
  344. from:'id',to:'id',ignore:true
  345. },{
  346. from:'wh_code',to:'wh_code'
  347. },{
  348. from:'wh_description',to:'pd_inwhname'
  349. }],
  350. dbtpls:[{
  351. field:'pd_whcode',width:100
  352. },{
  353. field:'pd_whname',width:100
  354. }],
  355. dbSearchFields:[{
  356. emptyText:'输入仓库编号或名称',
  357. xtype : "textfield",
  358. name : "wh_code",
  359. allowBlank : true,
  360. columnWidth : 0.25,
  361. getCondition:function(v){
  362. return "(upper(wh_code) like '%"+v.toUpperCase()+"%' or upper(wh_description) like '%"+v.toUpperCase()+"%')";
  363. }
  364. }],
  365. dbColumns:[{
  366. "text": "仓库ID",
  367. "flex": 0,
  368. "dataIndex": "id",
  369. "width": 0,
  370. "xtype": "",
  371. "items": null
  372. },{
  373. "text": "仓库编号",
  374. "flex": 1,
  375. "dataIndex": "wh_code",
  376. "width": 100,
  377. "xtype": "",
  378. "items": null
  379. }, {
  380. "text": "仓库名称",
  381. "flex": 1,
  382. "dataIndex": "wh_description",
  383. "xtype": "",
  384. "items": null
  385. }, {
  386. "text": "仓库类型",
  387. "flex": 1,
  388. "dataIndex": "wh_type",
  389. "xtype": "",
  390. "items": null
  391. }]
  392. }) ;
  393. }
  394. }
  395. });
  396. },
  397. addCombo:function(){
  398. var combo=this.ownerCmp;
  399. Ext.create('Ext.window.Window',{
  400. layout:'vbox',
  401. bodyPadding: 15,
  402. width:500,
  403. items:[{
  404. fieldLabel:'实际值',
  405. xtype:'textfield'
  406. },{
  407. fieldLabel:'显示值',
  408. xtype:'textfield'
  409. }],
  410. buttons:[{
  411. text:'确认',
  412. handler:function(b){
  413. combo.setValue('ok');
  414. b.up('window').close();
  415. }
  416. }],
  417. renderTo:this.ownerCmp.ownerCt.getEl()
  418. }).show();
  419. }
  420. });