FormPanelController.js 18 KB

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