FormPanelController.js 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. Ext.define('saas.view.money.othreceipts.FormPanelController', {
  2. extend: 'saas.view.core.form.FormPanelController',
  3. alias: 'controller.money-othreceipts-formpanel',
  4. init: function (form) {
  5. var me = this;
  6. this.control({
  7. //放大镜赋值关系 以及 tpl模板
  8. 'dbfindtrigger[name=or_custname]': {
  9. beforerender: function (f) {
  10. Ext.apply(f, {
  11. dataUrl: '/api/document/customer/dbfind',
  12. addXtype: 'document-customer-formpanel',
  13. addTitle: '客户资料',
  14. defaultCondition: "cu_statuscode='OPEN'",
  15. dbfinds: [{
  16. from: 'id',
  17. to: 'or_custid'
  18. }, {
  19. from: 'cu_code',
  20. to: 'or_custcode'
  21. }, {
  22. from: 'cu_name',
  23. to: 'or_custname'
  24. }],
  25. dbtpls: [{
  26. field: 'cu_code',
  27. width: 100
  28. }, {
  29. field: 'cu_name',
  30. width: 100
  31. }],
  32. dbSearchFields: [{
  33. emptyText: '输入客户编号或客户名称',
  34. xtype: "textfield",
  35. name: "search",
  36. getCondition: function (v) {
  37. return "(upper(cu_code) like '%"+v.toUpperCase()+"%' or upper(cu_name) like '%"+v.toUpperCase()+"%')";
  38. },
  39. allowBlank: true,
  40. columnWidth: 0.25
  41. }],
  42. dbColumns: [{
  43. conditionCode: 'id',
  44. "text": "客户ID",
  45. "flex": 0,
  46. "dataIndex": "id",
  47. "width": 0,
  48. "xtype": "",
  49. "items": null
  50. }, {
  51. conditionCode: 'cu_code',
  52. "text": "客户编号",
  53. "flex": 1,
  54. "dataIndex": "cu_code",
  55. "width": 100,
  56. "xtype": "",
  57. "items": null
  58. }, {
  59. conditionCode: 'cu_name',
  60. "text": "客户名称",
  61. "flex": 1,
  62. "dataIndex": "cu_name",
  63. "xtype": "",
  64. "items": null
  65. }, {
  66. conditionCode: 'cu_type',
  67. "text": "客户类型",
  68. "flex": 1,
  69. "dataIndex": "cu_type",
  70. "width": 200,
  71. "xtype": "",
  72. "items": null
  73. }, {
  74. "text": "业务员编号",
  75. "flex": 1,
  76. "dataIndex": "cu_sellercode",
  77. "width": 100
  78. }, {
  79. "text": "业务员",
  80. "flex": 1,
  81. "dataIndex": "cu_sellername",
  82. "width": 100
  83. }, {
  84. "text": "税率",
  85. "flex": 1,
  86. "dataIndex": "cu_taxrate",
  87. "width": 100,
  88. align:'right'
  89. }, {
  90. "text": "承付天数",
  91. "flex": 1,
  92. "dataIndex": "cu_promisedays",
  93. "width": 100,
  94. align:'right'
  95. }, {
  96. "text": "额度",
  97. "flex": 1,
  98. "dataIndex": "cu_credit",
  99. "width": 100,
  100. align:'right'
  101. }, {
  102. "text": "客户地址",
  103. "flex": 1,
  104. "dataIndex": "ca_address",
  105. "width": 250
  106. }]
  107. });
  108. }
  109. },
  110. //放大镜赋值关系 以及 tpl模板
  111. 'dbfindtrigger[name=or_bankname]': {
  112. beforerender: function (f) {
  113. Ext.apply(f, {
  114. dataUrl: '/api/document/bankinformation/list',
  115. dbfinds: [{
  116. from: 'bk_bankcode',
  117. to: 'or_bankcode'
  118. }, {
  119. from: 'bk_bankname',
  120. to: 'or_bankname'
  121. }, {
  122. from: 'id',
  123. to: 'or_bankid'
  124. }],
  125. // defaultCondition: "bk_statuscode='OPEN'",
  126. dbtpls: [{
  127. field: 'bk_bankcode',
  128. width: 100
  129. }, {
  130. field: 'bk_bankname',
  131. width: 100
  132. }],
  133. dbSearchFields: [{
  134. emptyText: '输入银行账户编号或名称',
  135. xtype: "textfield",
  136. name: "search",
  137. getCondition: function (v) {
  138. return "(upper(bk_bankcode) like '%"+v.toUpperCase()+"%' or upper(bk_bankname) like '%"+v.toUpperCase()+"%')";
  139. },
  140. allowBlank: true,
  141. columnWidth: 0.25
  142. }],
  143. dbColumns: [{
  144. "text": "账户ID",
  145. "flex": 0,
  146. "dataIndex": "id",
  147. "width": 0,
  148. "xtype": ""
  149. }, {
  150. "text": "账户编号",
  151. "flex": 1,
  152. "dataIndex": "bk_bankcode",
  153. "width": 120,
  154. "xtype": ""
  155. }, {
  156. "text": "账户名称",
  157. "flex": 1,
  158. "dataIndex": "bk_bankname",
  159. "width": 150,
  160. "xtype": ""
  161. }, {
  162. "text": "账户类型",
  163. "flex": 1,
  164. "dataIndex": "bk_type",
  165. "width": 120,
  166. "xtype": ""
  167. }, {
  168. "text": "账户余额",
  169. "flex": 1,
  170. "dataIndex": "bk_thisamount",
  171. "width": 120,
  172. "xtype": ""
  173. }, {
  174. "text": "建帐日期",
  175. "flex": 1,
  176. "dataIndex": "bk_date",
  177. "width": 120,
  178. "xtype": "datecolumn"
  179. }]
  180. });
  181. }
  182. }
  183. });
  184. }
  185. });