FormPanelController.js 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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. 'multidbfindtrigger[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_whid',to:'pd_whid'
  41. }, {
  42. from:'pr_whcode',to:'pd_whcode'
  43. }, {
  44. from:'pr_whname',to:'pd_whname'
  45. }, {
  46. from:'pr_saleprice',to:'pd_sendprice'
  47. }
  48. ],
  49. });
  50. }
  51. },
  52. 'dbfindtrigger[name=pd_whname]': {
  53. beforerender: function (f) {
  54. Ext.apply(f, {
  55. dbfinds: [{
  56. from: 'id',
  57. to: 'pd_whid',
  58. ignore: true
  59. }, {
  60. from: 'wh_code',
  61. to: 'pd_whcode'
  62. }, {
  63. from: 'wh_description',
  64. to: 'pd_whname'
  65. }],
  66. });
  67. }
  68. },
  69. 'remotecombo[name=pi_address]':{
  70. focus:function(f){
  71. //获取客户ID
  72. var pi_custid = f.ownerCt.down('[name=pi_custid]').value;
  73. if(pi_custid&&pi_custid!=""){
  74. Ext.apply(f.store.proxy.extraParams, {
  75. id:pi_custid
  76. });
  77. f.store.load();
  78. }else{
  79. saas.util.BaseUtil.showErrorToast('请先选择客户后在维护交货地址');
  80. f.setDisabled(true);
  81. }
  82. },
  83. expand:function(f){
  84. if(f.picker&&f.isExpanded){
  85. f.picker.setHeight(33*f.store.getCount())
  86. }
  87. }
  88. }
  89. });
  90. }
  91. });