FormPanelController.js 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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. });
  26. }
  27. },
  28. 'productMultiDbfindTrigger[name=pd_prodcode]': {
  29. beforerender: function (f) {
  30. Ext.apply(f, {
  31. dbfinds: [{
  32. from: 'id', to: 'pd_prodid', ignore: true
  33. }, {
  34. from: 'pr_code', to: 'pd_prodcode'
  35. }, {
  36. from: 'pr_detail', to: 'pr_detail'
  37. }, {
  38. from: 'pr_spec', to: 'pr_spec'
  39. },{
  40. from: 'pr_brand', to: 'pr_brand'
  41. },{
  42. from: 'pr_orispeccode', to: 'pr_orispeccode'
  43. },{
  44. from: 'pr_unit', to: 'pr_unit'
  45. }, {
  46. from:'pr_whid',to:'pd_whid'
  47. }, {
  48. from:'pr_whcode',to:'pd_whcode'
  49. }, {
  50. from:'pr_whname',to:'pd_whname'
  51. }, {
  52. from:'pr_saleprice',to:'pd_sendprice'
  53. }
  54. ],
  55. });
  56. }
  57. },
  58. 'dbfindtrigger[name=pd_whname]': {
  59. beforerender: function (f) {
  60. Ext.apply(f, {
  61. dbfinds: [{
  62. from: 'id',
  63. to: 'pd_whid',
  64. ignore: true
  65. }, {
  66. from: 'wh_code',
  67. to: 'pd_whcode'
  68. }, {
  69. from: 'wh_description',
  70. to: 'pd_whname'
  71. }],
  72. });
  73. }
  74. },
  75. 'dbfindtrigger[name=pi_seller]': {
  76. beforerender: function (f) {
  77. Ext.apply(f, {
  78. dbfinds: [{
  79. from: 'id',
  80. to: 'pi_sellerid',
  81. ignore: true
  82. }, {
  83. from: 'em_code',
  84. to: 'pi_sellercode'
  85. }, {
  86. from: 'em_name',
  87. to: 'pi_seller'
  88. }],
  89. });
  90. }
  91. },
  92. 'remotecombo[name=pi_address]':{
  93. focus:function(f){
  94. //获取客户ID
  95. var pi_custid = f.ownerCt.down('[name=pi_custid]').value;
  96. if(pi_custid&&pi_custid!=""){
  97. Ext.apply(f.store.proxy.extraParams, {
  98. id:pi_custid
  99. });
  100. f.store.load();
  101. }else{
  102. saas.util.BaseUtil.showErrorToast('请先选择客户后在维护交货地址');
  103. f.setDisabled(true);
  104. }
  105. },
  106. expand:function(f){
  107. if(f.picker&&f.isExpanded){
  108. f.picker.setHeight(33*f.store.getCount())
  109. }
  110. }
  111. },
  112. // 'currencyDbfindTrigger[name=pi_currency]':{
  113. // beforerender:function(f){
  114. // Ext.apply(f,{
  115. // dbfinds:[{
  116. // from:'cr_name',to:'pi_currency'
  117. // },{
  118. // from:'cr_rate',to:'pi_rate'
  119. // }],
  120. // }) ;
  121. // }
  122. // },
  123. });
  124. }
  125. });