FormPanelController.js 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. Ext.define('saas.view.sale.saleIn.FormPanelController', {
  2. extend: 'saas.view.core.form.FormPanelController',
  3. alias: 'controller.sale-salein-formpanel',
  4. init: function (form) {
  5. var me = this;
  6. this.control({
  7. //放大镜赋值关系 以及 tpl模板
  8. 'dbfindtrigger[name=pi_custname]': {
  9. beforerender: function (f) {
  10. Ext.apply(f, {
  11. dbfinds: [{
  12. from: 'id',
  13. to: 'pi_custid',
  14. ignore: true
  15. }, {
  16. from: 'cu_code',
  17. to: 'pi_custcode'
  18. }, {
  19. from: 'cu_name',
  20. to: 'pi_custname'
  21. }, {
  22. from: 'ca_address',
  23. to: 'pi_address'
  24. },{
  25. from:'cu_currency',to:'pi_currency'
  26. },{
  27. from:'cr_rate',to:'pi_rate'
  28. }],
  29. });
  30. }
  31. },
  32. 'productMultiDbfindTrigger[name=pd_prodcode]': {
  33. beforerender: function (f) {
  34. Ext.apply(f, {
  35. dbfinds: [{
  36. from: 'id', to: 'pd_prodid', ignore: true
  37. }, {
  38. from: 'pr_code', to: 'pd_prodcode'
  39. }, {
  40. from: 'pr_detail', to: 'pr_detail'
  41. }, {
  42. from: 'pr_spec', to: 'pr_spec'
  43. },{
  44. from: 'pr_brand', to: 'pr_brand'
  45. },{
  46. from: 'pr_orispeccode', to: 'pr_orispeccode'
  47. },{
  48. from: 'pr_unit', to: 'pr_unit'
  49. }, {
  50. from:'pr_whid',to:'pd_whid'
  51. }, {
  52. from:'pr_whcode',to:'pd_whcode'
  53. }, {
  54. from:'pr_whname',to:'pd_whname'
  55. }, {
  56. from:'pr_saleprice',to:'pd_sendprice'
  57. }
  58. ],
  59. });
  60. }
  61. },
  62. 'dbfindtrigger[name=pd_whname]': {
  63. beforerender: function (f) {
  64. Ext.apply(f, {
  65. dbfinds: [{
  66. from: 'id',
  67. to: 'pd_whid',
  68. ignore: true
  69. }, {
  70. from: 'wh_code',
  71. to: 'pd_whcode'
  72. }, {
  73. from: 'wh_description',
  74. to: 'pd_whname'
  75. }],
  76. });
  77. }
  78. },
  79. 'dbfindtrigger[name=pi_seller]': {
  80. beforerender: function (f) {
  81. Ext.apply(f, {
  82. dbfinds: [{
  83. from: 'id',
  84. to: 'pi_sellerid',
  85. ignore: true
  86. }, {
  87. from: 'em_code',
  88. to: 'pi_sellercode'
  89. }, {
  90. from: 'em_name',
  91. to: 'pi_seller'
  92. }],
  93. });
  94. }
  95. },
  96. 'remotecombo[name=pi_address]':{
  97. focus:function(f){
  98. //获取客户ID
  99. var pi_custid = f.ownerCt.down('[name=pi_custid]').value;
  100. if(pi_custid&&pi_custid!=""){
  101. Ext.apply(f.store.proxy.extraParams, {
  102. id:pi_custid
  103. });
  104. f.store.load();
  105. }else{
  106. saas.util.BaseUtil.showErrorToast('请先选择客户后在维护交货地址');
  107. f.setDisabled(true);
  108. }
  109. },
  110. expand:function(f){
  111. if(f.picker&&f.isExpanded){
  112. f.picker.setHeight(33*f.store.getCount())
  113. }
  114. }
  115. },
  116. // 'currencyDbfindTrigger[name=pi_currency]':{
  117. // beforerender:function(f){
  118. // Ext.apply(f,{
  119. // dbfinds:[{
  120. // from:'cr_name',to:'pi_currency'
  121. // },{
  122. // from:'cr_rate',to:'pi_rate'
  123. // }],
  124. // }) ;
  125. // }
  126. // },
  127. });
  128. }
  129. });